@object-ui/plugin-gantt 3.0.1 → 3.0.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.
@@ -1,44 +1,44 @@
1
- (function(X,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("react"),require("@object-ui/core"),require("@object-ui/react"),require("@object-ui/components"),require("lucide-react")):typeof define=="function"&&define.amd?define(["exports","react","@object-ui/core","@object-ui/react","@object-ui/components","lucide-react"],K):(X=typeof globalThis<"u"?globalThis:X||self,K(X.ObjectUIPluginGantt={},X.React,X.ObjectUICore,X.ObjectUIReact,X.ObjectUIComponents,X.LucideReact))})(this,(function(X,K,_t,wt,G,xe){"use strict";function Xr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ne=Xr(K);var De={exports:{}},ze={};var St;function Qr(){if(St)return ze;St=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(i,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var c in o)c!=="key"&&(s[c]=o[c])}else s=o;return o=s.ref,{$$typeof:e,type:i,key:a,ref:o!==void 0?o:null,props:s}}return ze.Fragment=t,ze.jsx=r,ze.jsxs=r,ze}var Ae={};var kt;function ei(){return kt||(kt=1,process.env.NODE_ENV!=="production"&&(function(){function e(b){if(b==null)return null;if(typeof b=="function")return b.$$typeof===Oe?null:b.displayName||b.name||null;if(typeof b=="string")return b;switch(b){case q:return"Fragment";case se:return"Profiler";case re:return"StrictMode";case S:return"Suspense";case $:return"SuspenseList";case B:return"Activity"}if(typeof b=="object")switch(typeof b.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),b.$$typeof){case E:return"Portal";case D:return b.displayName||"Context";case J:return(b._context.displayName||"Context")+".Consumer";case C:var A=b.render;return b=b.displayName,b||(b=A.displayName||A.name||"",b=b!==""?"ForwardRef("+b+")":"ForwardRef"),b;case oe:return A=b.displayName||null,A!==null?A:e(b.type)||"Memo";case fe:A=b._payload,b=b._init;try{return e(b(A))}catch{}}return null}function t(b){return""+b}function r(b){try{t(b);var A=!1}catch{A=!0}if(A){A=console;var L=A.error,V=typeof Symbol=="function"&&Symbol.toStringTag&&b[Symbol.toStringTag]||b.constructor.name||"Object";return L.call(A,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",V),t(b)}}function i(b){if(b===q)return"<>";if(typeof b=="object"&&b!==null&&b.$$typeof===fe)return"<...>";try{var A=e(b);return A?"<"+A+">":"<...>"}catch{return"<...>"}}function o(){var b=me.A;return b===null?null:b.getOwner()}function s(){return Error("react-stack-top-frame")}function a(b){if(Ce.call(b,"key")){var A=Object.getOwnPropertyDescriptor(b,"key").get;if(A&&A.isReactWarning)return!1}return b.key!==void 0}function c(b,A){function L(){Pe||(Pe=!0,console.error("%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://react.dev/link/special-props)",A))}L.isReactWarning=!0,Object.defineProperty(b,"key",{get:L,configurable:!0})}function d(){var b=e(this.type);return tt[b]||(tt[b]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),b=this.props.ref,b!==void 0?b:null}function u(b,A,L,V,rt,vt){var W=L.ref;return b={$$typeof:j,type:b,key:A,props:L,_owner:V},(W!==void 0?W:null)!==null?Object.defineProperty(b,"ref",{enumerable:!1,get:d}):Object.defineProperty(b,"ref",{enumerable:!1,value:null}),b._store={},Object.defineProperty(b._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(b,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(b,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:rt}),Object.defineProperty(b,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:vt}),Object.freeze&&(Object.freeze(b.props),Object.freeze(b)),b}function h(b,A,L,V,rt,vt){var W=A.children;if(W!==void 0)if(V)if(gt(W)){for(V=0;V<W.length;V++)y(W[V]);Object.freeze&&Object.freeze(W)}else console.error("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 y(W);if(Ce.call(A,"key")){W=e(b);var ke=Object.keys(A).filter(function(Jl){return Jl!=="key"});V=0<ke.length?"{key: someKey, "+ke.join(": ..., ")+": ...}":"{key: someKey}",Yr[W+V]||(ke=0<ke.length?"{"+ke.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(X,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("react"),require("@object-ui/core"),require("@object-ui/react"),require("@object-ui/components"),require("lucide-react")):typeof define=="function"&&define.amd?define(["exports","react","@object-ui/core","@object-ui/react","@object-ui/components","lucide-react"],K):(X=typeof globalThis<"u"?globalThis:X||self,K(X.ObjectUIPluginGantt={},X.React,X.ObjectUICore,X.ObjectUIReact,X.ObjectUIComponents,X.LucideReact))})(this,(function(X,K,_t,wt,G,xe){"use strict";function Xi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const ne=Xi(K);var De={exports:{}},ze={};var St;function Qi(){if(St)return ze;St=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(o,r,s){var a=null;if(s!==void 0&&(a=""+s),r.key!==void 0&&(a=""+r.key),"key"in r){s={};for(var c in r)c!=="key"&&(s[c]=r[c])}else s=r;return r=s.ref,{$$typeof:e,type:o,key:a,ref:r!==void 0?r:null,props:s}}return ze.Fragment=t,ze.jsx=i,ze.jsxs=i,ze}var Ae={};var kt;function eo(){return kt||(kt=1,process.env.NODE_ENV!=="production"&&(function(){function e(b){if(b==null)return null;if(typeof b=="function")return b.$$typeof===Oe?null:b.displayName||b.name||null;if(typeof b=="string")return b;switch(b){case q:return"Fragment";case se:return"Profiler";case ie:return"StrictMode";case S:return"Suspense";case $:return"SuspenseList";case B:return"Activity"}if(typeof b=="object")switch(typeof b.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),b.$$typeof){case E:return"Portal";case Z:return b.displayName||"Context";case J:return(b._context.displayName||"Context")+".Consumer";case C:var A=b.render;return b=b.displayName,b||(b=A.displayName||A.name||"",b=b!==""?"ForwardRef("+b+")":"ForwardRef"),b;case re:return A=b.displayName||null,A!==null?A:e(b.type)||"Memo";case fe:A=b._payload,b=b._init;try{return e(b(A))}catch{}}return null}function t(b){return""+b}function i(b){try{t(b);var A=!1}catch{A=!0}if(A){A=console;var U=A.error,V=typeof Symbol=="function"&&Symbol.toStringTag&&b[Symbol.toStringTag]||b.constructor.name||"Object";return U.call(A,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",V),t(b)}}function o(b){if(b===q)return"<>";if(typeof b=="object"&&b!==null&&b.$$typeof===fe)return"<...>";try{var A=e(b);return A?"<"+A+">":"<...>"}catch{return"<...>"}}function r(){var b=me.A;return b===null?null:b.getOwner()}function s(){return Error("react-stack-top-frame")}function a(b){if(Ie.call(b,"key")){var A=Object.getOwnPropertyDescriptor(b,"key").get;if(A&&A.isReactWarning)return!1}return b.key!==void 0}function c(b,A){function U(){Pe||(Pe=!0,console.error("%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://react.dev/link/special-props)",A))}U.isReactWarning=!0,Object.defineProperty(b,"key",{get:U,configurable:!0})}function d(){var b=e(this.type);return tt[b]||(tt[b]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),b=this.props.ref,b!==void 0?b:null}function u(b,A,U,V,it,vt){var W=U.ref;return b={$$typeof:O,type:b,key:A,props:U,_owner:V},(W!==void 0?W:null)!==null?Object.defineProperty(b,"ref",{enumerable:!1,get:d}):Object.defineProperty(b,"ref",{enumerable:!1,value:null}),b._store={},Object.defineProperty(b._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(b,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(b,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:it}),Object.defineProperty(b,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:vt}),Object.freeze&&(Object.freeze(b.props),Object.freeze(b)),b}function v(b,A,U,V,it,vt){var W=A.children;if(W!==void 0)if(V)if(gt(W)){for(V=0;V<W.length;V++)y(W[V]);Object.freeze&&Object.freeze(W)}else console.error("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 y(W);if(Ie.call(A,"key")){W=e(b);var ke=Object.keys(A).filter(function(Jl){return Jl!=="key"});V=0<ke.length?"{key: someKey, "+ke.join(": ..., ")+": ...}":"{key: someKey}",Yi[W+V]||(ke=0<ke.length?"{"+ke.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,V,W,ke,W),Yr[W+V]=!0)}if(W=null,L!==void 0&&(r(L),W=""+L),a(A)&&(r(A.key),W=""+A.key),"key"in A){L={};for(var yt in A)yt!=="key"&&(L[yt]=A[yt])}else L=A;return W&&c(L,typeof b=="function"?b.displayName||b.name||"Unknown":b),u(b,W,L,o(),rt,vt)}function y(b){w(b)?b._store&&(b._store.validated=1):typeof b=="object"&&b!==null&&b.$$typeof===fe&&(b._payload.status==="fulfilled"?w(b._payload.value)&&b._payload.value._store&&(b._payload.value._store.validated=1):b._store&&(b._store.validated=1))}function w(b){return typeof b=="object"&&b!==null&&b.$$typeof===j}var x=K,j=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),re=Symbol.for("react.strict_mode"),se=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),D=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),oe=Symbol.for("react.memo"),fe=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),Oe=Symbol.for("react.client.reference"),me=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ce=Object.prototype.hasOwnProperty,gt=Array.isArray,Ie=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(b){return b()}};var Pe,tt={},Hr=x.react_stack_bottom_frame.bind(x,s)(),Kr=Ie(i(s)),Yr={};Ae.Fragment=q,Ae.jsx=function(b,A,L){var V=1e4>me.recentlyCreatedOwnerStacks++;return h(b,A,L,!1,V?Error("react-stack-top-frame"):Hr,V?Ie(i(b)):Kr)},Ae.jsxs=function(b,A,L){var V=1e4>me.recentlyCreatedOwnerStacks++;return h(b,A,L,!0,V?Error("react-stack-top-frame"):Hr,V?Ie(i(b)):Kr)}})()),Ae}var xt;function ti(){return xt||(xt=1,process.env.NODE_ENV==="production"?De.exports=Qr():De.exports=ei()),De.exports}var _=ti();function p(e,t,r){function i(c,d){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:d,constr:a,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,d);const u=a.prototype,h=Object.keys(u);for(let y=0;y<h.length;y++){const w=h[y];w in c||(c[w]=u[w].bind(c))}}const o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function a(c){var d;const u=r?.Parent?new s:this;i(u,c),(d=u._zod).deferred??(d.deferred=[]);for(const h of u._zod.deferred)h();return u}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>r?.Parent&&c instanceof r.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class ge extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class zt extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const At={};function ce(e){return At}function $t(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>t.indexOf(+i)===-1).map(([i,o])=>o)}function it(e,t){return typeof t=="bigint"?t.toString():t}function Ze(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ot(e){return e==null}function nt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ri(e,t){const r=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(i)){const d=i.match(/\d?e-(\d?)/);d?.[1]&&(o=Number.parseInt(d[1]))}const s=r>o?r:o,a=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return a%c/10**s}const Tt=Symbol("evaluating");function T(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==Tt)return i===void 0&&(i=Tt,i=r()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function be(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function le(...e){const t={};for(const r of e){const i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}function Et(e){return JSON.stringify(e)}function ii(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Nt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function $e(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const oi=Ze(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ve(e){if($e(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!($e(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function jt(e){return ve(e)?{...e}:Array.isArray(e)?[...e]:e}const ni=new Set(["string","number","symbol"]);function ye(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function de(e,t,r){const i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}function k(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function ai(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const si={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ci(e,t){const r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=le(e._zod.def,{get shape(){const a={};for(const c in t){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(a[c]=r.shape[c])}return be(this,"shape",a),a},checks:[]});return de(e,s)}function li(e,t){const r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=le(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const c in t){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete a[c]}return be(this,"shape",a),a},checks:[]});return de(e,s)}function di(e,t){if(!ve(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const s=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=le(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return be(this,"shape",s),s}});return de(e,o)}function ui(e,t){if(!ve(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=le(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return be(this,"shape",i),i}});return de(e,r)}function pi(e,t){const r=le(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return be(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return de(e,r)}function fi(e,t,r){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=le(t._zod.def,{get shape(){const c=t._zod.def.shape,d={...c};if(r)for(const u in r){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(d[u]=e?new e({type:"optional",innerType:c[u]}):c[u])}else for(const u in c)d[u]=e?new e({type:"optional",innerType:c[u]}):c[u];return be(this,"shape",d),d},checks:[]});return de(t,a)}function mi(e,t,r){const i=le(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(r)for(const a in r){if(!(a in s))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(s[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(const a in o)s[a]=new e({type:"nonoptional",innerType:o[a]});return be(this,"shape",s),s}});return de(t,i)}function _e(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function he(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function Re(e){return typeof e=="string"?e:e?.message}function ue(e,t,r){const i={...e,path:e.path??[]};if(!e.message){const o=Re(e.inst?._zod.def?.error?.(e))??Re(t?.error?.(e))??Re(r.customError?.(e))??Re(r.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function at(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Te(...e){const[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}const Ot=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,it,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ct=p("$ZodError",Ot),Fe=p("$ZodError",Ot,{Parent:Error});function bi(e,t=r=>r.message){const r={},i=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:r}}function hi(e,t=r=>r.message){const r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)r._errors.push(t(s));else{let a=r,c=0;for(;c<s.path.length;){const d=s.path[c];c===s.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(t(s))):a[d]=a[d]||{_errors:[]},a=a[d],c++}}};return i(e),r}const Me=e=>(t,r,i,o)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new ge;if(a.issues.length){const c=new(o?.Err??e)(a.issues.map(d=>ue(d,s,ce())));throw Nt(c,o?.callee),c}return a.value},It=Me(Fe),Le=e=>async(t,r,i,o)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const c=new(o?.Err??e)(a.issues.map(d=>ue(d,s,ce())));throw Nt(c,o?.callee),c}return a.value},Pt=Le(Fe),Ue=e=>(t,r,i)=>{const o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ge;return s.issues.length?{success:!1,error:new(e??Ct)(s.issues.map(a=>ue(a,o,ce())))}:{success:!0,data:s.value}},gi=Ue(Fe),Ve=e=>async(t,r,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>ue(a,o,ce())))}:{success:!0,data:s.value}},vi=Ve(Fe),yi=e=>(t,r,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Me(e)(t,r,o)},_i=e=>(t,r,i)=>Me(e)(t,r,i),wi=e=>async(t,r,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Le(e)(t,r,o)},Si=e=>async(t,r,i)=>Le(e)(t,r,i),ki=e=>(t,r,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Ue(e)(t,r,o)},xi=e=>(t,r,i)=>Ue(e)(t,r,i),zi=e=>async(t,r,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Ve(e)(t,r,o)},Ai=e=>async(t,r,i)=>Ve(e)(t,r,i),$i=/^[cC][^\s-]{8,}$/,Ti=/^[0-9a-z]+$/,Ei=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ni=/^[0-9a-vA-V]{20}$/,ji=/^[A-Za-z0-9]{27}$/,Oi=/^[a-zA-Z0-9_-]{21}$/,Ci=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ii=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Dt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Pi=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Di="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Zi(){return new RegExp(Di,"u")}const Ri=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Fi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Mi=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Li=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ui=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Zt=/^[A-Za-z0-9_-]*$/,Vi=/^\+[1-9]\d{6,14}$/,Rt="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Wi=new RegExp(`^${Rt}$`);function Ft(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function qi(e){return new RegExp(`^${Ft(e)}$`)}function Ji(e){const t=Ft({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${r.join("|")})`;return new RegExp(`^${Rt}T(?:${i})$`)}const Gi=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Bi=/^-?\d+$/,Mt=/^-?\d+(?:\.\d+)?$/,Hi=/^(?:true|false)$/i,Ki=/^[^A-Z]*$/,Yi=/^[^a-z]*$/,Y=p("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Lt={number:"number",bigint:"bigint",object:"date"},Ut=p("$ZodCheckLessThan",(e,t)=>{Y.init(e,t);const r=Lt[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Vt=p("$ZodCheckGreaterThan",(e,t)=>{Y.init(e,t);const r=Lt[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xi=p("$ZodCheckMultipleOf",(e,t)=>{Y.init(e,t),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):ri(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Qi=p("$ZodCheckNumberFormat",(e,t)=>{Y.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),i=r?"int":"number",[o,s]=si[t.format];e._zod.onattach.push(a=>{const c=a._zod.bag;c.format=t.format,c.minimum=o,c.maximum=s,r&&(c.pattern=Bi)}),e._zod.check=a=>{const c=a.value;if(r){if(!Number.isInteger(c)){a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}c<o&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>s&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),eo=p("$ZodCheckMaxLength",(e,t)=>{var r;Y.init(e,t),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!ot(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{const o=i.value;if(o.length<=t.maximum)return;const a=at(o);i.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),to=p("$ZodCheckMinLength",(e,t)=>{var r;Y.init(e,t),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!ot(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=t.minimum)return;const a=at(o);i.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ro=p("$ZodCheckLengthEquals",(e,t)=>{var r;Y.init(e,t),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!ot(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=i=>{const o=i.value,s=o.length;if(s===t.length)return;const a=at(o),c=s>t.length;i.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),We=p("$ZodCheckStringFormat",(e,t)=>{var r,i;Y.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),io=p("$ZodCheckRegex",(e,t)=>{We.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),oo=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ki),We.init(e,t)}),no=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Yi),We.init(e,t)}),ao=p("$ZodCheckIncludes",(e,t)=>{Y.init(e,t);const r=ye(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),so=p("$ZodCheckStartsWith",(e,t)=>{Y.init(e,t);const r=new RegExp(`^${ye(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),co=p("$ZodCheckEndsWith",(e,t)=>{Y.init(e,t);const r=new RegExp(`.*${ye(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),lo=p("$ZodCheckOverwrite",(e,t)=>{Y.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class uo{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(`
7
- `).filter(a=>a),o=Math.min(...i.map(a=>a.length-a.trimStart().length)),s=i.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(const a of s)this.content.push(a)}compile(){const t=Function,r=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...r,o.join(`
8
- `))}}const po={major:4,minor:3,patch:6},N=p("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=po;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const s of o._zod.onattach)s(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(a,c,d)=>{let u=_e(a),h;for(const y of c){if(y._zod.def.when){if(!y._zod.def.when(a))continue}else if(u)continue;const w=a.issues.length,x=y._zod.check(a);if(x instanceof Promise&&d?.async===!1)throw new ge;if(h||x instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await x,a.issues.length!==w&&(u||(u=_e(a,w)))});else{if(a.issues.length===w)continue;u||(u=_e(a,w))}}return h?h.then(()=>a):a},s=(a,c,d)=>{if(_e(a))return a.aborted=!0,a;const u=o(c,i,d);if(u instanceof Promise){if(d.async===!1)throw new ge;return u.then(h=>e._zod.parse(h,d))}return e._zod.parse(u,d)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){const u=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(h=>s(h,a,c)):s(u,a,c)}const d=e._zod.parse(a,c);if(d instanceof Promise){if(c.async===!1)throw new ge;return d.then(u=>o(u,i,c))}return o(d,i,c)}}T(e,"~standard",()=>({validate:o=>{try{const s=gi(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return vi(e,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),st=p("$ZodString",(e,t)=>{N.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Gi(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Z=p("$ZodStringFormat",(e,t)=>{We.init(e,t),st.init(e,t)}),fo=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ii),Z.init(e,t)}),mo=p("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Dt(i))}else t.pattern??(t.pattern=Dt());Z.init(e,t)}),bo=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Pi),Z.init(e,t)}),ho=p("$ZodURL",(e,t)=>{Z.init(e,t),e._zod.check=r=>{try{const i=r.value.trim(),o=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),go=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Zi()),Z.init(e,t)}),vo=p("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Oi),Z.init(e,t)}),yo=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=$i),Z.init(e,t)}),_o=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ti),Z.init(e,t)}),wo=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ei),Z.init(e,t)}),So=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ni),Z.init(e,t)}),ko=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ji),Z.init(e,t)}),xo=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ji(t)),Z.init(e,t)}),zo=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Wi),Z.init(e,t)}),Ao=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=qi(t)),Z.init(e,t)}),$o=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ci),Z.init(e,t)}),To=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ri),Z.init(e,t),e._zod.bag.format="ipv4"}),Eo=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Fi),Z.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),No=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Mi),Z.init(e,t)}),jo=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Li),Z.init(e,t),e._zod.check=r=>{const i=r.value.split("/");try{if(i.length!==2)throw new Error;const[o,s]=i;if(!s)throw new Error;const a=Number(s);if(`${a}`!==s)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Wt(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Oo=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ui),Z.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Wt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Co(e){if(!Zt.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Wt(r)}const Io=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Zt),Z.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Co(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Po=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Vi),Z.init(e,t)});function Do(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[i]=r;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Zo=p("$ZodJWT",(e,t)=>{Z.init(e,t),e._zod.check=r=>{Do(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),qt=p("$ZodNumber",(e,t)=>{N.init(e,t),e._zod.pattern=e._zod.bag.pattern??Mt,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),Ro=p("$ZodNumberFormat",(e,t)=>{Qi.init(e,t),qt.init(e,t)}),Fo=p("$ZodBoolean",(e,t)=>{N.init(e,t),e._zod.pattern=Hi,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}const o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Mo=p("$ZodAny",(e,t)=>{N.init(e,t),e._zod.parse=r=>r}),Lo=p("$ZodUnknown",(e,t)=>{N.init(e,t),e._zod.parse=r=>r}),Uo=p("$ZodNever",(e,t)=>{N.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Vo=p("$ZodVoid",(e,t)=>{N.init(e,t),e._zod.parse=(r,i)=>{const o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),Wo=p("$ZodDate",(e,t)=>{N.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}const o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Jt(e,t,r){e.issues.length&&t.issues.push(...he(r,e.issues)),t.value[r]=e.value}const qo=p("$ZodArray",(e,t)=>{N.init(e,t),e._zod.parse=(r,i)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const s=[];for(let a=0;a<o.length;a++){const c=o[a],d=t.element._zod.run({value:c,issues:[]},i);d instanceof Promise?s.push(d.then(u=>Jt(u,r,a))):Jt(d,r,a)}return s.length?Promise.all(s).then(()=>r):r}});function qe(e,t,r,i,o){if(e.issues.length){if(o&&!(r in i))return;t.issues.push(...he(r,e.issues))}e.value===void 0?r in i&&(t.value[r]=void 0):t.value[r]=e.value}function Gt(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const r=ai(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Bt(e,t,r,i,o,s){const a=[],c=o.keySet,d=o.catchall._zod,u=d.def.type,h=d.optout==="optional";for(const y in t){if(c.has(y))continue;if(u==="never"){a.push(y);continue}const w=d.run({value:t[y],issues:[]},i);w instanceof Promise?e.push(w.then(x=>qe(x,r,y,t,h))):qe(w,r,y,t,h)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}const Jo=p("$ZodObject",(e,t)=>{if(N.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...c};return Object.defineProperty(t,"shape",{value:d}),d}})}const i=Ze(()=>Gt(t));T(e._zod,"propValues",()=>{const c=t.shape,d={};for(const u in c){const h=c[u]._zod;if(h.values){d[u]??(d[u]=new Set);for(const y of h.values)d[u].add(y)}}return d});const o=$e,s=t.catchall;let a;e._zod.parse=(c,d)=>{a??(a=i.value);const u=c.value;if(!o(u))return c.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),c;c.value={};const h=[],y=a.shape;for(const w of a.keys){const x=y[w],j=x._zod.optout==="optional",E=x._zod.run({value:u[w],issues:[]},d);E instanceof Promise?h.push(E.then(q=>qe(q,c,w,u,j))):qe(E,c,w,u,j)}return s?Bt(h,u,c,d,i.value,e):h.length?Promise.all(h).then(()=>c):c}}),Go=p("$ZodObjectJIT",(e,t)=>{Jo.init(e,t);const r=e._zod.parse,i=Ze(()=>Gt(t)),o=w=>{const x=new uo(["shape","payload","ctx"]),j=i.value,E=J=>{const D=Et(J);return`shape[${D}]._zod.run({ value: input[${D}], issues: [] }, ctx)`};x.write("const input = payload.value;");const q=Object.create(null);let re=0;for(const J of j.keys)q[J]=`key_${re++}`;x.write("const newResult = {};");for(const J of j.keys){const D=q[J],C=Et(J),$=w[J]?._zod?.optout==="optional";x.write(`const ${D} = ${E(J)};`),$?x.write(`
9
- if (${D}.issues.length) {
6
+ <%s key={someKey} {...props} />`,V,W,ke,W),Yi[W+V]=!0)}if(W=null,U!==void 0&&(i(U),W=""+U),a(A)&&(i(A.key),W=""+A.key),"key"in A){U={};for(var yt in A)yt!=="key"&&(U[yt]=A[yt])}else U=A;return W&&c(U,typeof b=="function"?b.displayName||b.name||"Unknown":b),u(b,W,U,r(),it,vt)}function y(b){w(b)?b._store&&(b._store.validated=1):typeof b=="object"&&b!==null&&b.$$typeof===fe&&(b._payload.status==="fulfilled"?w(b._payload.value)&&b._payload.value._store&&(b._payload.value._store.validated=1):b._store&&(b._store.validated=1))}function w(b){return typeof b=="object"&&b!==null&&b.$$typeof===O}var z=K,O=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),ie=Symbol.for("react.strict_mode"),se=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),Z=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),re=Symbol.for("react.memo"),fe=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),Oe=Symbol.for("react.client.reference"),me=z.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ie=Object.prototype.hasOwnProperty,gt=Array.isArray,Ce=console.createTask?console.createTask:function(){return null};z={react_stack_bottom_frame:function(b){return b()}};var Pe,tt={},Hi=z.react_stack_bottom_frame.bind(z,s)(),Ki=Ce(o(s)),Yi={};Ae.Fragment=q,Ae.jsx=function(b,A,U){var V=1e4>me.recentlyCreatedOwnerStacks++;return v(b,A,U,!1,V?Error("react-stack-top-frame"):Hi,V?Ce(o(b)):Ki)},Ae.jsxs=function(b,A,U){var V=1e4>me.recentlyCreatedOwnerStacks++;return v(b,A,U,!0,V?Error("react-stack-top-frame"):Hi,V?Ce(o(b)):Ki)}})()),Ae}var xt;function to(){return xt||(xt=1,process.env.NODE_ENV==="production"?De.exports=Qi():De.exports=eo()),De.exports}var _=to();function p(e,t,i){function o(c,d){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:d,constr:a,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,d);const u=a.prototype,v=Object.keys(u);for(let y=0;y<v.length;y++){const w=v[y];w in c||(c[w]=u[w].bind(c))}}const r=i?.Parent??Object;class s extends r{}Object.defineProperty(s,"name",{value:e});function a(c){var d;const u=i?.Parent?new s:this;o(u,c),(d=u._zod).deferred??(d.deferred=[]);for(const v of u._zod.deferred)v();return u}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>i?.Parent&&c instanceof i.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class ge extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class zt extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const At={};function ce(e){return At}function $t(e){const t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function ot(e,t){return typeof t=="bigint"?t.toString():t}function Ze(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function rt(e){return e==null}function nt(e){const t=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}function io(e,t){const i=(e.toString().split(".")[1]||"").length,o=t.toString();let r=(o.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(o)){const d=o.match(/\d?e-(\d?)/);d?.[1]&&(r=Number.parseInt(d[1]))}const s=i>r?i:r,a=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return a%c/10**s}const Tt=Symbol("evaluating");function T(e,t,i){let o;Object.defineProperty(e,t,{get(){if(o!==Tt)return o===void 0&&(o=Tt,o=i()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function be(e,t,i){Object.defineProperty(e,t,{value:i,writable:!0,enumerable:!0,configurable:!0})}function le(...e){const t={};for(const i of e){const o=Object.getOwnPropertyDescriptors(i);Object.assign(t,o)}return Object.defineProperties({},t)}function Et(e){return JSON.stringify(e)}function oo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Nt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function $e(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const ro=Ze(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ve(e){if($e(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const i=t.prototype;return!($e(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function jt(e){return ve(e)?{...e}:Array.isArray(e)?[...e]:e}const no=new Set(["string","number","symbol"]);function ye(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function de(e,t,i){const o=new e._zod.constr(t??e._zod.def);return(!t||i?.parent)&&(o._zod.parent=e),o}function k(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function ao(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const so={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function co(e,t){const i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=le(e._zod.def,{get shape(){const a={};for(const c in t){if(!(c in i.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(a[c]=i.shape[c])}return be(this,"shape",a),a},checks:[]});return de(e,s)}function lo(e,t){const i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=le(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const c in t){if(!(c in i.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete a[c]}return be(this,"shape",a),a},checks:[]});return de(e,s)}function uo(e,t){if(!ve(t))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const s=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=le(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return be(this,"shape",s),s}});return de(e,r)}function po(e,t){if(!ve(t))throw new Error("Invalid input to safeExtend: expected a plain object");const i=le(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return be(this,"shape",o),o}});return de(e,i)}function fo(e,t){const i=le(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return be(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return de(e,i)}function mo(e,t,i){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=le(t._zod.def,{get shape(){const c=t._zod.def.shape,d={...c};if(i)for(const u in i){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);i[u]&&(d[u]=e?new e({type:"optional",innerType:c[u]}):c[u])}else for(const u in c)d[u]=e?new e({type:"optional",innerType:c[u]}):c[u];return be(this,"shape",d),d},checks:[]});return de(t,a)}function bo(e,t,i){const o=le(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(i)for(const a in i){if(!(a in s))throw new Error(`Unrecognized key: "${a}"`);i[a]&&(s[a]=new e({type:"nonoptional",innerType:r[a]}))}else for(const a in r)s[a]=new e({type:"nonoptional",innerType:r[a]});return be(this,"shape",s),s}});return de(t,o)}function _e(e,t=0){if(e.aborted===!0)return!0;for(let i=t;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function he(e,t){return t.map(i=>{var o;return(o=i).path??(o.path=[]),i.path.unshift(e),i})}function Re(e){return typeof e=="string"?e:e?.message}function ue(e,t,i){const o={...e,path:e.path??[]};if(!e.message){const r=Re(e.inst?._zod.def?.error?.(e))??Re(t?.error?.(e))??Re(i.customError?.(e))??Re(i.localeError?.(e))??"Invalid input";o.message=r}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function at(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Te(...e){const[t,i,o]=e;return typeof t=="string"?{message:t,code:"custom",input:i,inst:o}:{...t}}const Ot=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ot,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},It=p("$ZodError",Ot),Fe=p("$ZodError",Ot,{Parent:Error});function ho(e,t=i=>i.message){const i={},o=[];for(const r of e.issues)r.path.length>0?(i[r.path[0]]=i[r.path[0]]||[],i[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:i}}function go(e,t=i=>i.message){const i={_errors:[]},o=r=>{for(const s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>o({issues:a}));else if(s.code==="invalid_key")o({issues:s.issues});else if(s.code==="invalid_element")o({issues:s.issues});else if(s.path.length===0)i._errors.push(t(s));else{let a=i,c=0;for(;c<s.path.length;){const d=s.path[c];c===s.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(t(s))):a[d]=a[d]||{_errors:[]},a=a[d],c++}}};return o(e),i}const Me=e=>(t,i,o,r)=>{const s=o?Object.assign(o,{async:!1}):{async:!1},a=t._zod.run({value:i,issues:[]},s);if(a instanceof Promise)throw new ge;if(a.issues.length){const c=new(r?.Err??e)(a.issues.map(d=>ue(d,s,ce())));throw Nt(c,r?.callee),c}return a.value},Ct=Me(Fe),Le=e=>async(t,i,o,r)=>{const s=o?Object.assign(o,{async:!0}):{async:!0};let a=t._zod.run({value:i,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const c=new(r?.Err??e)(a.issues.map(d=>ue(d,s,ce())));throw Nt(c,r?.callee),c}return a.value},Pt=Le(Fe),Ue=e=>(t,i,o)=>{const r=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:i,issues:[]},r);if(s instanceof Promise)throw new ge;return s.issues.length?{success:!1,error:new(e??It)(s.issues.map(a=>ue(a,r,ce())))}:{success:!0,data:s.value}},vo=Ue(Fe),Ve=e=>async(t,i,o)=>{const r=o?Object.assign(o,{async:!0}):{async:!0};let s=t._zod.run({value:i,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>ue(a,r,ce())))}:{success:!0,data:s.value}},yo=Ve(Fe),_o=e=>(t,i,o)=>{const r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Me(e)(t,i,r)},wo=e=>(t,i,o)=>Me(e)(t,i,o),So=e=>async(t,i,o)=>{const r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Le(e)(t,i,r)},ko=e=>async(t,i,o)=>Le(e)(t,i,o),xo=e=>(t,i,o)=>{const r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ue(e)(t,i,r)},zo=e=>(t,i,o)=>Ue(e)(t,i,o),Ao=e=>async(t,i,o)=>{const r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ve(e)(t,i,r)},$o=e=>async(t,i,o)=>Ve(e)(t,i,o),To=/^[cC][^\s-]{8,}$/,Eo=/^[0-9a-z]+$/,No=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,jo=/^[0-9a-vA-V]{20}$/,Oo=/^[A-Za-z0-9]{27}$/,Io=/^[a-zA-Z0-9_-]{21}$/,Co=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Po=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Dt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Do=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Zo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ro(){return new RegExp(Zo,"u")}const Fo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Mo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Lo=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Uo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Vo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Zt=/^[A-Za-z0-9_-]*$/,Wo=/^\+[1-9]\d{6,14}$/,Rt="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",qo=new RegExp(`^${Rt}$`);function Ft(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Jo(e){return new RegExp(`^${Ft(e)}$`)}function Go(e){const t=Ft({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${t}(?:${i.join("|")})`;return new RegExp(`^${Rt}T(?:${o})$`)}const Bo=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ho=/^-?\d+$/,Mt=/^-?\d+(?:\.\d+)?$/,Ko=/^(?:true|false)$/i,Yo=/^[^A-Z]*$/,Xo=/^[^a-z]*$/,Y=p("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),Lt={number:"number",bigint:"bigint",object:"date"},Ut=p("$ZodCheckLessThan",(e,t)=>{Y.init(e,t);const i=Lt[typeof t.value];e._zod.onattach.push(o=>{const r=o._zod.bag,s=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:i,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Vt=p("$ZodCheckGreaterThan",(e,t)=>{Y.init(e,t);const i=Lt[typeof t.value];e._zod.onattach.push(o=>{const r=o._zod.bag,s=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:i,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Qo=p("$ZodCheckMultipleOf",(e,t)=>{Y.init(e,t),e._zod.onattach.push(i=>{var o;(o=i._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=i=>{if(typeof i.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%t.value===BigInt(0):io(i.value,t.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:t.value,input:i.value,inst:e,continue:!t.abort})}}),er=p("$ZodCheckNumberFormat",(e,t)=>{Y.init(e,t),t.format=t.format||"float64";const i=t.format?.includes("int"),o=i?"int":"number",[r,s]=so[t.format];e._zod.onattach.push(a=>{const c=a._zod.bag;c.format=t.format,c.minimum=r,c.maximum=s,i&&(c.pattern=Ho)}),e._zod.check=a=>{const c=a.value;if(i){if(!Number.isInteger(c)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}c<r&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),c>s&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),tr=p("$ZodCheckMaxLength",(e,t)=>{var i;Y.init(e,t),(i=e._zod.def).when??(i.when=o=>{const r=o.value;return!rt(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const r=o.value;if(r.length<=t.maximum)return;const a=at(r);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ir=p("$ZodCheckMinLength",(e,t)=>{var i;Y.init(e,t),(i=e._zod.def).when??(i.when=o=>{const r=o.value;return!rt(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const r=o.value;if(r.length>=t.minimum)return;const a=at(r);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),or=p("$ZodCheckLengthEquals",(e,t)=>{var i;Y.init(e,t),(i=e._zod.def).when??(i.when=o=>{const r=o.value;return!rt(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{const r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=o=>{const r=o.value,s=r.length;if(s===t.length)return;const a=at(r),c=s>t.length;o.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),We=p("$ZodCheckStringFormat",(e,t)=>{var i,o;Y.init(e,t),e._zod.onattach.push(r=>{const s=r._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(i=e._zod).check??(i.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),rr=p("$ZodCheckRegex",(e,t)=>{We.init(e,t),e._zod.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),nr=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Yo),We.init(e,t)}),ar=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Xo),We.init(e,t)}),sr=p("$ZodCheckIncludes",(e,t)=>{Y.init(e,t);const i=ye(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${i}`:i);t.pattern=o,e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),cr=p("$ZodCheckStartsWith",(e,t)=>{Y.init(e,t);const i=new RegExp(`^${ye(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(o=>{const r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),lr=p("$ZodCheckEndsWith",(e,t)=>{Y.init(e,t);const i=new RegExp(`.*${ye(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(o=>{const r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}}),dr=p("$ZodCheckOverwrite",(e,t)=>{Y.init(e,t),e._zod.check=i=>{i.value=t.tx(i.value)}});class ur{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const o=t.split(`
7
+ `).filter(a=>a),r=Math.min(...o.map(a=>a.length-a.trimStart().length)),s=o.map(a=>a.slice(r)).map(a=>" ".repeat(this.indent*2)+a);for(const a of s)this.content.push(a)}compile(){const t=Function,i=this?.args,r=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...i,r.join(`
8
+ `))}}const pr={major:4,minor:3,patch:6},N=p("$ZodType",(e,t)=>{var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=pr;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const r of o)for(const s of r._zod.onattach)s(e);if(o.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(a,c,d)=>{let u=_e(a),v;for(const y of c){if(y._zod.def.when){if(!y._zod.def.when(a))continue}else if(u)continue;const w=a.issues.length,z=y._zod.check(a);if(z instanceof Promise&&d?.async===!1)throw new ge;if(v||z instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await z,a.issues.length!==w&&(u||(u=_e(a,w)))});else{if(a.issues.length===w)continue;u||(u=_e(a,w))}}return v?v.then(()=>a):a},s=(a,c,d)=>{if(_e(a))return a.aborted=!0,a;const u=r(c,o,d);if(u instanceof Promise){if(d.async===!1)throw new ge;return u.then(v=>e._zod.parse(v,d))}return e._zod.parse(u,d)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){const u=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(v=>s(v,a,c)):s(u,a,c)}const d=e._zod.parse(a,c);if(d instanceof Promise){if(c.async===!1)throw new ge;return d.then(u=>r(u,o,c))}return r(d,o,c)}}T(e,"~standard",()=>({validate:r=>{try{const s=vo(e,r);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return yo(e,r).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),st=p("$ZodString",(e,t)=>{N.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Bo(e._zod.bag),e._zod.parse=(i,o)=>{if(t.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),R=p("$ZodStringFormat",(e,t)=>{We.init(e,t),st.init(e,t)}),fr=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Po),R.init(e,t)}),mr=p("$ZodUUID",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Dt(o))}else t.pattern??(t.pattern=Dt());R.init(e,t)}),br=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Do),R.init(e,t)}),hr=p("$ZodURL",(e,t)=>{R.init(e,t),e._zod.check=i=>{try{const o=i.value.trim(),r=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:i.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:i.value,inst:e,continue:!t.abort})),t.normalize?i.value=r.href:i.value=o;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),gr=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ro()),R.init(e,t)}),vr=p("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Io),R.init(e,t)}),yr=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=To),R.init(e,t)}),_r=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Eo),R.init(e,t)}),wr=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=No),R.init(e,t)}),Sr=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=jo),R.init(e,t)}),kr=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Oo),R.init(e,t)}),xr=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Go(t)),R.init(e,t)}),zr=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=qo),R.init(e,t)}),Ar=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Jo(t)),R.init(e,t)}),$r=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Co),R.init(e,t)}),Tr=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Fo),R.init(e,t),e._zod.bag.format="ipv4"}),Er=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Mo),R.init(e,t),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!t.abort})}}}),Nr=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Lo),R.init(e,t)}),jr=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Uo),R.init(e,t),e._zod.check=i=>{const o=i.value.split("/");try{if(o.length!==2)throw new Error;const[r,s]=o;if(!s)throw new Error;const a=Number(s);if(`${a}`!==s)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${r}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!t.abort})}}});function Wt(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Or=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Vo),R.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{Wt(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!t.abort})}});function Ir(e){if(!Zt.test(e))return!1;const t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),i=t.padEnd(Math.ceil(t.length/4)*4,"=");return Wt(i)}const Cr=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Zt),R.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{Ir(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!t.abort})}}),Pr=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Wo),R.init(e,t)});function Dr(e,t=null){try{const i=e.split(".");if(i.length!==3)return!1;const[o]=i;if(!o)return!1;const r=JSON.parse(atob(o));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}const Zr=p("$ZodJWT",(e,t)=>{R.init(e,t),e._zod.check=i=>{Dr(i.value,t.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!t.abort})}}),qt=p("$ZodNumber",(e,t)=>{N.init(e,t),e._zod.pattern=e._zod.bag.pattern??Mt,e._zod.parse=(i,o)=>{if(t.coerce)try{i.value=Number(i.value)}catch{}const r=i.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return i;const s=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...s?{received:s}:{}}),i}}),Rr=p("$ZodNumberFormat",(e,t)=>{er.init(e,t),qt.init(e,t)}),Fr=p("$ZodBoolean",(e,t)=>{N.init(e,t),e._zod.pattern=Ko,e._zod.parse=(i,o)=>{if(t.coerce)try{i.value=!!i.value}catch{}const r=i.value;return typeof r=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),i}}),Mr=p("$ZodAny",(e,t)=>{N.init(e,t),e._zod.parse=i=>i}),Lr=p("$ZodUnknown",(e,t)=>{N.init(e,t),e._zod.parse=i=>i}),Ur=p("$ZodNever",(e,t)=>{N.init(e,t),e._zod.parse=(i,o)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)}),Vr=p("$ZodVoid",(e,t)=>{N.init(e,t),e._zod.parse=(i,o)=>{const r=i.value;return typeof r>"u"||i.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),i}}),Wr=p("$ZodDate",(e,t)=>{N.init(e,t),e._zod.parse=(i,o)=>{if(t.coerce)try{i.value=new Date(i.value)}catch{}const r=i.value,s=r instanceof Date;return s&&!Number.isNaN(r.getTime())||i.issues.push({expected:"date",code:"invalid_type",input:r,...s?{received:"Invalid Date"}:{},inst:e}),i}});function Jt(e,t,i){e.issues.length&&t.issues.push(...he(i,e.issues)),t.value[i]=e.value}const qr=p("$ZodArray",(e,t)=>{N.init(e,t),e._zod.parse=(i,o)=>{const r=i.value;if(!Array.isArray(r))return i.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),i;i.value=Array(r.length);const s=[];for(let a=0;a<r.length;a++){const c=r[a],d=t.element._zod.run({value:c,issues:[]},o);d instanceof Promise?s.push(d.then(u=>Jt(u,i,a))):Jt(d,i,a)}return s.length?Promise.all(s).then(()=>i):i}});function qe(e,t,i,o,r){if(e.issues.length){if(r&&!(i in o))return;t.issues.push(...he(i,e.issues))}e.value===void 0?i in o&&(t.value[i]=void 0):t.value[i]=e.value}function Gt(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const i=ao(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function Bt(e,t,i,o,r,s){const a=[],c=r.keySet,d=r.catchall._zod,u=d.def.type,v=d.optout==="optional";for(const y in t){if(c.has(y))continue;if(u==="never"){a.push(y);continue}const w=d.run({value:t[y],issues:[]},o);w instanceof Promise?e.push(w.then(z=>qe(z,i,y,t,v))):qe(w,i,y,t,v)}return a.length&&i.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s}),e.length?Promise.all(e).then(()=>i):i}const Jr=p("$ZodObject",(e,t)=>{if(N.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...c};return Object.defineProperty(t,"shape",{value:d}),d}})}const o=Ze(()=>Gt(t));T(e._zod,"propValues",()=>{const c=t.shape,d={};for(const u in c){const v=c[u]._zod;if(v.values){d[u]??(d[u]=new Set);for(const y of v.values)d[u].add(y)}}return d});const r=$e,s=t.catchall;let a;e._zod.parse=(c,d)=>{a??(a=o.value);const u=c.value;if(!r(u))return c.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),c;c.value={};const v=[],y=a.shape;for(const w of a.keys){const z=y[w],O=z._zod.optout==="optional",E=z._zod.run({value:u[w],issues:[]},d);E instanceof Promise?v.push(E.then(q=>qe(q,c,w,u,O))):qe(E,c,w,u,O)}return s?Bt(v,u,c,d,o.value,e):v.length?Promise.all(v).then(()=>c):c}}),Gr=p("$ZodObjectJIT",(e,t)=>{Jr.init(e,t);const i=e._zod.parse,o=Ze(()=>Gt(t)),r=w=>{const z=new ur(["shape","payload","ctx"]),O=o.value,E=J=>{const Z=Et(J);return`shape[${Z}]._zod.run({ value: input[${Z}], issues: [] }, ctx)`};z.write("const input = payload.value;");const q=Object.create(null);let ie=0;for(const J of O.keys)q[J]=`key_${ie++}`;z.write("const newResult = {};");for(const J of O.keys){const Z=q[J],C=Et(J),$=w[J]?._zod?.optout==="optional";z.write(`const ${Z} = ${E(J)};`),$?z.write(`
9
+ if (${Z}.issues.length) {
10
10
  if (${C} in input) {
11
- payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
11
+ payload.issues = payload.issues.concat(${Z}.issues.map(iss => ({
12
12
  ...iss,
13
13
  path: iss.path ? [${C}, ...iss.path] : [${C}]
14
14
  })));
15
15
  }
16
16
  }
17
17
 
18
- if (${D}.value === undefined) {
18
+ if (${Z}.value === undefined) {
19
19
  if (${C} in input) {
20
20
  newResult[${C}] = undefined;
21
21
  }
22
22
  } else {
23
- newResult[${C}] = ${D}.value;
23
+ newResult[${C}] = ${Z}.value;
24
24
  }
25
25
 
26
- `):x.write(`
27
- if (${D}.issues.length) {
28
- payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
26
+ `):z.write(`
27
+ if (${Z}.issues.length) {
28
+ payload.issues = payload.issues.concat(${Z}.issues.map(iss => ({
29
29
  ...iss,
30
30
  path: iss.path ? [${C}, ...iss.path] : [${C}]
31
31
  })));
32
32
  }
33
33
 
34
- if (${D}.value === undefined) {
34
+ if (${Z}.value === undefined) {
35
35
  if (${C} in input) {
36
36
  newResult[${C}] = undefined;
37
37
  }
38
38
  } else {
39
- newResult[${C}] = ${D}.value;
39
+ newResult[${C}] = ${Z}.value;
40
40
  }
41
41
 
42
- `)}x.write("payload.value = newResult;"),x.write("return payload;");const se=x.compile();return(J,D)=>se(w,J,D)};let s;const a=$e,c=!At.jitless,u=c&&oi.value,h=t.catchall;let y;e._zod.parse=(w,x)=>{y??(y=i.value);const j=w.value;return a(j)?c&&u&&x?.async===!1&&x.jitless!==!0?(s||(s=o(t.shape)),w=s(w,x),h?Bt([],j,w,x,y,e):w):r(w,x):(w.issues.push({expected:"object",code:"invalid_type",input:j,inst:e}),w)}});function Ht(e,t,r,i){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!_e(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(a=>ue(a,i,ce())))}),t)}const Kt=p("$ZodUnion",(e,t)=>{N.init(e,t),T(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),T(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),T(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),T(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>nt(s.source)).join("|")})$`)}});const r=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return i(o,s);let a=!1;const c=[];for(const d of t.options){const u=d._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)c.push(u),a=!0;else{if(u.issues.length===0)return u;c.push(u)}}return a?Promise.all(c).then(d=>Ht(d,o,e,s)):Ht(c,o,e,s)}}),Bo=p("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Kt.init(e,t);const r=e._zod.parse;T(e._zod,"propValues",()=>{const o={};for(const s of t.options){const a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[c,d]of Object.entries(a)){o[c]||(o[c]=new Set);for(const u of d)o[c].add(u)}}return o});const i=Ze(()=>{const o=t.options,s=new Map;for(const a of o){const c=a._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const d of c){if(s.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);s.set(d,a)}}return s});e._zod.parse=(o,s)=>{const a=o.value;if(!$e(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),o;const c=i.value.get(a?.[t.discriminator]);return c?c._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),o)}}),Ho=p("$ZodIntersection",(e,t)=>{N.init(e,t),e._zod.parse=(r,i)=>{const o=r.value,s=t.left._zod.run({value:o,issues:[]},i),a=t.right._zod.run({value:o,issues:[]},i);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([d,u])=>Yt(r,d,u)):Yt(r,s,a)}});function ct(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ve(e)&&ve(t)){const r=Object.keys(t),i=Object.keys(e).filter(s=>r.indexOf(s)!==-1),o={...e,...t};for(const s of i){const a=ct(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};o[s]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let i=0;i<e.length;i++){const o=e[i],s=t[i],a=ct(o,s);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Yt(e,t,r){const i=new Map;let o;for(const c of t.issues)if(c.code==="unrecognized_keys"){o??(o=c);for(const d of c.keys)i.has(d)||i.set(d,{}),i.get(d).l=!0}else e.issues.push(c);for(const c of r.issues)if(c.code==="unrecognized_keys")for(const d of c.keys)i.has(d)||i.set(d,{}),i.get(d).r=!0;else e.issues.push(c);const s=[...i].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&o&&e.issues.push({...o,keys:s}),_e(e))return e;const a=ct(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const Xt=p("$ZodTuple",(e,t)=>{N.init(e,t);const r=t.items;e._zod.parse=(i,o)=>{const s=i.value;if(!Array.isArray(s))return i.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=[];const a=[],c=[...r].reverse().findIndex(h=>h._zod.optin!=="optional"),d=c===-1?0:r.length-c;if(!t.rest){const h=s.length>r.length,y=s.length<d-1;if(h||y)return i.issues.push({...h?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:s,inst:e,origin:"array"}),i}let u=-1;for(const h of r){if(u++,u>=s.length&&u>=d)continue;const y=h._zod.run({value:s[u],issues:[]},o);y instanceof Promise?a.push(y.then(w=>Je(w,i,u))):Je(y,i,u)}if(t.rest){const h=s.slice(r.length);for(const y of h){u++;const w=t.rest._zod.run({value:y,issues:[]},o);w instanceof Promise?a.push(w.then(x=>Je(x,i,u))):Je(w,i,u)}}return a.length?Promise.all(a).then(()=>i):i}});function Je(e,t,r){e.issues.length&&t.issues.push(...he(r,e.issues)),t.value[r]=e.value}const Ko=p("$ZodRecord",(e,t)=>{N.init(e,t),e._zod.parse=(r,i)=>{const o=r.value;if(!ve(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;const s=[],a=t.keyType._zod.values;if(a){r.value={};const c=new Set;for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){c.add(typeof u=="number"?u.toString():u);const h=t.valueType._zod.run({value:o[u],issues:[]},i);h instanceof Promise?s.push(h.then(y=>{y.issues.length&&r.issues.push(...he(u,y.issues)),r.value[u]=y.value})):(h.issues.length&&r.issues.push(...he(u,h.issues)),r.value[u]=h.value)}let d;for(const u in o)c.has(u)||(d=d??[],d.push(u));d&&d.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:d})}else{r.value={};for(const c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let d=t.keyType._zod.run({value:c,issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&Mt.test(c)&&d.issues.length){const y=t.keyType._zod.run({value:Number(c),issues:[]},i);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(d=y)}if(d.issues.length){t.mode==="loose"?r.value[c]=o[c]:r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(y=>ue(y,i,ce())),input:c,path:[c],inst:e});continue}const h=t.valueType._zod.run({value:o[c],issues:[]},i);h instanceof Promise?s.push(h.then(y=>{y.issues.length&&r.issues.push(...he(c,y.issues)),r.value[d.value]=y.value})):(h.issues.length&&r.issues.push(...he(c,h.issues)),r.value[d.value]=h.value)}}return s.length?Promise.all(s).then(()=>r):r}}),Yo=p("$ZodEnum",(e,t)=>{N.init(e,t);const r=$t(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(o=>ni.has(typeof o)).map(o=>typeof o=="string"?ye(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const a=o.value;return i.has(a)||o.issues.push({code:"invalid_value",values:r,input:a,inst:e}),o}}),Xo=p("$ZodLiteral",(e,t)=>{if(N.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?ye(i):i?ye(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,o)=>{const s=i.value;return r.has(s)||i.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),i}}),Qo=p("$ZodTransform",(e,t)=>{N.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new zt(e.constructor.name);const o=t.transform(r.value,r);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(r.value=a,r));if(o instanceof Promise)throw new ge;return r.value=o,r}});function Qt(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const er=p("$ZodOptional",(e,t)=>{N.init(e,t),e._zod.optin="optional",e._zod.optout="optional",T(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),T(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${nt(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(s=>Qt(s,r.value)):Qt(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,i)}}),en=p("$ZodExactOptional",(e,t)=>{er.init(e,t),T(e._zod,"values",()=>t.innerType._zod.values),T(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,i)=>t.innerType._zod.run(r,i)}),tn=p("$ZodNullable",(e,t)=>{N.init(e,t),T(e._zod,"optin",()=>t.innerType._zod.optin),T(e._zod,"optout",()=>t.innerType._zod.optout),T(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${nt(r.source)}|null)$`):void 0}),T(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),rn=p("$ZodDefault",(e,t)=>{N.init(e,t),e._zod.optin="optional",T(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(s=>tr(s,t)):tr(o,t)}});function tr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const on=p("$ZodPrefault",(e,t)=>{N.init(e,t),e._zod.optin="optional",T(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),nn=p("$ZodNonOptional",(e,t)=>{N.init(e,t),T(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(s=>rr(s,e)):rr(o,e)}});function rr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const an=p("$ZodCatch",(e,t)=>{N.init(e,t),T(e._zod,"optin",()=>t.innerType._zod.optin),T(e._zod,"optout",()=>t.innerType._zod.optout),T(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(a=>ue(a,i,ce()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>ue(s,i,ce()))},input:r.value}),r.issues=[]),r)}}),sn=p("$ZodPipe",(e,t)=>{N.init(e,t),T(e._zod,"values",()=>t.in._zod.values),T(e._zod,"optin",()=>t.in._zod.optin),T(e._zod,"optout",()=>t.out._zod.optout),T(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){const s=t.out._zod.run(r,i);return s instanceof Promise?s.then(a=>Ge(a,t.in,i)):Ge(s,t.in,i)}const o=t.in._zod.run(r,i);return o instanceof Promise?o.then(s=>Ge(s,t.out,i)):Ge(o,t.out,i)}});function Ge(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const cn=p("$ZodReadonly",(e,t)=>{N.init(e,t),T(e._zod,"propValues",()=>t.innerType._zod.propValues),T(e._zod,"values",()=>t.innerType._zod.values),T(e._zod,"optin",()=>t.innerType?._zod?.optin),T(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(ir):ir(o)}});function ir(e){return e.value=Object.freeze(e.value),e}const ln=p("$ZodFunction",(e,t)=>(N.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){const o=e._def.input?It(e._def.input,i):i,s=Reflect.apply(r,this,o);return e._def.output?It(e._def.output,s):s}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){const o=e._def.input?await Pt(e._def.input,i):i,s=await Reflect.apply(r,this,o);return e._def.output?await Pt(e._def.output,s):s}},e._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{const i=e.constructor;return Array.isArray(r[0])?new i({type:"function",input:new Xt({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new i({type:"function",input:r[0],output:e._def.output})},e.output=r=>{const i=e.constructor;return new i({type:"function",input:e._def.input,output:r})},e)),dn=p("$ZodLazy",(e,t)=>{N.init(e,t),T(e._zod,"innerType",()=>t.getter()),T(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),T(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),T(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),T(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),un=p("$ZodCustom",(e,t)=>{Y.init(e,t),N.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,o=t.fn(i);if(o instanceof Promise)return o.then(s=>or(s,r,i,e));or(o,r,i,e)}});function or(e,t,r,i){if(!e){const o={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),t.issues.push(Te(o))}}var nr;class pn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const i=r[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const i={...this.get(r)??{}};delete i.id;const o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function fn(){return new pn}(nr=globalThis).__zod_globalRegistry??(nr.__zod_globalRegistry=fn());const Ee=globalThis.__zod_globalRegistry;function mn(e,t){return new e({type:"string",...k(t)})}function bn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...k(t)})}function ar(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...k(t)})}function hn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...k(t)})}function gn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...k(t)})}function vn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...k(t)})}function yn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...k(t)})}function _n(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...k(t)})}function wn(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...k(t)})}function Sn(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...k(t)})}function kn(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...k(t)})}function xn(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...k(t)})}function zn(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...k(t)})}function An(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...k(t)})}function $n(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...k(t)})}function Tn(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...k(t)})}function En(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...k(t)})}function Nn(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...k(t)})}function jn(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...k(t)})}function On(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...k(t)})}function Cn(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...k(t)})}function In(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...k(t)})}function Pn(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...k(t)})}function Dn(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...k(t)})}function Zn(e,t){return new e({type:"string",format:"date",check:"string_format",...k(t)})}function Rn(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...k(t)})}function Fn(e,t){return new e({type:"string",format:"duration",check:"string_format",...k(t)})}function Mn(e,t){return new e({type:"number",checks:[],...k(t)})}function Ln(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...k(t)})}function Un(e,t){return new e({type:"boolean",...k(t)})}function Vn(e){return new e({type:"any"})}function Wn(e){return new e({type:"unknown"})}function qn(e,t){return new e({type:"never",...k(t)})}function Jn(e,t){return new e({type:"void",...k(t)})}function Gn(e,t){return new e({type:"date",...k(t)})}function sr(e,t){return new Ut({check:"less_than",...k(t),value:e,inclusive:!1})}function Be(e,t){return new Ut({check:"less_than",...k(t),value:e,inclusive:!0})}function cr(e,t){return new Vt({check:"greater_than",...k(t),value:e,inclusive:!1})}function He(e,t){return new Vt({check:"greater_than",...k(t),value:e,inclusive:!0})}function lr(e,t){return new Xi({check:"multiple_of",...k(t),value:e})}function dr(e,t){return new eo({check:"max_length",...k(t),maximum:e})}function Ke(e,t){return new to({check:"min_length",...k(t),minimum:e})}function ur(e,t){return new ro({check:"length_equals",...k(t),length:e})}function Bn(e,t){return new io({check:"string_format",format:"regex",...k(t),pattern:e})}function Hn(e){return new oo({check:"string_format",format:"lowercase",...k(e)})}function Kn(e){return new no({check:"string_format",format:"uppercase",...k(e)})}function Yn(e,t){return new ao({check:"string_format",format:"includes",...k(t),includes:e})}function Xn(e,t){return new so({check:"string_format",format:"starts_with",...k(t),prefix:e})}function Qn(e,t){return new co({check:"string_format",format:"ends_with",...k(t),suffix:e})}function we(e){return new lo({check:"overwrite",tx:e})}function ea(e){return we(t=>t.normalize(e))}function ta(){return we(e=>e.trim())}function ra(){return we(e=>e.toLowerCase())}function ia(){return we(e=>e.toUpperCase())}function oa(){return we(e=>ii(e))}function na(e,t,r){return new e({type:"array",element:t,...k(r)})}function aa(e,t,r){return new e({type:"custom",check:"custom",fn:t,...k(r)})}function sa(e){const t=ca(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(Te(i,r.value,t._zod.def));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(Te(o))}},e(r.value,r)));return t}function ca(e,t){const r=new Y({check:"custom",...k(t)});return r._zod.check=e,r}function pr(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ee,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function R(e,t,r={path:[],schemaPath:[]}){var i;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);const c=e._zod.toJSONSchema?.();if(c)a.schema=c;else{const h={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,h);else{const w=a.schema,x=t.processors[o.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);x(e,t,w,h)}const y=e._zod.parent;y&&(a.ref||(a.ref=y),R(y,t,h),t.seen.get(y).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(a.schema,d),t.io==="input"&&H(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function fr(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const a of e.seen.entries()){const c=e.metadataRegistry.get(a[0])?.id;if(c){const d=i.get(c);if(d&&d!==a[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(c,a[0])}}const o=a=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(a[0])?.id,w=e.external.uri??(j=>j);if(y)return{ref:w(y)};const x=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=x,{defId:x,ref:`${w("__shared")}#/${c}/${x}`}}if(a[1]===r)return{ref:"#"};const u=`#/${c}/`,h=a[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:u+h}},s=a=>{if(a[1].schema.$ref)return;const c=a[1],{ref:d,defId:u}=o(a);c.def={...c.schema},u&&(c.defId=u);const h=c.schema;for(const y in h)delete h[y];h.$ref=d};if(e.cycles==="throw")for(const a of e.seen.entries()){const c=a[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
42
+ `)}z.write("payload.value = newResult;"),z.write("return payload;");const se=z.compile();return(J,Z)=>se(w,J,Z)};let s;const a=$e,c=!At.jitless,u=c&&ro.value,v=t.catchall;let y;e._zod.parse=(w,z)=>{y??(y=o.value);const O=w.value;return a(O)?c&&u&&z?.async===!1&&z.jitless!==!0?(s||(s=r(t.shape)),w=s(w,z),v?Bt([],O,w,z,y,e):w):i(w,z):(w.issues.push({expected:"object",code:"invalid_type",input:O,inst:e}),w)}});function Ht(e,t,i,o){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const r=e.filter(s=>!_e(s));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(s=>s.issues.map(a=>ue(a,o,ce())))}),t)}const Kt=p("$ZodUnion",(e,t)=>{N.init(e,t),T(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),T(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),T(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),T(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${r.map(s=>nt(s.source)).join("|")})$`)}});const i=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(r,s)=>{if(i)return o(r,s);let a=!1;const c=[];for(const d of t.options){const u=d._zod.run({value:r.value,issues:[]},s);if(u instanceof Promise)c.push(u),a=!0;else{if(u.issues.length===0)return u;c.push(u)}}return a?Promise.all(c).then(d=>Ht(d,r,e,s)):Ht(c,r,e,s)}}),Br=p("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Kt.init(e,t);const i=e._zod.parse;T(e._zod,"propValues",()=>{const r={};for(const s of t.options){const a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[c,d]of Object.entries(a)){r[c]||(r[c]=new Set);for(const u of d)r[c].add(u)}}return r});const o=Ze(()=>{const r=t.options,s=new Map;for(const a of r){const c=a._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const d of c){if(s.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);s.set(d,a)}}return s});e._zod.parse=(r,s)=>{const a=r.value;if(!$e(a))return r.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),r;const c=o.value.get(a?.[t.discriminator]);return c?c._zod.run(r,s):t.unionFallback?i(r,s):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),r)}}),Hr=p("$ZodIntersection",(e,t)=>{N.init(e,t),e._zod.parse=(i,o)=>{const r=i.value,s=t.left._zod.run({value:r,issues:[]},o),a=t.right._zod.run({value:r,issues:[]},o);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([d,u])=>Yt(i,d,u)):Yt(i,s,a)}});function ct(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ve(e)&&ve(t)){const i=Object.keys(t),o=Object.keys(e).filter(s=>i.indexOf(s)!==-1),r={...e,...t};for(const s of o){const a=ct(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};r[s]=a.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let o=0;o<e.length;o++){const r=e[o],s=t[o],a=ct(r,s);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};i.push(a.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function Yt(e,t,i){const o=new Map;let r;for(const c of t.issues)if(c.code==="unrecognized_keys"){r??(r=c);for(const d of c.keys)o.has(d)||o.set(d,{}),o.get(d).l=!0}else e.issues.push(c);for(const c of i.issues)if(c.code==="unrecognized_keys")for(const d of c.keys)o.has(d)||o.set(d,{}),o.get(d).r=!0;else e.issues.push(c);const s=[...o].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&r&&e.issues.push({...r,keys:s}),_e(e))return e;const a=ct(t.value,i.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const Xt=p("$ZodTuple",(e,t)=>{N.init(e,t);const i=t.items;e._zod.parse=(o,r)=>{const s=o.value;if(!Array.isArray(s))return o.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];const a=[],c=[...i].reverse().findIndex(v=>v._zod.optin!=="optional"),d=c===-1?0:i.length-c;if(!t.rest){const v=s.length>i.length,y=s.length<d-1;if(v||y)return o.issues.push({...v?{code:"too_big",maximum:i.length,inclusive:!0}:{code:"too_small",minimum:i.length},input:s,inst:e,origin:"array"}),o}let u=-1;for(const v of i){if(u++,u>=s.length&&u>=d)continue;const y=v._zod.run({value:s[u],issues:[]},r);y instanceof Promise?a.push(y.then(w=>Je(w,o,u))):Je(y,o,u)}if(t.rest){const v=s.slice(i.length);for(const y of v){u++;const w=t.rest._zod.run({value:y,issues:[]},r);w instanceof Promise?a.push(w.then(z=>Je(z,o,u))):Je(w,o,u)}}return a.length?Promise.all(a).then(()=>o):o}});function Je(e,t,i){e.issues.length&&t.issues.push(...he(i,e.issues)),t.value[i]=e.value}const Kr=p("$ZodRecord",(e,t)=>{N.init(e,t),e._zod.parse=(i,o)=>{const r=i.value;if(!ve(r))return i.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),i;const s=[],a=t.keyType._zod.values;if(a){i.value={};const c=new Set;for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){c.add(typeof u=="number"?u.toString():u);const v=t.valueType._zod.run({value:r[u],issues:[]},o);v instanceof Promise?s.push(v.then(y=>{y.issues.length&&i.issues.push(...he(u,y.issues)),i.value[u]=y.value})):(v.issues.length&&i.issues.push(...he(u,v.issues)),i.value[u]=v.value)}let d;for(const u in r)c.has(u)||(d=d??[],d.push(u));d&&d.length>0&&i.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:d})}else{i.value={};for(const c of Reflect.ownKeys(r)){if(c==="__proto__")continue;let d=t.keyType._zod.run({value:c,issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&Mt.test(c)&&d.issues.length){const y=t.keyType._zod.run({value:Number(c),issues:[]},o);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(d=y)}if(d.issues.length){t.mode==="loose"?i.value[c]=r[c]:i.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(y=>ue(y,o,ce())),input:c,path:[c],inst:e});continue}const v=t.valueType._zod.run({value:r[c],issues:[]},o);v instanceof Promise?s.push(v.then(y=>{y.issues.length&&i.issues.push(...he(c,y.issues)),i.value[d.value]=y.value})):(v.issues.length&&i.issues.push(...he(c,v.issues)),i.value[d.value]=v.value)}}return s.length?Promise.all(s).then(()=>i):i}}),Yr=p("$ZodEnum",(e,t)=>{N.init(e,t);const i=$t(t.entries),o=new Set(i);e._zod.values=o,e._zod.pattern=new RegExp(`^(${i.filter(r=>no.has(typeof r)).map(r=>typeof r=="string"?ye(r):r.toString()).join("|")})$`),e._zod.parse=(r,s)=>{const a=r.value;return o.has(a)||r.issues.push({code:"invalid_value",values:i,input:a,inst:e}),r}}),Xr=p("$ZodLiteral",(e,t)=>{if(N.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const i=new Set(t.values);e._zod.values=i,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?ye(o):o?ye(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,r)=>{const s=o.value;return i.has(s)||o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}}),Qr=p("$ZodTransform",(e,t)=>{N.init(e,t),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new zt(e.constructor.name);const r=t.transform(i.value,i);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then(a=>(i.value=a,i));if(r instanceof Promise)throw new ge;return i.value=r,i}});function Qt(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ei=p("$ZodOptional",(e,t)=>{N.init(e,t),e._zod.optin="optional",e._zod.optout="optional",T(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),T(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${nt(i.source)})?$`):void 0}),e._zod.parse=(i,o)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(i,o);return r instanceof Promise?r.then(s=>Qt(s,i.value)):Qt(r,i.value)}return i.value===void 0?i:t.innerType._zod.run(i,o)}}),en=p("$ZodExactOptional",(e,t)=>{ei.init(e,t),T(e._zod,"values",()=>t.innerType._zod.values),T(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(i,o)=>t.innerType._zod.run(i,o)}),tn=p("$ZodNullable",(e,t)=>{N.init(e,t),T(e._zod,"optin",()=>t.innerType._zod.optin),T(e._zod,"optout",()=>t.innerType._zod.optout),T(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${nt(i.source)}|null)$`):void 0}),T(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(i,o)=>i.value===null?i:t.innerType._zod.run(i,o)}),on=p("$ZodDefault",(e,t)=>{N.init(e,t),e._zod.optin="optional",T(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,o)=>{if(o.direction==="backward")return t.innerType._zod.run(i,o);if(i.value===void 0)return i.value=t.defaultValue,i;const r=t.innerType._zod.run(i,o);return r instanceof Promise?r.then(s=>ti(s,t)):ti(r,t)}});function ti(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const rn=p("$ZodPrefault",(e,t)=>{N.init(e,t),e._zod.optin="optional",T(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,o)=>(o.direction==="backward"||i.value===void 0&&(i.value=t.defaultValue),t.innerType._zod.run(i,o))}),nn=p("$ZodNonOptional",(e,t)=>{N.init(e,t),T(e._zod,"values",()=>{const i=t.innerType._zod.values;return i?new Set([...i].filter(o=>o!==void 0)):void 0}),e._zod.parse=(i,o)=>{const r=t.innerType._zod.run(i,o);return r instanceof Promise?r.then(s=>ii(s,e)):ii(r,e)}});function ii(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const an=p("$ZodCatch",(e,t)=>{N.init(e,t),T(e._zod,"optin",()=>t.innerType._zod.optin),T(e._zod,"optout",()=>t.innerType._zod.optout),T(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,o)=>{if(o.direction==="backward")return t.innerType._zod.run(i,o);const r=t.innerType._zod.run(i,o);return r instanceof Promise?r.then(s=>(i.value=s.value,s.issues.length&&(i.value=t.catchValue({...i,error:{issues:s.issues.map(a=>ue(a,o,ce()))},input:i.value}),i.issues=[]),i)):(i.value=r.value,r.issues.length&&(i.value=t.catchValue({...i,error:{issues:r.issues.map(s=>ue(s,o,ce()))},input:i.value}),i.issues=[]),i)}}),sn=p("$ZodPipe",(e,t)=>{N.init(e,t),T(e._zod,"values",()=>t.in._zod.values),T(e._zod,"optin",()=>t.in._zod.optin),T(e._zod,"optout",()=>t.out._zod.optout),T(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,o)=>{if(o.direction==="backward"){const s=t.out._zod.run(i,o);return s instanceof Promise?s.then(a=>Ge(a,t.in,o)):Ge(s,t.in,o)}const r=t.in._zod.run(i,o);return r instanceof Promise?r.then(s=>Ge(s,t.out,o)):Ge(r,t.out,o)}});function Ge(e,t,i){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},i)}const cn=p("$ZodReadonly",(e,t)=>{N.init(e,t),T(e._zod,"propValues",()=>t.innerType._zod.propValues),T(e._zod,"values",()=>t.innerType._zod.values),T(e._zod,"optin",()=>t.innerType?._zod?.optin),T(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(i,o)=>{if(o.direction==="backward")return t.innerType._zod.run(i,o);const r=t.innerType._zod.run(i,o);return r instanceof Promise?r.then(oi):oi(r)}});function oi(e){return e.value=Object.freeze(e.value),e}const ln=p("$ZodFunction",(e,t)=>(N.init(e,t),e._def=t,e._zod.def=t,e.implement=i=>{if(typeof i!="function")throw new Error("implement() must be called with a function");return function(...o){const r=e._def.input?Ct(e._def.input,o):o,s=Reflect.apply(i,this,r);return e._def.output?Ct(e._def.output,s):s}},e.implementAsync=i=>{if(typeof i!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){const r=e._def.input?await Pt(e._def.input,o):o,s=await Reflect.apply(i,this,r);return e._def.output?await Pt(e._def.output,s):s}},e._zod.parse=(i,o)=>typeof i.value!="function"?(i.issues.push({code:"invalid_type",expected:"function",input:i.value,inst:e}),i):(e._def.output&&e._def.output._zod.def.type==="promise"?i.value=e.implementAsync(i.value):i.value=e.implement(i.value),i),e.input=(...i)=>{const o=e.constructor;return Array.isArray(i[0])?new o({type:"function",input:new Xt({type:"tuple",items:i[0],rest:i[1]}),output:e._def.output}):new o({type:"function",input:i[0],output:e._def.output})},e.output=i=>{const o=e.constructor;return new o({type:"function",input:e._def.input,output:i})},e)),dn=p("$ZodLazy",(e,t)=>{N.init(e,t),T(e._zod,"innerType",()=>t.getter()),T(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),T(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),T(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),T(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(i,o)=>e._zod.innerType._zod.run(i,o)}),un=p("$ZodCustom",(e,t)=>{Y.init(e,t),N.init(e,t),e._zod.parse=(i,o)=>i,e._zod.check=i=>{const o=i.value,r=t.fn(o);if(r instanceof Promise)return r.then(s=>ri(s,i,o,e));ri(r,i,o,e)}});function ri(e,t,i,o){if(!e){const r={code:"custom",input:i,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(r.params=o._zod.def.params),t.issues.push(Te(r))}}var ni;class pn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...i){const o=i[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const i=this._map.get(t);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(t),this}get(t){const i=t._zod.parent;if(i){const o={...this.get(i)??{}};delete o.id;const r={...o,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function fn(){return new pn}(ni=globalThis).__zod_globalRegistry??(ni.__zod_globalRegistry=fn());const Ee=globalThis.__zod_globalRegistry;function mn(e,t){return new e({type:"string",...k(t)})}function bn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...k(t)})}function ai(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...k(t)})}function hn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...k(t)})}function gn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...k(t)})}function vn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...k(t)})}function yn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...k(t)})}function _n(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...k(t)})}function wn(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...k(t)})}function Sn(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...k(t)})}function kn(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...k(t)})}function xn(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...k(t)})}function zn(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...k(t)})}function An(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...k(t)})}function $n(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...k(t)})}function Tn(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...k(t)})}function En(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...k(t)})}function Nn(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...k(t)})}function jn(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...k(t)})}function On(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...k(t)})}function In(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...k(t)})}function Cn(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...k(t)})}function Pn(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...k(t)})}function Dn(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...k(t)})}function Zn(e,t){return new e({type:"string",format:"date",check:"string_format",...k(t)})}function Rn(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...k(t)})}function Fn(e,t){return new e({type:"string",format:"duration",check:"string_format",...k(t)})}function Mn(e,t){return new e({type:"number",checks:[],...k(t)})}function Ln(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...k(t)})}function Un(e,t){return new e({type:"boolean",...k(t)})}function Vn(e){return new e({type:"any"})}function Wn(e){return new e({type:"unknown"})}function qn(e,t){return new e({type:"never",...k(t)})}function Jn(e,t){return new e({type:"void",...k(t)})}function Gn(e,t){return new e({type:"date",...k(t)})}function si(e,t){return new Ut({check:"less_than",...k(t),value:e,inclusive:!1})}function Be(e,t){return new Ut({check:"less_than",...k(t),value:e,inclusive:!0})}function ci(e,t){return new Vt({check:"greater_than",...k(t),value:e,inclusive:!1})}function He(e,t){return new Vt({check:"greater_than",...k(t),value:e,inclusive:!0})}function li(e,t){return new Qo({check:"multiple_of",...k(t),value:e})}function di(e,t){return new tr({check:"max_length",...k(t),maximum:e})}function Ke(e,t){return new ir({check:"min_length",...k(t),minimum:e})}function ui(e,t){return new or({check:"length_equals",...k(t),length:e})}function Bn(e,t){return new rr({check:"string_format",format:"regex",...k(t),pattern:e})}function Hn(e){return new nr({check:"string_format",format:"lowercase",...k(e)})}function Kn(e){return new ar({check:"string_format",format:"uppercase",...k(e)})}function Yn(e,t){return new sr({check:"string_format",format:"includes",...k(t),includes:e})}function Xn(e,t){return new cr({check:"string_format",format:"starts_with",...k(t),prefix:e})}function Qn(e,t){return new lr({check:"string_format",format:"ends_with",...k(t),suffix:e})}function we(e){return new dr({check:"overwrite",tx:e})}function ea(e){return we(t=>t.normalize(e))}function ta(){return we(e=>e.trim())}function ia(){return we(e=>e.toLowerCase())}function oa(){return we(e=>e.toUpperCase())}function ra(){return we(e=>oo(e))}function na(e,t,i){return new e({type:"array",element:t,...k(i)})}function aa(e,t,i){return new e({type:"custom",check:"custom",fn:t,...k(i)})}function sa(e){const t=ca(i=>(i.addIssue=o=>{if(typeof o=="string")i.issues.push(Te(o,i.value,t._zod.def));else{const r=o;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=i.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),i.issues.push(Te(r))}},e(i.value,i)));return t}function ca(e,t){const i=new Y({check:"custom",...k(t)});return i._zod.check=e,i}function pi(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ee,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function F(e,t,i={path:[],schemaPath:[]}){var o;const r=e._zod.def,s=t.seen.get(e);if(s)return s.count++,i.schemaPath.includes(e)&&(s.cycle=i.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:i.path};t.seen.set(e,a);const c=e._zod.toJSONSchema?.();if(c)a.schema=c;else{const v={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,v);else{const w=a.schema,z=t.processors[r.type];if(!z)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);z(e,t,w,v)}const y=e._zod.parent;y&&(a.ref||(a.ref=y),F(y,t,v),t.seen.get(y).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(a.schema,d),t.io==="input"&&H(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function fi(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const a of e.seen.entries()){const c=e.metadataRegistry.get(a[0])?.id;if(c){const d=o.get(c);if(d&&d!==a[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(c,a[0])}}const r=a=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(a[0])?.id,w=e.external.uri??(O=>O);if(y)return{ref:w(y)};const z=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=z,{defId:z,ref:`${w("__shared")}#/${c}/${z}`}}if(a[1]===i)return{ref:"#"};const u=`#/${c}/`,v=a[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:u+v}},s=a=>{if(a[1].schema.$ref)return;const c=a[1],{ref:d,defId:u}=r(a);c.def={...c.schema},u&&(c.defId=u);const v=c.schema;for(const y in v)delete v[y];v.$ref=d};if(e.cycles==="throw")for(const a of e.seen.entries()){const c=a[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
43
43
 
44
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const c=a[1];if(t===a[0]){s(a);continue}if(e.external){const u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){s(a);continue}}if(e.metadataRegistry.get(a[0])?.id){s(a);continue}if(c.cycle){s(a);continue}if(c.count>1&&e.reused==="ref"){s(a);continue}}}function mr(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=a=>{const c=e.seen.get(a);if(c.ref===null)return;const d=c.def??c.schema,u={...d},h=c.ref;if(c.ref=null,h){i(h);const w=e.seen.get(h),x=w.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(x)):Object.assign(d,x),Object.assign(d,u),a._zod.parent===h)for(const E in d)E==="$ref"||E==="allOf"||E in u||delete d[E];if(x.$ref&&w.def)for(const E in d)E==="$ref"||E==="allOf"||E in w.def&&JSON.stringify(d[E])===JSON.stringify(w.def[E])&&delete d[E]}const y=a._zod.parent;if(y&&y!==h){i(y);const w=e.seen.get(y);if(w?.schema.$ref&&(d.$ref=w.schema.$ref,w.def))for(const x in d)x==="$ref"||x==="allOf"||x in w.def&&JSON.stringify(d[x])===JSON.stringify(w.def[x])&&delete d[x]}e.override({zodSchema:a,jsonSchema:d,path:c.path??[]})};for(const a of[...e.seen.entries()].reverse())i(a[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Object.assign(o,r.def??r.schema);const s=e.external?.defs??{};for(const a of e.seen.entries()){const c=a[1];c.def&&c.defId&&(s[c.defId]=c.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ye(t,"input",e.processors),output:Ye(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function H(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return H(i.element,r);if(i.type==="set")return H(i.valueType,r);if(i.type==="lazy")return H(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return H(i.innerType,r);if(i.type==="intersection")return H(i.left,r)||H(i.right,r);if(i.type==="record"||i.type==="map")return H(i.keyType,r)||H(i.valueType,r);if(i.type==="pipe")return H(i.in,r)||H(i.out,r);if(i.type==="object"){for(const o in i.shape)if(H(i.shape[o],r))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(H(o,r))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(H(o,r))return!0;return!!(i.rest&&H(i.rest,r))}return!1}const la=(e,t={})=>r=>{const i=pr({...r,processors:t});return R(e,i),fr(i,e),mr(i,e)},Ye=(e,t,r={})=>i=>{const{libraryOptions:o,target:s}=i??{},a=pr({...o??{},target:s,io:t,processors:r});return R(e,a),fr(a,e),mr(a,e)},da={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ua=(e,t,r,i)=>{const o=r;o.type="string";const{minimum:s,maximum:a,format:c,patterns:d,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof a=="number"&&(o.maxLength=a),c&&(o.format=da[c]??c,o.format===""&&delete o.format,c==="time"&&delete o.format),u&&(o.contentEncoding=u),d&&d.size>0){const h=[...d];h.length===1?o.pattern=h[0].source:h.length>1&&(o.allOf=[...h.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},pa=(e,t,r,i)=>{const o=r,{minimum:s,maximum:a,format:c,multipleOf:d,exclusiveMaximum:u,exclusiveMinimum:h}=e._zod.bag;typeof c=="string"&&c.includes("int")?o.type="integer":o.type="number",typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=h,o.exclusiveMinimum=!0):o.exclusiveMinimum=h),typeof s=="number"&&(o.minimum=s,typeof h=="number"&&t.target!=="draft-04"&&(h>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof a=="number"&&(o.maximum=a,typeof u=="number"&&t.target!=="draft-04"&&(u<=a?delete o.maximum:delete o.exclusiveMaximum)),typeof d=="number"&&(o.multipleOf=d)},fa=(e,t,r,i)=>{r.type="boolean"},ma=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},ba=(e,t,r,i)=>{r.not={}},ha=(e,t,r,i)=>{},ga=(e,t,r,i)=>{},va=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},ya=(e,t,r,i)=>{const o=e._zod.def,s=$t(o.entries);s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),r.enum=s},_a=(e,t,r,i)=>{const o=e._zod.def,s=[];for(const a of o.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(a))}else s.push(a);if(s.length!==0)if(s.length===1){const a=s[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),s.every(a=>typeof a=="boolean")&&(r.type="boolean"),s.every(a=>a===null)&&(r.type="null"),r.enum=s},wa=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Sa=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},ka=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},xa=(e,t,r,i)=>{const o=r,s=e._zod.def,{minimum:a,maximum:c}=e._zod.bag;typeof a=="number"&&(o.minItems=a),typeof c=="number"&&(o.maxItems=c),o.type="array",o.items=R(s.element,t,{...i,path:[...i.path,"items"]})},za=(e,t,r,i)=>{const o=r,s=e._zod.def;o.type="object",o.properties={};const a=s.shape;for(const u in a)o.properties[u]=R(a[u],t,{...i,path:[...i.path,"properties",u]});const c=new Set(Object.keys(a)),d=new Set([...c].filter(u=>{const h=s.shape[u]._zod;return t.io==="input"?h.optin===void 0:h.optout===void 0}));d.size>0&&(o.required=Array.from(d)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=R(s.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Aa=(e,t,r,i)=>{const o=e._zod.def,s=o.inclusive===!1,a=o.options.map((c,d)=>R(c,t,{...i,path:[...i.path,s?"oneOf":"anyOf",d]}));s?r.oneOf=a:r.anyOf=a},$a=(e,t,r,i)=>{const o=e._zod.def,s=R(o.left,t,{...i,path:[...i.path,"allOf",0]}),a=R(o.right,t,{...i,path:[...i.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,d=[...c(s)?s.allOf:[s],...c(a)?a.allOf:[a]];r.allOf=d},Ta=(e,t,r,i)=>{const o=r,s=e._zod.def;o.type="array";const a=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=s.items.map((w,x)=>R(w,t,{...i,path:[...i.path,a,x]})),u=s.rest?R(s.rest,t,{...i,path:[...i.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;t.target==="draft-2020-12"?(o.prefixItems=d,u&&(o.items=u)):t.target==="openapi-3.0"?(o.items={anyOf:d},u&&o.items.anyOf.push(u),o.minItems=d.length,u||(o.maxItems=d.length)):(o.items=d,u&&(o.additionalItems=u));const{minimum:h,maximum:y}=e._zod.bag;typeof h=="number"&&(o.minItems=h),typeof y=="number"&&(o.maxItems=y)},Ea=(e,t,r,i)=>{const o=r,s=e._zod.def;o.type="object";const a=s.keyType,d=a._zod.bag?.patterns;if(s.mode==="loose"&&d&&d.size>0){const h=R(s.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});o.patternProperties={};for(const y of d)o.patternProperties[y.source]=h}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=R(s.keyType,t,{...i,path:[...i.path,"propertyNames"]})),o.additionalProperties=R(s.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const u=a._zod.values;if(u){const h=[...u].filter(y=>typeof y=="string"||typeof y=="number");h.length>0&&(o.required=h)}},Na=(e,t,r,i)=>{const o=e._zod.def,s=R(o.innerType,t,i),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=o.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},ja=(e,t,r,i)=>{const o=e._zod.def;R(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},Oa=(e,t,r,i)=>{const o=e._zod.def;R(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},Ca=(e,t,r,i)=>{const o=e._zod.def;R(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},Ia=(e,t,r,i)=>{const o=e._zod.def;R(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},Pa=(e,t,r,i)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;R(s,t,i);const a=t.seen.get(e);a.ref=s},Da=(e,t,r,i)=>{const o=e._zod.def;R(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,r.readOnly=!0},br=(e,t,r,i)=>{const o=e._zod.def;R(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},Za=(e,t,r,i)=>{const o=e._zod.innerType;R(o,t,i);const s=t.seen.get(e);s.ref=o},Ra=p("ZodISODateTime",(e,t)=>{xo.init(e,t),F.init(e,t)});function Fa(e){return Dn(Ra,e)}const Ma=p("ZodISODate",(e,t)=>{zo.init(e,t),F.init(e,t)});function La(e){return Zn(Ma,e)}const Ua=p("ZodISOTime",(e,t)=>{Ao.init(e,t),F.init(e,t)});function Va(e){return Rn(Ua,e)}const Wa=p("ZodISODuration",(e,t)=>{$o.init(e,t),F.init(e,t)});function qa(e){return Fn(Wa,e)}const Q=p("ZodError",(e,t)=>{Ct.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>hi(e,r)},flatten:{value:r=>bi(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,it,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,it,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ja=Me(Q),Ga=Le(Q),Ba=Ue(Q),Ha=Ve(Q),Ka=yi(Q),Ya=_i(Q),Xa=wi(Q),Qa=Si(Q),es=ki(Q),ts=xi(Q),rs=zi(Q),is=Ai(Q),O=p("ZodType",(e,t)=>(N.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ye(e,"input"),output:Ye(e,"output")}}),e.toJSONSchema=la(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(le(t,{checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(r,i)=>de(e,r,i),e.brand=()=>e,e.register=((r,i)=>(r.add(e,i),e)),e.parse=(r,i)=>Ja(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>Ba(e,r,i),e.parseAsync=async(r,i)=>Ga(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Ha(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>Ka(e,r,i),e.decode=(r,i)=>Ya(e,r,i),e.encodeAsync=async(r,i)=>Xa(e,r,i),e.decodeAsync=async(r,i)=>Qa(e,r,i),e.safeEncode=(r,i)=>es(e,r,i),e.safeDecode=(r,i)=>ts(e,r,i),e.safeEncodeAsync=async(r,i)=>rs(e,r,i),e.safeDecodeAsync=async(r,i)=>is(e,r,i),e.refine=(r,i)=>e.check(oc(r,i)),e.superRefine=r=>e.check(nc(r)),e.overwrite=r=>e.check(we(r)),e.optional=()=>kr(e),e.exactOptional=()=>Us(e),e.nullable=()=>xr(e),e.nullish=()=>kr(xr(e)),e.nonoptional=r=>Bs(e,r),e.array=()=>v(e),e.or=r=>P([e,r]),e.and=r=>Ps(e,r),e.transform=r=>Ar(e,Ms(r)),e.default=r=>qs(e,r),e.prefault=r=>Gs(e,r),e.catch=r=>Ks(e,r),e.pipe=r=>Ar(e,r),e.readonly=()=>Qs(e),e.describe=r=>{const i=e.clone();return Ee.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){return Ee.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ee.get(e);const i=e.clone();return Ee.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),hr=p("_ZodString",(e,t)=>{st.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,o,s)=>ua(e,i,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(Bn(...i)),e.includes=(...i)=>e.check(Yn(...i)),e.startsWith=(...i)=>e.check(Xn(...i)),e.endsWith=(...i)=>e.check(Qn(...i)),e.min=(...i)=>e.check(Ke(...i)),e.max=(...i)=>e.check(dr(...i)),e.length=(...i)=>e.check(ur(...i)),e.nonempty=(...i)=>e.check(Ke(1,...i)),e.lowercase=i=>e.check(Hn(i)),e.uppercase=i=>e.check(Kn(i)),e.trim=()=>e.check(ta()),e.normalize=(...i)=>e.check(ea(...i)),e.toLowerCase=()=>e.check(ra()),e.toUpperCase=()=>e.check(ia()),e.slugify=()=>e.check(oa())}),os=p("ZodString",(e,t)=>{st.init(e,t),hr.init(e,t),e.email=r=>e.check(bn(ns,r)),e.url=r=>e.check(_n(as,r)),e.jwt=r=>e.check(Pn(ws,r)),e.emoji=r=>e.check(wn(ss,r)),e.guid=r=>e.check(ar(gr,r)),e.uuid=r=>e.check(hn(Xe,r)),e.uuidv4=r=>e.check(gn(Xe,r)),e.uuidv6=r=>e.check(vn(Xe,r)),e.uuidv7=r=>e.check(yn(Xe,r)),e.nanoid=r=>e.check(Sn(cs,r)),e.guid=r=>e.check(ar(gr,r)),e.cuid=r=>e.check(kn(ls,r)),e.cuid2=r=>e.check(xn(ds,r)),e.ulid=r=>e.check(zn(us,r)),e.base64=r=>e.check(On(vs,r)),e.base64url=r=>e.check(Cn(ys,r)),e.xid=r=>e.check(An(ps,r)),e.ksuid=r=>e.check($n(fs,r)),e.ipv4=r=>e.check(Tn(ms,r)),e.ipv6=r=>e.check(En(bs,r)),e.cidrv4=r=>e.check(Nn(hs,r)),e.cidrv6=r=>e.check(jn(gs,r)),e.e164=r=>e.check(In(_s,r)),e.datetime=r=>e.check(Fa(r)),e.date=r=>e.check(La(r)),e.time=r=>e.check(Va(r)),e.duration=r=>e.check(qa(r))});function n(e){return mn(os,e)}const F=p("ZodStringFormat",(e,t)=>{Z.init(e,t),hr.init(e,t)}),ns=p("ZodEmail",(e,t)=>{bo.init(e,t),F.init(e,t)}),gr=p("ZodGUID",(e,t)=>{fo.init(e,t),F.init(e,t)}),Xe=p("ZodUUID",(e,t)=>{mo.init(e,t),F.init(e,t)}),as=p("ZodURL",(e,t)=>{ho.init(e,t),F.init(e,t)}),ss=p("ZodEmoji",(e,t)=>{go.init(e,t),F.init(e,t)}),cs=p("ZodNanoID",(e,t)=>{vo.init(e,t),F.init(e,t)}),ls=p("ZodCUID",(e,t)=>{yo.init(e,t),F.init(e,t)}),ds=p("ZodCUID2",(e,t)=>{_o.init(e,t),F.init(e,t)}),us=p("ZodULID",(e,t)=>{wo.init(e,t),F.init(e,t)}),ps=p("ZodXID",(e,t)=>{So.init(e,t),F.init(e,t)}),fs=p("ZodKSUID",(e,t)=>{ko.init(e,t),F.init(e,t)}),ms=p("ZodIPv4",(e,t)=>{To.init(e,t),F.init(e,t)}),bs=p("ZodIPv6",(e,t)=>{Eo.init(e,t),F.init(e,t)}),hs=p("ZodCIDRv4",(e,t)=>{No.init(e,t),F.init(e,t)}),gs=p("ZodCIDRv6",(e,t)=>{jo.init(e,t),F.init(e,t)}),vs=p("ZodBase64",(e,t)=>{Oo.init(e,t),F.init(e,t)}),ys=p("ZodBase64URL",(e,t)=>{Io.init(e,t),F.init(e,t)}),_s=p("ZodE164",(e,t)=>{Po.init(e,t),F.init(e,t)}),ws=p("ZodJWT",(e,t)=>{Zo.init(e,t),F.init(e,t)}),vr=p("ZodNumber",(e,t)=>{qt.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,o,s)=>pa(e,i,o),e.gt=(i,o)=>e.check(cr(i,o)),e.gte=(i,o)=>e.check(He(i,o)),e.min=(i,o)=>e.check(He(i,o)),e.lt=(i,o)=>e.check(sr(i,o)),e.lte=(i,o)=>e.check(Be(i,o)),e.max=(i,o)=>e.check(Be(i,o)),e.int=i=>e.check(yr(i)),e.safe=i=>e.check(yr(i)),e.positive=i=>e.check(cr(0,i)),e.nonnegative=i=>e.check(He(0,i)),e.negative=i=>e.check(sr(0,i)),e.nonpositive=i=>e.check(Be(0,i)),e.multipleOf=(i,o)=>e.check(lr(i,o)),e.step=(i,o)=>e.check(lr(i,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function m(e){return Mn(vr,e)}const Ss=p("ZodNumberFormat",(e,t)=>{Ro.init(e,t),vr.init(e,t)});function yr(e){return Ln(Ss,e)}const ks=p("ZodBoolean",(e,t)=>{Fo.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>fa(e,r,i)});function f(e){return Un(ks,e)}const xs=p("ZodAny",(e,t)=>{Mo.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>ha()});function pe(){return Vn(xs)}const zs=p("ZodUnknown",(e,t)=>{Lo.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>ga()});function I(){return Wn(zs)}const As=p("ZodNever",(e,t)=>{Uo.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>ba(e,r,i)});function $s(e){return qn(As,e)}const Ts=p("ZodVoid",(e,t)=>{Vo.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>ma(e,r)});function Es(e){return Jn(Ts,e)}const Ns=p("ZodDate",(e,t)=>{Wo.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,o,s)=>va(e,i),e.min=(i,o)=>e.check(He(i,o)),e.max=(i,o)=>e.check(Be(i,o));const r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function ee(e){return Gn(Ns,e)}const js=p("ZodArray",(e,t)=>{qo.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>xa(e,r,i,o),e.element=t.element,e.min=(r,i)=>e.check(Ke(r,i)),e.nonempty=r=>e.check(Ke(1,r)),e.max=(r,i)=>e.check(dr(r,i)),e.length=(r,i)=>e.check(ur(r,i)),e.unwrap=()=>e.element});function v(e,t){return na(js,e,t)}const Os=p("ZodObject",(e,t)=>{Go.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>za(e,r,i,o),T(e,"shape",()=>t.shape),e.keyof=()=>g(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:I()}),e.loose=()=>e.clone({...e._zod.def,catchall:I()}),e.strict=()=>e.clone({...e._zod.def,catchall:$s()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>di(e,r),e.safeExtend=r=>ui(e,r),e.merge=r=>pi(e,r),e.pick=r=>ci(e,r),e.omit=r=>li(e,r),e.partial=(...r)=>fi(Sr,e,r[0]),e.required=(...r)=>mi(zr,e,r[0])});function l(e,t){const r={type:"object",shape:e??{},...k(t)};return new Os(r)}const _r=p("ZodUnion",(e,t)=>{Kt.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>Aa(e,r,i,o),e.options=t.options});function P(e,t){return new _r({type:"union",options:e,...k(t)})}const Cs=p("ZodDiscriminatedUnion",(e,t)=>{_r.init(e,t),Bo.init(e,t)});function wr(e,t,r){return new Cs({type:"union",options:t,discriminator:e,...k(r)})}const Is=p("ZodIntersection",(e,t)=>{Ho.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>$a(e,r,i,o)});function Ps(e,t){return new Is({type:"intersection",left:e,right:t})}const Ds=p("ZodTuple",(e,t)=>{Xt.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>Ta(e,r,i,o),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Ne(e,t,r){const i=t instanceof N,o=i?r:t,s=i?t:null;return new Ds({type:"tuple",items:e,rest:s,...k(o)})}const Zs=p("ZodRecord",(e,t)=>{Ko.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>Ea(e,r,i,o),e.keyType=t.keyType,e.valueType=t.valueType});function M(e,t,r){return new Zs({type:"record",keyType:e,valueType:t,...k(r)})}const lt=p("ZodEnum",(e,t)=>{Yo.init(e,t),O.init(e,t),e._zod.processJSONSchema=(i,o,s)=>ya(e,i,o),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(i,o)=>{const s={};for(const a of i)if(r.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new lt({...t,checks:[],...k(o),entries:s})},e.exclude=(i,o)=>{const s={...t.entries};for(const a of i)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new lt({...t,checks:[],...k(o),entries:s})}});function g(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new lt({type:"enum",entries:r,...k(t)})}const Rs=p("ZodLiteral",(e,t)=>{Xo.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>_a(e,r,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ie(e,t){return new Rs({type:"literal",values:Array.isArray(e)?e:[e],...k(t)})}const Fs=p("ZodTransform",(e,t)=>{Qo.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>ka(e,r),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new zt(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(Te(s,r.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(Te(a))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function Ms(e){return new Fs({type:"transform",transform:e})}const Sr=p("ZodOptional",(e,t)=>{er.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>br(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function kr(e){return new Sr({type:"optional",innerType:e})}const Ls=p("ZodExactOptional",(e,t)=>{en.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>br(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function Us(e){return new Ls({type:"optional",innerType:e})}const Vs=p("ZodNullable",(e,t)=>{tn.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>Na(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function xr(e){return new Vs({type:"nullable",innerType:e})}const Ws=p("ZodDefault",(e,t)=>{rn.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>Oa(e,r,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function qs(e,t){return new Ws({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():jt(t)}})}const Js=p("ZodPrefault",(e,t)=>{on.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>Ca(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function Gs(e,t){return new Js({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():jt(t)}})}const zr=p("ZodNonOptional",(e,t)=>{nn.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>ja(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function Bs(e,t){return new zr({type:"nonoptional",innerType:e,...k(t)})}const Hs=p("ZodCatch",(e,t)=>{an.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>Ia(e,r,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ks(e,t){return new Hs({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ys=p("ZodPipe",(e,t)=>{sn.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>Pa(e,r,i,o),e.in=t.in,e.out=t.out});function Ar(e,t){return new Ys({type:"pipe",in:e,out:t})}const Xs=p("ZodReadonly",(e,t)=>{cn.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>Da(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function Qs(e){return new Xs({type:"readonly",innerType:e})}const ec=p("ZodLazy",(e,t)=>{dn.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>Za(e,r,i,o),e.unwrap=()=>e._zod.def.getter()});function Qe(e){return new ec({type:"lazy",getter:e})}const tc=p("ZodFunction",(e,t)=>{ln.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>Sa(e,r)});function rc(e){return new tc({type:"function",input:Array.isArray(e?.input)?Ne(e?.input):v(I()),output:I()})}const ic=p("ZodCustom",(e,t)=>{un.init(e,t),O.init(e,t),e._zod.processJSONSchema=(r,i,o)=>wa(e,r)});function oc(e,t={}){return aa(ic,e,t)}function nc(e){return sa(e)}var ac=l({key:n().describe('Translation key (e.g., "views.task_list.label")'),defaultValue:n().optional().describe("Fallback value when translation key is not found"),params:M(n(),P([n(),m(),f()])).optional().describe("Interpolation parameters (e.g., { count: 5 })")}),z=P([n(),ac]).describe("Display label: plain string or i18n translation object"),U=l({ariaLabel:z.optional().describe("Accessible label for screen readers (WAI-ARIA aria-label)"),ariaDescribedBy:n().optional().describe("ID of element providing additional description (WAI-ARIA aria-describedby)"),role:n().optional().describe('WAI-ARIA role attribute (e.g., "dialog", "navigation", "alert")')}).describe("ARIA accessibility attributes");l({key:n().describe("Translation key"),zero:n().optional().describe('Zero form (e.g., "No items")'),one:n().optional().describe('Singular form (e.g., "{count} item")'),two:n().optional().describe('Dual form (e.g., "{count} items" for exactly 2)'),few:n().optional().describe("Few form (e.g., for 2-4 in some languages)"),many:n().optional().describe("Many form (e.g., for 5+ in some languages)"),other:n().describe('Default plural form (e.g., "{count} items")')}).describe("ICU plural rules for a translation key");var sc=l({style:g(["decimal","currency","percent","unit"]).default("decimal").describe("Number formatting style"),currency:n().optional().describe('ISO 4217 currency code (e.g., "USD", "EUR")'),unit:n().optional().describe('Unit for unit formatting (e.g., "kilometer", "liter")'),minimumFractionDigits:m().optional().describe("Minimum number of fraction digits"),maximumFractionDigits:m().optional().describe("Maximum number of fraction digits"),useGrouping:f().optional().describe("Whether to use grouping separators (e.g., 1,000)")}).describe("Number formatting rules"),cc=l({dateStyle:g(["full","long","medium","short"]).optional().describe("Date display style"),timeStyle:g(["full","long","medium","short"]).optional().describe("Time display style"),timeZone:n().optional().describe('IANA time zone (e.g., "America/New_York")'),hour12:f().optional().describe("Use 12-hour format")}).describe("Date/time formatting rules");l({code:n().describe('BCP 47 language code (e.g., "en-US", "zh-CN")'),fallbackChain:v(n()).optional().describe('Fallback language codes in priority order (e.g., ["zh-TW", "en"])'),direction:g(["ltr","rtl"]).default("ltr").describe("Text direction: left-to-right or right-to-left"),numberFormat:sc.optional().describe("Default number formatting rules"),dateFormat:cc.optional().describe("Default date/time formatting rules")}).describe("Locale configuration");var dt=g(["bar","horizontal-bar","column","grouped-bar","stacked-bar","bi-polar-bar","line","area","stacked-area","step-line","spline","pie","donut","funnel","pyramid","scatter","bubble","treemap","sunburst","sankey","word-cloud","gauge","solid-gauge","metric","kpi","bullet","choropleth","bubble-map","gl-map","heatmap","radar","waterfall","box-plot","violin","candlestick","stock","table","pivot"]),$r=l({field:n().describe("Data field key"),title:z.optional().describe("Axis display title"),format:n().optional().describe('Value format string (e.g., "$0,0.00")'),min:m().optional().describe("Minimum value"),max:m().optional().describe("Maximum value"),stepSize:m().optional().describe("Step size for ticks"),showGridLines:f().default(!0),position:g(["left","right","top","bottom"]).optional().describe("Axis position"),logarithmic:f().default(!1)}),lc=l({name:n().describe("Field name or series identifier"),label:z.optional().describe("Series display label"),type:dt.optional().describe("Override chart type for this series"),color:n().optional().describe("Series color (hex/rgb/token)"),stack:n().optional().describe("Stack identifier to group series"),yAxis:g(["left","right"]).default("left").describe("Bind to specific Y-Axis")}),dc=l({type:g(["line","region"]).default("line"),axis:g(["x","y"]).default("y"),value:P([m(),n()]).describe("Start value"),endValue:P([m(),n()]).optional().describe("End value for regions"),color:n().optional(),label:z.optional(),style:g(["solid","dashed","dotted"]).default("dashed")}),uc=l({tooltips:f().default(!0),zoom:f().default(!1),brush:f().default(!1),clickAction:n().optional().describe("Action ID to trigger on click")}),Tr=l({type:dt,title:z.optional().describe("Chart title"),subtitle:z.optional().describe("Chart subtitle"),description:z.optional().describe("Accessibility description"),xAxis:$r.optional().describe("X-Axis configuration"),yAxis:v($r).optional().describe("Y-Axis configuration (support dual axis)"),series:v(lc).optional().describe("Defined series configuration"),colors:v(n()).optional().describe("Color palette"),height:m().optional().describe("Fixed height in pixels"),showLegend:f().default(!0).describe("Display legend"),showDataLabels:f().default(!1).describe("Display data labels"),annotations:v(dc).optional(),interaction:uc.optional(),aria:U.optional().describe("ARIA accessibility attributes")}),Er=g(["xs","sm","md","lg","xl","2xl"]),pc=l({xs:m().min(1).max(12).optional(),sm:m().min(1).max(12).optional(),md:m().min(1).max(12).optional(),lg:m().min(1).max(12).optional(),xl:m().min(1).max(12).optional(),"2xl":m().min(1).max(12).optional()}).describe("Grid columns per breakpoint (1-12)"),fc=l({xs:m().optional(),sm:m().optional(),md:m().optional(),lg:m().optional(),xl:m().optional(),"2xl":m().optional()}).describe("Display order per breakpoint"),ut=l({breakpoint:Er.optional().describe("Minimum breakpoint for visibility"),hiddenOn:v(Er).optional().describe("Hide on these breakpoints"),columns:pc.optional().describe("Grid columns per breakpoint"),order:fc.optional().describe("Display order per breakpoint")}).describe("Responsive layout configuration"),pt=l({lazyLoad:f().optional().describe("Enable lazy loading (defer rendering until visible)"),virtualScroll:l({enabled:f().default(!1).describe("Enable virtual scrolling"),itemHeight:m().optional().describe("Fixed item height in pixels (for estimation)"),overscan:m().optional().describe("Number of extra items to render outside viewport")}).optional().describe("Virtual scrolling configuration"),cacheStrategy:g(["none","cache-first","network-first","stale-while-revalidate"]).optional().describe("Client-side data caching strategy"),prefetch:f().optional().describe("Prefetch data before component is visible"),pageSize:m().optional().describe("Number of items per page for pagination"),debounceMs:m().optional().describe("Debounce interval for user interactions in milliseconds")}).describe("Performance optimization configuration"),mc=n().min(2,{message:"System identifier must be at least 2 characters"}).regex(/^[a-z][a-z0-9_.]*$/,{message:'System identifier must be lowercase, starting with a letter, and may contain letters, numbers, underscores, or dots (e.g., "user_profile" or "order.created")'}).describe("System identifier (lowercase with underscores or dots)"),ae=n().min(2,{message:"Identifier must be at least 2 characters"}).regex(/^[a-z][a-z0-9_]*$/,{message:'Identifier must be lowercase snake_case, starting with a letter, and may contain only letters, numbers, and underscores (e.g., "user_profile")'}).describe("Snake case identifier (lowercase with underscores only)");n().min(3,{message:"Event name must be at least 3 characters"}).regex(/^[a-z][a-z0-9_.]*$/,{message:'Event name must be lowercase with dots for namespacing (e.g., "user.created", "order.paid")'}).describe("Event name (lowercase with dot notation for namespacing)");var je=l({id:ae.describe("Unique identifier for this navigation item (lowercase snake_case)"),label:z.describe("Display proper label"),icon:n().optional().describe("Icon name"),visible:n().optional().describe("Visibility formula condition")}),bc=je.extend({type:ie("object"),objectName:n().describe("Target object name"),viewName:n().optional().describe('Default list view to open. Defaults to "all"')}),hc=je.extend({type:ie("dashboard"),dashboardName:n().describe("Target dashboard name")}),gc=je.extend({type:ie("page"),pageName:n().describe("Target custom page component name"),params:M(n(),I()).optional().describe("Parameters passed to the page context")}),vc=je.extend({type:ie("url"),url:n().describe("Target external URL"),target:g(["_self","_blank"]).default("_self").describe("Link target window")}),yc=je.extend({type:ie("group"),expanded:f().default(!1).describe("Default expansion state in sidebar")}),ft=Qe(()=>P([bc.extend({children:v(ft).optional().describe("Child navigation items (e.g. specific views)")}),hc,gc,vc,yc.extend({children:v(ft).describe("Child navigation items")})])),_c=l({primaryColor:n().optional().describe("Primary theme color hex code"),logo:n().optional().describe("Custom logo URL for this app"),favicon:n().optional().describe("Custom favicon URL for this app")});l({name:ae.describe("App unique machine name (lowercase snake_case)"),label:z.describe("App display label"),version:n().optional().describe("App version"),description:z.optional().describe("App description"),icon:n().optional().describe("App icon used in the App Launcher"),branding:_c.optional().describe("App-specific branding"),active:f().optional().default(!0).describe("Whether the app is enabled"),isDefault:f().optional().default(!1).describe("Is default app"),navigation:v(ft).optional().describe("Structured navigation menu tree"),homePageId:n().optional().describe("ID of the navigation item to serve as landing page"),requiredPermissions:v(n()).optional().describe("Permissions required to access this app"),objects:v(I()).optional().describe("Objects belonging to this app"),apis:v(I()).optional().describe("Custom APIs belonging to this app"),mobileNavigation:l({mode:g(["drawer","bottom_nav","hamburger"]).default("drawer").describe("Mobile navigation mode: drawer sidebar, bottom navigation bar, or hamburger menu"),bottomNavItems:v(n()).optional().describe("Navigation item IDs to show in bottom nav (max 5)")}).optional().describe("Mobile-specific navigation configuration"),aria:U.optional().describe("ARIA accessibility attributes for the application")});var wc=g(["GET","POST","PUT","PATCH","DELETE"]),Nr=l({url:n().describe("API endpoint URL"),method:wc.optional().default("GET").describe("HTTP method"),headers:M(n(),n()).optional().describe("Custom HTTP headers"),params:M(n(),I()).optional().describe("Query parameters"),body:I().optional().describe("Request body for POST/PUT/PATCH")}),jr=wr("provider",[l({provider:ie("object"),object:n().describe("Target object name")}),l({provider:ie("api"),read:Nr.optional().describe("Configuration for fetching data"),write:Nr.optional().describe("Configuration for submitting data (for forms/editable tables)")}),l({provider:ie("value"),items:v(I()).describe("Static data array")})]),Sc=g(["none","count","count_empty","count_filled","count_unique","percent_empty","percent_filled","sum","avg","min","max"]).describe("Aggregation function for column footer summary"),kc=l({field:n().describe("Field name (snake_case)"),label:z.optional().describe("Display label override"),width:m().positive().optional().describe("Column width in pixels"),align:g(["left","center","right"]).optional().describe("Text alignment"),hidden:f().optional().describe("Hide column by default"),sortable:f().optional().describe("Allow sorting by this column"),resizable:f().optional().describe("Allow resizing this column"),wrap:f().optional().describe("Allow text wrapping"),type:n().optional().describe('Renderer type override (e.g., "currency", "date")'),pinned:g(["left","right"]).optional().describe("Pin/freeze column to left or right side"),summary:Sc.optional().describe("Footer aggregation function for this column"),link:f().optional().describe("Functions as the primary navigation link (triggers View navigation)"),action:n().optional().describe("Registered Action ID to execute when clicked")}),xc=l({type:g(["none","single","multiple"]).default("none").describe("Selection mode")}),zc=l({pageSize:m().int().positive().default(25).describe("Number of records per page"),pageSizeOptions:v(m().int().positive()).optional().describe("Available page size options")}),Ac=g(["compact","short","medium","tall","extra_tall"]).describe("Row height / density setting for list view"),$c=l({field:n().describe("Field name to group by"),order:g(["asc","desc"]).default("asc").describe("Group sort order"),collapsed:f().default(!1).describe("Collapse groups by default")}),Tc=l({fields:v($c).min(1).describe("Fields to group by (supports up to 3 levels)")}).describe("Record grouping configuration"),Ec=l({coverField:n().optional().describe("Attachment/image field to display as card cover"),coverFit:g(["cover","contain"]).default("cover").describe("Image fit mode for card cover"),cardSize:g(["small","medium","large"]).default("medium").describe("Card size in gallery view"),titleField:n().optional().describe("Field to display as card title"),visibleFields:v(n()).optional().describe("Fields to display on card body")}).describe("Gallery/card view configuration"),Nc=l({startDateField:n().describe("Field for timeline item start date"),endDateField:n().optional().describe("Field for timeline item end date"),titleField:n().describe("Field to display as timeline item title"),groupByField:n().optional().describe("Field to group timeline rows"),colorField:n().optional().describe("Field to determine item color"),scale:g(["hour","day","week","month","quarter","year"]).default("week").describe("Default timeline scale")}).describe("Timeline view configuration"),jc=l({type:g(["personal","collaborative"]).default("collaborative").describe("View ownership type"),lockedBy:n().optional().describe("User who locked the view configuration")}).describe("View sharing and access configuration"),Oc=l({field:n().describe("Field to derive color from (typically a select/status field)"),colors:M(n(),n()).optional().describe("Map of field value to color (hex/token)")}).describe("Row color configuration based on field values"),Cc=l({groupByField:n().describe("Field to group columns by (usually status/select)"),summarizeField:n().optional().describe("Field to sum at top of column (e.g. amount)"),columns:v(n()).describe("Fields to show on cards")}),Ic=l({startDateField:n(),endDateField:n().optional(),titleField:n(),colorField:n().optional()}),Or=l({startDateField:n(),endDateField:n(),titleField:n(),progressField:n().optional(),dependenciesField:n().optional()}),Pc=g(["page","drawer","modal","split","popover","new_window","none"]),Dc=l({mode:Pc.default("page"),view:n().optional().describe('Name of the form view to use for details (e.g. "summary_view", "edit_form")'),preventNavigation:f().default(!1).describe("Disable standard navigation entirely"),openNewTab:f().default(!1).describe("Force open in new tab (applies to page mode)"),width:P([n(),m()]).optional().describe('Width of the drawer/modal (e.g. "600px", "50%")')}),Cr=l({name:ae.optional().describe("Internal view name (lowercase snake_case)"),label:z.optional(),type:g(["grid","kanban","gallery","calendar","timeline","gantt","map"]).default("grid"),data:jr.optional().describe('Data source configuration (defaults to "object" provider)'),columns:P([v(n()),v(kc)]).describe("Fields to display as columns"),filter:v(I()).optional().describe("Filter criteria (JSON Rules)"),sort:P([n(),v(l({field:n(),order:g(["asc","desc"])}))]).optional(),searchableFields:v(n()).optional().describe("Fields enabled for search"),filterableFields:v(n()).optional().describe("Fields enabled for end-user filtering in the top bar"),quickFilters:v(l({field:n().describe("Field name to filter by"),label:n().optional().describe("Display label for the chip"),operator:g(["equals","not_equals","contains","in","is_null","is_not_null"]).default("equals").describe("Filter operator"),value:I().optional().describe("Preset filter value")})).optional().describe("One-click filter chips for quick record filtering"),resizable:f().optional().describe("Enable column resizing"),striped:f().optional().describe("Striped row styling"),bordered:f().optional().describe("Show borders"),selection:xc.optional().describe("Row selection configuration"),navigation:Dc.optional().describe("Configuration for item click navigation (page, drawer, modal, etc.)"),pagination:zc.optional().describe("Pagination configuration"),kanban:Cc.optional(),calendar:Ic.optional(),gantt:Or.optional(),gallery:Ec.optional(),timeline:Nc.optional(),description:z.optional().describe("View description for documentation/tooltips"),sharing:jc.optional().describe("View sharing and access configuration"),rowHeight:Ac.optional().describe("Row height / density setting"),grouping:Tc.optional().describe("Group records by one or more fields"),rowColor:Oc.optional().describe("Color rows based on field value"),hiddenFields:v(n()).optional().describe("Fields to hide in this specific view"),fieldOrder:v(n()).optional().describe("Explicit field display order for this view"),rowActions:v(n()).optional().describe("Actions available for individual row items"),bulkActions:v(n()).optional().describe("Actions available when multiple rows are selected"),virtualScroll:f().optional().describe("Enable virtual scrolling for large datasets"),conditionalFormatting:v(l({condition:n().describe("Condition expression to evaluate"),style:M(n(),n()).describe("CSS styles to apply when condition is true")})).optional().describe("Conditional formatting rules for list rows"),inlineEdit:f().optional().describe("Allow inline editing of records directly in the list view"),exportOptions:v(g(["csv","xlsx","pdf","json"])).optional().describe("Available export format options"),emptyState:l({title:z.optional(),message:z.optional(),icon:n().optional()}).optional().describe("Empty state configuration when no records found"),aria:U.optional().describe("ARIA accessibility attributes for the list view")}),Zc=l({field:n().describe("Field name (snake_case)"),label:z.optional().describe("Display label override"),placeholder:z.optional().describe("Placeholder text"),helpText:z.optional().describe("Help/hint text"),readonly:f().optional().describe("Read-only override"),required:f().optional().describe("Required override"),hidden:f().optional().describe("Hidden override"),colSpan:m().int().min(1).max(4).optional().describe("Column span in grid layout (1-4)"),widget:n().optional().describe("Custom widget/component name"),dependsOn:n().optional().describe("Parent field name for cascading"),visibleOn:n().optional().describe("Visibility condition expression")}),Ir=l({label:z.optional(),collapsible:f().default(!1),collapsed:f().default(!1),columns:g(["1","2","3","4"]).default("2").transform(e=>parseInt(e)),fields:v(P([n(),Zc]))}),Pr=l({type:g(["simple","tabbed","wizard","split","drawer","modal"]).default("simple"),data:jr.optional().describe('Data source configuration (defaults to "object" provider)'),sections:v(Ir).optional(),groups:v(Ir).optional(),defaultSort:v(l({field:n().describe("Field name to sort by"),order:g(["asc","desc"]).default("desc").describe("Sort direction")})).optional().describe("Default sort order for related list views within this form"),aria:U.optional().describe("ARIA accessibility attributes for the form view")});l({list:Cr.optional(),form:Pr.optional(),listViews:M(n(),Cr).optional().describe("Additional named list views"),formViews:M(n(),Pr).optional().describe("Additional named form views")});var te=l({$field:n().describe("Field Reference/Column Name")});l({$eq:pe().optional(),$ne:pe().optional()}),l({$gt:P([m(),ee(),te]).optional(),$gte:P([m(),ee(),te]).optional(),$lt:P([m(),ee(),te]).optional(),$lte:P([m(),ee(),te]).optional()}),l({$in:v(pe()).optional(),$nin:v(pe()).optional()}),l({$between:Ne([P([m(),ee(),te]),P([m(),ee(),te])]).optional()}),l({$contains:n().optional(),$startsWith:n().optional(),$endsWith:n().optional()}),l({$null:f().optional(),$exists:f().optional()});var mt=l({$eq:pe().optional(),$ne:pe().optional(),$gt:P([m(),ee(),te]).optional(),$gte:P([m(),ee(),te]).optional(),$lt:P([m(),ee(),te]).optional(),$lte:P([m(),ee(),te]).optional(),$in:v(pe()).optional(),$nin:v(pe()).optional(),$between:Ne([P([m(),ee(),te]),P([m(),ee(),te])]).optional(),$contains:n().optional(),$startsWith:n().optional(),$endsWith:n().optional(),$null:f().optional(),$exists:f().optional()}),Se=Qe(()=>M(n(),I()).and(l({$and:v(Se).optional(),$or:v(Se).optional(),$not:Se.optional()})));l({where:Se.optional()});var bt=Qe(()=>l({$and:v(P([M(n(),mt),bt])).optional(),$or:v(P([M(n(),mt),bt])).optional(),$not:P([M(n(),mt),bt]).optional()})),Rc=l({title:z.optional().describe("Widget title"),type:dt.default("metric").describe("Visualization type"),chartConfig:Tr.optional().describe("Chart visualization configuration"),object:n().optional().describe("Data source object name"),filter:Se.optional().describe("Data filter criteria"),categoryField:n().optional().describe("Field for grouping (X-Axis)"),valueField:n().optional().describe("Field for values (Y-Axis)"),aggregate:g(["count","sum","avg","min","max"]).optional().default("count").describe("Aggregate function"),layout:l({x:m(),y:m(),w:m(),h:m()}).describe("Grid layout position"),options:I().optional().describe("Widget specific configuration"),responsive:ut.optional().describe("Responsive layout configuration"),aria:U.optional().describe("ARIA accessibility attributes")});l({name:ae.describe("Dashboard unique name"),label:z.describe("Dashboard label"),description:z.optional().describe("Dashboard description"),widgets:v(Rc).describe("Widgets to display"),refreshInterval:m().optional().describe("Auto-refresh interval in seconds"),dateRange:l({field:n().optional().describe("Default date field name for time-based filtering"),defaultRange:g(["today","yesterday","this_week","last_week","this_month","last_month","this_quarter","last_quarter","this_year","last_year","last_7_days","last_30_days","last_90_days","custom"]).default("this_month").describe("Default date range preset"),allowCustomRange:f().default(!0).describe("Allow users to pick a custom date range")}).optional().describe("Global dashboard date range filter configuration"),globalFilters:v(l({field:n().describe("Field name to filter on"),label:z.optional().describe("Display label for the filter"),type:g(["text","select","date","number"]).optional().describe("Filter input type")})).optional().describe("Global filters that apply to all widgets in the dashboard"),aria:U.optional().describe("ARIA accessibility attributes"),performance:pt.optional().describe("Performance optimization settings")});var Fc=g(["tabular","summary","matrix","joined"]),Mc=l({field:n().describe("Field name"),label:z.optional().describe("Override label"),aggregate:g(["sum","avg","max","min","count","unique"]).optional().describe("Aggregation function"),responsive:ut.optional().describe("Responsive visibility for this column")}),Dr=l({field:n().describe("Field to group by"),sortOrder:g(["asc","desc"]).default("asc"),dateGranularity:g(["day","week","month","quarter","year"]).optional().describe("For date fields")}),Lc=Tr.extend({xAxis:n().describe("Grouping field for X-Axis"),yAxis:n().describe("Summary field for Y-Axis"),groupBy:n().optional().describe("Additional grouping field")});l({name:ae.describe("Report unique name"),label:z.describe("Report label"),description:z.optional(),objectName:n().describe("Primary object"),type:Fc.default("tabular").describe("Report format type"),columns:v(Mc).describe("Columns to display"),groupingsDown:v(Dr).optional().describe("Row groupings"),groupingsAcross:v(Dr).optional().describe("Column groupings (Matrix only)"),filter:Se.optional().describe("Filter criteria"),chart:Lc.optional().describe("Embedded chart configuration"),aria:U.optional().describe("ARIA accessibility attributes"),performance:pt.optional().describe("Performance optimization settings")});var Uc=g(["aes-256-gcm","aes-256-cbc","chacha20-poly1305"]).describe("Supported encryption algorithm"),Vc=g(["local","aws-kms","azure-key-vault","gcp-kms","hashicorp-vault"]).describe("Key management service provider"),Wc=l({enabled:f().default(!1).describe("Enable automatic key rotation"),frequencyDays:m().min(1).default(90).describe("Rotation frequency in days"),retainOldVersions:m().default(3).describe("Number of old key versions to retain"),autoRotate:f().default(!0).describe("Automatically rotate without manual approval")}).describe("Policy for automatic encryption key rotation"),Zr=l({enabled:f().default(!1).describe("Enable field-level encryption"),algorithm:Uc.default("aes-256-gcm").describe("Encryption algorithm"),keyManagement:l({provider:Vc.describe("Key management service provider"),keyId:n().optional().describe("Key identifier in the provider"),rotationPolicy:Wc.optional().describe("Key rotation policy")}).describe("Key management configuration"),scope:g(["field","record","table","database"]).describe("Encryption scope level"),deterministicEncryption:f().default(!1).describe("Allows equality queries on encrypted data"),searchableEncryption:f().default(!1).describe("Allows search on encrypted data")}).describe("Field-level encryption configuration");l({fieldName:n().describe("Name of the field to encrypt"),encryptionConfig:Zr.describe("Encryption settings for this field"),indexable:f().default(!1).describe("Allow indexing on encrypted field")}).describe("Per-field encryption assignment");var qc=g(["redact","partial","hash","tokenize","randomize","nullify","substitute"]).describe("Data masking strategy for PII protection"),Rr=l({field:n().describe("Field name to apply masking to"),strategy:qc.describe("Masking strategy to use"),pattern:n().optional().describe("Regex pattern for partial masking"),preserveFormat:f().default(!0).describe("Keep the original data format after masking"),preserveLength:f().default(!0).describe("Keep the original data length after masking"),roles:v(n()).optional().describe("Roles that see masked data"),exemptRoles:v(n()).optional().describe("Roles that see unmasked data")}).describe("Masking rule for a single field");l({enabled:f().default(!1).describe("Enable data masking"),rules:v(Rr).describe("List of field-level masking rules"),auditUnmasking:f().default(!0).describe("Log when masked data is accessed unmasked")}).describe("Top-level data masking configuration for PII protection");var Fr=g(["text","textarea","email","url","phone","password","markdown","html","richtext","number","currency","percent","date","datetime","time","boolean","toggle","select","multiselect","radio","checkboxes","lookup","master_detail","tree","image","file","avatar","video","audio","formula","summary","autonumber","location","address","code","json","color","rating","slider","signature","qrcode","progress","tags","vector"]),Jc=l({label:n().describe("Display label (human-readable, any case allowed)"),value:mc.describe("Stored value (lowercase machine identifier)"),color:n().optional().describe("Color code for badges/charts"),default:f().optional().describe("Is default option")});l({latitude:m().min(-90).max(90).describe("Latitude coordinate"),longitude:m().min(-180).max(180).describe("Longitude coordinate"),altitude:m().optional().describe("Altitude in meters"),accuracy:m().optional().describe("Accuracy in meters")});var Gc=l({precision:m().int().min(0).max(10).default(2).describe("Decimal precision (default: 2)"),currencyMode:g(["dynamic","fixed"]).default("dynamic").describe("Currency mode: dynamic (user selectable) or fixed (single currency)"),defaultCurrency:n().length(3).default("CNY").describe("Default or fixed currency code (ISO 4217, e.g., USD, CNY, EUR)")});l({value:m().describe("Monetary amount"),currency:n().length(3).describe("Currency code (ISO 4217)")}),l({street:n().optional().describe("Street address"),city:n().optional().describe("City name"),state:n().optional().describe("State/Province"),postalCode:n().optional().describe("Postal/ZIP code"),country:n().optional().describe("Country name or code"),countryCode:n().optional().describe("ISO country code (e.g., US, GB)"),formatted:n().optional().describe("Formatted address string")});var Bc=l({dimensions:m().int().min(1).max(1e4).describe("Vector dimensionality (e.g., 1536 for OpenAI embeddings)"),distanceMetric:g(["cosine","euclidean","dotProduct","manhattan"]).default("cosine").describe("Distance/similarity metric for vector search"),normalized:f().default(!1).describe("Whether vectors are normalized (unit length)"),indexed:f().default(!0).describe("Whether to create a vector index for fast similarity search"),indexType:g(["hnsw","ivfflat","flat"]).optional().describe("Vector index algorithm (HNSW for high accuracy, IVFFlat for large datasets)")}),Hc=l({minSize:m().min(0).optional().describe("Minimum file size in bytes"),maxSize:m().min(1).optional().describe("Maximum file size in bytes (e.g., 10485760 = 10MB)"),allowedTypes:v(n()).optional().describe('Allowed file extensions (e.g., [".pdf", ".docx", ".jpg"])'),blockedTypes:v(n()).optional().describe('Blocked file extensions (e.g., [".exe", ".bat", ".sh"])'),allowedMimeTypes:v(n()).optional().describe('Allowed MIME types (e.g., ["image/jpeg", "application/pdf"])'),blockedMimeTypes:v(n()).optional().describe("Blocked MIME types"),virusScan:f().default(!1).describe("Enable virus scanning for uploaded files"),virusScanProvider:g(["clamav","virustotal","metadefender","custom"]).optional().describe("Virus scanning service provider"),virusScanOnUpload:f().default(!0).describe("Scan files immediately on upload"),quarantineOnThreat:f().default(!0).describe("Quarantine files if threat detected"),storageProvider:n().optional().describe("Object storage provider name (references ObjectStorageConfig)"),storageBucket:n().optional().describe("Target bucket name"),storagePrefix:n().optional().describe('Storage path prefix (e.g., "uploads/documents/")'),imageValidation:l({minWidth:m().min(1).optional().describe("Minimum image width in pixels"),maxWidth:m().min(1).optional().describe("Maximum image width in pixels"),minHeight:m().min(1).optional().describe("Minimum image height in pixels"),maxHeight:m().min(1).optional().describe("Maximum image height in pixels"),aspectRatio:n().optional().describe('Required aspect ratio (e.g., "16:9", "1:1")'),generateThumbnails:f().default(!1).describe("Auto-generate thumbnails"),thumbnailSizes:v(l({name:n().describe('Thumbnail variant name (e.g., "small", "medium", "large")'),width:m().min(1).describe("Thumbnail width in pixels"),height:m().min(1).describe("Thumbnail height in pixels"),crop:f().default(!1).describe("Crop to exact dimensions")})).optional().describe("Thumbnail size configurations"),preserveMetadata:f().default(!1).describe("Preserve EXIF metadata"),autoRotate:f().default(!0).describe("Auto-rotate based on EXIF orientation")}).optional().describe("Image-specific validation rules"),allowMultiple:f().default(!1).describe("Allow multiple file uploads (overrides field.multiple)"),allowReplace:f().default(!0).describe("Allow replacing existing files"),allowDelete:f().default(!0).describe("Allow deleting uploaded files"),requireUpload:f().default(!1).describe("Require at least one file when field is required"),extractMetadata:f().default(!0).describe("Extract file metadata (name, size, type, etc.)"),extractText:f().default(!1).describe("Extract text content from documents (OCR/parsing)"),versioningEnabled:f().default(!1).describe("Keep previous versions of replaced files"),maxVersions:m().min(1).optional().describe("Maximum number of versions to retain"),publicRead:f().default(!1).describe("Allow public read access to uploaded files"),presignedUrlExpiry:m().min(60).max(604800).default(3600).describe("Presigned URL expiration in seconds (default: 1 hour)")}).refine(e=>!(e.minSize!==void 0&&e.maxSize!==void 0&&e.minSize>e.maxSize),{message:"minSize must be less than or equal to maxSize"}).refine(e=>!(e.virusScanProvider!==void 0&&e.virusScan!==!0),{message:"virusScanProvider requires virusScan to be enabled"}),Kc=l({uniqueness:f().default(!1).describe("Enforce unique values across all records"),completeness:m().min(0).max(1).default(0).describe("Minimum ratio of non-null values (0-1, default: 0 = no requirement)"),accuracy:l({source:n().describe('Reference data source for validation (e.g., "api.verify.com", "master_data")'),threshold:m().min(0).max(1).describe("Minimum accuracy threshold (0-1, e.g., 0.95 = 95% match required)")}).optional().describe("Accuracy validation configuration")}),Yc=l({enabled:f().describe("Enable caching for computed field results"),ttl:m().min(0).describe("Cache TTL in seconds (0 = no expiration)"),invalidateOn:v(n()).describe('Field paths that invalidate cache (e.g., ["inventory.quantity", "pricing.base_price"])')}),Xc=l({name:n().regex(/^[a-z_][a-z0-9_]*$/).describe("Machine name (snake_case)").optional(),label:n().optional().describe("Human readable label"),type:Fr.describe("Field Data Type"),description:n().optional().describe("Tooltip/Help text"),format:n().optional().describe("Format string (e.g. email, phone)"),required:f().default(!1).describe("Is required"),searchable:f().default(!1).describe("Is searchable"),multiple:f().default(!1).describe("Allow multiple values (Stores as Array/JSON). Applicable for select, lookup, file, image."),unique:f().default(!1).describe("Is unique constraint"),defaultValue:I().optional().describe("Default value"),maxLength:m().optional().describe("Max character length"),minLength:m().optional().describe("Min character length"),precision:m().optional().describe("Total digits"),scale:m().optional().describe("Decimal places"),min:m().optional().describe("Minimum value"),max:m().optional().describe("Maximum value"),options:v(Jc).optional().describe("Static options for select/multiselect"),reference:n().optional().describe("Target Object Name"),referenceFilters:v(n()).optional().describe('Filters applied to lookup dialogs (e.g. "active = true")'),writeRequiresMasterRead:f().optional().describe("If true, user needs read access to master record to edit this field"),deleteBehavior:g(["set_null","cascade","restrict"]).optional().default("set_null").describe("What happens if referenced record is deleted"),expression:n().optional().describe("Formula expression"),summaryOperations:l({object:n(),field:n(),function:g(["count","sum","min","max","avg"])}).optional().describe("Roll-up summary definition"),language:n().optional().describe("Programming language for syntax highlighting (e.g., javascript, python, sql)"),theme:n().optional().describe("Code editor theme (e.g., dark, light, monokai)"),lineNumbers:f().optional().describe("Show line numbers in code editor"),maxRating:m().optional().describe("Maximum rating value (default: 5)"),allowHalf:f().optional().describe("Allow half-star ratings"),displayMap:f().optional().describe("Display map widget for location field"),allowGeocoding:f().optional().describe("Allow address-to-coordinate conversion"),addressFormat:g(["us","uk","international"]).optional().describe("Address format template"),colorFormat:g(["hex","rgb","rgba","hsl"]).optional().describe("Color value format"),allowAlpha:f().optional().describe("Allow transparency/alpha channel"),presetColors:v(n()).optional().describe("Preset color options"),step:m().optional().describe("Step increment for slider (default: 1)"),showValue:f().optional().describe("Display current value on slider"),marks:M(n(),n()).optional().describe('Custom marks/labels at specific values (e.g., {0: "Low", 50: "Medium", 100: "High"})'),barcodeFormat:g(["qr","ean13","ean8","code128","code39","upca","upce"]).optional().describe("Barcode format type"),qrErrorCorrection:g(["L","M","Q","H"]).optional().describe('QR code error correction level (L=7%, M=15%, Q=25%, H=30%). Only applicable when barcodeFormat is "qr"'),displayValue:f().optional().describe("Display human-readable value below barcode/QR code"),allowScanning:f().optional().describe("Enable camera scanning for barcode/QR code input"),currencyConfig:Gc.optional().describe("Configuration for currency field type"),vectorConfig:Bc.optional().describe("Configuration for vector field type (AI/ML embeddings)"),fileAttachmentConfig:Hc.optional().describe("Configuration for file and attachment field types"),encryptionConfig:Zr.optional().describe("Field-level encryption configuration for sensitive data (GDPR/HIPAA/PCI-DSS)"),maskingRule:Rr.optional().describe("Data masking rules for PII protection"),auditTrail:f().default(!1).describe("Enable detailed audit trail for this field (tracks all changes with user and timestamp)"),dependencies:v(n()).optional().describe("Array of field names that this field depends on (for formulas, visibility rules, etc.)"),cached:Yc.optional().describe("Caching configuration for computed/formula fields"),dataQuality:Kc.optional().describe("Data quality validation and monitoring rules"),group:n().optional().describe('Field group name for organizing fields in forms and layouts (e.g., "contact_info", "billing", "system")'),conditionalRequired:n().optional().describe(`Formula expression that makes this field required when TRUE (e.g., "status = 'closed_won'")`),hidden:f().default(!1).describe("Hidden from default UI"),readonly:f().default(!1).describe("Read-only in UI"),sortable:f().optional().default(!0).describe("Whether field is sortable in list views"),inlineHelpText:n().optional().describe("Help text displayed below the field in forms"),trackFeedHistory:f().optional().describe("Track field changes in Chatter/activity feed (Salesforce pattern)"),caseSensitive:f().optional().describe("Whether text comparisons are case-sensitive"),autonumberFormat:n().optional().describe('Auto-number display format pattern (e.g., "CASE-{0000}")'),index:f().default(!1).describe("Create standard database index"),externalId:f().default(!1).describe("Is external ID for upsert operations")}),Qc=l({name:n(),label:z,type:Fr,required:f().default(!1),options:v(l({label:z,value:n()})).optional()});l({name:ae.describe("Machine name (lowercase snake_case)"),label:z.describe("Display label"),icon:n().optional().describe("Icon name"),locations:v(g(["list_toolbar","list_item","record_header","record_more","record_related","global_nav"])).optional().describe("Locations where this action is visible"),component:g(["action:button","action:icon","action:menu","action:group"]).optional().describe("Visual component override"),type:g(["script","url","modal","flow","api"]).default("script").describe("Action functionality type"),target:n().optional().describe("URL, Script Name, Flow ID, or API Endpoint"),execute:n().optional().describe("Legacy execution logic"),params:v(Qc).optional().describe("Input parameters required from user"),variant:g(["primary","secondary","danger","ghost","link"]).optional().describe("Button visual variant for styling (primary = highlighted, danger = destructive, ghost = transparent)"),confirmText:z.optional().describe("Confirmation message before execution"),successMessage:z.optional().describe("Success message to show after execution"),refreshAfter:f().default(!1).describe("Refresh view after execution"),visible:n().optional().describe("Formula returning boolean"),disabled:P([f(),n()]).optional().describe("Whether the action is disabled, or a condition expression string"),shortcut:n().optional().describe('Keyboard shortcut to trigger this action (e.g., "Ctrl+S")'),bulkEnabled:f().optional().describe("Whether this action can be applied to multiple selected records"),timeout:m().optional().describe("Maximum execution time in milliseconds for the action"),aria:U.optional().describe("ARIA accessibility attributes")});var el=l({name:n().describe('Region name (e.g. "sidebar", "main", "header")'),width:g(["small","medium","large","full"]).optional(),components:v(Qe(()=>rl)).describe("Components in this region")}),tl=g(["page:header","page:footer","page:sidebar","page:tabs","page:accordion","page:card","page:section","record:details","record:highlights","record:related_list","record:activity","record:chatter","record:path","app:launcher","nav:menu","nav:breadcrumb","global:search","global:notifications","user:profile","ai:chat_window","ai:suggestion"]),rl=l({type:P([tl,n()]).describe("Component Type (Standard enum or custom string)"),id:n().optional().describe("Unique instance ID"),label:z.optional(),properties:M(n(),I()).describe("Component props passed to the widget. See component.zod.ts for schemas."),events:M(n(),n()).optional().describe("Event handlers map"),style:M(n(),n()).optional().describe("Inline styles or utility classes"),className:n().optional().describe("CSS class names"),visibility:n().optional().describe("Visibility filter/formula"),responsive:ut.optional().describe("Responsive layout configuration"),aria:U.optional().describe("ARIA accessibility attributes")}),il=l({name:n().describe("Variable name"),type:g(["string","number","boolean","object","array"]).default("string"),defaultValue:I().optional()});l({name:ae.describe("Page unique name (lowercase snake_case)"),label:z,description:z.optional(),type:g(["record","home","app","utility"]).default("record"),variables:v(il).optional().describe("Local page state variables"),object:n().optional().describe("Bound object (for Record pages)"),template:n().default("default").describe('Layout template name (e.g. "header-sidebar-main")'),regions:v(el).describe("Defined regions with components"),isDefault:f().default(!1),assignedProfiles:v(n()).optional(),aria:U.optional().describe("ARIA accessibility attributes")});var ol=l({onMount:n().optional().describe("Initialization code when widget mounts"),onUpdate:n().optional().describe("Code to run when props change"),onUnmount:n().optional().describe("Cleanup code when widget unmounts"),onValidate:n().optional().describe("Custom validation logic"),onFocus:n().optional().describe("Code to run on focus"),onBlur:n().optional().describe("Code to run on blur"),onError:n().optional().describe("Error handling code")}),nl=l({name:n().describe("Event name"),label:z.optional().describe("Human-readable event label"),description:z.optional().describe("Event description and usage"),bubbles:f().default(!1).describe("Whether event bubbles"),cancelable:f().default(!1).describe("Whether event is cancelable"),payload:M(n(),I()).optional().describe("Event payload schema")}),al=l({name:n().describe("Property name (camelCase)"),label:z.optional().describe("Human-readable label"),type:g(["string","number","boolean","array","object","function","any"]).describe("TypeScript type"),required:f().default(!1).describe("Whether property is required"),default:I().optional().describe("Default value"),description:z.optional().describe("Property description"),validation:M(n(),I()).optional().describe("Validation rules"),category:n().optional().describe("Property category")}),sl=wr("type",[l({type:ie("npm"),packageName:n().describe("NPM package name"),version:n().default("latest"),exportName:n().optional().describe("Named export (default: default)")}),l({type:ie("remote"),url:n().url().describe("Remote entry URL (.js)"),moduleName:n().describe("Exposed module name"),scope:n().describe("Remote scope name")}),l({type:ie("inline"),code:n().describe("JavaScript code body")})]);l({name:ae.describe("Widget identifier (snake_case)"),label:z.describe("Widget display name"),description:z.optional().describe("Widget description"),version:n().optional().describe("Widget version (semver)"),author:n().optional().describe("Widget author"),icon:n().optional().describe("Widget icon"),fieldTypes:v(n()).optional().describe("Supported field types"),category:g(["input","display","picker","editor","custom"]).default("custom").describe("Widget category"),lifecycle:ol.optional().describe("Lifecycle hooks"),events:v(nl).optional().describe("Custom events"),properties:v(al).optional().describe("Configuration properties"),implementation:sl.optional().describe("Widget implementation source"),dependencies:v(l({name:n(),version:n().optional(),url:n().url().optional()})).optional().describe("Widget dependencies"),screenshots:v(n().url()).optional().describe("Screenshot URLs"),documentation:n().url().optional().describe("Documentation URL"),license:n().optional().describe("License (SPDX identifier)"),tags:v(n()).optional().describe("Tags for categorization"),aria:U.optional().describe("ARIA accessibility attributes"),performance:pt.optional().describe("Performance optimization settings")}),l({value:I().describe("Current field value"),onChange:rc().input(Ne([I()])).output(Es()).describe("Callback to update field value"),readonly:f().default(!1).describe("Read-only mode flag"),required:f().default(!1).describe("Required field flag"),error:n().optional().describe("Validation error message"),field:Xc.describe("Field schema definition"),record:M(n(),I()).optional().describe("Complete record data"),options:M(n(),I()).optional().describe("Custom widget options")}),l({}),l({title:z.describe("Page title"),subtitle:z.optional().describe("Page subtitle"),icon:n().optional().describe("Icon name"),breadcrumb:f().default(!0).describe("Show breadcrumb"),actions:v(n()).optional().describe("Action IDs to show in header"),aria:U.optional().describe("ARIA accessibility attributes")}),l({type:g(["line","card","pill"]).default("line"),position:g(["top","left"]).default("top"),items:v(l({label:z,icon:n().optional(),children:v(I()).describe("Child components")})),aria:U.optional().describe("ARIA accessibility attributes")}),l({title:z.optional(),bordered:f().default(!0),actions:v(n()).optional(),body:v(I()).optional().describe("Card content components (slot)"),footer:v(I()).optional().describe("Card footer components (slot)"),aria:U.optional().describe("ARIA accessibility attributes")}),l({columns:g(["1","2","3","4"]).default("2"),layout:g(["auto","custom"]).default("auto"),sections:v(n()).optional().describe("Section IDs to show")}),l({objectName:n().describe("Related object name"),relationshipField:n().describe("Field on related object that points to this record"),columns:v(n()).describe("Fields to display"),sort:n().optional(),limit:m().default(5)}),l({fields:v(n()).min(1).max(7).describe("Key fields to highlights (max 7)")}),l({mode:g(["float","sidebar","inline"]).default("float")}),l({context:n().optional()});var Mr=l({minWidth:m().default(44).describe("Minimum touch target width in pixels (WCAG 2.5.5: 44px)"),minHeight:m().default(44).describe("Minimum touch target height in pixels (WCAG 2.5.5: 44px)"),padding:m().optional().describe("Additional padding around touch target in pixels"),hitSlop:l({top:m().optional().describe("Extra hit area above the element"),right:m().optional().describe("Extra hit area to the right of the element"),bottom:m().optional().describe("Extra hit area below the element"),left:m().optional().describe("Extra hit area to the left of the element")}).optional().describe("Invisible hit area extension beyond the visible bounds")}).describe("Touch target sizing configuration (WCAG accessible)"),cl=g(["swipe","pinch","long_press","double_tap","drag","rotate","pan"]).describe("Touch gesture type"),ll=g(["up","down","left","right"]),dl=l({direction:v(ll).describe("Allowed swipe directions"),threshold:m().optional().describe("Minimum distance in pixels to recognize swipe"),velocity:m().optional().describe("Minimum velocity (px/ms) to trigger swipe")}).describe("Swipe gesture recognition settings"),ul=l({minScale:m().optional().describe("Minimum scale factor (e.g., 0.5 for 50%)"),maxScale:m().optional().describe("Maximum scale factor (e.g., 3.0 for 300%)")}).describe("Pinch/zoom gesture recognition settings"),pl=l({duration:m().default(500).describe("Hold duration in milliseconds to trigger long press"),moveTolerance:m().optional().describe("Max movement in pixels allowed during press")}).describe("Long press gesture recognition settings"),fl=l({type:cl.describe("Gesture type to configure"),label:z.optional().describe("Descriptive label for the gesture action"),enabled:f().default(!0).describe("Whether this gesture is active"),swipe:dl.optional().describe("Swipe gesture settings (when type is swipe)"),pinch:ul.optional().describe("Pinch gesture settings (when type is pinch)"),longPress:pl.optional().describe("Long press settings (when type is long_press)")}).describe("Per-gesture configuration");l({gestures:v(fl).optional().describe("Configured gesture recognizers"),touchTarget:Mr.optional().describe("Touch target sizing and hit area"),hapticFeedback:f().optional().describe("Enable haptic feedback on touch interactions")}).merge(U.partial()).describe("Touch and gesture interaction configuration");var ml=l({enabled:f().default(!1).describe("Enable focus trapping within this container"),initialFocus:n().optional().describe("CSS selector for the element to focus on activation"),returnFocus:f().default(!0).describe("Return focus to trigger element on deactivation"),escapeDeactivates:f().default(!0).describe("Allow Escape key to deactivate the focus trap")}).describe("Focus trap configuration for modal-like containers"),bl=l({key:n().describe('Key combination (e.g., "Ctrl+S", "Alt+N", "Escape")'),action:n().describe("Action identifier to invoke when shortcut is triggered"),description:z.optional().describe("Human-readable description of what the shortcut does"),scope:g(["global","view","form","modal","list"]).default("global").describe("Scope in which this shortcut is active")}).describe("Keyboard shortcut binding"),Lr=l({tabOrder:g(["auto","manual"]).default("auto").describe("Tab order strategy: auto (DOM order) or manual (explicit tabIndex)"),skipLinks:f().default(!1).describe("Provide skip-to-content navigation links"),focusVisible:f().default(!0).describe("Show visible focus indicators for keyboard users"),focusTrap:ml.optional().describe("Focus trap settings"),arrowNavigation:f().default(!1).describe("Enable arrow key navigation between focusable items")}).describe("Focus and tab navigation management");l({shortcuts:v(bl).optional().describe("Registered keyboard shortcuts"),focusManagement:Lr.optional().describe("Focus and tab order management"),rovingTabindex:f().default(!1).describe("Enable roving tabindex pattern for composite widgets")}).merge(U.partial()).describe("Keyboard navigation and shortcut configuration");var hl=l({primary:n().describe("Primary brand color (hex, rgb, or hsl)"),secondary:n().optional().describe("Secondary brand color"),accent:n().optional().describe("Accent color for highlights"),success:n().optional().describe("Success state color (default: green)"),warning:n().optional().describe("Warning state color (default: yellow)"),error:n().optional().describe("Error state color (default: red)"),info:n().optional().describe("Info state color (default: blue)"),background:n().optional().describe("Background color"),surface:n().optional().describe("Surface/card background color"),text:n().optional().describe("Primary text color"),textSecondary:n().optional().describe("Secondary text color"),border:n().optional().describe("Border color"),disabled:n().optional().describe("Disabled state color"),primaryLight:n().optional().describe("Lighter shade of primary"),primaryDark:n().optional().describe("Darker shade of primary"),secondaryLight:n().optional().describe("Lighter shade of secondary"),secondaryDark:n().optional().describe("Darker shade of secondary")}),gl=l({fontFamily:l({base:n().optional().describe("Base font family (default: system fonts)"),heading:n().optional().describe("Heading font family"),mono:n().optional().describe("Monospace font family for code")}).optional(),fontSize:l({xs:n().optional().describe("Extra small font size (e.g., 0.75rem)"),sm:n().optional().describe("Small font size (e.g., 0.875rem)"),base:n().optional().describe("Base font size (e.g., 1rem)"),lg:n().optional().describe("Large font size (e.g., 1.125rem)"),xl:n().optional().describe("Extra large font size (e.g., 1.25rem)"),"2xl":n().optional().describe("2X large font size (e.g., 1.5rem)"),"3xl":n().optional().describe("3X large font size (e.g., 1.875rem)"),"4xl":n().optional().describe("4X large font size (e.g., 2.25rem)")}).optional(),fontWeight:l({light:m().optional().describe("Light weight (default: 300)"),normal:m().optional().describe("Normal weight (default: 400)"),medium:m().optional().describe("Medium weight (default: 500)"),semibold:m().optional().describe("Semibold weight (default: 600)"),bold:m().optional().describe("Bold weight (default: 700)")}).optional(),lineHeight:l({tight:n().optional().describe("Tight line height (e.g., 1.25)"),normal:n().optional().describe("Normal line height (e.g., 1.5)"),relaxed:n().optional().describe("Relaxed line height (e.g., 1.75)"),loose:n().optional().describe("Loose line height (e.g., 2)")}).optional(),letterSpacing:l({tighter:n().optional().describe("Tighter letter spacing (e.g., -0.05em)"),tight:n().optional().describe("Tight letter spacing (e.g., -0.025em)"),normal:n().optional().describe("Normal letter spacing (e.g., 0)"),wide:n().optional().describe("Wide letter spacing (e.g., 0.025em)"),wider:n().optional().describe("Wider letter spacing (e.g., 0.05em)")}).optional()}),vl=l({0:n().optional().describe("0 spacing (0)"),1:n().optional().describe("Spacing unit 1 (e.g., 0.25rem)"),2:n().optional().describe("Spacing unit 2 (e.g., 0.5rem)"),3:n().optional().describe("Spacing unit 3 (e.g., 0.75rem)"),4:n().optional().describe("Spacing unit 4 (e.g., 1rem)"),5:n().optional().describe("Spacing unit 5 (e.g., 1.25rem)"),6:n().optional().describe("Spacing unit 6 (e.g., 1.5rem)"),8:n().optional().describe("Spacing unit 8 (e.g., 2rem)"),10:n().optional().describe("Spacing unit 10 (e.g., 2.5rem)"),12:n().optional().describe("Spacing unit 12 (e.g., 3rem)"),16:n().optional().describe("Spacing unit 16 (e.g., 4rem)"),20:n().optional().describe("Spacing unit 20 (e.g., 5rem)"),24:n().optional().describe("Spacing unit 24 (e.g., 6rem)")}),yl=l({none:n().optional().describe("No border radius (0)"),sm:n().optional().describe("Small border radius (e.g., 0.125rem)"),base:n().optional().describe("Base border radius (e.g., 0.25rem)"),md:n().optional().describe("Medium border radius (e.g., 0.375rem)"),lg:n().optional().describe("Large border radius (e.g., 0.5rem)"),xl:n().optional().describe("Extra large border radius (e.g., 0.75rem)"),"2xl":n().optional().describe("2X large border radius (e.g., 1rem)"),full:n().optional().describe("Full border radius (50%)")}),_l=l({none:n().optional().describe("No shadow"),sm:n().optional().describe("Small shadow"),base:n().optional().describe("Base shadow"),md:n().optional().describe("Medium shadow"),lg:n().optional().describe("Large shadow"),xl:n().optional().describe("Extra large shadow"),"2xl":n().optional().describe("2X large shadow"),inner:n().optional().describe("Inner shadow (inset)")}),wl=l({xs:n().optional().describe("Extra small breakpoint (e.g., 480px)"),sm:n().optional().describe("Small breakpoint (e.g., 640px)"),md:n().optional().describe("Medium breakpoint (e.g., 768px)"),lg:n().optional().describe("Large breakpoint (e.g., 1024px)"),xl:n().optional().describe("Extra large breakpoint (e.g., 1280px)"),"2xl":n().optional().describe("2X large breakpoint (e.g., 1536px)")}),Sl=l({duration:l({fast:n().optional().describe("Fast animation (e.g., 150ms)"),base:n().optional().describe("Base animation (e.g., 300ms)"),slow:n().optional().describe("Slow animation (e.g., 500ms)")}).optional(),timing:l({linear:n().optional().describe("Linear timing function"),ease:n().optional().describe("Ease timing function"),easeIn:n().optional().describe("Ease-in timing function"),easeOut:n().optional().describe("Ease-out timing function"),easeInOut:n().optional().describe("Ease-in-out timing function")}).optional()}),kl=l({base:m().optional().describe("Base z-index (e.g., 0)"),dropdown:m().optional().describe("Dropdown z-index (e.g., 1000)"),sticky:m().optional().describe("Sticky z-index (e.g., 1020)"),fixed:m().optional().describe("Fixed z-index (e.g., 1030)"),modalBackdrop:m().optional().describe("Modal backdrop z-index (e.g., 1040)"),modal:m().optional().describe("Modal z-index (e.g., 1050)"),popover:m().optional().describe("Popover z-index (e.g., 1060)"),tooltip:m().optional().describe("Tooltip z-index (e.g., 1070)")}),xl=g(["light","dark","auto"]),zl=g(["compact","regular","spacious"]),Al=g(["AA","AAA"]);l({name:ae.describe("Unique theme identifier (snake_case)"),label:n().describe("Human-readable theme name"),description:n().optional().describe("Theme description"),mode:xl.default("light").describe("Theme mode (light, dark, or auto)"),colors:hl.describe("Color palette configuration"),typography:gl.optional().describe("Typography settings"),spacing:vl.optional().describe("Spacing scale"),borderRadius:yl.optional().describe("Border radius scale"),shadows:_l.optional().describe("Box shadow effects"),breakpoints:wl.optional().describe("Responsive breakpoints"),animation:Sl.optional().describe("Animation settings"),zIndex:kl.optional().describe("Z-index scale for layering"),customVars:M(n(),n()).optional().describe("Custom CSS variables (key-value pairs)"),logo:l({light:n().optional().describe("Logo URL for light mode"),dark:n().optional().describe("Logo URL for dark mode"),favicon:n().optional().describe("Favicon URL")}).optional().describe("Logo assets"),extends:n().optional().describe("Base theme to extend from"),density:zl.optional().describe("Display density: compact, regular, or spacious"),wcagContrast:Al.optional().describe("WCAG color contrast level (AA or AAA)"),rtl:f().optional().describe("Enable right-to-left layout direction"),touchTarget:Mr.optional().describe("Touch target sizing defaults"),keyboardNavigation:Lr.optional().describe("Keyboard focus management settings")});var Ur=g(["cache_first","network_first","stale_while_revalidate","network_only","cache_only"]).describe("Data fetching strategy for offline/online transitions"),$l=g(["client_wins","server_wins","manual","last_write_wins"]).describe("How to resolve conflicts when syncing offline changes"),Tl=l({strategy:Ur.default("network_first").describe("Sync fetch strategy"),conflictResolution:$l.default("last_write_wins").describe("Conflict resolution policy"),retryInterval:m().optional().describe("Retry interval in milliseconds between sync attempts"),maxRetries:m().optional().describe("Maximum number of sync retry attempts"),batchSize:m().optional().describe("Number of mutations to sync per batch")}).describe("Offline-to-online synchronization configuration"),El=g(["indexeddb","localstorage","sqlite"]).describe("Client-side storage backend for offline cache"),Nl=g(["lru","lfu","fifo"]).describe("Cache eviction policy"),jl=l({maxSize:m().optional().describe("Maximum cache size in bytes"),ttl:m().optional().describe("Time-to-live for cached entries in milliseconds"),persistStorage:El.default("indexeddb").describe("Storage backend"),evictionPolicy:Nl.default("lru").describe("Cache eviction policy when full")}).describe("Client-side offline cache configuration");l({enabled:f().default(!1).describe("Enable offline support"),strategy:Ur.default("network_first").describe("Default offline fetch strategy"),cache:jl.optional().describe("Cache settings for offline data"),sync:Tl.optional().describe("Sync settings for offline mutations"),offlineIndicator:f().default(!0).describe("Show a visual indicator when offline"),offlineMessage:z.optional().describe("Customizable offline status message shown to users"),queueMaxSize:m().optional().describe("Maximum number of queued offline mutations")}).describe("Offline support configuration");var Vr=g(["fade","slide_up","slide_down","slide_left","slide_right","scale","rotate","flip","none"]).describe("Transition preset type"),Wr=g(["linear","ease","ease_in","ease_out","ease_in_out","spring"]).describe("Animation easing function"),et=l({preset:Vr.optional().describe("Transition preset to apply"),duration:m().optional().describe("Transition duration in milliseconds"),easing:Wr.optional().describe("Easing function for the transition"),delay:m().optional().describe("Delay before transition starts in milliseconds"),customKeyframes:n().optional().describe("CSS @keyframes name for custom animations")}).describe("Animation transition configuration"),Ol=g(["on_mount","on_unmount","on_hover","on_focus","on_click","on_scroll","on_visible"]).describe("Event that triggers the animation"),Cl=l({label:z.optional().describe("Descriptive label for this animation configuration"),enter:et.optional().describe("Enter/mount animation"),exit:et.optional().describe("Exit/unmount animation"),hover:et.optional().describe("Hover state animation"),trigger:Ol.optional().describe("When to trigger the animation"),reducedMotion:g(["respect","disable","alternative"]).default("respect").describe("Accessibility: how to handle prefers-reduced-motion")}).merge(U.partial()).describe("Component-level animation configuration"),Il=l({type:Vr.default("fade").describe("Page transition type"),duration:m().default(300).describe("Transition duration in milliseconds"),easing:Wr.default("ease_in_out").describe("Easing function for the transition"),crossFade:f().default(!1).describe("Whether to cross-fade between pages")}).describe("Page-level transition configuration");l({label:z.optional().describe("Descriptive label for the motion configuration"),defaultTransition:et.optional().describe("Default transition applied to all animations"),pageTransitions:Il.optional().describe("Page navigation transition settings"),componentAnimations:M(n(),Cl).optional().describe("Component name to animation configuration mapping"),reducedMotion:f().default(!1).describe("When true, respect prefers-reduced-motion and suppress animations globally"),enabled:f().default(!0).describe("Enable or disable all animations globally")}).describe("Top-level motion and animation design configuration");var Pl=g(["toast","snackbar","banner","alert","inline"]).describe("Notification presentation style"),Dl=g(["info","success","warning","error"]).describe("Notification severity level"),qr=g(["top_left","top_center","top_right","bottom_left","bottom_center","bottom_right"]).describe("Screen position for notification placement"),Zl=l({label:z.describe("Action button label"),action:n().describe("Action identifier to execute"),variant:g(["primary","secondary","link"]).default("primary").describe("Button variant style")}).describe("Notification action button");l({type:Pl.default("toast").describe("Notification presentation style"),severity:Dl.default("info").describe("Notification severity level"),title:z.optional().describe("Notification title"),message:z.describe("Notification message body"),icon:n().optional().describe("Icon name override"),duration:m().optional().describe("Auto-dismiss duration in ms, omit for persistent"),dismissible:f().default(!0).describe("Allow user to dismiss the notification"),actions:v(Zl).optional().describe("Action buttons"),position:qr.optional().describe("Override default position")}).merge(U.partial()).describe("Notification instance definition"),l({defaultPosition:qr.default("top_right").describe("Default screen position for notifications"),defaultDuration:m().default(5e3).describe("Default auto-dismiss duration in ms"),maxVisible:m().default(5).describe("Maximum number of notifications visible at once"),stackDirection:g(["up","down"]).default("down").describe("Stack direction for multiple notifications"),pauseOnHover:f().default(!0).describe("Pause auto-dismiss timer on hover")}).describe("Global notification system configuration");var Rl=g(["element","handle","grip_icon"]).describe("Drag initiation method"),Fl=g(["move","copy","link","none"]).describe("Drop operation effect"),Ml=l({axis:g(["x","y","both"]).default("both").describe("Constrain drag axis"),bounds:g(["parent","viewport","none"]).default("none").describe("Constrain within bounds"),grid:Ne([m(),m()]).optional().describe("Snap to grid [x, y] in pixels")}).describe("Drag movement constraints"),Ll=l({label:z.optional().describe("Accessible label for the drop zone"),accept:v(n()).describe("Accepted drag item types"),maxItems:m().optional().describe("Maximum items allowed in drop zone"),highlightOnDragOver:f().default(!0).describe("Highlight drop zone when dragging over"),dropEffect:Fl.default("move").describe("Visual effect on drop")}).merge(U.partial()).describe("Drop zone configuration"),Ul=l({type:n().describe("Drag item type identifier for matching with drop zones"),label:z.optional().describe("Accessible label describing the draggable item"),handle:Rl.default("element").describe("How to initiate drag"),constraint:Ml.optional().describe("Drag movement constraints"),preview:g(["element","custom","none"]).default("element").describe("Drag preview type"),disabled:f().default(!1).describe("Disable dragging")}).merge(U.partial()).describe("Draggable item configuration");l({enabled:f().default(!1).describe("Enable drag and drop"),dragItem:Ul.optional().describe("Configuration for draggable item"),dropZone:Ll.optional().describe("Configuration for drop target"),sortable:f().default(!1).describe("Enable sortable list behavior"),autoScroll:f().default(!0).describe("Auto-scroll during drag near edges"),touchDelay:m().default(200).describe("Delay in ms before drag starts on touch devices")}).describe("Drag and drop interaction configuration");function Jr(){const e=typeof window<"u"?window.innerWidth:1024;return e<640?35:e<1024?50:60}function Gr({tasks:e,viewMode:t="month",startDate:r,endDate:i,onTaskClick:o,onViewChange:s,onAddClick:a,className:c}){const[d,u]=ne.useState(new Date),[h,y]=ne.useState(typeof window<"u"&&window.innerWidth<640?32:40),[w,x]=ne.useState(Jr());ne.useEffect(()=>{const S=()=>{y(window.innerWidth<640?32:40),x(Jr())};return window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const j=ne.useMemo(()=>{let S=r?new Date(r):new Date,$=i?new Date(i):new Date;return!r&&e.length>0&&(S=new Date(Math.min(...e.map(oe=>oe.start.getTime()))),S.setDate(S.getDate()-7)),!i&&e.length>0&&($=new Date(Math.max(...e.map(oe=>oe.end.getTime()))),$.setDate($.getDate()+14)),S.setHours(0,0,0,0),$.setHours(23,59,59,999),{start:S,end:$}},[r,i,e]),E=ne.useMemo(()=>{const S=[],$=new Date(j.start);for(;$<=j.end;)S.push({date:new Date($),label:$.getDate().toString(),isWeekend:$.getDay()===0||$.getDay()===6}),$.setDate($.getDate()+1);return S},[j]),q=300,re=ne.useRef(null),se=ne.useRef(null),J=ne.useRef(null),D=S=>{re.current&&(re.current.scrollLeft=S.currentTarget.scrollLeft),se.current&&(se.current.scrollTop=S.currentTarget.scrollTop)},C=S=>{j.end.getTime()-j.start.getTime();const $=w,oe=1e3*60*60*24,fe=S.start.getTime()-j.start.getTime(),B=S.end.getTime()-S.start.getTime(),Oe=fe/oe*$,me=Math.max(B/oe*$,$);return{left:Oe,width:me}};return _.jsxs("div",{className:G.cn("flex flex-col h-full bg-background border rounded-lg overflow-hidden",c),children:[_.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 p-2 border-b bg-card",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsxs(G.Button,{variant:"outline",size:"sm",onClick:()=>a?.(),"aria-label":"Create new task",children:[_.jsx(xe.Plus,{className:"h-4 w-4 mr-1 sm:mr-2"}),_.jsx("span",{className:"hidden sm:inline",children:"New Task"}),_.jsx("span",{className:"sm:hidden",children:"New"})]}),_.jsx("div",{className:"h-4 w-px bg-border mx-1 sm:mx-2"}),_.jsx(G.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",children:_.jsx(xe.ChevronLeft,{className:"h-4 w-4"})}),_.jsx(G.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",children:_.jsx(xe.ChevronRight,{className:"h-4 w-4"})}),_.jsx("span",{className:"font-semibold text-xs sm:text-sm",children:j.start.toLocaleDateString(void 0,{month:"long",year:"numeric"})})]}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsxs(G.Select,{value:t,onValueChange:S=>s?.(S),children:[_.jsx(G.SelectTrigger,{className:"w-[100px] sm:w-[120px] h-8",children:_.jsx(G.SelectValue,{})}),_.jsxs(G.SelectContent,{children:[_.jsx(G.SelectItem,{value:"day",children:"Day View"}),_.jsx(G.SelectItem,{value:"week",children:"Week View"}),_.jsx(G.SelectItem,{value:"month",children:"Month View"}),_.jsx(G.SelectItem,{value:"quarter",children:"Quarter View"})]})]}),_.jsxs("div",{className:"flex bg-muted rounded-md p-1",children:[_.jsx(G.Button,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>x(S=>Math.max(15,S-10)),children:_.jsx(xe.ZoomOut,{className:"h-3 w-3"})}),_.jsx(G.Button,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>x(S=>Math.min(120,S+10)),children:_.jsx(xe.ZoomIn,{className:"h-3 w-3"})})]})]})]}),_.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[_.jsxs("div",{className:"flex border-b bg-muted/30 shrink-0 h-10 sm:h-[50px]",children:[_.jsxs("div",{className:"flex items-center font-medium text-xs text-muted-foreground px-2 sm:px-4 border-r bg-card z-20 shadow-sm",style:{width:q,minWidth:q},children:[_.jsx("div",{className:"flex-1",children:"Task Name"}),_.jsx("div",{className:"w-16 sm:w-20 text-right hidden sm:block",children:"Start"}),_.jsx("div",{className:"w-16 sm:w-20 text-right hidden sm:block",children:"End"})]}),_.jsx("div",{className:"flex-1 overflow-hidden",ref:re,children:_.jsx("div",{className:"flex h-full",style:{width:E.length*w},children:E.map((S,$)=>_.jsxs("div",{className:G.cn("flex flex-col items-center justify-center border-r text-xs text-muted-foreground h-full",S.isWeekend&&"bg-muted/50"),style:{width:w,minWidth:w},children:[_.jsx("span",{className:"font-medium text-foreground",children:S.label}),_.jsx("span",{className:"text-[10px] opacity-70",children:S.date.toLocaleDateString(void 0,{weekday:"narrow"})})]},$))})})]}),_.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[_.jsx("div",{className:"overflow-hidden border-r bg-card z-10 shadow-sm",ref:se,style:{width:q,minWidth:q},children:e.map(S=>_.jsxs("div",{className:"flex items-center border-b px-2 sm:px-4 hover:bg-accent/50 cursor-pointer transition-colors touch-manipulation",style:{height:h},onClick:()=>o?.(S),children:[_.jsxs("div",{className:"flex-1 truncate font-medium text-xs sm:text-sm flex items-center gap-2",children:[_.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:S.color||"#3b82f6"}}),S.title]}),_.jsx("div",{className:"w-16 sm:w-20 text-right text-xs text-muted-foreground hidden sm:block",children:S.start.toLocaleDateString(void 0,{month:"numeric",day:"numeric"})}),_.jsx("div",{className:"w-16 sm:w-20 text-right text-xs text-muted-foreground hidden sm:block",children:S.end.toLocaleDateString(void 0,{month:"numeric",day:"numeric"})})]},S.id))}),_.jsx("div",{className:"flex-1 overflow-auto bg-background/50 relative [-webkit-overflow-scrolling:touch]",ref:J,onScroll:D,children:_.jsx("div",{style:{width:E.length*w},children:_.jsxs("div",{className:"relative",children:[_.jsx("div",{className:"absolute inset-0 flex pointer-events-none z-0",children:E.map((S,$)=>_.jsx("div",{className:G.cn("border-r h-full",S.isWeekend&&"bg-muted/20"),style:{width:w,minWidth:w}},$))}),e.map(S=>{const $=C(S);return _.jsx("div",{className:"relative border-b hover:bg-black/5",style:{height:h},children:_.jsxs("div",{className:"absolute top-1 sm:top-2 h-[calc(100%-8px)] sm:h-[calc(100%-16px)] rounded-sm bg-primary border border-primary-foreground/20 shadow-sm cursor-pointer hover:brightness-110 flex items-center px-2 group",style:{left:$.left,width:$.width,backgroundColor:S.color||"#3b82f6"},onClick:()=>o?.(S),children:[S.progress>0&&_.jsx("div",{className:"absolute left-0 top-0 bottom-0 bg-black/20 rounded-l-sm",style:{width:`${S.progress}%`}}),_.jsxs("span",{className:"text-[10px] text-white font-medium truncate opacity-0 group-hover:opacity-100 transition-opacity",children:[Math.round(S.progress),"%"]})]})},S.id)}),_.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-red-500 z-20 pointer-events-none",style:{left:(new Date().getTime()-j.start.getTime())/(1e3*60*60*24)*w},children:_.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 -ml-[3px]"})})]})})})]})]})]})}function Vl(e){return e.data?e.data:e.staticData?{provider:"value",items:e.staticData}:e.objectName?{provider:"object",object:e.objectName}:null}function Wl(e){if(e){if(typeof e=="string"){const t=e.split(" "),r=t[0],i=t[1]?.toLowerCase()==="desc"?"desc":"asc";return{[r]:i}}if(Array.isArray(e))return e.reduce((t,r)=>(r.field&&r.order&&(t[r.field]=r.order),t),{})}}function ql(e){let t=null;if(e.startDateField&&e.endDateField)return t={startDateField:e.startDateField,endDateField:e.endDateField,titleField:e.titleField||"name",progressField:e.progressField,dependenciesField:e.dependenciesField||e.dependencyField,colorField:e.colorField},t;if(e.gantt&&(t=e.gantt),t){const r=Or.safeParse(t);return r.success||console.warn("[ObjectGantt] Invalid gantt configuration:",r.error.format()),t}return null}const Br=({schema:e,dataSource:t,className:r,onTaskClick:i,onRowClick:o,...s})=>{const[a,c]=K.useState([]),[d,u]=K.useState(!0),[h,y]=K.useState(null),[w,x]=K.useState(null),j=Vl(e),E=K.useMemo(()=>j,[JSON.stringify(j)]),q=ql(e),re=E?.provider==="value";K.useEffect(()=>{(async()=>{try{if(u(!0),s.data&&Array.isArray(s.data)){c(s.data),u(!1);return}if(re&&E?.provider==="value"){c(E.items),u(!1);return}if(!t)throw new Error("DataSource required for object/api providers");if(E?.provider==="object"){const C=E.object,S=await t.find(C,{$filter:e.filter,$orderby:Wl(e.sort)});let $=[];Array.isArray(S)?$=S:S&&typeof S=="object"&&(Array.isArray(S.data)?$=S.data:Array.isArray(S.records)&&($=S.records)),c($)}else E?.provider==="api"&&(console.warn("API provider not yet implemented for ObjectGantt"),c([]));u(!1)}catch(C){y(C),u(!1)}})()},[E,t,re,e.filter,e.sort]),K.useEffect(()=>{!re&&t&&(async()=>{try{if(!t)return;const C=E?.provider==="object"?E.object:e.objectName;if(!C)return;const S=await t.getObjectSchema(C);x(S)}catch(C){console.error("Failed to fetch object schema:",C)}})()},[e.objectName,t,re,E]);const se=K.useMemo(()=>{if(!q||!a.length)return[];const{startDateField:D,endDateField:C,titleField:S,progressField:$,dependenciesField:oe,colorField:fe}=q;return a.map((B,Oe)=>{const me=B[D],Ce=B[C],gt=B[S]||"Untitled Task",Ie=$?B[$]:0,Pe=oe?B[oe]:[],tt=fe?B[fe]:void 0;return{id:B.id||B._id||`task-${Oe}`,title:gt,start:me?new Date(me):new Date,end:Ce?new Date(Ce):new Date,progress:Math.min(100,Math.max(0,Ie||0)),dependencies:Array.isArray(Pe)?Pe:[],color:tt,data:B}}).filter(B=>!isNaN(B.start.getTime())&&!isNaN(B.end.getTime()))},[a,q]),J=wt.useNavigationOverlay({navigation:e.navigation,objectName:e.objectName,onRowClick:o});return d?_.jsx("div",{className:r,children:_.jsx("div",{className:"flex items-center justify-center h-96",children:_.jsx("div",{className:"text-muted-foreground",children:"Loading Gantt chart..."})})}):h?_.jsx("div",{className:r,children:_.jsx("div",{className:"flex items-center justify-center h-96",children:_.jsxs("div",{className:"text-destructive",children:["Error: ",h.message]})})}):q?_.jsxs("div",{className:r,children:[_.jsx("div",{className:"h-[calc(100vh-200px)] min-h-[600px]",children:_.jsx(Gr,{tasks:se,onTaskClick:D=>{J.handleClick(D.data),i?.(D.data)},onAddClick:()=>{}})}),J.isOverlay&&_.jsx(G.NavigationOverlay,{...J,title:"Task Details",children:D=>_.jsx("div",{className:"space-y-3",children:Object.entries(D).map(([C,S])=>_.jsxs("div",{className:"flex flex-col",children:[_.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:C.replace(/_/g," ")}),_.jsx("span",{className:"text-sm",children:String(S??"—")})]},C))})})]}):_.jsx("div",{className:r,children:_.jsx("div",{className:"flex items-center justify-center h-96",children:_.jsx("div",{className:"text-muted-foreground",children:"Gantt configuration required. Please specify startDateField, endDateField, and titleField."})})})},ht=({schema:e})=>{const{dataSource:t}=wt.useSchemaContext();return _.jsx(Br,{schema:e,dataSource:t})};_t.ComponentRegistry.register("object-gantt",ht,{namespace:"plugin-gantt",label:"Object Gantt",category:"view",inputs:[{name:"objectName",type:"string",label:"Object Name",required:!0},{name:"gantt",type:"object",label:"Gantt Config",description:"startDateField, endDateField, titleField, progressField, percentageField, colorField, dependenciesField"}]}),_t.ComponentRegistry.register("gantt",ht,{namespace:"view",label:"Gantt View",category:"view",inputs:[{name:"objectName",type:"string",label:"Object Name",required:!0},{name:"gantt",type:"object",label:"Gantt Config",description:"startDateField, endDateField, titleField, progressField, percentageField, colorField, dependenciesField"}]}),X.GanttView=Gr,X.ObjectGantt=Br,X.ObjectGanttRenderer=ht,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})}));
44
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const c=a[1];if(t===a[0]){s(a);continue}if(e.external){const u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){s(a);continue}}if(e.metadataRegistry.get(a[0])?.id){s(a);continue}if(c.cycle){s(a);continue}if(c.count>1&&e.reused==="ref"){s(a);continue}}}function mi(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=a=>{const c=e.seen.get(a);if(c.ref===null)return;const d=c.def??c.schema,u={...d},v=c.ref;if(c.ref=null,v){o(v);const w=e.seen.get(v),z=w.schema;if(z.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(z)):Object.assign(d,z),Object.assign(d,u),a._zod.parent===v)for(const E in d)E==="$ref"||E==="allOf"||E in u||delete d[E];if(z.$ref&&w.def)for(const E in d)E==="$ref"||E==="allOf"||E in w.def&&JSON.stringify(d[E])===JSON.stringify(w.def[E])&&delete d[E]}const y=a._zod.parent;if(y&&y!==v){o(y);const w=e.seen.get(y);if(w?.schema.$ref&&(d.$ref=w.schema.$ref,w.def))for(const z in d)z==="$ref"||z==="allOf"||z in w.def&&JSON.stringify(d[z])===JSON.stringify(w.def[z])&&delete d[z]}e.override({zodSchema:a,jsonSchema:d,path:c.path??[]})};for(const a of[...e.seen.entries()].reverse())o(a[0]);const r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(a)}Object.assign(r,i.def??i.schema);const s=e.external?.defs??{};for(const a of e.seen.entries()){const c=a[1];c.def&&c.defId&&(s[c.defId]=c.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{const a=JSON.parse(JSON.stringify(r));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ye(t,"input",e.processors),output:Ye(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function H(e,t){const i=t??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return H(o.element,i);if(o.type==="set")return H(o.valueType,i);if(o.type==="lazy")return H(o.getter(),i);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return H(o.innerType,i);if(o.type==="intersection")return H(o.left,i)||H(o.right,i);if(o.type==="record"||o.type==="map")return H(o.keyType,i)||H(o.valueType,i);if(o.type==="pipe")return H(o.in,i)||H(o.out,i);if(o.type==="object"){for(const r in o.shape)if(H(o.shape[r],i))return!0;return!1}if(o.type==="union"){for(const r of o.options)if(H(r,i))return!0;return!1}if(o.type==="tuple"){for(const r of o.items)if(H(r,i))return!0;return!!(o.rest&&H(o.rest,i))}return!1}const la=(e,t={})=>i=>{const o=pi({...i,processors:t});return F(e,o),fi(o,e),mi(o,e)},Ye=(e,t,i={})=>o=>{const{libraryOptions:r,target:s}=o??{},a=pi({...r??{},target:s,io:t,processors:i});return F(e,a),fi(a,e),mi(a,e)},da={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ua=(e,t,i,o)=>{const r=i;r.type="string";const{minimum:s,maximum:a,format:c,patterns:d,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(r.minLength=s),typeof a=="number"&&(r.maxLength=a),c&&(r.format=da[c]??c,r.format===""&&delete r.format,c==="time"&&delete r.format),u&&(r.contentEncoding=u),d&&d.size>0){const v=[...d];v.length===1?r.pattern=v[0].source:v.length>1&&(r.allOf=[...v.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},pa=(e,t,i,o)=>{const r=i,{minimum:s,maximum:a,format:c,multipleOf:d,exclusiveMaximum:u,exclusiveMinimum:v}=e._zod.bag;typeof c=="string"&&c.includes("int")?r.type="integer":r.type="number",typeof v=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.minimum=v,r.exclusiveMinimum=!0):r.exclusiveMinimum=v),typeof s=="number"&&(r.minimum=s,typeof v=="number"&&t.target!=="draft-04"&&(v>=s?delete r.minimum:delete r.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.maximum=u,r.exclusiveMaximum=!0):r.exclusiveMaximum=u),typeof a=="number"&&(r.maximum=a,typeof u=="number"&&t.target!=="draft-04"&&(u<=a?delete r.maximum:delete r.exclusiveMaximum)),typeof d=="number"&&(r.multipleOf=d)},fa=(e,t,i,o)=>{i.type="boolean"},ma=(e,t,i,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},ba=(e,t,i,o)=>{i.not={}},ha=(e,t,i,o)=>{},ga=(e,t,i,o)=>{},va=(e,t,i,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},ya=(e,t,i,o)=>{const r=e._zod.def,s=$t(r.entries);s.every(a=>typeof a=="number")&&(i.type="number"),s.every(a=>typeof a=="string")&&(i.type="string"),i.enum=s},_a=(e,t,i,o)=>{const r=e._zod.def,s=[];for(const a of r.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(a))}else s.push(a);if(s.length!==0)if(s.length===1){const a=s[0];i.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?i.enum=[a]:i.const=a}else s.every(a=>typeof a=="number")&&(i.type="number"),s.every(a=>typeof a=="string")&&(i.type="string"),s.every(a=>typeof a=="boolean")&&(i.type="boolean"),s.every(a=>a===null)&&(i.type="null"),i.enum=s},wa=(e,t,i,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Sa=(e,t,i,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},ka=(e,t,i,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},xa=(e,t,i,o)=>{const r=i,s=e._zod.def,{minimum:a,maximum:c}=e._zod.bag;typeof a=="number"&&(r.minItems=a),typeof c=="number"&&(r.maxItems=c),r.type="array",r.items=F(s.element,t,{...o,path:[...o.path,"items"]})},za=(e,t,i,o)=>{const r=i,s=e._zod.def;r.type="object",r.properties={};const a=s.shape;for(const u in a)r.properties[u]=F(a[u],t,{...o,path:[...o.path,"properties",u]});const c=new Set(Object.keys(a)),d=new Set([...c].filter(u=>{const v=s.shape[u]._zod;return t.io==="input"?v.optin===void 0:v.optout===void 0}));d.size>0&&(r.required=Array.from(d)),s.catchall?._zod.def.type==="never"?r.additionalProperties=!1:s.catchall?s.catchall&&(r.additionalProperties=F(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},Aa=(e,t,i,o)=>{const r=e._zod.def,s=r.inclusive===!1,a=r.options.map((c,d)=>F(c,t,{...o,path:[...o.path,s?"oneOf":"anyOf",d]}));s?i.oneOf=a:i.anyOf=a},$a=(e,t,i,o)=>{const r=e._zod.def,s=F(r.left,t,{...o,path:[...o.path,"allOf",0]}),a=F(r.right,t,{...o,path:[...o.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,d=[...c(s)?s.allOf:[s],...c(a)?a.allOf:[a]];i.allOf=d},Ta=(e,t,i,o)=>{const r=i,s=e._zod.def;r.type="array";const a=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=s.items.map((w,z)=>F(w,t,{...o,path:[...o.path,a,z]})),u=s.rest?F(s.rest,t,{...o,path:[...o.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;t.target==="draft-2020-12"?(r.prefixItems=d,u&&(r.items=u)):t.target==="openapi-3.0"?(r.items={anyOf:d},u&&r.items.anyOf.push(u),r.minItems=d.length,u||(r.maxItems=d.length)):(r.items=d,u&&(r.additionalItems=u));const{minimum:v,maximum:y}=e._zod.bag;typeof v=="number"&&(r.minItems=v),typeof y=="number"&&(r.maxItems=y)},Ea=(e,t,i,o)=>{const r=i,s=e._zod.def;r.type="object";const a=s.keyType,d=a._zod.bag?.patterns;if(s.mode==="loose"&&d&&d.size>0){const v=F(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});r.patternProperties={};for(const y of d)r.patternProperties[y.source]=v}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=F(s.keyType,t,{...o,path:[...o.path,"propertyNames"]})),r.additionalProperties=F(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]});const u=a._zod.values;if(u){const v=[...u].filter(y=>typeof y=="string"||typeof y=="number");v.length>0&&(r.required=v)}},Na=(e,t,i,o)=>{const r=e._zod.def,s=F(r.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=r.innerType,i.nullable=!0):i.anyOf=[s,{type:"null"}]},ja=(e,t,i,o)=>{const r=e._zod.def;F(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType},Oa=(e,t,i,o)=>{const r=e._zod.def;F(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType,i.default=JSON.parse(JSON.stringify(r.defaultValue))},Ia=(e,t,i,o)=>{const r=e._zod.def;F(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType,t.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},Ca=(e,t,i,o)=>{const r=e._zod.def;F(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType;let a;try{a=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=a},Pa=(e,t,i,o)=>{const r=e._zod.def,s=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;F(s,t,o);const a=t.seen.get(e);a.ref=s},Da=(e,t,i,o)=>{const r=e._zod.def;F(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType,i.readOnly=!0},bi=(e,t,i,o)=>{const r=e._zod.def;F(r.innerType,t,o);const s=t.seen.get(e);s.ref=r.innerType},Za=(e,t,i,o)=>{const r=e._zod.innerType;F(r,t,o);const s=t.seen.get(e);s.ref=r},Ra=p("ZodISODateTime",(e,t)=>{xr.init(e,t),M.init(e,t)});function Fa(e){return Dn(Ra,e)}const Ma=p("ZodISODate",(e,t)=>{zr.init(e,t),M.init(e,t)});function La(e){return Zn(Ma,e)}const Ua=p("ZodISOTime",(e,t)=>{Ar.init(e,t),M.init(e,t)});function Va(e){return Rn(Ua,e)}const Wa=p("ZodISODuration",(e,t)=>{$r.init(e,t),M.init(e,t)});function qa(e){return Fn(Wa,e)}const Q=p("ZodError",(e,t)=>{It.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>go(e,i)},flatten:{value:i=>ho(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,ot,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,ot,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ja=Me(Q),Ga=Le(Q),Ba=Ue(Q),Ha=Ve(Q),Ka=_o(Q),Ya=wo(Q),Xa=So(Q),Qa=ko(Q),es=xo(Q),ts=zo(Q),is=Ao(Q),os=$o(Q),I=p("ZodType",(e,t)=>(N.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ye(e,"input"),output:Ye(e,"output")}}),e.toJSONSchema=la(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone(le(t,{checks:[...t.checks??[],...i.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),e.with=e.check,e.clone=(i,o)=>de(e,i,o),e.brand=()=>e,e.register=((i,o)=>(i.add(e,o),e)),e.parse=(i,o)=>Ja(e,i,o,{callee:e.parse}),e.safeParse=(i,o)=>Ba(e,i,o),e.parseAsync=async(i,o)=>Ga(e,i,o,{callee:e.parseAsync}),e.safeParseAsync=async(i,o)=>Ha(e,i,o),e.spa=e.safeParseAsync,e.encode=(i,o)=>Ka(e,i,o),e.decode=(i,o)=>Ya(e,i,o),e.encodeAsync=async(i,o)=>Xa(e,i,o),e.decodeAsync=async(i,o)=>Qa(e,i,o),e.safeEncode=(i,o)=>es(e,i,o),e.safeDecode=(i,o)=>ts(e,i,o),e.safeEncodeAsync=async(i,o)=>is(e,i,o),e.safeDecodeAsync=async(i,o)=>os(e,i,o),e.refine=(i,o)=>e.check(rc(i,o)),e.superRefine=i=>e.check(nc(i)),e.overwrite=i=>e.check(we(i)),e.optional=()=>ki(e),e.exactOptional=()=>Us(e),e.nullable=()=>xi(e),e.nullish=()=>ki(xi(e)),e.nonoptional=i=>Bs(e,i),e.array=()=>g(e),e.or=i=>P([e,i]),e.and=i=>Ps(e,i),e.transform=i=>Ai(e,Ms(i)),e.default=i=>qs(e,i),e.prefault=i=>Gs(e,i),e.catch=i=>Ks(e,i),e.pipe=i=>Ai(e,i),e.readonly=()=>Qs(e),e.describe=i=>{const o=e.clone();return Ee.add(o,{description:i}),o},Object.defineProperty(e,"description",{get(){return Ee.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return Ee.get(e);const o=e.clone();return Ee.add(o,i[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),hi=p("_ZodString",(e,t)=>{st.init(e,t),I.init(e,t),e._zod.processJSONSchema=(o,r,s)=>ua(e,o,r);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...o)=>e.check(Bn(...o)),e.includes=(...o)=>e.check(Yn(...o)),e.startsWith=(...o)=>e.check(Xn(...o)),e.endsWith=(...o)=>e.check(Qn(...o)),e.min=(...o)=>e.check(Ke(...o)),e.max=(...o)=>e.check(di(...o)),e.length=(...o)=>e.check(ui(...o)),e.nonempty=(...o)=>e.check(Ke(1,...o)),e.lowercase=o=>e.check(Hn(o)),e.uppercase=o=>e.check(Kn(o)),e.trim=()=>e.check(ta()),e.normalize=(...o)=>e.check(ea(...o)),e.toLowerCase=()=>e.check(ia()),e.toUpperCase=()=>e.check(oa()),e.slugify=()=>e.check(ra())}),rs=p("ZodString",(e,t)=>{st.init(e,t),hi.init(e,t),e.email=i=>e.check(bn(ns,i)),e.url=i=>e.check(_n(as,i)),e.jwt=i=>e.check(Pn(ws,i)),e.emoji=i=>e.check(wn(ss,i)),e.guid=i=>e.check(ai(gi,i)),e.uuid=i=>e.check(hn(Xe,i)),e.uuidv4=i=>e.check(gn(Xe,i)),e.uuidv6=i=>e.check(vn(Xe,i)),e.uuidv7=i=>e.check(yn(Xe,i)),e.nanoid=i=>e.check(Sn(cs,i)),e.guid=i=>e.check(ai(gi,i)),e.cuid=i=>e.check(kn(ls,i)),e.cuid2=i=>e.check(xn(ds,i)),e.ulid=i=>e.check(zn(us,i)),e.base64=i=>e.check(On(vs,i)),e.base64url=i=>e.check(In(ys,i)),e.xid=i=>e.check(An(ps,i)),e.ksuid=i=>e.check($n(fs,i)),e.ipv4=i=>e.check(Tn(ms,i)),e.ipv6=i=>e.check(En(bs,i)),e.cidrv4=i=>e.check(Nn(hs,i)),e.cidrv6=i=>e.check(jn(gs,i)),e.e164=i=>e.check(Cn(_s,i)),e.datetime=i=>e.check(Fa(i)),e.date=i=>e.check(La(i)),e.time=i=>e.check(Va(i)),e.duration=i=>e.check(qa(i))});function n(e){return mn(rs,e)}const M=p("ZodStringFormat",(e,t)=>{R.init(e,t),hi.init(e,t)}),ns=p("ZodEmail",(e,t)=>{br.init(e,t),M.init(e,t)}),gi=p("ZodGUID",(e,t)=>{fr.init(e,t),M.init(e,t)}),Xe=p("ZodUUID",(e,t)=>{mr.init(e,t),M.init(e,t)}),as=p("ZodURL",(e,t)=>{hr.init(e,t),M.init(e,t)}),ss=p("ZodEmoji",(e,t)=>{gr.init(e,t),M.init(e,t)}),cs=p("ZodNanoID",(e,t)=>{vr.init(e,t),M.init(e,t)}),ls=p("ZodCUID",(e,t)=>{yr.init(e,t),M.init(e,t)}),ds=p("ZodCUID2",(e,t)=>{_r.init(e,t),M.init(e,t)}),us=p("ZodULID",(e,t)=>{wr.init(e,t),M.init(e,t)}),ps=p("ZodXID",(e,t)=>{Sr.init(e,t),M.init(e,t)}),fs=p("ZodKSUID",(e,t)=>{kr.init(e,t),M.init(e,t)}),ms=p("ZodIPv4",(e,t)=>{Tr.init(e,t),M.init(e,t)}),bs=p("ZodIPv6",(e,t)=>{Er.init(e,t),M.init(e,t)}),hs=p("ZodCIDRv4",(e,t)=>{Nr.init(e,t),M.init(e,t)}),gs=p("ZodCIDRv6",(e,t)=>{jr.init(e,t),M.init(e,t)}),vs=p("ZodBase64",(e,t)=>{Or.init(e,t),M.init(e,t)}),ys=p("ZodBase64URL",(e,t)=>{Cr.init(e,t),M.init(e,t)}),_s=p("ZodE164",(e,t)=>{Pr.init(e,t),M.init(e,t)}),ws=p("ZodJWT",(e,t)=>{Zr.init(e,t),M.init(e,t)}),vi=p("ZodNumber",(e,t)=>{qt.init(e,t),I.init(e,t),e._zod.processJSONSchema=(o,r,s)=>pa(e,o,r),e.gt=(o,r)=>e.check(ci(o,r)),e.gte=(o,r)=>e.check(He(o,r)),e.min=(o,r)=>e.check(He(o,r)),e.lt=(o,r)=>e.check(si(o,r)),e.lte=(o,r)=>e.check(Be(o,r)),e.max=(o,r)=>e.check(Be(o,r)),e.int=o=>e.check(yi(o)),e.safe=o=>e.check(yi(o)),e.positive=o=>e.check(ci(0,o)),e.nonnegative=o=>e.check(He(0,o)),e.negative=o=>e.check(si(0,o)),e.nonpositive=o=>e.check(Be(0,o)),e.multipleOf=(o,r)=>e.check(li(o,r)),e.step=(o,r)=>e.check(li(o,r)),e.finite=()=>e;const i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function m(e){return Mn(vi,e)}const Ss=p("ZodNumberFormat",(e,t)=>{Rr.init(e,t),vi.init(e,t)});function yi(e){return Ln(Ss,e)}const ks=p("ZodBoolean",(e,t)=>{Fr.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>fa(e,i,o)});function f(e){return Un(ks,e)}const xs=p("ZodAny",(e,t)=>{Mr.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>ha()});function pe(){return Vn(xs)}const zs=p("ZodUnknown",(e,t)=>{Lr.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>ga()});function j(){return Wn(zs)}const As=p("ZodNever",(e,t)=>{Ur.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>ba(e,i,o)});function $s(e){return qn(As,e)}const Ts=p("ZodVoid",(e,t)=>{Vr.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>ma(e,i)});function Es(e){return Jn(Ts,e)}const Ns=p("ZodDate",(e,t)=>{Wr.init(e,t),I.init(e,t),e._zod.processJSONSchema=(o,r,s)=>va(e,o),e.min=(o,r)=>e.check(He(o,r)),e.max=(o,r)=>e.check(Be(o,r));const i=e._zod.bag;e.minDate=i.minimum?new Date(i.minimum):null,e.maxDate=i.maximum?new Date(i.maximum):null});function ee(e){return Gn(Ns,e)}const js=p("ZodArray",(e,t)=>{qr.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>xa(e,i,o,r),e.element=t.element,e.min=(i,o)=>e.check(Ke(i,o)),e.nonempty=i=>e.check(Ke(1,i)),e.max=(i,o)=>e.check(di(i,o)),e.length=(i,o)=>e.check(ui(i,o)),e.unwrap=()=>e.element});function g(e,t){return na(js,e,t)}const Os=p("ZodObject",(e,t)=>{Gr.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>za(e,i,o,r),T(e,"shape",()=>t.shape),e.keyof=()=>h(Object.keys(e._zod.def.shape)),e.catchall=i=>e.clone({...e._zod.def,catchall:i}),e.passthrough=()=>e.clone({...e._zod.def,catchall:j()}),e.loose=()=>e.clone({...e._zod.def,catchall:j()}),e.strict=()=>e.clone({...e._zod.def,catchall:$s()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>uo(e,i),e.safeExtend=i=>po(e,i),e.merge=i=>fo(e,i),e.pick=i=>co(e,i),e.omit=i=>lo(e,i),e.partial=(...i)=>mo(Si,e,i[0]),e.required=(...i)=>bo(zi,e,i[0])});function l(e,t){const i={type:"object",shape:e??{},...k(t)};return new Os(i)}const _i=p("ZodUnion",(e,t)=>{Kt.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>Aa(e,i,o,r),e.options=t.options});function P(e,t){return new _i({type:"union",options:e,...k(t)})}const Is=p("ZodDiscriminatedUnion",(e,t)=>{_i.init(e,t),Br.init(e,t)});function wi(e,t,i){return new Is({type:"union",options:t,discriminator:e,...k(i)})}const Cs=p("ZodIntersection",(e,t)=>{Hr.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>$a(e,i,o,r)});function Ps(e,t){return new Cs({type:"intersection",left:e,right:t})}const Ds=p("ZodTuple",(e,t)=>{Xt.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>Ta(e,i,o,r),e.rest=i=>e.clone({...e._zod.def,rest:i})});function Ne(e,t,i){const o=t instanceof N,r=o?i:t,s=o?t:null;return new Ds({type:"tuple",items:e,rest:s,...k(r)})}const Zs=p("ZodRecord",(e,t)=>{Kr.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>Ea(e,i,o,r),e.keyType=t.keyType,e.valueType=t.valueType});function L(e,t,i){return new Zs({type:"record",keyType:e,valueType:t,...k(i)})}const lt=p("ZodEnum",(e,t)=>{Yr.init(e,t),I.init(e,t),e._zod.processJSONSchema=(o,r,s)=>ya(e,o,r),e.enum=t.entries,e.options=Object.values(t.entries);const i=new Set(Object.keys(t.entries));e.extract=(o,r)=>{const s={};for(const a of o)if(i.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new lt({...t,checks:[],...k(r),entries:s})},e.exclude=(o,r)=>{const s={...t.entries};for(const a of o)if(i.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new lt({...t,checks:[],...k(r),entries:s})}});function h(e,t){const i=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new lt({type:"enum",entries:i,...k(t)})}const Rs=p("ZodLiteral",(e,t)=>{Xr.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>_a(e,i,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function oe(e,t){return new Rs({type:"literal",values:Array.isArray(e)?e:[e],...k(t)})}const Fs=p("ZodTransform",(e,t)=>{Qr.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>ka(e,i),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new zt(e.constructor.name);i.addIssue=s=>{if(typeof s=="string")i.issues.push(Te(s,i.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=i.value),a.inst??(a.inst=e),i.issues.push(Te(a))}};const r=t.transform(i.value,i);return r instanceof Promise?r.then(s=>(i.value=s,i)):(i.value=r,i)}});function Ms(e){return new Fs({type:"transform",transform:e})}const Si=p("ZodOptional",(e,t)=>{ei.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>bi(e,i,o,r),e.unwrap=()=>e._zod.def.innerType});function ki(e){return new Si({type:"optional",innerType:e})}const Ls=p("ZodExactOptional",(e,t)=>{en.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>bi(e,i,o,r),e.unwrap=()=>e._zod.def.innerType});function Us(e){return new Ls({type:"optional",innerType:e})}const Vs=p("ZodNullable",(e,t)=>{tn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>Na(e,i,o,r),e.unwrap=()=>e._zod.def.innerType});function xi(e){return new Vs({type:"nullable",innerType:e})}const Ws=p("ZodDefault",(e,t)=>{on.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>Oa(e,i,o,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function qs(e,t){return new Ws({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():jt(t)}})}const Js=p("ZodPrefault",(e,t)=>{rn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>Ia(e,i,o,r),e.unwrap=()=>e._zod.def.innerType});function Gs(e,t){return new Js({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():jt(t)}})}const zi=p("ZodNonOptional",(e,t)=>{nn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>ja(e,i,o,r),e.unwrap=()=>e._zod.def.innerType});function Bs(e,t){return new zi({type:"nonoptional",innerType:e,...k(t)})}const Hs=p("ZodCatch",(e,t)=>{an.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>Ca(e,i,o,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ks(e,t){return new Hs({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ys=p("ZodPipe",(e,t)=>{sn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>Pa(e,i,o,r),e.in=t.in,e.out=t.out});function Ai(e,t){return new Ys({type:"pipe",in:e,out:t})}const Xs=p("ZodReadonly",(e,t)=>{cn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>Da(e,i,o,r),e.unwrap=()=>e._zod.def.innerType});function Qs(e){return new Xs({type:"readonly",innerType:e})}const ec=p("ZodLazy",(e,t)=>{dn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>Za(e,i,o,r),e.unwrap=()=>e._zod.def.getter()});function Qe(e){return new ec({type:"lazy",getter:e})}const tc=p("ZodFunction",(e,t)=>{ln.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>Sa(e,i)});function ic(e){return new tc({type:"function",input:Array.isArray(e?.input)?Ne(e?.input):g(j()),output:j()})}const oc=p("ZodCustom",(e,t)=>{un.init(e,t),I.init(e,t),e._zod.processJSONSchema=(i,o,r)=>wa(e,i)});function rc(e,t={}){return aa(oc,e,t)}function nc(e){return sa(e)}var ac=l({key:n().describe('Translation key (e.g., "views.task_list.label")'),defaultValue:n().optional().describe("Fallback value when translation key is not found"),params:L(n(),P([n(),m(),f()])).optional().describe("Interpolation parameters (e.g., { count: 5 })")}),x=P([n(),ac]).describe("Display label: plain string or i18n translation object"),D=l({ariaLabel:x.optional().describe("Accessible label for screen readers (WAI-ARIA aria-label)"),ariaDescribedBy:n().optional().describe("ID of element providing additional description (WAI-ARIA aria-describedby)"),role:n().optional().describe('WAI-ARIA role attribute (e.g., "dialog", "navigation", "alert")')}).describe("ARIA accessibility attributes");l({key:n().describe("Translation key"),zero:n().optional().describe('Zero form (e.g., "No items")'),one:n().optional().describe('Singular form (e.g., "{count} item")'),two:n().optional().describe('Dual form (e.g., "{count} items" for exactly 2)'),few:n().optional().describe("Few form (e.g., for 2-4 in some languages)"),many:n().optional().describe("Many form (e.g., for 5+ in some languages)"),other:n().describe('Default plural form (e.g., "{count} items")')}).describe("ICU plural rules for a translation key");var sc=l({style:h(["decimal","currency","percent","unit"]).default("decimal").describe("Number formatting style"),currency:n().optional().describe('ISO 4217 currency code (e.g., "USD", "EUR")'),unit:n().optional().describe('Unit for unit formatting (e.g., "kilometer", "liter")'),minimumFractionDigits:m().optional().describe("Minimum number of fraction digits"),maximumFractionDigits:m().optional().describe("Maximum number of fraction digits"),useGrouping:f().optional().describe("Whether to use grouping separators (e.g., 1,000)")}).describe("Number formatting rules"),cc=l({dateStyle:h(["full","long","medium","short"]).optional().describe("Date display style"),timeStyle:h(["full","long","medium","short"]).optional().describe("Time display style"),timeZone:n().optional().describe('IANA time zone (e.g., "America/New_York")'),hour12:f().optional().describe("Use 12-hour format")}).describe("Date/time formatting rules");l({code:n().describe('BCP 47 language code (e.g., "en-US", "zh-CN")'),fallbackChain:g(n()).optional().describe('Fallback language codes in priority order (e.g., ["zh-TW", "en"])'),direction:h(["ltr","rtl"]).default("ltr").describe("Text direction: left-to-right or right-to-left"),numberFormat:sc.optional().describe("Default number formatting rules"),dateFormat:cc.optional().describe("Default date/time formatting rules")}).describe("Locale configuration");var dt=h(["bar","horizontal-bar","column","grouped-bar","stacked-bar","bi-polar-bar","line","area","stacked-area","step-line","spline","pie","donut","funnel","pyramid","scatter","bubble","treemap","sunburst","sankey","word-cloud","gauge","solid-gauge","metric","kpi","bullet","choropleth","bubble-map","gl-map","heatmap","radar","waterfall","box-plot","violin","candlestick","stock","table","pivot"]),$i=l({field:n().describe("Data field key"),title:x.optional().describe("Axis display title"),format:n().optional().describe('Value format string (e.g., "$0,0.00")'),min:m().optional().describe("Minimum value"),max:m().optional().describe("Maximum value"),stepSize:m().optional().describe("Step size for ticks"),showGridLines:f().default(!0),position:h(["left","right","top","bottom"]).optional().describe("Axis position"),logarithmic:f().default(!1)}),lc=l({name:n().describe("Field name or series identifier"),label:x.optional().describe("Series display label"),type:dt.optional().describe("Override chart type for this series"),color:n().optional().describe("Series color (hex/rgb/token)"),stack:n().optional().describe("Stack identifier to group series"),yAxis:h(["left","right"]).default("left").describe("Bind to specific Y-Axis")}),dc=l({type:h(["line","region"]).default("line"),axis:h(["x","y"]).default("y"),value:P([m(),n()]).describe("Start value"),endValue:P([m(),n()]).optional().describe("End value for regions"),color:n().optional(),label:x.optional(),style:h(["solid","dashed","dotted"]).default("dashed")}),uc=l({tooltips:f().default(!0),zoom:f().default(!1),brush:f().default(!1),clickAction:n().optional().describe("Action ID to trigger on click")}),Ti=l({type:dt,title:x.optional().describe("Chart title"),subtitle:x.optional().describe("Chart subtitle"),description:x.optional().describe("Accessibility description"),xAxis:$i.optional().describe("X-Axis configuration"),yAxis:g($i).optional().describe("Y-Axis configuration (support dual axis)"),series:g(lc).optional().describe("Defined series configuration"),colors:g(n()).optional().describe("Color palette"),height:m().optional().describe("Fixed height in pixels"),showLegend:f().default(!0).describe("Display legend"),showDataLabels:f().default(!1).describe("Display data labels"),annotations:g(dc).optional(),interaction:uc.optional(),aria:D.optional().describe("ARIA accessibility attributes")}),Ei=h(["xs","sm","md","lg","xl","2xl"]),pc=l({xs:m().min(1).max(12).optional(),sm:m().min(1).max(12).optional(),md:m().min(1).max(12).optional(),lg:m().min(1).max(12).optional(),xl:m().min(1).max(12).optional(),"2xl":m().min(1).max(12).optional()}).describe("Grid columns per breakpoint (1-12)"),fc=l({xs:m().optional(),sm:m().optional(),md:m().optional(),lg:m().optional(),xl:m().optional(),"2xl":m().optional()}).describe("Display order per breakpoint"),ut=l({breakpoint:Ei.optional().describe("Minimum breakpoint for visibility"),hiddenOn:g(Ei).optional().describe("Hide on these breakpoints"),columns:pc.optional().describe("Grid columns per breakpoint"),order:fc.optional().describe("Display order per breakpoint")}).describe("Responsive layout configuration"),pt=l({lazyLoad:f().optional().describe("Enable lazy loading (defer rendering until visible)"),virtualScroll:l({enabled:f().default(!1).describe("Enable virtual scrolling"),itemHeight:m().optional().describe("Fixed item height in pixels (for estimation)"),overscan:m().optional().describe("Number of extra items to render outside viewport")}).optional().describe("Virtual scrolling configuration"),cacheStrategy:h(["none","cache-first","network-first","stale-while-revalidate"]).optional().describe("Client-side data caching strategy"),prefetch:f().optional().describe("Prefetch data before component is visible"),pageSize:m().optional().describe("Number of items per page for pagination"),debounceMs:m().optional().describe("Debounce interval for user interactions in milliseconds")}).describe("Performance optimization configuration"),mc=n().min(2,{message:"System identifier must be at least 2 characters"}).regex(/^[a-z][a-z0-9_.]*$/,{message:'System identifier must be lowercase, starting with a letter, and may contain letters, numbers, underscores, or dots (e.g., "user_profile" or "order.created")'}).describe("System identifier (lowercase with underscores or dots)"),ae=n().min(2,{message:"Identifier must be at least 2 characters"}).regex(/^[a-z][a-z0-9_]*$/,{message:'Identifier must be lowercase snake_case, starting with a letter, and may contain only letters, numbers, and underscores (e.g., "user_profile")'}).describe("Snake case identifier (lowercase with underscores only)");n().min(3,{message:"Event name must be at least 3 characters"}).regex(/^[a-z][a-z0-9_.]*$/,{message:'Event name must be lowercase with dots for namespacing (e.g., "user.created", "order.paid")'}).describe("Event name (lowercase with dot notation for namespacing)");var je=l({id:ae.describe("Unique identifier for this navigation item (lowercase snake_case)"),label:x.describe("Display proper label"),icon:n().optional().describe("Icon name"),visible:n().optional().describe("Visibility formula condition")}),bc=je.extend({type:oe("object"),objectName:n().describe("Target object name"),viewName:n().optional().describe('Default list view to open. Defaults to "all"')}),hc=je.extend({type:oe("dashboard"),dashboardName:n().describe("Target dashboard name")}),gc=je.extend({type:oe("page"),pageName:n().describe("Target custom page component name"),params:L(n(),j()).optional().describe("Parameters passed to the page context")}),vc=je.extend({type:oe("url"),url:n().describe("Target external URL"),target:h(["_self","_blank"]).default("_self").describe("Link target window")}),yc=je.extend({type:oe("group"),expanded:f().default(!1).describe("Default expansion state in sidebar")}),ft=Qe(()=>P([bc.extend({children:g(ft).optional().describe("Child navigation items (e.g. specific views)")}),hc,gc,vc,yc.extend({children:g(ft).describe("Child navigation items")})])),_c=l({primaryColor:n().optional().describe("Primary theme color hex code"),logo:n().optional().describe("Custom logo URL for this app"),favicon:n().optional().describe("Custom favicon URL for this app")});l({name:ae.describe("App unique machine name (lowercase snake_case)"),label:x.describe("App display label"),version:n().optional().describe("App version"),description:x.optional().describe("App description"),icon:n().optional().describe("App icon used in the App Launcher"),branding:_c.optional().describe("App-specific branding"),active:f().optional().default(!0).describe("Whether the app is enabled"),isDefault:f().optional().default(!1).describe("Is default app"),navigation:g(ft).optional().describe("Structured navigation menu tree"),homePageId:n().optional().describe("ID of the navigation item to serve as landing page"),requiredPermissions:g(n()).optional().describe("Permissions required to access this app"),objects:g(j()).optional().describe("Objects belonging to this app"),apis:g(j()).optional().describe("Custom APIs belonging to this app"),mobileNavigation:l({mode:h(["drawer","bottom_nav","hamburger"]).default("drawer").describe("Mobile navigation mode: drawer sidebar, bottom navigation bar, or hamburger menu"),bottomNavItems:g(n()).optional().describe("Navigation item IDs to show in bottom nav (max 5)")}).optional().describe("Mobile-specific navigation configuration"),aria:D.optional().describe("ARIA accessibility attributes for the application")});var wc=h(["GET","POST","PUT","PATCH","DELETE"]),Ni=l({url:n().describe("API endpoint URL"),method:wc.optional().default("GET").describe("HTTP method"),headers:L(n(),n()).optional().describe("Custom HTTP headers"),params:L(n(),j()).optional().describe("Query parameters"),body:j().optional().describe("Request body for POST/PUT/PATCH")}),ji=wi("provider",[l({provider:oe("object"),object:n().describe("Target object name")}),l({provider:oe("api"),read:Ni.optional().describe("Configuration for fetching data"),write:Ni.optional().describe("Configuration for submitting data (for forms/editable tables)")}),l({provider:oe("value"),items:g(j()).describe("Static data array")})]),Sc=h(["none","count","count_empty","count_filled","count_unique","percent_empty","percent_filled","sum","avg","min","max"]).describe("Aggregation function for column footer summary"),kc=l({field:n().describe("Field name (snake_case)"),label:x.optional().describe("Display label override"),width:m().positive().optional().describe("Column width in pixels"),align:h(["left","center","right"]).optional().describe("Text alignment"),hidden:f().optional().describe("Hide column by default"),sortable:f().optional().describe("Allow sorting by this column"),resizable:f().optional().describe("Allow resizing this column"),wrap:f().optional().describe("Allow text wrapping"),type:n().optional().describe('Renderer type override (e.g., "currency", "date")'),pinned:h(["left","right"]).optional().describe("Pin/freeze column to left or right side"),summary:Sc.optional().describe("Footer aggregation function for this column"),link:f().optional().describe("Functions as the primary navigation link (triggers View navigation)"),action:n().optional().describe("Registered Action ID to execute when clicked")}),xc=l({type:h(["none","single","multiple"]).default("none").describe("Selection mode")}),zc=l({pageSize:m().int().positive().default(25).describe("Number of records per page"),pageSizeOptions:g(m().int().positive()).optional().describe("Available page size options")}),Ac=h(["compact","short","medium","tall","extra_tall"]).describe("Row height / density setting for list view"),$c=l({field:n().describe("Field name to group by"),order:h(["asc","desc"]).default("asc").describe("Group sort order"),collapsed:f().default(!1).describe("Collapse groups by default")}),Tc=l({fields:g($c).min(1).describe("Fields to group by (supports up to 3 levels)")}).describe("Record grouping configuration"),Ec=l({coverField:n().optional().describe("Attachment/image field to display as card cover"),coverFit:h(["cover","contain"]).default("cover").describe("Image fit mode for card cover"),cardSize:h(["small","medium","large"]).default("medium").describe("Card size in gallery view"),titleField:n().optional().describe("Field to display as card title"),visibleFields:g(n()).optional().describe("Fields to display on card body")}).describe("Gallery/card view configuration"),Nc=l({startDateField:n().describe("Field for timeline item start date"),endDateField:n().optional().describe("Field for timeline item end date"),titleField:n().describe("Field to display as timeline item title"),groupByField:n().optional().describe("Field to group timeline rows"),colorField:n().optional().describe("Field to determine item color"),scale:h(["hour","day","week","month","quarter","year"]).default("week").describe("Default timeline scale")}).describe("Timeline view configuration"),jc=l({type:h(["personal","collaborative"]).default("collaborative").describe("View ownership type"),lockedBy:n().optional().describe("User who locked the view configuration")}).describe("View sharing and access configuration"),Oc=l({field:n().describe("Field to derive color from (typically a select/status field)"),colors:L(n(),n()).optional().describe("Map of field value to color (hex/token)")}).describe("Row color configuration based on field values"),Ic=l({groupByField:n().describe("Field to group columns by (usually status/select)"),summarizeField:n().optional().describe("Field to sum at top of column (e.g. amount)"),columns:g(n()).describe("Fields to show on cards")}),Cc=l({startDateField:n(),endDateField:n().optional(),titleField:n(),colorField:n().optional()}),Oi=l({startDateField:n(),endDateField:n(),titleField:n(),progressField:n().optional(),dependenciesField:n().optional()}),Pc=h(["page","drawer","modal","split","popover","new_window","none"]),Dc=l({mode:Pc.default("page"),view:n().optional().describe('Name of the form view to use for details (e.g. "summary_view", "edit_form")'),preventNavigation:f().default(!1).describe("Disable standard navigation entirely"),openNewTab:f().default(!1).describe("Force open in new tab (applies to page mode)"),width:P([n(),m()]).optional().describe('Width of the drawer/modal (e.g. "600px", "50%")')}),Ii=l({name:ae.optional().describe("Internal view name (lowercase snake_case)"),label:x.optional(),type:h(["grid","kanban","gallery","calendar","timeline","gantt","map"]).default("grid"),data:ji.optional().describe('Data source configuration (defaults to "object" provider)'),columns:P([g(n()),g(kc)]).describe("Fields to display as columns"),filter:g(j()).optional().describe("Filter criteria (JSON Rules)"),sort:P([n(),g(l({field:n(),order:h(["asc","desc"])}))]).optional(),searchableFields:g(n()).optional().describe("Fields enabled for search"),filterableFields:g(n()).optional().describe("Fields enabled for end-user filtering in the top bar"),quickFilters:g(l({field:n().describe("Field name to filter by"),label:n().optional().describe("Display label for the chip"),operator:h(["equals","not_equals","contains","in","is_null","is_not_null"]).default("equals").describe("Filter operator"),value:j().optional().describe("Preset filter value")})).optional().describe("One-click filter chips for quick record filtering"),resizable:f().optional().describe("Enable column resizing"),striped:f().optional().describe("Striped row styling"),bordered:f().optional().describe("Show borders"),selection:xc.optional().describe("Row selection configuration"),navigation:Dc.optional().describe("Configuration for item click navigation (page, drawer, modal, etc.)"),pagination:zc.optional().describe("Pagination configuration"),kanban:Ic.optional(),calendar:Cc.optional(),gantt:Oi.optional(),gallery:Ec.optional(),timeline:Nc.optional(),description:x.optional().describe("View description for documentation/tooltips"),sharing:jc.optional().describe("View sharing and access configuration"),rowHeight:Ac.optional().describe("Row height / density setting"),grouping:Tc.optional().describe("Group records by one or more fields"),rowColor:Oc.optional().describe("Color rows based on field value"),hiddenFields:g(n()).optional().describe("Fields to hide in this specific view"),fieldOrder:g(n()).optional().describe("Explicit field display order for this view"),rowActions:g(n()).optional().describe("Actions available for individual row items"),bulkActions:g(n()).optional().describe("Actions available when multiple rows are selected"),virtualScroll:f().optional().describe("Enable virtual scrolling for large datasets"),conditionalFormatting:g(l({condition:n().describe("Condition expression to evaluate"),style:L(n(),n()).describe("CSS styles to apply when condition is true")})).optional().describe("Conditional formatting rules for list rows"),inlineEdit:f().optional().describe("Allow inline editing of records directly in the list view"),exportOptions:g(h(["csv","xlsx","pdf","json"])).optional().describe("Available export format options"),emptyState:l({title:x.optional(),message:x.optional(),icon:n().optional()}).optional().describe("Empty state configuration when no records found"),aria:D.optional().describe("ARIA accessibility attributes for the list view")}),Zc=l({field:n().describe("Field name (snake_case)"),label:x.optional().describe("Display label override"),placeholder:x.optional().describe("Placeholder text"),helpText:x.optional().describe("Help/hint text"),readonly:f().optional().describe("Read-only override"),required:f().optional().describe("Required override"),hidden:f().optional().describe("Hidden override"),colSpan:m().int().min(1).max(4).optional().describe("Column span in grid layout (1-4)"),widget:n().optional().describe("Custom widget/component name"),dependsOn:n().optional().describe("Parent field name for cascading"),visibleOn:n().optional().describe("Visibility condition expression")}),Ci=l({label:x.optional(),collapsible:f().default(!1),collapsed:f().default(!1),columns:h(["1","2","3","4"]).default("2").transform(e=>parseInt(e)),fields:g(P([n(),Zc]))}),Pi=l({type:h(["simple","tabbed","wizard","split","drawer","modal"]).default("simple"),data:ji.optional().describe('Data source configuration (defaults to "object" provider)'),sections:g(Ci).optional(),groups:g(Ci).optional(),defaultSort:g(l({field:n().describe("Field name to sort by"),order:h(["asc","desc"]).default("desc").describe("Sort direction")})).optional().describe("Default sort order for related list views within this form"),aria:D.optional().describe("ARIA accessibility attributes for the form view")});l({list:Ii.optional(),form:Pi.optional(),listViews:L(n(),Ii).optional().describe("Additional named list views"),formViews:L(n(),Pi).optional().describe("Additional named form views")});var te=l({$field:n().describe("Field Reference/Column Name")});l({$eq:pe().optional(),$ne:pe().optional()}),l({$gt:P([m(),ee(),te]).optional(),$gte:P([m(),ee(),te]).optional(),$lt:P([m(),ee(),te]).optional(),$lte:P([m(),ee(),te]).optional()}),l({$in:g(pe()).optional(),$nin:g(pe()).optional()}),l({$between:Ne([P([m(),ee(),te]),P([m(),ee(),te])]).optional()}),l({$contains:n().optional(),$startsWith:n().optional(),$endsWith:n().optional()}),l({$null:f().optional(),$exists:f().optional()});var mt=l({$eq:pe().optional(),$ne:pe().optional(),$gt:P([m(),ee(),te]).optional(),$gte:P([m(),ee(),te]).optional(),$lt:P([m(),ee(),te]).optional(),$lte:P([m(),ee(),te]).optional(),$in:g(pe()).optional(),$nin:g(pe()).optional(),$between:Ne([P([m(),ee(),te]),P([m(),ee(),te])]).optional(),$contains:n().optional(),$startsWith:n().optional(),$endsWith:n().optional(),$null:f().optional(),$exists:f().optional()}),Se=Qe(()=>L(n(),j()).and(l({$and:g(Se).optional(),$or:g(Se).optional(),$not:Se.optional()})));l({where:Se.optional()});var bt=Qe(()=>l({$and:g(P([L(n(),mt),bt])).optional(),$or:g(P([L(n(),mt),bt])).optional(),$not:P([L(n(),mt),bt]).optional()})),Rc=l({title:x.optional().describe("Widget title"),type:dt.default("metric").describe("Visualization type"),chartConfig:Ti.optional().describe("Chart visualization configuration"),object:n().optional().describe("Data source object name"),filter:Se.optional().describe("Data filter criteria"),categoryField:n().optional().describe("Field for grouping (X-Axis)"),valueField:n().optional().describe("Field for values (Y-Axis)"),aggregate:h(["count","sum","avg","min","max"]).optional().default("count").describe("Aggregate function"),layout:l({x:m(),y:m(),w:m(),h:m()}).describe("Grid layout position"),options:j().optional().describe("Widget specific configuration"),responsive:ut.optional().describe("Responsive layout configuration"),aria:D.optional().describe("ARIA accessibility attributes")});l({name:ae.describe("Dashboard unique name"),label:x.describe("Dashboard label"),description:x.optional().describe("Dashboard description"),widgets:g(Rc).describe("Widgets to display"),refreshInterval:m().optional().describe("Auto-refresh interval in seconds"),dateRange:l({field:n().optional().describe("Default date field name for time-based filtering"),defaultRange:h(["today","yesterday","this_week","last_week","this_month","last_month","this_quarter","last_quarter","this_year","last_year","last_7_days","last_30_days","last_90_days","custom"]).default("this_month").describe("Default date range preset"),allowCustomRange:f().default(!0).describe("Allow users to pick a custom date range")}).optional().describe("Global dashboard date range filter configuration"),globalFilters:g(l({field:n().describe("Field name to filter on"),label:x.optional().describe("Display label for the filter"),type:h(["text","select","date","number"]).optional().describe("Filter input type")})).optional().describe("Global filters that apply to all widgets in the dashboard"),aria:D.optional().describe("ARIA accessibility attributes"),performance:pt.optional().describe("Performance optimization settings")});var Fc=h(["tabular","summary","matrix","joined"]),Mc=l({field:n().describe("Field name"),label:x.optional().describe("Override label"),aggregate:h(["sum","avg","max","min","count","unique"]).optional().describe("Aggregation function"),responsive:ut.optional().describe("Responsive visibility for this column")}),Di=l({field:n().describe("Field to group by"),sortOrder:h(["asc","desc"]).default("asc"),dateGranularity:h(["day","week","month","quarter","year"]).optional().describe("For date fields")}),Lc=Ti.extend({xAxis:n().describe("Grouping field for X-Axis"),yAxis:n().describe("Summary field for Y-Axis"),groupBy:n().optional().describe("Additional grouping field")});l({name:ae.describe("Report unique name"),label:x.describe("Report label"),description:x.optional(),objectName:n().describe("Primary object"),type:Fc.default("tabular").describe("Report format type"),columns:g(Mc).describe("Columns to display"),groupingsDown:g(Di).optional().describe("Row groupings"),groupingsAcross:g(Di).optional().describe("Column groupings (Matrix only)"),filter:Se.optional().describe("Filter criteria"),chart:Lc.optional().describe("Embedded chart configuration"),aria:D.optional().describe("ARIA accessibility attributes"),performance:pt.optional().describe("Performance optimization settings")});var Uc=h(["aes-256-gcm","aes-256-cbc","chacha20-poly1305"]).describe("Supported encryption algorithm"),Vc=h(["local","aws-kms","azure-key-vault","gcp-kms","hashicorp-vault"]).describe("Key management service provider"),Wc=l({enabled:f().default(!1).describe("Enable automatic key rotation"),frequencyDays:m().min(1).default(90).describe("Rotation frequency in days"),retainOldVersions:m().default(3).describe("Number of old key versions to retain"),autoRotate:f().default(!0).describe("Automatically rotate without manual approval")}).describe("Policy for automatic encryption key rotation"),Zi=l({enabled:f().default(!1).describe("Enable field-level encryption"),algorithm:Uc.default("aes-256-gcm").describe("Encryption algorithm"),keyManagement:l({provider:Vc.describe("Key management service provider"),keyId:n().optional().describe("Key identifier in the provider"),rotationPolicy:Wc.optional().describe("Key rotation policy")}).describe("Key management configuration"),scope:h(["field","record","table","database"]).describe("Encryption scope level"),deterministicEncryption:f().default(!1).describe("Allows equality queries on encrypted data"),searchableEncryption:f().default(!1).describe("Allows search on encrypted data")}).describe("Field-level encryption configuration");l({fieldName:n().describe("Name of the field to encrypt"),encryptionConfig:Zi.describe("Encryption settings for this field"),indexable:f().default(!1).describe("Allow indexing on encrypted field")}).describe("Per-field encryption assignment");var qc=h(["redact","partial","hash","tokenize","randomize","nullify","substitute"]).describe("Data masking strategy for PII protection"),Ri=l({field:n().describe("Field name to apply masking to"),strategy:qc.describe("Masking strategy to use"),pattern:n().optional().describe("Regex pattern for partial masking"),preserveFormat:f().default(!0).describe("Keep the original data format after masking"),preserveLength:f().default(!0).describe("Keep the original data length after masking"),roles:g(n()).optional().describe("Roles that see masked data"),exemptRoles:g(n()).optional().describe("Roles that see unmasked data")}).describe("Masking rule for a single field");l({enabled:f().default(!1).describe("Enable data masking"),rules:g(Ri).describe("List of field-level masking rules"),auditUnmasking:f().default(!0).describe("Log when masked data is accessed unmasked")}).describe("Top-level data masking configuration for PII protection");var Fi=h(["text","textarea","email","url","phone","password","markdown","html","richtext","number","currency","percent","date","datetime","time","boolean","toggle","select","multiselect","radio","checkboxes","lookup","master_detail","tree","image","file","avatar","video","audio","formula","summary","autonumber","location","address","code","json","color","rating","slider","signature","qrcode","progress","tags","vector"]),Jc=l({label:n().describe("Display label (human-readable, any case allowed)"),value:mc.describe("Stored value (lowercase machine identifier)"),color:n().optional().describe("Color code for badges/charts"),default:f().optional().describe("Is default option")});l({latitude:m().min(-90).max(90).describe("Latitude coordinate"),longitude:m().min(-180).max(180).describe("Longitude coordinate"),altitude:m().optional().describe("Altitude in meters"),accuracy:m().optional().describe("Accuracy in meters")});var Gc=l({precision:m().int().min(0).max(10).default(2).describe("Decimal precision (default: 2)"),currencyMode:h(["dynamic","fixed"]).default("dynamic").describe("Currency mode: dynamic (user selectable) or fixed (single currency)"),defaultCurrency:n().length(3).default("CNY").describe("Default or fixed currency code (ISO 4217, e.g., USD, CNY, EUR)")});l({value:m().describe("Monetary amount"),currency:n().length(3).describe("Currency code (ISO 4217)")}),l({street:n().optional().describe("Street address"),city:n().optional().describe("City name"),state:n().optional().describe("State/Province"),postalCode:n().optional().describe("Postal/ZIP code"),country:n().optional().describe("Country name or code"),countryCode:n().optional().describe("ISO country code (e.g., US, GB)"),formatted:n().optional().describe("Formatted address string")});var Bc=l({dimensions:m().int().min(1).max(1e4).describe("Vector dimensionality (e.g., 1536 for OpenAI embeddings)"),distanceMetric:h(["cosine","euclidean","dotProduct","manhattan"]).default("cosine").describe("Distance/similarity metric for vector search"),normalized:f().default(!1).describe("Whether vectors are normalized (unit length)"),indexed:f().default(!0).describe("Whether to create a vector index for fast similarity search"),indexType:h(["hnsw","ivfflat","flat"]).optional().describe("Vector index algorithm (HNSW for high accuracy, IVFFlat for large datasets)")}),Hc=l({minSize:m().min(0).optional().describe("Minimum file size in bytes"),maxSize:m().min(1).optional().describe("Maximum file size in bytes (e.g., 10485760 = 10MB)"),allowedTypes:g(n()).optional().describe('Allowed file extensions (e.g., [".pdf", ".docx", ".jpg"])'),blockedTypes:g(n()).optional().describe('Blocked file extensions (e.g., [".exe", ".bat", ".sh"])'),allowedMimeTypes:g(n()).optional().describe('Allowed MIME types (e.g., ["image/jpeg", "application/pdf"])'),blockedMimeTypes:g(n()).optional().describe("Blocked MIME types"),virusScan:f().default(!1).describe("Enable virus scanning for uploaded files"),virusScanProvider:h(["clamav","virustotal","metadefender","custom"]).optional().describe("Virus scanning service provider"),virusScanOnUpload:f().default(!0).describe("Scan files immediately on upload"),quarantineOnThreat:f().default(!0).describe("Quarantine files if threat detected"),storageProvider:n().optional().describe("Object storage provider name (references ObjectStorageConfig)"),storageBucket:n().optional().describe("Target bucket name"),storagePrefix:n().optional().describe('Storage path prefix (e.g., "uploads/documents/")'),imageValidation:l({minWidth:m().min(1).optional().describe("Minimum image width in pixels"),maxWidth:m().min(1).optional().describe("Maximum image width in pixels"),minHeight:m().min(1).optional().describe("Minimum image height in pixels"),maxHeight:m().min(1).optional().describe("Maximum image height in pixels"),aspectRatio:n().optional().describe('Required aspect ratio (e.g., "16:9", "1:1")'),generateThumbnails:f().default(!1).describe("Auto-generate thumbnails"),thumbnailSizes:g(l({name:n().describe('Thumbnail variant name (e.g., "small", "medium", "large")'),width:m().min(1).describe("Thumbnail width in pixels"),height:m().min(1).describe("Thumbnail height in pixels"),crop:f().default(!1).describe("Crop to exact dimensions")})).optional().describe("Thumbnail size configurations"),preserveMetadata:f().default(!1).describe("Preserve EXIF metadata"),autoRotate:f().default(!0).describe("Auto-rotate based on EXIF orientation")}).optional().describe("Image-specific validation rules"),allowMultiple:f().default(!1).describe("Allow multiple file uploads (overrides field.multiple)"),allowReplace:f().default(!0).describe("Allow replacing existing files"),allowDelete:f().default(!0).describe("Allow deleting uploaded files"),requireUpload:f().default(!1).describe("Require at least one file when field is required"),extractMetadata:f().default(!0).describe("Extract file metadata (name, size, type, etc.)"),extractText:f().default(!1).describe("Extract text content from documents (OCR/parsing)"),versioningEnabled:f().default(!1).describe("Keep previous versions of replaced files"),maxVersions:m().min(1).optional().describe("Maximum number of versions to retain"),publicRead:f().default(!1).describe("Allow public read access to uploaded files"),presignedUrlExpiry:m().min(60).max(604800).default(3600).describe("Presigned URL expiration in seconds (default: 1 hour)")}).refine(e=>!(e.minSize!==void 0&&e.maxSize!==void 0&&e.minSize>e.maxSize),{message:"minSize must be less than or equal to maxSize"}).refine(e=>!(e.virusScanProvider!==void 0&&e.virusScan!==!0),{message:"virusScanProvider requires virusScan to be enabled"}),Kc=l({uniqueness:f().default(!1).describe("Enforce unique values across all records"),completeness:m().min(0).max(1).default(0).describe("Minimum ratio of non-null values (0-1, default: 0 = no requirement)"),accuracy:l({source:n().describe('Reference data source for validation (e.g., "api.verify.com", "master_data")'),threshold:m().min(0).max(1).describe("Minimum accuracy threshold (0-1, e.g., 0.95 = 95% match required)")}).optional().describe("Accuracy validation configuration")}),Yc=l({enabled:f().describe("Enable caching for computed field results"),ttl:m().min(0).describe("Cache TTL in seconds (0 = no expiration)"),invalidateOn:g(n()).describe('Field paths that invalidate cache (e.g., ["inventory.quantity", "pricing.base_price"])')}),Xc=l({name:n().regex(/^[a-z_][a-z0-9_]*$/).describe("Machine name (snake_case)").optional(),label:n().optional().describe("Human readable label"),type:Fi.describe("Field Data Type"),description:n().optional().describe("Tooltip/Help text"),format:n().optional().describe("Format string (e.g. email, phone)"),required:f().default(!1).describe("Is required"),searchable:f().default(!1).describe("Is searchable"),multiple:f().default(!1).describe("Allow multiple values (Stores as Array/JSON). Applicable for select, lookup, file, image."),unique:f().default(!1).describe("Is unique constraint"),defaultValue:j().optional().describe("Default value"),maxLength:m().optional().describe("Max character length"),minLength:m().optional().describe("Min character length"),precision:m().optional().describe("Total digits"),scale:m().optional().describe("Decimal places"),min:m().optional().describe("Minimum value"),max:m().optional().describe("Maximum value"),options:g(Jc).optional().describe("Static options for select/multiselect"),reference:n().optional().describe("Target Object Name"),referenceFilters:g(n()).optional().describe('Filters applied to lookup dialogs (e.g. "active = true")'),writeRequiresMasterRead:f().optional().describe("If true, user needs read access to master record to edit this field"),deleteBehavior:h(["set_null","cascade","restrict"]).optional().default("set_null").describe("What happens if referenced record is deleted"),expression:n().optional().describe("Formula expression"),summaryOperations:l({object:n(),field:n(),function:h(["count","sum","min","max","avg"])}).optional().describe("Roll-up summary definition"),language:n().optional().describe("Programming language for syntax highlighting (e.g., javascript, python, sql)"),theme:n().optional().describe("Code editor theme (e.g., dark, light, monokai)"),lineNumbers:f().optional().describe("Show line numbers in code editor"),maxRating:m().optional().describe("Maximum rating value (default: 5)"),allowHalf:f().optional().describe("Allow half-star ratings"),displayMap:f().optional().describe("Display map widget for location field"),allowGeocoding:f().optional().describe("Allow address-to-coordinate conversion"),addressFormat:h(["us","uk","international"]).optional().describe("Address format template"),colorFormat:h(["hex","rgb","rgba","hsl"]).optional().describe("Color value format"),allowAlpha:f().optional().describe("Allow transparency/alpha channel"),presetColors:g(n()).optional().describe("Preset color options"),step:m().optional().describe("Step increment for slider (default: 1)"),showValue:f().optional().describe("Display current value on slider"),marks:L(n(),n()).optional().describe('Custom marks/labels at specific values (e.g., {0: "Low", 50: "Medium", 100: "High"})'),barcodeFormat:h(["qr","ean13","ean8","code128","code39","upca","upce"]).optional().describe("Barcode format type"),qrErrorCorrection:h(["L","M","Q","H"]).optional().describe('QR code error correction level (L=7%, M=15%, Q=25%, H=30%). Only applicable when barcodeFormat is "qr"'),displayValue:f().optional().describe("Display human-readable value below barcode/QR code"),allowScanning:f().optional().describe("Enable camera scanning for barcode/QR code input"),currencyConfig:Gc.optional().describe("Configuration for currency field type"),vectorConfig:Bc.optional().describe("Configuration for vector field type (AI/ML embeddings)"),fileAttachmentConfig:Hc.optional().describe("Configuration for file and attachment field types"),encryptionConfig:Zi.optional().describe("Field-level encryption configuration for sensitive data (GDPR/HIPAA/PCI-DSS)"),maskingRule:Ri.optional().describe("Data masking rules for PII protection"),auditTrail:f().default(!1).describe("Enable detailed audit trail for this field (tracks all changes with user and timestamp)"),dependencies:g(n()).optional().describe("Array of field names that this field depends on (for formulas, visibility rules, etc.)"),cached:Yc.optional().describe("Caching configuration for computed/formula fields"),dataQuality:Kc.optional().describe("Data quality validation and monitoring rules"),group:n().optional().describe('Field group name for organizing fields in forms and layouts (e.g., "contact_info", "billing", "system")'),conditionalRequired:n().optional().describe(`Formula expression that makes this field required when TRUE (e.g., "status = 'closed_won'")`),hidden:f().default(!1).describe("Hidden from default UI"),readonly:f().default(!1).describe("Read-only in UI"),sortable:f().optional().default(!0).describe("Whether field is sortable in list views"),inlineHelpText:n().optional().describe("Help text displayed below the field in forms"),trackFeedHistory:f().optional().describe("Track field changes in Chatter/activity feed (Salesforce pattern)"),caseSensitive:f().optional().describe("Whether text comparisons are case-sensitive"),autonumberFormat:n().optional().describe('Auto-number display format pattern (e.g., "CASE-{0000}")'),index:f().default(!1).describe("Create standard database index"),externalId:f().default(!1).describe("Is external ID for upsert operations")}),Qc=l({name:n(),label:x,type:Fi,required:f().default(!1),options:g(l({label:x,value:n()})).optional()});l({name:ae.describe("Machine name (lowercase snake_case)"),label:x.describe("Display label"),icon:n().optional().describe("Icon name"),locations:g(h(["list_toolbar","list_item","record_header","record_more","record_related","global_nav"])).optional().describe("Locations where this action is visible"),component:h(["action:button","action:icon","action:menu","action:group"]).optional().describe("Visual component override"),type:h(["script","url","modal","flow","api"]).default("script").describe("Action functionality type"),target:n().optional().describe("URL, Script Name, Flow ID, or API Endpoint"),execute:n().optional().describe("Legacy execution logic"),params:g(Qc).optional().describe("Input parameters required from user"),variant:h(["primary","secondary","danger","ghost","link"]).optional().describe("Button visual variant for styling (primary = highlighted, danger = destructive, ghost = transparent)"),confirmText:x.optional().describe("Confirmation message before execution"),successMessage:x.optional().describe("Success message to show after execution"),refreshAfter:f().default(!1).describe("Refresh view after execution"),visible:n().optional().describe("Formula returning boolean"),disabled:P([f(),n()]).optional().describe("Whether the action is disabled, or a condition expression string"),shortcut:n().optional().describe('Keyboard shortcut to trigger this action (e.g., "Ctrl+S")'),bulkEnabled:f().optional().describe("Whether this action can be applied to multiple selected records"),timeout:m().optional().describe("Maximum execution time in milliseconds for the action"),aria:D.optional().describe("ARIA accessibility attributes")});var el=l({name:n().describe('Region name (e.g. "sidebar", "main", "header")'),width:h(["small","medium","large","full"]).optional(),components:g(Qe(()=>il)).describe("Components in this region")}),tl=h(["page:header","page:footer","page:sidebar","page:tabs","page:accordion","page:card","page:section","record:details","record:highlights","record:related_list","record:activity","record:chatter","record:path","app:launcher","nav:menu","nav:breadcrumb","global:search","global:notifications","user:profile","ai:chat_window","ai:suggestion"]),il=l({type:P([tl,n()]).describe("Component Type (Standard enum or custom string)"),id:n().optional().describe("Unique instance ID"),label:x.optional(),properties:L(n(),j()).describe("Component props passed to the widget. See component.zod.ts for schemas."),events:L(n(),n()).optional().describe("Event handlers map"),style:L(n(),n()).optional().describe("Inline styles or utility classes"),className:n().optional().describe("CSS class names"),visibility:n().optional().describe("Visibility filter/formula"),responsive:ut.optional().describe("Responsive layout configuration"),aria:D.optional().describe("ARIA accessibility attributes")}),ol=l({name:n().describe("Variable name"),type:h(["string","number","boolean","object","array"]).default("string"),defaultValue:j().optional()});l({name:ae.describe("Page unique name (lowercase snake_case)"),label:x,description:x.optional(),type:h(["record","home","app","utility"]).default("record"),variables:g(ol).optional().describe("Local page state variables"),object:n().optional().describe("Bound object (for Record pages)"),template:n().default("default").describe('Layout template name (e.g. "header-sidebar-main")'),regions:g(el).describe("Defined regions with components"),isDefault:f().default(!1),assignedProfiles:g(n()).optional(),aria:D.optional().describe("ARIA accessibility attributes")});var rl=l({onMount:n().optional().describe("Initialization code when widget mounts"),onUpdate:n().optional().describe("Code to run when props change"),onUnmount:n().optional().describe("Cleanup code when widget unmounts"),onValidate:n().optional().describe("Custom validation logic"),onFocus:n().optional().describe("Code to run on focus"),onBlur:n().optional().describe("Code to run on blur"),onError:n().optional().describe("Error handling code")}),nl=l({name:n().describe("Event name"),label:x.optional().describe("Human-readable event label"),description:x.optional().describe("Event description and usage"),bubbles:f().default(!1).describe("Whether event bubbles"),cancelable:f().default(!1).describe("Whether event is cancelable"),payload:L(n(),j()).optional().describe("Event payload schema")}),al=l({name:n().describe("Property name (camelCase)"),label:x.optional().describe("Human-readable label"),type:h(["string","number","boolean","array","object","function","any"]).describe("TypeScript type"),required:f().default(!1).describe("Whether property is required"),default:j().optional().describe("Default value"),description:x.optional().describe("Property description"),validation:L(n(),j()).optional().describe("Validation rules"),category:n().optional().describe("Property category")}),sl=wi("type",[l({type:oe("npm"),packageName:n().describe("NPM package name"),version:n().default("latest"),exportName:n().optional().describe("Named export (default: default)")}),l({type:oe("remote"),url:n().url().describe("Remote entry URL (.js)"),moduleName:n().describe("Exposed module name"),scope:n().describe("Remote scope name")}),l({type:oe("inline"),code:n().describe("JavaScript code body")})]);l({name:ae.describe("Widget identifier (snake_case)"),label:x.describe("Widget display name"),description:x.optional().describe("Widget description"),version:n().optional().describe("Widget version (semver)"),author:n().optional().describe("Widget author"),icon:n().optional().describe("Widget icon"),fieldTypes:g(n()).optional().describe("Supported field types"),category:h(["input","display","picker","editor","custom"]).default("custom").describe("Widget category"),lifecycle:rl.optional().describe("Lifecycle hooks"),events:g(nl).optional().describe("Custom events"),properties:g(al).optional().describe("Configuration properties"),implementation:sl.optional().describe("Widget implementation source"),dependencies:g(l({name:n(),version:n().optional(),url:n().url().optional()})).optional().describe("Widget dependencies"),screenshots:g(n().url()).optional().describe("Screenshot URLs"),documentation:n().url().optional().describe("Documentation URL"),license:n().optional().describe("License (SPDX identifier)"),tags:g(n()).optional().describe("Tags for categorization"),aria:D.optional().describe("ARIA accessibility attributes"),performance:pt.optional().describe("Performance optimization settings")}),l({value:j().describe("Current field value"),onChange:ic().input(Ne([j()])).output(Es()).describe("Callback to update field value"),readonly:f().default(!1).describe("Read-only mode flag"),required:f().default(!1).describe("Required field flag"),error:n().optional().describe("Validation error message"),field:Xc.describe("Field schema definition"),record:L(n(),j()).optional().describe("Complete record data"),options:L(n(),j()).optional().describe("Custom widget options")}),l({}),l({title:x.describe("Page title"),subtitle:x.optional().describe("Page subtitle"),icon:n().optional().describe("Icon name"),breadcrumb:f().default(!0).describe("Show breadcrumb"),actions:g(n()).optional().describe("Action IDs to show in header"),aria:D.optional().describe("ARIA accessibility attributes")}),l({type:h(["line","card","pill"]).default("line"),position:h(["top","left"]).default("top"),items:g(l({label:x,icon:n().optional(),children:g(j()).describe("Child components")})),aria:D.optional().describe("ARIA accessibility attributes")}),l({title:x.optional(),bordered:f().default(!0),actions:g(n()).optional(),body:g(j()).optional().describe("Card content components (slot)"),footer:g(j()).optional().describe("Card footer components (slot)"),aria:D.optional().describe("ARIA accessibility attributes")}),l({columns:h(["1","2","3","4"]).default("2").describe("Number of columns for field layout (1-4)"),layout:h(["auto","custom"]).default("auto").describe("Layout mode: auto uses object compactLayout, custom uses explicit sections"),sections:g(n()).optional().describe('Section IDs to show (required when layout is "custom")'),fields:g(n()).optional().describe("Explicit field list to display (optional, overrides compactLayout)"),aria:D.optional().describe("ARIA accessibility attributes")}),l({objectName:n().describe('Related object name (e.g., "task", "opportunity")'),relationshipField:n().describe('Field on related object that points to this record (e.g., "account_id")'),columns:g(n()).describe("Fields to display in the related list"),sort:P([n(),g(l({field:n(),order:h(["asc","desc"])}))]).optional().describe("Sort order for related records"),limit:m().int().positive().default(5).describe("Number of records to display initially"),filter:g(j()).optional().describe("Additional filter criteria for related records"),title:x.optional().describe("Custom title for the related list"),showViewAll:f().default(!0).describe('Show "View All" link to see all related records'),actions:g(n()).optional().describe("Action IDs available for related records"),aria:D.optional().describe("ARIA accessibility attributes")}),l({fields:g(n()).min(1).max(7).describe("Key fields to highlight (1-7 fields max, typically displayed as prominent cards)"),layout:h(["horizontal","vertical"]).default("horizontal").describe("Layout orientation for highlight fields"),aria:D.optional().describe("ARIA accessibility attributes")}),l({types:g(h(["task","event","email","call","note"])).optional().describe("Activity types to display"),limit:m().int().positive().default(10).describe("Number of activities to show"),showCompleted:f().default(!1).describe("Include completed activities"),aria:D.optional().describe("ARIA accessibility attributes")}),l({statusField:n().describe("Field name representing the current status/stage"),stages:g(l({value:n(),label:x})).optional().describe("Explicit stage definitions (if not using field metadata)"),aria:D.optional().describe("ARIA accessibility attributes")}),l({items:g(l({label:x,icon:n().optional(),collapsed:f().default(!1),children:g(j()).describe("Child components")})),allowMultiple:f().default(!1).describe("Allow multiple panels to be expanded simultaneously"),aria:D.optional().describe("ARIA accessibility attributes")}),l({mode:h(["float","sidebar","inline"]).default("float").describe("Display mode for the chat window"),agentId:n().optional().describe("Specific AI agent to use"),context:L(n(),j()).optional().describe("Contextual data to pass to the AI"),aria:D.optional().describe("ARIA accessibility attributes")}),l({context:n().optional()});var Mi=l({minWidth:m().default(44).describe("Minimum touch target width in pixels (WCAG 2.5.5: 44px)"),minHeight:m().default(44).describe("Minimum touch target height in pixels (WCAG 2.5.5: 44px)"),padding:m().optional().describe("Additional padding around touch target in pixels"),hitSlop:l({top:m().optional().describe("Extra hit area above the element"),right:m().optional().describe("Extra hit area to the right of the element"),bottom:m().optional().describe("Extra hit area below the element"),left:m().optional().describe("Extra hit area to the left of the element")}).optional().describe("Invisible hit area extension beyond the visible bounds")}).describe("Touch target sizing configuration (WCAG accessible)"),cl=h(["swipe","pinch","long_press","double_tap","drag","rotate","pan"]).describe("Touch gesture type"),ll=h(["up","down","left","right"]),dl=l({direction:g(ll).describe("Allowed swipe directions"),threshold:m().optional().describe("Minimum distance in pixels to recognize swipe"),velocity:m().optional().describe("Minimum velocity (px/ms) to trigger swipe")}).describe("Swipe gesture recognition settings"),ul=l({minScale:m().optional().describe("Minimum scale factor (e.g., 0.5 for 50%)"),maxScale:m().optional().describe("Maximum scale factor (e.g., 3.0 for 300%)")}).describe("Pinch/zoom gesture recognition settings"),pl=l({duration:m().default(500).describe("Hold duration in milliseconds to trigger long press"),moveTolerance:m().optional().describe("Max movement in pixels allowed during press")}).describe("Long press gesture recognition settings"),fl=l({type:cl.describe("Gesture type to configure"),label:x.optional().describe("Descriptive label for the gesture action"),enabled:f().default(!0).describe("Whether this gesture is active"),swipe:dl.optional().describe("Swipe gesture settings (when type is swipe)"),pinch:ul.optional().describe("Pinch gesture settings (when type is pinch)"),longPress:pl.optional().describe("Long press settings (when type is long_press)")}).describe("Per-gesture configuration");l({gestures:g(fl).optional().describe("Configured gesture recognizers"),touchTarget:Mi.optional().describe("Touch target sizing and hit area"),hapticFeedback:f().optional().describe("Enable haptic feedback on touch interactions")}).merge(D.partial()).describe("Touch and gesture interaction configuration");var ml=l({enabled:f().default(!1).describe("Enable focus trapping within this container"),initialFocus:n().optional().describe("CSS selector for the element to focus on activation"),returnFocus:f().default(!0).describe("Return focus to trigger element on deactivation"),escapeDeactivates:f().default(!0).describe("Allow Escape key to deactivate the focus trap")}).describe("Focus trap configuration for modal-like containers"),bl=l({key:n().describe('Key combination (e.g., "Ctrl+S", "Alt+N", "Escape")'),action:n().describe("Action identifier to invoke when shortcut is triggered"),description:x.optional().describe("Human-readable description of what the shortcut does"),scope:h(["global","view","form","modal","list"]).default("global").describe("Scope in which this shortcut is active")}).describe("Keyboard shortcut binding"),Li=l({tabOrder:h(["auto","manual"]).default("auto").describe("Tab order strategy: auto (DOM order) or manual (explicit tabIndex)"),skipLinks:f().default(!1).describe("Provide skip-to-content navigation links"),focusVisible:f().default(!0).describe("Show visible focus indicators for keyboard users"),focusTrap:ml.optional().describe("Focus trap settings"),arrowNavigation:f().default(!1).describe("Enable arrow key navigation between focusable items")}).describe("Focus and tab navigation management");l({shortcuts:g(bl).optional().describe("Registered keyboard shortcuts"),focusManagement:Li.optional().describe("Focus and tab order management"),rovingTabindex:f().default(!1).describe("Enable roving tabindex pattern for composite widgets")}).merge(D.partial()).describe("Keyboard navigation and shortcut configuration");var hl=l({primary:n().describe("Primary brand color (hex, rgb, or hsl)"),secondary:n().optional().describe("Secondary brand color"),accent:n().optional().describe("Accent color for highlights"),success:n().optional().describe("Success state color (default: green)"),warning:n().optional().describe("Warning state color (default: yellow)"),error:n().optional().describe("Error state color (default: red)"),info:n().optional().describe("Info state color (default: blue)"),background:n().optional().describe("Background color"),surface:n().optional().describe("Surface/card background color"),text:n().optional().describe("Primary text color"),textSecondary:n().optional().describe("Secondary text color"),border:n().optional().describe("Border color"),disabled:n().optional().describe("Disabled state color"),primaryLight:n().optional().describe("Lighter shade of primary"),primaryDark:n().optional().describe("Darker shade of primary"),secondaryLight:n().optional().describe("Lighter shade of secondary"),secondaryDark:n().optional().describe("Darker shade of secondary")}),gl=l({fontFamily:l({base:n().optional().describe("Base font family (default: system fonts)"),heading:n().optional().describe("Heading font family"),mono:n().optional().describe("Monospace font family for code")}).optional(),fontSize:l({xs:n().optional().describe("Extra small font size (e.g., 0.75rem)"),sm:n().optional().describe("Small font size (e.g., 0.875rem)"),base:n().optional().describe("Base font size (e.g., 1rem)"),lg:n().optional().describe("Large font size (e.g., 1.125rem)"),xl:n().optional().describe("Extra large font size (e.g., 1.25rem)"),"2xl":n().optional().describe("2X large font size (e.g., 1.5rem)"),"3xl":n().optional().describe("3X large font size (e.g., 1.875rem)"),"4xl":n().optional().describe("4X large font size (e.g., 2.25rem)")}).optional(),fontWeight:l({light:m().optional().describe("Light weight (default: 300)"),normal:m().optional().describe("Normal weight (default: 400)"),medium:m().optional().describe("Medium weight (default: 500)"),semibold:m().optional().describe("Semibold weight (default: 600)"),bold:m().optional().describe("Bold weight (default: 700)")}).optional(),lineHeight:l({tight:n().optional().describe("Tight line height (e.g., 1.25)"),normal:n().optional().describe("Normal line height (e.g., 1.5)"),relaxed:n().optional().describe("Relaxed line height (e.g., 1.75)"),loose:n().optional().describe("Loose line height (e.g., 2)")}).optional(),letterSpacing:l({tighter:n().optional().describe("Tighter letter spacing (e.g., -0.05em)"),tight:n().optional().describe("Tight letter spacing (e.g., -0.025em)"),normal:n().optional().describe("Normal letter spacing (e.g., 0)"),wide:n().optional().describe("Wide letter spacing (e.g., 0.025em)"),wider:n().optional().describe("Wider letter spacing (e.g., 0.05em)")}).optional()}),vl=l({0:n().optional().describe("0 spacing (0)"),1:n().optional().describe("Spacing unit 1 (e.g., 0.25rem)"),2:n().optional().describe("Spacing unit 2 (e.g., 0.5rem)"),3:n().optional().describe("Spacing unit 3 (e.g., 0.75rem)"),4:n().optional().describe("Spacing unit 4 (e.g., 1rem)"),5:n().optional().describe("Spacing unit 5 (e.g., 1.25rem)"),6:n().optional().describe("Spacing unit 6 (e.g., 1.5rem)"),8:n().optional().describe("Spacing unit 8 (e.g., 2rem)"),10:n().optional().describe("Spacing unit 10 (e.g., 2.5rem)"),12:n().optional().describe("Spacing unit 12 (e.g., 3rem)"),16:n().optional().describe("Spacing unit 16 (e.g., 4rem)"),20:n().optional().describe("Spacing unit 20 (e.g., 5rem)"),24:n().optional().describe("Spacing unit 24 (e.g., 6rem)")}),yl=l({none:n().optional().describe("No border radius (0)"),sm:n().optional().describe("Small border radius (e.g., 0.125rem)"),base:n().optional().describe("Base border radius (e.g., 0.25rem)"),md:n().optional().describe("Medium border radius (e.g., 0.375rem)"),lg:n().optional().describe("Large border radius (e.g., 0.5rem)"),xl:n().optional().describe("Extra large border radius (e.g., 0.75rem)"),"2xl":n().optional().describe("2X large border radius (e.g., 1rem)"),full:n().optional().describe("Full border radius (50%)")}),_l=l({none:n().optional().describe("No shadow"),sm:n().optional().describe("Small shadow"),base:n().optional().describe("Base shadow"),md:n().optional().describe("Medium shadow"),lg:n().optional().describe("Large shadow"),xl:n().optional().describe("Extra large shadow"),"2xl":n().optional().describe("2X large shadow"),inner:n().optional().describe("Inner shadow (inset)")}),wl=l({xs:n().optional().describe("Extra small breakpoint (e.g., 480px)"),sm:n().optional().describe("Small breakpoint (e.g., 640px)"),md:n().optional().describe("Medium breakpoint (e.g., 768px)"),lg:n().optional().describe("Large breakpoint (e.g., 1024px)"),xl:n().optional().describe("Extra large breakpoint (e.g., 1280px)"),"2xl":n().optional().describe("2X large breakpoint (e.g., 1536px)")}),Sl=l({duration:l({fast:n().optional().describe("Fast animation (e.g., 150ms)"),base:n().optional().describe("Base animation (e.g., 300ms)"),slow:n().optional().describe("Slow animation (e.g., 500ms)")}).optional(),timing:l({linear:n().optional().describe("Linear timing function"),ease:n().optional().describe("Ease timing function"),easeIn:n().optional().describe("Ease-in timing function"),easeOut:n().optional().describe("Ease-out timing function"),easeInOut:n().optional().describe("Ease-in-out timing function")}).optional()}),kl=l({base:m().optional().describe("Base z-index (e.g., 0)"),dropdown:m().optional().describe("Dropdown z-index (e.g., 1000)"),sticky:m().optional().describe("Sticky z-index (e.g., 1020)"),fixed:m().optional().describe("Fixed z-index (e.g., 1030)"),modalBackdrop:m().optional().describe("Modal backdrop z-index (e.g., 1040)"),modal:m().optional().describe("Modal z-index (e.g., 1050)"),popover:m().optional().describe("Popover z-index (e.g., 1060)"),tooltip:m().optional().describe("Tooltip z-index (e.g., 1070)")}),xl=h(["light","dark","auto"]),zl=h(["compact","regular","spacious"]),Al=h(["AA","AAA"]);l({name:ae.describe("Unique theme identifier (snake_case)"),label:n().describe("Human-readable theme name"),description:n().optional().describe("Theme description"),mode:xl.default("light").describe("Theme mode (light, dark, or auto)"),colors:hl.describe("Color palette configuration"),typography:gl.optional().describe("Typography settings"),spacing:vl.optional().describe("Spacing scale"),borderRadius:yl.optional().describe("Border radius scale"),shadows:_l.optional().describe("Box shadow effects"),breakpoints:wl.optional().describe("Responsive breakpoints"),animation:Sl.optional().describe("Animation settings"),zIndex:kl.optional().describe("Z-index scale for layering"),customVars:L(n(),n()).optional().describe("Custom CSS variables (key-value pairs)"),logo:l({light:n().optional().describe("Logo URL for light mode"),dark:n().optional().describe("Logo URL for dark mode"),favicon:n().optional().describe("Favicon URL")}).optional().describe("Logo assets"),extends:n().optional().describe("Base theme to extend from"),density:zl.optional().describe("Display density: compact, regular, or spacious"),wcagContrast:Al.optional().describe("WCAG color contrast level (AA or AAA)"),rtl:f().optional().describe("Enable right-to-left layout direction"),touchTarget:Mi.optional().describe("Touch target sizing defaults"),keyboardNavigation:Li.optional().describe("Keyboard focus management settings")});var Ui=h(["cache_first","network_first","stale_while_revalidate","network_only","cache_only"]).describe("Data fetching strategy for offline/online transitions"),$l=h(["client_wins","server_wins","manual","last_write_wins"]).describe("How to resolve conflicts when syncing offline changes"),Tl=l({strategy:Ui.default("network_first").describe("Sync fetch strategy"),conflictResolution:$l.default("last_write_wins").describe("Conflict resolution policy"),retryInterval:m().optional().describe("Retry interval in milliseconds between sync attempts"),maxRetries:m().optional().describe("Maximum number of sync retry attempts"),batchSize:m().optional().describe("Number of mutations to sync per batch")}).describe("Offline-to-online synchronization configuration"),El=h(["indexeddb","localstorage","sqlite"]).describe("Client-side storage backend for offline cache"),Nl=h(["lru","lfu","fifo"]).describe("Cache eviction policy"),jl=l({maxSize:m().optional().describe("Maximum cache size in bytes"),ttl:m().optional().describe("Time-to-live for cached entries in milliseconds"),persistStorage:El.default("indexeddb").describe("Storage backend"),evictionPolicy:Nl.default("lru").describe("Cache eviction policy when full")}).describe("Client-side offline cache configuration");l({enabled:f().default(!1).describe("Enable offline support"),strategy:Ui.default("network_first").describe("Default offline fetch strategy"),cache:jl.optional().describe("Cache settings for offline data"),sync:Tl.optional().describe("Sync settings for offline mutations"),offlineIndicator:f().default(!0).describe("Show a visual indicator when offline"),offlineMessage:x.optional().describe("Customizable offline status message shown to users"),queueMaxSize:m().optional().describe("Maximum number of queued offline mutations")}).describe("Offline support configuration");var Vi=h(["fade","slide_up","slide_down","slide_left","slide_right","scale","rotate","flip","none"]).describe("Transition preset type"),Wi=h(["linear","ease","ease_in","ease_out","ease_in_out","spring"]).describe("Animation easing function"),et=l({preset:Vi.optional().describe("Transition preset to apply"),duration:m().optional().describe("Transition duration in milliseconds"),easing:Wi.optional().describe("Easing function for the transition"),delay:m().optional().describe("Delay before transition starts in milliseconds"),customKeyframes:n().optional().describe("CSS @keyframes name for custom animations")}).describe("Animation transition configuration"),Ol=h(["on_mount","on_unmount","on_hover","on_focus","on_click","on_scroll","on_visible"]).describe("Event that triggers the animation"),Il=l({label:x.optional().describe("Descriptive label for this animation configuration"),enter:et.optional().describe("Enter/mount animation"),exit:et.optional().describe("Exit/unmount animation"),hover:et.optional().describe("Hover state animation"),trigger:Ol.optional().describe("When to trigger the animation"),reducedMotion:h(["respect","disable","alternative"]).default("respect").describe("Accessibility: how to handle prefers-reduced-motion")}).merge(D.partial()).describe("Component-level animation configuration"),Cl=l({type:Vi.default("fade").describe("Page transition type"),duration:m().default(300).describe("Transition duration in milliseconds"),easing:Wi.default("ease_in_out").describe("Easing function for the transition"),crossFade:f().default(!1).describe("Whether to cross-fade between pages")}).describe("Page-level transition configuration");l({label:x.optional().describe("Descriptive label for the motion configuration"),defaultTransition:et.optional().describe("Default transition applied to all animations"),pageTransitions:Cl.optional().describe("Page navigation transition settings"),componentAnimations:L(n(),Il).optional().describe("Component name to animation configuration mapping"),reducedMotion:f().default(!1).describe("When true, respect prefers-reduced-motion and suppress animations globally"),enabled:f().default(!0).describe("Enable or disable all animations globally")}).describe("Top-level motion and animation design configuration");var Pl=h(["toast","snackbar","banner","alert","inline"]).describe("Notification presentation style"),Dl=h(["info","success","warning","error"]).describe("Notification severity level"),qi=h(["top_left","top_center","top_right","bottom_left","bottom_center","bottom_right"]).describe("Screen position for notification placement"),Zl=l({label:x.describe("Action button label"),action:n().describe("Action identifier to execute"),variant:h(["primary","secondary","link"]).default("primary").describe("Button variant style")}).describe("Notification action button");l({type:Pl.default("toast").describe("Notification presentation style"),severity:Dl.default("info").describe("Notification severity level"),title:x.optional().describe("Notification title"),message:x.describe("Notification message body"),icon:n().optional().describe("Icon name override"),duration:m().optional().describe("Auto-dismiss duration in ms, omit for persistent"),dismissible:f().default(!0).describe("Allow user to dismiss the notification"),actions:g(Zl).optional().describe("Action buttons"),position:qi.optional().describe("Override default position")}).merge(D.partial()).describe("Notification instance definition"),l({defaultPosition:qi.default("top_right").describe("Default screen position for notifications"),defaultDuration:m().default(5e3).describe("Default auto-dismiss duration in ms"),maxVisible:m().default(5).describe("Maximum number of notifications visible at once"),stackDirection:h(["up","down"]).default("down").describe("Stack direction for multiple notifications"),pauseOnHover:f().default(!0).describe("Pause auto-dismiss timer on hover")}).describe("Global notification system configuration");var Rl=h(["element","handle","grip_icon"]).describe("Drag initiation method"),Fl=h(["move","copy","link","none"]).describe("Drop operation effect"),Ml=l({axis:h(["x","y","both"]).default("both").describe("Constrain drag axis"),bounds:h(["parent","viewport","none"]).default("none").describe("Constrain within bounds"),grid:Ne([m(),m()]).optional().describe("Snap to grid [x, y] in pixels")}).describe("Drag movement constraints"),Ll=l({label:x.optional().describe("Accessible label for the drop zone"),accept:g(n()).describe("Accepted drag item types"),maxItems:m().optional().describe("Maximum items allowed in drop zone"),highlightOnDragOver:f().default(!0).describe("Highlight drop zone when dragging over"),dropEffect:Fl.default("move").describe("Visual effect on drop")}).merge(D.partial()).describe("Drop zone configuration"),Ul=l({type:n().describe("Drag item type identifier for matching with drop zones"),label:x.optional().describe("Accessible label describing the draggable item"),handle:Rl.default("element").describe("How to initiate drag"),constraint:Ml.optional().describe("Drag movement constraints"),preview:h(["element","custom","none"]).default("element").describe("Drag preview type"),disabled:f().default(!1).describe("Disable dragging")}).merge(D.partial()).describe("Draggable item configuration");l({enabled:f().default(!1).describe("Enable drag and drop"),dragItem:Ul.optional().describe("Configuration for draggable item"),dropZone:Ll.optional().describe("Configuration for drop target"),sortable:f().default(!1).describe("Enable sortable list behavior"),autoScroll:f().default(!0).describe("Auto-scroll during drag near edges"),touchDelay:m().default(200).describe("Delay in ms before drag starts on touch devices")}).describe("Drag and drop interaction configuration");function Ji(){const e=typeof window<"u"?window.innerWidth:1024;return e<640?35:e<1024?50:60}function Gi({tasks:e,viewMode:t="month",startDate:i,endDate:o,onTaskClick:r,onViewChange:s,onAddClick:a,className:c}){const[d,u]=ne.useState(new Date),[v,y]=ne.useState(typeof window<"u"&&window.innerWidth<640?32:40),[w,z]=ne.useState(Ji());ne.useEffect(()=>{const S=()=>{y(window.innerWidth<640?32:40),z(Ji())};return window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const O=ne.useMemo(()=>{let S=i?new Date(i):new Date,$=o?new Date(o):new Date;return!i&&e.length>0&&(S=new Date(Math.min(...e.map(re=>re.start.getTime()))),S.setDate(S.getDate()-7)),!o&&e.length>0&&($=new Date(Math.max(...e.map(re=>re.end.getTime()))),$.setDate($.getDate()+14)),S.setHours(0,0,0,0),$.setHours(23,59,59,999),{start:S,end:$}},[i,o,e]),E=ne.useMemo(()=>{const S=[],$=new Date(O.start);for(;$<=O.end;)S.push({date:new Date($),label:$.getDate().toString(),isWeekend:$.getDay()===0||$.getDay()===6}),$.setDate($.getDate()+1);return S},[O]),q=300,ie=ne.useRef(null),se=ne.useRef(null),J=ne.useRef(null),Z=S=>{ie.current&&(ie.current.scrollLeft=S.currentTarget.scrollLeft),se.current&&(se.current.scrollTop=S.currentTarget.scrollTop)},C=S=>{O.end.getTime()-O.start.getTime();const $=w,re=1e3*60*60*24,fe=S.start.getTime()-O.start.getTime(),B=S.end.getTime()-S.start.getTime(),Oe=fe/re*$,me=Math.max(B/re*$,$);return{left:Oe,width:me}};return _.jsxs("div",{className:G.cn("flex flex-col h-full bg-background border rounded-lg overflow-hidden",c),children:[_.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 p-2 border-b bg-card",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsxs(G.Button,{variant:"outline",size:"sm",onClick:()=>a?.(),"aria-label":"Create new task",children:[_.jsx(xe.Plus,{className:"h-4 w-4 mr-1 sm:mr-2"}),_.jsx("span",{className:"hidden sm:inline",children:"New Task"}),_.jsx("span",{className:"sm:hidden",children:"New"})]}),_.jsx("div",{className:"h-4 w-px bg-border mx-1 sm:mx-2"}),_.jsx(G.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",children:_.jsx(xe.ChevronLeft,{className:"h-4 w-4"})}),_.jsx(G.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",children:_.jsx(xe.ChevronRight,{className:"h-4 w-4"})}),_.jsx("span",{className:"font-semibold text-xs sm:text-sm",children:O.start.toLocaleDateString(void 0,{month:"long",year:"numeric"})})]}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsxs(G.Select,{value:t,onValueChange:S=>s?.(S),children:[_.jsx(G.SelectTrigger,{className:"w-[100px] sm:w-[120px] h-8",children:_.jsx(G.SelectValue,{})}),_.jsxs(G.SelectContent,{children:[_.jsx(G.SelectItem,{value:"day",children:"Day View"}),_.jsx(G.SelectItem,{value:"week",children:"Week View"}),_.jsx(G.SelectItem,{value:"month",children:"Month View"}),_.jsx(G.SelectItem,{value:"quarter",children:"Quarter View"})]})]}),_.jsxs("div",{className:"flex bg-muted rounded-md p-1",children:[_.jsx(G.Button,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>z(S=>Math.max(15,S-10)),children:_.jsx(xe.ZoomOut,{className:"h-3 w-3"})}),_.jsx(G.Button,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>z(S=>Math.min(120,S+10)),children:_.jsx(xe.ZoomIn,{className:"h-3 w-3"})})]})]})]}),_.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[_.jsxs("div",{className:"flex border-b bg-muted/30 shrink-0 h-10 sm:h-[50px]",children:[_.jsxs("div",{className:"flex items-center font-medium text-xs text-muted-foreground px-2 sm:px-4 border-r bg-card z-20 shadow-sm",style:{width:q,minWidth:q},children:[_.jsx("div",{className:"flex-1",children:"Task Name"}),_.jsx("div",{className:"w-16 sm:w-20 text-right hidden sm:block",children:"Start"}),_.jsx("div",{className:"w-16 sm:w-20 text-right hidden sm:block",children:"End"})]}),_.jsx("div",{className:"flex-1 overflow-hidden",ref:ie,children:_.jsx("div",{className:"flex h-full",style:{width:E.length*w},children:E.map((S,$)=>_.jsxs("div",{className:G.cn("flex flex-col items-center justify-center border-r text-xs text-muted-foreground h-full",S.isWeekend&&"bg-muted/50"),style:{width:w,minWidth:w},children:[_.jsx("span",{className:"font-medium text-foreground",children:S.label}),_.jsx("span",{className:"text-[10px] opacity-70",children:S.date.toLocaleDateString(void 0,{weekday:"narrow"})})]},$))})})]}),_.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[_.jsx("div",{className:"overflow-hidden border-r bg-card z-10 shadow-sm",ref:se,style:{width:q,minWidth:q},children:e.map(S=>_.jsxs("div",{className:"flex items-center border-b px-2 sm:px-4 hover:bg-accent/50 cursor-pointer transition-colors touch-manipulation",style:{height:v},onClick:()=>r?.(S),children:[_.jsxs("div",{className:"flex-1 truncate font-medium text-xs sm:text-sm flex items-center gap-2",children:[_.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:S.color||"#3b82f6"}}),S.title]}),_.jsx("div",{className:"w-16 sm:w-20 text-right text-xs text-muted-foreground hidden sm:block",children:S.start.toLocaleDateString(void 0,{month:"numeric",day:"numeric"})}),_.jsx("div",{className:"w-16 sm:w-20 text-right text-xs text-muted-foreground hidden sm:block",children:S.end.toLocaleDateString(void 0,{month:"numeric",day:"numeric"})})]},S.id))}),_.jsx("div",{className:"flex-1 overflow-auto bg-background/50 relative [-webkit-overflow-scrolling:touch]",ref:J,onScroll:Z,children:_.jsx("div",{style:{width:E.length*w},children:_.jsxs("div",{className:"relative",children:[_.jsx("div",{className:"absolute inset-0 flex pointer-events-none z-0",children:E.map((S,$)=>_.jsx("div",{className:G.cn("border-r h-full",S.isWeekend&&"bg-muted/20"),style:{width:w,minWidth:w}},$))}),e.map(S=>{const $=C(S);return _.jsx("div",{className:"relative border-b hover:bg-black/5",style:{height:v},children:_.jsxs("div",{className:"absolute top-1 sm:top-2 h-[calc(100%-8px)] sm:h-[calc(100%-16px)] rounded-sm bg-primary border border-primary-foreground/20 shadow-sm cursor-pointer hover:brightness-110 flex items-center px-2 group",style:{left:$.left,width:$.width,backgroundColor:S.color||"#3b82f6"},onClick:()=>r?.(S),children:[S.progress>0&&_.jsx("div",{className:"absolute left-0 top-0 bottom-0 bg-black/20 rounded-l-sm",style:{width:`${S.progress}%`}}),_.jsxs("span",{className:"text-[10px] text-white font-medium truncate opacity-0 group-hover:opacity-100 transition-opacity",children:[Math.round(S.progress),"%"]})]})},S.id)}),_.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-red-500 z-20 pointer-events-none",style:{left:(new Date().getTime()-O.start.getTime())/(1e3*60*60*24)*w},children:_.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 -ml-[3px]"})})]})})})]})]})]})}function Vl(e){return e.data?e.data:e.staticData?{provider:"value",items:e.staticData}:e.objectName?{provider:"object",object:e.objectName}:null}function Wl(e){if(e){if(typeof e=="string"){const t=e.split(" "),i=t[0],o=t[1]?.toLowerCase()==="desc"?"desc":"asc";return{[i]:o}}if(Array.isArray(e))return e.reduce((t,i)=>(i.field&&i.order&&(t[i.field]=i.order),t),{})}}function ql(e){let t=null;if(e.startDateField&&e.endDateField)return t={startDateField:e.startDateField,endDateField:e.endDateField,titleField:e.titleField||"name",progressField:e.progressField,dependenciesField:e.dependenciesField||e.dependencyField,colorField:e.colorField},t;if(e.gantt&&(t=e.gantt),t){const i=Oi.safeParse(t);return i.success||console.warn("[ObjectGantt] Invalid gantt configuration:",i.error.format()),t}return null}const Bi=({schema:e,dataSource:t,className:i,onTaskClick:o,onRowClick:r,...s})=>{const[a,c]=K.useState([]),[d,u]=K.useState(!0),[v,y]=K.useState(null),[w,z]=K.useState(null),O=Vl(e),E=K.useMemo(()=>O,[JSON.stringify(O)]),q=ql(e),ie=E?.provider==="value";K.useEffect(()=>{(async()=>{try{if(u(!0),s.data&&Array.isArray(s.data)){c(s.data),u(!1);return}if(ie&&E?.provider==="value"){c(E.items),u(!1);return}if(!t)throw new Error("DataSource required for object/api providers");if(E?.provider==="object"){const C=E.object,S=await t.find(C,{$filter:e.filter,$orderby:Wl(e.sort)});let $=[];Array.isArray(S)?$=S:S&&typeof S=="object"&&(Array.isArray(S.data)?$=S.data:Array.isArray(S.records)&&($=S.records)),c($)}else E?.provider==="api"&&(console.warn("API provider not yet implemented for ObjectGantt"),c([]));u(!1)}catch(C){y(C),u(!1)}})()},[E,t,ie,e.filter,e.sort]),K.useEffect(()=>{!ie&&t&&(async()=>{try{if(!t)return;const C=E?.provider==="object"?E.object:e.objectName;if(!C)return;const S=await t.getObjectSchema(C);z(S)}catch(C){console.error("Failed to fetch object schema:",C)}})()},[e.objectName,t,ie,E]);const se=K.useMemo(()=>{if(!q||!a.length)return[];const{startDateField:Z,endDateField:C,titleField:S,progressField:$,dependenciesField:re,colorField:fe}=q;return a.map((B,Oe)=>{const me=B[Z],Ie=B[C],gt=B[S]||"Untitled Task",Ce=$?B[$]:0,Pe=re?B[re]:[],tt=fe?B[fe]:void 0;return{id:B.id||B._id||`task-${Oe}`,title:gt,start:me?new Date(me):new Date,end:Ie?new Date(Ie):new Date,progress:Math.min(100,Math.max(0,Ce||0)),dependencies:Array.isArray(Pe)?Pe:[],color:tt,data:B}}).filter(B=>!isNaN(B.start.getTime())&&!isNaN(B.end.getTime()))},[a,q]),J=wt.useNavigationOverlay({navigation:e.navigation,objectName:e.objectName,onRowClick:r});return d?_.jsx("div",{className:i,children:_.jsx("div",{className:"flex items-center justify-center h-96",children:_.jsx("div",{className:"text-muted-foreground",children:"Loading Gantt chart..."})})}):v?_.jsx("div",{className:i,children:_.jsx("div",{className:"flex items-center justify-center h-96",children:_.jsxs("div",{className:"text-destructive",children:["Error: ",v.message]})})}):q?_.jsxs("div",{className:i,children:[_.jsx("div",{className:"h-[calc(100vh-200px)] min-h-[600px]",children:_.jsx(Gi,{tasks:se,onTaskClick:Z=>{J.handleClick(Z.data),o?.(Z.data)},onAddClick:()=>{}})}),J.isOverlay&&_.jsx(G.NavigationOverlay,{...J,title:"Task Details",children:Z=>_.jsx("div",{className:"space-y-3",children:Object.entries(Z).map(([C,S])=>_.jsxs("div",{className:"flex flex-col",children:[_.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:C.replace(/_/g," ")}),_.jsx("span",{className:"text-sm",children:String(S??"—")})]},C))})})]}):_.jsx("div",{className:i,children:_.jsx("div",{className:"flex items-center justify-center h-96",children:_.jsx("div",{className:"text-muted-foreground",children:"Gantt configuration required. Please specify startDateField, endDateField, and titleField."})})})},ht=({schema:e})=>{const{dataSource:t}=wt.useSchemaContext();return _.jsx(Bi,{schema:e,dataSource:t})};_t.ComponentRegistry.register("object-gantt",ht,{namespace:"plugin-gantt",label:"Object Gantt",category:"view",inputs:[{name:"objectName",type:"string",label:"Object Name",required:!0},{name:"gantt",type:"object",label:"Gantt Config",description:"startDateField, endDateField, titleField, progressField, percentageField, colorField, dependenciesField"}]}),_t.ComponentRegistry.register("gantt",ht,{namespace:"view",label:"Gantt View",category:"view",inputs:[{name:"objectName",type:"string",label:"Object Name",required:!0},{name:"gantt",type:"object",label:"Gantt Config",description:"startDateField, endDateField, titleField, progressField, percentageField, colorField, dependenciesField"}]}),X.GanttView=Gi,X.ObjectGantt=Bi,X.ObjectGanttRenderer=ht,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})}));