@langgenius/syncless-darwin-arm64 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/package.json +1 -1
  2. package/payload/.env +1 -1
  3. package/payload/dist/cli.js +32 -31
  4. package/payload/dist/{devtools-DRLjR4jL.js → devtools-0vxqtR5R.js} +2 -2
  5. package/payload/dist/dist-CcLoeEPp.js +80 -0
  6. package/payload/dist/esm-DcZNWkvb.js +4 -0
  7. package/payload/dist/execAsync-B57lajYt.js +2 -2
  8. package/payload/dist/execAsync-BZAWwuvf.js +2 -2
  9. package/payload/dist/execAsync-D2zcCRHg.js +2 -2
  10. package/payload/dist/{execAsync-BKAmdm9j.js → execAsync-D_3X02jS.js} +2 -2
  11. package/payload/dist/execAsync-DzZ-O7pw.js +2 -2
  12. package/payload/dist/{getMachineId-bsd-D8MDNeC1.js → getMachineId-bsd-BrlN6PEO.js} +3 -3
  13. package/payload/dist/{getMachineId-bsd-DQ4vj5gD.js → getMachineId-bsd-C9rTsHCB.js} +3 -3
  14. package/payload/dist/{getMachineId-bsd-DezaGQHm.js → getMachineId-bsd-CIiF5I2-.js} +3 -3
  15. package/payload/dist/{getMachineId-bsd-B803VO9W.js → getMachineId-bsd-CWysdV5q.js} +3 -3
  16. package/payload/dist/{getMachineId-bsd-B9iGj-MA.js → getMachineId-bsd-DngtODTf.js} +3 -3
  17. package/payload/dist/{getMachineId-darwin-CP4E8iBX.js → getMachineId-darwin-BVHajbu-.js} +3 -3
  18. package/payload/dist/{getMachineId-darwin-CdPAK2OG.js → getMachineId-darwin-Bh0FW8Yj.js} +3 -3
  19. package/payload/dist/{getMachineId-darwin-D5gsOLFi.js → getMachineId-darwin-DjZKKbMx.js} +3 -3
  20. package/payload/dist/{getMachineId-darwin-ChpKIwB6.js → getMachineId-darwin-L_bpBFRk.js} +3 -3
  21. package/payload/dist/getMachineId-darwin-j7fk-PUK.js +5 -0
  22. package/payload/dist/{getMachineId-linux-B1kFsVk7.js → getMachineId-linux-6ZzpQRKs.js} +3 -3
  23. package/payload/dist/{getMachineId-linux-BWjxDDOC.js → getMachineId-linux-BNh9bxS-.js} +3 -3
  24. package/payload/dist/{getMachineId-linux-B2UT6SaH.js → getMachineId-linux-DF4P4JAH.js} +3 -3
  25. package/payload/dist/{getMachineId-linux-BS6GytMx.js → getMachineId-linux-DtCHfcI-.js} +3 -3
  26. package/payload/dist/getMachineId-linux-Uf_DKcur.js +4 -0
  27. package/payload/dist/{getMachineId-unsupported-BW_gncpJ.js → getMachineId-unsupported-BHgtlyRW.js} +3 -3
  28. package/payload/dist/{getMachineId-unsupported-C1K8mJVz.js → getMachineId-unsupported-BU7O02cs.js} +3 -3
  29. package/payload/dist/{getMachineId-unsupported-Ctq0B8z5.js → getMachineId-unsupported-Ba8WKp1L.js} +3 -3
  30. package/payload/dist/{getMachineId-unsupported-CbS6Q1YO.js → getMachineId-unsupported-BhnsN8NZ.js} +3 -3
  31. package/payload/dist/getMachineId-unsupported-BynWzgul.js +4 -0
  32. package/payload/dist/{getMachineId-win-CVzFw4Vq.js → getMachineId-win-DHX0BZr6.js} +3 -3
  33. package/payload/dist/{getMachineId-win-AdojdA1n.js → getMachineId-win-Daab2wn9.js} +3 -3
  34. package/payload/dist/{getMachineId-win-CsN4rTaI.js → getMachineId-win-DvS6eAIQ.js} +3 -3
  35. package/payload/dist/{getMachineId-win-B9ZOFvA0.js → getMachineId-win-IRvYdsh7.js} +3 -3
  36. package/payload/dist/{getMachineId-win-CDcGJPww.js → getMachineId-win-LU1p7cWS.js} +3 -3
  37. package/payload/dist/{login_cycle-CAezpu7q-D2gyyQd6.js → login_cycle-C36tv8w1-C_uOBmKQ.js} +3 -3
  38. package/payload/dist/{runtime_auth_helpers-D4nu_5Cl-Cz1EtHMS.js → runtime_auth_helpers-CmuDi4B4-HYJPHkxE.js} +3 -3
  39. package/payload/dist/{runtime_auth_helpers-D4nu_5Cl-DvImlO82.js → runtime_auth_helpers-CmuDi4B4-QIl-jUV3.js} +3 -3
  40. package/payload/dist/{status-Cr57icb_-D3mTQM7b.js → status-jFJKIUBU-BCgr1MV_.js} +2 -2
  41. package/payload/package.json +2 -1
  42. package/payload/dist/esm-CVx3LwsY.js +0 -4
  43. package/payload/dist/getMachineId-darwin-Dmm_oRlX.js +0 -5
  44. package/payload/dist/getMachineId-linux-DGHtw-N6.js +0 -4
  45. package/payload/dist/getMachineId-unsupported-SVDlQL4c.js +0 -4
  46. package/payload/dist/rpc-BO_UIqCx-CKiy5fwF.js +0 -80
