@theoremjs/studio 0.3.4-next.679.gcdf1a3a → 0.3.4-next.711.g78e504a

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.
Files changed (161) hide show
  1. package/agreement.js +35 -5
  2. package/browser-connection.d.ts +1 -1
  3. package/browser-connection.js +3 -1
  4. package/browser-execution.js +1 -0
  5. package/compile-workspace.js +12 -5
  6. package/compile.d.ts +5 -3
  7. package/compile.js +80 -36
  8. package/cookbooks/catalog.d.ts +2 -2
  9. package/cookbooks/catalog.js +296 -51
  10. package/cookbooks/project.js +1 -0
  11. package/cookbooks/tools.js +64 -0
  12. package/draft.d.ts +23 -4
  13. package/draft.js +25 -2
  14. package/guardrail-probe.d.ts +3 -1
  15. package/guardrail-probe.js +37 -5
  16. package/mod.d.ts +2 -3
  17. package/mod.js +2 -3
  18. package/package.json +4 -4
  19. package/page/assets/Banner-GFaYsfrc.js +3 -0
  20. package/page/assets/Center-CgO0c-qo.js +1 -0
  21. package/page/assets/{ConsoleFrame-BMf3HicW.js → ConsoleFrame-KmyDVQkS.js} +3 -3
  22. package/page/assets/{MenuBottomSheet-sVJMYa4R.js → MenuBottomSheet-BSQO5V7g.js} +1 -1
  23. package/page/assets/{SchemaFields-DYormNVH.js → SchemaFields-CIsMisSq.js} +1 -1
  24. package/page/assets/{ToolResultCharts-Ce4lVdgN.js → ToolResultCharts-95plvcj4.js} +1 -1
  25. package/page/assets/{TraceInspector-DHyj0IHY.js → TraceInspector-D2113s73.js} +1 -1
  26. package/page/assets/{TraceOverview-CeiOIqk9.js → TraceOverview-Bz2EnBzL.js} +3 -3
  27. package/page/assets/{_virtual_studio-type-sources-BwSqfSwd.js → _virtual_studio-type-sources-La9AcR1O.js} +360 -97
  28. package/page/assets/browser-connection-B2a2EaIg.js +3 -0
  29. package/page/assets/browser-engine--lGbAmPM.js +13 -0
  30. package/page/assets/browser-transport-h1KAGUN4.js +45 -0
  31. package/page/assets/{crypto-CD14HeXH.js → crypto-BnoW7FFO.js} +1 -1
  32. package/page/assets/{encode-files-DhoC5hWG.js → encode-files-DoLGXgup.js} +1 -1
  33. package/page/assets/{export-agent-Cs2S0oXB.js → export-agent-CA42Pf8A.js} +3 -3
  34. package/page/assets/{guardrail-tester-IcJWVveC.js → guardrail-tester-fDJlewVB.js} +2 -2
  35. package/page/assets/index-Bd7U_fu_.js +149 -0
  36. package/page/assets/{labels-provider-t4c-5JMk.js → labels-provider-uONlWExD.js} +1 -1
  37. package/page/assets/live-messages-CTL-QEqM.js +1 -0
  38. package/page/assets/people-CIsR0-5R.js +1 -0
  39. package/page/assets/project-address-DjxPZuyn.js +1 -0
  40. package/page/assets/reader-COeSYhdZ.js +5 -0
  41. package/page/assets/{schemas-BQ9Jydzb.js → schemas-D7cgkv3L.js} +1 -1
  42. package/page/assets/shaped-data-7q5Be8sp.js +20 -0
  43. package/page/assets/{stub-nxRsh1jo.js → stub-DJBcKncO.js} +25 -7
  44. package/page/assets/studio-code-pane-MXm30Ppv.js +10 -0
  45. package/page/assets/{studio-console-Cn-v8Vvw.js → studio-console-dHEr6mr5.js} +1 -1
  46. package/page/assets/studio-decision-BoSmTyjn.js +1 -0
  47. package/page/assets/studio-embedding-B5E__vsY.js +2 -0
  48. package/page/assets/studio-host-console-CadL7PPh.js +2 -0
  49. package/page/assets/{studio-labels-CiLuAo3N.js → studio-labels-sxDmOFeL.js} +1 -1
  50. package/page/assets/studio-live-Cgt4zKeL.js +5 -0
  51. package/page/assets/studio-map-BgeqrIh_.js +1 -0
  52. package/page/assets/{studio-session-CjUQSXx0.js → studio-session-ClF2iNCX.js} +1 -1
  53. package/page/assets/studio-trace-replay-BqYGBZ1t.js +3 -0
  54. package/page/assets/{studio-type-checker-BbUSqqOS.js → studio-type-checker-DutkTKte.js} +1 -1
  55. package/page/assets/tool-schema-m1KPujBp.js +17 -0
  56. package/page/assets/{trace-record-DxgSKmYY.js → trace-record-Dm2jEhUR.js} +1 -1
  57. package/page/assets/trace-schema--4IGmLeE.js +1 -0
  58. package/page/assets/tree-5tuw5ISS.js +3 -0
  59. package/page/assets/turn-client-BmadRouD.js +2 -0
  60. package/page/assets/{use-one-call-BZKByPJh.js → use-one-call-IXfdRlUH.js} +1 -1
  61. package/page/assets/use-second-ticker-D6JSf9B3.js +1 -0
  62. package/page/assets/workspace-CMUi6xcQ.js +1 -0
  63. package/page/index.html +22 -20
  64. package/people.d.ts +2 -0
  65. package/people.js +3 -1
  66. package/policy.js +1 -0
  67. package/providers.d.ts +2 -2
  68. package/providers.js +8 -3
  69. package/read-source.js +67 -7
  70. package/registrations.d.ts +32 -4
  71. package/runtime-scope.d.ts +6 -3
  72. package/runtime-scope.js +16 -4
  73. package/runtime.js +15 -2
  74. package/section-notes.d.ts +1 -0
  75. package/section-notes.js +1 -0
  76. package/serve-page.mjs +8 -4
  77. package/server/draft-handler.d.ts +4 -4
  78. package/server/draft-handler.js +3 -2
  79. package/server/draft-probe.d.ts +9 -1
  80. package/server/draft-probe.js +2 -1
  81. package/server/handler.d.ts +0 -3
  82. package/server/handler.js +62 -38
  83. package/server/live.d.ts +7 -2
  84. package/server/live.js +11 -5
  85. package/server/run-traces.d.ts +5 -1
  86. package/server/run-traces.js +7 -3
  87. package/server/save-new.js +5 -5
  88. package/server/save-plan.js +2 -1
  89. package/server/save-session.js +4 -2
  90. package/server/serve.js +2 -1
  91. package/server/test-key.d.ts +2 -2
  92. package/server/test-key.js +1 -1
  93. package/slot-values.d.ts +2 -0
  94. package/slot-values.js +22 -0
  95. package/source.js +11 -4
  96. package/system-markup.d.ts +9 -7
  97. package/system-markup.js +38 -19
  98. package/tool-readers.d.ts +23 -0
  99. package/tool-readers.js +60 -0
  100. package/tools.js +5 -1
  101. package/types.d.ts +6 -1
  102. package/ui/inspector-context.d.ts +1 -8
  103. package/ui/inspector-context.js +0 -7
  104. package/ui/inspector.d.ts +43 -1
  105. package/ui/inspector.js +50 -9
  106. package/ui/lib/entries.d.ts +13 -0
  107. package/ui/lib/entries.js +43 -0
  108. package/ui/lib/project-traces.d.ts +5 -0
  109. package/ui/lib/project-traces.js +11 -1
  110. package/ui/lib/studio-page.d.ts +6 -1
  111. package/ui/lib/studio-page.js +33 -31
  112. package/ui/lib/studio-prefs.d.ts +0 -4
  113. package/ui/lib/studio-prefs.js +0 -7
  114. package/ui/lib/studio-project.d.ts +10 -6
  115. package/ui/lib/studio-project.js +19 -4
  116. package/ui/lib/studio-session.d.ts +2 -0
  117. package/ui/lib/studio-session.js +40 -2
  118. package/ui/lib/studio-store.d.ts +2 -2
  119. package/ui/lib/studio-store.js +9 -5
  120. package/ui/lib/tool-probe.d.ts +2 -0
  121. package/ui/lib/tool-probe.js +3 -2
  122. package/ui/lib/type-icons.d.ts +1 -0
  123. package/ui/lib/type-icons.js +2 -1
  124. package/ui/profile-editor.js +69 -45
  125. package/ui/studio-compare.d.ts +14 -4
  126. package/ui/studio-compare.js +58 -24
  127. package/ui/studio-live.d.ts +1 -1
  128. package/ui/studio-live.js +8 -3
  129. package/ui/studio-runner.d.ts +3 -2
  130. package/ui/studio-runner.js +16 -14
  131. package/ui/studio-screen.d.ts +1 -2
  132. package/ui/studio-screen.js +33 -37
  133. package/ui/studio-settings.js +4 -13
  134. package/ui/studio-trace-replay.js +7 -1
  135. package/workspace.js +3 -2
  136. package/asks.d.ts +0 -54
  137. package/asks.js +0 -69
  138. package/page/assets/Banner-CkcwUyOn.js +0 -4
  139. package/page/assets/Center-nHS1JSux.js +0 -1
  140. package/page/assets/browser-connection-DSUHVCT5.js +0 -3
  141. package/page/assets/browser-engine-BXSD3WU8.js +0 -11
  142. package/page/assets/browser-transport-cp9y8bBz.js +0 -45
  143. package/page/assets/index-JWco7tJJ.js +0 -145
  144. package/page/assets/live-messages-CiLmR89m.js +0 -1
  145. package/page/assets/reader-DrOfMM8I.js +0 -5
  146. package/page/assets/shaped-data-H1miOZm2.js +0 -20
  147. package/page/assets/studio-code-pane-B8MOEW9g.js +0 -8
  148. package/page/assets/studio-decision-CjJ_pqdJ.js +0 -1
  149. package/page/assets/studio-embedding-Cq3ePsfC.js +0 -2
  150. package/page/assets/studio-host-console-D__Of1no.js +0 -2
  151. package/page/assets/studio-live-DvDQbP5V.js +0 -5
  152. package/page/assets/studio-map-BZFYGG_Y.js +0 -1
  153. package/page/assets/studio-trace-replay-D22FgUA5.js +0 -3
  154. package/page/assets/tool-schema-BmRYaywn.js +0 -17
  155. package/page/assets/trace-schema-9CdEyG6Q.js +0 -1
  156. package/page/assets/tree-3N-1RPZz.js +0 -3
  157. package/page/assets/turn-client-DN8PawJr.js +0 -2
  158. package/page/assets/use-second-ticker-CEwOSS-d.js +0 -1
  159. package/page/assets/workspace-CTSW941G.js +0 -1
  160. package/ui/confirm-write.d.ts +0 -12
  161. package/ui/confirm-write.js +0 -45
