@fungi.computer/grove 0.16.1 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{Effect-DeiDqvoz.js → Effect-pxRavrBh.js} +11 -11
- package/dist/assets/{anthropic-messages-DQiQ4Cgh.js → anthropic-messages-CkLFXbme.js} +3 -3
- package/dist/assets/{azure-openai-responses-BdsogfXX.js → azure-openai-responses-BjItkyTn.js} +1 -1
- package/dist/assets/{base-face-BYExcFAP.js → base-face-CsIbc1by.js} +1 -1
- package/dist/assets/burger-BgftDtiM.js +1 -0
- package/dist/assets/cat-CfNEurUg.js +1 -0
- package/dist/assets/{classifier-shared-BCGGOIh6.js → classifier-shared-JiMD88Sh.js} +1 -1
- package/dist/assets/{cloudflare-workers-ai-system-one-BjlnhHlD.js → cloudflare-workers-ai-system-one-tEpgPfLW.js} +1 -1
- package/dist/assets/compat-CxZajpXB.js +2 -0
- package/dist/assets/conversation-toast-DUFOMoQ9.js +33 -0
- package/dist/assets/{document-EWUYmKg3.js → document-BBvRlLC3.js} +1 -1
- package/dist/assets/{document-BiiUDQ73.js → document-Bpcy9TTA.js} +1 -1
- package/dist/assets/extension-hook-Da3ATgkY.js +890 -0
- package/dist/assets/extensions-D2Z9guoO.js +1 -0
- package/dist/assets/{google-generative-ai-DZR_Ze6f.js → google-generative-ai-DJB3dC5c.js} +1 -1
- package/dist/assets/{google-shared-BpSgfzOZ.js → google-shared-DVq-_IDX.js} +1 -1
- package/dist/assets/{google-vertex-ghIH-83b.js → google-vertex-CYm5wNps.js} +1 -1
- package/dist/assets/index-BaCEAFz2.js +117 -0
- package/dist/assets/index-CIiuRnlU.css +1 -0
- package/dist/assets/{mistral-conversations-Dz3sIOsn.js → mistral-conversations-DDg7eeLe.js} +1 -1
- package/dist/assets/{mushroom-CjQXC8r7.js → mushroom-FKArpulr.js} +1 -1
- package/dist/assets/{node.browser-Bg-Udc28.js → node.browser-CdLsHXpS.js} +1 -1
- package/dist/assets/{openai-codex-responses-CsLh-FB3.js → openai-codex-responses-H7WhI66H.js} +1 -1
- package/dist/assets/{openai-completions-F-1Tomjo.js → openai-completions-CkqQ2fFp.js} +1 -1
- package/dist/assets/{openai-decisions-BMWT3gOP.js → openai-decisions-DMV8tZy4.js} +1 -1
- package/dist/assets/{openai-responses-CZ6dqUTL.js → openai-responses-Csql8sEY.js} +1 -1
- package/dist/assets/{openai-responses-shared-Btjx9mL_.js → openai-responses-shared-DAZ5Qapp.js} +1 -1
- package/dist/assets/{openrouter-images-D5Uqwk0h.js → openrouter-images-DFWtFOvI.js} +1 -1
- package/dist/assets/parakeet-BUkzxkvS.js +35 -0
- package/dist/assets/parakeet-conversation-D8vRtIjX.js +4 -0
- package/dist/assets/{pi-messages-1JTpG1Us.js → pi-messages-DoPiztqV.js} +1 -1
- package/dist/assets/{renderer-DOUDAFcS.js → renderer-BVZdPJB6.js} +1 -1
- package/dist/assets/runtime-core-U8lOfyYX.js +40 -0
- package/dist/assets/{system-one-shared-qsmpMW29.js → system-one-shared-D7AS4c2W.js} +1 -1
- package/dist/assets/{transform-messages-AGWoIDpj.js → transform-messages-CCZNew0k.js} +1 -1
- package/dist/assets/{typesafe-system-one-D8FWi62S.js → typesafe-system-one-Cl52u7Mq.js} +1 -1
- package/dist/assets/{website-conversation-kQbo5VTI.js → website-conversation-CpPJ8N_o.js} +1 -1
- package/dist/index.html +9 -8
- package/package.json +9 -9
- package/dist/assets/burger-Bn2ocNTG.js +0 -1
- package/dist/assets/cat-x9tMcsRE.js +0 -1
- package/dist/assets/compat-CAkhM7lX.js +0 -2
- package/dist/assets/conversation-toast-BLAWHMmE.js +0 -32
- package/dist/assets/extension-hook-BEwrceUI.js +0 -869
- package/dist/assets/index-BaZH2cO3.js +0 -117
- package/dist/assets/index-ODpmGtEN.css +0 -1
- package/dist/assets/parakeet-Cq96KyZe.js +0 -36
- package/dist/assets/parakeet-conversation-m2Bl3XXj.js +0 -4
- package/dist/assets/runtime-core-DDK2YKwN.js +0 -40
|
@@ -60,17 +60,17 @@ var e,t=Object.freeze({status:`aborted`});function n(e,t,n){function r(n,r){if(n
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},o,s=ie,c=!a.jitless,u=c&&ae.value,d=t.catchall,f;e._zod.parse=(a,l)=>{f??=r.value;let ee=a.value;return s(ee)?c&&u&&l?.async===!1&&l.jitless!==!0?(o||=i(t.shape),a=o(a,l),d?In([],ee,a,l,f,e):a):n(a,l):(a.issues.push({expected:`object`,code:`invalid_type`,input:ee,inst:e}),a)}});function zn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!be(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>we(e,r,o())))}),t)}var Bn=n(`$ZodUnion`,(e,t)=>{v.init(e,t),p(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),p(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),p(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),p(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>d(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>zn(t,r,e,i)):zn(o,r,e,i)}}),Vn=n(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Bn.init(e,t);let n=e._zod.parse;p(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=l(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!ie(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Hn=n(`$ZodIntersection`,(e,t)=>{v.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Wn(e,t,n)):Wn(e,i,a)}});function Un(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(oe(e)&&oe(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Un(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Un(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Wn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),be(e))return e;let o=Un(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Gn=n(`$ZodTuple`,(e,t)=>{v.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=Kn(n,`optin`),c=Kn(n,`optout`);if(!t.rest){if(a.length<s)return r.issues.push({code:`too_small`,minimum:s,inclusive:!0,input:a,inst:e,origin:`array`}),r;a.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:a,inst:e,origin:`array`})}let l=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=n.length-1,s=a.slice(n.length);for(let n of s){e++;let a=t.rest._zod.run({value:n,issues:[]},i);a instanceof Promise?o.push(a.then(t=>qn(t,r,e))):qn(a,r,e)}}return o.length?Promise.all(o).then(()=>Jn(l,r,n,a,c)):Jn(l,r,n,a,c)}});function Kn(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function qn(e,t,n){e.issues.length&&t.issues.push(...Se(n,e.issues)),t.value[n]=e.value}function Jn(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(...Se(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}var Yn=n(`$ZodRecord`,(e,t)=>{v.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!oe(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],s=t.keyType._zod.values;if(s){n.value={};let c=new Set;for(let l of s)if(typeof l==`string`||typeof l==`number`||typeof l==`symbol`){c.add(typeof l==`number`?l.toString():l);let s=t.keyType._zod.run({value:l,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>we(e,r,o())),input:l,path:[l],inst:e});continue}let u=s.value,d=t.valueType._zod.run({value:i[l],issues:[]},r);d instanceof Promise?a.push(d.then(e=>{e.issues.length&&n.issues.push(...Se(l,e.issues)),n.value[u]=e.value})):(d.issues.length&&n.issues.push(...Se(l,d.issues)),n.value[u]=d.value)}let l;for(let e in i)c.has(e)||(l??=[],l.push(e));l&&l.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:l})}else{n.value={};for(let s of Reflect.ownKeys(i)){if(s===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof s==`string`&&wt.test(s)&&c.issues.length){let e=t.keyType._zod.run({value:Number(s),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(c=e)}if(c.issues.length){t.mode===`loose`?n.value[s]=i[s]:n.issues.push({code:`invalid_key`,origin:`record`,issues:c.issues.map(e=>we(e,r,o())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:i[s],issues:[]},r);l instanceof Promise?a.push(l.then(e=>{e.issues.length&&n.issues.push(...Se(s,e.issues)),n.value[c.value]=e.value})):(l.issues.length&&n.issues.push(...Se(s,l.issues)),n.value[c.value]=l.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Xn=n(`$ZodEnum`,(e,t)=>{v.init(e,t);let n=s(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ce.has(typeof e)).map(e=>typeof e==`string`?le(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Zn=n(`$ZodLiteral`,(e,t)=>{if(v.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?le(e):e?le(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Qn=n(`$ZodTransform`,(e,t)=>{v.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,a)=>{if(a.direction===`backward`)throw new i(e.constructor.name);let o=t.transform(n.value,n);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n.fallback=!0,n));if(o instanceof Promise)throw new r;return n.value=o,n.fallback=!0,n}});function $n(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var er=n(`$ZodOptional`,(e,t)=>{v.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),p(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${d(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>$n(e,r)):$n(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),tr=n(`$ZodExactOptional`,(e,t)=>{er.init(e,t),p(e._zod,`values`,()=>t.innerType._zod.values),p(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),nr=n(`$ZodNullable`,(e,t)=>{v.init(e,t),p(e._zod,`optin`,()=>t.innerType._zod.optin),p(e._zod,`optout`,()=>t.innerType._zod.optout),p(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${d(e.source)}|null)$`):void 0}),p(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),rr=n(`$ZodDefault`,(e,t)=>{v.init(e,t),e._zod.optin=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ir(e,t)):ir(r,t)}});function ir(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ar=n(`$ZodPrefault`,(e,t)=>{v.init(e,t),e._zod.optin=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),or=n(`$ZodNonOptional`,(e,t)=>{v.init(e,t),p(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>sr(t,e)):sr(i,e)}});function sr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var cr=n(`$ZodCatch`,(e,t)=>{v.init(e,t),e._zod.optin=`optional`,p(e._zod,`optout`,()=>t.innerType._zod.optout),p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>we(e,n,o()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>we(e,n,o()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),lr=n(`$ZodNaN`,(e,t)=>{v.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),ur=n(`$ZodPipe`,(e,t)=>{v.init(e,t),p(e._zod,`values`,()=>t.in._zod.values),p(e._zod,`optin`,()=>t.in._zod.optin),p(e._zod,`optout`,()=>t.out._zod.optout),p(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>dr(e,t.in,n)):dr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>dr(e,t.out,n)):dr(r,t.out,n)}});function dr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var fr=n(`$ZodReadonly`,(e,t)=>{v.init(e,t),p(e._zod,`propValues`,()=>t.innerType._zod.propValues),p(e._zod,`values`,()=>t.innerType._zod.values),p(e._zod,`optin`,()=>t.innerType?._zod?.optin),p(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(pr):pr(r)}});function pr(e){return e.value=Object.freeze(e.value),e}var mr=n(`$ZodFunction`,(e,t)=>(v.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return function(...n){let r=e._def.input?Fe(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?Fe(e._def.output,i):i}},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...n){let r=e._def.input?await Le(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await Le(e._def.output,i):i}},e._zod.parse=(t,n)=>typeof t.value==`function`?(t.value=e._def.output&&e._def.output._zod.def.type===`promise`?e.implementAsync(t.value):e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new Gn({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),hr=n(`$ZodPromise`,(e,t)=>{v.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),gr=n(`$ZodLazy`,(e,t)=>{v.init(e,t),p(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),p(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),p(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),p(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),p(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),_r=n(`$ZodCustom`,(e,t)=>{_.init(e,t),v.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>vr(t,n,r,e));vr(i,n,r,e)}});function vr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Ee(e))}}var yr,br=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function xr(){return new br}(yr=globalThis).__zod_globalRegistry??(yr.__zod_globalRegistry=xr());var Sr=globalThis.__zod_globalRegistry;function Cr(e,t){return new e({type:`string`,...g(t)})}function wr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...g(t)})}function Tr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...g(t)})}function Er(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...g(t)})}function Dr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...g(t)})}function Or(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...g(t)})}function kr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...g(t)})}function Ar(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...g(t)})}function jr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...g(t)})}function Mr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...g(t)})}function Nr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...g(t)})}function Pr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...g(t)})}function Fr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...g(t)})}function Ir(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...g(t)})}function Lr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...g(t)})}function Rr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...g(t)})}function zr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...g(t)})}function Br(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...g(t)})}function Vr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...g(t)})}function Hr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...g(t)})}function Ur(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...g(t)})}function Wr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...g(t)})}function Gr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...g(t)})}function Kr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...g(t)})}function qr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...g(t)})}function Jr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...g(t)})}function Yr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...g(t)})}function Xr(e,t){return new e({type:`number`,checks:[],...g(t)})}function Zr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...g(t)})}function Qr(e,t){return new e({type:`boolean`,...g(t)})}function $r(e,t){return new e({type:`bigint`,...g(t)})}function ei(e,t){return new e({type:`symbol`,...g(t)})}function ti(e,t){return new e({type:`undefined`,...g(t)})}function ni(e,t){return new e({type:`null`,...g(t)})}function ri(e){return new e({type:`unknown`})}function ii(e,t){return new e({type:`never`,...g(t)})}function ai(e,t){return new e({type:`void`,...g(t)})}function oi(e,t){return new e({type:`nan`,...g(t)})}function si(e,t){return new jt({check:`less_than`,...g(t),value:e,inclusive:!1})}function ci(e,t){return new jt({check:`less_than`,...g(t),value:e,inclusive:!0})}function li(e,t){return new Mt({check:`greater_than`,...g(t),value:e,inclusive:!1})}function ui(e,t){return new Mt({check:`greater_than`,...g(t),value:e,inclusive:!0})}function di(e,t){return new Nt({check:`multiple_of`,...g(t),value:e})}function fi(e,t){return new Ft({check:`max_length`,...g(t),maximum:e})}function pi(e,t){return new It({check:`min_length`,...g(t),minimum:e})}function mi(e,t){return new Lt({check:`length_equals`,...g(t),length:e})}function hi(e,t){return new zt({check:`string_format`,format:`regex`,...g(t),pattern:e})}function gi(e){return new Bt({check:`string_format`,format:`lowercase`,...g(e)})}function _i(e){return new Vt({check:`string_format`,format:`uppercase`,...g(e)})}function vi(e,t){return new Ht({check:`string_format`,format:`includes`,...g(t),includes:e})}function yi(e,t){return new Ut({check:`string_format`,format:`starts_with`,...g(t),prefix:e})}function bi(e,t){return new Wt({check:`string_format`,format:`ends_with`,...g(t),suffix:e})}function xi(e){return new Gt({check:`overwrite`,tx:e})}function Si(e){return xi(t=>t.normalize(e))}function Ci(){return xi(e=>e.trim())}function wi(){return xi(e=>e.toLowerCase())}function Ti(){return xi(e=>e.toUpperCase())}function Ei(){return xi(e=>ne(e))}function Di(e,t,n){return new e({type:`array`,element:t,...g(n)})}function Oi(e,t,n){let r=g(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function ki(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...g(n)})}function Ai(e,t){let n=ji(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ee(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Ee(r))}},e(t.value,t)),t);return n}function ji(e,t){let n=new _({check:`custom`,...g(t)});return n._zod.check=e,n}function Mi(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Sr,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function b(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,b(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&x(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ni(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
63
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},o,s=ie,c=!a.jitless,u=c&&ae.value,d=t.catchall,f;e._zod.parse=(a,l)=>{f??=r.value;let ee=a.value;return s(ee)?c&&u&&l?.async===!1&&l.jitless!==!0?(o||=i(t.shape),a=o(a,l),d?In([],ee,a,l,f,e):a):n(a,l):(a.issues.push({expected:`object`,code:`invalid_type`,input:ee,inst:e}),a)}});function zn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!be(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>we(e,r,o())))}),t)}var Bn=n(`$ZodUnion`,(e,t)=>{v.init(e,t),p(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),p(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),p(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),p(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>d(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>zn(t,r,e,i)):zn(o,r,e,i)}}),Vn=n(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Bn.init(e,t);let n=e._zod.parse;p(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=l(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!ie(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Hn=n(`$ZodIntersection`,(e,t)=>{v.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Wn(e,t,n)):Wn(e,i,a)}});function Un(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(oe(e)&&oe(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Un(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Un(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Wn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),be(e))return e;let o=Un(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Gn=n(`$ZodTuple`,(e,t)=>{v.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=Kn(n,`optin`),c=Kn(n,`optout`);if(!t.rest){if(a.length<s)return r.issues.push({code:`too_small`,minimum:s,inclusive:!0,input:a,inst:e,origin:`array`}),r;a.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:a,inst:e,origin:`array`})}let l=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=n.length-1,s=a.slice(n.length);for(let n of s){e++;let a=t.rest._zod.run({value:n,issues:[]},i);a instanceof Promise?o.push(a.then(t=>qn(t,r,e))):qn(a,r,e)}}return o.length?Promise.all(o).then(()=>Jn(l,r,n,a,c)):Jn(l,r,n,a,c)}});function Kn(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function qn(e,t,n){e.issues.length&&t.issues.push(...Se(n,e.issues)),t.value[n]=e.value}function Jn(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(...Se(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}var Yn=n(`$ZodRecord`,(e,t)=>{v.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!oe(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],s=t.keyType._zod.values;if(s){n.value={};let c=new Set;for(let l of s)if(typeof l==`string`||typeof l==`number`||typeof l==`symbol`){c.add(typeof l==`number`?l.toString():l);let s=t.keyType._zod.run({value:l,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>we(e,r,o())),input:l,path:[l],inst:e});continue}let u=s.value,d=t.valueType._zod.run({value:i[l],issues:[]},r);d instanceof Promise?a.push(d.then(e=>{e.issues.length&&n.issues.push(...Se(l,e.issues)),n.value[u]=e.value})):(d.issues.length&&n.issues.push(...Se(l,d.issues)),n.value[u]=d.value)}let l;for(let e in i)c.has(e)||(l??=[],l.push(e));l&&l.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:l})}else{n.value={};for(let s of Reflect.ownKeys(i)){if(s===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof s==`string`&&wt.test(s)&&c.issues.length){let e=t.keyType._zod.run({value:Number(s),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(c=e)}if(c.issues.length){t.mode===`loose`?n.value[s]=i[s]:n.issues.push({code:`invalid_key`,origin:`record`,issues:c.issues.map(e=>we(e,r,o())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:i[s],issues:[]},r);l instanceof Promise?a.push(l.then(e=>{e.issues.length&&n.issues.push(...Se(s,e.issues)),n.value[c.value]=e.value})):(l.issues.length&&n.issues.push(...Se(s,l.issues)),n.value[c.value]=l.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Xn=n(`$ZodEnum`,(e,t)=>{v.init(e,t);let n=s(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ce.has(typeof e)).map(e=>typeof e==`string`?le(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Zn=n(`$ZodLiteral`,(e,t)=>{if(v.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?le(e):e?le(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Qn=n(`$ZodTransform`,(e,t)=>{v.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,a)=>{if(a.direction===`backward`)throw new i(e.constructor.name);let o=t.transform(n.value,n);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n.fallback=!0,n));if(o instanceof Promise)throw new r;return n.value=o,n.fallback=!0,n}});function $n(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var er=n(`$ZodOptional`,(e,t)=>{v.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),p(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${d(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>$n(e,r)):$n(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),tr=n(`$ZodExactOptional`,(e,t)=>{er.init(e,t),p(e._zod,`values`,()=>t.innerType._zod.values),p(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),nr=n(`$ZodNullable`,(e,t)=>{v.init(e,t),p(e._zod,`optin`,()=>t.innerType._zod.optin),p(e._zod,`optout`,()=>t.innerType._zod.optout),p(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${d(e.source)}|null)$`):void 0}),p(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),rr=n(`$ZodDefault`,(e,t)=>{v.init(e,t),e._zod.optin=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ir(e,t)):ir(r,t)}});function ir(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ar=n(`$ZodPrefault`,(e,t)=>{v.init(e,t),e._zod.optin=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),or=n(`$ZodNonOptional`,(e,t)=>{v.init(e,t),p(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>sr(t,e)):sr(i,e)}});function sr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var cr=n(`$ZodCatch`,(e,t)=>{v.init(e,t),e._zod.optin=`optional`,p(e._zod,`optout`,()=>t.innerType._zod.optout),p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>we(e,n,o()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>we(e,n,o()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),lr=n(`$ZodNaN`,(e,t)=>{v.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),ur=n(`$ZodPipe`,(e,t)=>{v.init(e,t),p(e._zod,`values`,()=>t.in._zod.values),p(e._zod,`optin`,()=>t.in._zod.optin),p(e._zod,`optout`,()=>t.out._zod.optout),p(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>dr(e,t.in,n)):dr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>dr(e,t.out,n)):dr(r,t.out,n)}});function dr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var fr=n(`$ZodReadonly`,(e,t)=>{v.init(e,t),p(e._zod,`propValues`,()=>t.innerType._zod.propValues),p(e._zod,`values`,()=>t.innerType._zod.values),p(e._zod,`optin`,()=>t.innerType?._zod?.optin),p(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(pr):pr(r)}});function pr(e){return e.value=Object.freeze(e.value),e}var mr=n(`$ZodFunction`,(e,t)=>(v.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return function(...n){let r=e._def.input?Fe(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?Fe(e._def.output,i):i}},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...n){let r=e._def.input?await Le(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await Le(e._def.output,i):i}},e._zod.parse=(t,n)=>typeof t.value==`function`?(t.value=e._def.output&&e._def.output._zod.def.type===`promise`?e.implementAsync(t.value):e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new Gn({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),hr=n(`$ZodPromise`,(e,t)=>{v.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),gr=n(`$ZodLazy`,(e,t)=>{v.init(e,t),p(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),p(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),p(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),p(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),p(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),_r=n(`$ZodCustom`,(e,t)=>{_.init(e,t),v.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>vr(t,n,r,e));vr(i,n,r,e)}});function vr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Ee(e))}}var yr,br=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function xr(){return new br}(yr=globalThis).__zod_globalRegistry??(yr.__zod_globalRegistry=xr());var Sr=globalThis.__zod_globalRegistry;function Cr(e,t){return new e({type:`string`,...g(t)})}function wr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...g(t)})}function Tr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...g(t)})}function Er(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...g(t)})}function Dr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...g(t)})}function Or(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...g(t)})}function kr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...g(t)})}function Ar(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...g(t)})}function jr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...g(t)})}function Mr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...g(t)})}function Nr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...g(t)})}function Pr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...g(t)})}function Fr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...g(t)})}function Ir(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...g(t)})}function Lr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...g(t)})}function Rr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...g(t)})}function zr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...g(t)})}function Br(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...g(t)})}function Vr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...g(t)})}function Hr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...g(t)})}function Ur(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...g(t)})}function Wr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...g(t)})}function Gr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...g(t)})}function Kr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...g(t)})}function qr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...g(t)})}function Jr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...g(t)})}function Yr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...g(t)})}function Xr(e,t){return new e({type:`number`,checks:[],...g(t)})}function Zr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...g(t)})}function Qr(e,t){return new e({type:`boolean`,...g(t)})}function $r(e,t){return new e({type:`bigint`,...g(t)})}function ei(e,t){return new e({type:`symbol`,...g(t)})}function ti(e,t){return new e({type:`undefined`,...g(t)})}function ni(e,t){return new e({type:`null`,...g(t)})}function ri(e){return new e({type:`unknown`})}function ii(e,t){return new e({type:`never`,...g(t)})}function ai(e,t){return new e({type:`void`,...g(t)})}function oi(e,t){return new e({type:`nan`,...g(t)})}function si(e,t){return new jt({check:`less_than`,...g(t),value:e,inclusive:!1})}function ci(e,t){return new jt({check:`less_than`,...g(t),value:e,inclusive:!0})}function li(e,t){return new Mt({check:`greater_than`,...g(t),value:e,inclusive:!1})}function ui(e,t){return new Mt({check:`greater_than`,...g(t),value:e,inclusive:!0})}function di(e){return li(0,e)}function fi(e,t){return new Nt({check:`multiple_of`,...g(t),value:e})}function pi(e,t){return new Ft({check:`max_length`,...g(t),maximum:e})}function mi(e,t){return new It({check:`min_length`,...g(t),minimum:e})}function hi(e,t){return new Lt({check:`length_equals`,...g(t),length:e})}function gi(e,t){return new zt({check:`string_format`,format:`regex`,...g(t),pattern:e})}function _i(e){return new Bt({check:`string_format`,format:`lowercase`,...g(e)})}function vi(e){return new Vt({check:`string_format`,format:`uppercase`,...g(e)})}function yi(e,t){return new Ht({check:`string_format`,format:`includes`,...g(t),includes:e})}function bi(e,t){return new Ut({check:`string_format`,format:`starts_with`,...g(t),prefix:e})}function xi(e,t){return new Wt({check:`string_format`,format:`ends_with`,...g(t),suffix:e})}function Si(e){return new Gt({check:`overwrite`,tx:e})}function Ci(e){return Si(t=>t.normalize(e))}function wi(){return Si(e=>e.trim())}function Ti(){return Si(e=>e.toLowerCase())}function Ei(){return Si(e=>e.toUpperCase())}function Di(){return Si(e=>ne(e))}function Oi(e,t,n){return new e({type:`array`,element:t,...g(n)})}function ki(e,t,n){let r=g(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Ai(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...g(n)})}function ji(e,t){let n=Mi(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ee(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Ee(r))}},e(t.value,t)),t);return n}function Mi(e,t){let n=new _({check:`custom`,...g(t)});return n._zod.check=e,n}function Ni(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Sr,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function b(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,b(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&x(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Pi(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
64
64
|
|
|
65
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Pi(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Ii(t,`input`,e.processors),output:Ii(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function x(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return x(r.element,n);if(r.type===`set`)return x(r.valueType,n);if(r.type===`lazy`)return x(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return x(r.innerType,n);if(r.type===`intersection`)return x(r.left,n)||x(r.right,n);if(r.type===`record`||r.type===`map`)return x(r.keyType,n)||x(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:x(r.in,n)||x(r.out,n);if(r.type===`object`){for(let e in r.shape)if(x(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(x(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(x(e,n))return!0;return!!(r.rest&&x(r.rest,n))}return!1}var Fi=(e,t={})=>n=>{let r=Mi({...n,processors:t});return b(e,r),Ni(r,e),Pi(r,e)},Ii=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Mi({...i??{},target:a,io:t,processors:n});return b(e,o),Ni(o,e),Pi(o,e)},Li={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ri=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Li[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},zi=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),ee=t.target===`draft-04`||t.target===`openapi-3.0`;d?ee?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?ee?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Bi=(e,t,n,r)=>{n.type=`boolean`},Vi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},Hi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},Ui=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Wi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},Gi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},Ki=(e,t,n,r)=>{n.not={}},qi=(e,t,n,r)=>{},Ji=(e,t,n,r)=>{},Yi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},Xi=(e,t,n,r)=>{let i=e._zod.def,a=s(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Zi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Qi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},$i=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},ea=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},ta=(e,t,n,r)=>{n.type=`boolean`},na=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},ra=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},ia=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},aa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},oa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},sa=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=b(a.element,t,{...r,path:[...r.path,`items`]})},ca=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=b(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=b(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},la=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>b(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},ua=(e,t,n,r)=>{let i=e._zod.def,a=b(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=b(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},da=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>b(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?b(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},fa=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=b(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=b(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=b(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},pa=(e,t,n,r)=>{let i=e._zod.def,a=b(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ma=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ha=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},ga=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},_a=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},va=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;b(o,t,r);let s=t.seen.get(e);s.ref=o},ya=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},ba=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},xa=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Sa=(e,t,n,r)=>{let i=e._zod.innerType;b(i,t,r);let a=t.seen.get(e);a.ref=i},Ca={string:Ri,number:zi,boolean:Bi,bigint:Vi,symbol:Hi,null:Ui,undefined:Wi,void:Gi,never:Ki,any:qi,unknown:Ji,date:Yi,enum:Xi,literal:Zi,nan:Qi,template_literal:$i,file:ea,success:ta,custom:na,function:ra,transform:ia,map:aa,set:oa,array:sa,object:ca,union:la,intersection:ua,tuple:da,record:fa,nullable:pa,nonoptional:ma,default:ha,prefault:ga,catch:_a,pipe:va,readonly:ya,promise:ba,optional:xa,lazy:Sa};function wa(e,t){if(`_idmap`in e){let n=e,r=Mi({...t,processors:Ca}),i={};for(let e of n._idmap.entries()){let[t,n]=e;b(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Ni(r,n),a[t]=Pi(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Mi({...t,processors:Ca});return b(e,n),Ni(n,e),Pi(n,e)}var Ta=n(`ZodISODateTime`,(e,t)=>{sn.init(e,t),w.init(e,t)});function Ea(e){return Kr(Ta,e)}var Da=n(`ZodISODate`,(e,t)=>{cn.init(e,t),w.init(e,t)});function Oa(e){return qr(Da,e)}var ka=n(`ZodISOTime`,(e,t)=>{ln.init(e,t),w.init(e,t)});function Aa(e){return Jr(ka,e)}var ja=n(`ZodISODuration`,(e,t)=>{un.init(e,t),w.init(e,t)});function Ma(e){return Yr(ja,e)}var S=n(`ZodError`,(e,t)=>{Oe.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>je(e,t)},flatten:{value:t=>Ae(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,c,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,c,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Na=Pe(S),Pa=Ie(S),Fa=Re(S),Ia=Be(S),La=He(S),Ra=Ue(S),za=We(S),Ba=Ge(S),Va=Ke(S),Ha=qe(S),Ua=Je(S),Wa=Ye(S),Ga=new WeakMap;function Ka(e,t,n){let r=Object.getPrototypeOf(e),i=Ga.get(r);if(i||(i=new Set,Ga.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var C=n(`ZodType`,(e,t)=>(v.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Ii(e,`input`),output:Ii(e,`output`)}}),e.toJSONSchema=Fi(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Na(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Fa(e,t,n),e.parseAsync=async(t,n)=>Pa(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ia(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>La(e,t,n),e.decode=(t,n)=>Ra(e,t,n),e.encodeAsync=async(t,n)=>za(e,t,n),e.decodeAsync=async(t,n)=>Ba(e,t,n),e.safeEncode=(t,n)=>Va(e,t,n),e.safeDecode=(t,n)=>Ha(e,t,n),e.safeEncodeAsync=async(t,n)=>Ua(e,t,n),e.safeDecodeAsync=async(t,n)=>Wa(e,t,n),Ka(e,`ZodType`,{check(...e){let t=this.def;return this.clone(h(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ue(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Fs(e,t))},superRefine(e,t){return this.check(Is(e,t))},overwrite(e){return this.check(xi(e))},optional(){return cs(this)},exactOptional(){return us(this)},nullable(){return fs(this)},nullish(){return cs(fs(this))},nonoptional(e){return vs(this,e)},array(){return Bo(this)},or(e){return Ko([this,e])},and(e){return Xo(this,e)},transform(e){return ws(this,os(e))},default(e){return ms(this,e)},prefault(e){return gs(this,e)},catch(e){return bs(this,e)},pipe(e){return ws(this,e)},readonly(){return Es(this)},describe(e){let t=this.clone();return Sr.add(t,{description:e}),t},meta(...e){if(e.length===0)return Sr.get(this);let t=this.clone();return Sr.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Sr.get(e)?.description},configurable:!0}),e)),qa=n(`_ZodString`,(e,t)=>{Jt.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ri(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Ka(e,`_ZodString`,{regex(...e){return this.check(hi(...e))},includes(...e){return this.check(vi(...e))},startsWith(...e){return this.check(yi(...e))},endsWith(...e){return this.check(bi(...e))},min(...e){return this.check(pi(...e))},max(...e){return this.check(fi(...e))},length(...e){return this.check(mi(...e))},nonempty(...e){return this.check(pi(1,...e))},lowercase(e){return this.check(gi(e))},uppercase(e){return this.check(_i(e))},trim(){return this.check(Ci())},normalize(...e){return this.check(Si(...e))},toLowerCase(){return this.check(wi())},toUpperCase(){return this.check(Ti())},slugify(){return this.check(Ei())}})}),Ja=n(`ZodString`,(e,t)=>{Jt.init(e,t),qa.init(e,t),e.email=t=>e.check(wr(Xa,t)),e.url=t=>e.check(Ar(eo,t)),e.jwt=t=>e.check(Gr(vo,t)),e.emoji=t=>e.check(jr(no,t)),e.guid=t=>e.check(Tr(Za,t)),e.uuid=t=>e.check(Er(Qa,t)),e.uuidv4=t=>e.check(Dr(Qa,t)),e.uuidv6=t=>e.check(Or(Qa,t)),e.uuidv7=t=>e.check(kr(Qa,t)),e.nanoid=t=>e.check(Mr(ro,t)),e.guid=t=>e.check(Tr(Za,t)),e.cuid=t=>e.check(Nr(io,t)),e.cuid2=t=>e.check(Pr(ao,t)),e.ulid=t=>e.check(Fr(oo,t)),e.base64=t=>e.check(Hr(mo,t)),e.base64url=t=>e.check(Ur(go,t)),e.xid=t=>e.check(Ir(so,t)),e.ksuid=t=>e.check(Lr(co,t)),e.ipv4=t=>e.check(Rr(lo,t)),e.ipv6=t=>e.check(zr(uo,t)),e.cidrv4=t=>e.check(Br(fo,t)),e.cidrv6=t=>e.check(Vr(po,t)),e.e164=t=>e.check(Wr(_o,t)),e.datetime=t=>e.check(Ea(t)),e.date=t=>e.check(Oa(t)),e.time=t=>e.check(Aa(t)),e.duration=t=>e.check(Ma(t))});function Ya(e){return Cr(Ja,e)}var w=n(`ZodStringFormat`,(e,t)=>{y.init(e,t),qa.init(e,t)}),Xa=n(`ZodEmail`,(e,t)=>{Zt.init(e,t),w.init(e,t)}),Za=n(`ZodGUID`,(e,t)=>{Yt.init(e,t),w.init(e,t)}),Qa=n(`ZodUUID`,(e,t)=>{Xt.init(e,t),w.init(e,t)});function $a(e){return Er(Qa,e)}var eo=n(`ZodURL`,(e,t)=>{Qt.init(e,t),w.init(e,t)});function to(e){return Ar(eo,e)}var no=n(`ZodEmoji`,(e,t)=>{$t.init(e,t),w.init(e,t)}),ro=n(`ZodNanoID`,(e,t)=>{en.init(e,t),w.init(e,t)}),io=n(`ZodCUID`,(e,t)=>{tn.init(e,t),w.init(e,t)}),ao=n(`ZodCUID2`,(e,t)=>{nn.init(e,t),w.init(e,t)}),oo=n(`ZodULID`,(e,t)=>{rn.init(e,t),w.init(e,t)}),so=n(`ZodXID`,(e,t)=>{an.init(e,t),w.init(e,t)}),co=n(`ZodKSUID`,(e,t)=>{on.init(e,t),w.init(e,t)}),lo=n(`ZodIPv4`,(e,t)=>{dn.init(e,t),w.init(e,t)}),uo=n(`ZodIPv6`,(e,t)=>{fn.init(e,t),w.init(e,t)}),fo=n(`ZodCIDRv4`,(e,t)=>{pn.init(e,t),w.init(e,t)}),po=n(`ZodCIDRv6`,(e,t)=>{mn.init(e,t),w.init(e,t)}),mo=n(`ZodBase64`,(e,t)=>{gn.init(e,t),w.init(e,t)});function ho(e){return Hr(mo,e)}var go=n(`ZodBase64URL`,(e,t)=>{vn.init(e,t),w.init(e,t)}),_o=n(`ZodE164`,(e,t)=>{yn.init(e,t),w.init(e,t)}),vo=n(`ZodJWT`,(e,t)=>{xn.init(e,t),w.init(e,t)}),yo=n(`ZodNumber`,(e,t)=>{Sn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zi(e,t,n,r),Ka(e,`ZodNumber`,{gt(e,t){return this.check(li(e,t))},gte(e,t){return this.check(ui(e,t))},min(e,t){return this.check(ui(e,t))},lt(e,t){return this.check(si(e,t))},lte(e,t){return this.check(ci(e,t))},max(e,t){return this.check(ci(e,t))},int(e){return this.check(So(e))},safe(e){return this.check(So(e))},positive(e){return this.check(li(0,e))},nonnegative(e){return this.check(ui(0,e))},negative(e){return this.check(si(0,e))},nonpositive(e){return this.check(ci(0,e))},multipleOf(e,t){return this.check(di(e,t))},step(e,t){return this.check(di(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function bo(e){return Xr(yo,e)}var xo=n(`ZodNumberFormat`,(e,t)=>{Cn.init(e,t),yo.init(e,t)});function So(e){return Zr(xo,e)}var Co=n(`ZodBoolean`,(e,t)=>{wn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bi(e,t,n,r)});function wo(e){return Qr(Co,e)}var To=n(`ZodBigInt`,(e,t)=>{Tn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vi(e,t,n,r),e.gte=(t,n)=>e.check(ui(t,n)),e.min=(t,n)=>e.check(ui(t,n)),e.gt=(t,n)=>e.check(li(t,n)),e.gte=(t,n)=>e.check(ui(t,n)),e.min=(t,n)=>e.check(ui(t,n)),e.lt=(t,n)=>e.check(si(t,n)),e.lte=(t,n)=>e.check(ci(t,n)),e.max=(t,n)=>e.check(ci(t,n)),e.positive=t=>e.check(li(BigInt(0),t)),e.negative=t=>e.check(si(BigInt(0),t)),e.nonpositive=t=>e.check(ci(BigInt(0),t)),e.nonnegative=t=>e.check(ui(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(di(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function Eo(e){return $r(To,e)}var Do=n(`ZodSymbol`,(e,t)=>{En.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hi(e,t,n,r)});function Oo(e){return ei(Do,e)}var ko=n(`ZodUndefined`,(e,t)=>{Dn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wi(e,t,n,r)});function Ao(e){return ti(ko,e)}var jo=n(`ZodNull`,(e,t)=>{On.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ui(e,t,n,r)});function Mo(e){return ni(jo,e)}var No=n(`ZodUnknown`,(e,t)=>{kn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Po(){return ri(No)}var Fo=n(`ZodNever`,(e,t)=>{An.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ki(e,t,n,r)});function Io(e){return ii(Fo,e)}var Lo=n(`ZodVoid`,(e,t)=>{jn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gi(e,t,n,r)});function Ro(e){return ai(Lo,e)}var zo=n(`ZodArray`,(e,t)=>{Nn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sa(e,t,n,r),e.element=t.element,Ka(e,`ZodArray`,{min(e,t){return this.check(pi(e,t))},nonempty(e){return this.check(pi(1,e))},max(e,t){return this.check(fi(e,t))},length(e,t){return this.check(mi(e,t))},unwrap(){return this.element}})});function Bo(e,t){return Di(zo,e,t)}var Vo=n(`ZodObject`,(e,t)=>{Rn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ca(e,t,n,r),p(e,`shape`,()=>t.shape),Ka(e,`ZodObject`,{keyof(){return ns(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Po()})},loose(){return this.clone({...this._zod.def,catchall:Po()})},strict(){return this.clone({...this._zod.def,catchall:Io()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return he(this,e)},safeExtend(e){return ge(this,e)},merge(e){return _e(this,e)},pick(e){return pe(this,e)},omit(e){return me(this,e)},partial(...e){return ve(ss,this,e[0])},required(...e){return ye(_s,this,e[0])}})});function Ho(e,t){return new Vo({type:`object`,shape:e??{},...g(t)})}function Uo(e,t){return new Vo({type:`object`,shape:e,catchall:Io(),...g(t)})}function Wo(e,t){return new Vo({type:`object`,shape:e,catchall:Po(),...g(t)})}var Go=n(`ZodUnion`,(e,t)=>{Bn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>la(e,t,n,r),e.options=t.options});function Ko(e,t){return new Go({type:`union`,options:e,...g(t)})}var qo=n(`ZodDiscriminatedUnion`,(e,t)=>{Go.init(e,t),Vn.init(e,t)});function Jo(e,t,n){return new qo({type:`union`,options:t,discriminator:e,...g(n)})}var Yo=n(`ZodIntersection`,(e,t)=>{Hn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ua(e,t,n,r)});function Xo(e,t){return new Yo({type:`intersection`,left:e,right:t})}var Zo=n(`ZodTuple`,(e,t)=>{Gn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>da(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Qo(e,t,n){let r=t instanceof v;return new Zo({type:`tuple`,items:e,rest:r?t:null,...g(r?n:t)})}var $o=n(`ZodRecord`,(e,t)=>{Yn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fa(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function es(e,t,n){return!t||!t._zod?new $o({type:`record`,keyType:Ya(),valueType:e,...g(t)}):new $o({type:`record`,keyType:e,valueType:t,...g(n)})}var ts=n(`ZodEnum`,(e,t)=>{Xn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xi(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ts({...t,checks:[],...g(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new ts({...t,checks:[],...g(r),entries:i})}});function ns(e,t){return new ts({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...g(t)})}var rs=n(`ZodLiteral`,(e,t)=>{Zn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zi(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function is(e,t){return new rs({type:`literal`,values:Array.isArray(e)?e:[e],...g(t)})}var as=n(`ZodTransform`,(e,t)=>{Qn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ia(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new i(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ee(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Ee(t))}};let a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=a,n.fallback=!0,n)}});function os(e){return new as({type:`transform`,transform:e})}var ss=n(`ZodOptional`,(e,t)=>{er.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cs(e){return new ss({type:`optional`,innerType:e})}var ls=n(`ZodExactOptional`,(e,t)=>{tr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function us(e){return new ls({type:`optional`,innerType:e})}var ds=n(`ZodNullable`,(e,t)=>{nr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fs(e){return new ds({type:`nullable`,innerType:e})}var ps=n(`ZodDefault`,(e,t)=>{rr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ha(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ms(e,t){return new ps({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}var hs=n(`ZodPrefault`,(e,t)=>{ar.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ga(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gs(e,t){return new hs({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}var _s=n(`ZodNonOptional`,(e,t)=>{or.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ma(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vs(e,t){return new _s({type:`nonoptional`,innerType:e,...g(t)})}var ys=n(`ZodCatch`,(e,t)=>{cr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_a(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function bs(e,t){return new ys({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var xs=n(`ZodNaN`,(e,t)=>{lr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qi(e,t,n,r)});function Ss(e){return oi(xs,e)}var Cs=n(`ZodPipe`,(e,t)=>{ur.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>va(e,t,n,r),e.in=t.in,e.out=t.out});function ws(e,t){return new Cs({type:`pipe`,in:e,out:t})}var Ts=n(`ZodReadonly`,(e,t)=>{fr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ya(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Es(e){return new Ts({type:`readonly`,innerType:e})}var Ds=n(`ZodLazy`,(e,t)=>{gr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sa(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Os(e){return new Ds({type:`lazy`,getter:e})}var ks=n(`ZodPromise`,(e,t)=>{hr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ba(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function As(e){return new ks({type:`promise`,innerType:e})}var js=n(`ZodFunction`,(e,t)=>{mr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ra(e,t,n,r)});function Ms(e){return new js({type:`function`,input:Array.isArray(e?.input)?Qo(e?.input):e?.input??Bo(Po()),output:e?.output??Po()})}var Ns=n(`ZodCustom`,(e,t)=>{_r.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>na(e,t,n,r)});function Ps(e,t){return Oi(Ns,e??(()=>!0),t)}function Fs(e,t={}){return ki(Ns,e,t)}function Is(e,t){return Ai(e,t)}function Ls(e,t={}){let n=new Ns({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...g(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Rs(e){let t=Os(()=>Ko([Ya(e),bo(),wo(),Mo(),Bo(t),es(Ya(),t)]));return t}var zs=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},Bs={pipe(){return zs(this,arguments)}},Vs=function(){function e(){}return e.prototype=Bs,e}(),T=function(e,t){if(typeof e==`function`)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},E=e=>e,Hs=e=>()=>e,Us=Hs(!0),Ws=Hs(!1),Gs=Hs(void 0),Ks=Gs;function qs(e,t,n,r,i,a,o,s,c){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return a(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return o(a(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(o(a(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return c(s(o(a(i(r(n(t(e.apply(this,arguments)))))))))}}}function Js(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function Ys(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i!==n&&t.set(i,i),i}}var Xs=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(`stack`);let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let e=Reflect.ownKeys(r);for(let n=0;n<e.length;n++)t.add(e[n]);r=Object.getPrototypeOf(r)}return t.has(`constructor`)&&typeof e.constructor==`function`&&n===e.constructor.prototype&&t.delete(`constructor`),t},Zs=new WeakSet,Qs=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),$s=0,ec=()=>{$s++};function tc(e){return typeof e==`string`}function nc(e){return typeof e==`number`}function rc(e){return typeof e==`boolean`}function ic(e){return typeof e==`bigint`}function ac(e){return typeof e==`symbol`}function oc(e){return tc(e)||nc(e)||ac(e)}function sc(e){return typeof e==`function`}function cc(e){return e===void 0}function lc(e){return e!==void 0}function uc(e){return e!=null}function dc(e){return!1}function fc(e){return!0}function pc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function mc(e){return typeof e==`object`&&!!e||sc(e)}var D=T(2,(e,t)=>mc(e)&&t in e);function hc(e){return D(e,Symbol.iterator)||tc(e)}var O=`~effect/Hash`,k=e=>{switch(typeof e){case`number`:return bc(e);case`bigint`:return j(e.toString(10));case`string`:return j(e);case`function`:case`object`:if(e===null)break;if(e instanceof Date)return Number.isNaN(e.getTime())?j(`Invalid Date`):j(e.toISOString());if(e instanceof RegExp)return j(e.toString());{if(Zs.has(e))return gc(e);let t=kc.get(e);if(t!==void 0)return t;if(Ac.has(e))return ec(),j(`[Circular]`);Ac.add(e);let n=$s,r;try{r=`~effect/Hash`in e?e[O]():typeof e==`function`?gc(e):e instanceof DataView?wc(Qs(e)):Array.isArray(e)||ArrayBuffer.isView(e)?wc(e):e instanceof Map?Tc(e):e instanceof Set?Dc(e):Sc(e)}finally{Ac.delete(e)}return n===$s&&kc.set(e,r),r}}return vc(_c(j(String(e))))},gc=e=>(Oc.has(e)||Oc.set(e,vc(Math.random()*4294967296|0)),Oc.get(e)),_c=e=>(e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^e>>>16),A=T(2,(e,t)=>_c(Math.imul(e,2654435761)+Math.imul(t,2246822507))),vc=e=>e&3221225471|e>>>1&1073741824,yc=new DataView(new ArrayBuffer(8)),bc=e=>{let t=e|0;return t===e?vc(t):(yc.setFloat64(0,e===e?e:NaN),vc(A(yc.getInt32(0),yc.getInt32(4))))},j=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return vc(t)},xc=(e,t)=>{let n=12289;for(let r of t)n^=A(k(r),k(e[r]));return vc(n)},Sc=e=>xc(e,Xs(e)),Cc=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return vc(r)},wc=e=>{let t=6151;for(let n of e)t=A(t,k(n));return vc(t)},Tc=Cc(j(`Map`),([e,t])=>A(k(e),k(t))),Ec=j(`Set`),Dc=Cc(Ec,e=>A(Ec,k(e))),Oc=new WeakMap,kc=new WeakMap,Ac=new WeakSet,M=`~effect/Equal`;function N(){return arguments.length===1?e=>jc(e,arguments[0]):jc(arguments[0],arguments[1])}function jc(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n===typeof t?n===`number`&&e!==e&&t!==t?!0:n!==`object`&&n!==`function`||Zs.has(e)||Zs.has(t)?!1:Mc(e,t):!1}function Mc(e,t){let n=Pc.length;for(let r=n;r-->0;)if(Pc[r]===e&&Fc[r]===t)return!0;if(n)return Nc(e,t);let r=Ic.get(e);r||Ic.set(e,r=new WeakMap);let i=r.get(t);return i===void 0&&r.set(t,i=Nc(e,t)),i}function Nc(e,t){Pc.push(e),Fc.push(t);try{return Lc(e,t)}finally{Pc.pop(),Fc.pop()}}var Pc=[],Fc=[],Ic=new WeakMap;function Lc(e,t){if(k(e)!==k(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let n=qc(e);if(n!==qc(t)||typeof e==`function`&&!n)return!1;if(n)return e[M](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:Rc(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;return!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView?!1:n?zc(Qs(e),Qs(t)):zc(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:Vc(e,t,Hc,Uc):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:Vc(e,t,k,jc):Bc(e,t)}function Rc(e,t){for(let n=0;n<e.length;n++)if(!jc(e[n],t[n]))return!1;return!0}function zc(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Bc(e,t){let n=Xs(e),r=Xs(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!jc(e[i],t[i]))return!1;return!0}function Vc(e,t,n,r){let i=new Map,a=0;for(let e of t){let t=n(e),r=i.get(t);r?r.push(e):i.set(t,[e]),a++}outer:for(let t of e){let e=i.get(n(t));if(e){for(let n=0;n<e.length;n++)if(r(t,e[n])){e[n]=e[e.length-1],e.pop(),a--;continue outer}}return!1}return a===0}var Hc=e=>k(e[0]),Uc=(e,t)=>jc(e[0],t[0])&&jc(e[1],t[1]),Wc=()=>0;function Gc(e,t){return Kc((n,r)=>e(n[0],r[0])&&t(n[1],r[1]))}function Kc(e){return function(t,n){return Vc(t,n,Wc,e)}}var qc=e=>D(e,M),Jc=e=>(t,n)=>t===n||e(t,n),Yc=(e,t)=>e===t,Xc=()=>Yc;function Zc(e){return Jc((t,n)=>{if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e[r](t[r],n[r]))return!1;return!0})}function Qc(e){return Jc((t,n)=>{if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e(t[r],n[r]))return!1;return!0})}var $c=e=>e.length>0;function el(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function tl(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&el(e,n,t[n])}var nl=Symbol.for(`~effect/Redactable`),rl=e=>D(e,nl);function il(e){return rl(e)?al(e):e}function al(e){return e[nl](globalThis[`~effect/Fiber/currentFiber`]?.context??cl)}var ol=`~effect/Fiber/currentFiber`,sl=new Map,cl={"~effect/Context":{},base:sl,depth:0,mapUnsafe:sl,pipe(){return zs(this,arguments)}};function P(e,t){let n=t?.space??0,r=new WeakSet,i=n?typeof n==`number`?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,t=0){try{return l(e,t)}catch{return(typeof e==`object`&&e||typeof e==`function`)&&r.delete(e),`[inspection threw]`}}function l(e,n=0){if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||e==null||typeof e==`boolean`||typeof e==`symbol`)return String(e);if(typeof e==`bigint`)return String(e)+`n`;if(typeof e==`object`||typeof e==`function`){if(r.has(e))return ll;r.add(e);let l;if(nl in e)l=c(al(e),n);else if(Array.isArray(e))l=!i||e.length<=1?`[${e.map(e=>c(e,n)).join(`,`)}]`:`[\n${a(n+1)}${e.map(e=>c(e,n+1)).join(`,
|
|
66
|
-
`+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=
|
|
67
|
-
`)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var ll=`[Circular]`;function ul(e){return typeof e==`string`?JSON.stringify(e):String(e)}function dl(e){return e.map(e=>`[${ul(e)}]`).join(``)}function fl(e){try{return e.toISOString()}catch{return`Invalid Date`}}function pl(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function ml(e,t){try{return e[t]}catch{return`[property access threw]`}}function hl(e,t){let n=[];return JSON.stringify(e,function(e,t){let r=Object.getOwnPropertyDescriptor(this,e)?.value,i=D(r,nl)?il(r):il(t);if(typeof i==`bigint`)return P(i);if(typeof i!=`object`||!i)return i;let a=i instanceof Error&&!D(i,`toJSON`)?{...i,name:i.name,message:i.message}:i;for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(i))return;if(n.push(i),a!==i&&n.push(a),!gl(a)||_l(a))return a;let o=new Proxy(a,{get(e,t){let n=Reflect.get(e,t,e);return Object.getOwnPropertyDescriptor(e,t)?.get===void 0?n:il(n)}});return n.push(o),o},t?.space)??`null`}function gl(e){for(let t of Object.getOwnPropertyNames(e))if(Object.getOwnPropertyDescriptor(e,t)?.get!==void 0)return!0;return!1}function _l(e){for(let t of[Number.prototype.valueOf,Boolean.prototype.valueOf,String.prototype.valueOf])try{return Reflect.apply(t,e,[]),!0}catch{}return!1}var vl=Symbol.for(`nodejs.util.inspect.custom`),yl=e=>{try{return e=il(e),D(e,`toJSON`)&&sc(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(yl):e}catch{return`[toJSON threw]`}},bl=(e,t=2)=>{if(typeof e==`string`)return e;try{return typeof e==`object`?hl(e,{space:t}):P(e,{space:t})}catch{return String(e)}},xl={toJSON(){return yl(this)},[vl](){return this.toJSON()},toString(){return P(this.toJSON())}},Sl=(()=>{let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,`writable`)?e.writable===!0:e.set!==void 0})(),Cl=()=>Error.stackTraceLimit,wl=e=>{Sl&&(Error.stackTraceLimit=e)},Tl=class{constructor(e){this.value=e,this.done=!1}next(e){return this.done?(this.value=e,this):(this.done=!0,{value:this.value,done:!1})}},El=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return Cl()!==0&&t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})(),Dl=`~effect/Effect`,Ol=`~effect/Exit`,kl={_A:E,_E:E,_R:E},Al=`${Dl}/identifier`,F=`${Dl}/args`,I=`${Dl}/evaluate`,L=`${Dl}/successCont`,R=`${Dl}/failureCont`,jl=`${Dl}/ensureCont`,Ml=Symbol.for(`effect/Effect/Yield`),Nl={pipe(){return zs(this,arguments)},toJSON(){return{...this}},toString(){return P(this.toJSON(),{ignoreToString:!0,space:2})},[vl](){return this.toJSON()}},Pl={[Dl]:kl,...Nl,[Symbol.iterator](){return new Tl(this)},toJSON(){return{_id:`Effect`,op:this[Al],...F in this?{args:this[F]}:void 0}}},Fl=e=>D(e,Dl),Il=e=>D(e,Ol),Ll=`~effect/Cause`,Rl=`~effect/Cause/Reason`,zl=e=>D(e,Ll),Bl=class{constructor(e){this[Ll]=Ll,this.reasons=e}pipe(){return zs(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${P(this.reasons)})`}[vl](){return this.toJSON()}[M](e){return zl(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>N(t,e.reasons[n]))}[O](){return wc(this.reasons)}},Vl=new WeakMap,Hl=class{[Rl];annotations;_tag;constructor(e,t,n){if(this[Rl]=Rl,this._tag=e,t!==Ul&&typeof n==`object`&&n&&t.size>0){let e=Vl.get(n);e&&(t=new Map([...e,...t])),Vl.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return zs(this,arguments)}toString(){return P(this)}[vl](){return this.toString()}},Ul=new Map,Wl=class extends Hl{constructor(e,t=Ul){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${P(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[M](e){return $l(e)&&N(this.error,e.error)&&N(this.annotations,e.annotations)}[O](){return A(j(this._tag))(A(k(this.error))(k(this.annotations)))}},Gl=e=>new Bl(e),Kl=(e,t)=>{let n=new Map,r=[];for(let i of e.concat(t)){let e=k(i),t=n.get(e);if(t===void 0)n.set(e,[i]);else if(t.some(e=>N(e,i)))continue;else t.push(i);r.push(i)}return r},ql=T(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new Bl(Kl(e.reasons,t.reasons));return N(e,n)?e:n}),Jl=new Bl([]),Yl=e=>new Bl([new Wl(e)]),Xl=class extends Hl{constructor(e,t=Ul){super(`Die`,t,e),this.defect=e}toString(){return`Die(${P(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[M](e){return eu(e)&&N(this.defect,e.defect)&&N(this.annotations,e.annotations)}[O](){return A(j(this._tag))(A(k(this.defect))(k(this.annotations)))}},Zl=e=>new Bl([new Xl(e)]),Ql=T(e=>zl(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new Bl(e.reasons.map(e=>e.annotate(t,n)))),$l=e=>e._tag===`Fail`,eu=e=>e._tag===`Die`,tu=e=>e._tag===`Interrupt`;function nu(e){return cu(`Effect.evaluate: Not implemented`)}var z=e=>({...Pl,[Al]:e.op,[I]:e[I]??nu,[L]:e[L],[R]:e[R],[jl]:e[jl]}),ru=e=>{let t=z(e),n=function(e){this[F]=e};return n.prototype=t,function(e){return new n(e)}},iu=e=>{let t={[Ol]:Ol,_tag:e.op,get[e.prop](){return this[F]},...z(e),toString(){return`${e.op}(${P(this[F])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[F]}},[M](e){return Il(e)&&e._tag===this._tag&&N(this[F],e[F])},[O](){return A(j(e.op),k(this[F]))}},n=function(e){this[F]=e};return n.prototype=t,function(e){return new n(e)}},B=iu({op:`Success`,prop:`value`,[I](e){let t=e.getCont(L);return t?t[L](this[F],e,this):e.yieldWith(this)}}),au={key:`effect/Cause/StackTrace`},ou={key:`effect/Cause/InterruptorStackTrace`},V=iu({op:`Failure`,prop:`cause`,[I](e){let t=this[F],n=!1;e.cache.stackFrame&&(t=Ql(t,{mapUnsafe:new Map([[au.key,e.cache.stackFrame]])}),n=!0);let r=e.getCont(R),i=e._interruptedCause;if(i&&e.interruptible){let a=!1;for(;r&&e.interruptible;)a||=Al in r,r=e.getCont(R);a&&(t=Gl(t.reasons.filter(e=>e._tag!==`Fail`))),t=ql(t,i),n=!0}return r?r[R](t,e,n?void 0:this):e.yieldWith(n?V(t):this)}}),su=e=>V(Yl(e)),cu=e=>V(Zl(e)),H=ru({op:`WithFiber`,[I](e){return this[F](e)}}),lu=function(){class e extends globalThis.Error{}let t=z({op:`YieldableError`,[I](){return su(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),uu=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends lu{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(tl(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),du=e=>{class t extends uu{_tag=e}return t.prototype.name=e,t};du(`NoSuchElementError`);var fu=`~effect/Cause/Done`,pu=e=>D(e,fu),mu={[fu]:fu,_tag:`Done`,value:void 0},hu=e=>e===void 0?mu:{[fu]:fu,_tag:`Done`,value:e},gu=su(mu),_u=e=>e===void 0?gu:su(hu(e)),vu=`~effect/Option`,yu={[vu]:{_A:e=>e},...Nl,[Symbol.iterator](){return new Tl(this)}},bu=Object.defineProperty(Object.assign(Object.create(yu),{_tag:`Some`,_op:`Some`,[M](e){return Cu(e)&&Tu(e)&&N(this.value,e.value)},[O](){return A(k(this._tag))(k(this.value))},toString(){return`some(${P(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:yl(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),xu=k(`None`),Su=Object.assign(Object.create(yu),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[M](e){return Cu(e)&&wu(e)},[O](){return xu},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),Cu=e=>D(e,vu),wu=e=>e._tag===`None`,Tu=e=>e._tag===`Some`,Eu=Object.create(Su),Du=function(e){this.value=e};Du.prototype=bu;var Ou=e=>new Du(e),ku=`~effect/Result`,Au={[ku]:{_A:e=>e,_E:e=>e},...Nl,[Symbol.iterator](){return new Tl(this)}},ju=Object.assign(Object.create(Au),{_tag:`Success`,_op:`Success`,[M](e){return Nu(e)&&Fu(e)&&N(this.success,e.success)},[O](){return A(k(this._tag))(k(this.success))},toString(){return`success(${P(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:yl(this.success)}}}),Mu=Object.assign(Object.create(Au),{_tag:`Failure`,_op:`Failure`,[M](e){return Nu(e)&&Pu(e)&&N(this.failure,e.failure)},[O](){return A(k(this._tag))(k(this.failure))},toString(){return`failure(${P(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:yl(this.failure)}}}),Nu=e=>D(e,ku),Pu=e=>e._tag===`Failure`,Fu=e=>e._tag===`Success`,Iu=function(e){this.failure=e};Iu.prototype=Mu;var Lu=e=>new Iu(e),Ru=function(e){this.success=e};Ru.prototype=ju;var zu=e=>new Ru(e),Bu=e=>Pu(e)?Eu:Ou(e.success);function Vu(e){return(t,n)=>t===n?0:e(t,n)}var Hu=Vu((e,t)=>e<t?-1:1),Uu=Vu((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),Wu=Vu((e,t)=>e<t?-1:1),Gu=T(2,(e,t)=>Vu((n,r)=>e(t(n),t(r)))),Ku=Gu(Uu,e=>e.getTime()),qu=e=>T(2,(t,n)=>e(t,n)===-1),Ju=e=>T(2,(t,n)=>e(t,n)===1),Yu=e=>T(2,(t,n)=>e(t,n)!==1),Xu=e=>T(2,(t,n)=>e(t,n)!==-1),Zu=()=>Eu,Qu=Ou,$u=Cu,ed=wu,td=Tu,nd=T(2,(e,{onNone:t,onSome:n})=>ed(e)?t():n(e.value)),rd=T(2,(e,t)=>ed(e)?t():e.value),id=T(2,(e,t)=>ed(e)?t():e),ad=e=>e==null?Zu():Qu(e),od=rd(Gs),sd=e=>(...t)=>{try{return Qu(e(...t))}catch{return Zu()}},cd=T(2,(e,t)=>ed(e)?Zu():Qu(t(e.value))),ld=T(2,(e,t)=>ed(e)?Zu():t(e.value))(E),ud=e=>ed(e)?[]:[e.value],dd=T(2,(e,t)=>ed(e)?Zu():t(e.value)?Qu(e.value):Zu()),fd=zu,pd=Lu,U=Pu,md=Fu,hd=Bu,gd=T(2,(e,t)=>U(e)?pd(t(e.failure)):e),_d=T(2,(e,t)=>md(e)?fd(t(e.success)):e),vd=T(2,(e,{onFailure:t,onSuccess:n})=>U(e)?t(e.failure):n(e.success)),yd=T(2,(e,t)=>{if(md(e))return e.success;throw t(e.failure)})(E),bd=globalThis.Array,xd=e=>bd.isArray(e)?e:bd.from(e),Sd=T(2,(e,t)=>[...e,t]);bd.isArray;var Cd=$c,wd=$c,Td=()=>[],Ed=e=>[e],Dd=T(2,(e,t)=>e.map(t)),Od=Qc,kd=e=>z({op:e.label,[I]:e.evaluate}),Ad=`~effect/Context/Service`,jd=function(){function e(){}let t=e;Object.setPrototypeOf(t,Md);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[Pd]=Pd,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&Nd.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},Md={[Ad]:Ad,...kd({label:`Service`,evaluate(e){return B(W(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return Zd(this,e)},use(e){return H(t=>e(W(t.context,this)))},useSync(e){return H(t=>B(e(W(t.context,this))))}},Nd=new Set,Pd=`~effect/Context/Reference`,Fd=`~effect/Context`,Id=8,Ld=8,Rd=(e,t,n,r)=>{let i=Object.create(Gd);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},zd=(e,t)=>{t&&(zd(e,t.parent),e.set(t.key,t.value))},Bd=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return zd(t,e.overlay),e._flat=t},Vd=(e,t)=>{let n=new Map(e.mapUnsafe);return t(n),Wd(n)},Hd=Symbol(),Ud=(e,t)=>{let n=e;for(let e=n.overlay;e;e=e.parent)if(e.key===t)return e.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?Hd:(n.overlay&&++n.baseHits>=n.base.size&&n.baseHits>=Ld&&(n.base=Bd(n),n.overlay=void 0,n.depth=0),r)},Wd=e=>Rd(void 0,e,void 0,0),Gd={get mapUnsafe(){return Bd(this)},...Nl,[Fd]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[M](e){if(!qd(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[e,r]of t)if(!n.has(e)||!N(r,n.get(e)))return!1;return!0},[O](){return bc(this.mapUnsafe.size)}},Kd=(e,t)=>e.cacheRoot===t.cacheRoot,qd=e=>D(e,Fd),Jd=e=>!!e[Pd],Yd=()=>Xd,Xd=Wd(new Map),Zd=(e,t)=>Wd(new Map([[e.key,t]])),Qd=T(3,(e,t,n)=>$d(e,t.key,n)),$d=(e,t,n)=>{let r=e,i=Nd.has(t)?void 0:r.cacheRoot;if(r.depth>=Id){let e=new Map(r.mapUnsafe);return e.set(t,n),Rd(i,e,void 0,0)}return Rd(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},ef=(e,t)=>{let n=Ud(e,t);return n===Hd?void 0:n},tf=T(2,(e,t)=>{let n=Ud(e,t.key);if(n===Hd){if(Jd(t))return rf(t);throw af(t)}return n}),W=tf,nf=`~effect/Context/defaultValue`,rf=e=>nf in e?e[nf]:e[nf]=e.defaultValue(),af=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
|
|
65
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Fi(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Li(t,`input`,e.processors),output:Li(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function x(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return x(r.element,n);if(r.type===`set`)return x(r.valueType,n);if(r.type===`lazy`)return x(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return x(r.innerType,n);if(r.type===`intersection`)return x(r.left,n)||x(r.right,n);if(r.type===`record`||r.type===`map`)return x(r.keyType,n)||x(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:x(r.in,n)||x(r.out,n);if(r.type===`object`){for(let e in r.shape)if(x(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(x(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(x(e,n))return!0;return!!(r.rest&&x(r.rest,n))}return!1}var Ii=(e,t={})=>n=>{let r=Ni({...n,processors:t});return b(e,r),Pi(r,e),Fi(r,e)},Li=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ni({...i??{},target:a,io:t,processors:n});return b(e,o),Pi(o,e),Fi(o,e)},Ri={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},zi=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ri[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Bi=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),ee=t.target===`draft-04`||t.target===`openapi-3.0`;d?ee?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?ee?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Vi=(e,t,n,r)=>{n.type=`boolean`},Hi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},Ui=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},Wi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Gi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},Ki=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},qi=(e,t,n,r)=>{n.not={}},Ji=(e,t,n,r)=>{},Yi=(e,t,n,r)=>{},Xi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},Zi=(e,t,n,r)=>{let i=e._zod.def,a=s(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Qi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},$i=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},ea=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},ta=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},na=(e,t,n,r)=>{n.type=`boolean`},ra=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},ia=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},aa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},oa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},sa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},ca=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=b(a.element,t,{...r,path:[...r.path,`items`]})},la=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=b(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=b(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},ua=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>b(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},da=(e,t,n,r)=>{let i=e._zod.def,a=b(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=b(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},fa=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>b(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?b(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},pa=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=b(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=b(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=b(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},ma=(e,t,n,r)=>{let i=e._zod.def,a=b(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ha=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ga=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},_a=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},va=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},ya=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;b(o,t,r);let s=t.seen.get(e);s.ref=o},ba=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},xa=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Sa=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ca=(e,t,n,r)=>{let i=e._zod.innerType;b(i,t,r);let a=t.seen.get(e);a.ref=i},wa={string:zi,number:Bi,boolean:Vi,bigint:Hi,symbol:Ui,null:Wi,undefined:Gi,void:Ki,never:qi,any:Ji,unknown:Yi,date:Xi,enum:Zi,literal:Qi,nan:$i,template_literal:ea,file:ta,success:na,custom:ra,function:ia,transform:aa,map:oa,set:sa,array:ca,object:la,union:ua,intersection:da,tuple:fa,record:pa,nullable:ma,nonoptional:ha,default:ga,prefault:_a,catch:va,pipe:ya,readonly:ba,promise:xa,optional:Sa,lazy:Ca};function Ta(e,t){if(`_idmap`in e){let n=e,r=Ni({...t,processors:wa}),i={};for(let e of n._idmap.entries()){let[t,n]=e;b(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Pi(r,n),a[t]=Fi(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Ni({...t,processors:wa});return b(e,n),Pi(n,e),Fi(n,e)}var Ea=n(`ZodISODateTime`,(e,t)=>{sn.init(e,t),w.init(e,t)});function Da(e){return Kr(Ea,e)}var Oa=n(`ZodISODate`,(e,t)=>{cn.init(e,t),w.init(e,t)});function ka(e){return qr(Oa,e)}var Aa=n(`ZodISOTime`,(e,t)=>{ln.init(e,t),w.init(e,t)});function ja(e){return Jr(Aa,e)}var Ma=n(`ZodISODuration`,(e,t)=>{un.init(e,t),w.init(e,t)});function Na(e){return Yr(Ma,e)}var S=n(`ZodError`,(e,t)=>{Oe.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>je(e,t)},flatten:{value:t=>Ae(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,c,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,c,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Pa=Pe(S),Fa=Ie(S),Ia=Re(S),La=Be(S),Ra=He(S),za=Ue(S),Ba=We(S),Va=Ge(S),Ha=Ke(S),Ua=qe(S),Wa=Je(S),Ga=Ye(S),Ka=new WeakMap;function qa(e,t,n){let r=Object.getPrototypeOf(e),i=Ka.get(r);if(i||(i=new Set,Ka.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var C=n(`ZodType`,(e,t)=>(v.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Li(e,`input`),output:Li(e,`output`)}}),e.toJSONSchema=Ii(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Pa(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ia(e,t,n),e.parseAsync=async(t,n)=>Fa(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>La(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ra(e,t,n),e.decode=(t,n)=>za(e,t,n),e.encodeAsync=async(t,n)=>Ba(e,t,n),e.decodeAsync=async(t,n)=>Va(e,t,n),e.safeEncode=(t,n)=>Ha(e,t,n),e.safeDecode=(t,n)=>Ua(e,t,n),e.safeEncodeAsync=async(t,n)=>Wa(e,t,n),e.safeDecodeAsync=async(t,n)=>Ga(e,t,n),qa(e,`ZodType`,{check(...e){let t=this.def;return this.clone(h(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ue(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Is(e,t))},superRefine(e,t){return this.check(Ls(e,t))},overwrite(e){return this.check(Si(e))},optional(){return ls(this)},exactOptional(){return ds(this)},nullable(){return ps(this)},nullish(){return ls(ps(this))},nonoptional(e){return ys(this,e)},array(){return Vo(this)},or(e){return qo([this,e])},and(e){return Zo(this,e)},transform(e){return Ts(this,ss(e))},default(e){return hs(this,e)},prefault(e){return _s(this,e)},catch(e){return xs(this,e)},pipe(e){return Ts(this,e)},readonly(){return Ds(this)},describe(e){let t=this.clone();return Sr.add(t,{description:e}),t},meta(...e){if(e.length===0)return Sr.get(this);let t=this.clone();return Sr.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Sr.get(e)?.description},configurable:!0}),e)),Ja=n(`_ZodString`,(e,t)=>{Jt.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zi(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,qa(e,`_ZodString`,{regex(...e){return this.check(gi(...e))},includes(...e){return this.check(yi(...e))},startsWith(...e){return this.check(bi(...e))},endsWith(...e){return this.check(xi(...e))},min(...e){return this.check(mi(...e))},max(...e){return this.check(pi(...e))},length(...e){return this.check(hi(...e))},nonempty(...e){return this.check(mi(1,...e))},lowercase(e){return this.check(_i(e))},uppercase(e){return this.check(vi(e))},trim(){return this.check(wi())},normalize(...e){return this.check(Ci(...e))},toLowerCase(){return this.check(Ti())},toUpperCase(){return this.check(Ei())},slugify(){return this.check(Di())}})}),Ya=n(`ZodString`,(e,t)=>{Jt.init(e,t),Ja.init(e,t),e.email=t=>e.check(wr(Za,t)),e.url=t=>e.check(Ar(to,t)),e.jwt=t=>e.check(Gr(yo,t)),e.emoji=t=>e.check(jr(ro,t)),e.guid=t=>e.check(Tr(Qa,t)),e.uuid=t=>e.check(Er($a,t)),e.uuidv4=t=>e.check(Dr($a,t)),e.uuidv6=t=>e.check(Or($a,t)),e.uuidv7=t=>e.check(kr($a,t)),e.nanoid=t=>e.check(Mr(io,t)),e.guid=t=>e.check(Tr(Qa,t)),e.cuid=t=>e.check(Nr(ao,t)),e.cuid2=t=>e.check(Pr(oo,t)),e.ulid=t=>e.check(Fr(so,t)),e.base64=t=>e.check(Hr(ho,t)),e.base64url=t=>e.check(Ur(_o,t)),e.xid=t=>e.check(Ir(co,t)),e.ksuid=t=>e.check(Lr(lo,t)),e.ipv4=t=>e.check(Rr(uo,t)),e.ipv6=t=>e.check(zr(fo,t)),e.cidrv4=t=>e.check(Br(po,t)),e.cidrv6=t=>e.check(Vr(mo,t)),e.e164=t=>e.check(Wr(vo,t)),e.datetime=t=>e.check(Da(t)),e.date=t=>e.check(ka(t)),e.time=t=>e.check(ja(t)),e.duration=t=>e.check(Na(t))});function Xa(e){return Cr(Ya,e)}var w=n(`ZodStringFormat`,(e,t)=>{y.init(e,t),Ja.init(e,t)}),Za=n(`ZodEmail`,(e,t)=>{Zt.init(e,t),w.init(e,t)}),Qa=n(`ZodGUID`,(e,t)=>{Yt.init(e,t),w.init(e,t)}),$a=n(`ZodUUID`,(e,t)=>{Xt.init(e,t),w.init(e,t)});function eo(e){return Er($a,e)}var to=n(`ZodURL`,(e,t)=>{Qt.init(e,t),w.init(e,t)});function no(e){return Ar(to,e)}var ro=n(`ZodEmoji`,(e,t)=>{$t.init(e,t),w.init(e,t)}),io=n(`ZodNanoID`,(e,t)=>{en.init(e,t),w.init(e,t)}),ao=n(`ZodCUID`,(e,t)=>{tn.init(e,t),w.init(e,t)}),oo=n(`ZodCUID2`,(e,t)=>{nn.init(e,t),w.init(e,t)}),so=n(`ZodULID`,(e,t)=>{rn.init(e,t),w.init(e,t)}),co=n(`ZodXID`,(e,t)=>{an.init(e,t),w.init(e,t)}),lo=n(`ZodKSUID`,(e,t)=>{on.init(e,t),w.init(e,t)}),uo=n(`ZodIPv4`,(e,t)=>{dn.init(e,t),w.init(e,t)}),fo=n(`ZodIPv6`,(e,t)=>{fn.init(e,t),w.init(e,t)}),po=n(`ZodCIDRv4`,(e,t)=>{pn.init(e,t),w.init(e,t)}),mo=n(`ZodCIDRv6`,(e,t)=>{mn.init(e,t),w.init(e,t)}),ho=n(`ZodBase64`,(e,t)=>{gn.init(e,t),w.init(e,t)});function go(e){return Hr(ho,e)}var _o=n(`ZodBase64URL`,(e,t)=>{vn.init(e,t),w.init(e,t)}),vo=n(`ZodE164`,(e,t)=>{yn.init(e,t),w.init(e,t)}),yo=n(`ZodJWT`,(e,t)=>{xn.init(e,t),w.init(e,t)}),bo=n(`ZodNumber`,(e,t)=>{Sn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bi(e,t,n,r),qa(e,`ZodNumber`,{gt(e,t){return this.check(li(e,t))},gte(e,t){return this.check(ui(e,t))},min(e,t){return this.check(ui(e,t))},lt(e,t){return this.check(si(e,t))},lte(e,t){return this.check(ci(e,t))},max(e,t){return this.check(ci(e,t))},int(e){return this.check(Co(e))},safe(e){return this.check(Co(e))},positive(e){return this.check(li(0,e))},nonnegative(e){return this.check(ui(0,e))},negative(e){return this.check(si(0,e))},nonpositive(e){return this.check(ci(0,e))},multipleOf(e,t){return this.check(fi(e,t))},step(e,t){return this.check(fi(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function xo(e){return Xr(bo,e)}var So=n(`ZodNumberFormat`,(e,t)=>{Cn.init(e,t),bo.init(e,t)});function Co(e){return Zr(So,e)}var wo=n(`ZodBoolean`,(e,t)=>{wn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vi(e,t,n,r)});function To(e){return Qr(wo,e)}var Eo=n(`ZodBigInt`,(e,t)=>{Tn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hi(e,t,n,r),e.gte=(t,n)=>e.check(ui(t,n)),e.min=(t,n)=>e.check(ui(t,n)),e.gt=(t,n)=>e.check(li(t,n)),e.gte=(t,n)=>e.check(ui(t,n)),e.min=(t,n)=>e.check(ui(t,n)),e.lt=(t,n)=>e.check(si(t,n)),e.lte=(t,n)=>e.check(ci(t,n)),e.max=(t,n)=>e.check(ci(t,n)),e.positive=t=>e.check(li(BigInt(0),t)),e.negative=t=>e.check(si(BigInt(0),t)),e.nonpositive=t=>e.check(ci(BigInt(0),t)),e.nonnegative=t=>e.check(ui(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(fi(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function Do(e){return $r(Eo,e)}var Oo=n(`ZodSymbol`,(e,t)=>{En.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ui(e,t,n,r)});function ko(e){return ei(Oo,e)}var Ao=n(`ZodUndefined`,(e,t)=>{Dn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gi(e,t,n,r)});function jo(e){return ti(Ao,e)}var Mo=n(`ZodNull`,(e,t)=>{On.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wi(e,t,n,r)});function No(e){return ni(Mo,e)}var Po=n(`ZodUnknown`,(e,t)=>{kn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Fo(){return ri(Po)}var Io=n(`ZodNever`,(e,t)=>{An.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qi(e,t,n,r)});function Lo(e){return ii(Io,e)}var Ro=n(`ZodVoid`,(e,t)=>{jn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ki(e,t,n,r)});function zo(e){return ai(Ro,e)}var Bo=n(`ZodArray`,(e,t)=>{Nn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ca(e,t,n,r),e.element=t.element,qa(e,`ZodArray`,{min(e,t){return this.check(mi(e,t))},nonempty(e){return this.check(mi(1,e))},max(e,t){return this.check(pi(e,t))},length(e,t){return this.check(hi(e,t))},unwrap(){return this.element}})});function Vo(e,t){return Oi(Bo,e,t)}var Ho=n(`ZodObject`,(e,t)=>{Rn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>la(e,t,n,r),p(e,`shape`,()=>t.shape),qa(e,`ZodObject`,{keyof(){return rs(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Fo()})},loose(){return this.clone({...this._zod.def,catchall:Fo()})},strict(){return this.clone({...this._zod.def,catchall:Lo()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return he(this,e)},safeExtend(e){return ge(this,e)},merge(e){return _e(this,e)},pick(e){return pe(this,e)},omit(e){return me(this,e)},partial(...e){return ve(cs,this,e[0])},required(...e){return ye(vs,this,e[0])}})});function Uo(e,t){return new Ho({type:`object`,shape:e??{},...g(t)})}function Wo(e,t){return new Ho({type:`object`,shape:e,catchall:Lo(),...g(t)})}function Go(e,t){return new Ho({type:`object`,shape:e,catchall:Fo(),...g(t)})}var Ko=n(`ZodUnion`,(e,t)=>{Bn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ua(e,t,n,r),e.options=t.options});function qo(e,t){return new Ko({type:`union`,options:e,...g(t)})}var Jo=n(`ZodDiscriminatedUnion`,(e,t)=>{Ko.init(e,t),Vn.init(e,t)});function Yo(e,t,n){return new Jo({type:`union`,options:t,discriminator:e,...g(n)})}var Xo=n(`ZodIntersection`,(e,t)=>{Hn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>da(e,t,n,r)});function Zo(e,t){return new Xo({type:`intersection`,left:e,right:t})}var Qo=n(`ZodTuple`,(e,t)=>{Gn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fa(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function $o(e,t,n){let r=t instanceof v;return new Qo({type:`tuple`,items:e,rest:r?t:null,...g(r?n:t)})}var es=n(`ZodRecord`,(e,t)=>{Yn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pa(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function ts(e,t,n){return!t||!t._zod?new es({type:`record`,keyType:Xa(),valueType:e,...g(t)}):new es({type:`record`,keyType:e,valueType:t,...g(n)})}var ns=n(`ZodEnum`,(e,t)=>{Xn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zi(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ns({...t,checks:[],...g(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new ns({...t,checks:[],...g(r),entries:i})}});function rs(e,t){return new ns({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...g(t)})}var is=n(`ZodLiteral`,(e,t)=>{Zn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qi(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function as(e,t){return new is({type:`literal`,values:Array.isArray(e)?e:[e],...g(t)})}var os=n(`ZodTransform`,(e,t)=>{Qn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aa(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new i(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ee(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Ee(t))}};let a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=a,n.fallback=!0,n)}});function ss(e){return new os({type:`transform`,transform:e})}var cs=n(`ZodOptional`,(e,t)=>{er.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ls(e){return new cs({type:`optional`,innerType:e})}var us=n(`ZodExactOptional`,(e,t)=>{tr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ds(e){return new us({type:`optional`,innerType:e})}var fs=n(`ZodNullable`,(e,t)=>{nr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ma(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ps(e){return new fs({type:`nullable`,innerType:e})}var ms=n(`ZodDefault`,(e,t)=>{rr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ga(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hs(e,t){return new ms({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}var gs=n(`ZodPrefault`,(e,t)=>{ar.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_a(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _s(e,t){return new gs({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}var vs=n(`ZodNonOptional`,(e,t)=>{or.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ha(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ys(e,t){return new vs({type:`nonoptional`,innerType:e,...g(t)})}var bs=n(`ZodCatch`,(e,t)=>{cr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>va(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xs(e,t){return new bs({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Ss=n(`ZodNaN`,(e,t)=>{lr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$i(e,t,n,r)});function Cs(e){return oi(Ss,e)}var ws=n(`ZodPipe`,(e,t)=>{ur.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ya(e,t,n,r),e.in=t.in,e.out=t.out});function Ts(e,t){return new ws({type:`pipe`,in:e,out:t})}var Es=n(`ZodReadonly`,(e,t)=>{fr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ba(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ds(e){return new Es({type:`readonly`,innerType:e})}var Os=n(`ZodLazy`,(e,t)=>{gr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ca(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function ks(e){return new Os({type:`lazy`,getter:e})}var As=n(`ZodPromise`,(e,t)=>{hr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function js(e){return new As({type:`promise`,innerType:e})}var Ms=n(`ZodFunction`,(e,t)=>{mr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ia(e,t,n,r)});function Ns(e){return new Ms({type:`function`,input:Array.isArray(e?.input)?$o(e?.input):e?.input??Vo(Fo()),output:e?.output??Fo()})}var Ps=n(`ZodCustom`,(e,t)=>{_r.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ra(e,t,n,r)});function Fs(e,t){return ki(Ps,e??(()=>!0),t)}function Is(e,t={}){return Ai(Ps,e,t)}function Ls(e,t){return ji(e,t)}function Rs(e,t={}){let n=new Ps({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...g(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function zs(e){let t=ks(()=>qo([Xa(e),xo(),To(),No(),Vo(t),ts(Xa(),t)]));return t}var Bs=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},Vs={pipe(){return Bs(this,arguments)}},Hs=function(){function e(){}return e.prototype=Vs,e}(),T=function(e,t){if(typeof e==`function`)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},E=e=>e,Us=e=>()=>e,Ws=Us(!0),Gs=Us(!1),Ks=Us(void 0),qs=Ks;function Js(e,t,n,r,i,a,o,s,c){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return a(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return o(a(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(o(a(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return c(s(o(a(i(r(n(t(e.apply(this,arguments)))))))))}}}function Ys(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function Xs(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i!==n&&t.set(i,i),i}}var Zs=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(`stack`);let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let e=Reflect.ownKeys(r);for(let n=0;n<e.length;n++)t.add(e[n]);r=Object.getPrototypeOf(r)}return t.has(`constructor`)&&typeof e.constructor==`function`&&n===e.constructor.prototype&&t.delete(`constructor`),t},Qs=new WeakSet,$s=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ec=0,tc=()=>{ec++};function nc(e){return typeof e==`string`}function rc(e){return typeof e==`number`}function ic(e){return typeof e==`boolean`}function ac(e){return typeof e==`bigint`}function oc(e){return typeof e==`symbol`}function sc(e){return nc(e)||rc(e)||oc(e)}function cc(e){return typeof e==`function`}function lc(e){return e===void 0}function uc(e){return e!==void 0}function dc(e){return e!=null}function fc(e){return!1}function pc(e){return!0}function mc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function hc(e){return typeof e==`object`&&!!e||cc(e)}var D=T(2,(e,t)=>hc(e)&&t in e);function gc(e){return D(e,Symbol.iterator)||nc(e)}var O=`~effect/Hash`,k=e=>{switch(typeof e){case`number`:return xc(e);case`bigint`:return j(e.toString(10));case`string`:return j(e);case`function`:case`object`:if(e===null)break;if(e instanceof Date)return Number.isNaN(e.getTime())?j(`Invalid Date`):j(e.toISOString());if(e instanceof RegExp)return j(e.toString());{if(Qs.has(e))return _c(e);let t=Ac.get(e);if(t!==void 0)return t;if(jc.has(e))return tc(),j(`[Circular]`);jc.add(e);let n=ec,r;try{r=`~effect/Hash`in e?e[O]():typeof e==`function`?_c(e):e instanceof DataView?Tc($s(e)):Array.isArray(e)||ArrayBuffer.isView(e)?Tc(e):e instanceof Map?Ec(e):e instanceof Set?Oc(e):Cc(e)}finally{jc.delete(e)}return n===ec&&Ac.set(e,r),r}}return yc(vc(j(String(e))))},_c=e=>(kc.has(e)||kc.set(e,yc(Math.random()*4294967296|0)),kc.get(e)),vc=e=>(e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^e>>>16),A=T(2,(e,t)=>vc(Math.imul(e,2654435761)+Math.imul(t,2246822507))),yc=e=>e&3221225471|e>>>1&1073741824,bc=new DataView(new ArrayBuffer(8)),xc=e=>{let t=e|0;return t===e?yc(t):(bc.setFloat64(0,e===e?e:NaN),yc(A(bc.getInt32(0),bc.getInt32(4))))},j=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return yc(t)},Sc=(e,t)=>{let n=12289;for(let r of t)n^=A(k(r),k(e[r]));return yc(n)},Cc=e=>Sc(e,Zs(e)),wc=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return yc(r)},Tc=e=>{let t=6151;for(let n of e)t=A(t,k(n));return yc(t)},Ec=wc(j(`Map`),([e,t])=>A(k(e),k(t))),Dc=j(`Set`),Oc=wc(Dc,e=>A(Dc,k(e))),kc=new WeakMap,Ac=new WeakMap,jc=new WeakSet,M=`~effect/Equal`;function N(){return arguments.length===1?e=>Mc(e,arguments[0]):Mc(arguments[0],arguments[1])}function Mc(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n===typeof t?n===`number`&&e!==e&&t!==t?!0:n!==`object`&&n!==`function`||Qs.has(e)||Qs.has(t)?!1:Nc(e,t):!1}function Nc(e,t){let n=Fc.length;for(let r=n;r-->0;)if(Fc[r]===e&&Ic[r]===t)return!0;if(n)return Pc(e,t);let r=Lc.get(e);r||Lc.set(e,r=new WeakMap);let i=r.get(t);return i===void 0&&r.set(t,i=Pc(e,t)),i}function Pc(e,t){Fc.push(e),Ic.push(t);try{return Rc(e,t)}finally{Fc.pop(),Ic.pop()}}var Fc=[],Ic=[],Lc=new WeakMap;function Rc(e,t){if(k(e)!==k(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let n=Jc(e);if(n!==Jc(t)||typeof e==`function`&&!n)return!1;if(n)return e[M](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:zc(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;return!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView?!1:n?Bc($s(e),$s(t)):Bc(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:Hc(e,t,Uc,Wc):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:Hc(e,t,k,Mc):Vc(e,t)}function zc(e,t){for(let n=0;n<e.length;n++)if(!Mc(e[n],t[n]))return!1;return!0}function Bc(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Vc(e,t){let n=Zs(e),r=Zs(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!Mc(e[i],t[i]))return!1;return!0}function Hc(e,t,n,r){let i=new Map,a=0;for(let e of t){let t=n(e),r=i.get(t);r?r.push(e):i.set(t,[e]),a++}outer:for(let t of e){let e=i.get(n(t));if(e){for(let n=0;n<e.length;n++)if(r(t,e[n])){e[n]=e[e.length-1],e.pop(),a--;continue outer}}return!1}return a===0}var Uc=e=>k(e[0]),Wc=(e,t)=>Mc(e[0],t[0])&&Mc(e[1],t[1]),Gc=()=>0;function Kc(e,t){return qc((n,r)=>e(n[0],r[0])&&t(n[1],r[1]))}function qc(e){return function(t,n){return Hc(t,n,Gc,e)}}var Jc=e=>D(e,M),Yc=e=>(t,n)=>t===n||e(t,n),Xc=(e,t)=>e===t,Zc=()=>Xc;function Qc(e){return Yc((t,n)=>{if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e[r](t[r],n[r]))return!1;return!0})}function $c(e){return Yc((t,n)=>{if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e(t[r],n[r]))return!1;return!0})}var el=e=>e.length>0;function tl(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function nl(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&tl(e,n,t[n])}var rl=Symbol.for(`~effect/Redactable`),il=e=>D(e,rl);function al(e){return il(e)?ol(e):e}function ol(e){return e[rl](globalThis[`~effect/Fiber/currentFiber`]?.context??ll)}var sl=`~effect/Fiber/currentFiber`,cl=new Map,ll={"~effect/Context":{},base:cl,depth:0,mapUnsafe:cl,pipe(){return Bs(this,arguments)}};function P(e,t){let n=t?.space??0,r=new WeakSet,i=n?typeof n==`number`?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,t=0){try{return l(e,t)}catch{return(typeof e==`object`&&e||typeof e==`function`)&&r.delete(e),`[inspection threw]`}}function l(e,n=0){if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||e==null||typeof e==`boolean`||typeof e==`symbol`)return String(e);if(typeof e==`bigint`)return String(e)+`n`;if(typeof e==`object`||typeof e==`function`){if(r.has(e))return ul;r.add(e);let l;if(rl in e)l=c(ol(e),n);else if(Array.isArray(e))l=!i||e.length<=1?`[${e.map(e=>c(e,n)).join(`,`)}]`:`[\n${a(n+1)}${e.map(e=>c(e,n+1)).join(`,
|
|
66
|
+
`+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=pl(e);else if(!t?.ignoreToString&&D(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=ml(e);l=e instanceof Error&&e.cause!==void 0?`${t} (cause: ${c(e.cause,n)})`:t}else if(Symbol.iterator in e)l=`${e.constructor.name}(${c(Array.from(e),n)})`;else{let t=s(e);if(!i||t.length<=1){let r=`{${t.map(t=>`${dl(t)}:${c(hl(e,t),n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${dl(t)}: ${c(hl(e,t),n+1)}`).join(`,
|
|
67
|
+
`)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var ul=`[Circular]`;function dl(e){return typeof e==`string`?JSON.stringify(e):String(e)}function fl(e){return e.map(e=>`[${dl(e)}]`).join(``)}function pl(e){try{return e.toISOString()}catch{return`Invalid Date`}}function ml(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function hl(e,t){try{return e[t]}catch{return`[property access threw]`}}function gl(e,t){let n=[];return JSON.stringify(e,function(e,t){let r=Object.getOwnPropertyDescriptor(this,e)?.value,i=D(r,rl)?al(r):al(t);if(typeof i==`bigint`)return P(i);if(typeof i!=`object`||!i)return i;let a=i instanceof Error&&!D(i,`toJSON`)?{...i,name:i.name,message:i.message}:i;for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(i))return;if(n.push(i),a!==i&&n.push(a),!_l(a)||vl(a))return a;let o=new Proxy(a,{get(e,t){let n=Reflect.get(e,t,e);return Object.getOwnPropertyDescriptor(e,t)?.get===void 0?n:al(n)}});return n.push(o),o},t?.space)??`null`}function _l(e){for(let t of Object.getOwnPropertyNames(e))if(Object.getOwnPropertyDescriptor(e,t)?.get!==void 0)return!0;return!1}function vl(e){for(let t of[Number.prototype.valueOf,Boolean.prototype.valueOf,String.prototype.valueOf])try{return Reflect.apply(t,e,[]),!0}catch{}return!1}var yl=Symbol.for(`nodejs.util.inspect.custom`),bl=e=>{try{return e=al(e),D(e,`toJSON`)&&cc(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(bl):e}catch{return`[toJSON threw]`}},xl=(e,t=2)=>{if(typeof e==`string`)return e;try{return typeof e==`object`?gl(e,{space:t}):P(e,{space:t})}catch{return String(e)}},Sl={toJSON(){return bl(this)},[yl](){return this.toJSON()},toString(){return P(this.toJSON())}},Cl=(()=>{let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,`writable`)?e.writable===!0:e.set!==void 0})(),wl=()=>Error.stackTraceLimit,Tl=e=>{Cl&&(Error.stackTraceLimit=e)},El=class{constructor(e){this.value=e,this.done=!1}next(e){return this.done?(this.value=e,this):(this.done=!0,{value:this.value,done:!1})}},Dl=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return wl()!==0&&t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})(),Ol=`~effect/Effect`,kl=`~effect/Exit`,Al={_A:E,_E:E,_R:E},jl=`${Ol}/identifier`,F=`${Ol}/args`,I=`${Ol}/evaluate`,L=`${Ol}/successCont`,R=`${Ol}/failureCont`,Ml=`${Ol}/ensureCont`,Nl=Symbol.for(`effect/Effect/Yield`),Pl={pipe(){return Bs(this,arguments)},toJSON(){return{...this}},toString(){return P(this.toJSON(),{ignoreToString:!0,space:2})},[yl](){return this.toJSON()}},Fl={[Ol]:Al,...Pl,[Symbol.iterator](){return new El(this)},toJSON(){return{_id:`Effect`,op:this[jl],...F in this?{args:this[F]}:void 0}}},Il=e=>D(e,Ol),Ll=e=>D(e,kl),Rl=`~effect/Cause`,zl=`~effect/Cause/Reason`,Bl=e=>D(e,Rl),Vl=class{constructor(e){this[Rl]=Rl,this.reasons=e}pipe(){return Bs(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${P(this.reasons)})`}[yl](){return this.toJSON()}[M](e){return Bl(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>N(t,e.reasons[n]))}[O](){return Tc(this.reasons)}},Hl=new WeakMap,Ul=class{[zl];annotations;_tag;constructor(e,t,n){if(this[zl]=zl,this._tag=e,t!==Wl&&typeof n==`object`&&n&&t.size>0){let e=Hl.get(n);e&&(t=new Map([...e,...t])),Hl.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return Bs(this,arguments)}toString(){return P(this)}[yl](){return this.toString()}},Wl=new Map,Gl=class extends Ul{constructor(e,t=Wl){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${P(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[M](e){return eu(e)&&N(this.error,e.error)&&N(this.annotations,e.annotations)}[O](){return A(j(this._tag))(A(k(this.error))(k(this.annotations)))}},Kl=e=>new Vl(e),ql=(e,t)=>{let n=new Map,r=[];for(let i of e.concat(t)){let e=k(i),t=n.get(e);if(t===void 0)n.set(e,[i]);else if(t.some(e=>N(e,i)))continue;else t.push(i);r.push(i)}return r},Jl=T(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new Vl(ql(e.reasons,t.reasons));return N(e,n)?e:n}),Yl=new Vl([]),Xl=e=>new Vl([new Gl(e)]),Zl=class extends Ul{constructor(e,t=Wl){super(`Die`,t,e),this.defect=e}toString(){return`Die(${P(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[M](e){return tu(e)&&N(this.defect,e.defect)&&N(this.annotations,e.annotations)}[O](){return A(j(this._tag))(A(k(this.defect))(k(this.annotations)))}},Ql=e=>new Vl([new Zl(e)]),$l=T(e=>Bl(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new Vl(e.reasons.map(e=>e.annotate(t,n)))),eu=e=>e._tag===`Fail`,tu=e=>e._tag===`Die`,nu=e=>e._tag===`Interrupt`;function ru(e){return lu(`Effect.evaluate: Not implemented`)}var z=e=>({...Fl,[jl]:e.op,[I]:e[I]??ru,[L]:e[L],[R]:e[R],[Ml]:e[Ml]}),iu=e=>{let t=z(e),n=function(e){this[F]=e};return n.prototype=t,function(e){return new n(e)}},au=e=>{let t={[kl]:kl,_tag:e.op,get[e.prop](){return this[F]},...z(e),toString(){return`${e.op}(${P(this[F])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[F]}},[M](e){return Ll(e)&&e._tag===this._tag&&N(this[F],e[F])},[O](){return A(j(e.op),k(this[F]))}},n=function(e){this[F]=e};return n.prototype=t,function(e){return new n(e)}},B=au({op:`Success`,prop:`value`,[I](e){let t=e.getCont(L);return t?t[L](this[F],e,this):e.yieldWith(this)}}),ou={key:`effect/Cause/StackTrace`},su={key:`effect/Cause/InterruptorStackTrace`},V=au({op:`Failure`,prop:`cause`,[I](e){let t=this[F],n=!1;e.cache.stackFrame&&(t=$l(t,{mapUnsafe:new Map([[ou.key,e.cache.stackFrame]])}),n=!0);let r=e.getCont(R),i=e._interruptedCause;if(i&&e.interruptible){let a=!1;for(;r&&e.interruptible;)a||=jl in r,r=e.getCont(R);a&&(t=Kl(t.reasons.filter(e=>e._tag!==`Fail`))),t=Jl(t,i),n=!0}return r?r[R](t,e,n?void 0:this):e.yieldWith(n?V(t):this)}}),cu=e=>V(Xl(e)),lu=e=>V(Ql(e)),H=iu({op:`WithFiber`,[I](e){return this[F](e)}}),uu=function(){class e extends globalThis.Error{}let t=z({op:`YieldableError`,[I](){return cu(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),du=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends uu{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(nl(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),fu=e=>{class t extends du{_tag=e}return t.prototype.name=e,t};fu(`NoSuchElementError`);var pu=`~effect/Cause/Done`,mu=e=>D(e,pu),hu={[pu]:pu,_tag:`Done`,value:void 0},gu=e=>e===void 0?hu:{[pu]:pu,_tag:`Done`,value:e},_u=cu(hu),vu=e=>e===void 0?_u:cu(gu(e)),yu=`~effect/Option`,bu={[yu]:{_A:e=>e},...Pl,[Symbol.iterator](){return new El(this)}},xu=Object.defineProperty(Object.assign(Object.create(bu),{_tag:`Some`,_op:`Some`,[M](e){return wu(e)&&Eu(e)&&N(this.value,e.value)},[O](){return A(k(this._tag))(k(this.value))},toString(){return`some(${P(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:bl(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),Su=k(`None`),Cu=Object.assign(Object.create(bu),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[M](e){return wu(e)&&Tu(e)},[O](){return Su},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),wu=e=>D(e,yu),Tu=e=>e._tag===`None`,Eu=e=>e._tag===`Some`,Du=Object.create(Cu),Ou=function(e){this.value=e};Ou.prototype=xu;var ku=e=>new Ou(e),Au=`~effect/Result`,ju={[Au]:{_A:e=>e,_E:e=>e},...Pl,[Symbol.iterator](){return new El(this)}},Mu=Object.assign(Object.create(ju),{_tag:`Success`,_op:`Success`,[M](e){return Pu(e)&&Iu(e)&&N(this.success,e.success)},[O](){return A(k(this._tag))(k(this.success))},toString(){return`success(${P(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:bl(this.success)}}}),Nu=Object.assign(Object.create(ju),{_tag:`Failure`,_op:`Failure`,[M](e){return Pu(e)&&Fu(e)&&N(this.failure,e.failure)},[O](){return A(k(this._tag))(k(this.failure))},toString(){return`failure(${P(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:bl(this.failure)}}}),Pu=e=>D(e,Au),Fu=e=>e._tag===`Failure`,Iu=e=>e._tag===`Success`,Lu=function(e){this.failure=e};Lu.prototype=Nu;var Ru=e=>new Lu(e),zu=function(e){this.success=e};zu.prototype=Mu;var Bu=e=>new zu(e),Vu=e=>Fu(e)?Du:ku(e.success);function Hu(e){return(t,n)=>t===n?0:e(t,n)}var Uu=Hu((e,t)=>e<t?-1:1),Wu=Hu((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),Gu=Hu((e,t)=>e<t?-1:1),Ku=T(2,(e,t)=>Hu((n,r)=>e(t(n),t(r)))),qu=Ku(Wu,e=>e.getTime()),Ju=e=>T(2,(t,n)=>e(t,n)===-1),Yu=e=>T(2,(t,n)=>e(t,n)===1),Xu=e=>T(2,(t,n)=>e(t,n)!==1),Zu=e=>T(2,(t,n)=>e(t,n)!==-1),Qu=()=>Du,$u=ku,ed=wu,td=Tu,nd=Eu,rd=T(2,(e,{onNone:t,onSome:n})=>td(e)?t():n(e.value)),id=T(2,(e,t)=>td(e)?t():e.value),ad=T(2,(e,t)=>td(e)?t():e),od=e=>e==null?Qu():$u(e),sd=id(Ks),cd=e=>(...t)=>{try{return $u(e(...t))}catch{return Qu()}},ld=T(2,(e,t)=>td(e)?Qu():$u(t(e.value))),ud=T(2,(e,t)=>td(e)?Qu():t(e.value))(E),dd=e=>td(e)?[]:[e.value],fd=T(2,(e,t)=>td(e)?Qu():t(e.value)?$u(e.value):Qu()),pd=Bu,md=Ru,hd=Fu,gd=Iu,_d=Vu,vd=T(2,(e,t)=>hd(e)?md(t(e.failure)):e),yd=T(2,(e,t)=>gd(e)?pd(t(e.success)):e),bd=T(2,(e,{onFailure:t,onSuccess:n})=>hd(e)?t(e.failure):n(e.success)),xd=T(2,(e,t)=>{if(gd(e))return e.success;throw t(e.failure)})(E),Sd=globalThis.Array,Cd=e=>Sd.isArray(e)?e:Sd.from(e),wd=T(2,(e,t)=>[...e,t]);Sd.isArray;var Td=el,Ed=el,Dd=()=>[],Od=e=>[e],kd=T(2,(e,t)=>e.map(t)),Ad=$c,jd=e=>z({op:e.label,[I]:e.evaluate}),Md=`~effect/Context/Service`,Nd=function(){function e(){}let t=e;Object.setPrototypeOf(t,Pd);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[Id]=Id,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&Fd.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},Pd={[Md]:Md,...jd({label:`Service`,evaluate(e){return B(U(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return $d(this,e)},use(e){return H(t=>e(U(t.context,this)))},useSync(e){return H(t=>B(e(U(t.context,this))))}},Fd=new Set,Id=`~effect/Context/Reference`,Ld=`~effect/Context`,Rd=8,zd=8,Bd=(e,t,n,r)=>{let i=Object.create(qd);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},Vd=(e,t)=>{t&&(Vd(e,t.parent),e.set(t.key,t.value))},Hd=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return Vd(t,e.overlay),e._flat=t},Ud=(e,t)=>{let n=new Map(e.mapUnsafe);return t(n),Kd(n)},Wd=Symbol(),Gd=(e,t)=>{let n=e;for(let e=n.overlay;e;e=e.parent)if(e.key===t)return e.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?Wd:(n.overlay&&++n.baseHits>=n.base.size&&n.baseHits>=zd&&(n.base=Hd(n),n.overlay=void 0,n.depth=0),r)},Kd=e=>Bd(void 0,e,void 0,0),qd={get mapUnsafe(){return Hd(this)},...Pl,[Ld]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[M](e){if(!Yd(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[e,r]of t)if(!n.has(e)||!N(r,n.get(e)))return!1;return!0},[O](){return xc(this.mapUnsafe.size)}},Jd=(e,t)=>e.cacheRoot===t.cacheRoot,Yd=e=>D(e,Ld),Xd=e=>!!e[Id],Zd=()=>Qd,Qd=Kd(new Map),$d=(e,t)=>Kd(new Map([[e.key,t]])),ef=T(3,(e,t,n)=>tf(e,t.key,n)),tf=(e,t,n)=>{let r=e,i=Fd.has(t)?void 0:r.cacheRoot;if(r.depth>=Rd){let e=new Map(r.mapUnsafe);return e.set(t,n),Bd(i,e,void 0,0)}return Bd(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},nf=(e,t)=>{let n=Gd(e,t);return n===Wd?void 0:n},rf=T(2,(e,t)=>{let n=Gd(e,t.key);if(n===Wd){if(Xd(t))return of(t);throw sf(t)}return n}),U=rf,af=`~effect/Context/defaultValue`,of=e=>af in e?e[af]:e[af]=e.defaultValue(),sf=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
|
|
68
68
|
`);e.splice(1,3),t.stack=e.join(`
|
|
69
|
-
`)}return t},
|
|
70
|
-
`),a=[r];for(let e=1;e<i.length&&!/Generator\.next|~effect\/(?:Effect|Utils)/.test(i[e]);e++)a.push(i[e]);return n?
|
|
69
|
+
`)}return t},cf=T(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:Ud(e,e=>t.mapUnsafe.forEach((t,n)=>e.set(n,t)))),W=Nd,lf=`~effect/Duration`,uf=BigInt(0),df=BigInt(1),ff=BigInt(2),pf=BigInt(10),mf=BigInt(1e3),hf=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),gf=e=>hf(e*1e6),_f=(e,t)=>{let n=e.indexOf(`.`);if(n===-1)return BigInt(e)*t;let r=e[0]===`-`,i=e.slice(n+1),a=pf**BigInt(i.length),o=(BigInt(e.slice(+!!r,n))*a+BigInt(i))*t,s=o/a+(o%a*ff>=a?df:uf);return r?-s:s},vf=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,yf=e=>{switch(typeof e){case`number`:return Mf(e);case`bigint`:return jf(e);case`string`:{if(e===`Infinity`)return kf;if(e===`-Infinity`)return Af;let t=vf.exec(e);if(!t)break;let[n,r,i]=t;if(i===`nano`||i===`nanos`)return jf(_f(r,df));if(i===`micro`||i===`micros`)return jf(_f(r,mf));let a=Number(r);switch(i){case`milli`:case`millis`:return Mf(a);case`second`:case`seconds`:return Nf(a);case`minute`:case`minutes`:return Pf(a);case`hour`:case`hours`:return Ff(a);case`day`:case`days`:return If(a);case`week`:case`weeks`:return Lf(a)}break}case`object`:{if(e===null)break;if(lf in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(rc)?bf(e):Number.isNaN(e[0])||Number.isNaN(e[1])?Of:e[0]===-1/0||e[1]===-1/0?Af:e[0]===1/0||e[1]===1/0?kf:G(hf(e[0]*1e9+e[1]));let t=e,n=0;return t.weeks&&(n+=t.weeks*6048e5),t.days&&(n+=t.days*864e5),t.hours&&(n+=t.hours*36e5),t.minutes&&(n+=t.minutes*6e4),t.seconds&&(n+=t.seconds*1e3),t.milliseconds&&(n+=t.milliseconds),!t.microseconds&&!t.nanoseconds?G(n):G(hf(n*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return bf(e)},bf=e=>{throw Error(`Invalid Input: ${e}`)},xf={_tag:`Millis`,millis:0},Sf={_tag:`Infinity`},Cf={_tag:`NegativeInfinity`},wf={[lf]:lf,[O](){switch(this.value._tag){case`Millis`:{let e=this.value.millis*1e6;return Number.isFinite(e)?k(hf(e)):xc(this.value.millis)}case`Nanos`:return k(this.value.nanos);default:return Cc(this.value)}},[M](e){return Tf(e)&&Wf(this,e)},toString(){switch(this.value._tag){case`Infinity`:return`Infinity`;case`NegativeInfinity`:return`-Infinity`;case`Nanos`:return`${this.value.nanos} nanos`;case`Millis`:return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case`Millis`:return{_id:`Duration`,_tag:`Millis`,millis:this.value.millis};case`Nanos`:return{_id:`Duration`,_tag:`Nanos`,nanos:String(this.value.nanos)};case`Infinity`:return{_id:`Duration`,_tag:`Infinity`};case`NegativeInfinity`:return{_id:`Duration`,_tag:`NegativeInfinity`}}},[yl](){return this.toJSON()},pipe(){return Bs(this,arguments)}},G=e=>{let t=Object.create(wf);return t.value=typeof e==`number`?isNaN(e)||e===0||Object.is(e,-0)?xf:Number.isFinite(e)?Number.isInteger(e)?{_tag:`Millis`,millis:e}:{_tag:`Nanos`,nanos:gf(e)}:e>0?Sf:Cf:e===uf?xf:{_tag:`Nanos`,nanos:e},t},Tf=e=>D(e,lf),Ef=e=>e.value._tag!==`Infinity`&&e.value._tag!==`NegativeInfinity`,Df=e=>{switch(e.value._tag){case`Millis`:return e.value.millis===0;case`Nanos`:return e.value.nanos===uf;case`Infinity`:case`NegativeInfinity`:return!1}},Of=G(0),kf=G(1/0),Af=G(-1/0),jf=e=>G(e),Mf=e=>G(e),Nf=e=>G(e*1e3),Pf=e=>G(e*6e4),Ff=e=>G(e*36e5),If=e=>G(e*864e5),Lf=e=>G(e*6048e5),Rf=e=>Vf(yf(e),{onMillis:E,onNanos:e=>Number(e)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),zf=e=>Vf(yf(e),{onMillis:e=>e/1e3,onNanos:e=>Number(e)/1e9,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),Bf=e=>{let t=yf(e);switch(t.value._tag){case`Infinity`:case`NegativeInfinity`:throw Error(`Cannot convert infinite duration to nanos`);case`Nanos`:return t.value.nanos;case`Millis`:return gf(t.value.millis)}},Vf=T(2,(e,t)=>{switch(e.value._tag){case`Millis`:return t.onMillis(e.value.millis);case`Nanos`:return t.onNanos(e.value.nanos);case`Infinity`:return t.onInfinity();case`NegativeInfinity`:return(t.onNegativeInfinity??t.onInfinity)()}}),Hf=T(3,(e,t,n)=>e.value._tag===`Infinity`||e.value._tag===`NegativeInfinity`||t.value._tag===`Infinity`||t.value._tag===`NegativeInfinity`?n.onInfinity(e,t):e.value._tag===`Millis`?t.value._tag===`Millis`?n.onMillis(e.value.millis,t.value.millis):n.onNanos(Bf(e),t.value.nanos):n.onNanos(e.value.nanos,Bf(t))),Uf=(e,t)=>Hf(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t,onInfinity:(e,t)=>e.value._tag===t.value._tag}),Wf=T(2,(e,t)=>Uf(e,t)),Gf=e=>t=>{let n=e(t);return hd(n)?Qu():$u(n.success)},Kf=W(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new Zf}),qf=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},Jf=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},Yf=e=>{try{return Jf(e)}catch{return qf(e)}},Xf=class{buckets=[];scheduleTask(e,t){let n=this.buckets,r=n.length,i,a=0;for(;a<r&&!(n[a][0]>t);a++)i=n[a];i&&i[0]===t?i[1].push(e):a===r?n.push([t,[e]]):n.splice(a,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}},Zf=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?qf:Yf)}shouldYield(e){return e.currentOpCount>=e.cache.maxOpsBeforeYield}makeDispatcher(){return new Qf(this.setImmediate)}},Qf=class{tasks=new Xf;running=void 0;setImmediate;constructor(e=Yf){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let n=e[t][1];for(let e=0;e<n.length;e++)n[e]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},$f=W(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),ep=W(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),tp=`effect/Tracer/ParentSpan`;Nd()(tp,{fiberCached:!0});var np=`effect/Tracer`,rp=`effect/Metric/FiberRuntimeMetrics`,ip=W(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:Ks}),ap=W(`effect/References/TracerEnabled`,{fiberCached:!0,defaultValue:Ws}),op=W(`effect/References/CurrentLogAnnotations`,{defaultValue:()=>({})}),sp=W(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),cp=W(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),lp=W(`effect/References/CurrentLogSpans`,{defaultValue:()=>[]}),up=class extends Ul{constructor(e,t=Wl){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[M](e){return nu(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[O](){return A(j(`${this._tag}:${this.fiberId}`))(_c(this.annotations))}},dp=e=>new Vl([new up(e)]),fp=e=>{let t=e.reasons.find(eu);return t?pd(t):md(e)},pp=e=>{for(let t=0;t<e.reasons.length;t++){let n=e.reasons[t];if(n._tag===`Fail`)return pd(n.error)}return md(e)},mp=Gf(pp),hp=e=>{let t=e.reasons.find(tu);return t?pd(t.defect):md(e)},gp=e=>e.reasons.some(nu),_p=e=>{let t;for(let n=0;n<e.reasons.length;n++){let r=e.reasons[n];r._tag===`Interrupt`&&(t??=new Set,r.fiberId!==void 0&&t.add(r.fiberId))}return t?pd(t):md(e)},vp=e=>e.reasons.length>0&&e.reasons.every(nu),yp=T(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>eu(e)?(n=!0,new Gl(t(e.error),e.annotations)):e);return n?Kl(r):e}),bp=e=>{let t;for(let n of e.reasons){if(n._tag===`Fail`)return n.error;n._tag===`Die`&&(t??=n)}return t===void 0?e.reasons.length>0?new globalThis.Error(`All fibers interrupted without error`):new globalThis.Error(`Empty cause`):t.defect},xp=(e,t)=>{let n=[],r=[];if(e.reasons.length===0)return n;let i=wl();i!==0&&Tl(1);try{for(let i of e.reasons){if(i._tag===`Interrupt`){r.push(i);continue}n.push(Sp(i._tag===`Die`?i.defect:i.error,i.annotations,t))}if(n.length===0){let e=Error(`The fiber was interrupted by:`);e.name=`InterruptCause`,e.stack=Dp(e,r);let i=new globalThis.Error(`All fibers interrupted without error`,{cause:e});i.name=`InterruptError`,i.stack=`${i.name}: ${i.message}`,n.push(Sp(i,r[0].annotations,t))}}finally{i!==0&&Tl(i)}return n},Sp=(e,t,n)=>{let r=typeof e,i;if(e&&r===`object`){if(i=new globalThis.Error(Cp(e),{cause:e.cause?Sp(e.cause):void 0}),typeof e.name==`string`&&(i.name=e.name),typeof e.stack==`string`)i.stack=Tp(e.stack,i,t);else{let e=`${i.name}: ${i.message}`;i.stack=t?Ep(e,t):e}n?.includeCauseInStack&&(i.stack=Ap(i));for(let t of Object.keys(e))t in i||(i[t]=e[t])}else{i=new globalThis.Error(e?r===`string`?e:gl(e):`Unknown error: ${e}`);let n=`${i.name}: ${i.message}`;i.stack=t?Ep(n,t):n}return i},Cp=e=>{if(typeof e.message==`string`)return e.message;if(typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return gl(e)},wp=/\((.*)\)/g,Tp=(e,t,n)=>{let r=`${t.name}: ${t.message}`,i=(e.startsWith(r)?e.slice(r.length):e).split(`
|
|
70
|
+
`),a=[r];for(let e=1;e<i.length&&!/Generator\.next|~effect\/(?:Effect|Utils)/.test(i[e]);e++)a.push(i[e]);return n?Ep(a.join(`
|
|
71
71
|
`),n):a.join(`
|
|
72
|
-
`)},
|
|
73
|
-
`)},
|
|
74
|
-
`)},
|
|
75
|
-
`),
|
|
76
|
-
`),r=`${t}[cause]: ${n[0]}`;for(let e=1,i=n.length;e<i;e++)r+=`\n${t}${n[e]}`;return e.cause&&(r+=` {\n${kp(e.cause,`${t} `)}\n${t}}`),r},Ap=`~effect/Fiber`,jp={_A:E,_E:E},Mp={id:0},Np=(()=>{try{return globalThis.process?.getBuiltinModule?.(`node:async_hooks`)?.AsyncResource}catch{return}})(),Pp=()=>Np===void 0?void 0:new Np(`effect/Fiber`),Fp=()=>globalThis[ol],Ip=class{constructor(e,t=!0){this.setContext(e),this.id=++Mp.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=void 0,this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this._parent=void 0,this._asyncContext=void 0,this.cache.runtimeMetrics?.recordFiberStart(this.context)}get[Ap](){return jp}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(e){return W(this.context,e)}addObserver(e){return this._exit?(e(this._exit),Ks):(this._observers===void 0?this._observers=[e]:this._observers.push(e),()=>this.removeObserver(e))}removeObserver(e){if(this._exit||this._observers===void 0)return;let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)}interruptUnsafe(e,t){if(this._exit)return;let n=lp(e);this.cache.stackFrame&&(n=Ql(n,Zd(au,this.cache.stackFrame))),t&&(n=Ql(n,t)),this._interruptedCause=this._interruptedCause?ql(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(J(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._asyncContext!==void 0){let t=this._asyncContext;return this._asyncContext=void 0,t.runInAsyncScope(this.evaluate,this,e)}if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===Ml){this._asyncContext=Pp();return}let n=Bp.interruptChildren&&Bp.interruptChildren(this);if(n!==void 0)return this.evaluate(Q(n,()=>t));if(this._exit=t,this.cache.runtimeMetrics?.recordFiberEnd(this.context,this._exit),this._parent&&=(this._parent._children?.delete(this),void 0),this._observers!==void 0){let e=this._observers;this._observers=void 0;for(let n=0;n<e.length;n++)e[n](t)}this._stack.length=0,this._children=void 0,this.context=Yd()}runLoop(e){let t=globalThis[ol];globalThis[ol]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;)try{this._deferredInterrupt&&(this._deferredInterrupt=!1,i=J(this._interruptedCause)),this.currentOpCount++;let e=this.cache;if(!r&&!e.preventYield&&e.scheduler.shouldYield(this)){r=!0;let e=i;i=Q(Zp,()=>e)}if(i=e.tracerContext?e.tracerContext(i,this):i[I](this),i===Ml){let e=this._yielded;if(Ol in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return Ml}}catch(e){if(!D(i,I))return cu(`Fiber.runLoop: Not a valid effect: ${String(i)}`);i=cu(e)}}finally{this._running=n,globalThis[ol]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,Rp;for(;;){let t=this._stack.pop();if(!t)return;let n=t[jl];if(n!==void 0){let r=n.call(t,this);if(r)return r[e]=r,r}if(t[e])return t}}succeedWith(e){if(!(++this.currentOpCount&zp-1))return B(e);let t=this.getCont(L);return t?t[L](e,this):this.yieldWith(B(e))}yieldWith(e){return this._yielded=e,Ml}children(){return this._children??=new Set}pipe(){return zs(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&Kd(t,e))return;let n=e.cacheRoot,r=n._fiberCache??=Lp(e);this.cache?.scheduler!==r.scheduler&&(this._dispatcher=void 0),this.cache=r}get currentSpanLocal(){let e=this.cache.span;return e?._tag===`Span`?e:void 0}},Lp=e=>{let t=ef(e,ep);return{scheduler:W(e,Wf),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:W(e,rp),span:ef(e,$f),logLevel:W(e,ap),minimumLogLevel:W(e,op),stackFrame:W(e,np),runtimeMetrics:ef(e,tp),maxOpsBeforeYield:W(e,Zf),preventYield:W(e,Qf)}},Rp={[L](e,t){return J(t._interruptedCause)},[R](e,t){return J(t._interruptedCause)}},zp=32,Bp={interruptChildren:void 0},Vp=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(ou.key,e.cache.stackFrame),Wd(t)},Hp=e=>{if(e._children!==void 0&&e._children.size!==0)return Jp(e._children)},Up=e=>{let t=e;return t._exit?q(t._exit):cm(n=>t._exit?n(q(t._exit)):Y(e.addObserver(e=>n(q(e)))))},Wp=e=>cm(t=>{let n=e[Symbol.iterator](),r=[],i;function a(){let e=n.next();for(;!e.done;){if(e.value._exit){r.push(e.value._exit),e=n.next();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t(q(r))}return a(),Y(()=>i?.())}),Gp=e=>{let t=e;return t._exit?t._exit:cm(n=>t._exit?n(t._exit):Y(e.addObserver(n)))},Kp=e=>H(t=>qp(e,t.id)),qp=T(e=>D(e[0],Ap),(e,t,n)=>H(r=>{let i=Vp(r);return i=i&&n?of(i,n):i??n,e.interruptUnsafe(t,i),Am(Up(e))})),Jp=e=>H(t=>{let n=Vp(t),r=Td();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return Am(Wp(r))}),q=B,J=V,Yp=su,Y=ru({op:`Sync`,[I](e){let t=this[F](),n=e.getCont(L);return n?n[L](t,e):e.yieldWith(B(t))}}),X=ru({op:`Suspend`,[I](e){return this[F]()}}),Xp=vd({onFailure:Yp,onSuccess:q}),Zp=ru({op:`Yield`,[I](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(Um)},this[F]??0),e.yieldWith(()=>{t=!0})}})(0),Qp=q(Zu()),$p=e=>X(()=>J(e())),em=e=>cu(e),tm=e=>X(()=>Yp(e())),Z=q(void 0),nm=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new a_(e,`An error occurred in Effect.try`):e.catch;return X(()=>{try{return q(t())}catch(e){return Yp(n(e))}})},rm=e=>om(function(t,n){e(n).then(e=>t(q(e)),e=>t(em(e)))},e.length!==0),im=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new a_(e,`An error occurred in Effect.tryPromise`):e.catch;return om(function(e,r){let i=e=>X(()=>{try{return Yp(El(()=>n(e)))}catch(e){return em(e)}});try{t(r).then(t=>e(q(t)),t=>e(i(t)))}catch(t){e(i(t))}},t.length!==0)},am=e=>H(t=>e(t.id)),om=function(){let e=z({op:`Async`,[I](e){let t=!1,n=!1,r=this.withSignal?new AbortController:void 0,i=this.register.call(e.cache.scheduler,r=>{t||(t=!0,n?e.evaluate(r):n=r)},r?.signal);return n===!1?(n=!0,e._yielded=()=>{t=!0},r===void 0&&i===void 0||e._stack.push(sm(()=>(t=!0,r?.abort(),i??Um))),Ml):n}}),t=function(e,t){this.register=e,this.withSignal=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),sm=ru({op:`AsyncFinalizer`,[jl](e){e.interruptible&&(e.interruptible=!1,e._stack.push(dg))},[R](e,t){return mp(e)?Q(Fh(V(e),this[F]()),()=>J(e)):J(e)}}),cm=e=>om(e,e.length>=2),lm=cm(Ks),um=(...e)=>{if(e.length===1){let t=e[0];return X(()=>hm(t()))}let[t,n]=e;return X(()=>hm(n.call(t.self)))},dm=(e,...t)=>{let n=t.length===0?function(){return X(()=>hm(e.apply(this,arguments)))}:function(){let n=X(()=>hm(e.apply(this,arguments)));for(let e=0;e<t.length;e++)n=t[e](n,...arguments);return n};return fm(e.length,n)},fm=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),pm=(e,...t)=>fm(e.length,t.length===0?function(){return mm(()=>e.apply(this,arguments))}:function(){let n=mm(()=>e.apply(this,arguments));for(let e of t)n=e(n,...arguments);return n}),mm=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return q(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}if(i&&i._tag===`Failure`)return r.value;{let n=!0;return X(()=>n?(n=!1,Q(r.value,e=>hm(t,e))):X(()=>hm(e())))}}}catch(e){return em(e)}},hm=function(){let e=z({op:`Iterator`,[L](e,t){let n=this.iterator;for(;;){let r=n.next(e);if(r.done)return q(r.value);if(!$(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[I](e){return this[L](this.initial,e)}}),t=function(e,t){this.iterator=e,this.initial=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),gm=T(2,(e,t)=>new ym(e,bm,q(t))),_m=function(e){return e._stack.push(this),this[F]},vm=z({op:`OnSuccess`,[I]:_m}),ym=function(e,t,n){this[F]=e,this[L]=t,this.payload=n};ym.prototype=vm;var bm=function(){return this.payload},xm=function(e,t){return t.succeedWith(this.payload)},Sm=(()=>{let e=`~effect/Effect/stackProbe`;return{[e]:function(){return Error().stack}}[e]()?.includes(`[as `+e+`]`)===!0})(),Cm=function(e,t){let n=this.payload;return t.succeedWith(Sm?n(e):El(()=>n(e)))},wm=function(e){let t=this.payload;return t(e)},Tm=function(e){let t=this.payload;return new ym(t(e),xm,e)},Em=function(e){return new ym(this.payload,xm,e)},Dm=e=>Im(e,Qu),Om=T(2,(e,t)=>new ym(e,Fl(t)?bm:wm,t)),km=T(2,(e,t)=>new ym(e,Fl(t)?Em:Tm,t)),Am=e=>new ym(e,bm,Um),jm=(e,t)=>H(n=>{let r=new Set;return tg(n,()=>r.size===0?void 0:Jp(r)),cm(i=>{let a=!1,o=0;for(let s of e){if(a)break;let e=o++,c=Dg(n,s,!0,!0,!1);r.add(c),c.addObserver(o=>{r.delete(c);let s=!a;a=!0,i(o),s&&t?.onWinner&&t.onWinner({fiber:c,index:e,parentFiber:n})})}})}),Mm=T(e=>Fl(e[1]),(e,t,n)=>jm([e,t],n)),Q=T(2,(e,t)=>new ym(e,wm,t)),Nm=T(2,(e,t)=>$(e)?e._tag===`Success`?t.onSuccess(e.value):t.onFailure(e.cause):_h(e,t)),$=e=>e[Ol]!==void 0,Pm=T(2,(e,t)=>$(e)?e._tag===`Success`?t(e.value):e:Q(e,t)),Fm=e=>Q(e,E),Im=T(2,(e,t)=>new ym(e,Cm,t)),Lm=T(2,(e,t)=>$(e)?Wm(e,t):Im(e,t)),Rm=T(2,(e,t)=>$(e)?Gm(e,t):fh(e,t)),zm=e=>V(lp(e)),Bm=e=>e._tag===`Success`,Vm=e=>e._tag===`Failure`,Hm=e=>e._tag===`Failure`?fd(e.cause):pd(e),Um=B(void 0),Wm=T(2,(e,t)=>e._tag===`Success`?B(t(e.value)):e),Gm=T(2,(e,t)=>{if(e._tag===`Success`)return e;let n=dp(e.cause);return U(n)?e:su(t(n.success))}),Km=T(2,(e,t)=>Bm(e)?t:e),qm=T(2,(e,t)=>Bm(e)?t.onSuccess(e.value):t.onFailure(e.cause)),Jm=e=>{let t=[];for(let n of e)n._tag===`Failure`&&t.push(...n.cause.reasons);return t.length===0?Um:V(Gl(t))},Ym=T(2,(e,t)=>H(n=>{let r=n.context,i=t(r);return r===i?e:(n.setContext(i),tg(n,()=>{n.setContext(r)}),e)})),Xm=T(3,(e,t,n)=>Ym(e,e=>{let r=tf(e,t),i=n(r);return r===i?e:Qd(e,t,i)})),Zm=()=>Qm,Qm=H(e=>q(e.context)),$m=e=>H(t=>e(t.context)),eh=T(2,(e,t)=>Ym(e,Hs(t))),th=T(2,(e,t)=>$(e)?e:Ym(e,of(t))),nh=function(){return arguments.length===1?T(2,(e,t)=>rh(e,arguments[0],t)):T(3,(e,t,n)=>rh(e,t,n)).apply(this,arguments)},rh=(e,t,n)=>Ym(e,Qd(t,n)),ih=T(e=>Fl(e[0]),(e,t)=>vg({while:Us,body:Hs(t?.disableYield?e:Q(e,e=>Zp)),step:Ks})),ah=T(2,(e,t)=>new sh(e,t.length===1?t:e=>t(e))),oh=z({op:`OnFailure`,[I]:_m}),sh=function(e,t){this[F]=e,this[R]=t};sh.prototype=oh;var ch=T(3,(e,t,n)=>ah(e,e=>{let r=t(e);return U(r)?J(r.failure):n(r.success,e)})),lh=T(2,(e,t)=>ch(e,dp,e=>t(e))),uh=T(3,(e,t,n)=>ah(e,e=>{let r=t(e);return U(r)?J(e):Om(n(r.success,e),J(e))})),dh=T(2,(e,t)=>uh(e,dp,e=>t(e))),fh=T(2,(e,t)=>lh(e,e=>tm(()=>t(e)))),ph=e=>lh(e,em),mh=T(2,(e,t)=>lh(e,e=>Y(()=>t(e)))),hh=T(e=>Fl(e[0]),(e,t)=>{if(!t?.log)return Sh(e,{onFailure:e=>Z,onSuccess:e=>Z});let n=m_(t.log===!0?void 0:t.log);return _h(e,{onFailure(e){let r=up(e);return U(r)?J(r.failure):t.message===void 0?n(e):n(t.message,e)},onSuccess:e=>Z})}),gh=e=>wh(e,{onFailure:pd,onSuccess:fd}),_h=T(2,(e,t)=>new yh(e,t.onSuccess.length===1?t.onSuccess:e=>t.onSuccess(e),t.onFailure.length===1?t.onFailure:e=>t.onFailure(e))),vh=z({op:`OnSuccessAndFailure`,[I]:_m}),yh=function(e,t,n){this[F]=e,this[L]=t,this[R]=n};yh.prototype=vh;var bh=function(e,t){let n=this.payload;return t.succeedWith(Sm?n.onSuccess(e):El(()=>n.onSuccess(e)))},xh=((e,t)=>{let n=z({op:e,[I]:_m,[L]:bh,[R]:t}),r=function(e,t){this[F]=e,this.payload=t};return r.prototype=n,r})(`Match`,function(e,t){let n=e.reasons.find($l);if(n===void 0)return J(e);let r=this.payload;return t.succeedWith(Sm?r.onFailure(n.error):El(()=>r.onFailure(n.error)))}),Sh=T(2,(e,t)=>_h(e,{onFailure:e=>{let n=e.reasons.find($l);return n?t.onFailure(n.error):J(e)},onSuccess:t.onSuccess})),Ch=T(2,(e,t)=>new xh(e,t)),wh=T(2,(e,t)=>{if($(e)){if(e._tag===`Success`)return B(t.onSuccess(e.value));let n=dp(e.cause);return U(n)?e:B(t.onFailure(n.success))}return Ch(e,t)}),Th=e=>$(e)?B(e):Eh(e),Eh=ru({op:`Exit`,[I](e){return e._stack.push(this),this[F]},[L](e,t,n){return t.succeedWith(n??B(e))},[R](e,t,n){return t.succeedWith(n??V(e))}}),Dh=T(2,(e,t)=>Q(Oh(e,t.duration),e=>ed(e)?t.orElse():q(e.value))),Oh=T(2,(e,t)=>Mm(Dm(e),gm(Qg(t),Zu()))),kh=`~effect/Scope`,Ah=`~effect/Scope/Closeable`,jh=jd(`effect/Scope`),Mh=(e,t)=>H(n=>(mg(n),Nh(e,t)??Z)),Nh=(e,t)=>{let n=e.state;if(n._tag===`Closed`||(e.state={_tag:`Closed`,exit:t},e.parent!==void 0&&Hh(e.parent,e),n._tag===`Empty`))return;if(n.finalizer!==void 0)return Ph(n.finalizer,t);let r=n.finalizers;return r.size===1?Ph(r.values().next().value,t):Ih(e,r,t)},Ph=(e,t)=>{try{return e(t)}catch(e){return cu(e)}},Fh=(e,t)=>Bm(e)?t:ah(t,t=>J(ql(e.cause,t))),Ih=dm(function*(e,t,n){let r=[],i=[],a=Array.from(t.values()),o=Fp();for(let t=a.length-1;t>=0;t--){let s=a[t];e.strategy===`sequential`?r.push(yield*Th(Ph(s,n))):i.push(Dg(o,Ph(s,n),!0,!0,`inherit`))}return i.length>0&&(r=yield*Wp(i)),yield*Jm(r)}),Lh=(e,t)=>Y(()=>Rh(e,t)),Rh=(e,t)=>{let n=Wh(t,e);return e.state._tag===`Closed`?(n.state=e.state,n):(Vh(e,n,e=>Mh(n,e)),n)},zh=(e,t)=>X(()=>e.state._tag===`Closed`?t(e.state.exit):(Vh(e,{},t),Z)),Bh=(e,t)=>zh(e,Hs(t)),Vh=(e,t,n)=>{if(e.state._tag===`Empty`)e.state={_tag:`Open`,finalizerKey:t,finalizer:n,finalizers:void 0};else if(e.state._tag===`Open`){let r=e.state;r.finalizer===void 0?r.finalizers.set(t,n):(r.finalizers=new Map([[r.finalizerKey,r.finalizer]]),r.finalizerKey=void 0,r.finalizer=void 0,r.finalizers.set(t,n))}},Hh=(e,t)=>{if(e.state._tag!==`Open`)return;let n=e.state;n.finalizerKey===t?e.state=Gh:n.finalizers!==void 0&&(n.finalizers.delete(t),n.finalizers.size===0&&(e.state=Gh))},Uh=e=>Wh(e,void 0),Wh=(e=`sequential`,t)=>({[Ah]:Ah,[kh]:kh,strategy:e,parent:t,state:Gh}),Gh={_tag:`Empty`},Kh=e=>Y(()=>Uh(e)),qh=jh,Jh=nh(jh),Yh=e=>H(t=>{let n=t.context,r=Uh();return t.setContext(Qd(t.context,jh,r)),tg(t,e=>(t.setContext(n),Nh(r,e))),e}),Xh=e=>X(()=>{let t=Uh();return ng(e(t),e=>X(()=>Nh(t,e)??Z))}),Zh=(e,t,n)=>$m(r=>gg(i=>Q(qh,a=>km(n?.interruptible?i(e):e,e=>zh(a,n=>th(t(e,n),r)))))),Qh=e=>Q(qh,t=>$m(n=>zh(t,t=>th(e(t),n)))),$h=function(){let e=z({op:`OnExit`,[I](e){return e._stack.push(this),this.effect},[jl](e){e.interruptible&&this.interruptible!==!0&&(e._stack.push(dg),e.interruptible=!1)},[L](e,t,n){n??=B(e);let r;try{r=this.onExit(n)}catch(e){r=cu(e)}return r?Q(r,e=>n):n},[R](e,t,n){n??=V(e);let r;try{r=this.onExit(n)}catch(e){r=cu(e)}return r?Q(Fh(n,r),e=>n):n}}),t=function(e,t,n){this.effect=e,this.onExit=t,this.interruptible=n};return t.prototype=e,t}(),eg=(e,t,n)=>new $h(e,t,n),tg=(e,t)=>{e._stack.push(new $h(void 0,t,void 0))},ng=T(2,eg),rg=T(2,(e,t)=>ng(e,e=>t)),ig=T(3,(e,t,n)=>ng(e,e=>{let r=t(e);return U(r)?Z:n(r.success,e)})),ag=T(2,(e,t)=>ig(e,Hm,t)),og=T(3,(e,t,n)=>ng(e,e=>{if(e._tag!==`Failure`)return Z;let r=t(e.cause);return U(r)?Z:n(r.success,e.cause)})),sg=T(2,(e,t)=>og(hp,t)(e)),cg=(e,t,n)=>gg(r=>Q(e,e=>eg(X(()=>r(t(e))),t=>n(e,t),!0))),lg=e=>H(t=>t.interruptible?(t.interruptible=!1,t._stack.push(dg),e):e),ug=ru({op:`SetInterruptible`,[jl](e){if(e.interruptible=this[F],e._interruptedCause&&e.interruptible)return()=>J(e._interruptedCause)}}),dg=ug(!0),fg=ug(!1),pg=e=>{if(e.interruptible=!0,e._stack.push(fg),e._interruptedCause)return J(e._interruptedCause)},mg=e=>{let t=e;t.interruptible&&(t.interruptible=!1,t._stack.push(dg))},hg=e=>H(t=>t.interruptible?e:pg(t)??e),gg=e=>H(t=>t.interruptible?(t.interruptible=!1,t._stack.push(dg),e(hg)):e(E)),_g=(e,t)=>hc(e)?t?.mode===`result`?yg(e,gh,t):yg(e,E,t):t?.discard?t.mode===`result`?yg(Object.values(e),gh,t):yg(Object.values(e),E,t):X(()=>{let n={};return gm(yg(Object.entries(e),([e,r])=>Im(t?.mode===`result`?gh(r):r,t=>{el(n,e,t)}),{discard:!0,concurrency:t?.concurrency}),n)}),vg=ru({op:`While`,[L](e,t){return this[F].step(e),this[F].while()?(t._stack.push(this),this[F].body()):Um},[I](e){return this[F].while()?(e._stack.push(this),this[F].body()):Um}}),yg=T(e=>typeof e[1]==`function`,(e,t,n)=>X(()=>{let r=xg(n?.concurrency);if(r===1)return bg(e,t,n);let i=xd(e),a=i.length;if(a===0)return n?.discard?Z:q([]);let o=n?.discard?void 0:Array(a),s=Tg({f:t,out:o},i,{concurrency:r});return s?gm(s,o):q(o)})),bg=(e,t,n)=>X(()=>{let r=n?.discard?void 0:[],i=e[Symbol.iterator](),a=i.next(),o=0;return gm(vg({while:()=>!a.done,body:()=>t(a.value,o++),step:e=>{r&&r.push(e),a=i.next()}}),r)}),xg=e=>e===`unbounded`?1/0:Math.max(1,e??1),Sg=()=>e=>{let t=e.onItem,n=e.step,r=(e,t,r,a,o)=>Q(Th(o),o=>n(e,t[r],o,r)??i(e,t,r+1,a)??Z),i=(e,i,a=0,o=i.length)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!$(c))return r(e,i,a,o,c);let l=n(e,s,c,a);if(l)return l._tag===`Failure`?l:void 0}};return i},Cg=e=>{let t=e.onItem,n=e.step;return(e,r,i)=>{let a=0,o=i.end??r.length,s=i.concurrency,c=!1,l,u,d,f,ee,p=e=>{let t=cu(e);return f=t,c=!0,u&&u.size>0?Q(lg(Jp(Array.from(u))),()=>f??t):t},m=()=>{let i=!1;for(;!f&&a<o;a++){let o=r[a],h=ee??t(e,o,a);if($(h)){if(f=n(e,o,h,a),f)break}else if(l){ee=void 0;let t=Dg(l,h,!0,!0,`inherit`);if(t._exit){if(f=n(e,o,t._exit,a),f)break;continue}u.add(t);let r=a;if(t.addObserver(a=>{u.delete(t);try{if(f){if(a._tag===`Failure`){let e=a.cause.reasons.filter(e=>e._tag!==`Interrupt`);if(e.length>0){let t=Gl(e);f=V(f._tag===`Failure`?ql(f.cause,t):t)}}}else{let t=n(e,o,a,r);t&&(f=t,m())}if(i){let e=m();e&&d(e)}else c&&u.size===0&&d(f??Z)}catch(e){d(p(e))}}),u.size<s)continue;i=!0,a++;return}else return cm(e=>{l=Fp(),u=new Set,ee=h,d=e;let t;try{t=m()}catch(t){return e(p(t))}return t?e(t):X(()=>(f??=Um,Q(u?Jp(u):Z,()=>f?._tag===`Failure`?f:Z)))})}if(c=!0,f){if(u&&u.size>0){let e=Vp(l);u.forEach(t=>t.interruptUnsafe(l.id,e));return}if(d||f._tag===`Failure`)return f}else if(d){if(u)u.size===0&&d(Z);else return Um}};return m()}},wg=()=>e=>Cg(e),Tg=Cg({onItem(e,t,n){return e.f(t,n)},step(e,t,n,r){if(n._tag===`Failure`)return n;e.out&&(e.out[r]=n.value)}}),Eg=T(e=>Fl(e[0]),(e,t)=>H(n=>(y_(),q(Dg(n,e,t?.startImmediately,!1,t?.uninterruptible??!1))))),Dg=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new Ip(a.context,o);return r||(a.children().add(s),s._parent=a),n?s.evaluate(t):(s._asyncContext=Pp(),a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0)),s},Og=T(e=>Fl(e[0]),(e,t)=>H(n=>q(Dg(n,e,t?.startImmediately,!0,t?.uninterruptible)))),kg=T(e=>Fl(e[0]),(e,t,n)=>H(r=>{let i=Dg(r,e,n?.startImmediately,!0,n?.uninterruptible);if(!i._exit){if(t.state._tag!==`Closed`){let e={};Vh(t,e,()=>am(e=>e===i.id?Z:Kp(i))),i.addObserver(()=>Hh(t,e))}else i.interruptUnsafe(r.id,Vp(r))}return q(i)})),Ag=T(e=>Fl(e[0]),(e,t)=>Q(qh,n=>kg(e,n,t))),jg=e=>(t,n)=>{let r=new Ip(n?.scheduler?Qd(e,Wf,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal){if(n.signal.aborted)r.interruptUnsafe();else{let e=()=>r.interruptUnsafe();n.signal.addEventListener(`abort`,e,{once:!0}),r.addObserver(()=>n.signal.removeEventListener(`abort`,e))}}return n?.onFiberStart&&n.onFiberStart(r),r},Mg=T(2,(e,t)=>e._exit?e:t.state._tag===`Closed`?(e.interruptUnsafe(e.id),e):(Hh(t,e),Vh(t,e,()=>Kp(e)),e.addObserver(()=>Hh(t,e)),e)),Ng=jg(Yd()),Pg=e=>{let t=jg(e);return(e,n)=>{let r=t(e,n);return new Promise(e=>{r.addObserver(t=>e(t))})}},Fg=Pg(Yd()),Ig=e=>{let t=Pg(e);return(e,n)=>t(e,n).then(e=>{if(e._tag===`Failure`)throw vp(e.cause);return e.value})},Lg=e=>{let t=jg(e);return e=>{if($(e))return e;let n=new Yf(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??cu(new r_(r))}},Rg=Lg(Yd()),zg=(e=>{let t=Lg(e);return e=>{let n=t(e);if(n._tag===`Failure`)throw vp(n.cause);return n.value}})(Yd()),Bg=q(!0),Vg=q(!1),Hg=class{waiters=[];scheduled=void 0;_isOpen;constructor(e){this._isOpen=e}scheduleUnsafe(e){if(this.waiters.length===0)return Bg;if(this.scheduled===void 0)this.scheduled=this.waiters,e.currentDispatcher.scheduleTask(this.flushScheduled,0);else for(let e=0;e<this.waiters.length;e++)this.scheduled.push(this.waiters[e]);return this.waiters=[],Bg}flushScheduled=()=>{if(this.scheduled===void 0)return;let e=this.scheduled;this.scheduled=void 0;for(let t=0;t<e.length;t++)e[t](Um)};flushWaiters(){let e=this.waiters;this.waiters=[],this.flushScheduled();for(let t=0;t<e.length;t++)e[t](Um)}open=H(e=>this._isOpen?Vg:(this._isOpen=!0,this.scheduleUnsafe(e)));release=H(e=>this._isOpen?Vg:this.scheduleUnsafe(e));openUnsafe(){return!this._isOpen&&(this._isOpen=!0,this.flushWaiters(),!0)}await=cm(e=>this._isOpen?e(Z):(this.waiters.push(e),Y(()=>{let t=this.waiters.indexOf(e);t===-1?this.scheduled!==void 0&&(t=this.scheduled.indexOf(e),t!==-1&&this.scheduled.splice(t,1)):this.waiters.splice(t,1)})));closeUnsafe(){return this._isOpen?(this._isOpen=!1,!0):!1}close=Y(()=>this.closeUnsafe());whenOpen=e=>Q(this.await,()=>e);isOpen(){return this._isOpen}},Ug=e=>new Hg(e??!1),Wg=e=>Y(()=>Ug(e)),Gg=G(`effect/Clock`,{defaultValue:()=>new qg}),Kg=2**31-1,qg=class{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=Y(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return Xg()}currentTimeNanos=Y(()=>this.currentTimeNanosUnsafe());monotonicTimeNanosUnsafe(){return Yg()}monotonicTimeNanos=Y(()=>this.monotonicTimeNanosUnsafe());sleep(e){return this.sleepMillis(If(e))}sleepMillis(e){return e<=0?Zp:Number.isFinite(e)?cm(t=>{let n=e>Kg?this.sleepMillis(e-Kg):Z,r=setTimeout(()=>t(n),Math.min(e,Kg));return Y(()=>clearTimeout(r))}):lm}},Jg=BigInt(1e6),Yg=function(){let e=globalThis.process?.hrtime;if(typeof e?.bigint==`function`)return()=>e.bigint();if(typeof performance<`u`&&typeof performance.now==`function`)return()=>BigInt(Math.round(performance.now()*1e6));let t=BigInt(0);return()=>{let e=BigInt(Date.now())*Jg;return e>t&&(t=e),t}}(),Xg=function(){let e=BigInt(1e9),t;return()=>{let n=Yg(),r=BigInt(Date.now())*Jg;if(t===void 0)t=r-n;else{let i=t+n;(r>i?r-i:i-r)>e&&(t=r-n)}return t+n}}(),Zg=e=>H(t=>e(t.getRef(Gg))),Qg=e=>Zg(t=>t.sleep(_f(e))),$g=Zg(e=>e.currentTimeMillis);du(`TimeoutError`);var e_=`~effect/Cause/IllegalArgumentError`,t_=class extends du(`IllegalArgumentError`){[e_]=e_;constructor(e){super({message:e})}};du(`ExceededCapacityError`);var n_=`~effect/Cause/AsyncFiberError`,r_=class extends du(`AsyncFiberError`){[n_]=n_;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}},i_=`~effect/Cause/UnknownError`,a_=class extends du(`UnknownError`){[i_]=i_;constructor(e,t){super({message:t,cause:e})}},o_=G(`effect/Console`,{defaultValue:()=>globalThis.console}),s_=Ju(Gu(Uu,e=>{switch(e){case`All`:return-(2**53-1);case`Fatal`:return 5e4;case`Error`:return 4e4;case`Warn`:return 3e4;case`Info`:return 2e4;case`Debug`:return 1e4;case`Trace`:return 0;case`None`:return 2**53-1}})),c_=G(`effect/Logger/CurrentLoggers`,{defaultValue:()=>new Set([__,v_])}),l_=G(`effect/Logger/LogToStderr`,{defaultValue:Ws}),u_={"~effect/Logger":{_Message:E,_Output:E},pipe(){return zs(this,arguments)}},d_=e=>{let t=Object.create(u_);return t.log=e,t},f_=e=>e.replace(/[\s="]/g,`_`),p_=(e,t)=>`${f_(e[0])}=${t-e[1]}ms`,m_=e=>(...t)=>{let n;for(let e=0,r=t.length;e<r;e++){let r=t[e];zl(r)&&(n?t.splice(e,1):t=t.slice(0,e).concat(t.slice(e+1)),n=n?Gl(n.reasons.concat(r.reasons)):r,e--)}return n===void 0&&(n=Jl),H(r=>{let i=e??r.cache.logLevel;if(s_(r.cache.minimumLogLevel,i))return Z;let a=r.getRef(Gg),o=r.getRef(c_);if(o.size>0){let e=new Date(a.currentTimeMillisUnsafe());for(let a of o)a.log({cause:n,fiber:r,date:e,logLevel:i,message:t})}return Z})},h_={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};h_.gray,h_.blue,h_.green,h_.yellow,h_.red,h_.bgBrightRed,h_.black;var g_=e=>`${e.getHours().toString().padStart(2,`0`)}:${e.getMinutes().toString().padStart(2,`0`)}:${e.getSeconds().toString().padStart(2,`0`)}.${e.getMilliseconds().toString().padStart(3,`0`)}`,__=d_(({cause:e,date:t,fiber:n,logLevel:r,message:i})=>{let a=Array.isArray(i)?i.slice():[i];e.reasons.length>0&&a.push(Dp(e));let o=t.getTime(),s=n.getRef(sp),c=``;for(let e of s)c+=` ${p_(e,o)}`;let l=n.getRef(ip);Object.keys(l).length>0&&a.push(l);let u=n.getRef(o_);(n.getRef(l_)?u.error:u.log)(`[${g_(t)}] ${r.toUpperCase()} (#${n.id})${c}:`,...a)}),v_=d_(({cause:e,fiber:t,logLevel:n,message:r})=>{let i=t.getRef(Gg),a=t.getRef(ip),o=t.cache.span;if(o===void 0||o._tag===`ExternalSpan`)return;let s={};for(let[e,t]of Object.entries(a))el(s,e,t);s[`effect.fiberId`]=t.id,s[`effect.logLevel`]=n.toUpperCase(),e.reasons.length>0&&(s[`effect.cause`]=Dp(e)),o.event(bl(Array.isArray(r)&&r.length===1?r[0]:r),i.currentTimeNanosUnsafe(),s)});function y_(){Bp.interruptChildren??=Hp}var b_=ip,x_=Fl,S_=_g,C_=yg,w_=vg,T_=rm,E_=im,D_=q,O_=X,k_=Y,A_=Z,j_=cm,M_=lm,N_=um,P_=Yp,F_=J,I_=$p,L_=em,R_=nm,z_=Zp,B_=Xp,V_=Q,H_=Fm,U_=Om,W_=km,G_=gh,K_=Th,q_=Im,J_=gm,Y_=Am,X_=lh,Z_=ah,Q_=fh,$_=ph,ev=dh,tv=hh,nv=mh,rv=Oh,iv=Dh,av=Qg,ov=Mm,sv=Ch,cv=Nm,lv=_h,uv=Sh,dv=Zm,fv=th,pv=eh,mv=nh,hv=qh,gv=Yh,_v=Xh,vv=Zh,yv=cg,bv=Qh,xv=rg,Sv=ag,Cv=eg,wv=ng,Tv=sg,Ev=lg,Dv=gg,Ov=ih,kv=Eg,Av=kg,jv=Ag,Mv=Og,Nv=Ng,Pv=jg,Fv=Ig,Iv=Fg,Lv=zg,Rv=Rg,zv=dm,Bv=m_(`Warn`),Vv=m_(`Error`),Hv=T(e=>x_(e[0]),(e,...t)=>Xm(e,b_,e=>{let n=t.length===1?{...e,...t[0]}:{...e};return t.length===1||el(n,t[0],t[1]),n}));jd()(`effect/Effect/Transaction`);var Uv=Lm,Wv=Rm,Gv=Pm,Kv=pm;export{mv as $,ie as $a,Ls as $i,fd as $n,Qc as $r,fp as $t,B_ as A,pi as Aa,T as Ai,If as An,Yl as Ar,Dm as At,sv as B,An as Ba,ps as Bi,Cd as Bn,$l as Br,zm as Bt,Kv as C,Qo as Ca,oc as Ci,gg as Cn,Vu as Cr,Dv as Ct,Mv as D,$a as Da,fc as Di,wf as Dn,du as Dr,Gg as Dt,kv as E,to as Ea,cc as Ei,_f as En,Nl as Er,z_ as Et,Bv as F,Sr as Fa,Vs as Fi,Yd as Fn,su as Fr,vp as Ft,Sv as G,v as Ga,Vo as Gi,pd as Gn,xl as Gr,Um as Gt,cv as H,Ln as Ha,rs as Hi,Od as Hn,H as Hr,Bm as Ht,q_ as I,_r as Ia,Bs as Ii,W as In,V as Ir,$m as It,Tv as J,ze as Ja,Ja as Ji,U as Jn,fl as Jr,Kp as Jt,wv as K,Fe as Ka,ss as Ki,yd as Kn,vl as Kr,Km as Kt,Uv as L,Vn as La,zs as Li,Sd as Ln,B as Lr,$g as Lt,tv as M,ki as Ma,E as Mi,G as Mn,_u as Mr,ch as Mt,x_ as N,hi as Na,Js as Ni,jd as Nn,I as Nr,_p as Nt,Av as O,wa as Oa,Ks as Oi,Tf as On,F as Or,t_ as Ot,Vv as P,Cr as Pa,Ys as Pi,Qd as Pn,cu as Pr,Dp as Pt,fv as Q,p as Qa,Ms as Qi,vd as Qn,el as Qr,dp as Qt,Q_ as R,gr as Ra,zo as Ri,Td as Rn,pu as Rr,$ as Rt,zv as S,Oo as Sa,mc as Si,Y as Sn,Yu as Sr,Ev as St,Ov as T,Po as Ta,ac as Ti,Yf as Tn,uu as Tr,w_ as Tt,uv as U,er as Ua,ds as Ui,Dd as Un,Cl as Ur,Wm as Ut,lv as V,nr as Va,ts as Vi,wd as Vn,ru as Vr,Vm as Vt,M_ as W,Jt as Wa,yo as Wi,Ed as Wn,wl as Wr,qm as Wt,nv as X,Ne as Xa,Go as Xi,_d as Xn,ul as Xr,Mg as Xt,$_ as Y,Ve as Ya,C as Yi,md as Yn,dl as Yr,Gp as Yt,T_ as Z,ue as Za,ns as Zi,gd as Zn,tl as Zr,pp as Zt,F_ as _,Ho as _a,dc as _i,Uh as _n,Uu as _r,ev as _t,U_ as a,Eo as aa,Kc as ai,Sg as an,ed as ar,Fv as at,Gv as b,Uo as ba,nc as bi,Qp as bn,Xu as br,E_ as bt,Y_ as c,Jo as ca,A as ci,eg as cn,sd as cr,hv as ct,X_ as d,Rs as da,j as di,Bh as dn,Zu as dr,pv as dt,Mo as ea,Zc as ei,Q as en,g as eo,dd as er,ov as et,dv as f,Os as fa,O as fi,zh as fn,id as fr,av as ft,P_ as g,bo as ga,sc as gi,Kh as gn,Ku as gr,W_ as gt,K_ as h,Ss as ha,rc as hi,Rh as hn,Wu as hr,k_ as ht,S_ as i,ho as ia,Gc as ii,wg as in,od as ir,Iv as it,N_ as j,ii as ja,qs as ji,Lf as jn,Gl as jr,cm as jt,jv as k,fi as ka,Hs as ki,jf as kn,Zl as kr,Om as kt,j_ as l,us as la,k as li,Jh as ln,cd as lr,gv as lt,xv as m,Wo as ma,ic as mi,Lh as mn,ud as mr,O_ as mt,yv as n,Ro as na,Xc as ni,mp as nn,t as no,ad as nr,Nv as nt,Hv as o,wo as oa,M as oi,Wg as on,$u as or,Lv as ot,L_ as p,is as pa,D as pi,Mh as pn,Qu as pr,D_ as pt,Cv as q,Le as qa,Cs as qi,hd as qn,P as qr,Up as qt,bv as r,Bo as ra,N as ri,gp as rn,rd as rr,Pv as rt,J_ as s,Ps as sa,wc as si,Ug as sn,td as sr,Rv as st,vv as t,Ao as ta,Jc as ti,Fp as tn,n as to,ld as tr,G_ as tt,Z_ as u,So as ua,bc as ui,xg as un,nd as ur,_v as ut,I_ as v,As as va,uc as vi,jh as vn,Hu as vr,rv as vt,C_ as w,Ko as wa,tc as wi,Z as wn,hu as wr,A_ as wt,H_ as x,Ya as xa,pc as xi,X as xn,qu as xr,R_ as xt,V_ as y,es as ya,lc as yi,q as yn,Ju as yr,iv as yt,Wv as z,Zn as za,Co as zi,xd as zn,Il as zr,Jm as zt};
|
|
72
|
+
`)},Ep=(e,t)=>{let n=t?.get(ou.key);return n&&(e=`${e}\n${Op(n)}`),e},Dp=(e,t)=>{let n=[`${e.name}: ${e.message}`];for(let e of t){let t=e.fiberId===void 0?`unknown`:`#${e.fiberId}`,r=e.annotations.get(su.key);n.push(` at fiber (${t})`),r&&n.push(Op(r))}return n.join(`
|
|
73
|
+
`)},Op=e=>{let t=[],n=e,r=0;for(;n&&r<10;){let e=n.stack();if(e){let r=e.matchAll(wp),i=!1;for(let[,e]of r)i=!0,t.push(` at ${n.name} (${e})`);i||t.push(` at ${n.name} (${e.replace(/^at /,``)})`)}else t.push(` at ${n.name}`);n=n.parent,r++}return t.join(`
|
|
74
|
+
`)},kp=e=>xp(e).map(Ap).join(`
|
|
75
|
+
`),Ap=e=>e.cause?`${e.stack} {\n${jp(e.cause,` `)}\n}`:e.stack,jp=(e,t)=>{let n=e.stack.split(`
|
|
76
|
+
`),r=`${t}[cause]: ${n[0]}`;for(let e=1,i=n.length;e<i;e++)r+=`\n${t}${n[e]}`;return e.cause&&(r+=` {\n${jp(e.cause,`${t} `)}\n${t}}`),r},Mp=`~effect/Fiber`,Np={_A:E,_E:E},Pp={id:0},Fp=(()=>{try{return globalThis.process?.getBuiltinModule?.(`node:async_hooks`)?.AsyncResource}catch{return}})(),Ip=()=>Fp===void 0?void 0:new Fp(`effect/Fiber`),Lp=()=>globalThis[sl],Rp=class{constructor(e,t=!0){this.setContext(e),this.id=++Pp.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=void 0,this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this._parent=void 0,this._asyncContext=void 0,this.cache.runtimeMetrics?.recordFiberStart(this.context)}get[Mp](){return Np}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(e){return U(this.context,e)}addObserver(e){return this._exit?(e(this._exit),qs):(this._observers===void 0?this._observers=[e]:this._observers.push(e),()=>this.removeObserver(e))}removeObserver(e){if(this._exit||this._observers===void 0)return;let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)}interruptUnsafe(e,t){if(this._exit)return;let n=dp(e);this.cache.stackFrame&&(n=$l(n,$d(ou,this.cache.stackFrame))),t&&(n=$l(n,t)),this._interruptedCause=this._interruptedCause?Jl(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(q(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._asyncContext!==void 0){let t=this._asyncContext;return this._asyncContext=void 0,t.runInAsyncScope(this.evaluate,this,e)}if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===Nl){this._asyncContext=Ip();return}let n=Hp.interruptChildren&&Hp.interruptChildren(this);if(n!==void 0)return this.evaluate(Z(n,()=>t));if(this._exit=t,this.cache.runtimeMetrics?.recordFiberEnd(this.context,this._exit),this._parent&&=(this._parent._children?.delete(this),void 0),this._observers!==void 0){let e=this._observers;this._observers=void 0;for(let n=0;n<e.length;n++)e[n](t)}this._stack.length=0,this._children=void 0,this.context=Zd()}runLoop(e){let t=globalThis[sl];globalThis[sl]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;)try{this._deferredInterrupt&&(this._deferredInterrupt=!1,i=q(this._interruptedCause)),this.currentOpCount++;let e=this.cache;if(!r&&!e.preventYield&&e.scheduler.shouldYield(this)){r=!0;let e=i;i=Z($p,()=>e)}if(i=e.tracerContext?e.tracerContext(i,this):i[I](this),i===Nl){let e=this._yielded;if(kl in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return Nl}}catch(e){if(!D(i,I))return lu(`Fiber.runLoop: Not a valid effect: ${String(i)}`);i=lu(e)}}finally{this._running=n,globalThis[sl]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,Bp;for(;;){let t=this._stack.pop();if(!t)return;let n=t[Ml];if(n!==void 0){let r=n.call(t,this);if(r)return r[e]=r,r}if(t[e])return t}}succeedWith(e){if(!(++this.currentOpCount&Vp-1))return B(e);let t=this.getCont(L);return t?t[L](e,this):this.yieldWith(B(e))}yieldWith(e){return this._yielded=e,Nl}children(){return this._children??=new Set}pipe(){return Bs(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&Jd(t,e))return;let n=e.cacheRoot,r=n._fiberCache??=zp(e);this.cache?.scheduler!==r.scheduler&&(this._dispatcher=void 0),this.cache=r}get currentSpanLocal(){let e=this.cache.span;return e?._tag===`Span`?e:void 0}},zp=e=>{let t=nf(e,np);return{scheduler:U(e,Kf),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:U(e,ap),span:nf(e,tp),logLevel:U(e,sp),minimumLogLevel:U(e,cp),stackFrame:U(e,ip),runtimeMetrics:nf(e,rp),maxOpsBeforeYield:U(e,$f),preventYield:U(e,ep)}},Bp={[L](e,t){return q(t._interruptedCause)},[R](e,t){return q(t._interruptedCause)}},Vp=32,Hp={interruptChildren:void 0},Up=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(su.key,e.cache.stackFrame),Kd(t)},Wp=e=>{if(e._children!==void 0&&e._children.size!==0)return Xp(e._children)},Gp=e=>{let t=e;return t._exit?K(t._exit):um(n=>t._exit?n(K(t._exit)):J(e.addObserver(e=>n(K(e)))))},Kp=e=>um(t=>{let n=e[Symbol.iterator](),r=[],i;function a(){let e=n.next();for(;!e.done;){if(e.value._exit){r.push(e.value._exit),e=n.next();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t(K(r))}return a(),J(()=>i?.())}),qp=e=>{let t=e;return t._exit?t._exit:um(n=>t._exit?n(t._exit):J(e.addObserver(n)))},Jp=e=>H(t=>Yp(e,t.id)),Yp=T(e=>D(e[0],Mp),(e,t,n)=>H(r=>{let i=Up(r);return i=i&&n?cf(i,n):i??n,e.interruptUnsafe(t,i),Mm(Gp(e))})),Xp=e=>H(t=>{let n=Up(t),r=Dd();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return Mm(Kp(r))}),K=B,q=V,Zp=cu,J=iu({op:`Sync`,[I](e){let t=this[F](),n=e.getCont(L);return n?n[L](t,e):e.yieldWith(B(t))}}),Y=iu({op:`Suspend`,[I](e){return this[F]()}}),Qp=bd({onFailure:Zp,onSuccess:K}),$p=iu({op:`Yield`,[I](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate($)},this[F]??0),e.yieldWith(()=>{t=!0})}})(0),em=K(Qu()),tm=e=>Y(()=>q(e())),nm=e=>lu(e),rm=e=>Y(()=>Zp(e())),X=K(void 0),im=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new o_(e,`An error occurred in Effect.try`):e.catch;return Y(()=>{try{return K(t())}catch(e){return Zp(n(e))}})},am=e=>cm(function(t,n){e(n).then(e=>t(K(e)),e=>t(nm(e)))},e.length!==0),om=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new o_(e,`An error occurred in Effect.tryPromise`):e.catch;return cm(function(e,r){let i=e=>Y(()=>{try{return Zp(Dl(()=>n(e)))}catch(e){return nm(e)}});try{t(r).then(t=>e(K(t)),t=>e(i(t)))}catch(t){e(i(t))}},t.length!==0)},sm=e=>H(t=>e(t.id)),cm=function(){let e=z({op:`Async`,[I](e){let t=!1,n=!1,r=this.withSignal?new AbortController:void 0,i=this.register.call(e.cache.scheduler,r=>{t||(t=!0,n?e.evaluate(r):n=r)},r?.signal);return n===!1?(n=!0,e._yielded=()=>{t=!0},r===void 0&&i===void 0||e._stack.push(lm(()=>(t=!0,r?.abort(),i??$))),Nl):n}}),t=function(e,t){this.register=e,this.withSignal=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),lm=iu({op:`AsyncFinalizer`,[Ml](e){e.interruptible&&(e.interruptible=!1,e._stack.push(fg))},[R](e,t){return gp(e)?Z(Ih(V(e),this[F]()),()=>q(e)):q(e)}}),um=e=>cm(e,e.length>=2),dm=um(qs),fm=(...e)=>{if(e.length===1){let t=e[0];return Y(()=>_m(t()))}let[t,n]=e;return Y(()=>_m(n.call(t.self)))},pm=(e,...t)=>{let n=t.length===0?function(){return Y(()=>_m(e.apply(this,arguments)))}:function(){let n=Y(()=>_m(e.apply(this,arguments)));for(let e=0;e<t.length;e++)n=t[e](n,...arguments);return n};return mm(e.length,n)},mm=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),hm=(e,...t)=>mm(e.length,t.length===0?function(){return gm(()=>e.apply(this,arguments))}:function(){let n=gm(()=>e.apply(this,arguments));for(let e of t)n=e(n,...arguments);return n}),gm=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return K(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}if(i&&i._tag===`Failure`)return r.value;{let n=!0;return Y(()=>n?(n=!1,Z(r.value,e=>_m(t,e))):Y(()=>_m(e())))}}}catch(e){return nm(e)}},_m=function(){let e=z({op:`Iterator`,[L](e,t){let n=this.iterator;for(;;){let r=n.next(e);if(r.done)return K(r.value);if(!Q(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[I](e){return this[L](this.initial,e)}}),t=function(e,t){this.iterator=e,this.initial=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),vm=T(2,(e,t)=>new xm(e,Sm,K(t))),ym=function(e){return e._stack.push(this),this[F]},bm=z({op:`OnSuccess`,[I]:ym}),xm=function(e,t,n){this[F]=e,this[L]=t,this.payload=n};xm.prototype=bm;var Sm=function(){return this.payload},Cm=function(e,t){return t.succeedWith(this.payload)},wm=(()=>{let e=`~effect/Effect/stackProbe`;return{[e]:function(){return Error().stack}}[e]()?.includes(`[as `+e+`]`)===!0})(),Tm=function(e,t){let n=this.payload;return t.succeedWith(wm?n(e):Dl(()=>n(e)))},Em=function(e){let t=this.payload;return t(e)},Dm=function(e){let t=this.payload;return new xm(t(e),Cm,e)},Om=function(e){return new xm(this.payload,Cm,e)},km=e=>Rm(e,$u),Am=T(2,(e,t)=>new xm(e,Il(t)?Sm:Em,t)),jm=T(2,(e,t)=>new xm(e,Il(t)?Om:Dm,t)),Mm=e=>new xm(e,Sm,$),Nm=(e,t)=>H(n=>{let r=new Set;return ng(n,()=>r.size===0?void 0:Xp(r)),um(i=>{let a=!1,o=0;for(let s of e){if(a)break;let e=o++,c=Og(n,s,!0,!0,!1);r.add(c),c.addObserver(o=>{r.delete(c);let s=!a;a=!0,i(o),s&&t?.onWinner&&t.onWinner({fiber:c,index:e,parentFiber:n})})}})}),Pm=T(e=>Il(e[1]),(e,t,n)=>Nm([e,t],n)),Z=T(2,(e,t)=>new xm(e,Em,t)),Fm=T(2,(e,t)=>Q(e)?e._tag===`Success`?t.onSuccess(e.value):t.onFailure(e.cause):vh(e,t)),Q=e=>e[kl]!==void 0,Im=T(2,(e,t)=>Q(e)?e._tag===`Success`?t(e.value):e:Z(e,t)),Lm=e=>Z(e,E),Rm=T(2,(e,t)=>new xm(e,Tm,t)),zm=T(2,(e,t)=>Q(e)?Gm(e,t):Rm(e,t)),Bm=T(2,(e,t)=>Q(e)?Km(e,t):ph(e,t)),Vm=e=>V(dp(e)),Hm=e=>e._tag===`Success`,Um=e=>e._tag===`Failure`,Wm=e=>e._tag===`Failure`?pd(e.cause):md(e),$=B(void 0),Gm=T(2,(e,t)=>e._tag===`Success`?B(t(e.value)):e),Km=T(2,(e,t)=>{if(e._tag===`Success`)return e;let n=pp(e.cause);return hd(n)?e:cu(t(n.success))}),qm=T(2,(e,t)=>Hm(e)?t:e),Jm=T(2,(e,t)=>Hm(e)?t.onSuccess(e.value):t.onFailure(e.cause)),Ym=e=>{let t=[];for(let n of e)n._tag===`Failure`&&t.push(...n.cause.reasons);return t.length===0?$:V(Kl(t))},Xm=T(2,(e,t)=>H(n=>{let r=n.context,i=t(r);return r===i?e:(n.setContext(i),ng(n,()=>{n.setContext(r)}),e)})),Zm=T(3,(e,t,n)=>Xm(e,e=>{let r=rf(e,t),i=n(r);return r===i?e:ef(e,t,i)})),Qm=()=>$m,$m=H(e=>K(e.context)),eh=e=>H(t=>e(t.context)),th=T(2,(e,t)=>Xm(e,Us(t))),nh=T(2,(e,t)=>Q(e)?e:Xm(e,cf(t))),rh=function(){return arguments.length===1?T(2,(e,t)=>ih(e,arguments[0],t)):T(3,(e,t,n)=>ih(e,t,n)).apply(this,arguments)},ih=(e,t,n)=>Xm(e,ef(t,n)),ah=T(e=>Il(e[0]),(e,t)=>yg({while:Ws,body:Us(t?.disableYield?e:Z(e,e=>$p)),step:qs})),oh=T(2,(e,t)=>new ch(e,t.length===1?t:e=>t(e))),sh=z({op:`OnFailure`,[I]:ym}),ch=function(e,t){this[F]=e,this[R]=t};ch.prototype=sh;var lh=T(3,(e,t,n)=>oh(e,e=>{let r=t(e);return hd(r)?q(r.failure):n(r.success,e)})),uh=T(2,(e,t)=>lh(e,pp,e=>t(e))),dh=T(3,(e,t,n)=>oh(e,e=>{let r=t(e);return hd(r)?q(e):Am(n(r.success,e),q(e))})),fh=T(2,(e,t)=>dh(e,pp,e=>t(e))),ph=T(2,(e,t)=>uh(e,e=>rm(()=>t(e)))),mh=e=>uh(e,nm),hh=T(2,(e,t)=>uh(e,e=>J(()=>t(e)))),gh=T(e=>Il(e[0]),(e,t)=>{if(!t?.log)return Ch(e,{onFailure:e=>X,onSuccess:e=>X});let n=h_(t.log===!0?void 0:t.log);return vh(e,{onFailure(e){let r=fp(e);return hd(r)?q(r.failure):t.message===void 0?n(e):n(t.message,e)},onSuccess:e=>X})}),_h=e=>Th(e,{onFailure:md,onSuccess:pd}),vh=T(2,(e,t)=>new bh(e,t.onSuccess.length===1?t.onSuccess:e=>t.onSuccess(e),t.onFailure.length===1?t.onFailure:e=>t.onFailure(e))),yh=z({op:`OnSuccessAndFailure`,[I]:ym}),bh=function(e,t,n){this[F]=e,this[L]=t,this[R]=n};bh.prototype=yh;var xh=function(e,t){let n=this.payload;return t.succeedWith(wm?n.onSuccess(e):Dl(()=>n.onSuccess(e)))},Sh=((e,t)=>{let n=z({op:e,[I]:ym,[L]:xh,[R]:t}),r=function(e,t){this[F]=e,this.payload=t};return r.prototype=n,r})(`Match`,function(e,t){let n=e.reasons.find(eu);if(n===void 0)return q(e);let r=this.payload;return t.succeedWith(wm?r.onFailure(n.error):Dl(()=>r.onFailure(n.error)))}),Ch=T(2,(e,t)=>vh(e,{onFailure:e=>{let n=e.reasons.find(eu);return n?t.onFailure(n.error):q(e)},onSuccess:t.onSuccess})),wh=T(2,(e,t)=>new Sh(e,t)),Th=T(2,(e,t)=>{if(Q(e)){if(e._tag===`Success`)return B(t.onSuccess(e.value));let n=pp(e.cause);return hd(n)?e:B(t.onFailure(n.success))}return wh(e,t)}),Eh=e=>Q(e)?B(e):Dh(e),Dh=iu({op:`Exit`,[I](e){return e._stack.push(this),this[F]},[L](e,t,n){return t.succeedWith(n??B(e))},[R](e,t,n){return t.succeedWith(n??V(e))}}),Oh=T(2,(e,t)=>Z(kh(e,t.duration),e=>td(e)?t.orElse():K(e.value))),kh=T(2,(e,t)=>Pm(km(e),vm($g(t),Qu()))),Ah=`~effect/Scope`,jh=`~effect/Scope/Closeable`,Mh=Nd(`effect/Scope`),Nh=(e,t)=>H(n=>(hg(n),Ph(e,t)??X)),Ph=(e,t)=>{let n=e.state;if(n._tag===`Closed`||(e.state={_tag:`Closed`,exit:t},e.parent!==void 0&&Uh(e.parent,e),n._tag===`Empty`))return;if(n.finalizer!==void 0)return Fh(n.finalizer,t);let r=n.finalizers;return r.size===1?Fh(r.values().next().value,t):Lh(e,r,t)},Fh=(e,t)=>{try{return e(t)}catch(e){return lu(e)}},Ih=(e,t)=>Hm(e)?t:oh(t,t=>q(Jl(e.cause,t))),Lh=pm(function*(e,t,n){let r=[],i=[],a=Array.from(t.values()),o=Lp();for(let t=a.length-1;t>=0;t--){let s=a[t];e.strategy===`sequential`?r.push(yield*Eh(Fh(s,n))):i.push(Og(o,Fh(s,n),!0,!0,`inherit`))}return i.length>0&&(r=yield*Kp(i)),yield*Ym(r)}),Rh=(e,t)=>J(()=>zh(e,t)),zh=(e,t)=>{let n=Gh(t,e);return e.state._tag===`Closed`?(n.state=e.state,n):(Hh(e,n,e=>Nh(n,e)),n)},Bh=(e,t)=>Y(()=>e.state._tag===`Closed`?t(e.state.exit):(Hh(e,{},t),X)),Vh=(e,t)=>Bh(e,Us(t)),Hh=(e,t,n)=>{if(e.state._tag===`Empty`)e.state={_tag:`Open`,finalizerKey:t,finalizer:n,finalizers:void 0};else if(e.state._tag===`Open`){let r=e.state;r.finalizer===void 0?r.finalizers.set(t,n):(r.finalizers=new Map([[r.finalizerKey,r.finalizer]]),r.finalizerKey=void 0,r.finalizer=void 0,r.finalizers.set(t,n))}},Uh=(e,t)=>{if(e.state._tag!==`Open`)return;let n=e.state;n.finalizerKey===t?e.state=Kh:n.finalizers!==void 0&&(n.finalizers.delete(t),n.finalizers.size===0&&(e.state=Kh))},Wh=e=>Gh(e,void 0),Gh=(e=`sequential`,t)=>({[jh]:jh,[Ah]:Ah,strategy:e,parent:t,state:Kh}),Kh={_tag:`Empty`},qh=e=>J(()=>Wh(e)),Jh=Mh,Yh=rh(Mh),Xh=e=>H(t=>{let n=t.context,r=Wh();return t.setContext(ef(t.context,Mh,r)),ng(t,e=>(t.setContext(n),Ph(r,e))),e}),Zh=e=>Y(()=>{let t=Wh();return rg(e(t),e=>Y(()=>Ph(t,e)??X))}),Qh=(e,t,n)=>eh(r=>_g(i=>Z(Jh,a=>jm(n?.interruptible?i(e):e,e=>Bh(a,n=>nh(t(e,n),r)))))),$h=e=>Z(Jh,t=>eh(n=>Bh(t,t=>nh(e(t),n)))),eg=function(){let e=z({op:`OnExit`,[I](e){return e._stack.push(this),this.effect},[Ml](e){e.interruptible&&this.interruptible!==!0&&(e._stack.push(fg),e.interruptible=!1)},[L](e,t,n){n??=B(e);let r;try{r=this.onExit(n)}catch(e){r=lu(e)}return r?Z(r,e=>n):n},[R](e,t,n){n??=V(e);let r;try{r=this.onExit(n)}catch(e){r=lu(e)}return r?Z(Ih(n,r),e=>n):n}}),t=function(e,t,n){this.effect=e,this.onExit=t,this.interruptible=n};return t.prototype=e,t}(),tg=(e,t,n)=>new eg(e,t,n),ng=(e,t)=>{e._stack.push(new eg(void 0,t,void 0))},rg=T(2,tg),ig=T(2,(e,t)=>rg(e,e=>t)),ag=T(3,(e,t,n)=>rg(e,e=>{let r=t(e);return hd(r)?X:n(r.success,e)})),og=T(2,(e,t)=>ag(e,Wm,t)),sg=T(3,(e,t,n)=>rg(e,e=>{if(e._tag!==`Failure`)return X;let r=t(e.cause);return hd(r)?X:n(r.success,e.cause)})),cg=T(2,(e,t)=>sg(_p,t)(e)),lg=(e,t,n)=>_g(r=>Z(e,e=>tg(Y(()=>r(t(e))),t=>n(e,t),!0))),ug=e=>H(t=>t.interruptible?(t.interruptible=!1,t._stack.push(fg),e):e),dg=iu({op:`SetInterruptible`,[Ml](e){if(e.interruptible=this[F],e._interruptedCause&&e.interruptible)return()=>q(e._interruptedCause)}}),fg=dg(!0),pg=dg(!1),mg=e=>{if(e.interruptible=!0,e._stack.push(pg),e._interruptedCause)return q(e._interruptedCause)},hg=e=>{let t=e;t.interruptible&&(t.interruptible=!1,t._stack.push(fg))},gg=e=>H(t=>t.interruptible?e:mg(t)??e),_g=e=>H(t=>t.interruptible?(t.interruptible=!1,t._stack.push(fg),e(gg)):e(E)),vg=(e,t)=>gc(e)?t?.mode===`result`?bg(e,_h,t):bg(e,E,t):t?.discard?t.mode===`result`?bg(Object.values(e),_h,t):bg(Object.values(e),E,t):Y(()=>{let n={};return vm(bg(Object.entries(e),([e,r])=>Rm(t?.mode===`result`?_h(r):r,t=>{tl(n,e,t)}),{discard:!0,concurrency:t?.concurrency}),n)}),yg=iu({op:`While`,[L](e,t){return this[F].step(e),this[F].while()?(t._stack.push(this),this[F].body()):$},[I](e){return this[F].while()?(e._stack.push(this),this[F].body()):$}}),bg=T(e=>typeof e[1]==`function`,(e,t,n)=>Y(()=>{let r=Sg(n?.concurrency);if(r===1)return xg(e,t,n);let i=Cd(e),a=i.length;if(a===0)return n?.discard?X:K([]);let o=n?.discard?void 0:Array(a),s=Eg({f:t,out:o},i,{concurrency:r});return s?vm(s,o):K(o)})),xg=(e,t,n)=>Y(()=>{let r=n?.discard?void 0:[],i=e[Symbol.iterator](),a=i.next(),o=0;return vm(yg({while:()=>!a.done,body:()=>t(a.value,o++),step:e=>{r&&r.push(e),a=i.next()}}),r)}),Sg=e=>e===`unbounded`?1/0:Math.max(1,e??1),Cg=()=>e=>{let t=e.onItem,n=e.step,r=(e,t,r,a,o)=>Z(Eh(o),o=>n(e,t[r],o,r)??i(e,t,r+1,a)??X),i=(e,i,a=0,o=i.length)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!Q(c))return r(e,i,a,o,c);let l=n(e,s,c,a);if(l)return l._tag===`Failure`?l:void 0}};return i},wg=e=>{let t=e.onItem,n=e.step;return(e,r,i)=>{let a=0,o=i.end??r.length,s=i.concurrency,c=!1,l,u,d,f,ee,p=e=>{let t=lu(e);return f=t,c=!0,u&&u.size>0?Z(ug(Xp(Array.from(u))),()=>f??t):t},m=()=>{let i=!1;for(;!f&&a<o;a++){let o=r[a],h=ee??t(e,o,a);if(Q(h)){if(f=n(e,o,h,a),f)break}else if(l){ee=void 0;let t=Og(l,h,!0,!0,`inherit`);if(t._exit){if(f=n(e,o,t._exit,a),f)break;continue}u.add(t);let r=a;if(t.addObserver(a=>{u.delete(t);try{if(f){if(a._tag===`Failure`){let e=a.cause.reasons.filter(e=>e._tag!==`Interrupt`);if(e.length>0){let t=Kl(e);f=V(f._tag===`Failure`?Jl(f.cause,t):t)}}}else{let t=n(e,o,a,r);t&&(f=t,m())}if(i){let e=m();e&&d(e)}else c&&u.size===0&&d(f??X)}catch(e){d(p(e))}}),u.size<s)continue;i=!0,a++;return}else return um(e=>{l=Lp(),u=new Set,ee=h,d=e;let t;try{t=m()}catch(t){return e(p(t))}return t?e(t):Y(()=>(f??=$,Z(u?Xp(u):X,()=>f?._tag===`Failure`?f:X)))})}if(c=!0,f){if(u&&u.size>0){let e=Up(l);u.forEach(t=>t.interruptUnsafe(l.id,e));return}if(d||f._tag===`Failure`)return f}else if(d){if(u)u.size===0&&d(X);else return $}};return m()}},Tg=()=>e=>wg(e),Eg=wg({onItem(e,t,n){return e.f(t,n)},step(e,t,n,r){if(n._tag===`Failure`)return n;e.out&&(e.out[r]=n.value)}}),Dg=T(e=>Il(e[0]),(e,t)=>H(n=>(b_(),K(Og(n,e,t?.startImmediately,!1,t?.uninterruptible??!1))))),Og=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new Rp(a.context,o);return r||(a.children().add(s),s._parent=a),n?s.evaluate(t):(s._asyncContext=Ip(),a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0)),s},kg=T(e=>Il(e[0]),(e,t)=>H(n=>K(Og(n,e,t?.startImmediately,!0,t?.uninterruptible)))),Ag=T(e=>Il(e[0]),(e,t,n)=>H(r=>{let i=Og(r,e,n?.startImmediately,!0,n?.uninterruptible);if(!i._exit){if(t.state._tag!==`Closed`){let e={};Hh(t,e,()=>sm(e=>e===i.id?X:Jp(i))),i.addObserver(()=>Uh(t,e))}else i.interruptUnsafe(r.id,Up(r))}return K(i)})),jg=T(e=>Il(e[0]),(e,t)=>Z(Jh,n=>Ag(e,n,t))),Mg=e=>(t,n)=>{let r=new Rp(n?.scheduler?ef(e,Kf,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal){if(n.signal.aborted)r.interruptUnsafe();else{let e=()=>r.interruptUnsafe();n.signal.addEventListener(`abort`,e,{once:!0}),r.addObserver(()=>n.signal.removeEventListener(`abort`,e))}}return n?.onFiberStart&&n.onFiberStart(r),r},Ng=T(2,(e,t)=>e._exit?e:t.state._tag===`Closed`?(e.interruptUnsafe(e.id),e):(Uh(t,e),Hh(t,e,()=>Jp(e)),e.addObserver(()=>Uh(t,e)),e)),Pg=Mg(Zd()),Fg=e=>{let t=Mg(e);return(e,n)=>{let r=t(e,n);return new Promise(e=>{r.addObserver(t=>e(t))})}},Ig=Fg(Zd()),Lg=e=>{let t=Fg(e);return(e,n)=>t(e,n).then(e=>{if(e._tag===`Failure`)throw bp(e.cause);return e.value})},Rg=e=>{let t=Mg(e);return e=>{if(Q(e))return e;let n=new Zf(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??lu(new i_(r))}},zg=Rg(Zd()),Bg=(e=>{let t=Rg(e);return e=>{let n=t(e);if(n._tag===`Failure`)throw bp(n.cause);return n.value}})(Zd()),Vg=K(!0),Hg=K(!1),Ug=class{waiters=[];scheduled=void 0;_isOpen;constructor(e){this._isOpen=e}scheduleUnsafe(e){if(this.waiters.length===0)return Vg;if(this.scheduled===void 0)this.scheduled=this.waiters,e.currentDispatcher.scheduleTask(this.flushScheduled,0);else for(let e=0;e<this.waiters.length;e++)this.scheduled.push(this.waiters[e]);return this.waiters=[],Vg}flushScheduled=()=>{if(this.scheduled===void 0)return;let e=this.scheduled;this.scheduled=void 0;for(let t=0;t<e.length;t++)e[t]($)};flushWaiters(){let e=this.waiters;this.waiters=[],this.flushScheduled();for(let t=0;t<e.length;t++)e[t]($)}open=H(e=>this._isOpen?Hg:(this._isOpen=!0,this.scheduleUnsafe(e)));release=H(e=>this._isOpen?Hg:this.scheduleUnsafe(e));openUnsafe(){return!this._isOpen&&(this._isOpen=!0,this.flushWaiters(),!0)}await=um(e=>this._isOpen?e(X):(this.waiters.push(e),J(()=>{let t=this.waiters.indexOf(e);t===-1?this.scheduled!==void 0&&(t=this.scheduled.indexOf(e),t!==-1&&this.scheduled.splice(t,1)):this.waiters.splice(t,1)})));closeUnsafe(){return this._isOpen?(this._isOpen=!1,!0):!1}close=J(()=>this.closeUnsafe());whenOpen=e=>Z(this.await,()=>e);isOpen(){return this._isOpen}},Wg=e=>new Ug(e??!1),Gg=e=>J(()=>Wg(e)),Kg=W(`effect/Clock`,{defaultValue:()=>new Jg}),qg=2**31-1,Jg=class{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=J(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return Zg()}currentTimeNanos=J(()=>this.currentTimeNanosUnsafe());monotonicTimeNanosUnsafe(){return Xg()}monotonicTimeNanos=J(()=>this.monotonicTimeNanosUnsafe());sleep(e){return this.sleepMillis(Rf(e))}sleepMillis(e){return e<=0?$p:Number.isFinite(e)?um(t=>{let n=e>qg?this.sleepMillis(e-qg):X,r=setTimeout(()=>t(n),Math.min(e,qg));return J(()=>clearTimeout(r))}):dm}},Yg=BigInt(1e6),Xg=function(){let e=globalThis.process?.hrtime;if(typeof e?.bigint==`function`)return()=>e.bigint();if(typeof performance<`u`&&typeof performance.now==`function`)return()=>BigInt(Math.round(performance.now()*1e6));let t=BigInt(0);return()=>{let e=BigInt(Date.now())*Yg;return e>t&&(t=e),t}}(),Zg=function(){let e=BigInt(1e9),t;return()=>{let n=Xg(),r=BigInt(Date.now())*Yg;if(t===void 0)t=r-n;else{let i=t+n;(r>i?r-i:i-r)>e&&(t=r-n)}return t+n}}(),Qg=e=>H(t=>e(t.getRef(Kg))),$g=e=>Qg(t=>t.sleep(yf(e))),e_=Qg(e=>e.currentTimeMillis);fu(`TimeoutError`);var t_=`~effect/Cause/IllegalArgumentError`,n_=class extends fu(`IllegalArgumentError`){[t_]=t_;constructor(e){super({message:e})}};fu(`ExceededCapacityError`);var r_=`~effect/Cause/AsyncFiberError`,i_=class extends fu(`AsyncFiberError`){[r_]=r_;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}},a_=`~effect/Cause/UnknownError`,o_=class extends fu(`UnknownError`){[a_]=a_;constructor(e,t){super({message:t,cause:e})}},s_=W(`effect/Console`,{defaultValue:()=>globalThis.console}),c_=Yu(Ku(Wu,e=>{switch(e){case`All`:return-(2**53-1);case`Fatal`:return 5e4;case`Error`:return 4e4;case`Warn`:return 3e4;case`Info`:return 2e4;case`Debug`:return 1e4;case`Trace`:return 0;case`None`:return 2**53-1}})),l_=W(`effect/Logger/CurrentLoggers`,{defaultValue:()=>new Set([v_,y_])}),u_=W(`effect/Logger/LogToStderr`,{defaultValue:Gs}),d_={"~effect/Logger":{_Message:E,_Output:E},pipe(){return Bs(this,arguments)}},f_=e=>{let t=Object.create(d_);return t.log=e,t},p_=e=>e.replace(/[\s="]/g,`_`),m_=(e,t)=>`${p_(e[0])}=${t-e[1]}ms`,h_=e=>(...t)=>{let n;for(let e=0,r=t.length;e<r;e++){let r=t[e];Bl(r)&&(n?t.splice(e,1):t=t.slice(0,e).concat(t.slice(e+1)),n=n?Kl(n.reasons.concat(r.reasons)):r,e--)}return n===void 0&&(n=Yl),H(r=>{let i=e??r.cache.logLevel;if(c_(r.cache.minimumLogLevel,i))return X;let a=r.getRef(Kg),o=r.getRef(l_);if(o.size>0){let e=new Date(a.currentTimeMillisUnsafe());for(let a of o)a.log({cause:n,fiber:r,date:e,logLevel:i,message:t})}return X})},g_={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};g_.gray,g_.blue,g_.green,g_.yellow,g_.red,g_.bgBrightRed,g_.black;var __=e=>`${e.getHours().toString().padStart(2,`0`)}:${e.getMinutes().toString().padStart(2,`0`)}:${e.getSeconds().toString().padStart(2,`0`)}.${e.getMilliseconds().toString().padStart(3,`0`)}`,v_=f_(({cause:e,date:t,fiber:n,logLevel:r,message:i})=>{let a=Array.isArray(i)?i.slice():[i];e.reasons.length>0&&a.push(kp(e));let o=t.getTime(),s=n.getRef(lp),c=``;for(let e of s)c+=` ${m_(e,o)}`;let l=n.getRef(op);Object.keys(l).length>0&&a.push(l);let u=n.getRef(s_);(n.getRef(u_)?u.error:u.log)(`[${__(t)}] ${r.toUpperCase()} (#${n.id})${c}:`,...a)}),y_=f_(({cause:e,fiber:t,logLevel:n,message:r})=>{let i=t.getRef(Kg),a=t.getRef(op),o=t.cache.span;if(o===void 0||o._tag===`ExternalSpan`)return;let s={};for(let[e,t]of Object.entries(a))tl(s,e,t);s[`effect.fiberId`]=t.id,s[`effect.logLevel`]=n.toUpperCase(),e.reasons.length>0&&(s[`effect.cause`]=kp(e)),o.event(xl(Array.isArray(r)&&r.length===1?r[0]:r),i.currentTimeNanosUnsafe(),s)});function b_(){Hp.interruptChildren??=Wp}var x_=op,S_=Il,C_=vg,w_=bg,T_=yg,E_=am,D_=om,O_=K,k_=Y,A_=J,j_=X,M_=um,N_=dm,P_=fm,F_=Zp,I_=q,L_=tm,R_=nm,z_=im,B_=$p,V_=Qp,H_=Z,U_=Lm,W_=Am,G_=jm,K_=_h,q_=Eh,J_=Rm,Y_=vm,X_=Mm,Z_=uh,Q_=oh,$_=ph,ev=mh,tv=fh,nv=gh,rv=hh,iv=kh,av=Oh,ov=$g,sv=Pm,cv=wh,lv=Fm,uv=vh,dv=Ch,fv=Qm,pv=nh,mv=th,hv=rh,gv=Jh,_v=Xh,vv=Zh,yv=Qh,bv=lg,xv=$h,Sv=ig,Cv=og,wv=tg,Tv=rg,Ev=cg,Dv=ug,Ov=_g,kv=ah,Av=Dg,jv=Ag,Mv=jg,Nv=kg,Pv=Pg,Fv=Mg,Iv=Lg,Lv=Ig,Rv=Bg,zv=zg,Bv=pm,Vv=h_(`Warn`),Hv=h_(`Error`),Uv=T(e=>S_(e[0]),(e,...t)=>Zm(e,x_,e=>{let n=t.length===1?{...e,...t[0]}:{...e};return t.length===1||tl(n,t[0],t[1]),n}));Nd()(`effect/Effect/Transaction`);var Wv=zm,Gv=Bm,Kv=Im,qv=hm;export{hv as $,Fe as $a,Rs as $i,pd as $n,$c as $r,mp as $t,V_ as A,ci as Aa,T as Ai,Rf as An,Xl as Ar,km as At,cv as B,Nn as Ba,ms as Bi,Td as Bn,eu as Br,Vm as Bt,qv as C,$o as Ca,sc as Ci,_g as Cn,Hu as Cr,Ov as Ct,Nv as D,eo as Da,pc as Di,Ef as Dn,fu as Dr,Kg as Dt,Av as E,no as Ea,lc as Ei,yf as En,Pl as Er,B_ as Et,Vv as F,di as Fa,Hs as Fi,Zd as Fn,cu as Fr,bp as Ft,Cv as G,An as Ga,Ho as Gi,md as Gn,Sl as Gr,$ as Gt,lv as H,Vn as Ha,is as Hi,Ad as Hn,H as Hr,Hm as Ht,J_ as I,Ai as Ia,Vs as Ii,U as In,V as Ir,eh as It,Ev as J,Cn as Ja,Ya as Ji,hd as Jn,pl as Jr,Jp as Jt,Tv as K,nr as Ka,cs as Ki,xd as Kn,yl as Kr,qm as Kt,Wv as L,gi as La,Bs as Li,wd as Ln,B as Lr,e_ as Lt,nv as M,mi as Ma,E as Mi,W as Mn,vu as Mr,lh as Mt,S_ as N,ii as Na,Ys as Ni,Nd as Nn,I as Nr,yp as Nt,jv as O,Ta as Oa,qs as Oi,Df as On,F as Or,n_ as Ot,Hv as P,Xr as Pa,Xs as Pi,ef as Pn,lu as Pr,kp as Pt,pv as Q,v as Qa,Ns as Qi,bd as Qn,tl as Qr,pp as Qt,$_ as R,Cr as Ra,Bo as Ri,Dd as Rn,mu as Rr,Q as Rt,Bv as S,ko as Sa,hc as Si,J as Sn,Xu as Sr,Dv as St,kv as T,Fo as Ta,oc as Ti,Zf as Tn,du as Tr,T_ as Tt,dv as U,gr as Ua,fs as Ui,kd as Un,wl as Ur,Gm as Ut,uv as V,_r as Va,ns as Vi,Ed as Vn,iu as Vr,Um as Vt,N_ as W,Zn as Wa,bo as Wi,Od as Wn,Tl as Wr,Jm as Wt,rv as X,er as Xa,Ko as Xi,yd as Xn,dl as Xr,Ng as Xt,ev as Y,Ln as Ya,C as Yi,gd as Yn,fl as Yr,qp as Yt,E_ as Z,Jt as Za,rs as Zi,vd as Zn,nl as Zr,hp as Zt,I_ as _,Uo as _a,fc as _i,Wh as _n,Wu as _r,tv as _t,W_ as a,Do as aa,qc as ai,Cg as an,p as ao,td as ar,Iv as at,Kv as b,Wo as ba,rc as bi,em as bn,Zu as br,D_ as bt,X_ as c,Yo as ca,A as ci,tg as cn,n as co,cd as cr,gv as ct,Z_ as d,zs as da,j as di,Vh as dn,Qu as dr,mv as dt,No as ea,Qc as ei,Z as en,Le as eo,fd as er,sv as et,fv as f,ks as fa,O as fi,Bh as fn,ad as fr,ov as ft,F_ as g,xo as ga,cc as gi,qh as gn,qu as gr,G_ as gt,q_ as h,Cs as ha,ic as hi,zh as hn,Gu as hr,A_ as ht,C_ as i,go as ia,Kc as ii,Tg as in,ue as io,sd as ir,Lv as it,P_ as j,pi as ja,Js as ji,zf as jn,Kl as jr,um as jt,Mv as k,Zr as ka,Us as ki,Nf as kn,Ql as kr,Am as kt,M_ as l,ds as la,k as li,Yh as ln,t as lo,ld as lr,_v as lt,Sv as m,Go as ma,ac as mi,Rh as mn,dd as mr,k_ as mt,bv as n,zo as na,Zc as ni,gp as nn,Ve as no,od as nr,Pv as nt,Uv as o,To as oa,M as oi,Gg as on,ie as oo,ed as or,Rv as ot,R_ as p,as as pa,D as pi,Nh as pn,$u as pr,O_ as pt,wv as q,Sn as qa,ws as qi,_d as qn,P as qr,Gp as qt,xv as r,Vo as ra,N as ri,vp as rn,Ne as ro,id as rr,Fv as rt,Y_ as s,Fs as sa,Tc as si,Wg as sn,g as so,nd as sr,zv as st,yv as t,jo as ta,Yc as ti,Lp as tn,ze as to,ud as tr,K_ as tt,Q_ as u,Co as ua,xc as ui,Sg as un,rd as ur,vv as ut,L_ as v,js as va,dc as vi,Mh as vn,Uu as vr,iv as vt,w_ as w,qo as wa,nc as wi,X as wn,gu as wr,j_ as wt,U_ as x,Xa as xa,mc as xi,Y as xn,Ju as xr,z_ as xt,H_ as y,ts as ya,uc as yi,K as yn,Yu as yr,av as yt,Gv as z,Sr as za,wo as zi,Cd as zn,Ll as zr,Ym as zt};
|