@@ -0,0 +1,80 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e16d36e9-1876-5088-a6a9-ad4448d5a19b")}catch(e){}}();
3
+ import{t as e}from"./chunk-Bdh3yLIe.js";Object.freeze({status:`aborted`});function t(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var n=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},r=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};const i={};function a(e){return e&&Object.assign(i,e),i}function o(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function s(e,t){return typeof t==`bigint`?t.toString():t}function c(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function l(e){return e==null}function u(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function d(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}const f=Symbol(`evaluating`);function p(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==f)return r===void 0&&(r=f,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ee(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function m(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function te(e){return JSON.stringify(e)}function ne(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const re=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ie(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const ae=c(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function oe(e){if(ie(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(ie(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function se(e){return oe(e)?{...e}:Array.isArray(e)?[...e]:e}const ce=new Set([`string`,`number`,`symbol`]);function le(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function h(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function g(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ue(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const de={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function fe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return h(e,m(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return ee(this,`shape`,e),e},checks:[]}))}function pe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return h(e,m(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return ee(this,`shape`,r),r},checks:[]}))}function me(e,t){if(!oe(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return h(e,m(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ee(this,`shape`,n),n}}))}function he(e,t){if(!oe(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return h(e,m(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ee(this,`shape`,n),n}}))}function ge(e,t){return h(e,m(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ee(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function _e(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return h(t,m(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return ee(this,`shape`,i),i},checks:[]}))}function ve(e,t,n){return h(t,m(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return ee(this,`shape`,i),i}}))}function ye(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function be(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function xe(e){return typeof e==`string`?e:e?.message}function _(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=xe(e.inst?._zod.def?.error?.(e))??xe(t?.error?.(e))??xe(n.customError?.(e))??xe(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Se(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ce(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const we=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,s,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Te=t(`$ZodError`,we),Ee=t(`$ZodError`,we,{Parent:Error});function De(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Oe(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}const ke=e=>(t,r,i,o)=>{let s=i?Object.assign(i,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new n;if(c.issues.length){let t=new(o?.Err??e)(c.issues.map(e=>_(e,s,a())));throw re(t,o?.callee),t}return c.value},Ae=e=>async(t,n,r,i)=>{let o=r?Object.assign(r,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>_(e,o,a())));throw re(t,i?.callee),t}return s.value},je=e=>(t,r,i)=>{let o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new n;return s.issues.length?{success:!1,error:new(e??Te)(s.issues.map(e=>_(e,o,a())))}:{success:!0,data:s.value}},Me=je(Ee),Ne=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>_(e,i,a())))}:{success:!0,data:o.value}},Pe=Ne(Ee),Fe=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ke(e)(t,n,i)},Ie=e=>(t,n,r)=>ke(e)(t,n,r),Le=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ae(e)(t,n,i)},Re=e=>async(t,n,r)=>Ae(e)(t,n,r),ze=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return je(e)(t,n,i)},Be=e=>(t,n,r)=>je(e)(t,n,r),Ve=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ne(e)(t,n,i)},He=e=>async(t,n,r)=>Ne(e)(t,n,r),Ue=/^[cC][^\s-]{8,}$/,We=/^[0-9a-z]+$/,Ge=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ke=/^[0-9a-vA-V]{20}$/,qe=/^[A-Za-z0-9]{27}$/,Je=/^[a-zA-Z0-9_-]{21}$/,Ye=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Xe=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ze=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Qe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function $e(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const et=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,tt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,nt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,rt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,it=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,at=/^[A-Za-z0-9_-]*$/,ot=/^\+[1-9]\d{6,14}$/,st=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,ct=RegExp(`^${st}$`);function lt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ut(e){return RegExp(`^${lt(e)}$`)}function dt(e){let t=lt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${st}T(?:${r})$`)}const ft=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},pt=/^-?\d+$/,mt=/^-?\d+(?:\.\d+)?$/,ht=/^(?:true|false)$/i,gt=/^null$/i,_t=/^[^A-Z]*$/,vt=/^[^a-z]*$/,v=t(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),yt={number:`number`,bigint:`bigint`,object:`date`},bt=t(`$ZodCheckLessThan`,(e,t)=>{v.init(e,t);let n=yt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xt=t(`$ZodCheckGreaterThan`,(e,t)=>{v.init(e,t);let n=yt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),St=t(`$ZodCheckMultipleOf`,(e,t)=>{v.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):d(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ct=t(`$ZodCheckNumberFormat`,(e,t)=>{v.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=de[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=pt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),wt=t(`$ZodCheckMaxLength`,(e,t)=>{var n;v.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!l(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Se(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Tt=t(`$ZodCheckMinLength`,(e,t)=>{var n;v.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!l(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Se(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Et=t(`$ZodCheckLengthEquals`,(e,t)=>{var n;v.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!l(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Se(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Dt=t(`$ZodCheckStringFormat`,(e,t)=>{var n,r;v.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ot=t(`$ZodCheckRegex`,(e,t)=>{Dt.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),kt=t(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=_t,Dt.init(e,t)}),At=t(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=vt,Dt.init(e,t)}),jt=t(`$ZodCheckIncludes`,(e,t)=>{v.init(e,t);let n=le(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Mt=t(`$ZodCheckStartsWith`,(e,t)=>{v.init(e,t);let n=RegExp(`^${le(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Nt=t(`$ZodCheckEndsWith`,(e,t)=>{v.init(e,t);let n=RegExp(`.*${le(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Pt=t(`$ZodCheckOverwrite`,(e,t)=>{v.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Ft=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
4
+ `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
5
+ `))}};const It={major:4,minor:3,patch:6},y=t(`$ZodType`,(e,t)=>{var r;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=It;let i=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&i.unshift(e);for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let i=ye(e),a;for(let o of t){if(o._zod.def.when){if(!o._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&r?.async===!1)throw new n;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(i||=ye(e,t))});else{if(e.issues.length===t)continue;i||=ye(e,t)}}return a?a.then(()=>e):e},r=(r,a,o)=>{if(ye(r))return r.aborted=!0,r;let s=t(a,i,o);if(s instanceof Promise){if(o.async===!1)throw new n;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(a,o)=>{if(o.skipChecks)return e._zod.parse(a,o);if(o.direction===`backward`){let t=e._zod.parse({value:a.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,o)):r(t,a,o)}let s=e._zod.parse(a,o);if(s instanceof Promise){if(o.async===!1)throw new n;return s.then(e=>t(e,i,o))}return t(s,i,o)}}p(e,`~standard`,()=>({validate:t=>{try{let n=Me(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Pe(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Lt=t(`$ZodString`,(e,t)=>{y.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ft(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),b=t(`$ZodStringFormat`,(e,t)=>{Dt.init(e,t),Lt.init(e,t)}),Rt=t(`$ZodGUID`,(e,t)=>{t.pattern??=Xe,b.init(e,t)}),zt=t(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Ze(e)}else t.pattern??=Ze();b.init(e,t)}),Bt=t(`$ZodEmail`,(e,t)=>{t.pattern??=Qe,b.init(e,t)}),Vt=t(`$ZodURL`,(e,t)=>{b.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ht=t(`$ZodEmoji`,(e,t)=>{t.pattern??=$e(),b.init(e,t)}),Ut=t(`$ZodNanoID`,(e,t)=>{t.pattern??=Je,b.init(e,t)}),Wt=t(`$ZodCUID`,(e,t)=>{t.pattern??=Ue,b.init(e,t)}),Gt=t(`$ZodCUID2`,(e,t)=>{t.pattern??=We,b.init(e,t)}),Kt=t(`$ZodULID`,(e,t)=>{t.pattern??=Ge,b.init(e,t)}),qt=t(`$ZodXID`,(e,t)=>{t.pattern??=Ke,b.init(e,t)}),Jt=t(`$ZodKSUID`,(e,t)=>{t.pattern??=qe,b.init(e,t)}),Yt=t(`$ZodISODateTime`,(e,t)=>{t.pattern??=dt(t),b.init(e,t)}),Xt=t(`$ZodISODate`,(e,t)=>{t.pattern??=ct,b.init(e,t)}),Zt=t(`$ZodISOTime`,(e,t)=>{t.pattern??=ut(t),b.init(e,t)}),Qt=t(`$ZodISODuration`,(e,t)=>{t.pattern??=Ye,b.init(e,t)}),$t=t(`$ZodIPv4`,(e,t)=>{t.pattern??=et,b.init(e,t),e._zod.bag.format=`ipv4`}),en=t(`$ZodIPv6`,(e,t)=>{t.pattern??=tt,b.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),tn=t(`$ZodCIDRv4`,(e,t)=>{t.pattern??=nt,b.init(e,t)}),nn=t(`$ZodCIDRv6`,(e,t)=>{t.pattern??=rt,b.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function rn(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const an=t(`$ZodBase64`,(e,t)=>{t.pattern??=it,b.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{rn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function on(e){if(!at.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return rn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const sn=t(`$ZodBase64URL`,(e,t)=>{t.pattern??=at,b.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{on(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),cn=t(`$ZodE164`,(e,t)=>{t.pattern??=ot,b.init(e,t)});function ln(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const un=t(`$ZodJWT`,(e,t)=>{b.init(e,t),e._zod.check=n=>{ln(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),dn=t(`$ZodNumber`,(e,t)=>{y.init(e,t),e._zod.pattern=e._zod.bag.pattern??mt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),fn=t(`$ZodNumberFormat`,(e,t)=>{Ct.init(e,t),dn.init(e,t)}),pn=t(`$ZodBoolean`,(e,t)=>{y.init(e,t),e._zod.pattern=ht,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),mn=t(`$ZodNull`,(e,t)=>{y.init(e,t),e._zod.pattern=gt,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),hn=t(`$ZodUnknown`,(e,t)=>{y.init(e,t),e._zod.parse=e=>e}),gn=t(`$ZodNever`,(e,t)=>{y.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function _n(e,t,n){e.issues.length&&t.issues.push(...be(n,e.issues)),t.value[n]=e.value}const vn=t(`$ZodArray`,(e,t)=>{y.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>_n(t,n,e))):_n(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function yn(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...be(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function bn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=ue(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function xn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>yn(e,n,i,t,u))):yn(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const Sn=t(`$ZodObject`,(e,t)=>{if(y.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=c(()=>bn(t));p(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=ie,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>yn(n,t,e,s,r))):yn(i,t,e,s,r)}return i?xn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Cn=t(`$ZodObjectJIT`,(e,t)=>{Sn.init(e,t);let n=e._zod.parse,r=c(()=>bn(t)),a=e=>{let t=new Ft([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=te(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=te(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
6
+ if (${n}.issues.length) {
7
+ if (${o} in input) {
8
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
9
+ ...iss,
10
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
11
+ })));
12
+ }
13
+ }
14
+
15
+ if (${n}.value === undefined) {
16
+ if (${o} in input) {
17
+ newResult[${o}] = undefined;
18
+ }
19
+ } else {
20
+ newResult[${o}] = ${n}.value;
21
+ }
22
+
23
+ `):t.write(`
24
+ if (${n}.issues.length) {
25
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
26
+ ...iss,
27
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
28
+ })));
29
+ }
30
+
31
+ if (${n}.value === undefined) {
32
+ if (${o} in input) {
33
+ newResult[${o}] = undefined;
34
+ }
35
+ } else {
36
+ newResult[${o}] = ${n}.value;
37
+ }
38
+
39
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},o,s=ie,l=!i.jitless,u=l&&ae.value,d=t.catchall,f;e._zod.parse=(i,c)=>{f??=r.value;let p=i.value;return s(p)?l&&u&&c?.async===!1&&c.jitless!==!0?(o||=a(t.shape),i=o(i,c),d?xn([],p,i,c,f,e):i):n(i,c):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function wn(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=>!ye(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=>_(e,r,a())))}),t)}const Tn=t(`$ZodUnion`,(e,t)=>{y.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=>u(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>wn(t,i,e,a)):wn(s,i,e,a)}}),En=t(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Tn.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=c(()=>{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?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),Dn=t(`$ZodIntersection`,(e,t)=>{y.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])=>kn(e,t,n)):kn(e,i,a)}});function On(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=On(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=On(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 kn(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}),ye(e))return e;let o=On(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const An=t(`$ZodRecord`,(e,t)=>{y.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 o=[],s=t.keyType._zod.values;if(s){n.value={};let a=new Set;for(let e of s)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){a.add(typeof e==`number`?e.toString():e);let s=t.valueType._zod.run({value:i[e],issues:[]},r);s instanceof Promise?o.push(s.then(t=>{t.issues.length&&n.issues.push(...be(e,t.issues)),n.value[e]=t.value})):(s.issues.length&&n.issues.push(...be(e,s.issues)),n.value[e]=s.value)}let c;for(let e in i)a.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let s of Reflect.ownKeys(i)){if(s===`__proto__`)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`&&mt.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=>_(e,r,a())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:i[s],issues:[]},r);l instanceof Promise?o.push(l.then(e=>{e.issues.length&&n.issues.push(...be(s,e.issues)),n.value[c.value]=e.value})):(l.issues.length&&n.issues.push(...be(s,l.issues)),n.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),jn=t(`$ZodEnum`,(e,t)=>{y.init(e,t);let n=o(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}}),Mn=t(`$ZodLiteral`,(e,t)=>{if(y.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}}),Nn=t(`$ZodTransform`,(e,t)=>{y.init(e,t),e._zod.parse=(i,a)=>{if(a.direction===`backward`)throw new r(e.constructor.name);let o=t.transform(i.value,i);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(i.value=e,i));if(o instanceof Promise)throw new n;return i.value=o,i}});function Pn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Fn=t(`$ZodOptional`,(e,t)=>{y.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(`^(${u(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Pn(t,e.value)):Pn(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),In=t(`$ZodExactOptional`,(e,t)=>{Fn.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)}),Ln=t(`$ZodNullable`,(e,t)=>{y.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(`^(${u(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)}),Rn=t(`$ZodDefault`,(e,t)=>{y.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=>zn(e,t)):zn(r,t)}});function zn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Bn=t(`$ZodPrefault`,(e,t)=>{y.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))}),Vn=t(`$ZodNonOptional`,(e,t)=>{y.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=>Hn(t,e)):Hn(i,e)}});function Hn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Un=t(`$ZodCatch`,(e,t)=>{y.init(e,t),p(e._zod,`optin`,()=>t.innerType._zod.optin),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=>_(e,n,a()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>_(e,n,a()))},input:e.value}),e.issues=[]),e)}}),Wn=t(`$ZodPipe`,(e,t)=>{y.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=>Gn(e,t.in,n)):Gn(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Gn(e,t.out,n)):Gn(r,t.out,n)}});function Gn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Kn=t(`$ZodReadonly`,(e,t)=>{y.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(qn):qn(r)}});function qn(e){return e.value=Object.freeze(e.value),e}const Jn=t(`$ZodLazy`,(e,t)=>{y.init(e,t),p(e._zod,`innerType`,()=>t.getter()),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)}),Yn=t(`$ZodCustom`,(e,t)=>{v.init(e,t),y.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=>Xn(t,n,r,e));Xn(i,n,r,e)}});function Xn(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(Ce(e))}}var Zn,Qn=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 $n(){return new Qn}(Zn=globalThis).__zod_globalRegistry??(Zn.__zod_globalRegistry=$n());const er=globalThis.__zod_globalRegistry;function tr(e,t){return new e({type:`string`,...g(t)})}function nr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...g(t)})}function rr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...g(t)})}function ir(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...g(t)})}function ar(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 sr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...g(t)})}function cr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...g(t)})}function lr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...g(t)})}function ur(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...g(t)})}function dr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...g(t)})}function fr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...g(t)})}function pr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...g(t)})}function mr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...g(t)})}function hr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...g(t)})}function gr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...g(t)})}function _r(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...g(t)})}function vr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...g(t)})}function yr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...g(t)})}function br(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...g(t)})}function xr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...g(t)})}function Sr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...g(t)})}function Cr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...g(t)})}function wr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...g(t)})}function Tr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...g(t)})}function Er(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...g(t)})}function Dr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...g(t)})}function Or(e,t){return new e({type:`number`,checks:[],...g(t)})}function kr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...g(t)})}function Ar(e,t){return new e({type:`boolean`,...g(t)})}function jr(e,t){return new e({type:`null`,...g(t)})}function Mr(e){return new e({type:`unknown`})}function Nr(e,t){return new e({type:`never`,...g(t)})}function Pr(e,t){return new bt({check:`less_than`,...g(t),value:e,inclusive:!1})}function Fr(e,t){return new bt({check:`less_than`,...g(t),value:e,inclusive:!0})}function Ir(e,t){return new xt({check:`greater_than`,...g(t),value:e,inclusive:!1})}function Lr(e,t){return new xt({check:`greater_than`,...g(t),value:e,inclusive:!0})}function Rr(e,t){return new St({check:`multiple_of`,...g(t),value:e})}function zr(e,t){return new wt({check:`max_length`,...g(t),maximum:e})}function Br(e,t){return new Tt({check:`min_length`,...g(t),minimum:e})}function Vr(e,t){return new Et({check:`length_equals`,...g(t),length:e})}function Hr(e,t){return new Ot({check:`string_format`,format:`regex`,...g(t),pattern:e})}function Ur(e){return new kt({check:`string_format`,format:`lowercase`,...g(e)})}function Wr(e){return new At({check:`string_format`,format:`uppercase`,...g(e)})}function Gr(e,t){return new jt({check:`string_format`,format:`includes`,...g(t),includes:e})}function Kr(e,t){return new Mt({check:`string_format`,format:`starts_with`,...g(t),prefix:e})}function qr(e,t){return new Nt({check:`string_format`,format:`ends_with`,...g(t),suffix:e})}function Jr(e){return new Pt({check:`overwrite`,tx:e})}function Yr(e){return Jr(t=>t.normalize(e))}function Xr(){return Jr(e=>e.trim())}function Zr(){return Jr(e=>e.toLowerCase())}function Qr(){return Jr(e=>e.toUpperCase())}function $r(){return Jr(e=>ne(e))}function ei(e,t,n){return new e({type:`array`,element:t,...g(n)})}function ti(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...g(n)})}function ni(e){let t=ri(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(Ce(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(Ce(r))}},e(n.value,n)));return t}function ri(e,t){let n=new v({check:`custom`,...g(t)});return n._zod.check=e,n}function ii(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??er,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 x(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,x(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`&&S(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ai(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>
40
+
41
+ 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 oi(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.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:ci(t,`input`,e.processors),output:ci(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function S(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 S(r.element,n);if(r.type===`set`)return S(r.valueType,n);if(r.type===`lazy`)return S(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 S(r.innerType,n);if(r.type===`intersection`)return S(r.left,n)||S(r.right,n);if(r.type===`record`||r.type===`map`)return S(r.keyType,n)||S(r.valueType,n);if(r.type===`pipe`)return S(r.in,n)||S(r.out,n);if(r.type===`object`){for(let e in r.shape)if(S(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(S(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(S(e,n))return!0;return!!(r.rest&&S(r.rest,n))}return!1}const si=(e,t={})=>n=>{let r=ii({...n,processors:t});return x(e,r),ai(r,e),oi(r,e)},ci=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ii({...i??{},target:a,io:t,processors:n});return x(e,o),ai(o,e),oi(o,e)},li={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ui=(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}))])}},di=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},fi=(e,t,n,r)=>{n.type=`boolean`},pi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},mi=(e,t,n,r)=>{n.not={}},hi=(e,t,n,r)=>{let i=e._zod.def,a=o(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},gi=(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(`Custom types cannot be represented in JSON Schema`)},vi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},yi=(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=x(a.element,t,{...r,path:[...r.path,`items`]})},bi=(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]=x(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=x(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},xi=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>x(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Si=(e,t,n,r)=>{let i=e._zod.def,a=x(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=x(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]]},Ci=(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=x(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=x(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=x(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)}},wi=(e,t,n,r)=>{let i=e._zod.def,a=x(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`}]},Ti=(e,t,n,r)=>{let i=e._zod.def;x(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ei=(e,t,n,r)=>{let i=e._zod.def;x(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Di=(e,t,n,r)=>{let i=e._zod.def;x(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)))},Oi=(e,t,n,r)=>{let i=e._zod.def;x(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},ki=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;x(a,t,r);let o=t.seen.get(e);o.ref=a},Ai=(e,t,n,r)=>{let i=e._zod.def;x(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},ji=(e,t,n,r)=>{let i=e._zod.def;x(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Mi=(e,t,n,r)=>{let i=e._zod.innerType;x(i,t,r);let a=t.seen.get(e);a.ref=i},Ni=t(`ZodISODateTime`,(e,t)=>{Yt.init(e,t),E.init(e,t)});function Pi(e){return wr(Ni,e)}const Fi=t(`ZodISODate`,(e,t)=>{Xt.init(e,t),E.init(e,t)});function Ii(e){return Tr(Fi,e)}const Li=t(`ZodISOTime`,(e,t)=>{Zt.init(e,t),E.init(e,t)});function Ri(e){return Er(Li,e)}const zi=t(`ZodISODuration`,(e,t)=>{Qt.init(e,t),E.init(e,t)});function Bi(e){return Dr(zi,e)}const Vi=(e,t)=>{Te.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Oe(e,t)},flatten:{value:t=>De(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,s,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,s,2)}},isEmpty:{get(){return e.issues.length===0}}})};t(`ZodError`,Vi);const C=t(`ZodError`,Vi,{Parent:Error}),Hi=ke(C),Ui=Ae(C),Wi=je(C),Gi=Ne(C),Ki=Fe(C),qi=Ie(C),Ji=Le(C),Yi=Re(C),Xi=ze(C),Zi=Be(C),Qi=Ve(C),$i=He(C),w=t(`ZodType`,(e,t)=>(y.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:ci(e,`input`),output:ci(e,`output`)}}),e.toJSONSchema=si(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(m(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>h(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Hi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Wi(e,t,n),e.parseAsync=async(t,n)=>Ui(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Gi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ki(e,t,n),e.decode=(t,n)=>qi(e,t,n),e.encodeAsync=async(t,n)=>Ji(e,t,n),e.decodeAsync=async(t,n)=>Yi(e,t,n),e.safeEncode=(t,n)=>Xi(e,t,n),e.safeDecode=(t,n)=>Zi(e,t,n),e.safeEncodeAsync=async(t,n)=>Qi(e,t,n),e.safeDecodeAsync=async(t,n)=>$i(e,t,n),e.refine=(t,n)=>e.check(vo(t,n)),e.superRefine=t=>e.check(yo(t)),e.overwrite=t=>e.check(Jr(t)),e.optional=()=>Za(e),e.exactOptional=()=>$a(e),e.nullable=()=>to(e),e.nullish=()=>Za(to(e)),e.nonoptional=t=>so(e,t),e.array=()=>D(e),e.or=t=>Ia([e,t]),e.and=t=>Ba(e,t),e.transform=t=>fo(e,Ya(t)),e.default=t=>ro(e,t),e.prefault=t=>ao(e,t),e.catch=t=>lo(e,t),e.pipe=t=>fo(e,t),e.readonly=()=>mo(e),e.describe=t=>{let n=e.clone();return er.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return er.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return er.get(e);let n=e.clone();return er.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),ea=t(`_ZodString`,(e,t)=>{Lt.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Hr(...t)),e.includes=(...t)=>e.check(Gr(...t)),e.startsWith=(...t)=>e.check(Kr(...t)),e.endsWith=(...t)=>e.check(qr(...t)),e.min=(...t)=>e.check(Br(...t)),e.max=(...t)=>e.check(zr(...t)),e.length=(...t)=>e.check(Vr(...t)),e.nonempty=(...t)=>e.check(Br(1,...t)),e.lowercase=t=>e.check(Ur(t)),e.uppercase=t=>e.check(Wr(t)),e.trim=()=>e.check(Xr()),e.normalize=(...t)=>e.check(Yr(...t)),e.toLowerCase=()=>e.check(Zr()),e.toUpperCase=()=>e.check(Qr()),e.slugify=()=>e.check($r())}),ta=t(`ZodString`,(e,t)=>{Lt.init(e,t),ea.init(e,t),e.email=t=>e.check(nr(na,t)),e.url=t=>e.check(cr(aa,t)),e.jwt=t=>e.check(Cr(ba,t)),e.emoji=t=>e.check(lr(oa,t)),e.guid=t=>e.check(rr(ra,t)),e.uuid=t=>e.check(ir(ia,t)),e.uuidv4=t=>e.check(ar(ia,t)),e.uuidv6=t=>e.check(or(ia,t)),e.uuidv7=t=>e.check(sr(ia,t)),e.nanoid=t=>e.check(ur(sa,t)),e.guid=t=>e.check(rr(ra,t)),e.cuid=t=>e.check(dr(ca,t)),e.cuid2=t=>e.check(fr(la,t)),e.ulid=t=>e.check(pr(ua,t)),e.base64=t=>e.check(br(_a,t)),e.base64url=t=>e.check(xr(va,t)),e.xid=t=>e.check(mr(da,t)),e.ksuid=t=>e.check(hr(fa,t)),e.ipv4=t=>e.check(gr(pa,t)),e.ipv6=t=>e.check(_r(ma,t)),e.cidrv4=t=>e.check(vr(ha,t)),e.cidrv6=t=>e.check(yr(ga,t)),e.e164=t=>e.check(Sr(ya,t)),e.datetime=t=>e.check(Pi(t)),e.date=t=>e.check(Ii(t)),e.time=t=>e.check(Ri(t)),e.duration=t=>e.check(Bi(t))});function T(e){return tr(ta,e)}const E=t(`ZodStringFormat`,(e,t)=>{b.init(e,t),ea.init(e,t)}),na=t(`ZodEmail`,(e,t)=>{Bt.init(e,t),E.init(e,t)}),ra=t(`ZodGUID`,(e,t)=>{Rt.init(e,t),E.init(e,t)}),ia=t(`ZodUUID`,(e,t)=>{zt.init(e,t),E.init(e,t)}),aa=t(`ZodURL`,(e,t)=>{Vt.init(e,t),E.init(e,t)}),oa=t(`ZodEmoji`,(e,t)=>{Ht.init(e,t),E.init(e,t)}),sa=t(`ZodNanoID`,(e,t)=>{Ut.init(e,t),E.init(e,t)}),ca=t(`ZodCUID`,(e,t)=>{Wt.init(e,t),E.init(e,t)}),la=t(`ZodCUID2`,(e,t)=>{Gt.init(e,t),E.init(e,t)}),ua=t(`ZodULID`,(e,t)=>{Kt.init(e,t),E.init(e,t)}),da=t(`ZodXID`,(e,t)=>{qt.init(e,t),E.init(e,t)}),fa=t(`ZodKSUID`,(e,t)=>{Jt.init(e,t),E.init(e,t)}),pa=t(`ZodIPv4`,(e,t)=>{$t.init(e,t),E.init(e,t)}),ma=t(`ZodIPv6`,(e,t)=>{en.init(e,t),E.init(e,t)}),ha=t(`ZodCIDRv4`,(e,t)=>{tn.init(e,t),E.init(e,t)}),ga=t(`ZodCIDRv6`,(e,t)=>{nn.init(e,t),E.init(e,t)}),_a=t(`ZodBase64`,(e,t)=>{an.init(e,t),E.init(e,t)}),va=t(`ZodBase64URL`,(e,t)=>{sn.init(e,t),E.init(e,t)}),ya=t(`ZodE164`,(e,t)=>{cn.init(e,t),E.init(e,t)}),ba=t(`ZodJWT`,(e,t)=>{un.init(e,t),E.init(e,t)}),xa=t(`ZodNumber`,(e,t)=>{dn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r),e.gt=(t,n)=>e.check(Ir(t,n)),e.gte=(t,n)=>e.check(Lr(t,n)),e.min=(t,n)=>e.check(Lr(t,n)),e.lt=(t,n)=>e.check(Pr(t,n)),e.lte=(t,n)=>e.check(Fr(t,n)),e.max=(t,n)=>e.check(Fr(t,n)),e.int=t=>e.check(wa(t)),e.safe=t=>e.check(wa(t)),e.positive=t=>e.check(Ir(0,t)),e.nonnegative=t=>e.check(Lr(0,t)),e.negative=t=>e.check(Pr(0,t)),e.nonpositive=t=>e.check(Fr(0,t)),e.multipleOf=(t,n)=>e.check(Rr(t,n)),e.step=(t,n)=>e.check(Rr(t,n)),e.finite=()=>e;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 Sa(e){return Or(xa,e)}const Ca=t(`ZodNumberFormat`,(e,t)=>{fn.init(e,t),xa.init(e,t)});function wa(e){return kr(Ca,e)}const Ta=t(`ZodBoolean`,(e,t)=>{pn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r)});function Ea(e){return Ar(Ta,e)}const Da=t(`ZodNull`,(e,t)=>{mn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r)});function Oa(e){return jr(Da,e)}const ka=t(`ZodUnknown`,(e,t)=>{hn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Aa(){return Mr(ka)}const ja=t(`ZodNever`,(e,t)=>{gn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r)});function Ma(e){return Nr(ja,e)}const Na=t(`ZodArray`,(e,t)=>{vn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Br(t,n)),e.nonempty=t=>e.check(Br(1,t)),e.max=(t,n)=>e.check(zr(t,n)),e.length=(t,n)=>e.check(Vr(t,n)),e.unwrap=()=>e.element});function D(e,t){return ei(Na,e,t)}const Pa=t(`ZodObject`,(e,t)=>{Cn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),p(e,`shape`,()=>t.shape),e.keyof=()=>Wa(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Aa()}),e.loose=()=>e.clone({...e._zod.def,catchall:Aa()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ma()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>me(e,t),e.safeExtend=t=>he(e,t),e.merge=t=>ge(e,t),e.pick=t=>fe(e,t),e.omit=t=>pe(e,t),e.partial=(...t)=>_e(Xa,e,t[0]),e.required=(...t)=>ve(oo,e,t[0])});function O(e,t){return new Pa({type:`object`,shape:e??{},...g(t)})}const Fa=t(`ZodUnion`,(e,t)=>{Tn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.options=t.options});function Ia(e,t){return new Fa({type:`union`,options:e,...g(t)})}const La=t(`ZodDiscriminatedUnion`,(e,t)=>{Fa.init(e,t),En.init(e,t)});function Ra(e,t,n){return new La({type:`union`,options:t,discriminator:e,...g(n)})}const za=t(`ZodIntersection`,(e,t)=>{Dn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r)});function Ba(e,t){return new za({type:`intersection`,left:e,right:t})}const Va=t(`ZodRecord`,(e,t)=>{An.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ha(e,t,n){return new Va({type:`record`,keyType:e,valueType:t,...g(n)})}const Ua=t(`ZodEnum`,(e,t)=>{jn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(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 Ua({...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 Ua({...t,checks:[],...g(r),entries:i})}});function Wa(e,t){return new Ua({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...g(t)})}function Ga(e,t){return new Ua({type:`enum`,entries:e,...g(t)})}const Ka=t(`ZodLiteral`,(e,t)=>{Mn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(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 qa(e,t){return new Ka({type:`literal`,values:Array.isArray(e)?e:[e],...g(t)})}const Ja=t(`ZodTransform`,(e,t)=>{Nn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r),e._zod.parse=(n,i)=>{if(i.direction===`backward`)throw new r(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ce(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(Ce(t))}};let a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n)):(n.value=a,n)}});function Ya(e){return new Ja({type:`transform`,transform:e})}const Xa=t(`ZodOptional`,(e,t)=>{Fn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Za(e){return new Xa({type:`optional`,innerType:e})}const Qa=t(`ZodExactOptional`,(e,t)=>{In.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $a(e){return new Qa({type:`optional`,innerType:e})}const eo=t(`ZodNullable`,(e,t)=>{Ln.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function to(e){return new eo({type:`nullable`,innerType:e})}const no=t(`ZodDefault`,(e,t)=>{Rn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ro(e,t){return new no({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}const io=t(`ZodPrefault`,(e,t)=>{Bn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ao(e,t){return new io({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}const oo=t(`ZodNonOptional`,(e,t)=>{Vn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function so(e,t){return new oo({type:`nonoptional`,innerType:e,...g(t)})}const co=t(`ZodCatch`,(e,t)=>{Un.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lo(e,t){return new co({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const uo=t(`ZodPipe`,(e,t)=>{Wn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.in=t.in,e.out=t.out});function fo(e,t){return new uo({type:`pipe`,in:e,out:t})}const po=t(`ZodReadonly`,(e,t)=>{Kn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mo(e){return new po({type:`readonly`,innerType:e})}const ho=t(`ZodLazy`,(e,t)=>{Jn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function go(e){return new ho({type:`lazy`,getter:e})}const _o=t(`ZodCustom`,(e,t)=>{Yn.init(e,t),w.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r)});function vo(e,t={}){return ti(_o,e,t)}function yo(e){return ni(e)}const bo={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`};var xo;(function(e){})(xo||={});const So={REVIEW_LIST_PENDING:`review.list_pending`,REVIEW_GET:`review.get`},Co=go(()=>Ia([T(),Sa(),Ea(),Oa(),D(Co),Ha(T(),Co)])),wo={TASK_LIST:`task.list`,TASK_SYNC:`task.sync`,TASK_GET:`task.get`,TASK_OPTIONS_SET:`task.options.set`,TASK_STATUS_SET:`task.status.set`,TASK_UNREADS_CLEAR:`task.unreads.clear`,TASK_CREATE:`task.create`,TASK_SEND:`task.send`,TASK_STOP:`task.stop`,TASK_TOOLS:`task.tools`,TASK_MESSAGES:`task.messages`,TASK_IN_FLIGHT_MESSAGES:`task.in_flight_messages`,TASK_TOOL_RESULT_GET:`task.tool_result.get`,TASK_PROMPT_EXPORT:`task.prompt_export`,TASK_AGENT_INSTRUCTION_GET:`task.agent_instruction.get`,TASK_AGENT_INSTRUCTION_SAVE:`task.agent_instruction.save`};O({message_origin:Wa([`human`,`agent`]).optional(),model_config_id:T().optional()}).catchall(Co);const To={WORKSPACE_LIST:`workspace.list`,WORKSPACE_SET_ACTIVE:`workspace.setActive`,WORKSPACE_UPDATE:`workspace.update`,WORKSPACE_MEMBERS_LIST:`workspace.members.list`,WORKSPACE_MEMBERS_INVITE:`workspace.members.invite`,WORKSPACE_MEMBERS_SET_STATUS:`workspace.members.setStatus`,WORKSPACE_TASK_USAGE_OVERVIEW:`workspace.taskUsageOverview`},Eo={AUTH_LOGIN_JWT:`auth:login:jwt`,CONNECTION_ACK:`connection.ack`,CONNECTION_EVENT_FILTER_SET:`connection.event_filter.set`},Do={CONNECTION_HEARTBEAT:`connection.heartbeat`},Oo={PREFERENCES_GET:`preferences.get`,PREFERENCES_UPDATE:`preferences.update`};let ko=function(e){return e.AUTOMATION=`automation`,e.BUG=`bug`,e.BUILD=`build`,e.CALENDAR=`calendar`,e.CODE=`code`,e.DEVICE=`device`,e.DOCUMENTS=`documents`,e.ENGINEERING=`engineering`,e.FINANCE=`finance`,e.IDEA=`idea`,e.INFORMATION=`information`,e.INBOX=`inbox`,e.INVITE=`invite`,e.MARKDOWN=`markdown`,e.PLANNING=`planning`,e.PRODUCT=`product`,e.REIMBURSEMENT=`reimbursement`,e.REQUIREMENTS=`requirements`,e.RESEARCH=`research`,e.REVIEW=`review`,e.SERVER=`server`,e.TEAM=`team`,e.TERMINAL=`terminal`,e.WEB=`web`,e}({}),Ao=function(e){return e.AMBER_SOFT=`#FFEAD5`,e.GREEN_LIGHT=`#E4FBCC`,e.MINT_LIGHT=`#D3F8DF`,e.SKY_LIGHT=`#E0F2FE`,e.BLUE_LIGHT=`#E0EAFF`,e.GRAY_LIGHT=`#EFF1F5`,e.PURPLE_LIGHT=`#FBE8FF`,e.PINK_LIGHT=`#FCE7F6`,e.YELLOW_LIGHT=`#FEF7C3`,e.LIME_LIGHT=`#E6F4D7`,e.CYAN_LIGHT=`#D5F5F6`,e.AZURE_LIGHT=`#D1E9FF`,e.INDIGO_LIGHT=`#D1E0FF`,e.SLATE_LIGHT=`#D5D9EB`,e.VIOLET_LIGHT=`#ECE9FE`,e.ROSE_LIGHT=`#FFE4E8`,e}({}),jo=function(e){return e.DOCUMENT=`document`,e.IMAGE=`image`,e.AUDIO=`audio`,e.VIDEO=`video`,e.OTHER=`other`,e}({});const Mo=O({type:T().trim().min(1)}).catchall(Co),No=O({version:qa(1),blocks:D(Mo)}),Po=O({type:qa(`opening-options`),data:O({text:T().trim().max(500),instruction:T().trim().max(2e3).optional(),file:O({types:D(Ga(jo)).min(1).max(5),otherExtensions:D(T().trim().min(1).max(24)).max(50).optional()}).optional()})}),Fo=O({hints:No.optional(),options:D(Po).max(20).optional()}),Io=O({version:qa(`1.0.0`),name:T().trim().max(128),description:T().trim().max(500),icon:Ga(ko),background:Ga(Ao),nodes:D(O({id:T().trim().min(1),position:O({x:Sa().finite(),y:Sa().finite()}),data:O({type:qa(`task`),icon:Ga(ko),background:Ga(Ao),title:T().trim().min(1).max(30),instructions:T().max(1e5),conversation_opener:Fo.optional()})})),edges:D(O({id:T().trim().min(1),source:T().trim().min(1),target:T().trim().min(1)}))}).superRefine((e,t)=>{let n=new Set;for(let r of e.nodes)n.has(r.id)&&t.addIssue({code:bo.custom,message:`Duplicate node id`,path:[`nodes`]}),n.add(r.id);let r=new Set,i=new Map,a=new Map;for(let o of e.edges){r.has(o.id)&&t.addIssue({code:bo.custom,message:`Duplicate edge id`,path:[`edges`]}),r.add(o.id),o.source===o.target&&t.addIssue({code:bo.custom,message:`Edge cannot connect a node to itself`,path:[`edges`]}),(!n.has(o.source)||!n.has(o.target))&&t.addIssue({code:bo.custom,message:`Edge endpoint is missing`,path:[`edges`]});let e=(i.get(o.target)??0)+1;e>1&&t.addIssue({code:bo.custom,message:`A node cannot have multiple upstream nodes`,path:[`edges`]}),i.set(o.target,e),a.set(o.source,[...a.get(o.source)??[],o.target])}let o=new Set,s=new Set,c=e=>{if(!s.has(e)){if(o.has(e)){t.addIssue({code:bo.custom,message:`Graph cannot contain cycles`,path:[`edges`]});return}o.add(e);for(let t of a.get(e)??[])c(t);o.delete(e),s.add(e)}};for(let e of n)c(e)});O({id:T().trim().min(1),graph:Io});const Lo={USER_PIPELINE_SETTING_GET:`user.pipeline.setting.get`,USER_PIPELINE_SETTING_UPDATE:`user.pipeline.setting.update`},Ro={displayName:`Syncless`,slug:`syncless`,domain:`syncless.ai`,apiBaseHost:`api.syncless.ai`},zo={web:`${Ro.displayName} Web`,desktop:`${Ro.displayName} Desktop`,mobile:`${Ro.displayName} Mobile`,browserExtension:`${Ro.displayName} Browser`},Bo={command:`syncless`,envPrefix:`SYNCLESS`},Vo={scope:`@langgenius`,launcherPackageName:`@langgenius/syncless`,platformPackagePrefix:`@langgenius/syncless-`},Ho=Ro.displayName;Ro.slug,zo.web,Bo.command,Vo.launcherPackageName;const Uo={USER_FACING:`user_facing`},Wo={HEARTBEAT_SEND_FAILED:`HEARTBEAT_SEND_FAILED`,HEARTBEAT_RESPONSE_TIMEOUT:`HEARTBEAT_RESPONSE_TIMEOUT`,REQUEST_SEND_FAILED:`RPC request failed to send`,TRANSPORT_CLOSED:`NETWORK_TRANSPORT_CLOSED`,TRANSPORT_SEND_FAILED:`NETWORK_TRANSPORT_SEND_FAILED`},Go={SEND_FAILED:`send_failed`},k={RPC_ERROR_CLASS:`rpc_error_class`,RPC_RESULT:`rpc_result`,TRANSPORT_PHASE:`transport_phase`},Ko={HEARTBEAT_TIMEOUT:`heartbeat_timeout`},qo={finish:()=>{}},Jo=()=>({setContext:()=>{},setFingerprint:()=>{},setLevel:()=>{},setTag:()=>{},setUser:()=>{}}),Yo=()=>({addBreadcrumb:e=>{},captureException:e=>{},destroy:async()=>{},enabled:!1,flush:async()=>!0,flushReplay:async()=>!1,init:async()=>{},startInactiveSpan:e=>qo,withScope:e=>e(Jo())}),Xo=e=>{if(!e)return;let t={};for(let[n,r]of Object.entries(e))r!=null&&(t[n]=r);return t},Zo=e=>typeof e==`string`?e:String(e),Qo=e=>{let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t},$o=e=>{let t={clientApp:e.clientApp,environment:e.environment,runtime:e.runtime,...e.appVersion?{appVersion:e.appVersion}:{},...e.release?{release:e.release}:{}},n={client_app:e.clientApp,environment:e.environment,runtime:e.runtime,...e.release?{release:e.release}:{}};return{contexts:{client:t},tags:n,user:{id:null}}},es=(e,t,n)=>{let r=Qo(n);if(Object.keys(r).length===0){delete e.contexts[t];return}e.contexts[t]=r},ts=(e,t)=>{delete e.contexts[t]},ns=(e,t,n)=>{if(n==null||n===``){delete e.tags[t];return}e.tags[t]=Zo(n)},rs=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,is=/^[a-f0-9]{16,}$/i,as=/^\d{4,}$/,os=new Set([`access_token`,`code`,`jwt`,`refresh_token`,`session`,`signature`,`state`,`token`]),ss=new Set([`authorization`,`cookie`,`set-auth-token`,`set-cookie`,`x-api-key`,`x-auth-token`,`x-csrf-token`]),cs=e=>e&&(rs.test(e)?`:uuid`:as.test(e)?`:id`:is.test(e)?`:hash`:e),ls=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`forEach`in e&&typeof e.forEach==`function`,us=e=>{if(!e)return[];if(ls(e)){let t=[];return e.forEach((e,n)=>{t.push([n,e])}),t}return Array.isArray(e)?e.map(([e,t])=>[e,t]):Object.entries(e).flatMap(([e,t])=>Array.isArray(t)?t.map(t=>[e,String(t)]):t==null?[]:[[e,String(t)]])},ds=e=>{let t={};for(let[n,r]of us(e)){let e=n.toLowerCase();ss.has(e)||(t[e]=r)}return t},fs=e=>{try{let t=new URL(e);t.username=``,t.password=``,t.hash=``,t.pathname=t.pathname.split(`/`).map(cs).join(`/`);let n=new URLSearchParams;return t.searchParams.forEach((e,t)=>{os.has(t.toLowerCase())||n.append(t,e)}),t.search=n.toString(),t.toString()}catch{let[t]=e.split(`?`);return t??e}},ps=(e,t=512)=>e.length<=t?e:`${e.slice(0,t)}…`,ms=e=>e<=0?!1:e>=1?!0:Math.random()<e,hs=`cancelled`,gs=e=>e.errorClass===Uo.USER_FACING?`warning`:`error`,_s=e=>!(e.status===`ok`||e.status===hs||e.status===Go.SEND_FAILED),vs=e=>{switch(e){case`ok`:return`ok`;case hs:return`cancelled`;case`timeout`:return`deadline_exceeded`;case Go.SEND_FAILED:return`internal_error`;default:return`internal_error`}},ys=e=>e instanceof Error?e:Error(ps(typeof e==`string`?e:`Unknown frontend stability error`)),bs=e=>e??`info`,xs=(e,t)=>{let n=e.flushTimeoutMs??1500,r=$o(e),i=(e,n)=>t.withScope(t=>{for(let[e,n]of Object.entries(r.tags))t.setTag(e,n);for(let[e,n]of Object.entries(r.contexts))t.setContext(e,n);if(r.user.id&&t.setUser({id:r.user.id}),!e)return n();for(let[n,r]of Object.entries(e.tags??{}))r&&t.setTag(n,r);for(let[n,r]of Object.entries(e.contexts??{}))t.setContext(n,r);return e.level&&t.setLevel(e.level),e.fingerprint&&e.fingerprint.length>0&&t.setFingerprint(e.fingerprint),n()}),a=n=>{let r=Xo({client_app:e.clientApp,environment:e.environment,runtime:e.runtime,...e.release?{release:e.release}:{},...n.attributes??{}});return t.startInactiveSpan({name:n.name,op:n.op,attributes:r})},o=e=>{if(!t.enabled)return;let{sampleRate:n,...r}=e;r.level!==`error`&&r.level!==`fatal`&&!ms(n??.2)||t.addBreadcrumb({...r,level:bs(r.level)})};return{addBreadcrumb:e=>{o(e)},captureException:(e,n)=>{t.enabled&&i(n,()=>{t.captureException(ys(e))})},clearScopeContext:e=>{ts(r,e)},clearUser:()=>{r.user={id:null}},createHttpPort:()=>({onRequestStart:({kind:e,method:n,timeoutMs:r,url:o})=>{let s=a({name:`${n} ${e}`,op:`http.client`,attributes:{http_kind:e,http_method:n,http_url:o,...r===void 0?{}:{http_timeout_ms:r}}});return{finish:({error:a,status:c,statusCode:l})=>{s.finish({attributes:{http_result:c,...l===void 0?{}:{http_status_code:l}},status:vs(c)}),c===`error`&&a&&i({contexts:{http:{method:n,statusCode:l,timeoutMs:r,url:o}},level:`error`,tags:{http_kind:e,http_method:n,http_result:c}},()=>{t.captureException(ys(a))})}}}}),createNetworkPort:()=>({onHeartbeatTimeout:({error:e,intervalMs:t})=>{o({category:`ws.heartbeat`,data:{intervalMs:t,[k.TRANSPORT_PHASE]:Ko.HEARTBEAT_TIMEOUT},level:`warning`,message:e instanceof Error?e.message:`Heartbeat timed out`,sampleRate:1})},onRpcStart:({channel:e,timeoutMs:n})=>{let r=a({name:e,op:`rpc.client`,attributes:{rpc_channel:e,rpc_timeout_ms:n}});return{finish:a=>{if(r.finish({attributes:{[k.RPC_RESULT]:a.status,...a.code?{rpc_code:a.code}:{},...a.domain?{rpc_domain:a.domain}:{},...a.errorClass?{[k.RPC_ERROR_CLASS]:a.errorClass}:{}},status:vs(a.status)}),a.status!==`ok`){if(!_s(a)){o({category:`rpc.lifecycle`,data:{channel:e,...a.errorClass?{errorClass:a.errorClass}:{},[k.RPC_RESULT]:a.status,timeoutMs:n},level:`warning`,message:`RPC ${a.status}`,sampleRate:1});return}i({contexts:{rpc:{channel:e,code:a.code,domain:a.domain,errorClass:a.errorClass,timeoutMs:n}},level:gs(a),tags:{rpc_channel:e,[k.RPC_RESULT]:a.status,...a.code?{rpc_code:a.code}:{},...a.domain?{rpc_domain:a.domain}:{},...a.errorClass?{[k.RPC_ERROR_CLASS]:a.errorClass}:{}}},()=>{t.captureException(ys(a.error))})}}}},onTransportError:({error:e,phase:n})=>{i({contexts:{transport:{phase:n}},level:`error`,tags:{[k.TRANSPORT_PHASE]:n}},()=>{t.captureException(ys(e))})},onWsConnectStart:({kind:e})=>{let n=a({name:`ws.${e}`,op:`ws.connect`,attributes:{ws_kind:e}});return{finish:({error:r,status:a})=>{n.finish({attributes:{ws_kind:e,ws_result:a},status:vs(a)}),a===`error`&&i({contexts:{transport:{kind:e}},level:`error`,tags:{ws_kind:e,ws_result:a}},()=>{t.captureException(ys(r))})}}},onWsEvent:({channel:e})=>{ms(.2)&&t.addBreadcrumb({category:`ws.event`,data:{channel:e},level:`info`,message:`Received ${e}`})},onWsStatusChange:({status:e})=>{t.enabled&&t.addBreadcrumb({category:`ws.status`,data:{status:e},level:e===`error`?`error`:`info`,message:`Transport ${e}`})}}),flush:async e=>t.enabled?await t.flush(e??n):!1,flushReplay:async e=>!t.enabled||!t.flushReplay?!1:await t.flushReplay(e),setScopeContext:(e,t)=>{es(r,e,t)},setTag:(e,t)=>{ns(r,e,t)},setUser:e=>{r.user=e},startSpan:a}};function Ss(e,t){if(typeof e!=`string`)throw TypeError(`Expected string, received ${e===null?`null`:typeof e}`);return t(e)}function Cs(e){return Ss(e,e=>e.trim().toLowerCase())}function ws(e){return Ss(e,e=>e.trim().toUpperCase())}const Ts=e=>e.length===0?[Yo()]:e,Es=e=>{let t=Ts(e);return t.find(e=>e.enabled)??t[0]??Yo()},Ds=e=>{let t=Ts(e),n=Es(t),r=t.filter(e=>e.enabled);return{addBreadcrumb:e=>{for(let n of t)try{n.addBreadcrumb(e)}catch{}},captureException:e=>{for(let n of t)try{n.captureException(e)}catch{}},destroy:async()=>{for(let e of t)if(e.destroy)try{await e.destroy()}catch{}},enabled:t.some(e=>e.enabled),flush:async e=>(await Promise.allSettled((r.length>0?r:t).map(async t=>{try{return await t.flush(e)}catch{return!1}}))).every(e=>e.status===`fulfilled`&&e.value===!0),flushReplay:async e=>{if(!n.flushReplay)return!1;try{return await n.flushReplay(e)}catch{return!1}},init:async()=>{for(let e of t)if(e.init)try{await e.init()}catch{}},startInactiveSpan:e=>{try{return n.startInactiveSpan(e)}catch{return Yo().startInactiveSpan(e)}},withScope:e=>{let t=e;try{return n.withScope(t)}catch{return Yo().withScope(t)}}}};let Os=function(e){return e.NOOP=`noop`,e.POSTHOG_BROWSER=`posthog-browser`,e.POSTHOG_REACT_NATIVE=`posthog-react-native`,e.SENTRY=`sentry`,e}({});const ks=new Set(Object.values(Os)),As=(e,t=[`sentry`])=>{let n=e?.trim();if(!n)return{invalidNames:[],names:[...t]};let r=n.split(`,`),i=[],a=[];for(let e of r){let t=Cs(e);if(!t)continue;if(!ks.has(t)){i.push(t);continue}let n=t;a.includes(n)||a.push(n)}return a.length>0?{invalidNames:i,names:a}:{invalidNames:i,names:[]}},js=e=>{let t={};for(let[n,r]of Object.entries(e))r==null||r===``||(t[n]=r);return t},Ms=e=>Object.keys(e).length>0,Ns=(e,t)=>{t.userId?e.setUser({id:t.userId}):e.clearUser(),e.setTag(`workspace_id`,t.workspaceId??null),e.setTag(`pipeline_id`,t.pipelineId??null),e.setTag(`task_id`,t.taskId??null),e.setTag(`environment_id`,t.environmentId??null),e.setTag(`route_view`,t.routeView??null),e.setTag(`command_name`,t.commandName??null),e.setTag(`auth_phase`,t.authPhase??null);let n=js({deviceCode:t.deviceCode,environmentId:t.environmentId,memberId:t.memberId,pipelineId:t.pipelineId,taskId:t.taskId,workspaceId:t.workspaceId});Ms(n)?e.setScopeContext(`echo`,n):e.clearScopeContext(`echo`);let r=js({authPhase:t.authPhase,commandName:t.commandName,cwd:t.cwd,interactive:t.interactive,routeTemplate:t.routeTemplate,routeView:t.routeView,screen:t.screen});Ms(r)?e.setScopeContext(`surface`,r):e.clearScopeContext(`surface`),e.addBreadcrumb({category:`echo.client_context`,data:{auth_phase:t.authPhase,command_name:t.commandName,environment_id:t.environmentId,has_device:!!t.deviceCode,interactive:t.interactive,pipeline_id:t.pipelineId,route_template:t.routeTemplate,route_view:t.routeView,task_id:t.taskId,workspace_id:t.workspaceId},level:`info`,message:`Client context changed`,sampleRate:1})},Ps={finish:()=>{}},Fs={finish:()=>{}},Is={finish:()=>{}},Ls=()=>({onHeartbeatTimeout:()=>{},onRpcStart:()=>Ps,onTransportError:()=>{},onWsConnectStart:()=>Fs,onWsEvent:()=>{},onWsStatusChange:()=>{}}),Rs=()=>({onRequestStart:()=>Is}),zs=/^[^@]+@([^+]+)(?:\+.+)?$/,Bs=e=>{if(!e)return;let t=zs.exec(e.trim())?.[1]?.trim();if(t)return t},Vs=/\/+$/,A=e=>e.replace(Vs,``),Hs=e=>e instanceof Request?e.url:e instanceof URL?e.toString():e,Us=(e,t)=>t?.method?t.method:e instanceof Request?e.method:`GET`,Ws=(e={})=>{let t=e.fetchImpl??fetch,n=e.observability??Rs(),r=e.kind??`http`;return async(e,i)=>{let a=fs(Hs(e)),o=Us(e,i).toUpperCase(),s=n.onRequestStart({kind:r,method:o,url:a});try{let n=await t(e,i);return s.finish({status:`ok`,statusCode:n.status}),n}catch(e){throw s.finish({status:`error`,error:e}),e}}};Object.freeze({status:`aborted`});function j(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var Gs=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ks=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};const qs={};function M(e){return e&&Object.assign(qs,e),qs}function Js(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Ys(e,t){return typeof t==`bigint`?t.toString():t}function Xs(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Zs(e){return e==null}function Qs(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function $s(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}const ec=Symbol(`evaluating`);function N(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ec)return r===void 0&&(r=ec,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function tc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function P(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function nc(e){return JSON.stringify(e)}function rc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const ic=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ac(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const oc=Xs(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function sc(e){if(ac(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(ac(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function cc(e){return sc(e)?{...e}:Array.isArray(e)?[...e]:e}const lc=new Set([`string`,`number`,`symbol`]);function uc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function F(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function I(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function dc(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const fc={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function pc(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return F(e,P(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return tc(this,`shape`,e),e},checks:[]}))}function mc(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return F(e,P(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return tc(this,`shape`,r),r},checks:[]}))}function hc(e,t){if(!sc(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return F(e,P(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return tc(this,`shape`,n),n}}))}function gc(e,t){if(!sc(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return F(e,P(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return tc(this,`shape`,n),n}}))}function _c(e,t){return F(e,P(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return tc(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function vc(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return F(t,P(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return tc(this,`shape`,i),i},checks:[]}))}function yc(e,t,n){return F(t,P(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return tc(this,`shape`,i),i}}))}function bc(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function xc(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Sc(e){return typeof e==`string`?e:e?.message}function L(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Sc(e.inst?._zod.def?.error?.(e))??Sc(t?.error?.(e))??Sc(n.customError?.(e))??Sc(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Cc(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function wc(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const Tc=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ys,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Ec=j(`$ZodError`,Tc),Dc=j(`$ZodError`,Tc,{Parent:Error});function Oc(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function kc(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}const Ac=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Gs;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>L(e,a,M())));throw ic(t,i?.callee),t}return o.value},jc=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>L(e,a,M())));throw ic(t,i?.callee),t}return o.value},Mc=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Gs;return a.issues.length?{success:!1,error:new(e??Ec)(a.issues.map(e=>L(e,i,M())))}:{success:!0,data:a.value}},Nc=Mc(Dc),Pc=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>L(e,i,M())))}:{success:!0,data:a.value}},Fc=Pc(Dc),Ic=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ac(e)(t,n,i)},Lc=e=>(t,n,r)=>Ac(e)(t,n,r),Rc=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return jc(e)(t,n,i)},zc=e=>async(t,n,r)=>jc(e)(t,n,r),Bc=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Mc(e)(t,n,i)},Vc=e=>(t,n,r)=>Mc(e)(t,n,r),Hc=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Pc(e)(t,n,i)},Uc=e=>async(t,n,r)=>Pc(e)(t,n,r),Wc=/^[cC][^\s-]{8,}$/,Gc=/^[0-9a-z]+$/,Kc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qc=/^[0-9a-vA-V]{20}$/,Jc=/^[A-Za-z0-9]{27}$/,Yc=/^[a-zA-Z0-9_-]{21}$/,Xc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Zc=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Qc=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,$c=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function el(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const tl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,rl=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,il=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,al=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ol=/^[A-Za-z0-9_-]*$/,sl=/^\+[1-9]\d{6,14}$/,cl=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,ll=RegExp(`^${cl}$`);function ul(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function dl(e){return RegExp(`^${ul(e)}$`)}function fl(e){let t=ul({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${cl}T(?:${r})$`)}const pl=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},ml=/^-?\d+$/,hl=/^-?\d+(?:\.\d+)?$/,gl=/^(?:true|false)$/i,_l=/^null$/i,vl=/^[^A-Z]*$/,yl=/^[^a-z]*$/,R=j(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),bl={number:`number`,bigint:`bigint`,object:`date`},xl=j(`$ZodCheckLessThan`,(e,t)=>{R.init(e,t);let n=bl[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Sl=j(`$ZodCheckGreaterThan`,(e,t)=>{R.init(e,t);let n=bl[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Cl=j(`$ZodCheckMultipleOf`,(e,t)=>{R.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):$s(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),wl=j(`$ZodCheckNumberFormat`,(e,t)=>{R.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=fc[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=ml)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Tl=j(`$ZodCheckMaxLength`,(e,t)=>{var n;R.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Zs(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Cc(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),El=j(`$ZodCheckMinLength`,(e,t)=>{var n;R.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Zs(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Cc(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Dl=j(`$ZodCheckLengthEquals`,(e,t)=>{var n;R.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Zs(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Cc(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ol=j(`$ZodCheckStringFormat`,(e,t)=>{var n,r;R.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),kl=j(`$ZodCheckRegex`,(e,t)=>{Ol.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Al=j(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=vl,Ol.init(e,t)}),jl=j(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=yl,Ol.init(e,t)}),Ml=j(`$ZodCheckIncludes`,(e,t)=>{R.init(e,t);let n=uc(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Nl=j(`$ZodCheckStartsWith`,(e,t)=>{R.init(e,t);let n=RegExp(`^${uc(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Pl=j(`$ZodCheckEndsWith`,(e,t)=>{R.init(e,t);let n=RegExp(`.*${uc(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Fl=j(`$ZodCheckOverwrite`,(e,t)=>{R.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Il=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
42
+ `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
43
+ `))}};const Ll={major:4,minor:3,patch:6},z=j(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ll;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=bc(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Gs;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=bc(e,t))});else{if(e.issues.length===t)continue;r||=bc(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(bc(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Gs;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Gs;return o.then(e=>t(e,r,a))}return t(o,r,a)}}N(e,`~standard`,()=>({validate:t=>{try{let n=Nc(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Fc(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Rl=j(`$ZodString`,(e,t)=>{z.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??pl(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),B=j(`$ZodStringFormat`,(e,t)=>{Ol.init(e,t),Rl.init(e,t)}),zl=j(`$ZodGUID`,(e,t)=>{t.pattern??=Zc,B.init(e,t)}),Bl=j(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Qc(e)}else t.pattern??=Qc();B.init(e,t)}),Vl=j(`$ZodEmail`,(e,t)=>{t.pattern??=$c,B.init(e,t)}),Hl=j(`$ZodURL`,(e,t)=>{B.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ul=j(`$ZodEmoji`,(e,t)=>{t.pattern??=el(),B.init(e,t)}),Wl=j(`$ZodNanoID`,(e,t)=>{t.pattern??=Yc,B.init(e,t)}),Gl=j(`$ZodCUID`,(e,t)=>{t.pattern??=Wc,B.init(e,t)}),Kl=j(`$ZodCUID2`,(e,t)=>{t.pattern??=Gc,B.init(e,t)}),ql=j(`$ZodULID`,(e,t)=>{t.pattern??=Kc,B.init(e,t)}),Jl=j(`$ZodXID`,(e,t)=>{t.pattern??=qc,B.init(e,t)}),Yl=j(`$ZodKSUID`,(e,t)=>{t.pattern??=Jc,B.init(e,t)}),Xl=j(`$ZodISODateTime`,(e,t)=>{t.pattern??=fl(t),B.init(e,t)}),Zl=j(`$ZodISODate`,(e,t)=>{t.pattern??=ll,B.init(e,t)}),Ql=j(`$ZodISOTime`,(e,t)=>{t.pattern??=dl(t),B.init(e,t)}),$l=j(`$ZodISODuration`,(e,t)=>{t.pattern??=Xc,B.init(e,t)}),eu=j(`$ZodIPv4`,(e,t)=>{t.pattern??=tl,B.init(e,t),e._zod.bag.format=`ipv4`}),tu=j(`$ZodIPv6`,(e,t)=>{t.pattern??=nl,B.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),nu=j(`$ZodCIDRv4`,(e,t)=>{t.pattern??=rl,B.init(e,t)}),ru=j(`$ZodCIDRv6`,(e,t)=>{t.pattern??=il,B.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function iu(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const au=j(`$ZodBase64`,(e,t)=>{t.pattern??=al,B.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{iu(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function ou(e){if(!ol.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return iu(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const su=j(`$ZodBase64URL`,(e,t)=>{t.pattern??=ol,B.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{ou(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),cu=j(`$ZodE164`,(e,t)=>{t.pattern??=sl,B.init(e,t)});function lu(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const uu=j(`$ZodJWT`,(e,t)=>{B.init(e,t),e._zod.check=n=>{lu(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),du=j(`$ZodNumber`,(e,t)=>{z.init(e,t),e._zod.pattern=e._zod.bag.pattern??hl,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),fu=j(`$ZodNumberFormat`,(e,t)=>{wl.init(e,t),du.init(e,t)}),pu=j(`$ZodBoolean`,(e,t)=>{z.init(e,t),e._zod.pattern=gl,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),mu=j(`$ZodNull`,(e,t)=>{z.init(e,t),e._zod.pattern=_l,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),hu=j(`$ZodUnknown`,(e,t)=>{z.init(e,t),e._zod.parse=e=>e}),gu=j(`$ZodNever`,(e,t)=>{z.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function _u(e,t,n){e.issues.length&&t.issues.push(...xc(n,e.issues)),t.value[n]=e.value}const vu=j(`$ZodArray`,(e,t)=>{z.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>_u(t,n,e))):_u(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function yu(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...xc(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function bu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=dc(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function xu(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>yu(e,n,i,t,u))):yu(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const Su=j(`$ZodObject`,(e,t)=>{if(z.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=Xs(()=>bu(t));N(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=ac,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>yu(n,t,e,s,r))):yu(i,t,e,s,r)}return i?xu(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Cu=j(`$ZodObjectJIT`,(e,t)=>{Su.init(e,t);let n=e._zod.parse,r=Xs(()=>bu(t)),i=e=>{let t=new Il([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=nc(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=nc(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
44
+ if (${n}.issues.length) {
45
+ if (${o} in input) {
46
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
47
+ ...iss,
48
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
49
+ })));
50
+ }
51
+ }
52
+
53
+ if (${n}.value === undefined) {
54
+ if (${o} in input) {
55
+ newResult[${o}] = undefined;
56
+ }
57
+ } else {
58
+ newResult[${o}] = ${n}.value;
59
+ }
60
+
61
+ `):t.write(`
62
+ if (${n}.issues.length) {
63
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
64
+ ...iss,
65
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
66
+ })));
67
+ }
68
+
69
+ if (${n}.value === undefined) {
70
+ if (${o} in input) {
71
+ newResult[${o}] = undefined;
72
+ }
73
+ } else {
74
+ newResult[${o}] = ${n}.value;
75
+ }
76
+
77
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=ac,s=!qs.jitless,c=s&&oc.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?xu([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function wu(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=>!bc(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=>L(e,r,M())))}),t)}const Tu=j(`$ZodUnion`,(e,t)=>{z.init(e,t),N(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),N(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),N(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),N(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=>Qs(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>wu(t,i,e,a)):wu(s,i,e,a)}}),Eu=j(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Tu.init(e,t);let n=e._zod.parse;N(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=Xs(()=>{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(!ac(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?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),Du=j(`$ZodIntersection`,(e,t)=>{z.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])=>ku(e,t,n)):ku(e,i,a)}});function Ou(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(sc(e)&&sc(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=Ou(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=Ou(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 ku(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}),bc(e))return e;let o=Ou(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const Au=j(`$ZodRecord`,(e,t)=>{z.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!sc(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...xc(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...xc(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&hl.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>L(e,r,M())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...xc(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...xc(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),ju=j(`$ZodEnum`,(e,t)=>{z.init(e,t);let n=Js(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>lc.has(typeof e)).map(e=>typeof e==`string`?uc(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}}),Mu=j(`$ZodLiteral`,(e,t)=>{if(z.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`?uc(e):e?uc(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}}),Nu=j(`$ZodTransform`,(e,t)=>{z.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ks(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Gs;return n.value=i,n}});function Pu(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Fu=j(`$ZodOptional`,(e,t)=>{z.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,N(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),N(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Qs(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Pu(t,e.value)):Pu(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Iu=j(`$ZodExactOptional`,(e,t)=>{Fu.init(e,t),N(e._zod,`values`,()=>t.innerType._zod.values),N(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Lu=j(`$ZodNullable`,(e,t)=>{z.init(e,t),N(e._zod,`optin`,()=>t.innerType._zod.optin),N(e._zod,`optout`,()=>t.innerType._zod.optout),N(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Qs(e.source)}|null)$`):void 0}),N(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)}),Ru=j(`$ZodDefault`,(e,t)=>{z.init(e,t),e._zod.optin=`optional`,N(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=>zu(e,t)):zu(r,t)}});function zu(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Bu=j(`$ZodPrefault`,(e,t)=>{z.init(e,t),e._zod.optin=`optional`,N(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))}),Vu=j(`$ZodNonOptional`,(e,t)=>{z.init(e,t),N(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=>Hu(t,e)):Hu(i,e)}});function Hu(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Uu=j(`$ZodCatch`,(e,t)=>{z.init(e,t),N(e._zod,`optin`,()=>t.innerType._zod.optin),N(e._zod,`optout`,()=>t.innerType._zod.optout),N(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=>L(e,n,M()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>L(e,n,M()))},input:e.value}),e.issues=[]),e)}}),Wu=j(`$ZodPipe`,(e,t)=>{z.init(e,t),N(e._zod,`values`,()=>t.in._zod.values),N(e._zod,`optin`,()=>t.in._zod.optin),N(e._zod,`optout`,()=>t.out._zod.optout),N(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=>Gu(e,t.in,n)):Gu(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Gu(e,t.out,n)):Gu(r,t.out,n)}});function Gu(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Ku=j(`$ZodReadonly`,(e,t)=>{z.init(e,t),N(e._zod,`propValues`,()=>t.innerType._zod.propValues),N(e._zod,`values`,()=>t.innerType._zod.values),N(e._zod,`optin`,()=>t.innerType?._zod?.optin),N(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(qu):qu(r)}});function qu(e){return e.value=Object.freeze(e.value),e}const Ju=j(`$ZodLazy`,(e,t)=>{z.init(e,t),N(e._zod,`innerType`,()=>t.getter()),N(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),N(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),N(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),N(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Yu=j(`$ZodCustom`,(e,t)=>{R.init(e,t),z.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=>Xu(t,n,r,e));Xu(i,n,r,e)}});function Xu(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(wc(e))}}var Zu,Qu=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 $u(){return new Qu}(Zu=globalThis).__zod_globalRegistry??(Zu.__zod_globalRegistry=$u());const ed=globalThis.__zod_globalRegistry;function td(e,t){return new e({type:`string`,...I(t)})}function nd(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...I(t)})}function rd(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...I(t)})}function id(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...I(t)})}function ad(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...I(t)})}function od(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...I(t)})}function sd(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...I(t)})}function cd(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...I(t)})}function ld(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...I(t)})}function ud(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...I(t)})}function dd(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...I(t)})}function fd(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...I(t)})}function pd(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...I(t)})}function md(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...I(t)})}function hd(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...I(t)})}function gd(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...I(t)})}function _d(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...I(t)})}function vd(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...I(t)})}function yd(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...I(t)})}function bd(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...I(t)})}function xd(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...I(t)})}function Sd(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...I(t)})}function Cd(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...I(t)})}function wd(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...I(t)})}function Td(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...I(t)})}function Ed(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...I(t)})}function Dd(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...I(t)})}function Od(e,t){return new e({type:`number`,checks:[],...I(t)})}function kd(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...I(t)})}function Ad(e,t){return new e({type:`boolean`,...I(t)})}function jd(e,t){return new e({type:`null`,...I(t)})}function Md(e){return new e({type:`unknown`})}function Nd(e,t){return new e({type:`never`,...I(t)})}function Pd(e,t){return new xl({check:`less_than`,...I(t),value:e,inclusive:!1})}function Fd(e,t){return new xl({check:`less_than`,...I(t),value:e,inclusive:!0})}function Id(e,t){return new Sl({check:`greater_than`,...I(t),value:e,inclusive:!1})}function Ld(e,t){return new Sl({check:`greater_than`,...I(t),value:e,inclusive:!0})}function Rd(e,t){return new Cl({check:`multiple_of`,...I(t),value:e})}function zd(e,t){return new Tl({check:`max_length`,...I(t),maximum:e})}function Bd(e,t){return new El({check:`min_length`,...I(t),minimum:e})}function Vd(e,t){return new Dl({check:`length_equals`,...I(t),length:e})}function Hd(e,t){return new kl({check:`string_format`,format:`regex`,...I(t),pattern:e})}function Ud(e){return new Al({check:`string_format`,format:`lowercase`,...I(e)})}function Wd(e){return new jl({check:`string_format`,format:`uppercase`,...I(e)})}function Gd(e,t){return new Ml({check:`string_format`,format:`includes`,...I(t),includes:e})}function Kd(e,t){return new Nl({check:`string_format`,format:`starts_with`,...I(t),prefix:e})}function qd(e,t){return new Pl({check:`string_format`,format:`ends_with`,...I(t),suffix:e})}function Jd(e){return new Fl({check:`overwrite`,tx:e})}function Yd(e){return Jd(t=>t.normalize(e))}function Xd(){return Jd(e=>e.trim())}function Zd(){return Jd(e=>e.toLowerCase())}function Qd(){return Jd(e=>e.toUpperCase())}function $d(){return Jd(e=>rc(e))}function ef(e,t,n){return new e({type:`array`,element:t,...I(n)})}function tf(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...I(n)})}function nf(e){let t=rf(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(wc(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(wc(r))}},e(n.value,n)));return t}function rf(e,t){let n=new R({check:`custom`,...I(t)});return n._zod.check=e,n}function af(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??ed,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 V(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,V(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`&&H(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function of(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>
78
+
79
+ 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 sf(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.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:lf(t,`input`,e.processors),output:lf(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function H(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 H(r.element,n);if(r.type===`set`)return H(r.valueType,n);if(r.type===`lazy`)return H(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 H(r.innerType,n);if(r.type===`intersection`)return H(r.left,n)||H(r.right,n);if(r.type===`record`||r.type===`map`)return H(r.keyType,n)||H(r.valueType,n);if(r.type===`pipe`)return H(r.in,n)||H(r.out,n);if(r.type===`object`){for(let e in r.shape)if(H(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(H(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(H(e,n))return!0;return!!(r.rest&&H(r.rest,n))}return!1}const cf=(e,t={})=>n=>{let r=af({...n,processors:t});return V(e,r),of(r,e),sf(r,e)},lf=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=af({...i??{},target:a,io:t,processors:n});return V(e,o),of(o,e),sf(o,e)},uf={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},df=(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=uf[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}))])}},ff=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},pf=(e,t,n,r)=>{n.type=`boolean`},mf=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},hf=(e,t,n,r)=>{n.not={}},gf=(e,t,n,r)=>{let i=e._zod.def,a=Js(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},_f=(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},vf=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},yf=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},bf=(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=V(a.element,t,{...r,path:[...r.path,`items`]})},xf=(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]=V(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=V(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Sf=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>V(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Cf=(e,t,n,r)=>{let i=e._zod.def,a=V(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=V(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]]},wf=(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=V(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=V(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=V(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)}},Tf=(e,t,n,r)=>{let i=e._zod.def,a=V(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`}]},Ef=(e,t,n,r)=>{let i=e._zod.def;V(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Df=(e,t,n,r)=>{let i=e._zod.def;V(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Of=(e,t,n,r)=>{let i=e._zod.def;V(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)))},kf=(e,t,n,r)=>{let i=e._zod.def;V(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},Af=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;V(a,t,r);let o=t.seen.get(e);o.ref=a},jf=(e,t,n,r)=>{let i=e._zod.def;V(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Mf=(e,t,n,r)=>{let i=e._zod.def;V(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Nf=(e,t,n,r)=>{let i=e._zod.innerType;V(i,t,r);let a=t.seen.get(e);a.ref=i},Pf=j(`ZodISODateTime`,(e,t)=>{Xl.init(e,t),K.init(e,t)});function Ff(e){return wd(Pf,e)}const If=j(`ZodISODate`,(e,t)=>{Zl.init(e,t),K.init(e,t)});function Lf(e){return Td(If,e)}const Rf=j(`ZodISOTime`,(e,t)=>{Ql.init(e,t),K.init(e,t)});function zf(e){return Ed(Rf,e)}const Bf=j(`ZodISODuration`,(e,t)=>{$l.init(e,t),K.init(e,t)});function Vf(e){return Dd(Bf,e)}const Hf=(e,t)=>{Ec.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>kc(e,t)},flatten:{value:t=>Oc(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ys,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ys,2)}},isEmpty:{get(){return e.issues.length===0}}})};j(`ZodError`,Hf);const U=j(`ZodError`,Hf,{Parent:Error}),Uf=Ac(U),Wf=jc(U),Gf=Mc(U),Kf=Pc(U),qf=Ic(U),Jf=Lc(U),Yf=Rc(U),Xf=zc(U),Zf=Bc(U),Qf=Vc(U),$f=Hc(U),ep=Uc(U),W=j(`ZodType`,(e,t)=>(z.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:lf(e,`input`),output:lf(e,`output`)}}),e.toJSONSchema=cf(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(P(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>F(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Uf(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Gf(e,t,n),e.parseAsync=async(t,n)=>Wf(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Kf(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>qf(e,t,n),e.decode=(t,n)=>Jf(e,t,n),e.encodeAsync=async(t,n)=>Yf(e,t,n),e.decodeAsync=async(t,n)=>Xf(e,t,n),e.safeEncode=(t,n)=>Zf(e,t,n),e.safeDecode=(t,n)=>Qf(e,t,n),e.safeEncodeAsync=async(t,n)=>$f(e,t,n),e.safeDecodeAsync=async(t,n)=>ep(e,t,n),e.refine=(t,n)=>e.check(ym(t,n)),e.superRefine=t=>e.check(bm(t)),e.overwrite=t=>e.check(Jd(t)),e.optional=()=>$p(e),e.exactOptional=()=>tm(e),e.nullable=()=>rm(e),e.nullish=()=>$p(rm(e)),e.nonoptional=t=>lm(e,t),e.array=()=>Ip(e),e.or=t=>zp([e,t]),e.and=t=>Up(e,t),e.transform=t=>pm(e,Zp(t)),e.default=t=>am(e,t),e.prefault=t=>sm(e,t),e.catch=t=>dm(e,t),e.pipe=t=>pm(e,t),e.readonly=()=>hm(e),e.describe=t=>{let n=e.clone();return ed.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return ed.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return ed.get(e);let n=e.clone();return ed.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),tp=j(`_ZodString`,(e,t)=>{Rl.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>df(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Hd(...t)),e.includes=(...t)=>e.check(Gd(...t)),e.startsWith=(...t)=>e.check(Kd(...t)),e.endsWith=(...t)=>e.check(qd(...t)),e.min=(...t)=>e.check(Bd(...t)),e.max=(...t)=>e.check(zd(...t)),e.length=(...t)=>e.check(Vd(...t)),e.nonempty=(...t)=>e.check(Bd(1,...t)),e.lowercase=t=>e.check(Ud(t)),e.uppercase=t=>e.check(Wd(t)),e.trim=()=>e.check(Xd()),e.normalize=(...t)=>e.check(Yd(...t)),e.toLowerCase=()=>e.check(Zd()),e.toUpperCase=()=>e.check(Qd()),e.slugify=()=>e.check($d())}),np=j(`ZodString`,(e,t)=>{Rl.init(e,t),tp.init(e,t),e.email=t=>e.check(nd(rp,t)),e.url=t=>e.check(cd(sp,t)),e.jwt=t=>e.check(Cd(Sp,t)),e.emoji=t=>e.check(ld(cp,t)),e.guid=t=>e.check(rd(ap,t)),e.uuid=t=>e.check(id(op,t)),e.uuidv4=t=>e.check(ad(op,t)),e.uuidv6=t=>e.check(od(op,t)),e.uuidv7=t=>e.check(sd(op,t)),e.nanoid=t=>e.check(ud(lp,t)),e.guid=t=>e.check(rd(ap,t)),e.cuid=t=>e.check(dd(up,t)),e.cuid2=t=>e.check(fd(dp,t)),e.ulid=t=>e.check(pd(fp,t)),e.base64=t=>e.check(bd(yp,t)),e.base64url=t=>e.check(xd(bp,t)),e.xid=t=>e.check(md(pp,t)),e.ksuid=t=>e.check(hd(mp,t)),e.ipv4=t=>e.check(gd(hp,t)),e.ipv6=t=>e.check(_d(gp,t)),e.cidrv4=t=>e.check(vd(_p,t)),e.cidrv6=t=>e.check(yd(vp,t)),e.e164=t=>e.check(Sd(xp,t)),e.datetime=t=>e.check(Ff(t)),e.date=t=>e.check(Lf(t)),e.time=t=>e.check(zf(t)),e.duration=t=>e.check(Vf(t))});function G(e){return td(np,e)}const K=j(`ZodStringFormat`,(e,t)=>{B.init(e,t),tp.init(e,t)}),rp=j(`ZodEmail`,(e,t)=>{Vl.init(e,t),K.init(e,t)});function ip(e){return nd(rp,e)}const ap=j(`ZodGUID`,(e,t)=>{zl.init(e,t),K.init(e,t)}),op=j(`ZodUUID`,(e,t)=>{Bl.init(e,t),K.init(e,t)}),sp=j(`ZodURL`,(e,t)=>{Hl.init(e,t),K.init(e,t)}),cp=j(`ZodEmoji`,(e,t)=>{Ul.init(e,t),K.init(e,t)}),lp=j(`ZodNanoID`,(e,t)=>{Wl.init(e,t),K.init(e,t)}),up=j(`ZodCUID`,(e,t)=>{Gl.init(e,t),K.init(e,t)}),dp=j(`ZodCUID2`,(e,t)=>{Kl.init(e,t),K.init(e,t)}),fp=j(`ZodULID`,(e,t)=>{ql.init(e,t),K.init(e,t)}),pp=j(`ZodXID`,(e,t)=>{Jl.init(e,t),K.init(e,t)}),mp=j(`ZodKSUID`,(e,t)=>{Yl.init(e,t),K.init(e,t)}),hp=j(`ZodIPv4`,(e,t)=>{eu.init(e,t),K.init(e,t)}),gp=j(`ZodIPv6`,(e,t)=>{tu.init(e,t),K.init(e,t)}),_p=j(`ZodCIDRv4`,(e,t)=>{nu.init(e,t),K.init(e,t)}),vp=j(`ZodCIDRv6`,(e,t)=>{ru.init(e,t),K.init(e,t)}),yp=j(`ZodBase64`,(e,t)=>{au.init(e,t),K.init(e,t)}),bp=j(`ZodBase64URL`,(e,t)=>{su.init(e,t),K.init(e,t)}),xp=j(`ZodE164`,(e,t)=>{cu.init(e,t),K.init(e,t)}),Sp=j(`ZodJWT`,(e,t)=>{uu.init(e,t),K.init(e,t)}),Cp=j(`ZodNumber`,(e,t)=>{du.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ff(e,t,n,r),e.gt=(t,n)=>e.check(Id(t,n)),e.gte=(t,n)=>e.check(Ld(t,n)),e.min=(t,n)=>e.check(Ld(t,n)),e.lt=(t,n)=>e.check(Pd(t,n)),e.lte=(t,n)=>e.check(Fd(t,n)),e.max=(t,n)=>e.check(Fd(t,n)),e.int=t=>e.check(Ep(t)),e.safe=t=>e.check(Ep(t)),e.positive=t=>e.check(Id(0,t)),e.nonnegative=t=>e.check(Ld(0,t)),e.negative=t=>e.check(Pd(0,t)),e.nonpositive=t=>e.check(Fd(0,t)),e.multipleOf=(t,n)=>e.check(Rd(t,n)),e.step=(t,n)=>e.check(Rd(t,n)),e.finite=()=>e;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 wp(e){return Od(Cp,e)}const Tp=j(`ZodNumberFormat`,(e,t)=>{fu.init(e,t),Cp.init(e,t)});function Ep(e){return kd(Tp,e)}const Dp=j(`ZodBoolean`,(e,t)=>{pu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pf(e,t,n,r)});function Op(e){return Ad(Dp,e)}const kp=j(`ZodNull`,(e,t)=>{mu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mf(e,t,n,r)});function Ap(e){return jd(kp,e)}const jp=j(`ZodUnknown`,(e,t)=>{hu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Mp(){return Md(jp)}const Np=j(`ZodNever`,(e,t)=>{gu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hf(e,t,n,r)});function Pp(e){return Nd(Np,e)}const Fp=j(`ZodArray`,(e,t)=>{vu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bf(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Bd(t,n)),e.nonempty=t=>e.check(Bd(1,t)),e.max=(t,n)=>e.check(zd(t,n)),e.length=(t,n)=>e.check(Vd(t,n)),e.unwrap=()=>e.element});function Ip(e,t){return ef(Fp,e,t)}const Lp=j(`ZodObject`,(e,t)=>{Cu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xf(e,t,n,r),N(e,`shape`,()=>t.shape),e.keyof=()=>qp(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Mp()}),e.loose=()=>e.clone({...e._zod.def,catchall:Mp()}),e.strict=()=>e.clone({...e._zod.def,catchall:Pp()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>hc(e,t),e.safeExtend=t=>gc(e,t),e.merge=t=>_c(e,t),e.pick=t=>pc(e,t),e.omit=t=>mc(e,t),e.partial=(...t)=>vc(Qp,e,t[0]),e.required=(...t)=>yc(cm,e,t[0])});function q(e,t){return new Lp({type:`object`,shape:e??{},...I(t)})}const Rp=j(`ZodUnion`,(e,t)=>{Tu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sf(e,t,n,r),e.options=t.options});function zp(e,t){return new Rp({type:`union`,options:e,...I(t)})}const Bp=j(`ZodDiscriminatedUnion`,(e,t)=>{Rp.init(e,t),Eu.init(e,t)});function Vp(e,t,n){return new Bp({type:`union`,options:t,discriminator:e,...I(n)})}const Hp=j(`ZodIntersection`,(e,t)=>{Du.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cf(e,t,n,r)});function Up(e,t){return new Hp({type:`intersection`,left:e,right:t})}const Wp=j(`ZodRecord`,(e,t)=>{Au.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wf(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Gp(e,t,n){return new Wp({type:`record`,keyType:e,valueType:t,...I(n)})}const Kp=j(`ZodEnum`,(e,t)=>{ju.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gf(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 Kp({...t,checks:[],...I(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 Kp({...t,checks:[],...I(r),entries:i})}});function qp(e,t){return new Kp({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...I(t)})}function Jp(e,t){return new Kp({type:`enum`,entries:e,...I(t)})}const Yp=j(`ZodLiteral`,(e,t)=>{Mu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_f(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 J(e,t){return new Yp({type:`literal`,values:Array.isArray(e)?e:[e],...I(t)})}const Xp=j(`ZodTransform`,(e,t)=>{Nu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yf(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ks(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(wc(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(wc(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Zp(e){return new Xp({type:`transform`,transform:e})}const Qp=j(`ZodOptional`,(e,t)=>{Fu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $p(e){return new Qp({type:`optional`,innerType:e})}const em=j(`ZodExactOptional`,(e,t)=>{Iu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function tm(e){return new em({type:`optional`,innerType:e})}const nm=j(`ZodNullable`,(e,t)=>{Lu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rm(e){return new nm({type:`nullable`,innerType:e})}const im=j(`ZodDefault`,(e,t)=>{Ru.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Df(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function am(e,t){return new im({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():cc(t)}})}const om=j(`ZodPrefault`,(e,t)=>{Bu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Of(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sm(e,t){return new om({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():cc(t)}})}const cm=j(`ZodNonOptional`,(e,t)=>{Vu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ef(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lm(e,t){return new cm({type:`nonoptional`,innerType:e,...I(t)})}const um=j(`ZodCatch`,(e,t)=>{Uu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function dm(e,t){return new um({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const fm=j(`ZodPipe`,(e,t)=>{Wu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Af(e,t,n,r),e.in=t.in,e.out=t.out});function pm(e,t){return new fm({type:`pipe`,in:e,out:t})}const mm=j(`ZodReadonly`,(e,t)=>{Ku.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hm(e){return new mm({type:`readonly`,innerType:e})}const gm=j(`ZodLazy`,(e,t)=>{Ju.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nf(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function _m(e){return new gm({type:`lazy`,getter:e})}const vm=j(`ZodCustom`,(e,t)=>{Yu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vf(e,t,n,r)});function ym(e,t={}){return tf(vm,e,t)}function bm(e){return nf(e)}function xm(e,t){return pm(Zp(e),t)}const Sm=[`en`,`zh-Hans`];q({identityToken:G().trim().min(1),nonce:G().trim().optional().nullable(),email:G().trim().email().optional().nullable(),name:q({firstName:G().trim().optional().nullable(),lastName:G().trim().optional().nullable()}).optional().nullable(),preferredLanguage:qp(Sm)}),q({isAvailable:Op()});const Cm=e=>xm(e=>e===null?void 0:e,e.optional()),wm=_m(()=>zp([G(),wp(),Op(),Ap(),Ip(wm),Gp(G(),wm)])),Tm=G().trim().pipe(ip()),Em=q({error:G().trim().min(1),details:Gp(G(),wm)}),Dm=q({expiresAt:Ff(),updatedAt:Ff()}),Om=q({id:G().trim().min(1),email:Tm,name:G(),image:G().nullable()}),km=q({token:G().trim().min(1),onboardingCompleted:Op(),projectTemplateOnboardingCompleted:Op(),session:Dm,user:Om}),Am=q({token:G().trim().min(1)});q({token:G().trim().min(1)});const Y={PENDING:`pending`,COMPLETED:`completed`,EXPIRED:`expired`,ERROR:`error`};Y.COMPLETED,Y.EXPIRED,Y.ERROR;const jm={BROWSER_PAGE:`browser_page`,DEEP_LINK:`deep_link`},Mm={GITHUB:`github`,GOOGLE:`google`,SLACK:`slack`},Nm={GOOGLE_WORKSPACE:`google-workspace`},Pm=qp([jm.BROWSER_PAGE,jm.DEEP_LINK]),Fm=qp([Mm.GITHUB,Mm.GOOGLE,Mm.SLACK]),Im=qp([Nm.GOOGLE_WORKSPACE]);q({returnMode:Pm,preferredLanguage:qp(Sm)});const Lm=q({authorizationUrl:G().trim().min(1),expiresAt:G().datetime(),state:G().trim().min(1)}),Rm=Lm.extend({provider:Fm}),zm=Lm.extend({provider:Im}),Bm=q({state:G().trim().min(1)}),Vm=Bm.extend({expiresAt:G().datetime(),name:G(),token:G().trim().min(1),userId:G().trim().min(1),avatarUrl:G()}),Hm=Bm.extend({reason:G().trim().min(1),status:J(Y.ERROR)}),Um=Vp(`status`,[Bm.extend({provider:Fm,status:J(Y.PENDING)}),Vm.extend({provider:Fm,status:J(Y.COMPLETED)}),Bm.extend({provider:Fm,status:J(Y.EXPIRED)}),Hm.extend({provider:Fm})]),Wm=Vp(`status`,[Bm.extend({provider:Im,status:J(Y.PENDING)}),Vm.extend({provider:Im,status:J(Y.COMPLETED)}),Bm.extend({provider:Im,status:J(Y.EXPIRED)}),Hm.extend({provider:Im})]);var Gm=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.USE_PROXY=e.UNSUPPORTED_MEDIA_TYPE=e.UNPROCESSABLE_ENTITY=e.UNAUTHORIZED=e.TOO_MANY_REQUESTS=e.TEMPORARY_REDIRECT=e.SWITCHING_PROTOCOLS=e.SERVICE_UNAVAILABLE=e.SEE_OTHER=e.RESET_CONTENT=e.REQUESTED_RANGE_NOT_SATISFIABLE=e.REQUEST_URI_TOO_LONG=e.REQUEST_TOO_LONG=e.REQUEST_TIMEOUT=e.REQUEST_HEADER_FIELDS_TOO_LARGE=e.PROXY_AUTHENTICATION_REQUIRED=e.PROCESSING=e.PRECONDITION_REQUIRED=e.PRECONDITION_FAILED=e.PERMANENT_REDIRECT=e.PAYMENT_REQUIRED=e.PARTIAL_CONTENT=e.OK=e.NOT_MODIFIED=e.NOT_IMPLEMENTED=e.NOT_FOUND=e.NOT_ACCEPTABLE=e.NON_AUTHORITATIVE_INFORMATION=e.NO_CONTENT=e.NETWORK_AUTHENTICATION_REQUIRED=e.MULTIPLE_CHOICES=e.MULTI_STATUS=e.MOVED_TEMPORARILY=e.MOVED_PERMANENTLY=e.METHOD_NOT_ALLOWED=e.METHOD_FAILURE=e.LOCKED=e.LENGTH_REQUIRED=e.INTERNAL_SERVER_ERROR=e.INSUFFICIENT_STORAGE=e.INSUFFICIENT_SPACE_ON_RESOURCE=e.IM_A_TEAPOT=e.HTTP_VERSION_NOT_SUPPORTED=e.GONE=e.GATEWAY_TIMEOUT=e.FORBIDDEN=e.FAILED_DEPENDENCY=e.EXPECTATION_FAILED=e.CREATED=e.CONTINUE=e.CONFLICT=e.BAD_REQUEST=e.BAD_GATEWAY=e.ACCEPTED=void 0,e.ACCEPTED=202,e.BAD_GATEWAY=502,e.BAD_REQUEST=400,e.CONFLICT=409,e.CONTINUE=100,e.CREATED=201,e.EXPECTATION_FAILED=417,e.FAILED_DEPENDENCY=424,e.FORBIDDEN=403,e.GATEWAY_TIMEOUT=504,e.GONE=410,e.HTTP_VERSION_NOT_SUPPORTED=505,e.IM_A_TEAPOT=418,e.INSUFFICIENT_SPACE_ON_RESOURCE=419,e.INSUFFICIENT_STORAGE=507,e.INTERNAL_SERVER_ERROR=500,e.LENGTH_REQUIRED=411,e.LOCKED=423,e.METHOD_FAILURE=420,e.METHOD_NOT_ALLOWED=405,e.MOVED_PERMANENTLY=301,e.MOVED_TEMPORARILY=302,e.MULTI_STATUS=207,e.MULTIPLE_CHOICES=300,e.NETWORK_AUTHENTICATION_REQUIRED=511,e.NO_CONTENT=204,e.NON_AUTHORITATIVE_INFORMATION=203,e.NOT_ACCEPTABLE=406,e.NOT_FOUND=404,e.NOT_IMPLEMENTED=501,e.NOT_MODIFIED=304,e.OK=200,e.PARTIAL_CONTENT=206,e.PAYMENT_REQUIRED=402,e.PERMANENT_REDIRECT=308,e.PRECONDITION_FAILED=412,e.PRECONDITION_REQUIRED=428,e.PROCESSING=102,e.PROXY_AUTHENTICATION_REQUIRED=407,e.REQUEST_HEADER_FIELDS_TOO_LARGE=431,e.REQUEST_TIMEOUT=408,e.REQUEST_TOO_LONG=413,e.REQUEST_URI_TOO_LONG=414,e.REQUESTED_RANGE_NOT_SATISFIABLE=416,e.RESET_CONTENT=205,e.SEE_OTHER=303,e.SERVICE_UNAVAILABLE=503,e.SWITCHING_PROTOCOLS=101,e.TEMPORARY_REDIRECT=307,e.TOO_MANY_REQUESTS=429,e.UNAUTHORIZED=401,e.UNPROCESSABLE_ENTITY=422,e.UNSUPPORTED_MEDIA_TYPE=415,e.USE_PROXY=305,e.default={ACCEPTED:e.ACCEPTED,BAD_GATEWAY:e.BAD_GATEWAY,BAD_REQUEST:e.BAD_REQUEST,CONFLICT:e.CONFLICT,CONTINUE:e.CONTINUE,CREATED:e.CREATED,EXPECTATION_FAILED:e.EXPECTATION_FAILED,FORBIDDEN:e.FORBIDDEN,GATEWAY_TIMEOUT:e.GATEWAY_TIMEOUT,GONE:e.GONE,HTTP_VERSION_NOT_SUPPORTED:e.HTTP_VERSION_NOT_SUPPORTED,IM_A_TEAPOT:e.IM_A_TEAPOT,INSUFFICIENT_SPACE_ON_RESOURCE:e.INSUFFICIENT_SPACE_ON_RESOURCE,INSUFFICIENT_STORAGE:e.INSUFFICIENT_STORAGE,INTERNAL_SERVER_ERROR:e.INTERNAL_SERVER_ERROR,LENGTH_REQUIRED:e.LENGTH_REQUIRED,LOCKED:e.LOCKED,METHOD_FAILURE:e.METHOD_FAILURE,METHOD_NOT_ALLOWED:e.METHOD_NOT_ALLOWED,MOVED_PERMANENTLY:e.MOVED_PERMANENTLY,MOVED_TEMPORARILY:e.MOVED_TEMPORARILY,MULTI_STATUS:e.MULTI_STATUS,MULTIPLE_CHOICES:e.MULTIPLE_CHOICES,NETWORK_AUTHENTICATION_REQUIRED:e.NETWORK_AUTHENTICATION_REQUIRED,NO_CONTENT:e.NO_CONTENT,NON_AUTHORITATIVE_INFORMATION:e.NON_AUTHORITATIVE_INFORMATION,NOT_ACCEPTABLE:e.NOT_ACCEPTABLE,NOT_FOUND:e.NOT_FOUND,NOT_IMPLEMENTED:e.NOT_IMPLEMENTED,NOT_MODIFIED:e.NOT_MODIFIED,OK:e.OK,PARTIAL_CONTENT:e.PARTIAL_CONTENT,PAYMENT_REQUIRED:e.PAYMENT_REQUIRED,PERMANENT_REDIRECT:e.PERMANENT_REDIRECT,PRECONDITION_FAILED:e.PRECONDITION_FAILED,PRECONDITION_REQUIRED:e.PRECONDITION_REQUIRED,PROCESSING:e.PROCESSING,PROXY_AUTHENTICATION_REQUIRED:e.PROXY_AUTHENTICATION_REQUIRED,REQUEST_HEADER_FIELDS_TOO_LARGE:e.REQUEST_HEADER_FIELDS_TOO_LARGE,REQUEST_TIMEOUT:e.REQUEST_TIMEOUT,REQUEST_TOO_LONG:e.REQUEST_TOO_LONG,REQUEST_URI_TOO_LONG:e.REQUEST_URI_TOO_LONG,REQUESTED_RANGE_NOT_SATISFIABLE:e.REQUESTED_RANGE_NOT_SATISFIABLE,RESET_CONTENT:e.RESET_CONTENT,SEE_OTHER:e.SEE_OTHER,SERVICE_UNAVAILABLE:e.SERVICE_UNAVAILABLE,SWITCHING_PROTOCOLS:e.SWITCHING_PROTOCOLS,TEMPORARY_REDIRECT:e.TEMPORARY_REDIRECT,TOO_MANY_REQUESTS:e.TOO_MANY_REQUESTS,UNAUTHORIZED:e.UNAUTHORIZED,UNPROCESSABLE_ENTITY:e.UNPROCESSABLE_ENTITY,UNSUPPORTED_MEDIA_TYPE:e.UNSUPPORTED_MEDIA_TYPE,USE_PROXY:e.USE_PROXY}})),Km=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reasonPhraseToStatusCode=e.statusCodeToReasonPhrase=void 0,e.statusCodeToReasonPhrase={202:`Accepted`,502:`Bad Gateway`,400:`Bad Request`,409:`Conflict`,100:`Continue`,201:`Created`,417:`Expectation Failed`,424:`Failed Dependency`,403:`Forbidden`,504:`Gateway Timeout`,410:`Gone`,505:`HTTP Version Not Supported`,418:`I'm a teapot`,419:`Insufficient Space on Resource`,507:`Insufficient Storage`,500:`Internal Server Error`,411:`Length Required`,423:`Locked`,420:`Method Failure`,405:`Method Not Allowed`,301:`Moved Permanently`,302:`Moved Temporarily`,207:`Multi-Status`,300:`Multiple Choices`,511:`Network Authentication Required`,204:`No Content`,203:`Non Authoritative Information`,406:`Not Acceptable`,404:`Not Found`,501:`Not Implemented`,304:`Not Modified`,200:`OK`,206:`Partial Content`,402:`Payment Required`,308:`Permanent Redirect`,412:`Precondition Failed`,428:`Precondition Required`,102:`Processing`,103:`Early Hints`,426:`Upgrade Required`,407:`Proxy Authentication Required`,431:`Request Header Fields Too Large`,408:`Request Timeout`,413:`Request Entity Too Large`,414:`Request-URI Too Long`,416:`Requested Range Not Satisfiable`,205:`Reset Content`,303:`See Other`,503:`Service Unavailable`,101:`Switching Protocols`,307:`Temporary Redirect`,429:`Too Many Requests`,401:`Unauthorized`,451:`Unavailable For Legal Reasons`,422:`Unprocessable Entity`,415:`Unsupported Media Type`,305:`Use Proxy`,421:`Misdirected Request`},e.reasonPhraseToStatusCode={Accepted:202,"Bad Gateway":502,"Bad Request":400,Conflict:409,Continue:100,Created:201,"Expectation Failed":417,"Failed Dependency":424,Forbidden:403,"Gateway Timeout":504,Gone:410,"HTTP Version Not Supported":505,"I'm a teapot":418,"Insufficient Space on Resource":419,"Insufficient Storage":507,"Internal Server Error":500,"Length Required":411,Locked:423,"Method Failure":420,"Method Not Allowed":405,"Moved Permanently":301,"Moved Temporarily":302,"Multi-Status":207,"Multiple Choices":300,"Network Authentication Required":511,"No Content":204,"Non Authoritative Information":203,"Not Acceptable":406,"Not Found":404,"Not Implemented":501,"Not Modified":304,OK:200,"Partial Content":206,"Payment Required":402,"Permanent Redirect":308,"Precondition Failed":412,"Precondition Required":428,Processing:102,"Early Hints":103,"Upgrade Required":426,"Proxy Authentication Required":407,"Request Header Fields Too Large":431,"Request Timeout":408,"Request Entity Too Large":413,"Request-URI Too Long":414,"Requested Range Not Satisfiable":416,"Reset Content":205,"See Other":303,"Service Unavailable":503,"Switching Protocols":101,"Temporary Redirect":307,"Too Many Requests":429,Unauthorized:401,"Unavailable For Legal Reasons":451,"Unprocessable Entity":422,"Unsupported Media Type":415,"Use Proxy":305,"Misdirected Request":421}})),qm=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getStatusText=e.getStatusCode=e.getReasonPhrase=void 0;var t=Km();function n(e){var n=t.statusCodeToReasonPhrase[e.toString()];if(!n)throw Error(`Status code does not exist: `+e);return n}e.getReasonPhrase=n;function r(e){var n=t.reasonPhraseToStatusCode[e];if(!n)throw Error(`Reason phrase does not exist: `+e);return n}e.getStatusCode=r,e.getStatusText=n})),Jm=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.StatusCodes=void 0,(function(e){e[e.CONTINUE=100]=`CONTINUE`,e[e.SWITCHING_PROTOCOLS=101]=`SWITCHING_PROTOCOLS`,e[e.PROCESSING=102]=`PROCESSING`,e[e.EARLY_HINTS=103]=`EARLY_HINTS`,e[e.OK=200]=`OK`,e[e.CREATED=201]=`CREATED`,e[e.ACCEPTED=202]=`ACCEPTED`,e[e.NON_AUTHORITATIVE_INFORMATION=203]=`NON_AUTHORITATIVE_INFORMATION`,e[e.NO_CONTENT=204]=`NO_CONTENT`,e[e.RESET_CONTENT=205]=`RESET_CONTENT`,e[e.PARTIAL_CONTENT=206]=`PARTIAL_CONTENT`,e[e.MULTI_STATUS=207]=`MULTI_STATUS`,e[e.MULTIPLE_CHOICES=300]=`MULTIPLE_CHOICES`,e[e.MOVED_PERMANENTLY=301]=`MOVED_PERMANENTLY`,e[e.MOVED_TEMPORARILY=302]=`MOVED_TEMPORARILY`,e[e.SEE_OTHER=303]=`SEE_OTHER`,e[e.NOT_MODIFIED=304]=`NOT_MODIFIED`,e[e.USE_PROXY=305]=`USE_PROXY`,e[e.TEMPORARY_REDIRECT=307]=`TEMPORARY_REDIRECT`,e[e.PERMANENT_REDIRECT=308]=`PERMANENT_REDIRECT`,e[e.BAD_REQUEST=400]=`BAD_REQUEST`,e[e.UNAUTHORIZED=401]=`UNAUTHORIZED`,e[e.PAYMENT_REQUIRED=402]=`PAYMENT_REQUIRED`,e[e.FORBIDDEN=403]=`FORBIDDEN`,e[e.NOT_FOUND=404]=`NOT_FOUND`,e[e.METHOD_NOT_ALLOWED=405]=`METHOD_NOT_ALLOWED`,e[e.NOT_ACCEPTABLE=406]=`NOT_ACCEPTABLE`,e[e.PROXY_AUTHENTICATION_REQUIRED=407]=`PROXY_AUTHENTICATION_REQUIRED`,e[e.REQUEST_TIMEOUT=408]=`REQUEST_TIMEOUT`,e[e.CONFLICT=409]=`CONFLICT`,e[e.GONE=410]=`GONE`,e[e.LENGTH_REQUIRED=411]=`LENGTH_REQUIRED`,e[e.PRECONDITION_FAILED=412]=`PRECONDITION_FAILED`,e[e.REQUEST_TOO_LONG=413]=`REQUEST_TOO_LONG`,e[e.REQUEST_URI_TOO_LONG=414]=`REQUEST_URI_TOO_LONG`,e[e.UNSUPPORTED_MEDIA_TYPE=415]=`UNSUPPORTED_MEDIA_TYPE`,e[e.REQUESTED_RANGE_NOT_SATISFIABLE=416]=`REQUESTED_RANGE_NOT_SATISFIABLE`,e[e.EXPECTATION_FAILED=417]=`EXPECTATION_FAILED`,e[e.IM_A_TEAPOT=418]=`IM_A_TEAPOT`,e[e.INSUFFICIENT_SPACE_ON_RESOURCE=419]=`INSUFFICIENT_SPACE_ON_RESOURCE`,e[e.METHOD_FAILURE=420]=`METHOD_FAILURE`,e[e.MISDIRECTED_REQUEST=421]=`MISDIRECTED_REQUEST`,e[e.UNPROCESSABLE_ENTITY=422]=`UNPROCESSABLE_ENTITY`,e[e.LOCKED=423]=`LOCKED`,e[e.FAILED_DEPENDENCY=424]=`FAILED_DEPENDENCY`,e[e.UPGRADE_REQUIRED=426]=`UPGRADE_REQUIRED`,e[e.PRECONDITION_REQUIRED=428]=`PRECONDITION_REQUIRED`,e[e.TOO_MANY_REQUESTS=429]=`TOO_MANY_REQUESTS`,e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]=`REQUEST_HEADER_FIELDS_TOO_LARGE`,e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]=`UNAVAILABLE_FOR_LEGAL_REASONS`,e[e.INTERNAL_SERVER_ERROR=500]=`INTERNAL_SERVER_ERROR`,e[e.NOT_IMPLEMENTED=501]=`NOT_IMPLEMENTED`,e[e.BAD_GATEWAY=502]=`BAD_GATEWAY`,e[e.SERVICE_UNAVAILABLE=503]=`SERVICE_UNAVAILABLE`,e[e.GATEWAY_TIMEOUT=504]=`GATEWAY_TIMEOUT`,e[e.HTTP_VERSION_NOT_SUPPORTED=505]=`HTTP_VERSION_NOT_SUPPORTED`,e[e.INSUFFICIENT_STORAGE=507]=`INSUFFICIENT_STORAGE`,e[e.NETWORK_AUTHENTICATION_REQUIRED=511]=`NETWORK_AUTHENTICATION_REQUIRED`})(e.StatusCodes||={})})),Ym=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReasonPhrases=void 0,(function(e){e.ACCEPTED=`Accepted`,e.BAD_GATEWAY=`Bad Gateway`,e.BAD_REQUEST=`Bad Request`,e.CONFLICT=`Conflict`,e.CONTINUE=`Continue`,e.CREATED=`Created`,e.EXPECTATION_FAILED=`Expectation Failed`,e.FAILED_DEPENDENCY=`Failed Dependency`,e.FORBIDDEN=`Forbidden`,e.GATEWAY_TIMEOUT=`Gateway Timeout`,e.GONE=`Gone`,e.HTTP_VERSION_NOT_SUPPORTED=`HTTP Version Not Supported`,e.IM_A_TEAPOT=`I'm a teapot`,e.INSUFFICIENT_SPACE_ON_RESOURCE=`Insufficient Space on Resource`,e.INSUFFICIENT_STORAGE=`Insufficient Storage`,e.INTERNAL_SERVER_ERROR=`Internal Server Error`,e.LENGTH_REQUIRED=`Length Required`,e.LOCKED=`Locked`,e.METHOD_FAILURE=`Method Failure`,e.METHOD_NOT_ALLOWED=`Method Not Allowed`,e.MOVED_PERMANENTLY=`Moved Permanently`,e.MOVED_TEMPORARILY=`Moved Temporarily`,e.MULTI_STATUS=`Multi-Status`,e.MULTIPLE_CHOICES=`Multiple Choices`,e.NETWORK_AUTHENTICATION_REQUIRED=`Network Authentication Required`,e.NO_CONTENT=`No Content`,e.NON_AUTHORITATIVE_INFORMATION=`Non Authoritative Information`,e.NOT_ACCEPTABLE=`Not Acceptable`,e.NOT_FOUND=`Not Found`,e.NOT_IMPLEMENTED=`Not Implemented`,e.NOT_MODIFIED=`Not Modified`,e.OK=`OK`,e.PARTIAL_CONTENT=`Partial Content`,e.PAYMENT_REQUIRED=`Payment Required`,e.PERMANENT_REDIRECT=`Permanent Redirect`,e.PRECONDITION_FAILED=`Precondition Failed`,e.PRECONDITION_REQUIRED=`Precondition Required`,e.PROCESSING=`Processing`,e.EARLY_HINTS=`Early Hints`,e.UPGRADE_REQUIRED=`Upgrade Required`,e.PROXY_AUTHENTICATION_REQUIRED=`Proxy Authentication Required`,e.REQUEST_HEADER_FIELDS_TOO_LARGE=`Request Header Fields Too Large`,e.REQUEST_TIMEOUT=`Request Timeout`,e.REQUEST_TOO_LONG=`Request Entity Too Large`,e.REQUEST_URI_TOO_LONG=`Request-URI Too Long`,e.REQUESTED_RANGE_NOT_SATISFIABLE=`Requested Range Not Satisfiable`,e.RESET_CONTENT=`Reset Content`,e.SEE_OTHER=`See Other`,e.SERVICE_UNAVAILABLE=`Service Unavailable`,e.SWITCHING_PROTOCOLS=`Switching Protocols`,e.TEMPORARY_REDIRECT=`Temporary Redirect`,e.TOO_MANY_REQUESTS=`Too Many Requests`,e.UNAUTHORIZED=`Unauthorized`,e.UNAVAILABLE_FOR_LEGAL_REASONS=`Unavailable For Legal Reasons`,e.UNPROCESSABLE_ENTITY=`Unprocessable Entity`,e.UNSUPPORTED_MEDIA_TYPE=`Unsupported Media Type`,e.USE_PROXY=`Use Proxy`,e.MISDIRECTED_REQUEST=`Misdirected Request`})(e.ReasonPhrases||={})})),X=e((e=>{var t=e&&e.__assign||function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)},n=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__exportStar||function(e,t){for(var r in e)r!==`default`&&!t.hasOwnProperty(r)&&n(t,e,r)},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0});var a=i(Gm()),o=qm(),s=qm();Object.defineProperty(e,`getStatusCode`,{enumerable:!0,get:function(){return s.getStatusCode}}),Object.defineProperty(e,`getReasonPhrase`,{enumerable:!0,get:function(){return s.getReasonPhrase}}),Object.defineProperty(e,`getStatusText`,{enumerable:!0,get:function(){return s.getStatusText}});var c=Jm();Object.defineProperty(e,`StatusCodes`,{enumerable:!0,get:function(){return c.StatusCodes}});var l=Ym();Object.defineProperty(e,`ReasonPhrases`,{enumerable:!0,get:function(){return l.ReasonPhrases}}),r(Gm(),e),e.default=t(t({},a.default),{getStatusCode:o.getStatusCode,getStatusText:o.getStatusText})}))();const Z=(e,t)=>{let n=JSON.parse(e),r=t.safeParse(n);if(!r.success)throw r.error;return r.data};let Xm=function(e){return e.OK=`ok`,e.UNAUTHORIZED=`unauthorized`,e}({});const Zm=q({success:Op()}),Qm=q({token:G().trim().min(1),userId:G().trim().min(1),email:G().trim().email(),expiresAt:G().datetime(),updatedAt:G().datetime(),name:G(),avatarUrl:G()}),$m=q({ok:J(!0),revokedAt:G().datetime(),sessionId:G().trim().min(1)}),Q=async(e,t)=>{let n=Z(await e.text(),Em);throw Error(n.error)},eh=async(e,t,n={})=>{let r=await(n.fetchImpl??fetch)(`${A(e)}/api/auth/email-otp/send-verification-otp`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({email:t.email})});return r.status===X.StatusCodes.NO_CONTENT?{success:!0}:r.status===X.StatusCodes.OK?Z(await r.text(),Zm):await Q(r,`Failed to request sign-in code`)},th=async(e,t,n={})=>{let r=await(n.fetchImpl??fetch)(`${A(e)}/api/auth/sign-in/email-otp`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({email:t.email,otp:t.otp,preferredLanguage:t.preferredLanguage})});return r.status===X.StatusCodes.OK?Z(await r.text(),Am):await Q(r,`Failed to verify sign-in code`)},nh=async(e,t,n={})=>{let r=await(n.fetchImpl??fetch)(`${A(e)}/api/auth/oauth/${encodeURIComponent(t.provider)}/start`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({returnMode:t.returnMode,preferredLanguage:t.preferredLanguage})});return r.status===X.StatusCodes.OK?Z(await r.text(),Rm):await Q(r,`Failed to start external OAuth login`)},rh=async(e,t,n={})=>{let r=n.fetchImpl??fetch,i=new URL(`/api/auth/oauth/${encodeURIComponent(t.provider)}/completion`,A(e));i.searchParams.set(`state`,t.state);let a=await r(i,{method:`GET`});return a.status===X.StatusCodes.OK?Z(await a.text(),Um):await Q(a,`Failed to load external OAuth completion state`)},ih=async(e,t,n={})=>{let r=await(n.fetchImpl??fetch)(`${A(e)}/api/auth/sso/${encodeURIComponent(t.provider)}/start`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({returnMode:t.returnMode,preferredLanguage:t.preferredLanguage})});return r.status===X.StatusCodes.OK?Z(await r.text(),zm):await Q(r,`Failed to start external SSO login`)},ah=async(e,t,n={})=>{let r=n.fetchImpl??fetch,i=new URL(`/api/auth/sso/${encodeURIComponent(t.provider)}/completion`,A(e));i.searchParams.set(`state`,t.state);let a=await r(i,{method:`GET`});return a.status===X.StatusCodes.OK?Z(await a.text(),Wm):await Q(a,`Failed to load external SSO completion state`)},oh=async(e,t,n={})=>{let r=await(n.fetchImpl??fetch)(`${A(e)}/api/auth/cli-session/exchange`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});return r.status===X.StatusCodes.OK?Z(await r.text(),Qm):await Q(r,`Failed to create CLI session`)},sh=async(e,t,n={})=>{let r=await(n.fetchImpl??fetch)(`${A(e)}/api/auth/cli-session/logout`,{method:`POST`,headers:{authorization:`Bearer ${t.token}`}});if(r.status===X.StatusCodes.UNAUTHORIZED)throw Error(`Stored auth is invalid or expired`);return r.status===X.StatusCodes.OK?Z(await r.text(),$m):await Q(r,`Failed to revoke CLI session`)},ch=async(e,t,n={})=>{let r=n.fetchImpl??fetch,i=new URL(`/api/auth/get-session`,A(e));i.searchParams.set(`disableCookieCache`,`true`),t.disableRefresh&&i.searchParams.set(`disableRefresh`,`true`);let a=await r(i,{method:`GET`,headers:{authorization:`Bearer ${t.token}`}});return a.status===X.StatusCodes.OK?{status:`ok`,session:Z(await a.text(),km),error:null}:a.status===X.StatusCodes.UNAUTHORIZED?{status:`unauthorized`,session:null,error:Z(await a.text(),Em)}:await Q(a,`Failed to refresh session`)};var lh=class extends Error{constructor(e,t){super(e),this.name=`HttpClientResponseError`,this.status=t.status,this.statusText=t.statusText,this.bodyText=t.bodyText,t.cause!==void 0&&(this.cause=t.cause)}};const uh=async e=>{try{return await e.clone().text()}catch{return}},dh=async(e,t=`HTTP request failed`)=>{if(e.ok)return;let n=await uh(e);throw new lh(t,{status:e.status,statusText:e.statusText,bodyText:n})},fh=/^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,ph=/^\d+$/;let mh=function(e){return e.CLI=`cli`,e.DESKTOP=`desktop`,e.MOBILE=`mobile`,e.BROWSER_USE=`browser-use`,e}({}),hh=function(e){return e.STABLE=`stable`,e.BETA=`beta`,e.PREVIEW=`preview`,e}({}),gh=function(e){return e.COMMAND=`command`,e.DOWNLOAD=`download`,e.STORE=`store`,e.DOCS=`docs`,e}({}),_h=function(e){return e.DARWIN_ARM64=`darwin-arm64`,e.DARWIN_X64=`darwin-x64`,e.WIN_X64=`win-x64`,e}({}),vh=function(e){return e.DARWIN_ARM64=`darwin-arm64`,e.DARWIN_X64=`darwin-x64`,e.LINUX_X64=`linux-x64`,e.LINUX_ARM64=`linux-arm64`,e}({}),yh=function(e){return e.IOS=`ios`,e.ANDROID=`android`,e}({}),bh=function(e){return e.CHROME=`chrome`,e}({});const xh=new Set(Object.values(mh)),Sh=new Set(Object.values(hh)),Ch=new Set(Object.values(gh)),wh=Object.values(_h),Th={cli:Object.values(vh),desktop:wh,mobile:Object.values(yh),"browser-use":Object.values(bh)},Eh=e=>typeof e==`object`&&!!e,$=(e,t)=>{if(typeof e!=`string`||e.trim().length===0)throw Error(`Release manifest ${t} must be a non-empty string`);return e.trim()},Dh=(e,t)=>{if(e!=null){if(typeof e!=`string`||e.trim().length===0)throw Error(`Release manifest ${t} must be a non-empty string when provided`);return e.trim()}},Oh=(e,t)=>{if(e!=null){if(typeof e!=`number`||!Number.isFinite(e))throw TypeError(`Release manifest ${t} must be a finite number when provided`);return e}},kh=(e,t)=>{let n=Oh(e,t);if(n!=null){if(!Number.isInteger(n)||n<0)throw Error(`Release manifest ${t} must be a non-negative integer when provided`);return n}},Ah=(e,t)=>{let n=ph.test(e),r=ph.test(t);return n&&r?Number(e)-Number(t):n?-1:r?1:e.localeCompare(t)},jh=e=>{let t=e.trim().match(fh);if(!t)throw Error(`Invalid release version: ${e}`);return{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),prerelease:t[4]?t[4].split(`.`):[]}},Mh=e=>xh.has(e),Nh=e=>Sh.has(e),Ph=e=>Ch.has(e),Fh=(e,t)=>Th[e].includes(t),Ih=(e,t)=>{let n=jh(e),r=jh(t);if(n.major!==r.major)return n.major-r.major;if(n.minor!==r.minor)return n.minor-r.minor;if(n.patch!==r.patch)return n.patch-r.patch;let i=n.prerelease.length>0,a=r.prerelease.length>0;if(!i&&!a)return 0;if(!i)return 1;if(!a)return-1;let o=Math.max(n.prerelease.length,r.prerelease.length);for(let e=0;e<o;e+=1){let t=n.prerelease[e],i=r.prerelease[e];if(t==null)return-1;if(i==null)return 1;let a=Ah(t,i);if(a!==0)return a}return 0},Lh=(e,t)=>Ih(t,e.minimumSupportedVersion)<0?`update_required`:Ih(t,e.latestVersion)<0?`update_available`:`up_to_date`,Rh=e=>{if(!Fh(e.product,e.platform))throw Error(`Unsupported release platform '${e.platform}' for product '${e.product}'`);return`v1/releases/${e.product}/${e.channel}/${e.platform}.json`},zh=e=>{if(!Eh(e))throw TypeError(`Release manifest must be an object`);let t=e.schemaVersion;if(t!==1)throw Error(`Unsupported release manifest schema version: ${String(t)}`);let n=$(e.product,`product`);if(!Mh(n))throw Error(`Unsupported release product: ${n}`);let r=$(e.channel,`channel`);if(!Nh(r))throw Error(`Unsupported release channel: ${r}`);let i=$(e.platform,`platform`);if(!Fh(n,i))throw Error(`Unsupported release platform '${i}' for product '${n}'`);let a=i,o=e.actions;if(!Array.isArray(o))throw TypeError(`Release manifest actions must be an array`);let s=o.map((e,t)=>{if(!Eh(e))throw TypeError(`Release manifest actions[${t}] must be an object`);let n=$(e.kind,`actions[${t}].kind`);if(!Ph(n))throw Error(`Unsupported release action kind: ${n}`);return{kind:n,label:$(e.label,`actions[${t}].label`),url:Dh(e.url,`actions[${t}].url`),command:Dh(e.command,`actions[${t}].command`),sha256:Dh(e.sha256,`actions[${t}].sha256`),size:kh(e.size,`actions[${t}].size`)}}),c=Oh(e.rolloutPercentage,`rolloutPercentage`);if(c!=null&&(!Number.isInteger(c)||c<0||c>100))throw Error(`Release manifest rolloutPercentage must be an integer between 0 and 100`);return{schemaVersion:1,product:n,channel:r,platform:a,latestVersion:$(e.latestVersion,`latestVersion`),minimumSupportedVersion:$(e.minimumSupportedVersion,`minimumSupportedVersion`),publishedAt:$(e.publishedAt,`publishedAt`),releaseNotesUrl:Dh(e.releaseNotesUrl,`releaseNotesUrl`),message:Dh(e.message,`message`),rolloutPercentage:c,actions:s}},Bh=new Set([`localhost`,`127.0.0.1`,`::1`]),Vh=e=>Bh.has(e),Hh=e=>{let t=A(e.trim()),n=new URL(t);if(n.protocol===`https:`||n.protocol===`http:`&&Vh(n.hostname))return A(n.toString());throw Error(`Updates base URL must use https or localhost http: ${e}`)},Uh=e=>`${Hh(e.baseUrl)}/${Rh({product:e.product,channel:e.channel,platform:e.platform})}`,Wh=async e=>e.json(),Gh=async e=>{let t=new AbortController,n=setTimeout(()=>{t.abort()},e.timeoutMs);try{let n=await e.fetchImpl(e.url,{method:`GET`,signal:t.signal,headers:{accept:`application/json`}});return await dh(n,`Release manifest request failed`),zh(await Wh(n))}finally{clearTimeout(n)}},Kh=async e=>{let t=e.fetch??fetch,n=await Gh({url:Uh({baseUrl:e.baseUrl,product:e.product,channel:e.channel,platform:e.platform}),fetchImpl:t,timeoutMs:e.timeoutMs??5e3});return{availability:Lh(n,e.currentVersion),manifest:n}};export{Oo as $,Ws as A,ds as B,Jp as C,G as D,Gp as E,As as F,Bo as G,fs as H,Bs as I,k as J,Wo as K,Cs as L,Ns as M,Ds as N,zp as O,Ls as P,Eo as Q,ws as R,J as S,q as T,Xo as U,ps as V,Yo as W,Ho as X,Ko as Y,Do as Z,qp as _,Xm as a,Ea as at,Vp as b,ch as c,O as ct,eh as d,So as et,th as f,Cm as g,wm as h,mh as i,Wa as it,Os as j,Mp as k,ah as l,Ha as lt,ih as m,vh as n,Lo as nt,oh as o,Ra as ot,nh as p,Go as q,hh as r,To as rt,rh as s,qa as st,Kh as t,wo as tt,sh as u,T as ut,Ip as v,wp as w,_m as x,Op as y,xs as z};
80
+ //# debugId=e16d36e9-1876-5088-a6a9-ad4448d5a19b
@@ -0,0 +1,4 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e8bde271-5390-5b15-b64a-58f71e8ba498")}catch(e){}}();
3
+ import{n as e,r as t}from"./chunk-Bdh3yLIe.js";var n,r=e((()=>{n=`1.9.1`}));function i(e){let t=new Set([e]),n=new Set,r=e.match(a);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function o(e){return n.add(e),!1}function s(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(a);if(!r)return o(e);let c={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return c.prerelease!=null||i.major!==c.major?o(e):i.major===0?i.minor===c.minor&&i.patch<=c.patch?s(e):o(e):i.minor<=c.minor?s(e):o(e)}}var a,o,s=e((()=>{r(),a=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,o=i(n)}));function c(e,t,r,i=!1){let a=f[d]=f[d]??{version:n};if(!i&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return r.error(t.stack||t.message),!1}if(a.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${n}`);return r.error(t.stack||t.message),!1}return a[e]=t,r.debug(`@opentelemetry/api: Registered a global for ${e} v${n}.`),!0}function l(e){let t=f[d]?.version;if(!(!t||!o(t)))return f[d]?.[e]}function u(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${n}.`);let r=f[d];r&&delete r[e]}var ee,d,f,p=e((()=>{r(),s(),ee=n.split(`.`)[0],d=Symbol.for(`opentelemetry.js.api.${ee}`),f=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{}}));function m(e,t,n){let r=l(`diag`);if(r)return r[e](t,...n)}var te,ne=e((()=>{p(),te=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return m(`debug`,this._namespace,e)}error(...e){return m(`error`,this._namespace,e)}info(...e){return m(`info`,this._namespace,e)}warn(...e){return m(`warn`,this._namespace,e)}verbose(...e){return m(`verbose`,this._namespace,e)}}})),h,g=e((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(h||={})}));function re(e,t){e<h.NONE?e=h.NONE:e>h.ALL&&(e=h.ALL),t||={};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,h.ERROR),warn:n(`warn`,h.WARN),info:n(`info`,h.INFO),debug:n(`debug`,h.DEBUG),verbose:n(`verbose`,h.VERBOSE)}}var ie=e((()=>{g()})),ae,_,v=e((()=>{ne(),ie(),g(),p(),ae=`diag`,_=class e{static instance(){return this._instance||=new e,this._instance}constructor(){function e(e){return function(...t){let n=l(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:h.INFO})=>{if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error(e.stack??e.message),!1}typeof n==`number`&&(n={logLevel:n});let r=l(`diag`),i=re(n.logLevel??h.INFO,e);if(r&&!n.suppressOverrideMessage){let e=Error().stack??`<failed to generate stacktrace>`;r.warn(`Current logger will be overwritten from ${e}`),i.warn(`Current logger will overwrite one already registered from ${e}`)}return c(`diag`,i,t,!0)},t.disable=()=>{u(ae,t)},t.createComponentLogger=e=>new te(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}}})),oe,se=e((()=>{oe=class e{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let e of t)n._entries.delete(e);return n}clear(){return new e}}})),ce,le=e((()=>{ce=Symbol(`BaggageEntryMetadata`)}));function ue(e={}){return new oe(new Map(Object.entries(e)))}function de(e){return typeof e!=`string`&&(fe.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:ce,toString(){return e}}}var fe,pe=e((()=>{v(),se(),le(),fe=_.instance()}));function y(e){return Symbol.for(e)}var me,b,x=e((()=>{me=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},b=new me})),S,C,he,ge=e((()=>{if(S=[{n:`error`,c:`error`},{n:`warn`,c:`warn`},{n:`info`,c:`info`},{n:`debug`,c:`debug`},{n:`verbose`,c:`trace`}],C={},typeof console<`u`)for(let e of[`error`,`warn`,`info`,`debug`,`trace`,`log`])typeof console[e]==`function`&&(C[e]=console[e]);he=class{constructor(){function e(e){return function(...t){let n=C[e];if(typeof n!=`function`&&(n=C.log),typeof n!=`function`&&console&&(n=console[e],typeof n!=`function`&&(n=console.log)),typeof n==`function`)return n.apply(console,t)}}for(let t=0;t<S.length;t++)this[S[t].n]=e(S[t].c)}}}));function _e(){return E}var ve,w,ye,be,xe,Se,T,Ce,we,Te,E,Ee,De,Oe,ke,Ae,je,Me,Ne=e((()=>{ve=class{constructor(){}createGauge(e,t){return De}createHistogram(e,t){return Oe}createCounter(e,t){return Ee}createUpDownCounter(e,t){return ke}createObservableGauge(e,t){return je}createObservableCounter(e,t){return Ae}createObservableUpDownCounter(e,t){return Me}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},w=class{},ye=class extends w{add(e,t){}},be=class extends w{add(e,t){}},xe=class extends w{record(e,t){}},Se=class extends w{record(e,t){}},T=class{addCallback(e){}removeCallback(e){}},Ce=class extends T{},we=class extends T{},Te=class extends T{},E=new ve,Ee=new ye,De=new xe,Oe=new Se,ke=new be,Ae=new Ce,je=new we,Me=new Te})),D,Pe=e((()=>{(function(e){e[e.INT=0]=`INT`,e[e.DOUBLE=1]=`DOUBLE`})(D||={})})),O,k,Fe=e((()=>{O={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},k={set(e,t,n){e!=null&&(e[t]=n)}}})),Ie,Le=e((()=>{x(),Ie=class{active(){return b}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}}})),A,Re,j,M=e((()=>{Le(),p(),v(),A=`context`,Re=new Ie,j=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalContextManager(e){return c(A,e,_.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return l(A)||Re}disable(){this._getContextManager().disable(),u(A,_.instance())}}})),N,ze=e((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(N||={})})),P,F,I,Be=e((()=>{ze(),P=`0000000000000000`,F=`00000000000000000000000000000000`,I={traceId:F,spanId:P,traceFlags:N.NONE}})),L,Ve=e((()=>{Be(),L=class{constructor(e=I){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}}));function He(e){return e.getValue(R)||void 0}function Ue(){return He(j.getInstance().active())}function We(e,t){return e.setValue(R,t)}function Ge(e){return e.deleteValue(R)}function Ke(e,t){return We(e,new L(t))}function qe(e){return He(e)?.spanContext()}var R,Je=e((()=>{x(),Ve(),M(),R=y(`OpenTelemetry Context Key SPAN`)}));function Ye(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(B[e.charCodeAt(t)]|0)+(B[e.charCodeAt(t+1)]|0)+(B[e.charCodeAt(t+2)]|0)+(B[e.charCodeAt(t+3)]|0);return n===t}function Xe(e){return Ye(e,32)&&e!==`00000000000000000000000000000000`}function Ze(e){return Ye(e,16)&&e!==`0000000000000000`}function z(e){return Xe(e.traceId)&&Ze(e.spanId)}function Qe(e){return new L(e)}var B,$e=e((()=>{Be(),Ve(),B=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1])}));function et(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var V,tt,nt=e((()=>{M(),Je(),Ve(),$e(),V=j.getInstance(),tt=class{startSpan(e,t,n=V.active()){if(t?.root)return new L;let r=n&&qe(n);return et(r)&&z(r)?new L(r):new L}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??V.active(),c=this.startSpan(e,i,s),l=We(s,c);return V.with(l,o,void 0,c)}}})),rt,it,at=e((()=>{nt(),rt=new tt,it=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):rt}}})),ot,st=e((()=>{nt(),ot=class{getTracer(e,t,n){return new tt}}})),ct,H,lt=e((()=>{at(),st(),ct=new ot,H=class{getTracer(e,t,n){return this.getDelegateTracer(e,t,n)??new it(this,e,t,n)}getDelegate(){return this._delegate??ct}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){return this._delegate?.getTracer(e,t,n)}}})),ut,dt=e((()=>{(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(ut||={})})),ft,pt=e((()=>{(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(ft||={})})),mt,ht=e((()=>{(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(mt||={})}));function gt(e){return bt.test(e)}function _t(e){return xt.test(e)&&!St.test(e)}var U,vt,yt,bt,xt,St,Ct=e((()=>{U=`[_0-9a-z-*/]`,vt=`[a-z]${U}{0,255}`,yt=`[a-z0-9]${U}{0,240}@[a-z]${U}{0,13}`,bt=RegExp(`^(?:${vt}|${yt})$`),xt=/^[ -~]{0,255}[!-~]$/,St=/,|=/})),wt,Tt,Et,W,Dt,Ot=e((()=>{Ct(),wt=32,Tt=512,Et=`,`,W=`=`,Dt=class e{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return Array.from(this._internalState.keys()).reduceRight((e,t)=>(e.push(t+W+this.get(t)),e),[]).join(Et)}_parse(e){e.length>Tt||(this._internalState=e.split(Et).reduceRight((e,t)=>{let n=t.trim(),r=n.indexOf(W);if(r!==-1){let i=n.slice(0,r),a=n.slice(r+1,t.length);gt(i)&&_t(a)&&e.set(i,a)}return e},new Map),this._internalState.size>wt&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,wt))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}}}));function kt(e){return new Dt(e)}var At=e((()=>{Ot()})),G,jt=e((()=>{M(),G=j.getInstance()})),K,Mt=e((()=>{v(),K=_.instance()})),Nt,Pt,Ft=e((()=>{Ne(),Nt=class{getMeter(e,t,n){return E}},Pt=new Nt})),q,It,Lt=e((()=>{Ft(),p(),v(),q=`metrics`,It=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return c(q,e,_.instance())}getMeterProvider(){return l(q)||Pt}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){u(q,_.instance())}}})),J,Rt=e((()=>{Lt(),J=It.getInstance()})),zt,Bt=e((()=>{zt=class{inject(e,t){}extract(e,t){return e}fields(){return[]}}}));function Vt(e){return e.getValue(Y)||void 0}function Ht(){return Vt(j.getInstance().active())}function Ut(e,t){return e.setValue(Y,t)}function Wt(e){return e.deleteValue(Y)}var Y,Gt=e((()=>{M(),x(),Y=y(`OpenTelemetry Baggage Key`)})),X,Kt,qt,Jt=e((()=>{p(),Bt(),Fe(),Gt(),pe(),v(),X=`propagation`,Kt=new zt,qt=class e{constructor(){this.createBaggage=ue,this.getBaggage=Vt,this.getActiveBaggage=Ht,this.setBaggage=Ut,this.deleteBaggage=Wt}static getInstance(){return this._instance||=new e,this._instance}setGlobalPropagator(e){return c(X,e,_.instance())}inject(e,t,n=k){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=O){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){u(X,_.instance())}_getGlobalPropagator(){return l(X)||Kt}}})),Z,Yt=e((()=>{Jt(),Z=qt.getInstance()})),Q,Xt,Zt=e((()=>{p(),lt(),$e(),Je(),v(),Q=`trace`,Xt=class e{constructor(){this._proxyTracerProvider=new H,this.wrapSpanContext=Qe,this.isSpanContextValid=z,this.deleteSpan=Ge,this.getSpan=He,this.getActiveSpan=Ue,this.getSpanContext=qe,this.setSpan=We,this.setSpanContext=Ke}static getInstance(){return this._instance||=new e,this._instance}setGlobalTracerProvider(e){let t=c(Q,this._proxyTracerProvider,_.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return l(Q)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){u(Q,_.instance()),this._proxyTracerProvider=new H}}})),$,Qt=e((()=>{Zt(),$=Xt.getInstance()})),$t=t({DiagConsoleLogger:()=>he,DiagLogLevel:()=>h,INVALID_SPANID:()=>P,INVALID_SPAN_CONTEXT:()=>I,INVALID_TRACEID:()=>F,ProxyTracer:()=>it,ProxyTracerProvider:()=>H,ROOT_CONTEXT:()=>b,SamplingDecision:()=>ut,SpanKind:()=>ft,SpanStatusCode:()=>mt,TraceFlags:()=>N,ValueType:()=>D,baggageEntryMetadataFromString:()=>de,context:()=>G,createContextKey:()=>y,createNoopMeter:()=>_e,createTraceState:()=>kt,default:()=>en,defaultTextMapGetter:()=>O,defaultTextMapSetter:()=>k,diag:()=>K,isSpanContextValid:()=>z,isValidSpanId:()=>Ze,isValidTraceId:()=>Xe,metrics:()=>J,propagation:()=>Z,trace:()=>$}),en,tn=e((()=>{pe(),x(),ge(),g(),Ne(),Pe(),Fe(),at(),lt(),dt(),pt(),ht(),ze(),At(),$e(),Be(),jt(),Mt(),Rt(),Yt(),Qt(),en={context:G,diag:K,metrics:J,propagation:Z,trace:$}}));export{y as _,J as a,mt as c,I as d,F as f,b as g,he as h,Z as i,ft as l,D as m,tn as n,K as o,N as p,$ as r,G as s,$t as t,z as u,h as v};
4
+ //# debugId=e8bde271-5390-5b15-b64a-58f71e8ba498
@@ -1,4 +1,4 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="16795115-07a7-59f1-b93a-cbf3627b29d9")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="66b58e1f-2439-56e3-a32b-c40f12b150a7")}catch(e){}}();
3
3
  import{i as e,t}from"./chunk-Bdh3yLIe.js";var n=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.execAsync=void 0;let n=e(`child_process`);t.execAsync=e(`util`).promisify(n.exec)}));export{n as t};
4
- //# debugId=16795115-07a7-59f1-b93a-cbf3627b29d9
4
+ //# debugId=66b58e1f-2439-56e3-a32b-c40f12b150a7
@@ -1,4 +1,4 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a5c4ad93-8e39-510e-a80f-3b4e2487928c")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3a6a9673-2678-5085-b30e-269e6f0b9803")}catch(e){}}();
3
3
  import{i as e,t}from"./chunk-Bdh3yLIe.js";var n=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.execAsync=void 0;let n=e(`child_process`);t.execAsync=e(`util`).promisify(n.exec)}));export{n as t};
4
- //# debugId=a5c4ad93-8e39-510e-a80f-3b4e2487928c
4
+ //# debugId=3a6a9673-2678-5085-b30e-269e6f0b9803
@@ -1,4 +1,4 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d52d2001-987a-579b-b72a-dae03aabbf54")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="30ceaaff-7fa3-5547-96bd-745d51341f04")}catch(e){}}();
3
3
  import{i as e,t}from"./chunk-Bdh3yLIe.js";var n=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.execAsync=void 0;let n=e(`child_process`);t.execAsync=e(`util`).promisify(n.exec)}));export{n as t};
4
- //# debugId=d52d2001-987a-579b-b72a-dae03aabbf54
4
+ //# debugId=30ceaaff-7fa3-5547-96bd-745d51341f04
@@ -1,4 +1,4 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="02f5cee2-d1a8-564b-8c83-7b6191724b2f")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0dd7b145-9e35-595e-80bb-78044c84521b")}catch(e){}}();
3
3
  import{i as e,t}from"./chunk-Bdh3yLIe.js";var n=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.execAsync=void 0;let n=e(`child_process`);t.execAsync=e(`util`).promisify(n.exec)}));export{n as t};
4
- //# debugId=02f5cee2-d1a8-564b-8c83-7b6191724b2f
4
+ //# debugId=0dd7b145-9e35-595e-80bb-78044c84521b
@@ -1,4 +1,4 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="78c5e0b7-f6bb-5548-907f-6f39165018b3")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="67872406-1797-5abf-8b3c-b13d18b85f08")}catch(e){}}();
3
3
  import{i as e,t}from"./chunk-Bdh3yLIe.js";var n=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.execAsync=void 0;let n=e(`child_process`);t.execAsync=e(`util`).promisify(n.exec)}));export{n as t};
