@langgenius/syncless-darwin-arm64 0.0.16 → 0.0.17-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/package.json +1 -1
  2. package/payload/.env +1 -1
  3. package/payload/dist/cli.js +134 -71
  4. package/payload/dist/{devtools-uqpz439S.js → devtools-CA2oRalS.js} +2 -2
  5. package/payload/dist/{esm-DcZNWkvb.js → esm-ff0QswHQ.js} +2 -2
  6. package/payload/dist/{execAsync-BZAWwuvf.js → execAsync-BbPoEBLY.js} +2 -2
  7. package/payload/dist/{execAsync-D2zcCRHg.js → execAsync-C1C2Dhr5.js} +2 -2
  8. package/payload/dist/{execAsync-D_3X02jS.js → execAsync-DgGRALCR.js} +2 -2
  9. package/payload/dist/{execAsync-B57lajYt.js → execAsync-YfbJtIiI.js} +2 -2
  10. package/payload/dist/execAsync-ZBi_Rp_8.js +4 -0
  11. package/payload/dist/{getMachineId-bsd-BrlN6PEO.js → getMachineId-bsd-B7IJldTE.js} +3 -3
  12. package/payload/dist/{getMachineId-bsd-C9rTsHCB.js → getMachineId-bsd-BOF4R-5b.js} +3 -3
  13. package/payload/dist/{getMachineId-bsd-CIiF5I2-.js → getMachineId-bsd-CXxDmbl-.js} +3 -3
  14. package/payload/dist/{getMachineId-bsd-CWysdV5q.js → getMachineId-bsd-CgdeU1_A.js} +3 -3
  15. package/payload/dist/getMachineId-bsd-vwRNoq3L.js +4 -0
  16. package/payload/dist/{getMachineId-darwin-BVHajbu-.js → getMachineId-darwin-0va0rJGP.js} +3 -3
  17. package/payload/dist/{getMachineId-darwin-Bh0FW8Yj.js → getMachineId-darwin-B2iRJjDk.js} +3 -3
  18. package/payload/dist/{getMachineId-darwin-DjZKKbMx.js → getMachineId-darwin-BqrOLIYH.js} +3 -3
  19. package/payload/dist/{getMachineId-darwin-L_bpBFRk.js → getMachineId-darwin-CuPOfqMl.js} +3 -3
  20. package/payload/dist/getMachineId-darwin-D4cnvOCq.js +5 -0
  21. package/payload/dist/{getMachineId-linux-6ZzpQRKs.js → getMachineId-linux-CUlAgf4p.js} +3 -3
  22. package/payload/dist/{getMachineId-linux-BNh9bxS-.js → getMachineId-linux-DKUhpr74.js} +3 -3
  23. package/payload/dist/{getMachineId-linux-DF4P4JAH.js → getMachineId-linux-DV61XOHH.js} +3 -3
  24. package/payload/dist/{getMachineId-linux-DtCHfcI-.js → getMachineId-linux-h3RBA30a.js} +3 -3
  25. package/payload/dist/getMachineId-linux-txioaRT4.js +4 -0
  26. package/payload/dist/{getMachineId-unsupported-BHgtlyRW.js → getMachineId-unsupported-BIk8g1NB.js} +3 -3
  27. package/payload/dist/{getMachineId-unsupported-BU7O02cs.js → getMachineId-unsupported-BWYkKo3b.js} +3 -3
  28. package/payload/dist/{getMachineId-unsupported-Ba8WKp1L.js → getMachineId-unsupported-BxJJ5c2g.js} +3 -3
  29. package/payload/dist/{getMachineId-unsupported-BhnsN8NZ.js → getMachineId-unsupported-DMJtgTje.js} +3 -3
  30. package/payload/dist/getMachineId-unsupported-DiyhtuQH.js +4 -0
  31. package/payload/dist/{getMachineId-win-DHX0BZr6.js → getMachineId-win-BlEG8eKR.js} +3 -3
  32. package/payload/dist/{getMachineId-win-Daab2wn9.js → getMachineId-win-CPwLBa-V.js} +3 -3
  33. package/payload/dist/{getMachineId-win-DvS6eAIQ.js → getMachineId-win-CfvwfuJg.js} +3 -3
  34. package/payload/dist/{getMachineId-win-IRvYdsh7.js → getMachineId-win-oAABMa4A.js} +3 -3
  35. package/payload/dist/getMachineId-win-qu-3Sn0c.js +4 -0
  36. package/payload/package.json +1 -1
  37. package/payload/dist/dist-Bu1YPPQW.js +0 -130
  38. package/payload/dist/execAsync-DzZ-O7pw.js +0 -4
  39. package/payload/dist/getMachineId-bsd-DngtODTf.js +0 -4
  40. package/payload/dist/getMachineId-darwin-j7fk-PUK.js +0 -5
  41. package/payload/dist/getMachineId-linux-Uf_DKcur.js +0 -4
  42. package/payload/dist/getMachineId-unsupported-BynWzgul.js +0 -4
  43. package/payload/dist/getMachineId-win-LU1p7cWS.js +0 -4
  44. package/payload/dist/login_cycle-Dp2pPYfl-CVoti3ri.js +0 -4
  45. package/payload/dist/runtime_auth_helpers-Cc-eZq6d-CRgMm6u8.js +0 -3
  46. package/payload/dist/runtime_auth_helpers-Cc-eZq6d-D8qQ07Ah.js +0 -4
  47. package/payload/dist/status-jFJKIUBU-BCgr1MV_.js +0 -4
