@openspecui/web 11.0.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/assets/App-BagQkLCd.css +1 -0
  2. package/dist/assets/{App-DJc144W-.js → App-Dmag08k5.js} +108 -108
  3. package/dist/assets/{main-DXrIDd5i.js → main-DXjJbv3-.js} +2 -2
  4. package/dist/assets/{trpc-EqFJjKn0.js → trpc-CENMN-Kx.js} +1 -1
  5. package/dist/index.html +1 -1
  6. package/dist-ssg/client/.vite/ssr-manifest.json +69 -29
  7. package/dist-ssg/client/assets/CanvasRenderer-B3YNEZKU.js +1 -0
  8. package/dist-ssg/client/assets/WebGLRenderer-91FdO4XE.js +1 -0
  9. package/dist-ssg/client/assets/WebGPURenderer-BcSREi3g.js +1 -0
  10. package/dist-ssg/client/assets/browserAll-CRvGxmXW.js +1 -0
  11. package/dist-ssg/client/assets/{config-guide-presentation-BcSY1KFl.js → config-guide-presentation-GtsojPuN.js} +1 -1
  12. package/dist-ssg/client/assets/{dist-DqLAJpLg.js → dist-B0xIEOgo.js} +1 -1
  13. package/dist-ssg/client/assets/{dist-B6Pffk4D.js → dist-BAP9yhhm.js} +1 -1
  14. package/dist-ssg/client/assets/dist-Bsojfco7.js +1 -0
  15. package/dist-ssg/client/assets/{dist-C24XzhQ9.js → dist-BxTQbErr.js} +1 -1
  16. package/dist-ssg/client/assets/{dist-C6Glwe3G.js → dist-C7lTRiju.js} +1 -1
  17. package/dist-ssg/client/assets/{dist-D_u4DgCb.js → dist-CI3zBObR.js} +1 -1
  18. package/dist-ssg/client/assets/{dist-WVAwgVsq.js → dist-CJOMMo-D.js} +1 -1
  19. package/dist-ssg/client/assets/{dist-iFk0rzRc.js → dist-Cgf7W726.js} +1 -1
  20. package/dist-ssg/client/assets/{dist--KYFoBcy.js → dist-DHkPjBBo.js} +1 -1
  21. package/dist-ssg/client/assets/{dist-DP2j-YyT.js → dist-Df3fSUJ8.js} +1 -1
  22. package/dist-ssg/client/assets/dist-fJz8f69P.js +1 -0
  23. package/dist-ssg/client/assets/dist-we8a11kz.js +1 -0
  24. package/dist-ssg/client/assets/{ghostty-web-lktg9S8z.js → ghostty-web-VZE4TZBO.js} +1 -1
  25. package/dist-ssg/client/assets/index-CS0xsSqt.css +1 -0
  26. package/dist-ssg/client/assets/index.ssg-m0qZ-Tbv.js +1650 -0
  27. package/dist-ssg/client/assets/{init-Cy2h-29G.js → init-0qJSx79q.js} +1 -1
  28. package/dist-ssg/client/assets/{trpc-DxTuySH7.js → trpc-D4bSp4J9.js} +1 -1
  29. package/dist-ssg/client/assets/webworkerAll-BUpVAcIt.js +1 -0
  30. package/dist-ssg/client/index.ssg.html +2 -2
  31. package/dist-ssg/server/assets/CanvasRenderer-eDcOd6Sl.js +3 -0
  32. package/dist-ssg/server/assets/WebGLRenderer-BYGgdFoJ.js +3 -0
  33. package/dist-ssg/server/assets/WebGPURenderer-CS5mt9ch.js +3 -0
  34. package/dist-ssg/server/assets/{browserAll-ByxW2BCo.js → browserAll-Da2y8ybl.js} +2 -2
  35. package/dist-ssg/server/assets/{config-guide-presentation-BfkVCRQq.js → config-guide-presentation-GWnVFKTW.js} +1 -1
  36. package/dist-ssg/server/assets/{dist-DvJqEVFD.js → dist-A6g9ScYS.js} +1 -1
  37. package/dist-ssg/server/assets/{dist-5xHpmSpA.js → dist-Bk9be2-W.js} +1 -1
  38. package/dist-ssg/server/assets/dist-C8ZGbZgL.js +3 -0
  39. package/dist-ssg/server/assets/{dist-DzYuWuV1.js → dist-C8mczL_o.js} +1 -1
  40. package/dist-ssg/server/assets/{dist-Cj2NABFW.js → dist-CRw-jyve.js} +1 -1
  41. package/dist-ssg/server/assets/{dist-wEaYViHh.js → dist-CmE7gK9r.js} +1 -1
  42. package/dist-ssg/server/assets/dist-D2ilXjzO.js +3 -0
  43. package/dist-ssg/server/assets/{dist-C-7lPLui.js → dist-D3Ubfaie.js} +1 -1
  44. package/dist-ssg/server/assets/{dist-j6yIDF4P.js → dist-DHhdkqG1.js} +1 -1
  45. package/dist-ssg/server/assets/dist-DbHDr3r9.js +3 -0
  46. package/dist-ssg/server/assets/{dist-7sF3GmjJ.js → dist-QLG95fVW.js} +1 -1
  47. package/dist-ssg/server/assets/{dist-BPIetWhy.js → dist-dHhPmrtl.js} +1 -1
  48. package/dist-ssg/server/assets/{entry-server-DccPywiF.js → entry-server-B1byBTHL.js} +963 -136
  49. package/dist-ssg/server/assets/{init-mk1myhk2.js → init-BCpyot27.js} +1 -1
  50. package/dist-ssg/server/assets/trpc-D5UIUAYV.js +3 -0
  51. package/dist-ssg/server/assets/webworkerAll-Dg825OUg.js +4 -0
  52. package/dist-ssg/server/ssr-entry-manifest.json +24 -24
  53. package/package.json +3 -3
  54. package/dist/assets/App-CRdki6ZH.css +0 -1
  55. package/dist-ssg/client/assets/CanvasRenderer-CngPuJLR.js +0 -1
  56. package/dist-ssg/client/assets/WebGLRenderer-D6PAqEKt.js +0 -1
  57. package/dist-ssg/client/assets/WebGPURenderer-CtCVeRwN.js +0 -1
  58. package/dist-ssg/client/assets/browserAll-BiLg81NS.js +0 -1
  59. package/dist-ssg/client/assets/dist-BN2GrXVl.js +0 -1
  60. package/dist-ssg/client/assets/dist-DqTWWRfT.js +0 -1
  61. package/dist-ssg/client/assets/dist-ZlYc7_kt.js +0 -1
  62. package/dist-ssg/client/assets/index-CDBo5TOs.css +0 -1
  63. package/dist-ssg/client/assets/index.ssg-n59gyR9q.js +0 -1650
  64. package/dist-ssg/client/assets/webworkerAll-B5n4bM-i.js +0 -1
  65. package/dist-ssg/server/assets/CanvasRenderer-D58O6peF.js +0 -3
  66. package/dist-ssg/server/assets/WebGLRenderer-CLVKAqNO.js +0 -3
  67. package/dist-ssg/server/assets/WebGPURenderer-D4vaKOO4.js +0 -3
  68. package/dist-ssg/server/assets/dist-CiijDa1h.js +0 -3
  69. package/dist-ssg/server/assets/dist-CkT7sc-T.js +0 -3
  70. package/dist-ssg/server/assets/dist-Ct3YhJiO.js +0 -3
  71. package/dist-ssg/server/assets/trpc-BPMx2lHD.js +0 -3
  72. package/dist-ssg/server/assets/webworkerAll-5v7Fs7LO.js +0 -4
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/hosted-connection-state-BYVOLSii.js","assets/jsx-runtime-B5X0rzej.js","assets/chunk-VBW0iQ51.js","assets/App-DJc144W-.js","assets/preload-helper-qlgyTAkD.js","assets/ToolbarRootContext-DJ7ICfbj.js","assets/react-dom-DGmpTSTt.js","assets/react-w0ynVMNy.js","assets/dist-BM1p13VL.js","assets/dist-BjgzTMjG.js","assets/dist-DOslja1j.js","assets/dist-BElax2Cc.js","assets/dist-B_gB7iV-.js","assets/dist-BTEspn1S.js","assets/dist-BPqKJ2jd.js","assets/dist-B_cOSPGy.js","assets/Geometry-DnX4RiLB.js","assets/trpc-EqFJjKn0.js","assets/RenderTargetSystem-DNBcF83q.js","assets/CanvasRenderer-frZG-e8U.js","assets/getTextureBatchBindGroup-BBz5dgEf.js","assets/ImageSource-D9b88hVS.js","assets/FilterSystem-DGEzd4r7.js","assets/WebGPURenderer-rPgcvLqV.js","assets/BufferResource-TFXpqlS4.js","assets/App-CRdki6ZH.css"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./chunk-VBW0iQ51.js";import"./modulepreload-polyfill-CXK8biUa.js";import{t}from"./client-pO1cwWkl.js";import"./react-w0ynVMNy.js";import"./react-dom-DGmpTSTt.js";import{t as n}from"./jsx-runtime-B5X0rzej.js";import{t as r}from"./preload-helper-qlgyTAkD.js";var i;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(i||={});var a;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(a||={});var o=i.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),s=e=>{switch(typeof e){case`undefined`:return o.undefined;case`string`:return o.string;case`number`:return Number.isNaN(e)?o.nan:o.number;case`boolean`:return o.boolean;case`function`:return o.function;case`bigint`:return o.bigint;case`symbol`:return o.symbol;case`object`:return Array.isArray(e)?o.array:e===null?o.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?o.promise:typeof Map<`u`&&e instanceof Map?o.map:typeof Set<`u`&&e instanceof Set?o.set:typeof Date<`u`&&e instanceof Date?o.date:o.object;default:return o.unknown}},c=i.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),l=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,i.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};l.create=e=>new l(e);var u=(e,t)=>{let n;switch(e.code){case c.invalid_type:n=e.received===o.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case c.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,i.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:n=`Unrecognized key(s) in object: ${i.joinValues(e.keys,`, `)}`;break;case c.invalid_union:n=`Invalid input`;break;case c.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${i.joinValues(e.options)}`;break;case c.invalid_enum_value:n=`Invalid enum value. Expected ${i.joinValues(e.options)}, received '${e.received}'`;break;case c.invalid_arguments:n=`Invalid function arguments`;break;case c.invalid_return_type:n=`Invalid function return type`;break;case c.invalid_date:n=`Invalid date`;break;case c.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:i.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case c.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case c.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case c.custom:n=`Invalid input`;break;case c.invalid_intersection_types:n=`Intersection results could not be merged`;break;case c.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case c.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,i.assertNever(e)}return{message:n}},ee=u;function te(){return ee}var ne=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function d(e,t){let n=te(),r=ne({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===u?void 0:u].filter(e=>!!e)});e.common.issues.push(r)}var f=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return p;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return p;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},p=Object.freeze({status:`aborted`}),re=e=>({status:`dirty`,value:e}),m=e=>({status:`valid`,value:e}),ie=e=>e.status===`aborted`,ae=e=>e.status===`dirty`,h=e=>e.status===`valid`,g=e=>typeof Promise<`u`&&e instanceof Promise,_;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(_||={});var v=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},oe=(e,t)=>{if(h(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){return this._error||=new l(e.common.issues),this._error}}};function y(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var b=class{get description(){return this._def.description}_getType(e){return s(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:s(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new f,ctx:{common:e.parent.common,data:e.data,parsedType:s(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(g(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:s(e)};return oe(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:s(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return h(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>h(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:s(e)},r=this._parse({data:e,path:n.path,parent:n});return oe(n,await(g(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:c.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new M({schema:this,typeName:R.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return N.create(this,this._def)}nullable(){return P.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return w.create(this)}promise(){return j.create(this,this._def)}or(e){return D.create([this,e],this._def)}and(e){return k.create(this,e,this._def)}transform(e){return new M({...y(this._def),schema:this,typeName:R.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new F({...y(this._def),innerType:this,defaultValue:t,typeName:R.ZodDefault})}brand(){return new $e({typeName:R.ZodBranded,type:this,...y(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new I({...y(this._def),innerType:this,catchValue:t,typeName:R.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return et.create(this,e)}readonly(){return L.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},se=/^c[^\s-]{8,}$/i,ce=/^[0-9a-z]+$/,le=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ue=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,de=/^[a-z0-9_-]{21}$/i,fe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,me=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,he=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,ge,_e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ve=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ye=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,be=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Se=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ce=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,we=RegExp(`^${Ce}$`);function Te(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Ee(e){return RegExp(`^${Te(e)}$`)}function De(e){let t=`${Ce}T${Te(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Oe(e,t){return!!((t===`v4`||!t)&&_e.test(e)||(t===`v6`||!t)&&ye.test(e))}function ke(e,t){if(!fe.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Ae(e,t){return!!((t===`v4`||!t)&&ve.test(e)||(t===`v6`||!t)&&be.test(e))}var je=class e extends b{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==o.string){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.string,received:t.parsedType}),p}let t=new f,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?d(n,{code:c.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&d(n,{code:c.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)me.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`email`,code:c.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)ge||=new RegExp(he,`u`),ge.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`emoji`,code:c.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)ue.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`uuid`,code:c.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)de.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`nanoid`,code:c.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)se.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`cuid`,code:c.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)ce.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`cuid2`,code:c.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)le.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`ulid`,code:c.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),d(n,{validation:`url`,code:c.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`regex`,code:c.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?De(r).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?we.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?Ee(r).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?pe.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`duration`,code:c.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Oe(e.data,r.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`ip`,code:c.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?ke(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`jwt`,code:c.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?Ae(e.data,r.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`cidr`,code:c.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?xe.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`base64`,code:c.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Se.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`base64url`,code:c.invalid_string,message:r.message}),t.dirty()):i.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:c.invalid_string,..._.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,..._.errToObj(e)})}url(e){return this._addCheck({kind:`url`,..._.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,..._.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,..._.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,..._.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,..._.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,..._.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,..._.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,..._.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,..._.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,..._.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,..._.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,..._.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,..._.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,..._.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,..._.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,..._.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,..._.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,..._.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,..._.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,..._.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,..._.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,..._.errToObj(t)})}nonempty(e){return this.min(1,_.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};je.create=e=>new je({checks:[],typeName:R.ZodString,coerce:e?.coerce??!1,...y(e)});function Me(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var Ne=class e extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==o.number){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.number,received:t.parsedType}),p}let t,n=new f;for(let r of this._def.checks)r.kind===`int`?i.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),d(t,{code:c.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),d(t,{code:c.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),d(t,{code:c.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?Me(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),d(t,{code:c.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),d(t,{code:c.not_finite,message:r.message}),n.dirty()):i.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,_.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,_.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,_.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,_.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:_.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:_.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:_.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:_.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:_.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:_.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&i.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};Ne.create=e=>new Ne({checks:[],typeName:R.ZodNumber,coerce:e?.coerce||!1,...y(e)});var Pe=class e extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==o.bigint)return this._getInvalidInput(e);let t,n=new f;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),d(t,{code:c.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),d(t,{code:c.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),d(t,{code:c.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):i.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.bigint,received:t.parsedType}),p}gte(e,t){return this.setLimit(`min`,e,!0,_.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,_.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,_.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,_.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:_.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:_.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Pe.create=e=>new Pe({checks:[],typeName:R.ZodBigInt,coerce:e?.coerce??!1,...y(e)});var Fe=class extends b{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==o.boolean){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.boolean,received:t.parsedType}),p}return m(e.data)}};Fe.create=e=>new Fe({typeName:R.ZodBoolean,coerce:e?.coerce||!1,...y(e)});var Ie=class e extends b{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==o.date){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.date,received:t.parsedType}),p}if(Number.isNaN(e.data.getTime()))return d(this._getOrReturnCtx(e),{code:c.invalid_date}),p;let t=new f,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):i.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:_.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:_.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};Ie.create=e=>new Ie({checks:[],coerce:e?.coerce||!1,typeName:R.ZodDate,...y(e)});var Le=class extends b{_parse(e){if(this._getType(e)!==o.symbol){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.symbol,received:t.parsedType}),p}return m(e.data)}};Le.create=e=>new Le({typeName:R.ZodSymbol,...y(e)});var Re=class extends b{_parse(e){if(this._getType(e)!==o.undefined){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.undefined,received:t.parsedType}),p}return m(e.data)}};Re.create=e=>new Re({typeName:R.ZodUndefined,...y(e)});var ze=class extends b{_parse(e){if(this._getType(e)!==o.null){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.null,received:t.parsedType}),p}return m(e.data)}};ze.create=e=>new ze({typeName:R.ZodNull,...y(e)});var x=class extends b{constructor(){super(...arguments),this._any=!0}_parse(e){return m(e.data)}};x.create=e=>new x({typeName:R.ZodAny,...y(e)});var S=class extends b{constructor(){super(...arguments),this._unknown=!0}_parse(e){return m(e.data)}};S.create=e=>new S({typeName:R.ZodUnknown,...y(e)});var C=class extends b{_parse(e){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.never,received:t.parsedType}),p}};C.create=e=>new C({typeName:R.ZodNever,...y(e)});var Be=class extends b{_parse(e){if(this._getType(e)!==o.undefined){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.void,received:t.parsedType}),p}return m(e.data)}};Be.create=e=>new Be({typeName:R.ZodVoid,...y(e)});var w=class e extends b{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==o.array)return d(t,{code:c.invalid_type,expected:o.array,received:t.parsedType}),p;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(d(t,{code:e?c.too_big:c.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(d(t,{code:c.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(d(t,{code:c.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new v(t,e,t.path,n)))).then(e=>f.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new v(t,e,t.path,n)));return f.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:_.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:_.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:_.toString(n)}})}nonempty(e){return this.min(1,e)}};w.create=(e,t)=>new w({type:e,minLength:null,maxLength:null,exactLength:null,typeName:R.ZodArray,...y(t)});function T(e){if(e instanceof E){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=N.create(T(r))}return new E({...e._def,shape:()=>t})}else if(e instanceof w)return new w({...e._def,type:T(e.element)});else if(e instanceof N)return N.create(T(e.unwrap()));else if(e instanceof P)return P.create(T(e.unwrap()));else if(e instanceof A)return A.create(e.items.map(e=>T(e)));else return e}var E=class e extends b{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:i.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==o.object){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.object,received:t.parsedType}),p}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof C&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let s=[];for(let e of i){let t=r[e],i=n.data[e];s.push({key:{status:`valid`,value:e},value:t._parse(new v(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof C){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)s.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(d(n,{code:c.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];s.push({key:{status:`valid`,value:t},value:e._parse(new v(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of s){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>f.mergeObjectSync(t,e)):f.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(t){return _.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:_.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:R.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of i.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of i.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return T(this)}partial(t){let n={};for(let e of i.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of i.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof N;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Ye(i.objectKeys(this.shape))}};E.create=(e,t)=>new E({shape:()=>e,unknownKeys:`strip`,catchall:C.create(),typeName:R.ZodObject,...y(t)}),E.strictCreate=(e,t)=>new E({shape:()=>e,unknownKeys:`strict`,catchall:C.create(),typeName:R.ZodObject,...y(t)}),E.lazycreate=(e,t)=>new E({shape:e,unknownKeys:`strip`,catchall:C.create(),typeName:R.ZodObject,...y(t)});var D=class extends b{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new l(e.ctx.common.issues));return d(t,{code:c.invalid_union,unionErrors:n}),p}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new l(e));return d(t,{code:c.invalid_union,unionErrors:i}),p}}get options(){return this._def.options}};D.create=(e,t)=>new D({options:e,typeName:R.ZodUnion,...y(t)});var O=e=>e instanceof qe?O(e.schema):e instanceof M?O(e.innerType()):e instanceof Je?[e.value]:e instanceof Xe?e.options:e instanceof Ze?i.objectValues(e.enum):e instanceof F?O(e._def.innerType):e instanceof Re?[void 0]:e instanceof ze?[null]:e instanceof N?[void 0,...O(e.unwrap())]:e instanceof P?[null,...O(e.unwrap())]:e instanceof $e||e instanceof L?O(e.unwrap()):e instanceof I?O(e._def.innerType):[],Ve=class e extends b{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==o.object)return d(t,{code:c.invalid_type,expected:o.object,received:t.parsedType}),p;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(d(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),p)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=O(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:R.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...y(r)})}};function He(e,t){let n=s(e),r=s(t);if(e===t)return{valid:!0,data:e};if(n===o.object&&r===o.object){let n=i.objectKeys(t),r=i.objectKeys(e).filter(e=>n.indexOf(e)!==-1),a={...e,...t};for(let n of r){let r=He(e[n],t[n]);if(!r.valid)return{valid:!1};a[n]=r.data}return{valid:!0,data:a}}else if(n===o.array&&r===o.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=He(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===o.date&&r===o.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var k=class extends b{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(ie(e)||ie(r))return p;let i=He(e.value,r.value);return i.valid?((ae(e)||ae(r))&&t.dirty(),{status:t.value,value:i.data}):(d(n,{code:c.invalid_intersection_types}),p)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};k.create=(e,t,n)=>new k({left:e,right:t,typeName:R.ZodIntersection,...y(n)});var A=class e extends b{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==o.array)return d(n,{code:c.invalid_type,expected:o.array,received:n.parsedType}),p;if(n.data.length<this._def.items.length)return d(n,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),p;!this._def.rest&&n.data.length>this._def.items.length&&(d(n,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new v(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>f.mergeArray(t,e)):f.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};A.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new A({items:e,typeName:R.ZodTuple,rest:null,...y(t)})};var Ue=class e extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==o.object)return d(n,{code:c.invalid_type,expected:o.object,received:n.parsedType}),p;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new v(n,e,n.path,e)),value:a._parse(new v(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?f.mergeObjectAsync(t,r):f.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof b?new e({keyType:t,valueType:n,typeName:R.ZodRecord,...y(r)}):new e({keyType:je.create(),valueType:t,typeName:R.ZodRecord,...y(n)})}},We=class extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==o.map)return d(n,{code:c.invalid_type,expected:o.map,received:n.parsedType}),p;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new v(n,e,n.path,[a,`key`])),value:i._parse(new v(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return p;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return p;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};We.create=(e,t,n)=>new We({valueType:t,keyType:e,typeName:R.ZodMap,...y(n)});var Ge=class e extends b{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==o.set)return d(n,{code:c.invalid_type,expected:o.set,received:n.parsedType}),p;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(d(n,{code:c.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(d(n,{code:c.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return p;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let s=[...n.data.values()].map((e,t)=>i._parse(new v(n,e,n.path,t)));return n.common.async?Promise.all(s).then(e=>a(e)):a(s)}min(t,n){return new e({...this._def,minSize:{value:t,message:_.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:_.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Ge.create=(e,t)=>new Ge({valueType:e,minSize:null,maxSize:null,typeName:R.ZodSet,...y(t)});var Ke=class e extends b{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==o.function)return d(t,{code:c.invalid_type,expected:o.function,received:t.parsedType}),p;function n(e,n){return ne({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,te(),u].filter(e=>!!e),issueData:{code:c.invalid_arguments,argumentsError:n}})}function r(e,n){return ne({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,te(),u].filter(e=>!!e),issueData:{code:c.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof j){let e=this;return m(async function(...t){let o=new l([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return m(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new l([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new l([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:A.create(t).rest(S.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||A.create([]).rest(S.create()),returns:n||S.create(),typeName:R.ZodFunction,...y(r)})}},qe=class extends b{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};qe.create=(e,t)=>new qe({getter:e,typeName:R.ZodLazy,...y(t)});var Je=class extends b{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return d(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),p}return{status:`valid`,value:e.data}}get value(){return this._def.value}};Je.create=(e,t)=>new Je({value:e,typeName:R.ZodLiteral,...y(t)});function Ye(e,t){return new Xe({values:e,typeName:R.ZodEnum,...y(t)})}var Xe=class e extends b{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return d(t,{expected:i.joinValues(n),received:t.parsedType,code:c.invalid_type}),p}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return d(t,{received:t.data,code:c.invalid_enum_value,options:n}),p}return m(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};Xe.create=Ye;var Ze=class extends b{_parse(e){let t=i.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==o.string&&n.parsedType!==o.number){let e=i.objectValues(t);return d(n,{expected:i.joinValues(e),received:n.parsedType,code:c.invalid_type}),p}if(this._cache||=new Set(i.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=i.objectValues(t);return d(n,{received:n.data,code:c.invalid_enum_value,options:e}),p}return m(e.data)}get enum(){return this._def.values}};Ze.create=(e,t)=>new Ze({values:e,typeName:R.ZodNativeEnum,...y(t)});var j=class extends b{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==o.promise&&t.common.async===!1?(d(t,{code:c.invalid_type,expected:o.promise,received:t.parsedType}),p):m((t.parsedType===o.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};j.create=(e,t)=>new j({type:e,typeName:R.ZodPromise,...y(t)});var M=class extends b{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:e=>{d(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),r.type===`preprocess`){let e=r.transform(n.data,a);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return p;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?p:r.status===`dirty`||t.value===`dirty`?re(r.value):r});{if(t.value===`aborted`)return p;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?p:r.status===`dirty`||t.value===`dirty`?re(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,a);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?p:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?p:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!h(e))return p;let i=r.transform(e.value,a);if(i instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>h(e)?Promise.resolve(r.transform(e.value,a)).then(e=>({status:t.value,value:e})):p);i.assertNever(r)}};M.create=(e,t,n)=>new M({schema:e,typeName:R.ZodEffects,effect:t,...y(n)}),M.createWithPreprocess=(e,t,n)=>new M({schema:t,effect:{type:`preprocess`,transform:e},typeName:R.ZodEffects,...y(n)});var N=class extends b{_parse(e){return this._getType(e)===o.undefined?m(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};N.create=(e,t)=>new N({innerType:e,typeName:R.ZodOptional,...y(t)});var P=class extends b{_parse(e){return this._getType(e)===o.null?m(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};P.create=(e,t)=>new P({innerType:e,typeName:R.ZodNullable,...y(t)});var F=class extends b{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===o.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};F.create=(e,t)=>new F({innerType:e,typeName:R.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...y(t)});var I=class extends b{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return g(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new l(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new l(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};I.create=(e,t)=>new I({innerType:e,typeName:R.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...y(t)});var Qe=class extends b{_parse(e){if(this._getType(e)!==o.nan){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.nan,received:t.parsedType}),p}return{status:`valid`,value:e.data}}};Qe.create=e=>new Qe({typeName:R.ZodNaN,...y(e)});var $e=class extends b{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},et=class e extends b{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?p:e.status===`dirty`?(t.dirty(),re(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?p:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:R.ZodPipeline})}},L=class extends b{_parse(e){let t=this._def.innerType._parse(e),n=e=>(h(e)&&(e.value=Object.freeze(e.value)),e);return g(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};L.create=(e,t)=>new L({innerType:e,typeName:R.ZodReadonly,...y(t)});function tt(e,t){let n=typeof e==`function`?e(t):typeof e==`string`?{message:e}:e;return typeof n==`string`?{message:n}:n}function nt(e,t={},n){return e?x.create().superRefine((r,i)=>{let a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){let e=tt(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}});if(!a){let e=tt(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}}):x.create()}E.lazycreate;var R;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(R||={});var z=je.create,B=Ne.create;Qe.create,Pe.create;var V=Fe.create;Ie.create,Le.create;var rt=Re.create,H=ze.create;x.create;var U=S.create;C.create,Be.create;var W=w.create,G=E.create;E.strictCreate;var it=D.create,K=Ve.create;k.create;var at=A.create,ot=Ue.create;We.create,Ge.create,Ke.create;var st=qe.create,q=Je.create,J=Xe.create;Ze.create,j.create,M.create,N.create,P.create;var ct=M.createWithPreprocess;et.create;var lt=e(t(),1),Y=G({severity:J([`error`,`warning`,`info`]),code:z(),message:z(),target:z().optional(),fix:z().optional()}).passthrough(),ut=J([`store`,`declared`,`nearest`,`global_default`,`implicit`]),dt=G({path:z(),source:ut,store_id:z().optional()}).passthrough(),ft=G({id:z(),summary:z()}).passthrough(),pt=G({store_id:z(),root:z().optional(),status:W(Y)}).passthrough(),mt=pt.extend({specs:W(ft).optional(),fetch:z().optional()}).passthrough(),ht=G({status:W(Y).min(1)}).passthrough(),gt=st(()=>it([z(),B(),V(),H(),W(gt),ot(z(),gt)])),_t=G({success:V(),stdout:z(),stderr:z(),exitCode:B().int().nullable(),payload:gt.nullable(),diagnostics:W(Y),contractError:z().optional()}),vt=G({name:z(),message:z(),cliEvidence:_t.nullable()}),yt=J([`loading`,`ready`,`revalidating`,`error`,`refresh-error`]),bt=J([`initial`,`dependency`,`explicit-refresh`,`subscriber-resume`]);function X(e){let t={identity:z().min(1),workGeneration:B().int().nonnegative(),invalidationCause:bt};return K(`state`,[G({...t,state:q(`loading`),data:H(),freshness:H(),snapshotGeneration:H(),error:H()}),G({...t,state:q(`ready`),data:e,freshness:q(`current`),snapshotGeneration:B().int().nonnegative(),error:H()}),G({...t,state:q(`revalidating`),data:e,freshness:q(`stale-display-only`),snapshotGeneration:B().int().nonnegative(),error:H()}),G({...t,state:q(`error`),data:H(),freshness:H(),snapshotGeneration:H(),error:vt}),G({...t,state:q(`refresh-error`),data:e,freshness:q(`stale-display-only`),snapshotGeneration:B().int().nonnegative(),error:vt})])}var xt=G({identity:z().min(1),workGeneration:B().int().nonnegative(),snapshotGeneration:B().int().nonnegative().nullable(),state:yt,invalidationCause:bt}),Z=G({severity:z().optional(),code:z().optional(),message:z().optional(),target:z().optional(),fix:z().optional()}).passthrough(),St=G({id:z(),root:z()}).passthrough();G({stores:W(St).default([]),status:W(Z).optional()}).passthrough();var Ct=G({present:V().nullable().optional(),healthy:V().nullable().optional()}).passthrough(),wt=G({present:V().nullable().optional(),valid:V().nullable().optional(),id:z().nullable().optional(),remote:z().nullable().optional()}).passthrough(),Tt=G({is_repository:V().nullable().optional(),has_commits:V().nullable().optional(),has_uncommitted_changes:V().nullable().optional(),has_remote:V().nullable().optional(),origin_url:z().nullable().optional()}).passthrough(),Et=G({id:z().optional(),root:z().optional(),metadata_path:z().nullable().optional(),openspec_root:Ct.optional(),metadata:wt.optional(),git:Tt.optional(),status:W(Z).optional()}).passthrough();G({stores:W(Et).default([]),status:W(Z).optional()}).passthrough();var Dt=G({id:z(),requirementCount:B()}).passthrough(),Ot=G({name:z(),completedTasks:B(),totalTasks:B(),lastModified:z(),status:J([`no-tasks`,`complete`,`in-progress`])}).passthrough();G({specs:W(Dt).default([]),status:W(Z).optional()}).passthrough(),G({changes:W(Ot).default([]),status:W(Z).optional()}).passthrough(),J([`specs`,`changes`]);var kt=`stores.content.inspect`,At=G({kind:z(),message:z(),cliVersion:z().optional()}).passthrough(),jt=G({available:V(),specs:W(Dt),storeId:z(),evidence:U().nullable().optional(),error:At.optional(),cliVersion:z().optional()}).passthrough(),Mt=G({available:V(),changes:W(Ot),storeId:z(),evidence:U().nullable().optional(),error:At.optional(),cliVersion:z().optional()}).passthrough(),Nt=G({exitStatus:B().int().nullable(),stdout:z().optional(),stderr:z().optional(),diagnostics:W(Y).optional(),payload:U().optional(),contractError:z().optional()}),Pt=G({requestId:z().min(1),envUri:z().min(1),kind:J([`setup`,`register`,`unregister`,`remove`]),storeId:z().min(1).optional(),observedAt:B().int().nonnegative()}),Ft=K(`status`,[Pt.extend({status:J([`accepted`,`running`]),result:rt().optional()}),Pt.extend({status:J([`succeeded`,`failed`,`indeterminate`]),result:Nt})]);Ft.and(G({rejoined:V()})),K(`type`,[G({type:q(`snapshot`),cursor:B().int().nonnegative(),records:W(Ft)}),G({type:q(`changed`),cursor:B().int().nonnegative(),record:Ft})]);var It=[`notifications.subscribe`,`config.notifications`],Lt=[`stores.inspect`,`stores.mutate`,`contexts.inspect`],Rt=kt,zt=[...Lt,Rt],Bt=G({planningRootPath:z().nullable(),rootSource:ut,storeId:z().nullable(),ready:V()}).passthrough();G({status:q(`ok`),projectDir:z(),projectName:z(),watcherEnabled:V(),openspecuiVersion:z(),hostedShellProtocolVersion:q(1),embeddedUiUrl:z(),runtimeCapabilities:W(J(It)),apiBaseUrl:z().optional(),cliVersion:z().nullable().optional(),envUri:z().optional(),rootSummary:Bt.nullable().optional(),hostedCapabilities:W(J(zt)).optional(),accessGateEnabled:V().optional()}).passthrough();var Vt=G({kind:z(),message:z(),cliVersion:z().optional()}).passthrough(),Ht=G({available:V(),stores:W(St),evidence:U().nullable().optional(),error:Vt.optional(),cliVersion:z().optional()}).passthrough(),Ut=G({available:V(),stores:W(Et),evidence:U().nullable().optional(),error:Vt.optional(),cliVersion:z().optional()}).passthrough(),Wt=X(Ht);X(Ut),X(jt),X(Mt);var Gt=xt,Kt=G({available:V(),version:z().optional(),error:z().optional(),effectiveCommand:z().optional(),tried:W(z()).optional()}).passthrough(),qt=G({success:V(),stdout:z(),stderr:z(),exitCode:B().int().nullable(),diagnostics:W(Y),contractError:z().optional()}).passthrough(),Jt=dt.extend({healthy:V(),status:W(Y)}).passthrough(),Yt=G({role:q(`referenced_store`),id:z(),path:z().optional(),remote:z().optional(),fetch:z().optional(),status:W(Y)}).passthrough(),Xt=G({launchProject:G({path:z(),physicalPath:z().optional()}).passthrough(),planningRoot:Jt.nullable(),storeId:z().nullable(),generation:z().optional(),cli:Kt,references:W(pt),contextMembers:W(Yt),dataScope:G({path:z(),source:J([`xdg-data-home`,`local-app-data`,`user-home-default`]),environmentVariable:J([`XDG_DATA_HOME`,`LOCALAPPDATA`]).nullable()}).passthrough(),diagnostics:G({root:W(Y),doctor:W(Y),context:W(Y)}).passthrough(),evidence:G({doctor:qt.nullable(),context:qt.nullable()}).passthrough(),observedAt:B()}).passthrough(),Zt=J([`cli-unavailable`,`doctor-command-failed`,`doctor-contract-drift`,`root-unresolved`,`root-unhealthy`,`context-command-failed`,`context-contract-drift`,`context-root-mismatch`,`references-unresolved`,`resolver-failed`]),Qt=G({state:q(`loading`),data:H(),attempt:H(),error:H(),observedAt:B()}),$t=G({state:q(`ready`),data:Xt,attempt:H(),error:H(),observedAt:B()}),en=G({state:q(`refreshing`),data:Xt,attempt:H(),error:H(),observedAt:B()}),tn=G({state:q(`error`),data:Xt.nullable(),attempt:Xt,error:G({code:Zt,message:z()}),observedAt:B()}),nn=X(K(`state`,[$t,tn]));K(`state`,[Qt,$t,en,tn]),G({result:G({data:U()}).passthrough()}).passthrough();var rn=`credential`;function an(e){let t=e.trim();if(!t)return null;let n;try{n=new URL(t)}catch{return null}n.hash=``,n.search=``;let r=n.pathname.replace(/\/+$/,``);return n.pathname=r.length>0?r:`/`,n.toString().replace(/\/$/,(n.pathname,``))}function on(e,t){return new URLSearchParams(e).get(t)?.trim()||null}function sn(e){let t=on(e.search,`session`);return{hosted:t!==null,apiBaseUrl:an(on(e.search,`api`)??``),sessionId:t}}function cn(e,t){let n=sn(t);return n.hosted&&n.sessionId?`hosted-session:${n.sessionId}:${e}`:e}function ln(){return typeof window<`u`&&window.location!==void 0}function un(){return ln()?sn(window.location):{hosted:!1,apiBaseUrl:null,sessionId:null}}function Q(){return ln()?un().apiBaseUrl??``:``}function dn(e){if(!ln())return``;let t=Q();if(t){let n=new URL(t);return`${n.protocol===`https:`?`wss:`:`ws:`}//${n.host}${e}`}return`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}${e}`}function fn(){return dn(`/trpc`)}function pn(){return dn(`/ws/pty`)}function mn(){let e=Q();return e?`${e}/trpc`:`/trpc`}function hn(){let e=Q();return e?`${e}/api/health`:`/api/health`}var gn=`openspecui:access-gate-credential-response`,_n=null,vn=!1;function yn(){return typeof window<`u`&&window.location!==void 0}function bn(e){let t=new URLSearchParams(e.hash.slice(1)),n=t.get(rn);if(n===null)return!1;n.length>0&&(_n=n),t.delete(rn);let r=t.toString();return e.hash=r?`#${r}`:``,!0}function xn(){if(!yn())return _n;let e=new URL(window.location.href);return bn(e)&&window.history.replaceState({},``,`${e.pathname}${e.search}${e.hash}`),_n}function Sn(){return xn()}function Cn(){let e=Sn();return e?`Bearer ${e}`:null}function wn(e){return e===`/api`||e.startsWith(`/api/`)||e===`/trpc`||e.startsWith(`/trpc/`)}function Tn(e){if(!yn())return null;let t=e instanceof Request?e.url:e instanceof URL?e.toString():e;try{return new URL(t,window.location.href)}catch{return null}}function En(e){let t=Tn(e);if(!t||!wn(t.pathname))return!1;let n=Q(),r=n?new URL(n).origin:window.location.origin;return t.origin===r}function Dn(e,t){let n=Cn();if(!n||!En(e))return fetch(e,t);let r=new Headers(t?.headers??(e instanceof Request?e.headers:void 0));return r.has(`Authorization`)||r.set(`Authorization`,n),fetch(e,{...t,headers:r})}function On(e=navigator.serviceWorker){vn||(vn=!0,e.addEventListener(`message`,e=>{let t=e,n=t.data;if(typeof n!=`object`||!n||n.type!==`openspecui:access-gate-credential-request`)return;let r=t.ports[0];r&&r.postMessage({type:gn,authorization:Cn()})}))}async function kn(e){e.controller||await new Promise((t,n)=>{let r=window.setTimeout(()=>{e.removeEventListener(`controllerchange`,i),n(Error(`Access Gate resource worker did not take control.`))},5e3),i=()=>{window.clearTimeout(r),e.removeEventListener(`controllerchange`,i),t()};e.addEventListener(`controllerchange`,i)})}async function An(e=navigator.serviceWorker){Sn()&&(On(e),await e.register(`/access-gate-resource-worker.js`,{scope:`/`,type:`module`}),await e.ready,await kn(e))}var $=null;typeof window<`u`&&window.__OPENSPEC_STATIC_MODE__===!0&&($=!0,console.log(`[static-mode] Detected static export mode (via flag)`));async function jn(){return $===null&&($=typeof window<`u`&&window.__OPENSPEC_STATIC_MODE__===!0),$}function Mn(){return $===!0}function Nn(e){$=e}var Pn=null;function Fn(){return Pn===null?typeof window<`u`&&window.__OPENSPEC_BASE_PATH__||`./`:Pn}function In(){return typeof window<`u`&&window.__INITIAL_DATA__?window.__INITIAL_DATA__:null}var Ln=n(),Rn=()=>{let e=document.getElementById(`root`);return e&&e.innerHTML.trim().length>0},zn=()=>typeof window<`u`&&window.__OPENSPEC_STATIC_MODE__===!0;async function Bn(e,t){let{HostedConnectionState:n}=await r(async()=>{let{HostedConnectionState:e}=await import(`./hosted-connection-state-BYVOLSii.js`);return{HostedConnectionState:e}},__vite__mapDeps([0,1,2]));(0,lt.createRoot)(e).render((0,Ln.jsx)(n,{...t}))}async function Vn(){try{let e=await Dn(hn());return e.ok?null:e.status===401||e.status===403?{title:`Authentication Required`,message:`This Project Web session does not have a valid backend credential.`}:{title:`Project Web Unavailable`,message:`Backend admission failed with ${e.status} ${e.statusText||`Unknown Error`}.`,onRetry:()=>window.location.reload()}}catch(e){return{title:`Project Web Unavailable`,message:e instanceof Error?e.message:String(e),onRetry:()=>window.location.reload()}}}async function Hn(){let e=document.getElementById(`root`);if(xn()){if(!(`serviceWorker`in navigator)){await Bn(e,{title:`Protected Session Unavailable`,message:`This browser cannot install the transient protected-resource transport.`});return}try{await An(navigator.serviceWorker)}catch(t){await Bn(e,{title:`Protected Session Unavailable`,message:t instanceof Error?t.message:String(t)});return}}let t=un();if(t.hosted&&!t.apiBaseUrl){await Bn(e,{title:`Hosted Session Not Connected`,message:`This embedded UI session needs explicit api and session query parameters.`});return}let n=zn()||await jn();if(Nn(n),n)console.log(`[OpenSpec UI] Running in static mode`);else{let t=await Vn();if(t){await Bn(e,t);return}}let{App:i}=await r(async()=>{let{App:e}=await import(`./App-DJc144W-.js`);return{App:e}},__vite__mapDeps([3,2,4,5,6,7,1,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]));Rn()&&n?(console.log(`[OpenSpec UI] Hydrating pre-rendered content`),(0,lt.hydrateRoot)(e,(0,Ln.jsx)(i,{}))):(console.log(`[OpenSpec UI] Fresh render`),(0,lt.createRoot)(e).render((0,Ln.jsx)(i,{})))}Hn();export{J as A,it as B,pt as C,V as D,W as E,G as F,c as H,ct as I,ot as L,q as M,H as N,nt as O,B as P,z as R,Y as S,dt as T,U as V,Wt as _,Cn as a,X as b,hn as c,fn as d,sn as f,nn as g,Gt as h,Dn as i,st as j,K as k,pn as l,rn as m,In as n,Sn as o,cn as p,Mn as r,Q as s,Fn as t,mn as u,_t as v,mt as w,ht as x,xt as y,at as z};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/hosted-connection-state-BYVOLSii.js","assets/jsx-runtime-B5X0rzej.js","assets/chunk-VBW0iQ51.js","assets/App-Dmag08k5.js","assets/preload-helper-qlgyTAkD.js","assets/ToolbarRootContext-DJ7ICfbj.js","assets/react-dom-DGmpTSTt.js","assets/react-w0ynVMNy.js","assets/dist-BM1p13VL.js","assets/dist-BjgzTMjG.js","assets/dist-DOslja1j.js","assets/dist-BElax2Cc.js","assets/dist-B_gB7iV-.js","assets/dist-BTEspn1S.js","assets/dist-BPqKJ2jd.js","assets/dist-B_cOSPGy.js","assets/Geometry-DnX4RiLB.js","assets/trpc-CENMN-Kx.js","assets/RenderTargetSystem-DNBcF83q.js","assets/CanvasRenderer-frZG-e8U.js","assets/getTextureBatchBindGroup-BBz5dgEf.js","assets/ImageSource-D9b88hVS.js","assets/FilterSystem-DGEzd4r7.js","assets/WebGPURenderer-rPgcvLqV.js","assets/BufferResource-TFXpqlS4.js","assets/App-BagQkLCd.css"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./chunk-VBW0iQ51.js";import"./modulepreload-polyfill-CXK8biUa.js";import{t}from"./client-pO1cwWkl.js";import"./react-w0ynVMNy.js";import"./react-dom-DGmpTSTt.js";import{t as n}from"./jsx-runtime-B5X0rzej.js";import{t as r}from"./preload-helper-qlgyTAkD.js";var i;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(i||={});var a;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(a||={});var o=i.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),s=e=>{switch(typeof e){case`undefined`:return o.undefined;case`string`:return o.string;case`number`:return Number.isNaN(e)?o.nan:o.number;case`boolean`:return o.boolean;case`function`:return o.function;case`bigint`:return o.bigint;case`symbol`:return o.symbol;case`object`:return Array.isArray(e)?o.array:e===null?o.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?o.promise:typeof Map<`u`&&e instanceof Map?o.map:typeof Set<`u`&&e instanceof Set?o.set:typeof Date<`u`&&e instanceof Date?o.date:o.object;default:return o.unknown}},c=i.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),l=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,i.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};l.create=e=>new l(e);var u=(e,t)=>{let n;switch(e.code){case c.invalid_type:n=e.received===o.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case c.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,i.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:n=`Unrecognized key(s) in object: ${i.joinValues(e.keys,`, `)}`;break;case c.invalid_union:n=`Invalid input`;break;case c.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${i.joinValues(e.options)}`;break;case c.invalid_enum_value:n=`Invalid enum value. Expected ${i.joinValues(e.options)}, received '${e.received}'`;break;case c.invalid_arguments:n=`Invalid function arguments`;break;case c.invalid_return_type:n=`Invalid function return type`;break;case c.invalid_date:n=`Invalid date`;break;case c.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:i.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case c.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case c.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case c.custom:n=`Invalid input`;break;case c.invalid_intersection_types:n=`Intersection results could not be merged`;break;case c.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case c.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,i.assertNever(e)}return{message:n}},ee=u;function te(){return ee}var ne=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function d(e,t){let n=te(),r=ne({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===u?void 0:u].filter(e=>!!e)});e.common.issues.push(r)}var f=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return p;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return p;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},p=Object.freeze({status:`aborted`}),re=e=>({status:`dirty`,value:e}),m=e=>({status:`valid`,value:e}),ie=e=>e.status===`aborted`,ae=e=>e.status===`dirty`,h=e=>e.status===`valid`,g=e=>typeof Promise<`u`&&e instanceof Promise,_;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(_||={});var v=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},oe=(e,t)=>{if(h(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){return this._error||=new l(e.common.issues),this._error}}};function y(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var b=class{get description(){return this._def.description}_getType(e){return s(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:s(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new f,ctx:{common:e.parent.common,data:e.data,parsedType:s(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(g(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:s(e)};return oe(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:s(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return h(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>h(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:s(e)},r=this._parse({data:e,path:n.path,parent:n});return oe(n,await(g(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:c.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new M({schema:this,typeName:R.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return N.create(this,this._def)}nullable(){return P.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return w.create(this)}promise(){return j.create(this,this._def)}or(e){return D.create([this,e],this._def)}and(e){return k.create(this,e,this._def)}transform(e){return new M({...y(this._def),schema:this,typeName:R.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new F({...y(this._def),innerType:this,defaultValue:t,typeName:R.ZodDefault})}brand(){return new $e({typeName:R.ZodBranded,type:this,...y(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new I({...y(this._def),innerType:this,catchValue:t,typeName:R.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return et.create(this,e)}readonly(){return L.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},se=/^c[^\s-]{8,}$/i,ce=/^[0-9a-z]+$/,le=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ue=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,de=/^[a-z0-9_-]{21}$/i,fe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,me=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,he=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,ge,_e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ve=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ye=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,be=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Se=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ce=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,we=RegExp(`^${Ce}$`);function Te(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Ee(e){return RegExp(`^${Te(e)}$`)}function De(e){let t=`${Ce}T${Te(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Oe(e,t){return!!((t===`v4`||!t)&&_e.test(e)||(t===`v6`||!t)&&ye.test(e))}function ke(e,t){if(!fe.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Ae(e,t){return!!((t===`v4`||!t)&&ve.test(e)||(t===`v6`||!t)&&be.test(e))}var je=class e extends b{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==o.string){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.string,received:t.parsedType}),p}let t=new f,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?d(n,{code:c.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&d(n,{code:c.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)me.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`email`,code:c.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)ge||=new RegExp(he,`u`),ge.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`emoji`,code:c.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)ue.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`uuid`,code:c.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)de.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`nanoid`,code:c.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)se.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`cuid`,code:c.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)ce.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`cuid2`,code:c.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)le.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`ulid`,code:c.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),d(n,{validation:`url`,code:c.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`regex`,code:c.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?De(r).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?we.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?Ee(r).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?pe.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`duration`,code:c.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Oe(e.data,r.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`ip`,code:c.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?ke(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`jwt`,code:c.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?Ae(e.data,r.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`cidr`,code:c.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?xe.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`base64`,code:c.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Se.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:`base64url`,code:c.invalid_string,message:r.message}),t.dirty()):i.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:c.invalid_string,..._.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,..._.errToObj(e)})}url(e){return this._addCheck({kind:`url`,..._.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,..._.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,..._.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,..._.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,..._.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,..._.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,..._.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,..._.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,..._.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,..._.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,..._.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,..._.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,..._.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,..._.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,..._.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,..._.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,..._.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,..._.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,..._.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,..._.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,..._.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,..._.errToObj(t)})}nonempty(e){return this.min(1,_.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};je.create=e=>new je({checks:[],typeName:R.ZodString,coerce:e?.coerce??!1,...y(e)});function Me(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var Ne=class e extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==o.number){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.number,received:t.parsedType}),p}let t,n=new f;for(let r of this._def.checks)r.kind===`int`?i.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),d(t,{code:c.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),d(t,{code:c.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),d(t,{code:c.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?Me(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),d(t,{code:c.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),d(t,{code:c.not_finite,message:r.message}),n.dirty()):i.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,_.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,_.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,_.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,_.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:_.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:_.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:_.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:_.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:_.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:_.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&i.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};Ne.create=e=>new Ne({checks:[],typeName:R.ZodNumber,coerce:e?.coerce||!1,...y(e)});var Pe=class e extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==o.bigint)return this._getInvalidInput(e);let t,n=new f;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),d(t,{code:c.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),d(t,{code:c.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),d(t,{code:c.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):i.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.bigint,received:t.parsedType}),p}gte(e,t){return this.setLimit(`min`,e,!0,_.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,_.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,_.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,_.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:_.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:_.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Pe.create=e=>new Pe({checks:[],typeName:R.ZodBigInt,coerce:e?.coerce??!1,...y(e)});var Fe=class extends b{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==o.boolean){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.boolean,received:t.parsedType}),p}return m(e.data)}};Fe.create=e=>new Fe({typeName:R.ZodBoolean,coerce:e?.coerce||!1,...y(e)});var Ie=class e extends b{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==o.date){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.date,received:t.parsedType}),p}if(Number.isNaN(e.data.getTime()))return d(this._getOrReturnCtx(e),{code:c.invalid_date}),p;let t=new f,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):i.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:_.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:_.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};Ie.create=e=>new Ie({checks:[],coerce:e?.coerce||!1,typeName:R.ZodDate,...y(e)});var Le=class extends b{_parse(e){if(this._getType(e)!==o.symbol){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.symbol,received:t.parsedType}),p}return m(e.data)}};Le.create=e=>new Le({typeName:R.ZodSymbol,...y(e)});var Re=class extends b{_parse(e){if(this._getType(e)!==o.undefined){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.undefined,received:t.parsedType}),p}return m(e.data)}};Re.create=e=>new Re({typeName:R.ZodUndefined,...y(e)});var ze=class extends b{_parse(e){if(this._getType(e)!==o.null){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.null,received:t.parsedType}),p}return m(e.data)}};ze.create=e=>new ze({typeName:R.ZodNull,...y(e)});var x=class extends b{constructor(){super(...arguments),this._any=!0}_parse(e){return m(e.data)}};x.create=e=>new x({typeName:R.ZodAny,...y(e)});var S=class extends b{constructor(){super(...arguments),this._unknown=!0}_parse(e){return m(e.data)}};S.create=e=>new S({typeName:R.ZodUnknown,...y(e)});var C=class extends b{_parse(e){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.never,received:t.parsedType}),p}};C.create=e=>new C({typeName:R.ZodNever,...y(e)});var Be=class extends b{_parse(e){if(this._getType(e)!==o.undefined){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.void,received:t.parsedType}),p}return m(e.data)}};Be.create=e=>new Be({typeName:R.ZodVoid,...y(e)});var w=class e extends b{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==o.array)return d(t,{code:c.invalid_type,expected:o.array,received:t.parsedType}),p;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(d(t,{code:e?c.too_big:c.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(d(t,{code:c.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(d(t,{code:c.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new v(t,e,t.path,n)))).then(e=>f.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new v(t,e,t.path,n)));return f.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:_.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:_.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:_.toString(n)}})}nonempty(e){return this.min(1,e)}};w.create=(e,t)=>new w({type:e,minLength:null,maxLength:null,exactLength:null,typeName:R.ZodArray,...y(t)});function T(e){if(e instanceof E){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=N.create(T(r))}return new E({...e._def,shape:()=>t})}else if(e instanceof w)return new w({...e._def,type:T(e.element)});else if(e instanceof N)return N.create(T(e.unwrap()));else if(e instanceof P)return P.create(T(e.unwrap()));else if(e instanceof A)return A.create(e.items.map(e=>T(e)));else return e}var E=class e extends b{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:i.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==o.object){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.object,received:t.parsedType}),p}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof C&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let s=[];for(let e of i){let t=r[e],i=n.data[e];s.push({key:{status:`valid`,value:e},value:t._parse(new v(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof C){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)s.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(d(n,{code:c.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];s.push({key:{status:`valid`,value:t},value:e._parse(new v(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of s){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>f.mergeObjectSync(t,e)):f.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(t){return _.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:_.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:R.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of i.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of i.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return T(this)}partial(t){let n={};for(let e of i.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of i.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof N;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Ye(i.objectKeys(this.shape))}};E.create=(e,t)=>new E({shape:()=>e,unknownKeys:`strip`,catchall:C.create(),typeName:R.ZodObject,...y(t)}),E.strictCreate=(e,t)=>new E({shape:()=>e,unknownKeys:`strict`,catchall:C.create(),typeName:R.ZodObject,...y(t)}),E.lazycreate=(e,t)=>new E({shape:e,unknownKeys:`strip`,catchall:C.create(),typeName:R.ZodObject,...y(t)});var D=class extends b{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new l(e.ctx.common.issues));return d(t,{code:c.invalid_union,unionErrors:n}),p}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new l(e));return d(t,{code:c.invalid_union,unionErrors:i}),p}}get options(){return this._def.options}};D.create=(e,t)=>new D({options:e,typeName:R.ZodUnion,...y(t)});var O=e=>e instanceof qe?O(e.schema):e instanceof M?O(e.innerType()):e instanceof Je?[e.value]:e instanceof Xe?e.options:e instanceof Ze?i.objectValues(e.enum):e instanceof F?O(e._def.innerType):e instanceof Re?[void 0]:e instanceof ze?[null]:e instanceof N?[void 0,...O(e.unwrap())]:e instanceof P?[null,...O(e.unwrap())]:e instanceof $e||e instanceof L?O(e.unwrap()):e instanceof I?O(e._def.innerType):[],Ve=class e extends b{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==o.object)return d(t,{code:c.invalid_type,expected:o.object,received:t.parsedType}),p;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(d(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),p)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=O(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:R.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...y(r)})}};function He(e,t){let n=s(e),r=s(t);if(e===t)return{valid:!0,data:e};if(n===o.object&&r===o.object){let n=i.objectKeys(t),r=i.objectKeys(e).filter(e=>n.indexOf(e)!==-1),a={...e,...t};for(let n of r){let r=He(e[n],t[n]);if(!r.valid)return{valid:!1};a[n]=r.data}return{valid:!0,data:a}}else if(n===o.array&&r===o.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=He(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===o.date&&r===o.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var k=class extends b{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(ie(e)||ie(r))return p;let i=He(e.value,r.value);return i.valid?((ae(e)||ae(r))&&t.dirty(),{status:t.value,value:i.data}):(d(n,{code:c.invalid_intersection_types}),p)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};k.create=(e,t,n)=>new k({left:e,right:t,typeName:R.ZodIntersection,...y(n)});var A=class e extends b{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==o.array)return d(n,{code:c.invalid_type,expected:o.array,received:n.parsedType}),p;if(n.data.length<this._def.items.length)return d(n,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),p;!this._def.rest&&n.data.length>this._def.items.length&&(d(n,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new v(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>f.mergeArray(t,e)):f.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};A.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new A({items:e,typeName:R.ZodTuple,rest:null,...y(t)})};var Ue=class e extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==o.object)return d(n,{code:c.invalid_type,expected:o.object,received:n.parsedType}),p;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new v(n,e,n.path,e)),value:a._parse(new v(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?f.mergeObjectAsync(t,r):f.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof b?new e({keyType:t,valueType:n,typeName:R.ZodRecord,...y(r)}):new e({keyType:je.create(),valueType:t,typeName:R.ZodRecord,...y(n)})}},We=class extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==o.map)return d(n,{code:c.invalid_type,expected:o.map,received:n.parsedType}),p;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new v(n,e,n.path,[a,`key`])),value:i._parse(new v(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return p;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return p;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};We.create=(e,t,n)=>new We({valueType:t,keyType:e,typeName:R.ZodMap,...y(n)});var Ge=class e extends b{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==o.set)return d(n,{code:c.invalid_type,expected:o.set,received:n.parsedType}),p;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(d(n,{code:c.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(d(n,{code:c.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return p;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let s=[...n.data.values()].map((e,t)=>i._parse(new v(n,e,n.path,t)));return n.common.async?Promise.all(s).then(e=>a(e)):a(s)}min(t,n){return new e({...this._def,minSize:{value:t,message:_.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:_.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Ge.create=(e,t)=>new Ge({valueType:e,minSize:null,maxSize:null,typeName:R.ZodSet,...y(t)});var Ke=class e extends b{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==o.function)return d(t,{code:c.invalid_type,expected:o.function,received:t.parsedType}),p;function n(e,n){return ne({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,te(),u].filter(e=>!!e),issueData:{code:c.invalid_arguments,argumentsError:n}})}function r(e,n){return ne({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,te(),u].filter(e=>!!e),issueData:{code:c.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof j){let e=this;return m(async function(...t){let o=new l([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return m(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new l([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new l([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:A.create(t).rest(S.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||A.create([]).rest(S.create()),returns:n||S.create(),typeName:R.ZodFunction,...y(r)})}},qe=class extends b{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};qe.create=(e,t)=>new qe({getter:e,typeName:R.ZodLazy,...y(t)});var Je=class extends b{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return d(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),p}return{status:`valid`,value:e.data}}get value(){return this._def.value}};Je.create=(e,t)=>new Je({value:e,typeName:R.ZodLiteral,...y(t)});function Ye(e,t){return new Xe({values:e,typeName:R.ZodEnum,...y(t)})}var Xe=class e extends b{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return d(t,{expected:i.joinValues(n),received:t.parsedType,code:c.invalid_type}),p}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return d(t,{received:t.data,code:c.invalid_enum_value,options:n}),p}return m(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};Xe.create=Ye;var Ze=class extends b{_parse(e){let t=i.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==o.string&&n.parsedType!==o.number){let e=i.objectValues(t);return d(n,{expected:i.joinValues(e),received:n.parsedType,code:c.invalid_type}),p}if(this._cache||=new Set(i.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=i.objectValues(t);return d(n,{received:n.data,code:c.invalid_enum_value,options:e}),p}return m(e.data)}get enum(){return this._def.values}};Ze.create=(e,t)=>new Ze({values:e,typeName:R.ZodNativeEnum,...y(t)});var j=class extends b{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==o.promise&&t.common.async===!1?(d(t,{code:c.invalid_type,expected:o.promise,received:t.parsedType}),p):m((t.parsedType===o.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};j.create=(e,t)=>new j({type:e,typeName:R.ZodPromise,...y(t)});var M=class extends b{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:e=>{d(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),r.type===`preprocess`){let e=r.transform(n.data,a);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return p;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?p:r.status===`dirty`||t.value===`dirty`?re(r.value):r});{if(t.value===`aborted`)return p;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?p:r.status===`dirty`||t.value===`dirty`?re(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,a);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?p:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?p:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!h(e))return p;let i=r.transform(e.value,a);if(i instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>h(e)?Promise.resolve(r.transform(e.value,a)).then(e=>({status:t.value,value:e})):p);i.assertNever(r)}};M.create=(e,t,n)=>new M({schema:e,typeName:R.ZodEffects,effect:t,...y(n)}),M.createWithPreprocess=(e,t,n)=>new M({schema:t,effect:{type:`preprocess`,transform:e},typeName:R.ZodEffects,...y(n)});var N=class extends b{_parse(e){return this._getType(e)===o.undefined?m(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};N.create=(e,t)=>new N({innerType:e,typeName:R.ZodOptional,...y(t)});var P=class extends b{_parse(e){return this._getType(e)===o.null?m(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};P.create=(e,t)=>new P({innerType:e,typeName:R.ZodNullable,...y(t)});var F=class extends b{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===o.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};F.create=(e,t)=>new F({innerType:e,typeName:R.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...y(t)});var I=class extends b{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return g(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new l(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new l(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};I.create=(e,t)=>new I({innerType:e,typeName:R.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...y(t)});var Qe=class extends b{_parse(e){if(this._getType(e)!==o.nan){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:o.nan,received:t.parsedType}),p}return{status:`valid`,value:e.data}}};Qe.create=e=>new Qe({typeName:R.ZodNaN,...y(e)});var $e=class extends b{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},et=class e extends b{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?p:e.status===`dirty`?(t.dirty(),re(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?p:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:R.ZodPipeline})}},L=class extends b{_parse(e){let t=this._def.innerType._parse(e),n=e=>(h(e)&&(e.value=Object.freeze(e.value)),e);return g(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};L.create=(e,t)=>new L({innerType:e,typeName:R.ZodReadonly,...y(t)});function tt(e,t){let n=typeof e==`function`?e(t):typeof e==`string`?{message:e}:e;return typeof n==`string`?{message:n}:n}function nt(e,t={},n){return e?x.create().superRefine((r,i)=>{let a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){let e=tt(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}});if(!a){let e=tt(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}}):x.create()}E.lazycreate;var R;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(R||={});var z=je.create,B=Ne.create;Qe.create,Pe.create;var V=Fe.create;Ie.create,Le.create;var rt=Re.create,H=ze.create;x.create;var U=S.create;C.create,Be.create;var W=w.create,G=E.create;E.strictCreate;var it=D.create,K=Ve.create;k.create;var at=A.create,ot=Ue.create;We.create,Ge.create,Ke.create;var st=qe.create,q=Je.create,J=Xe.create;Ze.create,j.create,M.create,N.create,P.create;var ct=M.createWithPreprocess;et.create;var lt=e(t(),1),Y=G({severity:J([`error`,`warning`,`info`]),code:z(),message:z(),target:z().optional(),fix:z().optional()}).passthrough(),ut=J([`store`,`declared`,`nearest`,`global_default`,`implicit`]),dt=G({path:z(),source:ut,store_id:z().optional()}).passthrough(),ft=G({id:z(),summary:z()}).passthrough(),pt=G({store_id:z(),root:z().optional(),status:W(Y)}).passthrough(),mt=pt.extend({specs:W(ft).optional(),fetch:z().optional()}).passthrough(),ht=G({status:W(Y).min(1)}).passthrough(),gt=st(()=>it([z(),B(),V(),H(),W(gt),ot(z(),gt)])),_t=G({success:V(),stdout:z(),stderr:z(),exitCode:B().int().nullable(),payload:gt.nullable(),diagnostics:W(Y),contractError:z().optional()}),vt=G({name:z(),message:z(),cliEvidence:_t.nullable()}),yt=J([`loading`,`ready`,`revalidating`,`error`,`refresh-error`]),bt=J([`initial`,`dependency`,`explicit-refresh`,`subscriber-resume`]);function X(e){let t={identity:z().min(1),workGeneration:B().int().nonnegative(),invalidationCause:bt};return K(`state`,[G({...t,state:q(`loading`),data:H(),freshness:H(),snapshotGeneration:H(),error:H()}),G({...t,state:q(`ready`),data:e,freshness:q(`current`),snapshotGeneration:B().int().nonnegative(),error:H()}),G({...t,state:q(`revalidating`),data:e,freshness:q(`stale-display-only`),snapshotGeneration:B().int().nonnegative(),error:H()}),G({...t,state:q(`error`),data:H(),freshness:H(),snapshotGeneration:H(),error:vt}),G({...t,state:q(`refresh-error`),data:e,freshness:q(`stale-display-only`),snapshotGeneration:B().int().nonnegative(),error:vt})])}var xt=G({identity:z().min(1),workGeneration:B().int().nonnegative(),snapshotGeneration:B().int().nonnegative().nullable(),state:yt,invalidationCause:bt}),Z=G({severity:z().optional(),code:z().optional(),message:z().optional(),target:z().optional(),fix:z().optional()}).passthrough(),St=G({id:z(),root:z()}).passthrough();G({stores:W(St).default([]),status:W(Z).optional()}).passthrough();var Ct=G({present:V().nullable().optional(),healthy:V().nullable().optional()}).passthrough(),wt=G({present:V().nullable().optional(),valid:V().nullable().optional(),id:z().nullable().optional(),remote:z().nullable().optional()}).passthrough(),Tt=G({is_repository:V().nullable().optional(),has_commits:V().nullable().optional(),has_uncommitted_changes:V().nullable().optional(),has_remote:V().nullable().optional(),origin_url:z().nullable().optional()}).passthrough(),Et=G({id:z().optional(),root:z().optional(),metadata_path:z().nullable().optional(),openspec_root:Ct.optional(),metadata:wt.optional(),git:Tt.optional(),status:W(Z).optional()}).passthrough();G({stores:W(Et).default([]),status:W(Z).optional()}).passthrough();var Dt=G({id:z(),requirementCount:B()}).passthrough(),Ot=G({name:z(),completedTasks:B(),totalTasks:B(),lastModified:z(),status:J([`no-tasks`,`complete`,`in-progress`])}).passthrough();G({specs:W(Dt).default([]),status:W(Z).optional()}).passthrough(),G({changes:W(Ot).default([]),status:W(Z).optional()}).passthrough(),J([`specs`,`changes`]);var kt=`stores.content.inspect`,At=G({kind:z(),message:z(),cliVersion:z().optional()}).passthrough(),jt=G({available:V(),specs:W(Dt),storeId:z(),evidence:U().nullable().optional(),error:At.optional(),cliVersion:z().optional()}).passthrough(),Mt=G({available:V(),changes:W(Ot),storeId:z(),evidence:U().nullable().optional(),error:At.optional(),cliVersion:z().optional()}).passthrough(),Nt=G({exitStatus:B().int().nullable(),stdout:z().optional(),stderr:z().optional(),diagnostics:W(Y).optional(),payload:U().optional(),contractError:z().optional()}),Pt=G({requestId:z().min(1),envUri:z().min(1),kind:J([`setup`,`register`,`unregister`,`remove`]),storeId:z().min(1).optional(),observedAt:B().int().nonnegative()}),Ft=K(`status`,[Pt.extend({status:J([`accepted`,`running`]),result:rt().optional()}),Pt.extend({status:J([`succeeded`,`failed`,`indeterminate`]),result:Nt})]);Ft.and(G({rejoined:V()})),K(`type`,[G({type:q(`snapshot`),cursor:B().int().nonnegative(),records:W(Ft)}),G({type:q(`changed`),cursor:B().int().nonnegative(),record:Ft})]);var It=[`notifications.subscribe`,`config.notifications`],Lt=[`stores.inspect`,`stores.mutate`,`contexts.inspect`],Rt=kt,zt=[...Lt,Rt],Bt=G({planningRootPath:z().nullable(),rootSource:ut,storeId:z().nullable(),ready:V()}).passthrough();G({status:q(`ok`),projectDir:z(),projectName:z(),watcherEnabled:V(),openspecuiVersion:z(),hostedShellProtocolVersion:q(1),embeddedUiUrl:z(),runtimeCapabilities:W(J(It)),apiBaseUrl:z().optional(),cliVersion:z().nullable().optional(),envUri:z().optional(),rootSummary:Bt.nullable().optional(),hostedCapabilities:W(J(zt)).optional(),accessGateEnabled:V().optional()}).passthrough();var Vt=G({kind:z(),message:z(),cliVersion:z().optional()}).passthrough(),Ht=G({available:V(),stores:W(St),evidence:U().nullable().optional(),error:Vt.optional(),cliVersion:z().optional()}).passthrough(),Ut=G({available:V(),stores:W(Et),evidence:U().nullable().optional(),error:Vt.optional(),cliVersion:z().optional()}).passthrough(),Wt=X(Ht);X(Ut),X(jt),X(Mt);var Gt=xt,Kt=G({available:V(),version:z().optional(),error:z().optional(),effectiveCommand:z().optional(),tried:W(z()).optional()}).passthrough(),qt=G({success:V(),stdout:z(),stderr:z(),exitCode:B().int().nullable(),diagnostics:W(Y),contractError:z().optional()}).passthrough(),Jt=dt.extend({healthy:V(),status:W(Y)}).passthrough(),Yt=G({role:q(`referenced_store`),id:z(),path:z().optional(),remote:z().optional(),fetch:z().optional(),status:W(Y)}).passthrough(),Xt=G({launchProject:G({path:z(),physicalPath:z().optional()}).passthrough(),planningRoot:Jt.nullable(),storeId:z().nullable(),generation:z().optional(),cli:Kt,references:W(pt),contextMembers:W(Yt),dataScope:G({path:z(),source:J([`xdg-data-home`,`local-app-data`,`user-home-default`]),environmentVariable:J([`XDG_DATA_HOME`,`LOCALAPPDATA`]).nullable()}).passthrough(),diagnostics:G({root:W(Y),doctor:W(Y),context:W(Y)}).passthrough(),evidence:G({doctor:qt.nullable(),context:qt.nullable()}).passthrough(),observedAt:B()}).passthrough(),Zt=J([`cli-unavailable`,`doctor-command-failed`,`doctor-contract-drift`,`root-unresolved`,`root-unhealthy`,`context-command-failed`,`context-contract-drift`,`context-root-mismatch`,`references-unresolved`,`resolver-failed`]),Qt=G({state:q(`loading`),data:H(),attempt:H(),error:H(),observedAt:B()}),$t=G({state:q(`ready`),data:Xt,attempt:H(),error:H(),observedAt:B()}),en=G({state:q(`refreshing`),data:Xt,attempt:H(),error:H(),observedAt:B()}),tn=G({state:q(`error`),data:Xt.nullable(),attempt:Xt,error:G({code:Zt,message:z()}),observedAt:B()}),nn=X(K(`state`,[$t,tn]));K(`state`,[Qt,$t,en,tn]),G({result:G({data:U()}).passthrough()}).passthrough();var rn=`credential`;function an(e){let t=e.trim();if(!t)return null;let n;try{n=new URL(t)}catch{return null}n.hash=``,n.search=``;let r=n.pathname.replace(/\/+$/,``);return n.pathname=r.length>0?r:`/`,n.toString().replace(/\/$/,(n.pathname,``))}function on(e,t){return new URLSearchParams(e).get(t)?.trim()||null}function sn(e){let t=on(e.search,`session`);return{hosted:t!==null,apiBaseUrl:an(on(e.search,`api`)??``),sessionId:t}}function cn(e,t){let n=sn(t);return n.hosted&&n.sessionId?`hosted-session:${n.sessionId}:${e}`:e}function ln(){return typeof window<`u`&&window.location!==void 0}function un(){return ln()?sn(window.location):{hosted:!1,apiBaseUrl:null,sessionId:null}}function Q(){return ln()?un().apiBaseUrl??``:``}function dn(e){if(!ln())return``;let t=Q();if(t){let n=new URL(t);return`${n.protocol===`https:`?`wss:`:`ws:`}//${n.host}${e}`}return`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}${e}`}function fn(){return dn(`/trpc`)}function pn(){return dn(`/ws/pty`)}function mn(){let e=Q();return e?`${e}/trpc`:`/trpc`}function hn(){let e=Q();return e?`${e}/api/health`:`/api/health`}var gn=`openspecui:access-gate-credential-response`,_n=null,vn=!1;function yn(){return typeof window<`u`&&window.location!==void 0}function bn(e){let t=new URLSearchParams(e.hash.slice(1)),n=t.get(rn);if(n===null)return!1;n.length>0&&(_n=n),t.delete(rn);let r=t.toString();return e.hash=r?`#${r}`:``,!0}function xn(){if(!yn())return _n;let e=new URL(window.location.href);return bn(e)&&window.history.replaceState({},``,`${e.pathname}${e.search}${e.hash}`),_n}function Sn(){return xn()}function Cn(){let e=Sn();return e?`Bearer ${e}`:null}function wn(e){return e===`/api`||e.startsWith(`/api/`)||e===`/trpc`||e.startsWith(`/trpc/`)}function Tn(e){if(!yn())return null;let t=e instanceof Request?e.url:e instanceof URL?e.toString():e;try{return new URL(t,window.location.href)}catch{return null}}function En(e){let t=Tn(e);if(!t||!wn(t.pathname))return!1;let n=Q(),r=n?new URL(n).origin:window.location.origin;return t.origin===r}function Dn(e,t){let n=Cn();if(!n||!En(e))return fetch(e,t);let r=new Headers(t?.headers??(e instanceof Request?e.headers:void 0));return r.has(`Authorization`)||r.set(`Authorization`,n),fetch(e,{...t,headers:r})}function On(e=navigator.serviceWorker){vn||(vn=!0,e.addEventListener(`message`,e=>{let t=e,n=t.data;if(typeof n!=`object`||!n||n.type!==`openspecui:access-gate-credential-request`)return;let r=t.ports[0];r&&r.postMessage({type:gn,authorization:Cn()})}))}async function kn(e){e.controller||await new Promise((t,n)=>{let r=window.setTimeout(()=>{e.removeEventListener(`controllerchange`,i),n(Error(`Access Gate resource worker did not take control.`))},5e3),i=()=>{window.clearTimeout(r),e.removeEventListener(`controllerchange`,i),t()};e.addEventListener(`controllerchange`,i)})}async function An(e=navigator.serviceWorker){Sn()&&(On(e),await e.register(`/access-gate-resource-worker.js`,{scope:`/`,type:`module`}),await e.ready,await kn(e))}var $=null;typeof window<`u`&&window.__OPENSPEC_STATIC_MODE__===!0&&($=!0,console.log(`[static-mode] Detected static export mode (via flag)`));async function jn(){return $===null&&($=typeof window<`u`&&window.__OPENSPEC_STATIC_MODE__===!0),$}function Mn(){return $===!0}function Nn(e){$=e}var Pn=null;function Fn(){return Pn===null?typeof window<`u`&&window.__OPENSPEC_BASE_PATH__||`./`:Pn}function In(){return typeof window<`u`&&window.__INITIAL_DATA__?window.__INITIAL_DATA__:null}var Ln=n(),Rn=()=>{let e=document.getElementById(`root`);return e&&e.innerHTML.trim().length>0},zn=()=>typeof window<`u`&&window.__OPENSPEC_STATIC_MODE__===!0;async function Bn(e,t){let{HostedConnectionState:n}=await r(async()=>{let{HostedConnectionState:e}=await import(`./hosted-connection-state-BYVOLSii.js`);return{HostedConnectionState:e}},__vite__mapDeps([0,1,2]));(0,lt.createRoot)(e).render((0,Ln.jsx)(n,{...t}))}async function Vn(){try{let e=await Dn(hn());return e.ok?null:e.status===401||e.status===403?{title:`Authentication Required`,message:`This Project Web session does not have a valid backend credential.`}:{title:`Project Web Unavailable`,message:`Backend admission failed with ${e.status} ${e.statusText||`Unknown Error`}.`,onRetry:()=>window.location.reload()}}catch(e){return{title:`Project Web Unavailable`,message:e instanceof Error?e.message:String(e),onRetry:()=>window.location.reload()}}}async function Hn(){let e=document.getElementById(`root`);if(xn()){if(!(`serviceWorker`in navigator)){await Bn(e,{title:`Protected Session Unavailable`,message:`This browser cannot install the transient protected-resource transport.`});return}try{await An(navigator.serviceWorker)}catch(t){await Bn(e,{title:`Protected Session Unavailable`,message:t instanceof Error?t.message:String(t)});return}}let t=un();if(t.hosted&&!t.apiBaseUrl){await Bn(e,{title:`Hosted Session Not Connected`,message:`This embedded UI session needs explicit api and session query parameters.`});return}let n=zn()||await jn();if(Nn(n),n)console.log(`[OpenSpec UI] Running in static mode`);else{let t=await Vn();if(t){await Bn(e,t);return}}let{App:i}=await r(async()=>{let{App:e}=await import(`./App-Dmag08k5.js`);return{App:e}},__vite__mapDeps([3,2,4,5,6,7,1,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]));Rn()&&n?(console.log(`[OpenSpec UI] Hydrating pre-rendered content`),(0,lt.hydrateRoot)(e,(0,Ln.jsx)(i,{}))):(console.log(`[OpenSpec UI] Fresh render`),(0,lt.createRoot)(e).render((0,Ln.jsx)(i,{})))}Hn();export{J as A,it as B,pt as C,V as D,W as E,G as F,c as H,ct as I,ot as L,q as M,H as N,nt as O,B as P,z as R,Y as S,dt as T,U as V,Wt as _,Cn as a,X as b,hn as c,fn as d,sn as f,nn as g,Gt as h,Dn as i,st as j,K as k,pn as l,rn as m,In as n,Sn as o,cn as p,Mn as r,Q as s,Fn as t,mn as u,_t as v,mt as w,ht as x,xt as y,at as z};