@@ -53,4 +53,4 @@ import{n as e}from"./rolldown-runtime-hePW80VL.js";function t(e){let t=Object.va
53
53
 
54
54
  `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},s,c=ie,l=!k.jitless,u=l&&ae.value,d=t.catchall,f;e._zod.parse=(i,a)=>{f??=r.value;let p=i.value;return c(p)?l&&u&&a?.async===!1&&a.jitless!==!0?(s||=o(t.shape),i=s(i,a),d?Pi([],p,i,a,f,e,a?.abortEarly===!0):i):n(i,a):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Li(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!S(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>w(e,r,A())))}),t)}var Ri=D(`$ZodUnion`,(e,t)=>{N.init(e,t),E(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),E(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),E(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),E(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>s(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Li(t,r,e,i)):Li(o,r,e,i)}});function zi(e,t,n,r){let i=[];for(let t=0;t<e.length;t++)e[t].issues.length===0&&i.push(t);return i.length===1?(t.value=e[i[0]].value,t):(i.length===0?t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>w(e,r,A())))}):t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:[],inclusive:!1,matches:i}),t)}var Bi=D(`$ZodXor`,(e,t)=>{Ri.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);t instanceof Promise?(o.push(t),a=!0):o.push(t)}return a?Promise.all(o).then(t=>zi(t,r,e,i)):zi(o,r,e,i)}});function Vi(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var Hi=D(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Ri.init(e,t);let n=e._zod.parse;E(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||d(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=f(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=a(()=>Vi(t));e._zod.parse=(i,a)=>{let o=i.value;if(!ie(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),Ui=D(`$ZodIntersection`,(e,t)=>{N.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Gi(e,t,n)):Gi(e,i,a)}});function Wi(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(v(e)&&v(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Wi(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Wi(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Gi(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Wi(t.value,n.value);if(!c.valid){if(S(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Ki=D(`$ZodTuple`,(e,t)=>{N.init(e,t);let n=t.items,r=k.memoizer;r?.attach(e),e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=r?r.alloc(e,i,[],a):[];let s=[],c=qi(n,`optin`),l=qi(n,`optout`);if(!t.rest){if(o.length<c)return i.issues.push({code:`too_small`,minimum:c,inclusive:!0,input:o,inst:e,origin:`array`}),i;o.length>n.length&&i.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:o,inst:e,origin:`array`})}let u=Array(n.length),d=t.rest?a?.abortEarly:void 0,f=!1;for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:o[e],issues:[]},a);t instanceof Promise?s.push(t.then(t=>{u[e]=t})):(u[e]=t,d&&!f&&t.issues.length&&(f=S(t)))}if(t.rest&&!f){let e=n.length-1,r=o.slice(n.length),c=i.issues.length;for(let n of r){if(d&&i.issues.length!==c){if(S(i,c))break;c=i.issues.length}e++;let r=t.rest._zod.run({value:n,issues:[]},a);r instanceof Promise?s.push(r.then(t=>Ji(t,i,e))):Ji(r,i,e)}}return s.length?Promise.all(s).then(()=>Yi(u,i,n,o,l)):Yi(u,i,n,o,l)}});function qi(e,t){for(let n=e.length-1;n>=0;n--)if(!(t===`optin`?e[n]._zod.optin!==void 0:e[n]._zod.optout===`optional`))return n+1;return 0}function Ji(e,t,n){e.issues.length&&t.issues.push(...C(n,e.issues)),t.value[n]=e.value}function Yi(e,t,n,r,i){for(let a=0;a<n.length;a++){let o=e[a],s=a<r.length;if(!s&&a>=i&&n[a]._zod.optin===`optional`){t.value.length=a;break}if(o.issues.length){if(!s&&a>=i){t.value.length=a;break}t.issues.push(...C(a,o.issues))}t.value[a]=o.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}var Xi=D(`$ZodRecord`,(e,t)=>{N.init(e,t);let n=k.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!v(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>w(e,i,A())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...C(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...C(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&xn.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>w(e,i,A())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...C(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...C(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Zi=D(`$ZodMap`,(e,t)=>{N.init(e,t);let n=k.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!(a instanceof Map))return r.issues.push({expected:`map`,code:`invalid_type`,input:a,inst:e}),r;let o=[];r.value=n?n.alloc(e,r,new Map,i):new Map;let s=i?.abortEarly,c=r.issues.length;for(let[n,l]of a){if(s&&r.issues.length!==c){if(S(r,c))break;c=r.issues.length}let u=t.keyType._zod.run({value:n,issues:[]},i),d=t.valueType._zod.run({value:l,issues:[]},i);u instanceof Promise||d instanceof Promise?o.push(Promise.all([u,d]).then(([t,o])=>{Qi(t,o,r,n,a,e,i)})):Qi(u,d,r,n,a,e,i)}return o.length?Promise.all(o).then(()=>r):r}});function Qi(e,t,n,r,i,a,o){e.issues.length&&(se.has(typeof r)?n.issues.push(...C(r,e.issues)):n.issues.push({code:`invalid_key`,origin:`map`,input:i,inst:a,issues:e.issues.map(e=>w(e,o,A()))})),t.issues.length&&(se.has(typeof r)?n.issues.push(...C(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>w(e,o,A()))})),n.value.set(e.value,t.value)}var $i=D(`$ZodSet`,(e,t)=>{N.init(e,t);let n=k.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!(a instanceof Set))return r.issues.push({input:a,inst:e,expected:`set`,code:`invalid_type`}),r;let o=[];r.value=n?n.alloc(e,r,new Set,i):new Set;let s=i?.abortEarly,c=r.issues.length;for(let e of a){if(s&&r.issues.length!==c){if(S(r,c))break;c=r.issues.length}let n=t.valueType._zod.run({value:e,issues:[]},i);n instanceof Promise?o.push(n.then(e=>ea(e,r))):ea(n,r)}return o.length?Promise.all(o).then(()=>r):r}});function ea(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var ta=D(`$ZodEnum`,(e,n)=>{N.init(e,n);let r=t(n.entries),i=new Set(r);e._zod.values=i,E(e,`pattern`,e=>{let n=t(e.def.entries).filter(e=>se.has(typeof e));return RegExp(n.length?`^(${n.map(e=>y(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,n)=>{let a=t.value;return i.has(a)||t.issues.push({code:`invalid_value`,values:r,input:a,inst:e}),t}}),na=D(`$ZodLiteral`,(e,t)=>{N.init(e,t);let n=new Set(t.values);e._zod.values=n,E(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?y(e):e?y(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),ra=D(`$ZodFile`,(e,t)=>{N.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:`file`,code:`invalid_type`,input:r,inst:e}),t}}),ia=D(`$ZodTransform`,(e,t)=>{N.init(e,t),e._zod.optin=`optional`,k.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new qe(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new O;return n.value=i,n}});function aa(e,t){return e.value=t.issues.length?void 0:t.value,e}var oa=D(`$ZodOptional`,(e,t)=>{N.init(e,t),E(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,E(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),E(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${s(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>aa(e,t)):aa(e,r)}return t.innerType._zod.run(e,n)}}),sa=D(`$ZodExactOptional`,(e,t)=>{oa.init(e,t),E(e,`values`,e=>e.def.innerType._zod.values),E(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ca=D(`$ZodNullable`,(e,t)=>{N.init(e,t),E(e,`optin`,e=>e.def.innerType._zod.optin),E(e,`optout`,e=>e.def.innerType._zod.optout),E(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${s(t.source)}|null)$`):void 0}),E(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),la=D(`$ZodDefault`,(e,t)=>{N.init(e,t),e._zod.optin=`defaulted`,E(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ua(e,t)):ua(r,t)}});function ua(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var da=D(`$ZodPrefault`,(e,t)=>{N.init(e,t),e._zod.optin=`defaulted`,E(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),fa=D(`$ZodNonOptional`,(e,t)=>{N.init(e,t),E(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>pa(t,e)):pa(i,e)}});function pa(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var ma=D(`$ZodSuccess`,(e,t)=>{N.init(e,t),e._zod.parse=(e,n)=>{if(n.direction===`backward`)throw new qe(`ZodSuccess`);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=t.issues.length===0,e)):(e.value=r.issues.length===0,e)}});function ha(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>w(e,r,A()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var ga=D(`$ZodCatch`,(e,t)=>{N.init(e,t),E(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),E(e,`optout`,e=>e.def.innerType._zod.optout),E(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>ha(e,r,t,n)):ha(e,r,t,n)}}),_a=D(`$ZodNaN`,(e,t)=>{N.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),va=D(`$ZodPipe`,(e,t)=>{N.init(e,t),E(e,`values`,e=>e.def.in._zod.values),E(e,`optin`,e=>e.def.in._zod.optin),E(e,`optout`,e=>e.def.out._zod.optout),E(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ya(e,t.in,n)):ya(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ya(e,t.out,n)):ya(r,t.out,n)}});function ya(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var ba=D(`$ZodCodec`,(e,t)=>{N.init(e,t),E(e,`values`,e=>e.def.in._zod.values),E(e,`optin`,e=>e.def.in._zod.optin),E(e,`optout`,e=>e.def.out._zod.optout),E(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if((n.direction||`forward`)===`forward`){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>xa(e,t,n)):xa(r,t,n)}{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>xa(e,t,n)):xa(r,t,n)}}});function xa(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>Sa(e,r,t.out,n)):Sa(e,r,t.out,n)}{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>Sa(e,r,t.in,n)):Sa(e,r,t.in,n)}}function Sa(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}var Ca=D(`$ZodPreprocess`,(e,t)=>{va.init(e,t)}),wa=D(`$ZodReadonly`,(e,t)=>{N.init(e,t),E(e,`propValues`,e=>e.def.innerType._zod.propValues),E(e,`values`,e=>e.def.innerType._zod.values),E(e,`optin`,e=>e.def.innerType?._zod?.optin),E(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Ta):Ta(r)}});function Ta(e){return e.memo||(e.value=Object.freeze(e.value)),e}function Ea(e){let t=e._zod.def,n=t.pattern,r=!!t.format?.includes(`int`),i,a;for(let e of t.checks??[]){let t=e._zod.def;t.pattern&&(n=t.pattern),r||=!!t.format?.includes(`int`);let o=t.minimum??t.length,s=t.maximum??t.length;o!==void 0&&(i===void 0||o>i)&&(i=o),s!==void 0&&(a===void 0||s<a)&&(a=s)}if(n)return n.source;if(i!==void 0&&a!==void 0&&i>a)return`(?!)`;if(i!==void 0||a!==void 0)return vn({minimum:i,maximum:a}).source;let o=e._zod.pattern;return(r&&o===xn?bn:o)?.source}function Da(e){let t=e._zod.def,n=e._zod.pattern?.source,r=t.innerType??e._zod.innerType;if(r){let e=r._zod.pattern?.source,t=Da(r);return n&&e&&t&&t!==e?n.replace(s(e),()=>s(t)):n}if(t.options){let e=t.options.map(Da);if(e.every(Boolean))return`^(${e.map(e=>s(e)).join(`|`)})$`}return Ea(e)}var Oa=D(`$ZodTemplateLiteral`,(e,t)=>{N.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){let t=Da(e);if(!t)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);n.push(s(t))}else if(e===null||ce.has(typeof e))n.push(y(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`string`,code:`invalid_type`}),n)}),ka=D(`$ZodFunction`,(e,t)=>(N.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return Object.defineProperty(function(...n){let r=e._def.input?lt(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?lt(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return Object.defineProperty(async function(...n){let r=e._def.input?await dt(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await dt(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(t,n)=>typeof t.value==`function`?(t.value=e._def.output&&e._def.output._zod.def.type===`promise`?e.implementAsync(t.value):e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new Ki({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),Aa=D(`$ZodPromise`,(e,t)=>{N.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),ja=D(`$ZodLazy`,(e,t)=>{N.init(e,t),u(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),E(e,`pattern`,e=>e.innerType?._zod?.pattern),E(e,`propValues`,e=>e.innerType?._zod?.propValues),E(e,`optin`,e=>e.innerType?._zod?.optin??void 0),E(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Ma=D(`$ZodCustom`,(e,t)=>{M.init(e,t),N.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Na(t,n,r,e));Na(i,n,r,e)}});function Na(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Ae(e))}}var Pa=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Fa=`~memo`,Ia=[];function La(e){return typeof e==`object`&&!!e}function Ra(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var za=new WeakMap,Ba=0,Va=1,Ha=2;function Ua(e,t,n){let r=za.get(e);if(r!==void 0)return r?Ha:Ba;if(t.has(e))return Ha;t.add(e);let i=Ba,a=e=>{if(i!==Ha&&e?._zod){let r=Ua(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Ba;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Va:o.value?._zod?Ua(o.value,t,n):Ba;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=f(c);s(e?o(e,!0):Va),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Ua(r,t,!1):Va);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Wa(e,i)}function Wa(e,t){return t!==Va&&za.set(e,t===Ha),t}function Ga(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Ka,qa=[],Ja={alloc(e,t,n){let r=Ka;if(!r)return n;Ka=void 0;let i={value:n,issues:null};return r.set(t.value,i),qa.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Xa(n,e.value))throw new Pa;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Ua(e,new Set,!1);if(i===Ba)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Ha||r?n=!0:r=!0}let l=s.value;if(!La(l))return t(s,c);let u=c[Fa];u||(u={buckets:new WeakMap,backEdges:void 0},c[Fa]=u);let d;i===c?d=a:(d=Ga(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Ra(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Ka=d;let p=qa.length,m=t(s,c);Ka=void 0;let h=qa.length>p?qa.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Ra(e.issues):Ia),e)):(h&&(h.issues=m.issues.length?Ra(m.issues):Ia),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Ya(){return Ja}function Xa(e,t){let n=e[Fa]?.backEdges;return n!==void 0&&La(t)&&n.has(t)}var Za=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let r={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},i={nan:`NaN`};function a(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):i[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${a(e.expected)}, received ${a(ke(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${le(e.values[0])}`:`Invalid option: expected one of ${n(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${n(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Qa(){return{localeError:Za()}}var $a,eo=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function to(){return new eo}($a=globalThis).__zod_globalRegistry??($a.__zod_globalRegistry=to());var F=globalThis.__zod_globalRegistry;function no(e){return e.checks&&=[...e.checks],e}function ro(e,t){return new e(no({type:`string`,...x(t)}))}function io(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...x(t)})}function ao(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...x(t)})}function oo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...x(t)})}function so(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...x(t)})}function co(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...x(t)})}function lo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...x(t)})}function uo(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...x(t)})}function fo(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...x(t)})}function po(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...x(t)})}function mo(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...x(t)})}function ho(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...x(t)})}function go(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...x(t)})}function _o(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...x(t)})}function vo(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...x(t)})}function yo(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...x(t)})}function bo(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...x(t)})}function xo(e,t){return new e({type:`string`,format:`mac`,check:`string_format`,abort:!1,...x(t)})}function So(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...x(t)})}function Co(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...x(t)})}function wo(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...x(t)})}function To(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...x(t)})}function Eo(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...x(t)})}function Do(e,t){return new e({type:`string`,format:`credit_card`,check:`string_format`,abort:!1,...x(t)})}function Oo(e,t){return new e({type:`string`,format:`iban`,check:`string_format`,abort:!1,...x(t)})}function ko(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...x(t)})}function Ao(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...x(t)})}function jo(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...x(t)})}function Mo(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...x(t)})}function No(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...x(t)})}function Po(e,t){return new e(no({type:`number`,checks:[],...x(t)}))}function Fo(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...x(t)})}function Io(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,...x(t)})}function Lo(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,...x(t)})}function Ro(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,...x(t)})}function zo(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,...x(t)})}function Bo(e,t){return new e({type:`boolean`,...x(t)})}function Vo(e,t){return new e({type:`bigint`,...x(t)})}function Ho(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,...x(t)})}function Uo(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,...x(t)})}function Wo(e,t){return new e({type:`symbol`,...x(t)})}function Go(e,t){return new e({type:`undefined`,...x(t)})}function Ko(e,t){return new e({type:`null`,...x(t)})}function qo(e){return new e({type:`any`})}function Jo(e){return new e({type:`unknown`})}function Yo(e,t){return new e({type:`never`,...x(t)})}function Xo(e,t){return new e({type:`void`,...x(t)})}function Zo(e,t){return new e({type:`date`,...x(t)})}function Qo(e,t){return new e({type:`nan`,...x(t)})}function I(e,t){return new Jn({check:`less_than`,...x(t),value:e,inclusive:!1})}function L(e,t){return new Jn({check:`less_than`,...x(t),value:e,inclusive:!0})}function R(e,t){return new Yn({check:`greater_than`,...x(t),value:e,inclusive:!1})}function z(e,t){return new Yn({check:`greater_than`,...x(t),value:e,inclusive:!0})}function $o(e){return R(0,e)}function es(e){return I(0,e)}function ts(e){return L(0,e)}function ns(e){return z(0,e)}function rs(e,t){return new Xn({check:`multiple_of`,...x(t),value:e})}function is(e,t){return new $n({check:`max_size`,...x(t),maximum:e})}function B(e,t){return new er({check:`min_size`,...x(t),minimum:e})}function as(e,t){return new tr({check:`size_equals`,...x(t),size:e})}function os(e,t){return new nr({check:`max_length`,...x(t),maximum:e})}function ss(e,t){return new rr({check:`min_length`,...x(t),minimum:e})}function cs(e,t){return new ir({check:`length_equals`,...x(t),length:e})}function ls(e,t){return new or({check:`string_format`,format:`regex`,...x(t),pattern:e})}function us(e){return new sr({check:`string_format`,format:`lowercase`,...x(e)})}function ds(e){return new cr({check:`string_format`,format:`uppercase`,...x(e)})}function fs(e,t){return new lr({check:`string_format`,format:`includes`,...x(t),includes:e})}function ps(e,t){return new ur({check:`string_format`,format:`starts_with`,...x(t),prefix:e})}function ms(e,t){return new dr({check:`string_format`,format:`ends_with`,...x(t),suffix:e})}function hs(e,t,n){return new pr({check:`property`,property:e,schema:t,...x(n)})}function gs(e,t){return new mr({check:`properties`,shape:e,...x(t)})}function _s(e,t){return new hr({check:`mime_type`,mime:e,...x(t)})}function V(e){return new gr({check:`overwrite`,tx:e})}function vs(e){return V(t=>t.normalize(e))}function ys(){return V(e=>e.trim())}function bs(){return V(e=>e.toLowerCase())}function xs(){return V(e=>e.toUpperCase())}function Ss(){return V(e=>ne(e))}function Cs(e,t,n){return new e({type:`array`,element:t,...x(n)})}function ws(e,t){return new e({type:`file`,...x(t)})}function Ts(e,t,n){let r=x(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Es(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...x(n)})}function Ds(e,t){let n=Os(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ae(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Ae(r))}},e(t.value,t)),t);return n}function Os(e,t){let n=new M({check:`custom`,...x(t)});return n._zod.check=e,n}function ks(e){let t=new M({check:`describe`});return t._zod.onattach=[t=>{let n=F.get(t)??{};F.add(t,{...n,description:e})}],t._zod.check=()=>{},t}function As(e){let t=new M({check:`meta`});return t._zod.onattach=[t=>{let n=F.get(t)??{};F.add(t,{...n,...e})}],t._zod.check=()=>{},t}function js(e,t){let n=x(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Codec??ba,c=e.Boolean??vi,l=new s({type:`pipe`,in:new(e.String??Sr)({type:`string`,error:n.error}),out:new c({type:`boolean`,error:n.error}),transform:((e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:!o.has(r)&&(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:l,continue:!1}),{})}),reverseTransform:((e,t)=>e===!0?r[0]||`true`:i[0]||`false`),error:n.error});return l._zod.bag.truthy=r,l._zod.bag.falsy=i,l._zod.bag.case=n.case??`insensitive`,l}function Ms(e,t,n,r={}){let i=x(r),a={check:`string_format`,type:`string`,format:t,fn:typeof n==`function`?n:e=>n.test(e),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}function Ns(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&d(e,t,n[t]);return e}function Ps(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??F,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function H(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function U(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,U(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Ns(o.schema,c),t.io===`input`&&W(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Fs(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Is(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Fs(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Fs(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
55
55
 
56
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ls(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ls(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Rs=new Set([`type`,`properties`,`required`,`additionalProperties`]),zs=[`oneOf`,`anyOf`];function Bs(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Vs(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Rs.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Bs(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}d(n,r,e.length===1?e[0]:Vs(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Bs(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Hs(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Rs)if(t in e)return;let n=t.filter(e=>zs.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Vs(t);else{let e=n[0],i=zs.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Vs([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ns(e,r))}function Us(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Ns(i,s),Ns(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ls(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Hs(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Ns(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,d(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Gs(t,`input`,e.processors),output:Gs(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function W(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return W(r.element,n);if(r.type===`set`)return W(r.valueType,n);if(r.type===`lazy`)return W(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return W(r.innerType,n);if(r.type===`intersection`)return W(r.left,n)||W(r.right,n);if(r.type===`record`||r.type===`map`)return W(r.keyType,n)||W(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:W(r.in,n)||W(r.out,n);if(r.type===`object`){for(let e in r.shape)if(W(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(W(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(W(e,n))return!0;return!!(r.rest&&W(r.rest,n))}return!1}var Ws=(e,t={})=>n=>{let r=Ps({...n,processors:t});return U(e,r),Is(r,e),Us(r,e)},Gs=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ps({...i??{},target:a,io:t,processors:n});return U(e,o),Is(o,e),Us(o,e)},G=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},K=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ks=(e,t)=>{G(e,`minimum`,t),K(e,`maximum`,t)},qs=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Js=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Ys=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Xs=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Zs=(e,t)=>G(e,`minimum`,t.minimum),Qs=(e,t)=>K(e,`maximum`,t.maximum),$s=e=>(t,n)=>{Xs(t,n.format);let[r,i]=e[n.format];G(t,`minimum`,r),K(t,`maximum`,i)},ec={greater_than:(e,t)=>G(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>K(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>qs(e,t.value),number_format:$s(de),bigint_format:$s(fe),min_length:Zs,max_length:Qs,length_equals:(e,t)=>Ks(e,t.length),min_size:Zs,max_size:Qs,size_equals:(e,t)=>Ks(e,t.size),string_format:(e,t)=>{Xs(e,t.format),t.pattern&&Js(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Ys(e,t.mime)};function q(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)ec[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&G(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&G(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&K(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&K(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&qs(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Ys(t,i.mime);for(let e of i.patterns??[])Js(t,e);return t}var tc={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},nc=new Map([[ei,tn],[ni,nn]]),rc=e=>nc.get(e)??e,ic=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=q(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=tc[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(rc);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ac=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=q(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):H(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},oc=(e,t,n,r)=>{n.type=`boolean`},sc=(e,t,n,r)=>{H(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},cc=(e,t,n,r)=>{H(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},lc=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},uc=(e,t,n,r)=>{H(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},dc=(e,t,n,r)=>{H(e,t,n,r,`Void cannot be represented in JSON Schema`)},fc=(e,t,n,r)=>{n.not={}},pc=(e,t,n,r)=>{},mc=(e,t,n,r)=>{},hc=(e,t,n,r)=>{H(e,t,n,r,`Date cannot be represented in JSON Schema`)},gc=(e,n,r,i)=>{let a=e._zod.def,o=t(a.entries);o.length===0?r.not={}:(o.every(e=>typeof e==`number`)&&(r.type=`number`),o.every(e=>typeof e==`string`)&&(r.type=`string`),r.enum=o)},_c=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(H(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(H(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},vc=(e,t,n,r)=>{H(e,t,n,r,`NaN cannot be represented in JSON Schema`)},yc=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},bc=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=q(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},xc=(e,t,n,r)=>{n.type=`boolean`},Sc=(e,t,n,r)=>{H(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Cc=(e,t,n,r)=>{H(e,t,n,r,`Function types cannot be represented in JSON Schema`)},wc=(e,t,n,r)=>{H(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Tc=(e,t,n,r)=>{H(e,t,n,r,`Map cannot be represented in JSON Schema`)},Ec=(e,t,n,r)=>{H(e,t,n,r,`Set cannot be represented in JSON Schema`)},Dc=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=q(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=U(a.element,t,{...r,path:[...r.path,`items`]})};function Oc(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Oc(t.out):t.type===`catch`?Oc(t.innerType):e._zod.optin}var kc=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&H(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)d(i.properties,e,U(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Oc(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=U(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ac=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>U(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},jc=(e,t,n,r)=>{let i=e._zod.def,a=U(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=U(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Mc=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>U(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?U(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?Oc(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=q(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Nc(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Nc(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Nc(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?xn:bn).source)),p}var Pc=new WeakMap;function Fc(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Pc.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Nc(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var Ic=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=q(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=U(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)d(i.patternProperties,rc(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=U(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Pc.get(t);n||(n=[],Pc.set(t,n),t.deferred.push(()=>Fc(t))),n.push(e)}i.additionalProperties=U(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Oc(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Lc=(e,t,n,r)=>{let i=e._zod.def,a=U(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Rc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},zc=Symbol();function Bc(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(H(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),zc):JSON.parse(o)}var Vc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Bc(i.defaultValue,e,t,n,r);o!==zc&&(n.default=o)},Hc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Bc(i.defaultValue,e,t,n,r);o!==zc&&(n._prefault=o)},Uc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{H(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Wc=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;U(o,t,r);let s=t.seen.get(e);s.ref=o},Gc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Kc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},qc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Jc=(e,t,n,r)=>{let i=e._zod.innerType;U(i,t,r);let a=t.seen.get(e);a.ref=i},Yc={string:ic,number:ac,boolean:oc,bigint:sc,symbol:cc,null:lc,undefined:uc,void:dc,never:fc,any:pc,unknown:mc,date:hc,enum:gc,literal:_c,nan:vc,template_literal:yc,file:bc,success:xc,custom:Sc,function:Cc,transform:wc,map:Tc,set:Ec,array:Dc,object:kc,union:Ac,intersection:jc,tuple:Mc,record:Ic,nullable:Lc,nonoptional:Rc,default:Vc,prefault:Hc,catch:Uc,pipe:Wc,readonly:Gc,promise:Kc,optional:qc,lazy:Jc};function Xc(e,t){if(`_idmap`in e){let n=e,r=Ps({...t,processors:Yc}),i={};for(let e of n._idmap.entries()){let[t,n]=e;U(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Is(r,n),d(a,t,Us(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Ps({...t,processors:Yc});return U(e,n),Is(n,e),Us(n,e)}var Zc=new WeakSet([Object.prototype,Error.prototype]);function Qc(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var $c=(e,t)=>{et.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Zc.has(n)||(Zc.add(n),Qc(n,`format`,e=>t=>it(e,t)),Qc(n,`flatten`,e=>t=>rt(e,t)),Qc(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,r,2)}),Qc(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,r,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},el=D(`ZodError`,$c),J=D(`ZodError`,$c,void 0,{Parent:Error}),tl=ct(J),nl=ut(J),rl=ft(J),il=mt(J),al=bt(J),ol=xt(J),sl=St(J),cl=Ct(J),ll=wt(J),ul=Tt(J),dl=Et(J),fl=Dt(J),pl=e({ZodAny:()=>Hu,ZodArray:()=>Zu,ZodBase64:()=>ru,ZodBase64URL:()=>au,ZodBigInt:()=>ju,ZodBigIntFormat:()=>Nu,ZodBoolean:()=>ku,ZodCIDRv4:()=>$l,ZodCIDRv6:()=>tu,ZodCUID:()=>Ll,ZodCUID2:()=>zl,ZodCatch:()=>Kd,ZodCodec:()=>Qd,ZodCreditCard:()=>lu,ZodCustom:()=>pf,ZodCustomStringFormat:()=>hu,ZodDate:()=>Yu,ZodDefault:()=>Rd,ZodDiscriminatedUnion:()=>cd,ZodE164:()=>su,ZodEmail:()=>Sl,ZodEmoji:()=>Nl,ZodEnum:()=>Sd,ZodExactOptional:()=>Nd,ZodFile:()=>Dd,ZodFunction:()=>df,ZodGUID:()=>wl,ZodIBAN:()=>du,ZodIPv4:()=>ql,ZodIPv6:()=>Zl,ZodISODate:()=>yl,ZodISODateTime:()=>vl,ZodISODuration:()=>xl,ZodISOTime:()=>bl,ZodInstanceOf:()=>bf,ZodIntersection:()=>ud,ZodJWT:()=>pu,ZodKSUID:()=>Gl,ZodLazy:()=>sf,ZodLiteral:()=>Td,ZodMAC:()=>Yl,ZodMap:()=>vd,ZodNaN:()=>Jd,ZodNanoID:()=>Fl,ZodNever:()=>Gu,ZodNonOptional:()=>Hd,ZodNull:()=>Bu,ZodNullable:()=>Fd,ZodNumber:()=>xu,ZodNumberFormat:()=>Cu,ZodObject:()=>ed,ZodOptional:()=>jd,ZodPipe:()=>Xd,ZodPrefault:()=>Bd,ZodPreprocess:()=>tf,ZodPromise:()=>lf,ZodReadonly:()=>nf,ZodRecord:()=>md,ZodSet:()=>bd,ZodString:()=>gl,ZodStringFormat:()=>Z,ZodSuccess:()=>Wd,ZodSymbol:()=>Iu,ZodTemplateLiteral:()=>af,ZodTransform:()=>kd,ZodTuple:()=>fd,ZodType:()=>X,ZodULID:()=>Vl,ZodURL:()=>Al,ZodUUID:()=>Q,ZodUndefined:()=>Ru,ZodUnion:()=>id,ZodUnknown:()=>Wu,ZodVoid:()=>qu,ZodXID:()=>Ul,ZodXor:()=>od,_ZodString:()=>hl,_default:()=>zd,_function:()=>ff,any:()=>Uu,array:()=>Qu,base64:()=>iu,base64url:()=>ou,bigint:()=>Mu,boolean:()=>Au,catch:()=>qd,check:()=>mf,cidrv4:()=>eu,cidrv6:()=>nu,codec:()=>$d,creditCard:()=>uu,cuid:()=>Rl,cuid2:()=>Bl,currencyCode:()=>yu,custom:()=>hf,date:()=>Xu,describe:()=>vf,discriminatedUnion:()=>ld,e164:()=>cu,email:()=>Cl,emoji:()=>Pl,enum:()=>Cd,exactOptional:()=>Pd,file:()=>Od,float32:()=>Tu,float64:()=>Eu,function:()=>ff,guid:()=>Tl,hash:()=>bu,hex:()=>vu,hostname:()=>_u,httpUrl:()=>Ml,iban:()=>fu,instanceof:()=>xf,int:()=>wu,int32:()=>Du,int64:()=>Pu,intersection:()=>dd,invertCodec:()=>ef,ipv4:()=>Jl,ipv6:()=>Ql,json:()=>Cf,jwt:()=>mu,keyof:()=>$u,ksuid:()=>Kl,lazy:()=>cf,literal:()=>Ed,looseObject:()=>rd,looseRecord:()=>_d,mac:()=>Xl,map:()=>yd,meta:()=>yf,nan:()=>Yd,nanoid:()=>Il,nativeEnum:()=>wd,never:()=>Ku,nonoptional:()=>Ud,null:()=>Vu,nullable:()=>Id,nullish:()=>Ld,number:()=>Su,object:()=>td,optional:()=>Md,partialRecord:()=>gd,pipe:()=>Zd,prefault:()=>Vd,preprocess:()=>wf,promise:()=>uf,readonly:()=>rf,record:()=>hd,refine:()=>gf,set:()=>xd,strictObject:()=>nd,string:()=>_l,stringFormat:()=>gu,stringbool:()=>Sf,success:()=>Gd,superRefine:()=>_f,symbol:()=>Lu,templateLiteral:()=>of,transform:()=>Ad,tuple:()=>pd,uint32:()=>Ou,uint64:()=>Fu,ulid:()=>Hl,undefined:()=>zu,union:()=>ad,unknown:()=>$,url:()=>jl,uuid:()=>El,uuidv4:()=>Dl,uuidv6:()=>Ol,uuidv7:()=>kl,void:()=>Ju,xid:()=>Wl,xor:()=>sd});function ml(){k.localeError||A(Qa())}function Y(){k.memoizer||A({memoizer:Ya()})}var X=D(`ZodType`,(e,t)=>(ml(),N.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(_(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return b(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(gf(e,t))},superRefine(e,t){return this.check(_f(e,t))},overwrite(e){return this.check(V(e))},optional(){return Md(this)},exactOptional(){return Pd(this)},nullable(){return Id(this)},nullish(){return Md(Id(this))},nonoptional(e){return Ud(this,e)},array(){return Qu(this)},or(e){return ad([this,e])},and(e){return dd(this,e)},transform(e){return Zd(this,Ad(e))},default(e){return zd(this,e)},prefault(e){return Vd(this,e)},catch(e){return qd(this,e)},pipe(e){return Zd(this,e)},readonly(){return rf(this)},describe(e){let t=this.clone();return F.add(t,{description:e}),t},meta(...e){if(e.length===0)return F.get(this);let t=this.clone();return F.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Me(this,`~standard`,{...xr(this),jsonSchema:{input:Gs(this,`input`),output:Gs(this,`output`)}})},set"~standard"(e){T(this,`~standard`,e)},parse:function e(t,n){return tl(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await nl(this,t,n,{callee:e})},safeParse(e,t){return rl(this,e,t)},async safeParseAsync(e,t){return il(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){T(this,`spa`,e)},validate(e,t){return _t(this,e,t)},validateAsync(e,t){return yt(this,e,t)},encode:function e(t,n){return al(this,t,n,{callee:e})},decode:function e(t,n){return ol(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await sl(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await cl(this,t,n,{callee:e})},safeEncode(e,t){return ll(this,e,t)},safeDecode(e,t){return ul(this,e,t)},async safeEncodeAsync(e,t){return dl(this,e,t)},async safeDecodeAsync(e,t){return fl(this,e,t)},toJSONSchema(e){return Ws(this,{})(e)},get description(){return F.get(this)?.description},get _def(){return this._zod.def}}),hl=D(`_ZodString`,(e,t)=>{Sr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ic(e,t,n,r)},Ne({format:e=>q(e).format??null,minLength:e=>q(e).minimum??null,maxLength:e=>q(e).maximum??null},{regex(...e){return this.check(ls(...e))},includes(...e){return this.check(fs(...e))},startsWith(...e){return this.check(ps(...e))},endsWith(...e){return this.check(ms(...e))},min(...e){return this.check(ss(...e))},max(...e){return this.check(os(...e))},length(...e){return this.check(cs(...e))},nonempty(...e){return this.check(ss(1,...e))},lowercase(e){return this.check(us(e))},uppercase(e){return this.check(ds(e))},trim(){return this.check(ys())},normalize(...e){return this.check(vs(...e))},toLowerCase(){return this.check(bs())},toUpperCase(){return this.check(xs())},slugify(){return this.check(Ss())}})),gl=D(`ZodString`,(e,t)=>{Sr.init(e,t),hl.init(e,t)},{email(e){return this.check(io(Sl,e))},url(e){return this.check(uo(Al,e))},jwt(e){return this.check(ko(pu,e))},emoji(e){return this.check(fo(Nl,e))},guid(e){return this.check(ao(wl,e))},uuid(e){return this.check(oo(Q,e))},uuidv4(e){return this.check(so(Q,e))},uuidv6(e){return this.check(co(Q,e))},uuidv7(e){return this.check(lo(Q,e))},nanoid(e){return this.check(po(Fl,e))},cuid(e){return this.check(mo(Ll,e))},cuid2(e){return this.check(ho(zl,e))},ulid(e){return this.check(go(Vl,e))},base64(e){return this.check(wo(ru,e))},base64url(e){return this.check(To(au,e))},xid(e){return this.check(_o(Ul,e))},ksuid(e){return this.check(vo(Gl,e))},ipv4(e){return this.check(yo(ql,e))},ipv6(e){return this.check(bo(Zl,e))},cidrv4(e){return this.check(So($l,e))},cidrv6(e){return this.check(Co(tu,e))},e164(e){return this.check(Eo(su,e))},datetime(e){return this.check(Ao(vl,e))},date(e){return this.check(jo(yl,e))},time(e){return this.check(Mo(bl,e))},duration(e){return this.check(No(xl,e))}});function _l(e){return ro(gl,e)}var Z=D(`ZodStringFormat`,(e,t)=>{P.init(e,t),hl.init(e,t)}),vl=D(`ZodISODateTime`,(e,t)=>{Vr.init(e,t),Z.init(e,t)}),yl=D(`ZodISODate`,(e,t)=>{Hr.init(e,t),Z.init(e,t)}),bl=D(`ZodISOTime`,(e,t)=>{Ur.init(e,t),Z.init(e,t)}),xl=D(`ZodISODuration`,(e,t)=>{Wr.init(e,t),Z.init(e,t)}),Sl=D(`ZodEmail`,(e,t)=>{Tr.init(e,t),Z.init(e,t)});function Cl(e){return io(Sl,e)}var wl=D(`ZodGUID`,(e,t)=>{Cr.init(e,t),Z.init(e,t)});function Tl(e){return ao(wl,e)}var Q=D(`ZodUUID`,(e,t)=>{wr.init(e,t),Z.init(e,t)});function El(e){return oo(Q,e)}function Dl(e){return so(Q,e)}function Ol(e){return co(Q,e)}function kl(e){return lo(Q,e)}var Al=D(`ZodURL`,(e,t)=>{Nr.init(e,t),Z.init(e,t)});function jl(e){return uo(Al,e)}function Ml(e){return uo(Al,{protocol:on,hostname:an,...x(e)})}var Nl=D(`ZodEmoji`,(e,t)=>{Pr.init(e,t),Z.init(e,t)});function Pl(e){return fo(Nl,e)}var Fl=D(`ZodNanoID`,(e,t)=>{Fr.init(e,t),Z.init(e,t)});function Il(e){return po(Fl,e)}var Ll=D(`ZodCUID`,(e,t)=>{Ir.init(e,t),Z.init(e,t)});function Rl(e){return mo(Ll,e)}var zl=D(`ZodCUID2`,(e,t)=>{Lr.init(e,t),Z.init(e,t)});function Bl(e){return ho(zl,e)}var Vl=D(`ZodULID`,(e,t)=>{Rr.init(e,t),Z.init(e,t)});function Hl(e){return go(Vl,e)}var Ul=D(`ZodXID`,(e,t)=>{zr.init(e,t),Z.init(e,t)});function Wl(e){return _o(Ul,e)}var Gl=D(`ZodKSUID`,(e,t)=>{Br.init(e,t),Z.init(e,t)});function Kl(e){return vo(Gl,e)}var ql=D(`ZodIPv4`,(e,t)=>{Gr.init(e,t),Z.init(e,t)});function Jl(e){return yo(ql,e)}var Yl=D(`ZodMAC`,(e,t)=>{Yr.init(e,t),Z.init(e,t)});function Xl(e){return xo(Yl,e)}var Zl=D(`ZodIPv6`,(e,t)=>{Jr.init(e,t),Z.init(e,t)});function Ql(e){return bo(Zl,e)}var $l=D(`ZodCIDRv4`,(e,t)=>{Xr.init(e,t),Z.init(e,t)});function eu(e){return So($l,e)}var tu=D(`ZodCIDRv6`,(e,t)=>{Qr.init(e,t),Z.init(e,t)});function nu(e){return Co(tu,e)}var ru=D(`ZodBase64`,(e,t)=>{ti.init(e,t),Z.init(e,t)});function iu(e){return wo(ru,e)}var au=D(`ZodBase64URL`,(e,t)=>{ii.init(e,t),Z.init(e,t)});function ou(e){return To(au,e)}var su=D(`ZodE164`,(e,t)=>{ai.init(e,t),Z.init(e,t)});function cu(e){return Eo(su,e)}var lu=D(`ZodCreditCard`,(e,t)=>{li.init(e,t),Z.init(e,t)});function uu(e){return Do(lu,e)}var du=D(`ZodIBAN`,(e,t)=>{fi.init(e,t),Z.init(e,t)});function fu(e){return Oo(du,e)}var pu=D(`ZodJWT`,(e,t)=>{mi.init(e,t),Z.init(e,t)});function mu(e){return ko(pu,e)}var hu=D(`ZodCustomStringFormat`,(e,t)=>{hi.init(e,t),Z.init(e,t)});function gu(e,t,n={}){return Ms(hu,e,t,n)}function _u(e){return Ms(hu,`hostname`,rn,e)}function vu(e){return Ms(hu,`hex`,Dn,e)}function yu(e){return Ms(hu,`currency_code`,ln,e)}function bu(e,t){let n=`${e}_${t?.enc??`hex`}`,r=Ot[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return Ms(hu,n,r,t)}var xu=D(`ZodNumber`,(e,t)=>{gi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ac(e,t,n,r),e.isFinite=!0},Ne({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=q(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=q(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=q(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>q(e).format??null},{gt(e,t){return this.check(R(e,t))},gte(e,t){return this.check(z(e,t))},min(e,t){return this.check(z(e,t))},lt(e,t){return this.check(I(e,t))},lte(e,t){return this.check(L(e,t))},max(e,t){return this.check(L(e,t))},int(e){return this.check(wu(e))},safe(e){return this.check(wu(e))},positive(e){return this.check(R(0,e))},nonnegative(e){return this.check(z(0,e))},negative(e){return this.check(I(0,e))},nonpositive(e){return this.check(L(0,e))},multipleOf(e,t){return this.check(rs(e,t))},step(e,t){return this.check(rs(e,t))},finite(){return this}}));function Su(e){return Po(xu,e)}var Cu=D(`ZodNumberFormat`,(e,t)=>{_i.init(e,t),xu.init(e,t)});function wu(e){return Fo(Cu,e)}function Tu(e){return Io(Cu,e)}function Eu(e){return Lo(Cu,e)}function Du(e){return Ro(Cu,e)}function Ou(e){return zo(Cu,e)}var ku=D(`ZodBoolean`,(e,t)=>{vi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oc(e,t,n,r)});function Au(e){return Bo(ku,e)}var ju=D(`ZodBigInt`,(e,t)=>{yi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sc(e,t,n,r)},Ne({minValue:e=>q(e).minimum??null,maxValue:e=>q(e).maximum??null,format:e=>q(e).format??null},{gte(e,t){return this.check(z(e,t))},min(e,t){return this.check(z(e,t))},gt(e,t){return this.check(R(e,t))},lt(e,t){return this.check(I(e,t))},lte(e,t){return this.check(L(e,t))},max(e,t){return this.check(L(e,t))},positive(e){return this.check(R(BigInt(0),e))},negative(e){return this.check(I(BigInt(0),e))},nonpositive(e){return this.check(L(BigInt(0),e))},nonnegative(e){return this.check(z(BigInt(0),e))},multipleOf(e,t){return this.check(rs(e,t))}}));function Mu(e){return Vo(ju,e)}var Nu=D(`ZodBigIntFormat`,(e,t)=>{bi.init(e,t),ju.init(e,t)});function Pu(e){return Ho(Nu,e)}function Fu(e){return Uo(Nu,e)}var Iu=D(`ZodSymbol`,(e,t)=>{xi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cc(e,t,n,r)});function Lu(e){return Wo(Iu,e)}var Ru=D(`ZodUndefined`,(e,t)=>{Si.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uc(e,t,n,r)});function zu(e){return Go(Ru,e)}var Bu=D(`ZodNull`,(e,t)=>{Ci.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lc(e,t,n,r)});function Vu(e){return Ko(Bu,e)}var Hu=D(`ZodAny`,(e,t)=>{wi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Uu(){return qo(Hu)}var Wu=D(`ZodUnknown`,(e,t)=>{Ti.init(e,t),X.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function $(){return Jo(Wu)}var Gu=D(`ZodNever`,(e,t)=>{Ei.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fc(e,t,n,r)});function Ku(e){return Yo(Gu,e)}var qu=D(`ZodVoid`,(e,t)=>{Di.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dc(e,t,n,r)});function Ju(e){return Xo(qu,e)}var Yu=D(`ZodDate`,(e,t)=>{Oi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hc(e,t,n,r),e.min=(t,n)=>e.check(z(t,n)),e.max=(t,n)=>e.check(L(t,n))},Ne({minDate:e=>{let{minimum:t}=q(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=q(e);return t?new Date(t):null}},{}));function Xu(e){return Zo(Yu,e)}var Zu=D(`ZodArray`,(e,t)=>{Y(),Ai.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dc(e,t,n,r),e.element=t.element},{min(e,t){return this.check(ss(e,t))},nonempty(e){return this.check(ss(1,e))},max(e,t){return this.check(os(e,t))},length(e,t){return this.check(cs(e,t))},unwrap(){return this.element}});function Qu(e,t){return Cs(Zu,e,t)}function $u(e){let t=e._zod.def.shape;return Cd(Object.keys(t))}var ed=D(`ZodObject`,(e,t)=>{Y(),Ii.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kc(e,t,n,r),ze(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Cd(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(_(this._zod.def,{catchall:e}))},passthrough(){return this.clone(_(this._zod.def,{catchall:$()}))},loose(){return this.clone(_(this._zod.def,{catchall:$()}))},strict(){return this.clone(_(this._zod.def,{catchall:Ku()}))},strip(){return this.clone(_(this._zod.def,{catchall:void 0}))},extend(e){return ge(this,e)},safeExtend(e){return ve(this,e)},merge(e){return ye(this,e)},pick(e){return pe(this,e)},omit(e){return he(this,e)},partial(...e){return be(jd,this,e[0])},exactPartial(...e){return be(Nd,this,e[0],`exactPartial`)},required(...e){return xe(Hd,this,e[0])}});function td(e,t){return new ed({type:`object`,shape:e??{},...x(t)})}function nd(e,t){return new ed({type:`object`,shape:e,catchall:Ku(),...x(t)})}function rd(e,t){return new ed({type:`object`,shape:e,catchall:$(),...x(t)})}var id=D(`ZodUnion`,(e,t)=>{Ri.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ac(e,t,n,r),e.options=t.options});function ad(e,t){return new id({type:`union`,options:e,...x(t)})}var od=D(`ZodXor`,(e,t)=>{id.init(e,t),Bi.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ac(e,t,n,r),e.options=t.options});function sd(e,t){return new od({type:`union`,options:e,inclusive:!1,...x(t)})}var cd=D(`ZodDiscriminatedUnion`,(e,t)=>{id.init(e,t),Hi.init(e,t)});function ld(e,t,n){return new cd({type:`union`,options:t,discriminator:e,...x(n)})}var ud=D(`ZodIntersection`,(e,t)=>{Ui.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jc(e,t,n,r)});function dd(e,t){return new ud({type:`intersection`,left:e,right:t})}var fd=D(`ZodTuple`,(e,t)=>{Y(),Ki.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mc(e,t,n,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw Error(`.partial() cannot be used on tuple schemas containing refinements`);return this.clone({...e,items:e.items.map(e=>new jd({type:`optional`,innerType:e}))})}});function pd(e,t,n){let r=t instanceof N;return new fd({type:`tuple`,items:e,rest:r?t:null,...x(r?n:t)})}var md=D(`ZodRecord`,(e,t)=>{Y(),Xi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ic(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function hd(e,t,n){return!t||!t._zod?new md({type:`record`,keyType:_l(),valueType:e,...x(t)}):new md({type:`record`,keyType:e,valueType:t,...x(n)})}function gd(e,t,n){return new md({type:`record`,keyType:e,valueType:t,...x(n),partial:!0})}function _d(e,t,n){return new md({type:`record`,keyType:e,valueType:t,mode:`loose`,...x(n)})}var vd=D(`ZodMap`,(e,t)=>{Y(),Zi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tc(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(B(...t)),e.nonempty=t=>e.check(B(1,t)),e.max=(...t)=>e.check(is(...t)),e.size=(...t)=>e.check(as(...t))});function yd(e,t,n){return new vd({type:`map`,keyType:e,valueType:t,...x(n)})}var bd=D(`ZodSet`,(e,t)=>{Y(),$i.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ec(e,t,n,r),e.min=(...t)=>e.check(B(...t)),e.nonempty=t=>e.check(B(1,t)),e.max=(...t)=>e.check(is(...t)),e.size=(...t)=>e.check(as(...t))});function xd(e,t){return new bd({type:`set`,valueType:e,...x(t)})}var Sd=D(`ZodEnum`,(e,t)=>{ta.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gc(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Sd({...t,checks:[],...x(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Sd({...t,checks:[],...x(r),entries:i})}});function Cd(e,t){return new Sd({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...x(t)})}function wd(e,t){return new Sd({type:`enum`,entries:e,...x(t)})}var Td=D(`ZodLiteral`,(e,t)=>{na.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_c(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ed(e,t){return new Td({type:`literal`,values:Array.isArray(e)?e:[e],...x(t)})}var Dd=D(`ZodFile`,(e,t)=>{ra.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bc(e,t,n,r),e.min=(t,n)=>e.check(B(t,n)),e.max=(t,n)=>e.check(is(t,n)),e.mime=(t,n)=>e.check(_s(Array.isArray(t)?t:[t],n))});function Od(e){return ws(Dd,e)}var kd=D(`ZodTransform`,(e,t)=>{Y(),ia.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wc(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new qe(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ae(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ae(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ad(e){return new kd({type:`transform`,transform:e})}var jd=D(`ZodOptional`,(e,t)=>{oa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Md(e){return new jd({type:`optional`,innerType:e})}var Nd=D(`ZodExactOptional`,(e,t)=>{sa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pd(e){return new Nd({type:`optional`,innerType:e})}var Fd=D(`ZodNullable`,(e,t)=>{ca.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Id(e){return new Fd({type:`nullable`,innerType:e})}function Ld(e){return Md(Id(e))}var Rd=D(`ZodDefault`,(e,t)=>{la.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zd(e,t){return new Rd({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():oe(t)}})}var Bd=D(`ZodPrefault`,(e,t)=>{da.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Vd(e,t){return new Bd({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():oe(t)}})}var Hd=D(`ZodNonOptional`,(e,t)=>{fa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ud(e,t){return new Hd({type:`nonoptional`,innerType:e,...x(t)})}var Wd=D(`ZodSuccess`,(e,t)=>{ma.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Gd(e){return new Wd({type:`success`,innerType:e})}var Kd=D(`ZodCatch`,(e,t)=>{ga.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function qd(e,t){return new Kd({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Ve(t)})}var Jd=D(`ZodNaN`,(e,t)=>{_a.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vc(e,t,n,r)});function Yd(e){return Qo(Jd,e)}var Xd=D(`ZodPipe`,(e,t)=>{va.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wc(e,t,n,r),e.in=t.in,e.out=t.out});function Zd(e,t){return new Xd({type:`pipe`,in:e,out:t})}var Qd=D(`ZodCodec`,(e,t)=>{Xd.init(e,t),ba.init(e,t)});function $d(e,t,n){return new Qd({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function ef(e){let t=e._zod.def;return new Qd({type:`pipe`,in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var tf=D(`ZodPreprocess`,(e,t)=>{Xd.init(e,t),Ca.init(e,t)}),nf=D(`ZodReadonly`,(e,t)=>{wa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rf(e){return new nf({type:`readonly`,innerType:e})}var af=D(`ZodTemplateLiteral`,(e,t)=>{Oa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yc(e,t,n,r)});function of(e,t){return new af({type:`template_literal`,parts:e,...x(t)})}var sf=D(`ZodLazy`,(e,t)=>{ja.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jc(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function cf(e){return new sf({type:`lazy`,getter:e})}var lf=D(`ZodPromise`,(e,t)=>{Aa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uf(e){return new lf({type:`promise`,innerType:e})}var df=D(`ZodFunction`,(e,t)=>{ka.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cc(e,t,n,r)});function ff(e){return new df({type:`function`,input:Array.isArray(e?.input)?pd(e?.input):e?.input??Qu($()),output:e?.output??$()})}var pf=D(`ZodCustom`,(e,t)=>{Ma.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sc(e,t,n,r)});function mf(e){let t=new M({check:`custom`});return t._zod.check=e,t}function hf(e,t){return Ts(pf,e??(()=>!0),t)}function gf(e,t={}){return Es(pf,e,t)}function _f(e,t){return Ds(e,t)}var vf=ks,yf=As,bf=D(`ZodInstanceOf`,(e,t)=>{pf.init(e,t)},{properties(e,t){return this.check(gs(e,t))}});function xf(e,t={}){let n=new bf({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...x(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}var Sf=(...e)=>js({Codec:Qd,Boolean:ku,String:gl},...e);function Cf(e){let t=cf(()=>ad([_l(e),Su(),Au(),Vu(),Qu(t),hd(_l(),t)]));return t}function wf(e,t){return new tf({type:`pipe`,in:Ad(e),out:t})}export{gs as $,R as A,L as B,nd as C,el as D,$ as E,No as F,B as G,is as H,Mo as I,ns as J,rs as K,cs as L,fs as M,jo as N,Xc as O,Ao as P,$o as Q,us as R,pl as S,ad as T,_s as U,os as V,ss as W,vs as X,ts as Y,V as Z,rd as _,ed as a,bs as at,gd as b,zu as c,ds as ct,Au as d,Ue as dt,hs as et,hf as f,d as ft,Ed as g,cf as h,bl as i,ps as it,z as j,ms as k,Qu as l,F as lt,Cf as m,vl as n,as as nt,Cd as o,xs as ot,ld as p,v as pt,es as q,xl as r,Ss as rt,Vu as s,ys as st,yl as t,ls as tt,iu as u,ot as ut,Su as v,_l as w,hd as x,td as y,I as z};
56
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ls(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ls(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Rs=new Set([`type`,`properties`,`required`,`additionalProperties`]),zs=[`oneOf`,`anyOf`];function Bs(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Vs(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Rs.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Bs(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}d(n,r,e.length===1?e[0]:Vs(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Bs(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Hs(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Rs)if(t in e)return;let n=t.filter(e=>zs.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Vs(t);else{let e=n[0],i=zs.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Vs([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ns(e,r))}function Us(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Ns(i,s),Ns(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ls(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Hs(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Ns(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,d(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Gs(t,`input`,e.processors),output:Gs(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function W(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return W(r.element,n);if(r.type===`set`)return W(r.valueType,n);if(r.type===`lazy`)return W(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return W(r.innerType,n);if(r.type===`intersection`)return W(r.left,n)||W(r.right,n);if(r.type===`record`||r.type===`map`)return W(r.keyType,n)||W(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:W(r.in,n)||W(r.out,n);if(r.type===`object`){for(let e in r.shape)if(W(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(W(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(W(e,n))return!0;return!!(r.rest&&W(r.rest,n))}return!1}var Ws=(e,t={})=>n=>{let r=Ps({...n,processors:t});return U(e,r),Is(r,e),Us(r,e)},Gs=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ps({...i??{},target:a,io:t,processors:n});return U(e,o),Is(o,e),Us(o,e)},G=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},K=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ks=(e,t)=>{G(e,`minimum`,t),K(e,`maximum`,t)},qs=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Js=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Ys=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Xs=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Zs=(e,t)=>G(e,`minimum`,t.minimum),Qs=(e,t)=>K(e,`maximum`,t.maximum),$s=e=>(t,n)=>{Xs(t,n.format);let[r,i]=e[n.format];G(t,`minimum`,r),K(t,`maximum`,i)},ec={greater_than:(e,t)=>G(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>K(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>qs(e,t.value),number_format:$s(de),bigint_format:$s(fe),min_length:Zs,max_length:Qs,length_equals:(e,t)=>Ks(e,t.length),min_size:Zs,max_size:Qs,size_equals:(e,t)=>Ks(e,t.size),string_format:(e,t)=>{Xs(e,t.format),t.pattern&&Js(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Ys(e,t.mime)};function q(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)ec[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&G(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&G(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&K(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&K(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&qs(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Ys(t,i.mime);for(let e of i.patterns??[])Js(t,e);return t}var tc={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},nc=new Map([[ei,tn],[ni,nn]]),rc=e=>nc.get(e)??e,ic=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=q(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=tc[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(rc);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ac=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=q(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):H(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},oc=(e,t,n,r)=>{n.type=`boolean`},sc=(e,t,n,r)=>{H(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},cc=(e,t,n,r)=>{H(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},lc=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},uc=(e,t,n,r)=>{H(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},dc=(e,t,n,r)=>{H(e,t,n,r,`Void cannot be represented in JSON Schema`)},fc=(e,t,n,r)=>{n.not={}},pc=(e,t,n,r)=>{},mc=(e,t,n,r)=>{},hc=(e,t,n,r)=>{H(e,t,n,r,`Date cannot be represented in JSON Schema`)},gc=(e,n,r,i)=>{let a=e._zod.def,o=t(a.entries);o.length===0?r.not={}:(o.every(e=>typeof e==`number`)&&(r.type=`number`),o.every(e=>typeof e==`string`)&&(r.type=`string`),r.enum=o)},_c=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(H(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(H(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},vc=(e,t,n,r)=>{H(e,t,n,r,`NaN cannot be represented in JSON Schema`)},yc=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},bc=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=q(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},xc=(e,t,n,r)=>{n.type=`boolean`},Sc=(e,t,n,r)=>{H(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Cc=(e,t,n,r)=>{H(e,t,n,r,`Function types cannot be represented in JSON Schema`)},wc=(e,t,n,r)=>{H(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Tc=(e,t,n,r)=>{H(e,t,n,r,`Map cannot be represented in JSON Schema`)},Ec=(e,t,n,r)=>{H(e,t,n,r,`Set cannot be represented in JSON Schema`)},Dc=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=q(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=U(a.element,t,{...r,path:[...r.path,`items`]})};function Oc(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Oc(t.out):t.type===`catch`?Oc(t.innerType):e._zod.optin}var kc=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&H(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)d(i.properties,e,U(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Oc(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=U(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ac=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>U(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},jc=(e,t,n,r)=>{let i=e._zod.def,a=U(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=U(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Mc=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>U(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?U(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?Oc(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=q(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Nc(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Nc(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Nc(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?xn:bn).source)),p}var Pc=new WeakMap;function Fc(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Pc.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Nc(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var Ic=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=q(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=U(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)d(i.patternProperties,rc(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=U(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Pc.get(t);n||(n=[],Pc.set(t,n),t.deferred.push(()=>Fc(t))),n.push(e)}i.additionalProperties=U(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Oc(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Lc=(e,t,n,r)=>{let i=e._zod.def,a=U(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Rc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},zc=Symbol();function Bc(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(H(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),zc):JSON.parse(o)}var Vc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Bc(i.defaultValue,e,t,n,r);o!==zc&&(n.default=o)},Hc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Bc(i.defaultValue,e,t,n,r);o!==zc&&(n._prefault=o)},Uc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{H(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Wc=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;U(o,t,r);let s=t.seen.get(e);s.ref=o},Gc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Kc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},qc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Jc=(e,t,n,r)=>{let i=e._zod.innerType;U(i,t,r);let a=t.seen.get(e);a.ref=i},Yc={string:ic,number:ac,boolean:oc,bigint:sc,symbol:cc,null:lc,undefined:uc,void:dc,never:fc,any:pc,unknown:mc,date:hc,enum:gc,literal:_c,nan:vc,template_literal:yc,file:bc,success:xc,custom:Sc,function:Cc,transform:wc,map:Tc,set:Ec,array:Dc,object:kc,union:Ac,intersection:jc,tuple:Mc,record:Ic,nullable:Lc,nonoptional:Rc,default:Vc,prefault:Hc,catch:Uc,pipe:Wc,readonly:Gc,promise:Kc,optional:qc,lazy:Jc};function Xc(e,t){if(`_idmap`in e){let n=e,r=Ps({...t,processors:Yc}),i={};for(let e of n._idmap.entries()){let[t,n]=e;U(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Is(r,n),d(a,t,Us(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Ps({...t,processors:Yc});return U(e,n),Is(n,e),Us(n,e)}var Zc=new WeakSet([Object.prototype,Error.prototype]);function Qc(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var $c=(e,t)=>{et.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Zc.has(n)||(Zc.add(n),Qc(n,`format`,e=>t=>it(e,t)),Qc(n,`flatten`,e=>t=>rt(e,t)),Qc(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,r,2)}),Qc(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,r,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},el=D(`ZodError`,$c),J=D(`ZodError`,$c,void 0,{Parent:Error}),tl=ct(J),nl=ut(J),rl=ft(J),il=mt(J),al=bt(J),ol=xt(J),sl=St(J),cl=Ct(J),ll=wt(J),ul=Tt(J),dl=Et(J),fl=Dt(J),pl=e({ZodAny:()=>Hu,ZodArray:()=>Zu,ZodBase64:()=>ru,ZodBase64URL:()=>au,ZodBigInt:()=>ju,ZodBigIntFormat:()=>Nu,ZodBoolean:()=>ku,ZodCIDRv4:()=>$l,ZodCIDRv6:()=>tu,ZodCUID:()=>Ll,ZodCUID2:()=>zl,ZodCatch:()=>Kd,ZodCodec:()=>Qd,ZodCreditCard:()=>lu,ZodCustom:()=>pf,ZodCustomStringFormat:()=>hu,ZodDate:()=>Yu,ZodDefault:()=>Rd,ZodDiscriminatedUnion:()=>cd,ZodE164:()=>su,ZodEmail:()=>Sl,ZodEmoji:()=>Nl,ZodEnum:()=>Sd,ZodExactOptional:()=>Nd,ZodFile:()=>Dd,ZodFunction:()=>df,ZodGUID:()=>wl,ZodIBAN:()=>du,ZodIPv4:()=>ql,ZodIPv6:()=>Zl,ZodISODate:()=>yl,ZodISODateTime:()=>vl,ZodISODuration:()=>xl,ZodISOTime:()=>bl,ZodInstanceOf:()=>bf,ZodIntersection:()=>ud,ZodJWT:()=>pu,ZodKSUID:()=>Gl,ZodLazy:()=>sf,ZodLiteral:()=>Td,ZodMAC:()=>Yl,ZodMap:()=>vd,ZodNaN:()=>Jd,ZodNanoID:()=>Fl,ZodNever:()=>Gu,ZodNonOptional:()=>Hd,ZodNull:()=>Bu,ZodNullable:()=>Fd,ZodNumber:()=>xu,ZodNumberFormat:()=>Cu,ZodObject:()=>ed,ZodOptional:()=>jd,ZodPipe:()=>Xd,ZodPrefault:()=>Bd,ZodPreprocess:()=>tf,ZodPromise:()=>lf,ZodReadonly:()=>nf,ZodRecord:()=>md,ZodSet:()=>bd,ZodString:()=>gl,ZodStringFormat:()=>Z,ZodSuccess:()=>Wd,ZodSymbol:()=>Iu,ZodTemplateLiteral:()=>af,ZodTransform:()=>kd,ZodTuple:()=>fd,ZodType:()=>X,ZodULID:()=>Vl,ZodURL:()=>Al,ZodUUID:()=>Q,ZodUndefined:()=>Ru,ZodUnion:()=>id,ZodUnknown:()=>Wu,ZodVoid:()=>qu,ZodXID:()=>Ul,ZodXor:()=>od,_ZodString:()=>hl,_default:()=>zd,_function:()=>ff,any:()=>Uu,array:()=>Qu,base64:()=>iu,base64url:()=>ou,bigint:()=>Mu,boolean:()=>Au,catch:()=>qd,check:()=>mf,cidrv4:()=>eu,cidrv6:()=>nu,codec:()=>$d,creditCard:()=>uu,cuid:()=>Rl,cuid2:()=>Bl,currencyCode:()=>yu,custom:()=>hf,date:()=>Xu,describe:()=>vf,discriminatedUnion:()=>ld,e164:()=>cu,email:()=>Cl,emoji:()=>Pl,enum:()=>Cd,exactOptional:()=>Pd,file:()=>Od,float32:()=>Tu,float64:()=>Eu,function:()=>ff,guid:()=>Tl,hash:()=>bu,hex:()=>vu,hostname:()=>_u,httpUrl:()=>Ml,iban:()=>fu,instanceof:()=>xf,int:()=>wu,int32:()=>Du,int64:()=>Pu,intersection:()=>dd,invertCodec:()=>ef,ipv4:()=>Jl,ipv6:()=>Ql,json:()=>Cf,jwt:()=>mu,keyof:()=>$u,ksuid:()=>Kl,lazy:()=>cf,literal:()=>Ed,looseObject:()=>rd,looseRecord:()=>_d,mac:()=>Xl,map:()=>yd,meta:()=>yf,nan:()=>Yd,nanoid:()=>Il,nativeEnum:()=>wd,never:()=>Ku,nonoptional:()=>Ud,null:()=>Vu,nullable:()=>Id,nullish:()=>Ld,number:()=>Su,object:()=>td,optional:()=>Md,partialRecord:()=>gd,pipe:()=>Zd,prefault:()=>Vd,preprocess:()=>wf,promise:()=>uf,readonly:()=>rf,record:()=>hd,refine:()=>gf,set:()=>xd,strictObject:()=>nd,string:()=>_l,stringFormat:()=>gu,stringbool:()=>Sf,success:()=>Gd,superRefine:()=>_f,symbol:()=>Lu,templateLiteral:()=>of,transform:()=>Ad,tuple:()=>pd,uint32:()=>Ou,uint64:()=>Fu,ulid:()=>Hl,undefined:()=>zu,union:()=>ad,unknown:()=>$,url:()=>jl,uuid:()=>El,uuidv4:()=>Dl,uuidv6:()=>Ol,uuidv7:()=>kl,void:()=>Ju,xid:()=>Wl,xor:()=>sd});function ml(){k.localeError||A(Qa())}function Y(){k.memoizer||A({memoizer:Ya()})}var X=D(`ZodType`,(e,t)=>(ml(),N.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(_(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return b(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(gf(e,t))},superRefine(e,t){return this.check(_f(e,t))},overwrite(e){return this.check(V(e))},optional(){return Md(this)},exactOptional(){return Pd(this)},nullable(){return Id(this)},nullish(){return Md(Id(this))},nonoptional(e){return Ud(this,e)},array(){return Qu(this)},or(e){return ad([this,e])},and(e){return dd(this,e)},transform(e){return Zd(this,Ad(e))},default(e){return zd(this,e)},prefault(e){return Vd(this,e)},catch(e){return qd(this,e)},pipe(e){return Zd(this,e)},readonly(){return rf(this)},describe(e){let t=this.clone();return F.add(t,{description:e}),t},meta(...e){if(e.length===0)return F.get(this);let t=this.clone();return F.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Me(this,`~standard`,{...xr(this),jsonSchema:{input:Gs(this,`input`),output:Gs(this,`output`)}})},set"~standard"(e){T(this,`~standard`,e)},parse:function e(t,n){return tl(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await nl(this,t,n,{callee:e})},safeParse(e,t){return rl(this,e,t)},async safeParseAsync(e,t){return il(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){T(this,`spa`,e)},validate(e,t){return _t(this,e,t)},validateAsync(e,t){return yt(this,e,t)},encode:function e(t,n){return al(this,t,n,{callee:e})},decode:function e(t,n){return ol(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await sl(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await cl(this,t,n,{callee:e})},safeEncode(e,t){return ll(this,e,t)},safeDecode(e,t){return ul(this,e,t)},async safeEncodeAsync(e,t){return dl(this,e,t)},async safeDecodeAsync(e,t){return fl(this,e,t)},toJSONSchema(e){return Ws(this,{})(e)},get description(){return F.get(this)?.description},get _def(){return this._zod.def}}),hl=D(`_ZodString`,(e,t)=>{Sr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ic(e,t,n,r)},Ne({format:e=>q(e).format??null,minLength:e=>q(e).minimum??null,maxLength:e=>q(e).maximum??null},{regex(...e){return this.check(ls(...e))},includes(...e){return this.check(fs(...e))},startsWith(...e){return this.check(ps(...e))},endsWith(...e){return this.check(ms(...e))},min(...e){return this.check(ss(...e))},max(...e){return this.check(os(...e))},length(...e){return this.check(cs(...e))},nonempty(...e){return this.check(ss(1,...e))},lowercase(e){return this.check(us(e))},uppercase(e){return this.check(ds(e))},trim(){return this.check(ys())},normalize(...e){return this.check(vs(...e))},toLowerCase(){return this.check(bs())},toUpperCase(){return this.check(xs())},slugify(){return this.check(Ss())}})),gl=D(`ZodString`,(e,t)=>{Sr.init(e,t),hl.init(e,t)},{email(e){return this.check(io(Sl,e))},url(e){return this.check(uo(Al,e))},jwt(e){return this.check(ko(pu,e))},emoji(e){return this.check(fo(Nl,e))},guid(e){return this.check(ao(wl,e))},uuid(e){return this.check(oo(Q,e))},uuidv4(e){return this.check(so(Q,e))},uuidv6(e){return this.check(co(Q,e))},uuidv7(e){return this.check(lo(Q,e))},nanoid(e){return this.check(po(Fl,e))},cuid(e){return this.check(mo(Ll,e))},cuid2(e){return this.check(ho(zl,e))},ulid(e){return this.check(go(Vl,e))},base64(e){return this.check(wo(ru,e))},base64url(e){return this.check(To(au,e))},xid(e){return this.check(_o(Ul,e))},ksuid(e){return this.check(vo(Gl,e))},ipv4(e){return this.check(yo(ql,e))},ipv6(e){return this.check(bo(Zl,e))},cidrv4(e){return this.check(So($l,e))},cidrv6(e){return this.check(Co(tu,e))},e164(e){return this.check(Eo(su,e))},datetime(e){return this.check(Ao(vl,e))},date(e){return this.check(jo(yl,e))},time(e){return this.check(Mo(bl,e))},duration(e){return this.check(No(xl,e))}});function _l(e){return ro(gl,e)}var Z=D(`ZodStringFormat`,(e,t)=>{P.init(e,t),hl.init(e,t)}),vl=D(`ZodISODateTime`,(e,t)=>{Vr.init(e,t),Z.init(e,t)}),yl=D(`ZodISODate`,(e,t)=>{Hr.init(e,t),Z.init(e,t)}),bl=D(`ZodISOTime`,(e,t)=>{Ur.init(e,t),Z.init(e,t)}),xl=D(`ZodISODuration`,(e,t)=>{Wr.init(e,t),Z.init(e,t)}),Sl=D(`ZodEmail`,(e,t)=>{Tr.init(e,t),Z.init(e,t)});function Cl(e){return io(Sl,e)}var wl=D(`ZodGUID`,(e,t)=>{Cr.init(e,t),Z.init(e,t)});function Tl(e){return ao(wl,e)}var Q=D(`ZodUUID`,(e,t)=>{wr.init(e,t),Z.init(e,t)});function El(e){return oo(Q,e)}function Dl(e){return so(Q,e)}function Ol(e){return co(Q,e)}function kl(e){return lo(Q,e)}var Al=D(`ZodURL`,(e,t)=>{Nr.init(e,t),Z.init(e,t)});function jl(e){return uo(Al,e)}function Ml(e){return uo(Al,{protocol:on,hostname:an,...x(e)})}var Nl=D(`ZodEmoji`,(e,t)=>{Pr.init(e,t),Z.init(e,t)});function Pl(e){return fo(Nl,e)}var Fl=D(`ZodNanoID`,(e,t)=>{Fr.init(e,t),Z.init(e,t)});function Il(e){return po(Fl,e)}var Ll=D(`ZodCUID`,(e,t)=>{Ir.init(e,t),Z.init(e,t)});function Rl(e){return mo(Ll,e)}var zl=D(`ZodCUID2`,(e,t)=>{Lr.init(e,t),Z.init(e,t)});function Bl(e){return ho(zl,e)}var Vl=D(`ZodULID`,(e,t)=>{Rr.init(e,t),Z.init(e,t)});function Hl(e){return go(Vl,e)}var Ul=D(`ZodXID`,(e,t)=>{zr.init(e,t),Z.init(e,t)});function Wl(e){return _o(Ul,e)}var Gl=D(`ZodKSUID`,(e,t)=>{Br.init(e,t),Z.init(e,t)});function Kl(e){return vo(Gl,e)}var ql=D(`ZodIPv4`,(e,t)=>{Gr.init(e,t),Z.init(e,t)});function Jl(e){return yo(ql,e)}var Yl=D(`ZodMAC`,(e,t)=>{Yr.init(e,t),Z.init(e,t)});function Xl(e){return xo(Yl,e)}var Zl=D(`ZodIPv6`,(e,t)=>{Jr.init(e,t),Z.init(e,t)});function Ql(e){return bo(Zl,e)}var $l=D(`ZodCIDRv4`,(e,t)=>{Xr.init(e,t),Z.init(e,t)});function eu(e){return So($l,e)}var tu=D(`ZodCIDRv6`,(e,t)=>{Qr.init(e,t),Z.init(e,t)});function nu(e){return Co(tu,e)}var ru=D(`ZodBase64`,(e,t)=>{ti.init(e,t),Z.init(e,t)});function iu(e){return wo(ru,e)}var au=D(`ZodBase64URL`,(e,t)=>{ii.init(e,t),Z.init(e,t)});function ou(e){return To(au,e)}var su=D(`ZodE164`,(e,t)=>{ai.init(e,t),Z.init(e,t)});function cu(e){return Eo(su,e)}var lu=D(`ZodCreditCard`,(e,t)=>{li.init(e,t),Z.init(e,t)});function uu(e){return Do(lu,e)}var du=D(`ZodIBAN`,(e,t)=>{fi.init(e,t),Z.init(e,t)});function fu(e){return Oo(du,e)}var pu=D(`ZodJWT`,(e,t)=>{mi.init(e,t),Z.init(e,t)});function mu(e){return ko(pu,e)}var hu=D(`ZodCustomStringFormat`,(e,t)=>{hi.init(e,t),Z.init(e,t)});function gu(e,t,n={}){return Ms(hu,e,t,n)}function _u(e){return Ms(hu,`hostname`,rn,e)}function vu(e){return Ms(hu,`hex`,Dn,e)}function yu(e){return Ms(hu,`currency_code`,ln,e)}function bu(e,t){let n=`${e}_${t?.enc??`hex`}`,r=Ot[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return Ms(hu,n,r,t)}var xu=D(`ZodNumber`,(e,t)=>{gi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ac(e,t,n,r),e.isFinite=!0},Ne({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=q(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=q(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=q(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>q(e).format??null},{gt(e,t){return this.check(R(e,t))},gte(e,t){return this.check(z(e,t))},min(e,t){return this.check(z(e,t))},lt(e,t){return this.check(I(e,t))},lte(e,t){return this.check(L(e,t))},max(e,t){return this.check(L(e,t))},int(e){return this.check(wu(e))},safe(e){return this.check(wu(e))},positive(e){return this.check(R(0,e))},nonnegative(e){return this.check(z(0,e))},negative(e){return this.check(I(0,e))},nonpositive(e){return this.check(L(0,e))},multipleOf(e,t){return this.check(rs(e,t))},step(e,t){return this.check(rs(e,t))},finite(){return this}}));function Su(e){return Po(xu,e)}var Cu=D(`ZodNumberFormat`,(e,t)=>{_i.init(e,t),xu.init(e,t)});function wu(e){return Fo(Cu,e)}function Tu(e){return Io(Cu,e)}function Eu(e){return Lo(Cu,e)}function Du(e){return Ro(Cu,e)}function Ou(e){return zo(Cu,e)}var ku=D(`ZodBoolean`,(e,t)=>{vi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oc(e,t,n,r)});function Au(e){return Bo(ku,e)}var ju=D(`ZodBigInt`,(e,t)=>{yi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sc(e,t,n,r)},Ne({minValue:e=>q(e).minimum??null,maxValue:e=>q(e).maximum??null,format:e=>q(e).format??null},{gte(e,t){return this.check(z(e,t))},min(e,t){return this.check(z(e,t))},gt(e,t){return this.check(R(e,t))},lt(e,t){return this.check(I(e,t))},lte(e,t){return this.check(L(e,t))},max(e,t){return this.check(L(e,t))},positive(e){return this.check(R(BigInt(0),e))},negative(e){return this.check(I(BigInt(0),e))},nonpositive(e){return this.check(L(BigInt(0),e))},nonnegative(e){return this.check(z(BigInt(0),e))},multipleOf(e,t){return this.check(rs(e,t))}}));function Mu(e){return Vo(ju,e)}var Nu=D(`ZodBigIntFormat`,(e,t)=>{bi.init(e,t),ju.init(e,t)});function Pu(e){return Ho(Nu,e)}function Fu(e){return Uo(Nu,e)}var Iu=D(`ZodSymbol`,(e,t)=>{xi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cc(e,t,n,r)});function Lu(e){return Wo(Iu,e)}var Ru=D(`ZodUndefined`,(e,t)=>{Si.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uc(e,t,n,r)});function zu(e){return Go(Ru,e)}var Bu=D(`ZodNull`,(e,t)=>{Ci.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lc(e,t,n,r)});function Vu(e){return Ko(Bu,e)}var Hu=D(`ZodAny`,(e,t)=>{wi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Uu(){return qo(Hu)}var Wu=D(`ZodUnknown`,(e,t)=>{Ti.init(e,t),X.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function $(){return Jo(Wu)}var Gu=D(`ZodNever`,(e,t)=>{Ei.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fc(e,t,n,r)});function Ku(e){return Yo(Gu,e)}var qu=D(`ZodVoid`,(e,t)=>{Di.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dc(e,t,n,r)});function Ju(e){return Xo(qu,e)}var Yu=D(`ZodDate`,(e,t)=>{Oi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hc(e,t,n,r),e.min=(t,n)=>e.check(z(t,n)),e.max=(t,n)=>e.check(L(t,n))},Ne({minDate:e=>{let{minimum:t}=q(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=q(e);return t?new Date(t):null}},{}));function Xu(e){return Zo(Yu,e)}var Zu=D(`ZodArray`,(e,t)=>{Y(),Ai.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dc(e,t,n,r),e.element=t.element},{min(e,t){return this.check(ss(e,t))},nonempty(e){return this.check(ss(1,e))},max(e,t){return this.check(os(e,t))},length(e,t){return this.check(cs(e,t))},unwrap(){return this.element}});function Qu(e,t){return Cs(Zu,e,t)}function $u(e){let t=e._zod.def.shape;return Cd(Object.keys(t))}var ed=D(`ZodObject`,(e,t)=>{Y(),Ii.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kc(e,t,n,r),ze(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Cd(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(_(this._zod.def,{catchall:e}))},passthrough(){return this.clone(_(this._zod.def,{catchall:$()}))},loose(){return this.clone(_(this._zod.def,{catchall:$()}))},strict(){return this.clone(_(this._zod.def,{catchall:Ku()}))},strip(){return this.clone(_(this._zod.def,{catchall:void 0}))},extend(e){return ge(this,e)},safeExtend(e){return ve(this,e)},merge(e){return ye(this,e)},pick(e){return pe(this,e)},omit(e){return he(this,e)},partial(...e){return be(jd,this,e[0])},exactPartial(...e){return be(Nd,this,e[0],`exactPartial`)},required(...e){return xe(Hd,this,e[0])}});function td(e,t){return new ed({type:`object`,shape:e??{},...x(t)})}function nd(e,t){return new ed({type:`object`,shape:e,catchall:Ku(),...x(t)})}function rd(e,t){return new ed({type:`object`,shape:e,catchall:$(),...x(t)})}var id=D(`ZodUnion`,(e,t)=>{Ri.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ac(e,t,n,r),e.options=t.options});function ad(e,t){return new id({type:`union`,options:e,...x(t)})}var od=D(`ZodXor`,(e,t)=>{id.init(e,t),Bi.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ac(e,t,n,r),e.options=t.options});function sd(e,t){return new od({type:`union`,options:e,inclusive:!1,...x(t)})}var cd=D(`ZodDiscriminatedUnion`,(e,t)=>{id.init(e,t),Hi.init(e,t)});function ld(e,t,n){return new cd({type:`union`,options:t,discriminator:e,...x(n)})}var ud=D(`ZodIntersection`,(e,t)=>{Ui.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jc(e,t,n,r)});function dd(e,t){return new ud({type:`intersection`,left:e,right:t})}var fd=D(`ZodTuple`,(e,t)=>{Y(),Ki.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mc(e,t,n,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw Error(`.partial() cannot be used on tuple schemas containing refinements`);return this.clone({...e,items:e.items.map(e=>new jd({type:`optional`,innerType:e}))})}});function pd(e,t,n){let r=t instanceof N;return new fd({type:`tuple`,items:e,rest:r?t:null,...x(r?n:t)})}var md=D(`ZodRecord`,(e,t)=>{Y(),Xi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ic(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function hd(e,t,n){return!t||!t._zod?new md({type:`record`,keyType:_l(),valueType:e,...x(t)}):new md({type:`record`,keyType:e,valueType:t,...x(n)})}function gd(e,t,n){return new md({type:`record`,keyType:e,valueType:t,...x(n),partial:!0})}function _d(e,t,n){return new md({type:`record`,keyType:e,valueType:t,mode:`loose`,...x(n)})}var vd=D(`ZodMap`,(e,t)=>{Y(),Zi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tc(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(B(...t)),e.nonempty=t=>e.check(B(1,t)),e.max=(...t)=>e.check(is(...t)),e.size=(...t)=>e.check(as(...t))});function yd(e,t,n){return new vd({type:`map`,keyType:e,valueType:t,...x(n)})}var bd=D(`ZodSet`,(e,t)=>{Y(),$i.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ec(e,t,n,r),e.min=(...t)=>e.check(B(...t)),e.nonempty=t=>e.check(B(1,t)),e.max=(...t)=>e.check(is(...t)),e.size=(...t)=>e.check(as(...t))});function xd(e,t){return new bd({type:`set`,valueType:e,...x(t)})}var Sd=D(`ZodEnum`,(e,t)=>{ta.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gc(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Sd({...t,checks:[],...x(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Sd({...t,checks:[],...x(r),entries:i})}});function Cd(e,t){return new Sd({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...x(t)})}function wd(e,t){return new Sd({type:`enum`,entries:e,...x(t)})}var Td=D(`ZodLiteral`,(e,t)=>{na.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_c(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ed(e,t){return new Td({type:`literal`,values:Array.isArray(e)?e:[e],...x(t)})}var Dd=D(`ZodFile`,(e,t)=>{ra.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bc(e,t,n,r),e.min=(t,n)=>e.check(B(t,n)),e.max=(t,n)=>e.check(is(t,n)),e.mime=(t,n)=>e.check(_s(Array.isArray(t)?t:[t],n))});function Od(e){return ws(Dd,e)}var kd=D(`ZodTransform`,(e,t)=>{Y(),ia.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wc(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new qe(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ae(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ae(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ad(e){return new kd({type:`transform`,transform:e})}var jd=D(`ZodOptional`,(e,t)=>{oa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Md(e){return new jd({type:`optional`,innerType:e})}var Nd=D(`ZodExactOptional`,(e,t)=>{sa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pd(e){return new Nd({type:`optional`,innerType:e})}var Fd=D(`ZodNullable`,(e,t)=>{ca.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Id(e){return new Fd({type:`nullable`,innerType:e})}function Ld(e){return Md(Id(e))}var Rd=D(`ZodDefault`,(e,t)=>{la.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zd(e,t){return new Rd({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():oe(t)}})}var Bd=D(`ZodPrefault`,(e,t)=>{da.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Vd(e,t){return new Bd({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():oe(t)}})}var Hd=D(`ZodNonOptional`,(e,t)=>{fa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ud(e,t){return new Hd({type:`nonoptional`,innerType:e,...x(t)})}var Wd=D(`ZodSuccess`,(e,t)=>{ma.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Gd(e){return new Wd({type:`success`,innerType:e})}var Kd=D(`ZodCatch`,(e,t)=>{ga.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function qd(e,t){return new Kd({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Ve(t)})}var Jd=D(`ZodNaN`,(e,t)=>{_a.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vc(e,t,n,r)});function Yd(e){return Qo(Jd,e)}var Xd=D(`ZodPipe`,(e,t)=>{va.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wc(e,t,n,r),e.in=t.in,e.out=t.out});function Zd(e,t){return new Xd({type:`pipe`,in:e,out:t})}var Qd=D(`ZodCodec`,(e,t)=>{Xd.init(e,t),ba.init(e,t)});function $d(e,t,n){return new Qd({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function ef(e){let t=e._zod.def;return new Qd({type:`pipe`,in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var tf=D(`ZodPreprocess`,(e,t)=>{Xd.init(e,t),Ca.init(e,t)}),nf=D(`ZodReadonly`,(e,t)=>{wa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rf(e){return new nf({type:`readonly`,innerType:e})}var af=D(`ZodTemplateLiteral`,(e,t)=>{Oa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yc(e,t,n,r)});function of(e,t){return new af({type:`template_literal`,parts:e,...x(t)})}var sf=D(`ZodLazy`,(e,t)=>{ja.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jc(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function cf(e){return new sf({type:`lazy`,getter:e})}var lf=D(`ZodPromise`,(e,t)=>{Aa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uf(e){return new lf({type:`promise`,innerType:e})}var df=D(`ZodFunction`,(e,t)=>{ka.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cc(e,t,n,r)});function ff(e){return new df({type:`function`,input:Array.isArray(e?.input)?pd(e?.input):e?.input??Qu($()),output:e?.output??$()})}var pf=D(`ZodCustom`,(e,t)=>{Ma.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sc(e,t,n,r)});function mf(e){let t=new M({check:`custom`});return t._zod.check=e,t}function hf(e,t){return Ts(pf,e??(()=>!0),t)}function gf(e,t={}){return Es(pf,e,t)}function _f(e,t){return Ds(e,t)}var vf=ks,yf=As,bf=D(`ZodInstanceOf`,(e,t)=>{pf.init(e,t)},{properties(e,t){return this.check(gs(e,t))}});function xf(e,t={}){let n=new bf({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...x(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}var Sf=(...e)=>js({Codec:Qd,Boolean:ku,String:gl},...e);function Cf(e){let t=cf(()=>ad([_l(e),Su(),Au(),Vu(),Qu(t),hd(_l(),t)]));return t}function wf(e,t){return new tf({type:`pipe`,in:Ad(e),out:t})}export{V as $,Xc as A,us as B,hd as C,ad as D,_l as E,jo as F,_s as G,L as H,Ao as I,rs as J,ss as K,No as L,R as M,z as N,$ as O,fs as P,vs as Q,Mo as R,gd as S,nd as T,os as U,I as V,is as W,ns as X,es as Y,ts as Z,cf as _,bl as a,Ss as at,Su as b,Cd as c,xs as ct,Qu as d,F as dt,$o as et,iu as f,ot as ft,Cf as g,ld as h,v as ht,xl as i,as as it,ms as j,el as k,Vu as l,ys as lt,hf as m,d as mt,yl as n,hs as nt,ed as o,ps as ot,Au as p,Ue as pt,B as q,vl as r,ls as rt,id as s,bs as st,cd as t,gs as tt,zu as u,ds as ut,Ed as v,pl as w,td as x,rd as y,cs as z};