4
- //# debugId=78c5e0b7-f6bb-5548-907f-6f39165018b3
4
+ //# debugId=67872406-1797-5abf-8b3c-b13d18b85f08
@@ -1,4 +1,4 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c675a729-a09f-5fdd-ae73-757de56ad147")}catch(e){}}();
3
- import{a as e,i as t,t as n}from"./chunk-Bdh3yLIe.js";import{n as r,t as i}from"./esm-CVx3LwsY.js";import{t as a}from"./execAsync-BKAmdm9j.js";var o=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let o=t(`fs`),s=a(),c=(r(),e(i));async function l(){try{return(await o.promises.readFile(`/etc/hostid`,{encoding:`utf8`})).trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}try{return(await(0,s.execAsync)(`kenv -q smbios.system.uuid`)).stdout.trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=l}));export default o();export{};
4
- //# debugId=c675a729-a09f-5fdd-ae73-757de56ad147
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3c5b79ee-b5cf-5e69-9ff9-5df5d397aad1")}catch(e){}}();
3
+ import{a as e,i as t,t as n}from"./chunk-Bdh3yLIe.js";import{n as r,t as i}from"./esm-DcZNWkvb.js";import{t as a}from"./execAsync-D_3X02jS.js";var o=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let o=t(`fs`),s=a(),c=(r(),e(i));async function l(){try{return(await o.promises.readFile(`/etc/hostid`,{encoding:`utf8`})).trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}try{return(await(0,s.execAsync)(`kenv -q smbios.system.uuid`)).stdout.trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=l}));export default o();export{};
4
+ //# debugId=3c5b79ee-b5cf-5e69-9ff9-5df5d397aad1