@@ -1,130 +0,0 @@
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]="3fe60296-773c-5f48-a15a-d8d5a8cc8162")}catch(e){}}();
3
- import{t as e}from"./chunk-Bdh3yLIe.js";var t;function n(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 r=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},i=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(t=globalThis).__zod_globalConfig??(t.__zod_globalConfig={});const a=globalThis.__zod_globalConfig;function o(e){return e&&Object.assign(a,e),a}function s(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 c(e,t){return typeof t==`bigint`?t.toString():t}function l(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function u(e){return e==null}function d(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function f(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}const p=Symbol(`evaluating`);function m(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==p)return r===void 0&&(r=p,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 te(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function ne(e){return JSON.stringify(e)}function re(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const ie=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ae(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const oe=l(()=>{if(a.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function se(e){if(ae(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(ae(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ce(e){return se(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const le=new Set([`string`,`number`,`symbol`]);function ue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function de(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function h(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 fe(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const pe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function me(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 de(e,te(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 he(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 de(e,te(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 ge(e,t){if(!se(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 de(e,te(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ee(this,`shape`,n),n}}))}function _e(e,t){if(!se(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return de(e,te(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ee(this,`shape`,n),n}}))}function ve(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return de(e,te(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:t._zod.def.checks??[]}))}function ye(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 de(t,te(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 be(e,t,n){return de(t,te(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 xe(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 Se(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Ce(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function we(e){return typeof e==`string`?e:e?.message}function g(e,t,n){let r=e.message?e.message:we(e.inst?._zod.def?.error?.(e))??we(t?.error?.(e))??we(n.customError?.(e))??we(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Te(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ee(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const De=(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,c,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Oe=n(`$ZodError`,De),ke=n(`$ZodError`,De,{Parent:Error});function Ae(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 je(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}const Me=e=>(t,n,i,a)=>{let s=i?{...i,async:!1}:{async:!1},c=t._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new r;if(c.issues.length){let t=new(a?.Err??e)(c.issues.map(e=>g(e,s,o())));throw ie(t,a?.callee),t}return c.value},Ne=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>g(e,a,o())));throw ie(t,i?.callee),t}return s.value},Pe=e=>(t,n,i)=>{let a=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise)throw new r;return s.issues.length?{success:!1,error:new(e??Oe)(s.issues.map(e=>g(e,a,o())))}:{success:!0,data:s.value}},Fe=Pe(ke),Ie=e=>async(t,n,r)=>{let i=r?{...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=>g(e,i,o())))}:{success:!0,data:a.value}},Le=Ie(ke),Re=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Me(e)(t,n,i)},ze=e=>(t,n,r)=>Me(e)(t,n,r),Be=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ne(e)(t,n,i)},Ve=e=>async(t,n,r)=>Ne(e)(t,n,r),He=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Pe(e)(t,n,i)},Ue=e=>(t,n,r)=>Pe(e)(t,n,r),We=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ie(e)(t,n,i)},Ge=e=>async(t,n,r)=>Ie(e)(t,n,r),Ke=/^[cC][0-9a-z]{6,}$/,qe=/^[0-9a-z]+$/,Je=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ye=/^[0-9a-vA-V]{20}$/,Xe=/^[A-Za-z0-9]{27}$/,Ze=/^[a-zA-Z0-9_-]{21}$/,Qe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,$e=/^([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})$/,et=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)$/,tt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function nt(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const rt=/^(?:(?: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])$/,it=/^(([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}|:))$/,at=/^((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])$/,ot=/^(([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])$/,st=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ct=/^[A-Za-z0-9_-]*$/,lt=/^https?$/,ut=/^\+[1-9]\d{6,14}$/,dt=`(?:(?:\\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])))`,ft=RegExp(`^${dt}$`);function pt(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 mt(e){return RegExp(`^${pt(e)}$`)}function ht(e){let t=pt({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(`^${dt}T(?:${r})$`)}const gt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},_t=/^-?\d+n?$/,vt=/^-?\d+$/,yt=/^-?\d+(?:\.\d+)?$/,bt=/^(?:true|false)$/i,xt=/^null$/i,St=/^[^A-Z]*$/,Ct=/^[^a-z]*$/,_=n(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),wt={number:`number`,bigint:`bigint`,object:`date`},Tt=n(`$ZodCheckLessThan`,(e,t)=>{_.init(e,t);let n=wt[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})}}),Et=n(`$ZodCheckGreaterThan`,(e,t)=>{_.init(e,t);let n=wt[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})}}),Dt=n(`$ZodCheckMultipleOf`,(e,t)=>{_.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):f(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})}}),Ot=n(`$ZodCheckNumberFormat`,(e,t)=>{_.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=pe[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=vt)}),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})}}),kt=n(`$ZodCheckMaxLength`,(e,t)=>{var n;_.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!u(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=Te(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),At=n(`$ZodCheckMinLength`,(e,t)=>{var n;_.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!u(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=Te(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),jt=n(`$ZodCheckLengthEquals`,(e,t)=>{var n;_.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!u(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=Te(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})}}),Mt=n(`$ZodCheckStringFormat`,(e,t)=>{var n,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=()=>{})}),Nt=n(`$ZodCheckRegex`,(e,t)=>{Mt.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})}}),Pt=n(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=St,Mt.init(e,t)}),Ft=n(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Ct,Mt.init(e,t)}),It=n(`$ZodCheckIncludes`,(e,t)=>{_.init(e,t);let n=ue(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})}}),Lt=n(`$ZodCheckStartsWith`,(e,t)=>{_.init(e,t);let n=RegExp(`^${ue(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})}}),Rt=n(`$ZodCheckEndsWith`,(e,t)=>{_.init(e,t);let n=RegExp(`.*${ue(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})}}),zt=n(`$ZodCheckOverwrite`,(e,t)=>{_.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Bt=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 Vt={major:4,minor:4,patch:3},v=n(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Vt;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)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let i=xe(e),a;for(let o of t){if(o._zod.def.when){if(Se(e)||!o._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&n?.async===!1)throw new r;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(i||=xe(e,t))});else{if(e.issues.length===t)continue;i||=xe(e,t)}}return a?a.then(()=>e):e},n=(n,a,o)=>{if(xe(n))return n.aborted=!0,n;let s=t(a,i,o);if(s instanceof Promise){if(o.async===!1)throw new r;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=>n(e,a,o)):n(t,a,o)}let s=e._zod.parse(a,o);if(s instanceof Promise){if(o.async===!1)throw new r;return s.then(e=>t(e,i,o))}return t(s,i,o)}}m(e,`~standard`,()=>({validate:t=>{try{let n=Fe(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Le(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Ht=n(`$ZodString`,(e,t)=>{v.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??gt(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}}),y=n(`$ZodStringFormat`,(e,t)=>{Mt.init(e,t),Ht.init(e,t)}),Ut=n(`$ZodGUID`,(e,t)=>{t.pattern??=$e,y.init(e,t)}),Wt=n(`$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??=et(e)}else t.pattern??=et();y.init(e,t)}),Gt=n(`$ZodEmail`,(e,t)=>{t.pattern??=tt,y.init(e,t)}),Kt=n(`$ZodURL`,(e,t)=>{y.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===lt.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let 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})}}}),qt=n(`$ZodEmoji`,(e,t)=>{t.pattern??=nt(),y.init(e,t)}),Jt=n(`$ZodNanoID`,(e,t)=>{t.pattern??=Ze,y.init(e,t)}),Yt=n(`$ZodCUID`,(e,t)=>{t.pattern??=Ke,y.init(e,t)}),Xt=n(`$ZodCUID2`,(e,t)=>{t.pattern??=qe,y.init(e,t)}),Zt=n(`$ZodULID`,(e,t)=>{t.pattern??=Je,y.init(e,t)}),Qt=n(`$ZodXID`,(e,t)=>{t.pattern??=Ye,y.init(e,t)}),$t=n(`$ZodKSUID`,(e,t)=>{t.pattern??=Xe,y.init(e,t)}),en=n(`$ZodISODateTime`,(e,t)=>{t.pattern??=ht(t),y.init(e,t)}),tn=n(`$ZodISODate`,(e,t)=>{t.pattern??=ft,y.init(e,t)}),nn=n(`$ZodISOTime`,(e,t)=>{t.pattern??=mt(t),y.init(e,t)}),rn=n(`$ZodISODuration`,(e,t)=>{t.pattern??=Qe,y.init(e,t)}),an=n(`$ZodIPv4`,(e,t)=>{t.pattern??=rt,y.init(e,t),e._zod.bag.format=`ipv4`}),on=n(`$ZodIPv6`,(e,t)=>{t.pattern??=it,y.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})}}}),sn=n(`$ZodCIDRv4`,(e,t)=>{t.pattern??=at,y.init(e,t)}),cn=n(`$ZodCIDRv6`,(e,t)=>{t.pattern??=ot,y.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 ln(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const un=n(`$ZodBase64`,(e,t)=>{t.pattern??=st,y.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{ln(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function dn(e){if(!ct.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return ln(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const fn=n(`$ZodBase64URL`,(e,t)=>{t.pattern??=ct,y.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{dn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),pn=n(`$ZodE164`,(e,t)=>{t.pattern??=ut,y.init(e,t)});function mn(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 hn=n(`$ZodJWT`,(e,t)=>{y.init(e,t),e._zod.check=n=>{mn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),gn=n(`$ZodNumber`,(e,t)=>{v.init(e,t),e._zod.pattern=e._zod.bag.pattern??yt,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}}),_n=n(`$ZodNumberFormat`,(e,t)=>{Ot.init(e,t),gn.init(e,t)}),vn=n(`$ZodBoolean`,(e,t)=>{v.init(e,t),e._zod.pattern=bt,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}}),yn=n(`$ZodBigInt`,(e,t)=>{v.init(e,t),e._zod.pattern=_t,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),bn=n(`$ZodNull`,(e,t)=>{v.init(e,t),e._zod.pattern=xt,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}}),xn=n(`$ZodUnknown`,(e,t)=>{v.init(e,t),e._zod.parse=e=>e}),Sn=n(`$ZodNever`,(e,t)=>{v.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Cn(e,t,n){e.issues.length&&t.issues.push(...Ce(n,e.issues)),t.value[n]=e.value}const wn=n(`$ZodArray`,(e,t)=>{v.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=>Cn(t,n,e))):Cn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Tn(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Ce(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function En(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=fe(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Dn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||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=>Tn(e,n,i,t,u,d))):Tn(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const On=n(`$ZodObject`,(e,t)=>{if(v.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=l(()=>En(t));m(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=ae,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.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Tn(n,t,e,s,r,i))):Tn(a,t,e,s,r,i)}return i?Dn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),kn=n(`$ZodObjectJIT`,(e,t)=>{On.init(e,t);let n=e._zod.parse,r=l(()=>En(t)),i=e=>{let t=new Bt([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=ne(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=ne(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?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
- `):c?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(`
40
- const ${n}_present = ${o} in input;
41
- if (${n}.issues.length) {
42
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
43
- ...iss,
44
- path: iss.path ? [${o}, ...iss.path] : [${o}]
45
- })));
46
- }
47
- if (!${n}_present && !${n}.issues.length) {
48
- payload.issues.push({
49
- code: "invalid_type",
50
- expected: "nonoptional",
51
- input: undefined,
52
- path: [${o}]
53
- });
54
- }
55
-
56
- if (${n}_present) {
57
- if (${n}.value === undefined) {
58
- newResult[${o}] = undefined;
59
- } else {
60
- newResult[${o}] = ${n}.value;
61
- }
62
- }
63
-
64
- `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},o,s=ae,c=!a.jitless,u=c&&oe.value,d=t.catchall,f;e._zod.parse=(a,l)=>{f??=r.value;let p=a.value;return s(p)?c&&u&&l?.async===!1&&l.jitless!==!0?(o||=i(t.shape),a=o(a,l),d?Dn([],p,a,l,f,e):a):n(a,l):(a.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),a)}});function An(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=>!xe(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=>g(e,r,o())))}),t)}const jn=n(`$ZodUnion`,(e,t)=>{v.init(e,t),m(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),m(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),m(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),m(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>d(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>An(t,r,e,i)):An(o,r,e,i)}}),Mn=n(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,jn.init(e,t);let n=e._zod.parse;m(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=l(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!ae(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Nn=n(`$ZodIntersection`,(e,t)=>{v.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Fn(e,t,n)):Fn(e,i,a)}});function Pn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(se(e)&&se(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=Pn(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=Pn(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 Fn(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}),xe(e))return e;let o=Pn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const In=n(`$ZodRecord`,(e,t)=>{v.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!se(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],s=t.keyType._zod.values;if(s){n.value={};let c=new Set;for(let l of s)if(typeof l==`string`||typeof l==`number`||typeof l==`symbol`){c.add(typeof l==`number`?l.toString():l);let s=t.keyType._zod.run({value:l,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>g(e,r,o())),input:l,path:[l],inst:e});continue}let u=s.value,d=t.valueType._zod.run({value:i[l],issues:[]},r);d instanceof Promise?a.push(d.then(e=>{e.issues.length&&n.issues.push(...Ce(l,e.issues)),n.value[u]=e.value})):(d.issues.length&&n.issues.push(...Ce(l,d.issues)),n.value[u]=d.value)}let l;for(let e in i)c.has(e)||(l??=[],l.push(e));l&&l.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:l})}else{n.value={};for(let s of Reflect.ownKeys(i)){if(s===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof s==`string`&&yt.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=>g(e,r,o())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:i[s],issues:[]},r);l instanceof Promise?a.push(l.then(e=>{e.issues.length&&n.issues.push(...Ce(s,e.issues)),n.value[c.value]=e.value})):(l.issues.length&&n.issues.push(...Ce(s,l.issues)),n.value[c.value]=l.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Ln=n(`$ZodEnum`,(e,t)=>{v.init(e,t);let n=s(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>le.has(typeof e)).map(e=>typeof e==`string`?ue(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}}),Rn=n(`$ZodLiteral`,(e,t)=>{if(v.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?ue(e):e?ue(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}}),zn=n(`$ZodTransform`,(e,t)=>{v.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,a)=>{if(a.direction===`backward`)throw new i(e.constructor.name);let o=t.transform(n.value,n);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n.fallback=!0,n));if(o instanceof Promise)throw new r;return n.value=o,n.fallback=!0,n}});function Bn(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Vn=n(`$ZodOptional`,(e,t)=>{v.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),m(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${d(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Bn(e,r)):Bn(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Hn=n(`$ZodExactOptional`,(e,t)=>{Vn.init(e,t),m(e._zod,`values`,()=>t.innerType._zod.values),m(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Un=n(`$ZodNullable`,(e,t)=>{v.init(e,t),m(e._zod,`optin`,()=>t.innerType._zod.optin),m(e._zod,`optout`,()=>t.innerType._zod.optout),m(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${d(e.source)}|null)$`):void 0}),m(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)}),Wn=n(`$ZodDefault`,(e,t)=>{v.init(e,t),e._zod.optin=`optional`,m(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=>Gn(e,t)):Gn(r,t)}});function Gn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Kn=n(`$ZodPrefault`,(e,t)=>{v.init(e,t),e._zod.optin=`optional`,m(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))}),qn=n(`$ZodNonOptional`,(e,t)=>{v.init(e,t),m(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=>Jn(t,e)):Jn(i,e)}});function Jn(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 Yn=n(`$ZodCatch`,(e,t)=>{v.init(e,t),e._zod.optin=`optional`,m(e._zod,`optout`,()=>t.innerType._zod.optout),m(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=>g(e,n,o()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>g(e,n,o()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Xn=n(`$ZodPipe`,(e,t)=>{v.init(e,t),m(e._zod,`values`,()=>t.in._zod.values),m(e._zod,`optin`,()=>t.in._zod.optin),m(e._zod,`optout`,()=>t.out._zod.optout),m(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=>Zn(e,t.in,n)):Zn(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Zn(e,t.out,n)):Zn(r,t.out,n)}});function Zn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const Qn=n(`$ZodReadonly`,(e,t)=>{v.init(e,t),m(e._zod,`propValues`,()=>t.innerType._zod.propValues),m(e._zod,`values`,()=>t.innerType._zod.values),m(e._zod,`optin`,()=>t.innerType?._zod?.optin),m(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($n):$n(r)}});function $n(e){return e.value=Object.freeze(e.value),e}const er=n(`$ZodLazy`,(e,t)=>{v.init(e,t),m(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),m(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),m(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),m(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),m(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),tr=n(`$ZodCustom`,(e,t)=>{_.init(e,t),v.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>nr(t,n,r,e));nr(i,n,r,e)}});function nr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Ee(e))}}var rr,ir=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 ar(){return new ir}(rr=globalThis).__zod_globalRegistry??(rr.__zod_globalRegistry=ar());const or=globalThis.__zod_globalRegistry;function sr(e,t){return new e({type:`string`,...h(t)})}function cr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...h(t)})}function lr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...h(t)})}function ur(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...h(t)})}function dr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...h(t)})}function fr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...h(t)})}function pr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...h(t)})}function mr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...h(t)})}function hr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...h(t)})}function gr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...h(t)})}function _r(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...h(t)})}function vr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...h(t)})}function yr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...h(t)})}function br(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...h(t)})}function xr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...h(t)})}function Sr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...h(t)})}function Cr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...h(t)})}function wr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...h(t)})}function Tr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...h(t)})}function Er(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...h(t)})}function Dr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...h(t)})}function Or(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...h(t)})}function kr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...h(t)})}function Ar(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...h(t)})}function jr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...h(t)})}function Mr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...h(t)})}function Nr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...h(t)})}function Pr(e,t){return new e({type:`number`,checks:[],...h(t)})}function Fr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...h(t)})}function Ir(e,t){return new e({type:`boolean`,...h(t)})}function Lr(e,t){return new e({type:`bigint`,...h(t)})}function Rr(e,t){return new e({type:`null`,...h(t)})}function zr(e){return new e({type:`unknown`})}function Br(e,t){return new e({type:`never`,...h(t)})}function Vr(e,t){return new Tt({check:`less_than`,...h(t),value:e,inclusive:!1})}function Hr(e,t){return new Tt({check:`less_than`,...h(t),value:e,inclusive:!0})}function Ur(e,t){return new Et({check:`greater_than`,...h(t),value:e,inclusive:!1})}function Wr(e,t){return new Et({check:`greater_than`,...h(t),value:e,inclusive:!0})}function Gr(e,t){return new Dt({check:`multiple_of`,...h(t),value:e})}function Kr(e,t){return new kt({check:`max_length`,...h(t),maximum:e})}function qr(e,t){return new At({check:`min_length`,...h(t),minimum:e})}function Jr(e,t){return new jt({check:`length_equals`,...h(t),length:e})}function Yr(e,t){return new Nt({check:`string_format`,format:`regex`,...h(t),pattern:e})}function Xr(e){return new Pt({check:`string_format`,format:`lowercase`,...h(e)})}function Zr(e){return new Ft({check:`string_format`,format:`uppercase`,...h(e)})}function Qr(e,t){return new It({check:`string_format`,format:`includes`,...h(t),includes:e})}function $r(e,t){return new Lt({check:`string_format`,format:`starts_with`,...h(t),prefix:e})}function ei(e,t){return new Rt({check:`string_format`,format:`ends_with`,...h(t),suffix:e})}function ti(e){return new zt({check:`overwrite`,tx:e})}function ni(e){return ti(t=>t.normalize(e))}function ri(){return ti(e=>e.trim())}function ii(){return ti(e=>e.toLowerCase())}function ai(){return ti(e=>e.toUpperCase())}function oi(){return ti(e=>re(e))}function si(e,t,n){return new e({type:`array`,element:t,...h(n)})}function ci(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...h(n)})}function li(e,t){let n=ui(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ee(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Ee(r))}},e(t.value,t)),t);return n}function ui(e,t){let n=new _({check:`custom`,...h(t)});return n._zod.check=e,n}function di(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??or,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function b(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,b(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&x(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function fi(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>
65
-
66
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function pi(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:hi(t,`input`,e.processors),output:hi(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function x(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return x(r.element,n);if(r.type===`set`)return x(r.valueType,n);if(r.type===`lazy`)return x(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return x(r.innerType,n);if(r.type===`intersection`)return x(r.left,n)||x(r.right,n);if(r.type===`record`||r.type===`map`)return x(r.keyType,n)||x(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:x(r.in,n)||x(r.out,n);if(r.type===`object`){for(let e in r.shape)if(x(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(x(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(x(e,n))return!0;return!!(r.rest&&x(r.rest,n))}return!1}const mi=(e,t={})=>n=>{let r=di({...n,processors:t});return b(e,r),fi(r,e),pi(r,e)},hi=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=di({...i??{},target:a,io:t,processors:n});return b(e,o),fi(o,e),pi(o,e)},gi={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},_i=(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=gi[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}))])}},vi=(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`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},yi=(e,t,n,r)=>{n.type=`boolean`},bi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},xi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Si=(e,t,n,r)=>{n.not={}},Ci=(e,t,n,r)=>{let i=e._zod.def,a=s(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},wi=(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},Ti=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Ei=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Di=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=b(a.element,t,{...r,path:[...r.path,`items`]})},Oi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=b(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=b(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},ki=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>b(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ai=(e,t,n,r)=>{let i=e._zod.def,a=b(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=b(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},ji=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=b(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=b(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=b(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Mi=(e,t,n,r)=>{let i=e._zod.def,a=b(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ni=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Pi=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Fi=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Ii=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Li=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;b(o,t,r);let s=t.seen.get(e);s.ref=o},Ri=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},zi=(e,t,n,r)=>{let i=e._zod.def;b(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Bi=(e,t,n,r)=>{let i=e._zod.innerType;b(i,t,r);let a=t.seen.get(e);a.ref=i},Vi=n(`ZodISODateTime`,(e,t)=>{en.init(e,t),T.init(e,t)});function Hi(e){return Ar(Vi,e)}const Ui=n(`ZodISODate`,(e,t)=>{tn.init(e,t),T.init(e,t)});function Wi(e){return jr(Ui,e)}const Gi=n(`ZodISOTime`,(e,t)=>{nn.init(e,t),T.init(e,t)});function Ki(e){return Mr(Gi,e)}const qi=n(`ZodISODuration`,(e,t)=>{rn.init(e,t),T.init(e,t)});function Ji(e){return Nr(qi,e)}const S=n(`ZodError`,(e,t)=>{Oe.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>je(e,t)},flatten:{value:t=>Ae(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,c,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,c,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Yi=Me(S),Xi=Ne(S),Zi=Pe(S),Qi=Ie(S),$i=Re(S),ea=ze(S),ta=Be(S),na=Ve(S),ra=He(S),ia=Ue(S),aa=We(S),oa=Ge(S),sa=new WeakMap;function ca(e,t,n){let r=Object.getPrototypeOf(e),i=sa.get(r);if(i||(i=new Set,sa.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}const C=n(`ZodType`,(e,t)=>(v.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:hi(e,`input`),output:hi(e,`output`)}}),e.toJSONSchema=mi(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.parse=(t,n)=>Yi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Zi(e,t,n),e.parseAsync=async(t,n)=>Xi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Qi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>$i(e,t,n),e.decode=(t,n)=>ea(e,t,n),e.encodeAsync=async(t,n)=>ta(e,t,n),e.decodeAsync=async(t,n)=>na(e,t,n),e.safeEncode=(t,n)=>ra(e,t,n),e.safeDecode=(t,n)=>ia(e,t,n),e.safeEncodeAsync=async(t,n)=>aa(e,t,n),e.safeDecodeAsync=async(t,n)=>oa(e,t,n),ca(e,`ZodType`,{check(...e){let t=this.def;return this.clone(te(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return de(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Do(e,t))},superRefine(e,t){return this.check(Oo(e,t))},overwrite(e){return this.check(ti(e))},optional(){return oo(this)},exactOptional(){return co(this)},nullable(){return uo(this)},nullish(){return oo(uo(this))},nonoptional(e){return _o(this,e)},array(){return E(this)},or(e){return qa([this,e])},and(e){return Za(this,e)},transform(e){return xo(this,io(e))},default(e){return po(this,e)},prefault(e){return ho(this,e)},catch(e){return yo(this,e)},pipe(e){return xo(this,e)},readonly(){return Co(this)},describe(e){let t=this.clone();return or.add(t,{description:e}),t},meta(...e){if(e.length===0)return or.get(this);let t=this.clone();return or.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,`description`,{get(){return or.get(e)?.description},configurable:!0}),e)),la=n(`_ZodString`,(e,t)=>{Ht.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,ca(e,`_ZodString`,{regex(...e){return this.check(Yr(...e))},includes(...e){return this.check(Qr(...e))},startsWith(...e){return this.check($r(...e))},endsWith(...e){return this.check(ei(...e))},min(...e){return this.check(qr(...e))},max(...e){return this.check(Kr(...e))},length(...e){return this.check(Jr(...e))},nonempty(...e){return this.check(qr(1,...e))},lowercase(e){return this.check(Xr(e))},uppercase(e){return this.check(Zr(e))},trim(){return this.check(ri())},normalize(...e){return this.check(ni(...e))},toLowerCase(){return this.check(ii())},toUpperCase(){return this.check(ai())},slugify(){return this.check(oi())}})}),ua=n(`ZodString`,(e,t)=>{Ht.init(e,t),la.init(e,t),e.email=t=>e.check(cr(da,t)),e.url=t=>e.check(mr(ma,t)),e.jwt=t=>e.check(kr(ka,t)),e.emoji=t=>e.check(hr(ha,t)),e.guid=t=>e.check(lr(fa,t)),e.uuid=t=>e.check(ur(pa,t)),e.uuidv4=t=>e.check(dr(pa,t)),e.uuidv6=t=>e.check(fr(pa,t)),e.uuidv7=t=>e.check(pr(pa,t)),e.nanoid=t=>e.check(gr(ga,t)),e.guid=t=>e.check(lr(fa,t)),e.cuid=t=>e.check(_r(_a,t)),e.cuid2=t=>e.check(vr(va,t)),e.ulid=t=>e.check(yr(ya,t)),e.base64=t=>e.check(Er(Ea,t)),e.base64url=t=>e.check(Dr(Da,t)),e.xid=t=>e.check(br(ba,t)),e.ksuid=t=>e.check(xr(xa,t)),e.ipv4=t=>e.check(Sr(Sa,t)),e.ipv6=t=>e.check(Cr(Ca,t)),e.cidrv4=t=>e.check(wr(wa,t)),e.cidrv6=t=>e.check(Tr(Ta,t)),e.e164=t=>e.check(Or(Oa,t)),e.datetime=t=>e.check(Hi(t)),e.date=t=>e.check(Wi(t)),e.time=t=>e.check(Ki(t)),e.duration=t=>e.check(Ji(t))});function w(e){return sr(ua,e)}const T=n(`ZodStringFormat`,(e,t)=>{y.init(e,t),la.init(e,t)}),da=n(`ZodEmail`,(e,t)=>{Gt.init(e,t),T.init(e,t)}),fa=n(`ZodGUID`,(e,t)=>{Ut.init(e,t),T.init(e,t)}),pa=n(`ZodUUID`,(e,t)=>{Wt.init(e,t),T.init(e,t)}),ma=n(`ZodURL`,(e,t)=>{Kt.init(e,t),T.init(e,t)}),ha=n(`ZodEmoji`,(e,t)=>{qt.init(e,t),T.init(e,t)}),ga=n(`ZodNanoID`,(e,t)=>{Jt.init(e,t),T.init(e,t)}),_a=n(`ZodCUID`,(e,t)=>{Yt.init(e,t),T.init(e,t)}),va=n(`ZodCUID2`,(e,t)=>{Xt.init(e,t),T.init(e,t)}),ya=n(`ZodULID`,(e,t)=>{Zt.init(e,t),T.init(e,t)}),ba=n(`ZodXID`,(e,t)=>{Qt.init(e,t),T.init(e,t)}),xa=n(`ZodKSUID`,(e,t)=>{$t.init(e,t),T.init(e,t)}),Sa=n(`ZodIPv4`,(e,t)=>{an.init(e,t),T.init(e,t)}),Ca=n(`ZodIPv6`,(e,t)=>{on.init(e,t),T.init(e,t)}),wa=n(`ZodCIDRv4`,(e,t)=>{sn.init(e,t),T.init(e,t)}),Ta=n(`ZodCIDRv6`,(e,t)=>{cn.init(e,t),T.init(e,t)}),Ea=n(`ZodBase64`,(e,t)=>{un.init(e,t),T.init(e,t)}),Da=n(`ZodBase64URL`,(e,t)=>{fn.init(e,t),T.init(e,t)}),Oa=n(`ZodE164`,(e,t)=>{pn.init(e,t),T.init(e,t)}),ka=n(`ZodJWT`,(e,t)=>{hn.init(e,t),T.init(e,t)}),Aa=n(`ZodNumber`,(e,t)=>{gn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r),ca(e,`ZodNumber`,{gt(e,t){return this.check(Ur(e,t))},gte(e,t){return this.check(Wr(e,t))},min(e,t){return this.check(Wr(e,t))},lt(e,t){return this.check(Vr(e,t))},lte(e,t){return this.check(Hr(e,t))},max(e,t){return this.check(Hr(e,t))},int(e){return this.check(Na(e))},safe(e){return this.check(Na(e))},positive(e){return this.check(Ur(0,e))},nonnegative(e){return this.check(Wr(0,e))},negative(e){return this.check(Vr(0,e))},nonpositive(e){return this.check(Hr(0,e))},multipleOf(e,t){return this.check(Gr(e,t))},step(e,t){return this.check(Gr(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ja(e){return Pr(Aa,e)}const Ma=n(`ZodNumberFormat`,(e,t)=>{_n.init(e,t),Aa.init(e,t)});function Na(e){return Fr(Ma,e)}const Pa=n(`ZodBoolean`,(e,t)=>{vn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r)});function Fa(e){return Ir(Pa,e)}const Ia=n(`ZodBigInt`,(e,t)=>{yn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.gte=(t,n)=>e.check(Wr(t,n)),e.min=(t,n)=>e.check(Wr(t,n)),e.gt=(t,n)=>e.check(Ur(t,n)),e.gte=(t,n)=>e.check(Wr(t,n)),e.min=(t,n)=>e.check(Wr(t,n)),e.lt=(t,n)=>e.check(Vr(t,n)),e.lte=(t,n)=>e.check(Hr(t,n)),e.max=(t,n)=>e.check(Hr(t,n)),e.positive=t=>e.check(Ur(BigInt(0),t)),e.negative=t=>e.check(Vr(BigInt(0),t)),e.nonpositive=t=>e.check(Hr(BigInt(0),t)),e.nonnegative=t=>e.check(Wr(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(Gr(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function La(e){return Lr(Ia,e)}const Ra=n(`ZodNull`,(e,t)=>{bn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r)});function za(e){return Rr(Ra,e)}const Ba=n(`ZodUnknown`,(e,t)=>{xn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Va(){return zr(Ba)}const Ha=n(`ZodNever`,(e,t)=>{Sn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r)});function Ua(e){return Br(Ha,e)}const Wa=n(`ZodArray`,(e,t)=>{wn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r),e.element=t.element,ca(e,`ZodArray`,{min(e,t){return this.check(qr(e,t))},nonempty(e){return this.check(qr(1,e))},max(e,t){return this.check(Kr(e,t))},length(e,t){return this.check(Jr(e,t))},unwrap(){return this.element}})});function E(e,t){return si(Wa,e,t)}const Ga=n(`ZodObject`,(e,t)=>{kn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),m(e,`shape`,()=>t.shape),ca(e,`ZodObject`,{keyof(){return to(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Va()})},loose(){return this.clone({...this._zod.def,catchall:Va()})},strict(){return this.clone({...this._zod.def,catchall:Ua()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ge(this,e)},safeExtend(e){return _e(this,e)},merge(e){return ve(this,e)},pick(e){return me(this,e)},omit(e){return he(this,e)},partial(...e){return ye(ao,this,e[0])},required(...e){return be(go,this,e[0])}})});function D(e,t){return new Ga({type:`object`,shape:e??{},...h(t)})}const Ka=n(`ZodUnion`,(e,t)=>{jn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.options=t.options});function qa(e,t){return new Ka({type:`union`,options:e,...h(t)})}const Ja=n(`ZodDiscriminatedUnion`,(e,t)=>{Ka.init(e,t),Mn.init(e,t)});function Ya(e,t,n){return new Ja({type:`union`,options:t,discriminator:e,...h(n)})}const Xa=n(`ZodIntersection`,(e,t)=>{Nn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r)});function Za(e,t){return new Xa({type:`intersection`,left:e,right:t})}const Qa=n(`ZodRecord`,(e,t)=>{In.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function $a(e,t,n){return!t||!t._zod?new Qa({type:`record`,keyType:w(),valueType:e,...h(t)}):new Qa({type:`record`,keyType:e,valueType:t,...h(n)})}const eo=n(`ZodEnum`,(e,t)=>{Ln.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(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 eo({...t,checks:[],...h(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 eo({...t,checks:[],...h(r),entries:i})}});function to(e,t){return new eo({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...h(t)})}function O(e,t){return new eo({type:`enum`,entries:e,...h(t)})}const no=n(`ZodLiteral`,(e,t)=>{Rn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(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 k(e,t){return new no({type:`literal`,values:Array.isArray(e)?e:[e],...h(t)})}const ro=n(`ZodTransform`,(e,t)=>{zn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new i(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ee(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Ee(t))}};let a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=a,n.fallback=!0,n)}});function io(e){return new ro({type:`transform`,transform:e})}const ao=n(`ZodOptional`,(e,t)=>{Vn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function oo(e){return new ao({type:`optional`,innerType:e})}const so=n(`ZodExactOptional`,(e,t)=>{Hn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function co(e){return new so({type:`optional`,innerType:e})}const lo=n(`ZodNullable`,(e,t)=>{Un.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uo(e){return new lo({type:`nullable`,innerType:e})}const fo=n(`ZodDefault`,(e,t)=>{Wn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function po(e,t){return new fo({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ce(t)}})}const mo=n(`ZodPrefault`,(e,t)=>{Kn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ho(e,t){return new mo({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ce(t)}})}const go=n(`ZodNonOptional`,(e,t)=>{qn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _o(e,t){return new go({type:`nonoptional`,innerType:e,...h(t)})}const vo=n(`ZodCatch`,(e,t)=>{Yn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function yo(e,t){return new vo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const bo=n(`ZodPipe`,(e,t)=>{Xn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Li(e,t,n,r),e.in=t.in,e.out=t.out});function xo(e,t){return new bo({type:`pipe`,in:e,out:t})}const So=n(`ZodReadonly`,(e,t)=>{Qn.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ri(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Co(e){return new So({type:`readonly`,innerType:e})}const wo=n(`ZodLazy`,(e,t)=>{er.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bi(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function To(e){return new wo({type:`lazy`,getter:e})}const Eo=n(`ZodCustom`,(e,t)=>{tr.init(e,t),C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r)});function Do(e,t={}){return ci(Eo,e,t)}function Oo(e,t){return li(e,t)}const A=To(()=>qa([w(),ja(),Fa(),za(),E(A),$a(w(),A)])),j={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 ko;(function(e){})(ko||={});const Ao={REVIEW_LIST_PENDING:`review.list_pending`,REVIEW_GET:`review.get`};let jo=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}({}),Mo=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}({}),No=function(e){return e.DOCUMENT=`document`,e.IMAGE=`image`,e.AUDIO=`audio`,e.VIDEO=`video`,e.OTHER=`other`,e}({});const Po=D({type:w().trim().min(1)}).catchall(A),Fo=D({version:k(1),blocks:E(Po)}),Io=D({type:k(`opening-options`),data:D({text:w().trim().max(500),instruction:w().trim().max(2e3).optional(),file:D({types:E(O(No)).min(1).max(5),otherExtensions:E(w().trim().min(1).max(24)).max(50).optional()}).optional()})}),Lo=D({hints:Fo.optional(),options:E(Io).max(20).optional()}),Ro=D({version:k(`1.0.0`),name:w().trim().max(128),description:w().trim().max(500),icon:O(jo),background:O(Mo),nodes:E(D({id:w().trim().min(1),position:D({x:ja().finite(),y:ja().finite()}),data:D({type:k(`task`),icon:O(jo),background:O(Mo),title:w().trim().min(1).max(30),instructions:w().max(1e5),conversation_opener:Lo.optional()})})),edges:E(D({id:w().trim().min(1),source:w().trim().min(1),target:w().trim().min(1)}))}).superRefine((e,t)=>{let n=new Set;for(let r of e.nodes)n.has(r.id)&&t.addIssue({code:j.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:j.custom,message:`Duplicate edge id`,path:[`edges`]}),r.add(o.id),o.source===o.target&&t.addIssue({code:j.custom,message:`Edge cannot connect a node to itself`,path:[`edges`]}),(!n.has(o.source)||!n.has(o.target))&&t.addIssue({code:j.custom,message:`Edge endpoint is missing`,path:[`edges`]});let e=(i.get(o.target)??0)+1;e>1&&t.addIssue({code:j.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:j.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)}),zo=D({id:w().trim().min(1),graph:Ro});let Bo=function(e){return e.TRANSLATE=`translate`,e.FAST_MODE=`fast_mode`,e.BALANCED_MODE=`balanced_mode`,e.MAX_MODE=`max_mode`,e.DOWNSTREAM_COMPLETION_SUMMARY=`downstream_completion_summary`,e.PROJECT_TEMPLATE_INSTRUCTION_GENERATION=`project_template_instruction_generation`,e.TASK_TITLE_GENERATION=`task_title_generation`,e.GUARDRAIL=`guardrail`,e}({}),Vo=function(e){return e.OPENAI=`openai`,e.ANTHROPIC=`anthropic`,e.BEDROCK=`bedrock`,e.OPENROUTER=`openrouter`,e.OPENAI_COMPATIBLE=`openai-compatible`,e.DEEPSEEK=`deepseek`,e}({});const M={API_KEY:`apiKey`,BASE_URL:`baseUrl`,ORGANIZATION:`organization`,REGION:`region`,VALIDATION_MODEL:`validationModel`},N={SECURE:`secure`,TEXT:`text`,JSON:`json`},Ho={openrouter:{provider:`openrouter`,label:`OpenRouter`,sortOrder:10,fields:[{name:M.API_KEY,label:`API key`,type:N.SECURE,required:!0},{name:M.BASE_URL,label:`Custom API endpoint URL`,type:N.TEXT,required:!1,placeholder:`https://openrouter.ai/api/v1`},{name:M.VALIDATION_MODEL,label:`Validation model`,type:N.TEXT,required:!1,defaultValue:`anthropic/claude-haiku-4.5`}]},openai:{provider:`openai`,label:`OpenAI`,sortOrder:20,fields:[{name:M.API_KEY,label:`API key`,type:N.SECURE,required:!0},{name:M.BASE_URL,label:`Custom API endpoint URL`,type:N.TEXT,required:!1,placeholder:`https://api.openai.com/v1`},{name:M.ORGANIZATION,label:`Organization`,type:N.TEXT,required:!1},{name:M.VALIDATION_MODEL,label:`Validation model`,type:N.TEXT,required:!1,defaultValue:`gpt-5.5`}]},anthropic:{provider:`anthropic`,label:`Anthropic`,sortOrder:30,fields:[{name:M.API_KEY,label:`API key`,type:N.SECURE,required:!0},{name:M.BASE_URL,label:`Custom API endpoint URL`,type:N.TEXT,required:!1,placeholder:`https://api.anthropic.com`},{name:M.VALIDATION_MODEL,label:`Validation model`,type:N.TEXT,required:!1,defaultValue:`claude-haiku-4-5`}]},bedrock:{provider:`bedrock`,label:`Bedrock`,sortOrder:40,fields:[{name:M.API_KEY,label:`API key`,type:N.SECURE,required:!0},{name:M.BASE_URL,label:`Custom API endpoint URL`,type:N.TEXT,required:!1,placeholder:`https://bedrock-runtime.{region}.amazonaws.com`},{name:M.REGION,label:`AWS region`,type:N.TEXT,required:!0,defaultValue:`us-east-1`},{name:M.VALIDATION_MODEL,label:`Validation model`,type:N.TEXT,required:!1,defaultValue:`global.anthropic.claude-haiku-4-5-20251001-v1:0`}]},"openai-compatible":{provider:`openai-compatible`,label:`OpenAI Compatible`,sortOrder:50,fields:[{name:M.API_KEY,label:`API key`,type:N.SECURE,required:!0},{name:M.BASE_URL,label:`API endpoint URL`,type:N.TEXT,required:!0,placeholder:`https://api.example.com/v1`},{name:M.VALIDATION_MODEL,label:`Validation model`,type:N.TEXT,required:!0,placeholder:`provider/model-id`}]},deepseek:{provider:`deepseek`,label:`DeepSeek`,sortOrder:60,fields:[{name:M.API_KEY,label:`API key`,type:N.SECURE,required:!0},{name:M.BASE_URL,label:`Custom API endpoint URL`,type:N.TEXT,required:!1,defaultValue:`https://api.deepseek.com`},{name:M.VALIDATION_MODEL,label:`Validation model`,type:N.TEXT,required:!1,defaultValue:`deepseek-v4-flash`}]}};Object.values(Ho).sort((e,t)=>e.sortOrder-t.sortOrder);let Uo=function(e){return e.CLAUDE_TOKEN=`claude_token`,e.OPENAI_TOKEN=`openai_token`,e.DEEPSEEK_TOKEN=`deepseek_token`,e.GEMINI_TOKEN=`gemini_token`,e}({}),Wo=function(e){return e.CLAUDE=`claude`,e.OPENAI=`openai`,e.GEMINI=`gemini`,e.DEEPSEEK=`deepseek`,e.CUSTOM=`custom`,e}({});const Go=$a(w(),A),Ko=D({contextWindowTokens:ja().int().positive(),compactionThresholdRatio:ja().min(0).max(1)}),qo=Ko.extend({type:k(`prompt`)}).strict(),Jo=Ya(`type`,[qo,Ko.extend({type:k(`native`)}).strict()]),Yo=D({modelId:w().trim().min(1),context:Jo,parameters:Go.optional()}).strict(),Xo=Yo.extend({family:O(Wo)}).strict(),Zo=D({calculatorMethod:O(Uo),pricing:$a(w(),A)}).strict(),Qo=D({provider:O(Vo),modelConfig:Xo}).strict().extend({billingConfig:Zo}).strict(),$o=D({translate:w().trim().min(1),fast_mode:w().trim().min(1),balanced_mode:w().trim().min(1),max_mode:w().trim().min(1),downstream_completion_summary:w().trim().min(1),project_template_instruction_generation:w().trim().min(1),task_title_generation:w().trim().min(1),guardrail:w().trim().min(1)});function es(e,t){for(let[n,r]of Object.entries(e.scenarios))e.models[r]||t.addIssue({code:j.custom,message:`Scenario references missing model config: ${r}`,path:[`scenarios`,n]});for(let[n,r]of Object.entries(e.models))r.modelConfig.family===`custom`&&t.addIssue({code:j.custom,message:`Platform model config cannot use custom family`,path:[`models`,n,`modelConfig`,`family`]})}const ts=D({version:k(1),scenarios:$o,models:$a(w().trim().min(1),Qo)}).strict().superRefine(es);D({expectedRevision:w().nullable(),config:ts});const ns=D({temperature:ja().min(0).max(2)}).strict(),rs=D({modelId:w().trim().min(1),context:qo.optional(),customConfig:ns.optional()}).strict(),is=D({credentialId:w().trim().min(1),modelConfig:rs}).strict(),as=D({translate:is.optional(),fast_mode:is.optional(),balanced_mode:is.optional(),max_mode:is.optional(),downstream_completion_summary:is.optional(),project_template_instruction_generation:is.optional(),task_title_generation:is.optional(),guardrail:is.optional()}).strict();D({enabled:Fa(),scenarioRoutes:as}).strict(),D({templates:E(zo)}).superRefine((e,t)=>{os(e.templates,t)}),D({expectedRevision:w().nullable(),templates:E(zo)}).superRefine((e,t)=>{os(e.templates,t)});function os(e,t){let n=new Set;for(let r of e)n.has(r.id)&&t.addIssue({code:j.custom,message:`Duplicate template blueprint id`,path:[`templates`]}),n.add(r.id)}const ss={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_RENAME:`task.rename`,TASK_CONVERT_TO_PROJECT:`task.convert_to_project`,TASK_OWN_DOWNSTREAM_CREATE:`task.own_downstream.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`},cs=to([`human`,`agent`]),ls=D({version:k(1),scenario:O(Bo),provider:O(Vo),model_id:w().trim().min(1),model_family:O(Wo),model_config:Yo}),us=Ya(`owner`,[ls.extend({owner:k(`platform`),platform_model_config_id:w().trim().min(1)}).catchall(A),ls.extend({owner:k(`workspace`),credential_id:w().trim().min(1)}).catchall(A)]),ds=D({message_origin:cs.optional(),llm_route:us.optional()}).catchall(A);D({type:k(`text`),text:w()});const fs={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`,WORKSPACE_LLM_CREDENTIALS_LIST:`workspace.llmCredentials.list`,WORKSPACE_LLM_CREDENTIAL_CREATE:`workspace.llmCredential.create`,WORKSPACE_LLM_CREDENTIAL_UPDATE:`workspace.llmCredential.update`,WORKSPACE_LLM_CREDENTIAL_DELETE:`workspace.llmCredential.delete`,WORKSPACE_LLM_DEFAULT_MODELS_LIST:`workspace.llmDefaultModels.list`,WORKSPACE_LLM_SETTINGS_GET:`workspace.llmSettings.get`,WORKSPACE_LLM_SETTINGS_UPDATE:`workspace.llmSettings.update`,WORKSPACE_LLM_ROUTE_TEST:`workspace.llmRoute.test`},ps={AUTH_LOGIN_JWT:`auth:login:jwt`,CONNECTION_ACK:`connection.ack`,CONNECTION_EVENT_FILTER_SET:`connection.event_filter.set`},ms={CONNECTION_HEARTBEAT:`connection.heartbeat`},hs={PREFERENCES_GET:`preferences.get`,PREFERENCES_UPDATE:`preferences.update`},gs={USER_PIPELINE_SETTING_GET:`user.pipeline.setting.get`,USER_PIPELINE_SETTING_UPDATE:`user.pipeline.setting.update`},_s={displayName:`Syncless`,slug:`syncless`,domain:`syncless.ai`,apiBaseHost:`api.syncless.ai`},vs={web:`${_s.displayName} Web`,desktop:`${_s.displayName} Desktop`,mobile:`${_s.displayName} Mobile`,browserExtension:`${_s.displayName} Browser`},ys={command:`syncless`,envPrefix:`SYNCLESS`},bs={scope:`@langgenius`,launcherPackageName:`@langgenius/syncless`,platformPackagePrefix:`@langgenius/syncless-`},xs=_s.displayName;_s.slug,vs.web,ys.command,bs.launcherPackageName;const Ss={USER_FACING:`user_facing`},Cs={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`},ws={SEND_FAILED:`send_failed`},Ts={RPC_ERROR_CLASS:`rpc_error_class`,RPC_RESULT:`rpc_result`,TRANSPORT_PHASE:`transport_phase`},Es={HEARTBEAT_TIMEOUT:`heartbeat_timeout`},Ds={finish:()=>{}},Os=()=>({setContext:()=>{},setFingerprint:()=>{},setLevel:()=>{},setTag:()=>{},setUser:()=>{}}),ks=()=>({addBreadcrumb:e=>{},captureException:e=>{},destroy:async()=>{},enabled:!1,flush:async()=>!0,flushReplay:async()=>!1,init:async()=>{},startInactiveSpan:e=>Ds,withScope:e=>e(Os())}),As=e=>{if(!e)return;let t={};for(let[n,r]of Object.entries(e))r!=null&&(t[n]=r);return t},js=e=>typeof e==`string`?e:String(e),Ms=e=>{let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t},Ns=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}}},Ps=(e,t,n)=>{let r=Ms(n);if(Object.keys(r).length===0){delete e.contexts[t];return}e.contexts[t]=r},Fs=(e,t)=>{delete e.contexts[t]},Is=(e,t,n)=>{if(n==null||n===``){delete e.tags[t];return}e.tags[t]=js(n)},Ls=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,Rs=/^[a-f0-9]{16,}$/i,zs=/^\d{4,}$/,Bs=new Set([`access_token`,`code`,`jwt`,`refresh_token`,`session`,`signature`,`state`,`token`]),Vs=new Set([`authorization`,`cookie`,`set-auth-token`,`set-cookie`,`x-api-key`,`x-auth-token`,`x-csrf-token`]),Hs=e=>e&&(Ls.test(e)?`:uuid`:zs.test(e)?`:id`:Rs.test(e)?`:hash`:e),Us=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`forEach`in e&&typeof e.forEach==`function`,Ws=e=>{if(!e)return[];if(Us(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)]])},Gs=e=>{let t={};for(let[n,r]of Ws(e)){let e=n.toLowerCase();Vs.has(e)||(t[e]=r)}return t},Ks=e=>{try{let t=new URL(e);t.username=``,t.password=``,t.hash=``,t.pathname=t.pathname.split(`/`).map(Hs).join(`/`);let n=new URLSearchParams;return t.searchParams.forEach((e,t)=>{Bs.has(t.toLowerCase())||n.append(t,e)}),t.search=n.toString(),t.toString()}catch{let[t]=e.split(`?`);return t??e}},qs=(e,t=512)=>e.length<=t?e:`${e.slice(0,t)}…`,Js=e=>e<=0?!1:e>=1?!0:Math.random()<e,Ys=`cancelled`,Xs=e=>e.errorClass===Ss.USER_FACING?`warning`:`error`,Zs=e=>!(e.status===`ok`||e.status===Ys||e.status===ws.SEND_FAILED),Qs=e=>{switch(e){case`ok`:return`ok`;case Ys:return`cancelled`;case`timeout`:return`deadline_exceeded`;case ws.SEND_FAILED:return`internal_error`;default:return`internal_error`}},$s=e=>e instanceof Error?e:Error(qs(typeof e==`string`?e:`Unknown frontend stability error`)),ec=e=>e??`info`,tc=(e,t)=>{let n=e.flushTimeoutMs??1500,r=Ns(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=As({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`&&!Js(n??.2)||t.addBreadcrumb({...r,level:ec(r.level)})};return{addBreadcrumb:e=>{o(e)},captureException:(e,n)=>{t.enabled&&i(n,()=>{t.captureException($s(e))})},clearScopeContext:e=>{Fs(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:Qs(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($s(a))})}}}}),createNetworkPort:()=>({onHeartbeatTimeout:({error:e,intervalMs:t})=>{o({category:`ws.heartbeat`,data:{intervalMs:t,[Ts.TRANSPORT_PHASE]:Es.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:{[Ts.RPC_RESULT]:a.status,...a.code?{rpc_code:a.code}:{},...a.domain?{rpc_domain:a.domain}:{},...a.errorClass?{[Ts.RPC_ERROR_CLASS]:a.errorClass}:{}},status:Qs(a.status)}),a.status!==`ok`){if(!Zs(a)){o({category:`rpc.lifecycle`,data:{channel:e,...a.errorClass?{errorClass:a.errorClass}:{},[Ts.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:Xs(a),tags:{rpc_channel:e,[Ts.RPC_RESULT]:a.status,...a.code?{rpc_code:a.code}:{},...a.domain?{rpc_domain:a.domain}:{},...a.errorClass?{[Ts.RPC_ERROR_CLASS]:a.errorClass}:{}}},()=>{t.captureException($s(a.error))})}}}},onTransportError:({error:e,phase:n})=>{i({contexts:{transport:{phase:n}},level:`error`,tags:{[Ts.TRANSPORT_PHASE]:n}},()=>{t.captureException($s(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:Qs(a)}),a===`error`&&i({contexts:{transport:{kind:e}},level:`error`,tags:{ws_kind:e,ws_result:a}},()=>{t.captureException($s(r))})}}},onWsEvent:({channel:e})=>{Js(.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)=>{Ps(r,e,t)},setTag:(e,t)=>{Is(r,e,t)},setUser:e=>{r.user=e},startSpan:a}};function nc(e,t){if(typeof e!=`string`)throw TypeError(`Expected string, received ${e===null?`null`:typeof e}`);return t(e)}function rc(e){return nc(e,e=>e.trim().toLowerCase())}function ic(e){return nc(e,e=>e.trim().toUpperCase())}const ac=e=>e.length===0?[ks()]:e,oc=e=>{let t=ac(e);return t.find(e=>e.enabled)??t[0]??ks()},sc=e=>{let t=ac(e),n=oc(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 ks().startInactiveSpan(e)}},withScope:e=>{let t=e;try{return n.withScope(t)}catch{return ks().withScope(t)}}}};let cc=function(e){return e.NOOP=`noop`,e.POSTHOG_BROWSER=`posthog-browser`,e.POSTHOG_REACT_NATIVE=`posthog-react-native`,e.SENTRY=`sentry`,e}({});const lc=new Set(Object.values(cc)),uc=(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=rc(e);if(!t)continue;if(!lc.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:[]}},dc=e=>{let t={};for(let[n,r]of Object.entries(e))r==null||r===``||(t[n]=r);return t},fc=e=>Object.keys(e).length>0,pc=(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=dc({deviceCode:t.deviceCode,environmentId:t.environmentId,memberId:t.memberId,pipelineId:t.pipelineId,taskId:t.taskId,workspaceId:t.workspaceId});fc(n)?e.setScopeContext(`echo`,n):e.clearScopeContext(`echo`);let r=dc({authPhase:t.authPhase,commandName:t.commandName,cwd:t.cwd,interactive:t.interactive,routeTemplate:t.routeTemplate,routeView:t.routeView,screen:t.screen});fc(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})},mc={finish:()=>{}},hc={finish:()=>{}},gc={finish:()=>{}},_c=()=>({onHeartbeatTimeout:()=>{},onRpcStart:()=>mc,onTransportError:()=>{},onWsConnectStart:()=>hc,onWsEvent:()=>{},onWsStatusChange:()=>{}}),vc=()=>({onRequestStart:()=>gc}),yc=/^[^@]+@([^+]+)(?:\+.+)?$/,bc=e=>{if(!e)return;let t=yc.exec(e.trim())?.[1]?.trim();if(t)return t},xc=/\/+$/,P=e=>e.replace(xc,``),Sc=e=>e instanceof Request?e.url:e instanceof URL?e.toString():e,Cc=(e,t)=>t?.method?t.method:e instanceof Request?e.method:`GET`,wc=(e={})=>{let t=e.fetchImpl??fetch,n=e.observability??vc(),r=e.kind??`http`;return async(e,i)=>{let a=Ks(Sc(e)),o=Cc(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}}};var Tc;function F(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 Ec=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Dc=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Tc=globalThis).__zod_globalConfig??(Tc.__zod_globalConfig={});const Oc=globalThis.__zod_globalConfig;function I(e){return e&&Object.assign(Oc,e),Oc}function kc(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 Ac(e,t){return typeof t==`bigint`?t.toString():t}function jc(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Mc(e){return e==null}function Nc(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Pc(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}const Fc=Symbol(`evaluating`);function L(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Fc)return r===void 0&&(r=Fc,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ic(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Lc(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Rc(e){return JSON.stringify(e)}function zc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Bc=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Vc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const Hc=jc(()=>{if(Oc.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Uc(e){if(Vc(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Vc(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Wc(e){return Uc(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Gc=new Set([`string`,`number`,`symbol`]);function Kc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function qc(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function R(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 Jc(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const Yc={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Xc(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 qc(e,Lc(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 Ic(this,`shape`,e),e},checks:[]}))}function Zc(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 qc(e,Lc(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 Ic(this,`shape`,r),r},checks:[]}))}function Qc(e,t){if(!Uc(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 qc(e,Lc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ic(this,`shape`,n),n}}))}function $c(e,t){if(!Uc(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return qc(e,Lc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ic(this,`shape`,n),n}}))}function el(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return qc(e,Lc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Ic(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function tl(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 qc(t,Lc(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 Ic(this,`shape`,i),i},checks:[]}))}function nl(e,t,n){return qc(t,Lc(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 Ic(this,`shape`,i),i}}))}function rl(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 il(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function al(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ol(e){return typeof e==`string`?e:e?.message}function z(e,t,n){let r=e.message?e.message:ol(e.inst?._zod.def?.error?.(e))??ol(t?.error?.(e))??ol(n.customError?.(e))??ol(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function sl(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function cl(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const ll=(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,Ac,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},ul=F(`$ZodError`,ll),dl=F(`$ZodError`,ll,{Parent:Error});function fl(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 pl(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}const ml=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Ec;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>z(e,a,I())));throw Bc(t,i?.callee),t}return o.value},hl=e=>async(t,n,r,i)=>{let a=r?{...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=>z(e,a,I())));throw Bc(t,i?.callee),t}return o.value},gl=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 Ec;return a.issues.length?{success:!1,error:new(e??ul)(a.issues.map(e=>z(e,i,I())))}:{success:!0,data:a.value}},_l=gl(dl),vl=e=>async(t,n,r)=>{let i=r?{...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=>z(e,i,I())))}:{success:!0,data:a.value}},yl=vl(dl),bl=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ml(e)(t,n,i)},xl=e=>(t,n,r)=>ml(e)(t,n,r),Sl=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return hl(e)(t,n,i)},Cl=e=>async(t,n,r)=>hl(e)(t,n,r),wl=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return gl(e)(t,n,i)},Tl=e=>(t,n,r)=>gl(e)(t,n,r),El=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return vl(e)(t,n,i)},Dl=e=>async(t,n,r)=>vl(e)(t,n,r),Ol=/^[cC][0-9a-z]{6,}$/,kl=/^[0-9a-z]+$/,Al=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,jl=/^[0-9a-vA-V]{20}$/,Ml=/^[A-Za-z0-9]{27}$/,Nl=/^[a-zA-Z0-9_-]{21}$/,Pl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Fl=/^([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})$/,Il=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)$/,Ll=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function Rl(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const zl=/^(?:(?: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])$/,Bl=/^(([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}|:))$/,Vl=/^((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])$/,Hl=/^(([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])$/,Ul=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Wl=/^[A-Za-z0-9_-]*$/,Gl=/^https?$/,Kl=/^\+[1-9]\d{6,14}$/,ql=`(?:(?:\\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])))`,Jl=RegExp(`^${ql}$`);function Yl(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 Xl(e){return RegExp(`^${Yl(e)}$`)}function Zl(e){let t=Yl({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(`^${ql}T(?:${r})$`)}const Ql=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},$l=/^-?\d+$/,eu=/^-?\d+(?:\.\d+)?$/,tu=/^(?:true|false)$/i,nu=/^null$/i,ru=/^[^A-Z]*$/,iu=/^[^a-z]*$/,B=F(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),au={number:`number`,bigint:`bigint`,object:`date`},ou=F(`$ZodCheckLessThan`,(e,t)=>{B.init(e,t);let n=au[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})}}),su=F(`$ZodCheckGreaterThan`,(e,t)=>{B.init(e,t);let n=au[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})}}),cu=F(`$ZodCheckMultipleOf`,(e,t)=>{B.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):Pc(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})}}),lu=F(`$ZodCheckNumberFormat`,(e,t)=>{B.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Yc[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=$l)}),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})}}),uu=F(`$ZodCheckMaxLength`,(e,t)=>{var n;B.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Mc(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=sl(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),du=F(`$ZodCheckMinLength`,(e,t)=>{var n;B.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Mc(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=sl(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fu=F(`$ZodCheckLengthEquals`,(e,t)=>{var n;B.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Mc(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=sl(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})}}),pu=F(`$ZodCheckStringFormat`,(e,t)=>{var n,r;B.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=()=>{})}),mu=F(`$ZodCheckRegex`,(e,t)=>{pu.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})}}),hu=F(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=ru,pu.init(e,t)}),gu=F(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=iu,pu.init(e,t)}),_u=F(`$ZodCheckIncludes`,(e,t)=>{B.init(e,t);let n=Kc(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})}}),vu=F(`$ZodCheckStartsWith`,(e,t)=>{B.init(e,t);let n=RegExp(`^${Kc(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})}}),yu=F(`$ZodCheckEndsWith`,(e,t)=>{B.init(e,t);let n=RegExp(`.*${Kc(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})}}),bu=F(`$ZodCheckOverwrite`,(e,t)=>{B.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var xu=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(`
67
- `).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(`
68
- `))}};const Su={major:4,minor:4,patch:3},V=F(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Su;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=rl(e),i;for(let a of t){if(a._zod.def.when){if(il(e)||!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 Ec;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=rl(e,t))});else{if(e.issues.length===t)continue;r||=rl(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(rl(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Ec;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 Ec;return o.then(e=>t(e,r,a))}return t(o,r,a)}}L(e,`~standard`,()=>({validate:t=>{try{let n=_l(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return yl(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Cu=F(`$ZodString`,(e,t)=>{V.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ql(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}}),H=F(`$ZodStringFormat`,(e,t)=>{pu.init(e,t),Cu.init(e,t)}),wu=F(`$ZodGUID`,(e,t)=>{t.pattern??=Fl,H.init(e,t)}),Tu=F(`$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??=Il(e)}else t.pattern??=Il();H.init(e,t)}),Eu=F(`$ZodEmail`,(e,t)=>{t.pattern??=Ll,H.init(e,t)}),Du=F(`$ZodURL`,(e,t)=>{H.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Gl.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let 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})}}}),Ou=F(`$ZodEmoji`,(e,t)=>{t.pattern??=Rl(),H.init(e,t)}),ku=F(`$ZodNanoID`,(e,t)=>{t.pattern??=Nl,H.init(e,t)}),Au=F(`$ZodCUID`,(e,t)=>{t.pattern??=Ol,H.init(e,t)}),ju=F(`$ZodCUID2`,(e,t)=>{t.pattern??=kl,H.init(e,t)}),Mu=F(`$ZodULID`,(e,t)=>{t.pattern??=Al,H.init(e,t)}),Nu=F(`$ZodXID`,(e,t)=>{t.pattern??=jl,H.init(e,t)}),Pu=F(`$ZodKSUID`,(e,t)=>{t.pattern??=Ml,H.init(e,t)}),Fu=F(`$ZodISODateTime`,(e,t)=>{t.pattern??=Zl(t),H.init(e,t)}),Iu=F(`$ZodISODate`,(e,t)=>{t.pattern??=Jl,H.init(e,t)}),Lu=F(`$ZodISOTime`,(e,t)=>{t.pattern??=Xl(t),H.init(e,t)}),Ru=F(`$ZodISODuration`,(e,t)=>{t.pattern??=Pl,H.init(e,t)}),zu=F(`$ZodIPv4`,(e,t)=>{t.pattern??=zl,H.init(e,t),e._zod.bag.format=`ipv4`}),Bu=F(`$ZodIPv6`,(e,t)=>{t.pattern??=Bl,H.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})}}}),Vu=F(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Vl,H.init(e,t)}),Hu=F(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Hl,H.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 Uu(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Wu=F(`$ZodBase64`,(e,t)=>{t.pattern??=Ul,H.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Uu(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Gu(e){if(!Wl.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Uu(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Ku=F(`$ZodBase64URL`,(e,t)=>{t.pattern??=Wl,H.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Gu(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),qu=F(`$ZodE164`,(e,t)=>{t.pattern??=Kl,H.init(e,t)});function Ju(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 Yu=F(`$ZodJWT`,(e,t)=>{H.init(e,t),e._zod.check=n=>{Ju(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Xu=F(`$ZodNumber`,(e,t)=>{V.init(e,t),e._zod.pattern=e._zod.bag.pattern??eu,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}}),Zu=F(`$ZodNumberFormat`,(e,t)=>{lu.init(e,t),Xu.init(e,t)}),Qu=F(`$ZodBoolean`,(e,t)=>{V.init(e,t),e._zod.pattern=tu,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}}),$u=F(`$ZodNull`,(e,t)=>{V.init(e,t),e._zod.pattern=nu,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}}),ed=F(`$ZodUnknown`,(e,t)=>{V.init(e,t),e._zod.parse=e=>e}),td=F(`$ZodNever`,(e,t)=>{V.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function nd(e,t,n){e.issues.length&&t.issues.push(...al(n,e.issues)),t.value[n]=e.value}const rd=F(`$ZodArray`,(e,t)=>{V.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=>nd(t,n,e))):nd(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function id(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...al(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function ad(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=Jc(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function od(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||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=>id(e,n,i,t,u,d))):id(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const sd=F(`$ZodObject`,(e,t)=>{if(V.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=jc(()=>ad(t));L(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=Vc,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.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>id(n,t,e,s,r,i))):id(a,t,e,s,r,i)}return i?od(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),cd=F(`$ZodObjectJIT`,(e,t)=>{sd.init(e,t);let n=e._zod.parse,r=jc(()=>ad(t)),i=e=>{let t=new xu([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Rc(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=Rc(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
69
- if (${n}.issues.length) {
70
- if (${o} in input) {
71
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
72
- ...iss,
73
- path: iss.path ? [${o}, ...iss.path] : [${o}]
74
- })));
75
- }
76
- }
77
-
78
- if (${n}.value === undefined) {
79
- if (${o} in input) {
80
- newResult[${o}] = undefined;
81
- }
82
- } else {
83
- newResult[${o}] = ${n}.value;
84
- }
85
-
86
- `):c?t.write(`
87
- if (${n}.issues.length) {
88
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
89
- ...iss,
90
- path: iss.path ? [${o}, ...iss.path] : [${o}]
91
- })));
92
- }
93
-
94
- if (${n}.value === undefined) {
95
- if (${o} in input) {
96
- newResult[${o}] = undefined;
97
- }
98
- } else {
99
- newResult[${o}] = ${n}.value;
100
- }
101
-
102
- `):t.write(`
103
- const ${n}_present = ${o} in input;
104
- if (${n}.issues.length) {
105
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
106
- ...iss,
107
- path: iss.path ? [${o}, ...iss.path] : [${o}]
108
- })));
109
- }
110
- if (!${n}_present && !${n}.issues.length) {
111
- payload.issues.push({
112
- code: "invalid_type",
113
- expected: "nonoptional",
114
- input: undefined,
115
- path: [${o}]
116
- });
117
- }
118
-
119
- if (${n}_present) {
120
- if (${n}.value === undefined) {
121
- newResult[${o}] = undefined;
122
- } else {
123
- newResult[${o}] = ${n}.value;
124
- }
125
- }
126
-
127
- `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Vc,s=!Oc.jitless,c=s&&Hc.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?od([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function ld(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=>!rl(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=>z(e,r,I())))}),t)}const ud=F(`$ZodUnion`,(e,t)=>{V.init(e,t),L(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),L(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),L(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),L(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=>Nc(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>ld(t,r,e,i)):ld(o,r,e,i)}}),dd=F(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,ud.init(e,t);let n=e._zod.parse;L(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=jc(()=>{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(!Vc(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),fd=F(`$ZodIntersection`,(e,t)=>{V.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>md(e,t,n)):md(e,i,a)}});function pd(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Uc(e)&&Uc(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=pd(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=pd(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 md(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}),rl(e))return e;let o=pd(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const hd=F(`$ZodRecord`,(e,t)=>{V.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Uc(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 c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>z(e,r,I())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...al(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...al(c,u.issues)),n.value[l]=u.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__`||!Object.prototype.propertyIsEnumerable.call(i,o))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`&&eu.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=>z(e,r,I())),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(...al(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...al(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),gd=F(`$ZodEnum`,(e,t)=>{V.init(e,t);let n=kc(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Gc.has(typeof e)).map(e=>typeof e==`string`?Kc(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}}),_d=F(`$ZodLiteral`,(e,t)=>{if(V.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Kc(e):e?Kc(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}}),vd=F(`$ZodTransform`,(e,t)=>{V.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Dc(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.fallback=!0,n));if(i instanceof Promise)throw new Ec;return n.value=i,n.fallback=!0,n}});function yd(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const bd=F(`$ZodOptional`,(e,t)=>{V.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,L(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),L(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Nc(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>yd(e,r)):yd(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),xd=F(`$ZodExactOptional`,(e,t)=>{bd.init(e,t),L(e._zod,`values`,()=>t.innerType._zod.values),L(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Sd=F(`$ZodNullable`,(e,t)=>{V.init(e,t),L(e._zod,`optin`,()=>t.innerType._zod.optin),L(e._zod,`optout`,()=>t.innerType._zod.optout),L(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Nc(e.source)}|null)$`):void 0}),L(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)}),Cd=F(`$ZodDefault`,(e,t)=>{V.init(e,t),e._zod.optin=`optional`,L(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=>wd(e,t)):wd(r,t)}});function wd(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Td=F(`$ZodPrefault`,(e,t)=>{V.init(e,t),e._zod.optin=`optional`,L(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))}),Ed=F(`$ZodNonOptional`,(e,t)=>{V.init(e,t),L(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=>Dd(t,e)):Dd(i,e)}});function Dd(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 Od=F(`$ZodCatch`,(e,t)=>{V.init(e,t),e._zod.optin=`optional`,L(e._zod,`optout`,()=>t.innerType._zod.optout),L(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=>z(e,n,I()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>z(e,n,I()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),kd=F(`$ZodPipe`,(e,t)=>{V.init(e,t),L(e._zod,`values`,()=>t.in._zod.values),L(e._zod,`optin`,()=>t.in._zod.optin),L(e._zod,`optout`,()=>t.out._zod.optout),L(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=>Ad(e,t.in,n)):Ad(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ad(e,t.out,n)):Ad(r,t.out,n)}});function Ad(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const jd=F(`$ZodPreprocess`,(e,t)=>{kd.init(e,t)}),Md=F(`$ZodReadonly`,(e,t)=>{V.init(e,t),L(e._zod,`propValues`,()=>t.innerType._zod.propValues),L(e._zod,`values`,()=>t.innerType._zod.values),L(e._zod,`optin`,()=>t.innerType?._zod?.optin),L(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(Nd):Nd(r)}});function Nd(e){return e.value=Object.freeze(e.value),e}const Pd=F(`$ZodLazy`,(e,t)=>{V.init(e,t),L(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),L(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),L(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),L(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),L(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Fd=F(`$ZodCustom`,(e,t)=>{B.init(e,t),V.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Id(t,n,r,e));Id(i,n,r,e)}});function Id(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(cl(e))}}var Ld,Rd=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 zd(){return new Rd}(Ld=globalThis).__zod_globalRegistry??(Ld.__zod_globalRegistry=zd());const Bd=globalThis.__zod_globalRegistry;function Vd(e,t){return new e({type:`string`,...R(t)})}function Hd(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...R(t)})}function Ud(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...R(t)})}function Wd(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...R(t)})}function Gd(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...R(t)})}function Kd(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...R(t)})}function qd(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...R(t)})}function Jd(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...R(t)})}function Yd(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...R(t)})}function Xd(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...R(t)})}function Zd(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...R(t)})}function Qd(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...R(t)})}function $d(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...R(t)})}function ef(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...R(t)})}function tf(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...R(t)})}function nf(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...R(t)})}function rf(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...R(t)})}function af(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...R(t)})}function of(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...R(t)})}function sf(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...R(t)})}function cf(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...R(t)})}function lf(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...R(t)})}function uf(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...R(t)})}function df(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...R(t)})}function ff(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...R(t)})}function pf(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...R(t)})}function mf(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...R(t)})}function hf(e,t){return new e({type:`number`,checks:[],...R(t)})}function gf(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...R(t)})}function _f(e,t){return new e({type:`boolean`,...R(t)})}function vf(e,t){return new e({type:`null`,...R(t)})}function yf(e){return new e({type:`unknown`})}function bf(e,t){return new e({type:`never`,...R(t)})}function xf(e,t){return new ou({check:`less_than`,...R(t),value:e,inclusive:!1})}function Sf(e,t){return new ou({check:`less_than`,...R(t),value:e,inclusive:!0})}function Cf(e,t){return new su({check:`greater_than`,...R(t),value:e,inclusive:!1})}function wf(e,t){return new su({check:`greater_than`,...R(t),value:e,inclusive:!0})}function Tf(e,t){return new cu({check:`multiple_of`,...R(t),value:e})}function Ef(e,t){return new uu({check:`max_length`,...R(t),maximum:e})}function Df(e,t){return new du({check:`min_length`,...R(t),minimum:e})}function Of(e,t){return new fu({check:`length_equals`,...R(t),length:e})}function kf(e,t){return new mu({check:`string_format`,format:`regex`,...R(t),pattern:e})}function Af(e){return new hu({check:`string_format`,format:`lowercase`,...R(e)})}function jf(e){return new gu({check:`string_format`,format:`uppercase`,...R(e)})}function Mf(e,t){return new _u({check:`string_format`,format:`includes`,...R(t),includes:e})}function Nf(e,t){return new vu({check:`string_format`,format:`starts_with`,...R(t),prefix:e})}function Pf(e,t){return new yu({check:`string_format`,format:`ends_with`,...R(t),suffix:e})}function Ff(e){return new bu({check:`overwrite`,tx:e})}function If(e){return Ff(t=>t.normalize(e))}function Lf(){return Ff(e=>e.trim())}function Rf(){return Ff(e=>e.toLowerCase())}function zf(){return Ff(e=>e.toUpperCase())}function Bf(){return Ff(e=>zc(e))}function Vf(e,t,n){return new e({type:`array`,element:t,...R(n)})}function Hf(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...R(n)})}function Uf(e,t){let n=Wf(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(cl(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(cl(r))}},e(t.value,t)),t);return n}function Wf(e,t){let n=new B({check:`custom`,...R(t)});return n._zod.check=e,n}function Gf(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??Bd,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 U(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,U(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&W(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Kf(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>
128
-
129
- 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 qf(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Yf(t,`input`,e.processors),output:Yf(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function W(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return W(r.element,n);if(r.type===`set`)return W(r.valueType,n);if(r.type===`lazy`)return W(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return W(r.innerType,n);if(r.type===`intersection`)return W(r.left,n)||W(r.right,n);if(r.type===`record`||r.type===`map`)return W(r.keyType,n)||W(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:W(r.in,n)||W(r.out,n);if(r.type===`object`){for(let e in r.shape)if(W(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(W(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(W(e,n))return!0;return!!(r.rest&&W(r.rest,n))}return!1}const Jf=(e,t={})=>n=>{let r=Gf({...n,processors:t});return U(e,r),Kf(r,e),qf(r,e)},Yf=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Gf({...i??{},target:a,io:t,processors:n});return U(e,o),Kf(o,e),qf(o,e)},Xf={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Zf=(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=Xf[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}))])}},Qf=(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`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},$f=(e,t,n,r)=>{n.type=`boolean`},ep=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},tp=(e,t,n,r)=>{n.not={}},np=(e,t,n,r)=>{let i=e._zod.def,a=kc(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},rp=(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},ip=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},ap=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},op=(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=U(a.element,t,{...r,path:[...r.path,`items`]})},sp=(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]=U(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=U(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},cp=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>U(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},lp=(e,t,n,r)=>{let i=e._zod.def,a=U(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=U(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},up=(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=U(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=U(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=U(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)}},dp=(e,t,n,r)=>{let i=e._zod.def,a=U(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},fp=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},pp=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},mp=(e,t,n,r)=>{let i=e._zod.def;U(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)))},hp=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},gp=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;U(o,t,r);let s=t.seen.get(e);s.ref=o},_p=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},vp=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},yp=(e,t,n,r)=>{let i=e._zod.innerType;U(i,t,r);let a=t.seen.get(e);a.ref=i},bp=F(`ZodISODateTime`,(e,t)=>{Fu.init(e,t),J.init(e,t)});function xp(e){return df(bp,e)}const Sp=F(`ZodISODate`,(e,t)=>{Iu.init(e,t),J.init(e,t)});function Cp(e){return ff(Sp,e)}const wp=F(`ZodISOTime`,(e,t)=>{Lu.init(e,t),J.init(e,t)});function Tp(e){return pf(wp,e)}const Ep=F(`ZodISODuration`,(e,t)=>{Ru.init(e,t),J.init(e,t)});function Dp(e){return mf(Ep,e)}const G=F(`ZodError`,(e,t)=>{ul.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>pl(e,t)},flatten:{value:t=>fl(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ac,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ac,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Op=ml(G),kp=hl(G),Ap=gl(G),jp=vl(G),Mp=bl(G),Np=xl(G),Pp=Sl(G),Fp=Cl(G),Ip=wl(G),Lp=Tl(G),Rp=El(G),zp=Dl(G),Bp=new WeakMap;function Vp(e,t,n){let r=Object.getPrototypeOf(e),i=Bp.get(r);if(i||(i=new Set,Bp.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}const K=F(`ZodType`,(e,t)=>(V.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Yf(e,`input`),output:Yf(e,`output`)}}),e.toJSONSchema=Jf(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.parse=(t,n)=>Op(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ap(e,t,n),e.parseAsync=async(t,n)=>kp(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>jp(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Mp(e,t,n),e.decode=(t,n)=>Np(e,t,n),e.encodeAsync=async(t,n)=>Pp(e,t,n),e.decodeAsync=async(t,n)=>Fp(e,t,n),e.safeEncode=(t,n)=>Ip(e,t,n),e.safeDecode=(t,n)=>Lp(e,t,n),e.safeEncodeAsync=async(t,n)=>Rp(e,t,n),e.safeDecodeAsync=async(t,n)=>zp(e,t,n),Vp(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Lc(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return qc(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(ch(e,t))},superRefine(e,t){return this.check(lh(e,t))},overwrite(e){return this.check(Ff(e))},optional(){return Vm(this)},exactOptional(){return Um(this)},nullable(){return Gm(this)},nullish(){return Vm(Gm(this))},nonoptional(e){return Zm(this,e)},array(){return Cm(this)},or(e){return Em([this,e])},and(e){return Am(this,e)},transform(e){return th(this,zm(e))},default(e){return qm(this,e)},prefault(e){return Ym(this,e)},catch(e){return $m(this,e)},pipe(e){return th(this,e)},readonly(){return ih(this)},describe(e){let t=this.clone();return Bd.add(t,{description:e}),t},meta(...e){if(e.length===0)return Bd.get(this);let t=this.clone();return Bd.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,`description`,{get(){return Bd.get(e)?.description},configurable:!0}),e)),Hp=F(`_ZodString`,(e,t)=>{Cu.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zf(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Vp(e,`_ZodString`,{regex(...e){return this.check(kf(...e))},includes(...e){return this.check(Mf(...e))},startsWith(...e){return this.check(Nf(...e))},endsWith(...e){return this.check(Pf(...e))},min(...e){return this.check(Df(...e))},max(...e){return this.check(Ef(...e))},length(...e){return this.check(Of(...e))},nonempty(...e){return this.check(Df(1,...e))},lowercase(e){return this.check(Af(e))},uppercase(e){return this.check(jf(e))},trim(){return this.check(Lf())},normalize(...e){return this.check(If(...e))},toLowerCase(){return this.check(Rf())},toUpperCase(){return this.check(zf())},slugify(){return this.check(Bf())}})}),Up=F(`ZodString`,(e,t)=>{Cu.init(e,t),Hp.init(e,t),e.email=t=>e.check(Hd(Wp,t)),e.url=t=>e.check(Jd(Jp,t)),e.jwt=t=>e.check(uf(lm,t)),e.emoji=t=>e.check(Yd(Yp,t)),e.guid=t=>e.check(Ud(Kp,t)),e.uuid=t=>e.check(Wd(qp,t)),e.uuidv4=t=>e.check(Gd(qp,t)),e.uuidv6=t=>e.check(Kd(qp,t)),e.uuidv7=t=>e.check(qd(qp,t)),e.nanoid=t=>e.check(Xd(Xp,t)),e.guid=t=>e.check(Ud(Kp,t)),e.cuid=t=>e.check(Zd(Zp,t)),e.cuid2=t=>e.check(Qd(Qp,t)),e.ulid=t=>e.check($d($p,t)),e.base64=t=>e.check(sf(om,t)),e.base64url=t=>e.check(cf(sm,t)),e.xid=t=>e.check(ef(em,t)),e.ksuid=t=>e.check(tf(tm,t)),e.ipv4=t=>e.check(nf(nm,t)),e.ipv6=t=>e.check(rf(rm,t)),e.cidrv4=t=>e.check(af(im,t)),e.cidrv6=t=>e.check(of(am,t)),e.e164=t=>e.check(lf(cm,t)),e.datetime=t=>e.check(xp(t)),e.date=t=>e.check(Cp(t)),e.time=t=>e.check(Tp(t)),e.duration=t=>e.check(Dp(t))});function q(e){return Vd(Up,e)}const J=F(`ZodStringFormat`,(e,t)=>{H.init(e,t),Hp.init(e,t)}),Wp=F(`ZodEmail`,(e,t)=>{Eu.init(e,t),J.init(e,t)});function Gp(e){return Hd(Wp,e)}const Kp=F(`ZodGUID`,(e,t)=>{wu.init(e,t),J.init(e,t)}),qp=F(`ZodUUID`,(e,t)=>{Tu.init(e,t),J.init(e,t)}),Jp=F(`ZodURL`,(e,t)=>{Du.init(e,t),J.init(e,t)}),Yp=F(`ZodEmoji`,(e,t)=>{Ou.init(e,t),J.init(e,t)}),Xp=F(`ZodNanoID`,(e,t)=>{ku.init(e,t),J.init(e,t)}),Zp=F(`ZodCUID`,(e,t)=>{Au.init(e,t),J.init(e,t)}),Qp=F(`ZodCUID2`,(e,t)=>{ju.init(e,t),J.init(e,t)}),$p=F(`ZodULID`,(e,t)=>{Mu.init(e,t),J.init(e,t)}),em=F(`ZodXID`,(e,t)=>{Nu.init(e,t),J.init(e,t)}),tm=F(`ZodKSUID`,(e,t)=>{Pu.init(e,t),J.init(e,t)}),nm=F(`ZodIPv4`,(e,t)=>{zu.init(e,t),J.init(e,t)}),rm=F(`ZodIPv6`,(e,t)=>{Bu.init(e,t),J.init(e,t)}),im=F(`ZodCIDRv4`,(e,t)=>{Vu.init(e,t),J.init(e,t)}),am=F(`ZodCIDRv6`,(e,t)=>{Hu.init(e,t),J.init(e,t)}),om=F(`ZodBase64`,(e,t)=>{Wu.init(e,t),J.init(e,t)}),sm=F(`ZodBase64URL`,(e,t)=>{Ku.init(e,t),J.init(e,t)}),cm=F(`ZodE164`,(e,t)=>{qu.init(e,t),J.init(e,t)}),lm=F(`ZodJWT`,(e,t)=>{Yu.init(e,t),J.init(e,t)}),um=F(`ZodNumber`,(e,t)=>{Xu.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qf(e,t,n,r),Vp(e,`ZodNumber`,{gt(e,t){return this.check(Cf(e,t))},gte(e,t){return this.check(wf(e,t))},min(e,t){return this.check(wf(e,t))},lt(e,t){return this.check(xf(e,t))},lte(e,t){return this.check(Sf(e,t))},max(e,t){return this.check(Sf(e,t))},int(e){return this.check(pm(e))},safe(e){return this.check(pm(e))},positive(e){return this.check(Cf(0,e))},nonnegative(e){return this.check(wf(0,e))},negative(e){return this.check(xf(0,e))},nonpositive(e){return this.check(Sf(0,e))},multipleOf(e,t){return this.check(Tf(e,t))},step(e,t){return this.check(Tf(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function dm(e){return hf(um,e)}const fm=F(`ZodNumberFormat`,(e,t)=>{Zu.init(e,t),um.init(e,t)});function pm(e){return gf(fm,e)}const mm=F(`ZodBoolean`,(e,t)=>{Qu.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$f(e,t,n,r)});function hm(e){return _f(mm,e)}const gm=F(`ZodNull`,(e,t)=>{$u.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ep(e,t,n,r)});function _m(e){return vf(gm,e)}const vm=F(`ZodUnknown`,(e,t)=>{ed.init(e,t),K.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ym(){return yf(vm)}const bm=F(`ZodNever`,(e,t)=>{td.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tp(e,t,n,r)});function xm(e){return bf(bm,e)}const Sm=F(`ZodArray`,(e,t)=>{rd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>op(e,t,n,r),e.element=t.element,Vp(e,`ZodArray`,{min(e,t){return this.check(Df(e,t))},nonempty(e){return this.check(Df(1,e))},max(e,t){return this.check(Ef(e,t))},length(e,t){return this.check(Of(e,t))},unwrap(){return this.element}})});function Cm(e,t){return Vf(Sm,e,t)}const wm=F(`ZodObject`,(e,t)=>{cd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sp(e,t,n,r),L(e,`shape`,()=>t.shape),Vp(e,`ZodObject`,{keyof(){return Pm(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:ym()})},loose(){return this.clone({...this._zod.def,catchall:ym()})},strict(){return this.clone({...this._zod.def,catchall:xm()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Qc(this,e)},safeExtend(e){return $c(this,e)},merge(e){return el(this,e)},pick(e){return Xc(this,e)},omit(e){return Zc(this,e)},partial(...e){return tl(Bm,this,e[0])},required(...e){return nl(Xm,this,e[0])}})});function Y(e,t){return new wm({type:`object`,shape:e??{},...R(t)})}const Tm=F(`ZodUnion`,(e,t)=>{ud.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cp(e,t,n,r),e.options=t.options});function Em(e,t){return new Tm({type:`union`,options:e,...R(t)})}const Dm=F(`ZodDiscriminatedUnion`,(e,t)=>{Tm.init(e,t),dd.init(e,t)});function Om(e,t,n){return new Dm({type:`union`,options:t,discriminator:e,...R(n)})}const km=F(`ZodIntersection`,(e,t)=>{fd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lp(e,t,n,r)});function Am(e,t){return new km({type:`intersection`,left:e,right:t})}const jm=F(`ZodRecord`,(e,t)=>{hd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>up(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Mm(e,t,n){return!t||!t._zod?new jm({type:`record`,keyType:q(),valueType:e,...R(t)}):new jm({type:`record`,keyType:e,valueType:t,...R(n)})}const Nm=F(`ZodEnum`,(e,t)=>{gd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>np(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 Nm({...t,checks:[],...R(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 Nm({...t,checks:[],...R(r),entries:i})}});function Pm(e,t){return new Nm({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...R(t)})}function Fm(e,t){return new Nm({type:`enum`,entries:e,...R(t)})}const Im=F(`ZodLiteral`,(e,t)=>{_d.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rp(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 Lm(e,t){return new Im({type:`literal`,values:Array.isArray(e)?e:[e],...R(t)})}const Rm=F(`ZodTransform`,(e,t)=>{vd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ap(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Dc(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(cl(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(cl(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function zm(e){return new Rm({type:`transform`,transform:e})}const Bm=F(`ZodOptional`,(e,t)=>{bd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Vm(e){return new Bm({type:`optional`,innerType:e})}const Hm=F(`ZodExactOptional`,(e,t)=>{xd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Um(e){return new Hm({type:`optional`,innerType:e})}const Wm=F(`ZodNullable`,(e,t)=>{Sd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Gm(e){return new Wm({type:`nullable`,innerType:e})}const Km=F(`ZodDefault`,(e,t)=>{Cd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function qm(e,t){return new Km({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Wc(t)}})}const Jm=F(`ZodPrefault`,(e,t)=>{Td.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ym(e,t){return new Jm({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Wc(t)}})}const Xm=F(`ZodNonOptional`,(e,t)=>{Ed.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Zm(e,t){return new Xm({type:`nonoptional`,innerType:e,...R(t)})}const Qm=F(`ZodCatch`,(e,t)=>{Od.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $m(e,t){return new Qm({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const eh=F(`ZodPipe`,(e,t)=>{kd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gp(e,t,n,r),e.in=t.in,e.out=t.out});function th(e,t){return new eh({type:`pipe`,in:e,out:t})}const nh=F(`ZodPreprocess`,(e,t)=>{eh.init(e,t),jd.init(e,t)}),rh=F(`ZodReadonly`,(e,t)=>{Md.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_p(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ih(e){return new rh({type:`readonly`,innerType:e})}const ah=F(`ZodLazy`,(e,t)=>{Pd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yp(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function oh(e){return new ah({type:`lazy`,getter:e})}const sh=F(`ZodCustom`,(e,t)=>{Fd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ip(e,t,n,r)});function ch(e,t={}){return Hf(sh,e,t)}function lh(e,t){return Uf(e,t)}function uh(e,t){return new nh({type:`pipe`,in:zm(e),out:t})}const dh=[`en`,`zh-Hans`];Y({identityToken:q().trim().min(1),nonce:q().trim().optional().nullable(),email:q().trim().email().optional().nullable(),name:Y({firstName:q().trim().optional().nullable(),lastName:q().trim().optional().nullable()}).optional().nullable(),preferredLanguage:Pm(dh)}),Y({isAvailable:hm()});const fh=e=>uh(e=>e===null?void 0:e,e.optional()),ph=oh(()=>Em([q(),dm(),hm(),_m(),Cm(ph),Mm(q(),ph)])),mh=q().trim().pipe(Gp()),hh=Y({error:q().trim().min(1),details:Mm(q(),ph)}),gh=Y({expiresAt:xp(),updatedAt:xp()}),_h=Y({id:q().trim().min(1),email:mh,name:q(),image:q().nullable()}),vh=Y({token:q().trim().min(1),onboardingCompleted:hm(),projectTemplateOnboardingCompleted:hm(),session:gh,user:_h}),yh=Y({token:q().trim().min(1)});Y({token:q().trim().min(1)});const X={PENDING:`pending`,COMPLETED:`completed`,EXPIRED:`expired`,ERROR:`error`};X.COMPLETED,X.EXPIRED,X.ERROR;const bh={BROWSER_PAGE:`browser_page`,DEEP_LINK:`deep_link`},xh={GITHUB:`github`,GOOGLE:`google`,SLACK:`slack`},Sh={GOOGLE_WORKSPACE:`google-workspace`},Ch=Pm([bh.BROWSER_PAGE,bh.DEEP_LINK]),wh=Pm([xh.GITHUB,xh.GOOGLE,xh.SLACK]),Th=Pm([Sh.GOOGLE_WORKSPACE]);Y({returnMode:Ch,preferredLanguage:Pm(dh)});const Eh=Y({authorizationUrl:q().trim().min(1),expiresAt:q().datetime(),state:q().trim().min(1)}),Dh=Eh.extend({provider:wh}),Oh=Eh.extend({provider:Th}),kh=Y({state:q().trim().min(1)}),Ah=kh.extend({expiresAt:q().datetime(),name:q(),token:q().trim().min(1),userId:q().trim().min(1),avatarUrl:q()}),jh=kh.extend({reason:q().trim().min(1),status:Lm(X.ERROR)}),Mh=Om(`status`,[kh.extend({provider:wh,status:Lm(X.PENDING)}),Ah.extend({provider:wh,status:Lm(X.COMPLETED)}),kh.extend({provider:wh,status:Lm(X.EXPIRED)}),jh.extend({provider:wh})]),Nh=Om(`status`,[kh.extend({provider:Th,status:Lm(X.PENDING)}),Ah.extend({provider:Th,status:Lm(X.COMPLETED)}),kh.extend({provider:Th,status:Lm(X.EXPIRED)}),jh.extend({provider:Th})]);var Ph=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}})),Fh=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}})),Ih=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getStatusText=e.getStatusCode=e.getReasonPhrase=void 0;var t=Fh();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})),Lh=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||={})})),Rh=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||={})})),Z=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(Ph()),o=Ih(),s=Ih();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=Lh();Object.defineProperty(e,`StatusCodes`,{enumerable:!0,get:function(){return c.StatusCodes}});var l=Rh();Object.defineProperty(e,`ReasonPhrases`,{enumerable:!0,get:function(){return l.ReasonPhrases}}),r(Ph(),e),e.default=t(t({},a.default),{getStatusCode:o.getStatusCode,getStatusText:o.getStatusText})}))();const Q=(e,t)=>{let n=JSON.parse(e),r=t.safeParse(n);if(!r.success)throw r.error;return r.data};let zh=function(e){return e.OK=`ok`,e.UNAUTHORIZED=`unauthorized`,e}({});const Bh=Y({success:hm()}),Vh=Y({token:q().trim().min(1),userId:q().trim().min(1),email:q().trim().email(),expiresAt:q().datetime(),updatedAt:q().datetime(),name:q(),avatarUrl:q()}),Hh=Y({ok:Lm(!0),revokedAt:q().datetime(),sessionId:q().trim().min(1)}),$=async(e,t)=>{let n=Q(await e.text(),hh);throw Error(n.error)},Uh=async(e,t,n={})=>{let r=await(n.fetchImpl??fetch)(`${P(e)}/api/auth/email-otp/send-verification-otp`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({email:t.email})});return r.status===Z.StatusCodes.NO_CONTENT?{success:!0}:r.status===Z.StatusCodes.OK?Q(await r.text(),Bh):await $(r,`Failed to request sign-in code`)},Wh=async(e,t,n={})=>{let r=await(n.fetchImpl??fetch)(`${P(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===Z.StatusCodes.OK?Q(await r.text(),yh):await $(r,`Failed to verify sign-in code`)},Gh=async(e,t,n={})=>{let r=await(n.fetchImpl??fetch)(`${P(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===Z.StatusCodes.OK?Q(await r.text(),Dh):await $(r,`Failed to start external OAuth login`)},Kh=async(e,t,n={})=>{let r=n.fetchImpl??fetch,i=new URL(`/api/auth/oauth/${encodeURIComponent(t.provider)}/completion`,P(e));i.searchParams.set(`state`,t.state);let a=await r(i,{method:`GET`});return a.status===Z.StatusCodes.OK?Q(await a.text(),Mh):await $(a,`Failed to load external OAuth completion state`)},qh=async(e,t,n={})=>{let r=await(n.fetchImpl??fetch)(`${P(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===Z.StatusCodes.OK?Q(await r.text(),Oh):await $(r,`Failed to start external SSO login`)},Jh=async(e,t,n={})=>{let r=n.fetchImpl??fetch,i=new URL(`/api/auth/sso/${encodeURIComponent(t.provider)}/completion`,P(e));i.searchParams.set(`state`,t.state);let a=await r(i,{method:`GET`});return a.status===Z.StatusCodes.OK?Q(await a.text(),Nh):await $(a,`Failed to load external SSO completion state`)},Yh=async(e,t,n={})=>{let r=await(n.fetchImpl??fetch)(`${P(e)}/api/auth/cli-session/exchange`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});return r.status===Z.StatusCodes.OK?Q(await r.text(),Vh):await $(r,`Failed to create CLI session`)},Xh=async(e,t,n={})=>{let r=await(n.fetchImpl??fetch)(`${P(e)}/api/auth/cli-session/logout`,{method:`POST`,headers:{authorization:`Bearer ${t.token}`}});if(r.status===Z.StatusCodes.UNAUTHORIZED)throw Error(`Stored auth is invalid or expired`);return r.status===Z.StatusCodes.OK?Q(await r.text(),Hh):await $(r,`Failed to revoke CLI session`)},Zh=async(e,t,n={})=>{let r=n.fetchImpl??fetch,i=new URL(`/api/auth/get-session`,P(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===Z.StatusCodes.OK?{status:`ok`,session:Q(await a.text(),vh),error:null}:a.status===Z.StatusCodes.UNAUTHORIZED?{status:`unauthorized`,session:null,error:Q(await a.text(),hh)}:await $(a,`Failed to refresh session`)};var Qh=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 $h=async e=>{try{return await e.clone().text()}catch{return}},eg=async(e,t=`HTTP request failed`)=>{if(e.ok)return;let n=await $h(e);throw new Qh(t,{status:e.status,statusText:e.statusText,bodyText:n})},tg=/^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-]+)*)?$/,ng=/^\d+$/;let rg=function(e){return e.CLI=`cli`,e.DESKTOP=`desktop`,e.MOBILE=`mobile`,e.BROWSER_USE=`browser-use`,e}({}),ig=function(e){return e.STABLE=`stable`,e.BETA=`beta`,e.PREVIEW=`preview`,e}({}),ag=function(e){return e.COMMAND=`command`,e.DOWNLOAD=`download`,e.STORE=`store`,e.DOCS=`docs`,e}({}),og=function(e){return e.DARWIN_ARM64=`darwin-arm64`,e.DARWIN_X64=`darwin-x64`,e.WIN_X64=`win-x64`,e}({}),sg=function(e){return e.DARWIN_ARM64=`darwin-arm64`,e.DARWIN_X64=`darwin-x64`,e.LINUX_X64=`linux-x64`,e.LINUX_ARM64=`linux-arm64`,e}({}),cg=function(e){return e.IOS=`ios`,e.ANDROID=`android`,e}({}),lg=function(e){return e.CHROME=`chrome`,e}({});const ug=new Set(Object.values(rg)),dg=new Set(Object.values(ig)),fg=new Set(Object.values(ag)),pg=Object.values(og),mg={cli:Object.values(sg),desktop:pg,mobile:Object.values(cg),"browser-use":Object.values(lg)},hg=e=>typeof e==`object`&&!!e,gg=(e,t)=>{if(typeof e!=`string`||e.trim().length===0)throw Error(`Release manifest ${t} must be a non-empty string`);return e.trim()},_g=(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()}},vg=(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}},yg=(e,t)=>{let n=vg(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}},bg=(e,t)=>{let n=ng.test(e),r=ng.test(t);return n&&r?Number(e)-Number(t):n?-1:r?1:e.localeCompare(t)},xg=e=>{let t=e.trim().match(tg);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(`.`):[]}},Sg=e=>ug.has(e),Cg=e=>dg.has(e),wg=e=>fg.has(e),Tg=(e,t)=>mg[e].includes(t),Eg=(e,t)=>{let n=xg(e),r=xg(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=bg(t,i);if(a!==0)return a}return 0},Dg=(e,t)=>Eg(t,e.minimumSupportedVersion)<0?`update_required`:Eg(t,e.latestVersion)<0?`update_available`:`up_to_date`,Og=e=>{if(!Tg(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`},kg=e=>{if(!hg(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=gg(e.product,`product`);if(!Sg(n))throw Error(`Unsupported release product: ${n}`);let r=gg(e.channel,`channel`);if(!Cg(r))throw Error(`Unsupported release channel: ${r}`);let i=gg(e.platform,`platform`);if(!Tg(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(!hg(e))throw TypeError(`Release manifest actions[${t}] must be an object`);let n=gg(e.kind,`actions[${t}].kind`);if(!wg(n))throw Error(`Unsupported release action kind: ${n}`);return{kind:n,label:gg(e.label,`actions[${t}].label`),url:_g(e.url,`actions[${t}].url`),command:_g(e.command,`actions[${t}].command`),sha256:_g(e.sha256,`actions[${t}].sha256`),size:yg(e.size,`actions[${t}].size`)}}),c=vg(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:gg(e.latestVersion,`latestVersion`),minimumSupportedVersion:gg(e.minimumSupportedVersion,`minimumSupportedVersion`),publishedAt:gg(e.publishedAt,`publishedAt`),releaseNotesUrl:_g(e.releaseNotesUrl,`releaseNotesUrl`),message:_g(e.message,`message`),rolloutPercentage:c,actions:s}},Ag=new Set([`localhost`,`127.0.0.1`,`::1`]),jg=e=>Ag.has(e),Mg=e=>{let t=P(e.trim()),n=new URL(t);if(n.protocol===`https:`||n.protocol===`http:`&&jg(n.hostname))return P(n.toString());throw Error(`Updates base URL must use https or localhost http: ${e}`)},Ng=e=>`${Mg(e.baseUrl)}/${Og({product:e.product,channel:e.channel,platform:e.platform})}`,Pg=async e=>e.json(),Fg=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 eg(n,`Release manifest request failed`),kg(await Pg(n))}finally{clearTimeout(n)}},Ig=async e=>{let t=e.fetch??fetch,n=await Fg({url:Ng({baseUrl:e.baseUrl,product:e.product,channel:e.channel,platform:e.platform}),fetchImpl:t,timeoutMs:e.timeoutMs??5e3});return{availability:Dg(n,e.currentVersion),manifest:n}};export{hs as $,wc as A,Gs as B,Fm as C,q as D,Mm as E,uc as F,ys as G,Ks as H,bc as I,Ts as J,Cs as K,rc as L,pc as M,sc as N,Em as O,_c as P,ps as Q,ic as R,Lm as S,Y as T,As as U,qs as V,ks as W,xs as X,Es as Y,ms as Z,Pm as _,w as _t,zh as a,ds as at,Om as b,Zh as c,za as ct,Uh as d,Fa as dt,Ao as et,Wh as f,Ya as ft,fh as g,$a as gt,ph as h,D as ht,rg as i,Lo as it,cc as j,ym as k,Jh as l,E as lt,qh as m,ja as mt,sg as n,gs as nt,Yh as o,A as ot,Gh as p,k as pt,ws as q,ig as r,fs as rt,Kh as s,to as st,Ig as t,ss as tt,Xh as u,La as ut,Cm as v,qa as vt,dm as w,oh as x,hm as y,tc as z};
130
- //# debugId=3fe60296-773c-5f48-a15a-d8d5a8cc8162
@@ -1,4 +0,0 @@
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]="67872406-1797-5abf-8b3c-b13d18b85f08")}catch(e){}}();
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=67872406-1797-5abf-8b3c-b13d18b85f08
@@ -1,4 +0,0 @@
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]="8bfe4b6b-f955-5893-b391-b73cf5c72932")}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-B57lajYt.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=8bfe4b6b-f955-5893-b391-b73cf5c72932
@@ -1,5 +0,0 @@
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]="110a3e60-802e-581c-931c-7b63a3c87e23")}catch(e){}}();
3
- import{a as e,t}from"./chunk-Bdh3yLIe.js";import{n,t as r}from"./esm-DcZNWkvb.js";import{t as i}from"./execAsync-D2zcCRHg.js";var a=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getMachineId=void 0;let a=i(),o=(n(),e(r));async function s(){try{let e=(await(0,a.execAsync)(`ioreg -rd1 -c "IOPlatformExpertDevice"`)).stdout.split(`
4
- `).find(e=>e.includes(`IOPlatformUUID`));if(!e)return;let t=e.split(`" = "`);if(t.length===2)return t[1].slice(0,-1)}catch(e){o.diag.debug(`error reading machine id: ${e}`)}}t.getMachineId=s}));export default a();export{};
5
- //# debugId=110a3e60-802e-581c-931c-7b63a3c87e23
@@ -1,4 +0,0 @@
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]="3367db6b-b97f-5612-b980-9c0b25f7fe3f")}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";var a=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let a=t(`fs`),o=(r(),e(i));async function s(){for(let e of[`/etc/machine-id`,`/var/lib/dbus/machine-id`])try{return(await a.promises.readFile(e,{encoding:`utf8`})).trim()}catch(e){o.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=s}));export default a();export{};
4
- //# debugId=3367db6b-b97f-5612-b980-9c0b25f7fe3f