progon-agent 1.5.2 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/supervisor/cli.js +75 -75
- package/extension-bundle.json +3 -3
- package/extension-dist/background/background.js +101 -95
- package/extension-dist/card/card.html +10 -9
- package/extension-dist/card/card.js +3 -3
- package/extension-dist/chunks/shared-B3glEBMw.js +1 -0
- package/extension-dist/chunks/shared-B9oC2P3-.js +8 -0
- package/extension-dist/chunks/shared-BByPq6Kh.js +1 -0
- package/extension-dist/chunks/shared-BMIAtDPv.js +45 -0
- package/extension-dist/chunks/shared-BTOXSk0k.js +118 -0
- package/extension-dist/chunks/{shared-VvEftNwZ.js → shared-C-Q9DKcM.js} +1 -1
- package/extension-dist/chunks/shared-C4rk8dhz.js +1 -0
- package/extension-dist/chunks/shared-CHDbyhV4.js +1 -0
- package/extension-dist/chunks/shared-CmGCWsjS.js +15 -0
- package/extension-dist/chunks/shared-D7P2v9Mb.js +372 -0
- package/extension-dist/chunks/shared-DKBOqKL2.css +1 -0
- package/extension-dist/chunks/shared-Dnq0mR_F.css +1 -0
- package/extension-dist/chunks/shared-Dor6Qf-t.js +1 -0
- package/extension-dist/chunks/shared-DwL_iWMx.js +1 -0
- package/extension-dist/chunks/shared-GBy7ssZb.js +1 -0
- package/extension-dist/chunks/shared-gmwevruS.js +159 -0
- package/extension-dist/chunks/shared-iMtAwxmT.js +351 -0
- package/extension-dist/chunks/shared-mCuRTIv8.js +129 -0
- package/extension-dist/chunks/shared-rQyAr3p-.js +1 -0
- package/extension-dist/chunks/shared-yvJVPBBs.css +1 -0
- package/extension-dist/content/content.js +205 -205
- package/extension-dist/content/frame.js +80 -80
- package/extension-dist/manifest.json +32 -29
- package/extension-dist/offscreen/offscreen.html +3 -2
- package/extension-dist/offscreen/offscreen.js +1 -1
- package/extension-dist/popup/popup.css +1 -1
- package/extension-dist/popup/popup.html +9 -8
- package/extension-dist/popup/popup.js +9 -3
- package/extension-dist/sidepanel/sidepanel.css +1 -1
- package/extension-dist/sidepanel/sidepanel.html +12 -11
- package/extension-dist/sidepanel/sidepanel.js +1 -1
- package/extension-dist/workspace/workspace.html +13 -11
- package/extension-dist/workspace/workspace.js +48 -54
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
- package/extension-dist/chunks/shared--PKAvBPy.js +0 -1
- package/extension-dist/chunks/shared-0jT00uC5.js +0 -317
- package/extension-dist/chunks/shared-8TdX8bnw.js +0 -1
- package/extension-dist/chunks/shared-BBwL-FWr.js +0 -8
- package/extension-dist/chunks/shared-BECVQaqd.js +0 -1
- package/extension-dist/chunks/shared-BYkDbcM2.js +0 -372
- package/extension-dist/chunks/shared-BdaUsVif.css +0 -1
- package/extension-dist/chunks/shared-CDlAJRnF.js +0 -117
- package/extension-dist/chunks/shared-CQ5Ygj2p.js +0 -1
- package/extension-dist/chunks/shared-CnMBv8Ku.js +0 -1
- package/extension-dist/chunks/shared-CyNKhHOY.js +0 -1
- package/extension-dist/chunks/shared-D3X5MuUz.js +0 -1
- package/extension-dist/chunks/shared-D7GfVHk0.js +0 -129
- package/extension-dist/chunks/shared-U9lBnzuH.js +0 -33
- package/extension-dist/chunks/shared-fJPHxpB5.css +0 -1
- package/extension-dist/chunks/shared-o0-3vI--.js +0 -193
- package/extension-dist/chunks/shared-uKTblxo0.js +0 -15
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{r as e}from"./shared-XKyaHtl9.js";import{Fn as t,I as n,Is as r,Jn as i,L as a,Ln as o,Ls as s,Mt as c,Nn as l,Oi as u,Pn as d,Qn as f,R as ee,U as te,Un as p,Vn as m,Xn as ne,Xo as h,Yn as g,_n as re,cr as ie,lr as ae,pa as _,qn as oe,qt as se,xi as v}from"./shared-iMtAwxmT.js";import{_ as ce,b as y,f as le,l as b,m as ue,p as de,v as fe,y as pe}from"./shared-C4rk8dhz.js"
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v0.574.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
;var x=h(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),S=r(),C=`?`,w={xs:`size-4 text-(length:--text-2xs)`,sm:`size-5.5 text-(length:--text-micro)`,md:`size-7 text-(length:--text-caption)`,lg:`size-9 text-(length:--text-body-sm)`},T={primary:`bg-(--color-bg-primary-tint-15) text-fg-on-primary-tint shadow-[0_0_0_2px_var(--av-ring,var(--color-bg-card)),inset_0_0_0_1px_var(--color-border-primary-tint-28)]`,info:`bg-[color-mix(in_srgb,var(--color-info)_16%,transparent)] text-fg-info shadow-[0_0_0_2px_var(--av-ring,var(--color-bg-card))]`,scenario:`bg-[color-mix(in_srgb,var(--color-accent-scenario)_16%,transparent)] text-(--color-accent-scenario) shadow-[0_0_0_2px_var(--av-ring,var(--color-bg-card))]`};function E(e){return typeof e==`string`&&e.length>0}function D(e,t,n){return E(e)&&E(t)?(e.charAt(0)+t.charAt(0)).toUpperCase():E(e)?e.charAt(0).toUpperCase():E(n)?n.charAt(0).toUpperCase():C}function O(e,t,n,r){return E(e)&&E(t)?`${e} ${t}`:E(e)?e:E(n)?n:r}function k(e){return e.replace(/@.*$/,``).split(/[\s._-]+/).filter(e=>e!==``).slice(0,2).map(e=>e.charAt(0).toUpperCase()).join(``)}var A=`inline-grid shrink-0 place-items-center rounded-full font-semibold tracking-[0.2px]`;function j(e){let{size:t,tone:n=`primary`,className:r}=e,i=_(A,w[t],T[n],r);if(e.displayName!==void 0)return/* @__PURE__ */ (0,S.jsx)(`span`,{"aria-hidden":`true`,className:i,children:k(e.displayName)});let{firstName:a,lastName:o,email:s,unknownLabel:c}=e;return/* @__PURE__ */ (0,S.jsx)(`span`,{role:`img`,"aria-label":O(a,o,s,c),className:i,children:/* @__PURE__ */ (0,S.jsx)(`span`,{"aria-hidden":`true`,children:D(a,o,s)})})}var M=/* @__PURE__ */ e(s(),1),N=/*#__PURE__*/ M.forwardRef(function(e,r){let{render:s,className:u,nativeButton:p=!0,disabled:h=!1,id:g,style:_,...b}=e,{state:x,disabled:S,setTouched:C,setFocused:w,validationMode:T,validation:E}=te(),{labelId:D}=ee(),O=y(),k=O.useState(`selectionMode`),A=O.useState(`disabled`),j=O.useState(`readOnly`),N=O.useState(`required`),P=O.useState(`positionerElement`),F=O.useState(`listElement`),I=O.useState(`popupId`),L=O.useState(`triggerProps`),R=O.useState(`inputInsidePopup`),z=O.useState(`id`),B=O.useState(`labelId`),V=O.useState(`open`),H=O.useState(`selectedValue`),U=O.useState(`activeIndex`),W=O.useState(`selectedIndex`),G=O.useState(`hasSelectedValue`),K=fe(),q=pe(),J=o(),Y=S||A||h,X=le(),me=de(O);a({id:R?g:void 0});let he=R?g??z:g,ge=n(D,B),Z;V&&R?Z=I??ce(z):V&&(Z=F==null?void 0:F.id);let Q=M.useRef(``);function $(e){Q.current=e.pointerType}let{reference:_e}=se(K,{enabled:!V&&!j&&!A&&k===`single`,listRef:O.context.labelsRef,activeIndex:U,selectedIndex:W,onMatch(e){let t=O.context.valuesRef.current[e];t!==void 0&&O.context.setSelectedValue(t,m(ae))}}),{reference:ve}=re(K,{enabled:!A,event:`mousedown`}),{buttonRef:ye,getButtonProps:be}=oe({native:p,disabled:Y}),xe={...x,readOnly:j,open:V,disabled:Y,popupSide:me,listEmpty:X,placeholder:k!==`none`&&!G},Se=ne(e=>{O.set(`triggerElement`,e)});return v(`button`,e,{ref:[r,ye,Se],state:xe,props:[L,ve,_e,{id:he,tabIndex:R?0:-1,role:R?`combobox`:void 0,"aria-expanded":V,"aria-haspopup":R?`dialog`:`listbox`,"aria-controls":Z,"aria-required":R&&N||void 0,"aria-readonly":R&&j||void 0,"aria-labelledby":ge,onPointerDown:$,onPointerEnter:$,onFocus(){w(!0),Y||J.start(0,O.context.forceMount)},onBlur(e){if(!l(P,e.relatedTarget)&&(C(!0),w(!1),T===`onBlur`)){let e=k===`none`?q:H;E.commit(e)}},onMouseDown(e){if(Y)return;if(R||K.set(`domReferenceElement`,e.currentTarget),O.context.forceMount(),Q.current!==`touch`){var t;(t=O.context.inputRef.current)==null||t.focus(),R||e.preventDefault()}if(V)return;let n=i(e.currentTarget);function r(e){let t=O.state.triggerElement;if(!t)return;let n=d(e),r=O.state.positionerElement,i=O.state.listElement;l(t,n)||l(r,n)||l(i,n)||c(e,t)||O.context.setOpen(!1,m(f,e))}R&&n.addEventListener(`mouseup`,r,{once:!0})},onKeyDown(e){if(e.key===`ArrowDown`||e.key===`ArrowUp`){var n;t(e),O.context.setOpen(!0,m(ie,e.nativeEvent)),(n=O.context.inputRef.current)==null||n.focus()}}},E.getValidationProps(Y,b),be],stateAttributesMapping:ue})}),P=/*#__PURE__*/ M.createContext(void 0);function F(){let e=M.useContext(P);if(e===void 0)throw Error(u(18));return e}var I=/*#__PURE__*/ M.forwardRef(function(e,t){let{render:n,className:r,style:i,items:a,...o}=e,s=y().useState(`grid`),[c,l]=M.useState(),u=M.useMemo(()=>({labelId:c,setLabelId:l,items:a}),[c,l,a]),d=v(`div`,e,{ref:t,props:[{role:s?`rowgroup`:`group`,"aria-labelledby":c},o]}),f=/*#__PURE__*/ (0,S.jsx)(P.Provider,{value:u,children:d});return a?/*#__PURE__*/ (0,S.jsx)(b,{items:a,children:f}):f}),L=/*#__PURE__*/ M.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{setLabelId:s}=F(),c=p(a);return g(()=>(s(c),()=>{s(e=>e===c?void 0:e)}),[c,s]),v(`div`,e,{ref:t,props:[{id:c,"aria-hidden":!0},o]})});function R(e){return{targetId:e.id,applicationId:e.applicationId,environmentId:e.environmentId,baseUrl:e.baseUrl,hostPattern:e.hostPattern}}function z(e){return e.baseUrl===null?{baseUrl:null,hostPattern:e.hostPattern}:{baseUrl:e.baseUrl,hostPattern:null}}function B(e){let{projectTargets:t,projectTrustedSites:n}=e;return t===null||n===null?null:{cells:t,trustedSites:n}}var V=`mt-0.5 size-4 shrink-0 rounded-full border-solid [transition:border_var(--motion-short)_var(--ease-out)]`,H=`border-[1.5px] border-stroke-strong`,U=`border-[5px] border-primary-400`;function W({checked:e}){return/* @__PURE__ */ (0,S.jsx)(`span`,{"aria-hidden":`true`,className:_(V,e?U:H)})}var G=`relative cursor-pointer border border-solid border-stroke [transition:border-color_var(--motion-short)_var(--ease-out),background-color_var(--motion-short)_var(--ease-out),color_var(--motion-short)_var(--ease-out)] hover:not-has-checked:not-has-disabled:border-stroke-hover has-checked:border-(--color-border-primary-tint-55) has-checked:bg-surface-primary-tint has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-stroke-focus has-disabled:cursor-not-allowed has-disabled:opacity-disabled`,K=`pointer-events-none absolute opacity-0`,q=_(G,`grid text-fg-primary`),J=`grid-cols-[auto_minmax(0,1fr)] items-start gap-2.5 rounded-md px-3 py-2.5`,Y=`gap-2 rounded-lg p-1.5 pb-2.25`,X=`block overflow-hidden rounded-sm`,me=`flex items-start gap-2.5 px-1.5`;function he({name:e,value:t,checked:n,onChange:r,title:i,description:a,disabled:o,media:s,"data-testid":c}){let l=/* @__PURE__ */ (0,S.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[/* @__PURE__ */ (0,S.jsx)(`span`,{className:`text-sm font-semibold`,children:i}),a!==void 0&&/* @__PURE__ */ (0,S.jsx)(`span`,{className:`text-xs text-fg-muted`,children:a})]});return/* @__PURE__ */ (0,S.jsxs)(`label`,{className:_(q,s===void 0?J:Y),"data-testid":c,children:[/* @__PURE__ */ (0,S.jsx)(`input`,{type:`radio`,name:e,value:t,checked:n,onChange:r,disabled:o,className:K}),s===void 0?/* @__PURE__ */ (0,S.jsxs)(S.Fragment,{children:[/* @__PURE__ */ (0,S.jsx)(W,{checked:n}),l]}):/* @__PURE__ */ (0,S.jsxs)(S.Fragment,{children:[/* @__PURE__ */ (0,S.jsx)(`span`,{className:X,children:s}),/* @__PURE__ */ (0,S.jsxs)(`span`,{className:me,children:[/* @__PURE__ */ (0,S.jsx)(W,{checked:n}),l]})]})]})}export{z as a,N as c,R as i,j as l,W as n,L as o,B as r,I as s,he as t,x as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{At as e,Et as t,Pt as n,St as r,kt as i}from"./shared-BTOXSk0k.js";import"./shared-Dor6Qf-t.js";var a=n().min(1).max(80),o={id:a,code:i().int().min(1e3).max(4999),reason:n().max(123)};r(`t`,[e({t:t(`open`),id:a,url:n().min(1).max(4096)}).strict(),e({t:t(`data`),id:a,data:n()}).strict(),e({t:t(`close`),...o}).strict()]),r(`t`,[e({t:t(`opened`),id:a}).strict(),e({t:t(`data`),id:a,data:n()}).strict(),e({t:t(`closed`),...o}).strict()]),e({sessionId:n().uuid(),wsUrl:n().min(1),sessionToken:n(),expiresIn:i().int(),runnerClaimEpoch:i().int().nonnegative()}).omit({runnerClaimEpoch:!0}).extend({wsUrl:n()});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import{r as e}from"./shared-XKyaHtl9.js";import{A as t,Bc as n,Go as r,Io as i,Is as a,Jo as o,Ki as s,Ls as c,Mo as l,Qi as u,So as d,Ts as f,Uo as p,Xo as m,Zo as h,_ as g,b as _,fa as v,fc as y,k as ee,l as b,la as x,ll as S,pa as C,pc as w,qo as te,ul as T,wo as ne,x as E}from"./shared-iMtAwxmT.js"
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v0.574.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
;var re=m(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),D=m(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),O=m(`circle-dashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),k=m(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),A=m(`globe-lock`,[[`path`,{d:`M15.686 15A14.5 14.5 0 0 1 12 22a14.5 14.5 0 0 1 0-20 10 10 0 1 0 9.542 13`,key:`qkt0x6`}],[`path`,{d:`M2 12h8.5`,key:`ovaggd`}],[`path`,{d:`M20 6V4a2 2 0 1 0-4 0v2`,key:`1of5e8`}],[`rect`,{width:`8`,height:`5`,x:`14`,y:`6`,rx:`1`,key:`1fmf51`}]]),j=m(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),M=m(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),N=/* @__PURE__ */ e(c(),1),P=a()
|
|
9
|
+
/**
|
|
10
|
+
* @license lucide-react v0.574.0 - ISC
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the ISC license.
|
|
13
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* @license lucide-react v0.574.0 - ISC
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the ISC license.
|
|
19
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* @license lucide-react v0.574.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* @license lucide-react v0.574.0 - ISC
|
|
29
|
+
*
|
|
30
|
+
* This source code is licensed under the ISC license.
|
|
31
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* @license lucide-react v0.574.0 - ISC
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the ISC license.
|
|
37
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* @license lucide-react v0.574.0 - ISC
|
|
41
|
+
*
|
|
42
|
+
* This source code is licensed under the ISC license.
|
|
43
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
44
|
+
*/
|
|
45
|
+
;function F({user:e,project:t,children:n}){let{id:r,number:i}=t,a=(0,N.useMemo)(()=>({projectId:r,projectNumber:i,user:e}),[r,i,e]);return/* @__PURE__ */ (0,P.jsx)(f,{value:a,children:n})}function I({label:e,loadingLabel:t,loading:n,onLoadMore:r,className:i,"data-testid":a}){return/* @__PURE__ */ (0,P.jsx)(`button`,{type:`button`,onClick:r,disabled:n,"aria-busy":n||void 0,"data-testid":a,className:C(`flex h-9 w-full items-center justify-center gap-2 rounded-md border border-dashed border-stroke-hover bg-transparent text-(length:--text-body-sm) font-medium text-fg-secondary transition-colors duration-(--motion-short) ease-out hover-enabled:border-solid hover-enabled:bg-surface-hover-layer hover-enabled:text-fg-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-stroke-focus aria-busy:cursor-progress`,i),children:n?/* @__PURE__ */ (0,P.jsxs)(P.Fragment,{children:[/* @__PURE__ */ (0,P.jsx)(v,{}),t]}):e})}var ie=6e4,L=Date.now(),R=/* @__PURE__ */ new Set,z;function B(e){return R.add(e),z===void 0&&(L=Date.now(),z=setInterval(()=>{L=Date.now(),R.forEach(e=>e())},ie)),()=>{R.delete(e),R.size===0&&z!==void 0&&(clearInterval(z),z=void 0)}}function V(){return L}function H(){return(0,N.useSyncExternalStore)(B,V,V)}function U(e,t){var n;return(e==null||(n=e.selection)==null?void 0:n.keySource)===t.selection.keySource&&e.selection.modelId===t.selection.modelId&&G(t.error)}function W(e,t){let n=t.unavailable[e.keySource];switch(e.disabledReason){case`plan_not_allowed`:return n.plan;case`toggle_disabled`:return n.disabled;case`no_key`:return n.noKey;case`key_invalid`:return n.invalid;case`ai_disabled`:return t.userDisabled;case`model_not_allowed`:return t.modelDisallowed;default:return t.modelUnavailable}}function ae(e,t){let n=e==null?void 0:e.inUse.errorCode;return n==null?null:t.refusals[n]}function oe(e,t,n){if(t===`plan_not_allowed`)return{label:e===`personal`?n.enterprise:n.planUnavailable,link:{label:n.upgrade,to:`plan`}};if(t===`ai_disabled`)return{label:n.userDisabled,link:{label:n.settings,to:`users`}};if(t===`model_not_allowed`)return{label:n.modelDisallowed,link:{label:n.settings,to:`models`}};let r=e===`personal`?`personalKey`:`companyKey`;return t===`toggle_disabled`?{label:n.unavailable[e].disabled}:{label:t===`no_key`?n.noKey:n.invalidKey,link:e===`managed`?void 0:{label:t===`no_key`?n.addKey:n.updateKey,to:r}}}function G(e){return!(e instanceof s&&e.status>=400&&e.status<500)}function se(e,t){if(!(e instanceof s))return t.serverFailed;if(e.status===0)return t.offline;if(G(e))return t.serverFailed;if(e.errorCode===`ai_models.selection_not_sendable`){var n;let r=T.safeParse((n=e.params)==null?void 0:n.disabledReason);return r.success?t.refusalReasons[r.data]:t.modelUnavailable}return t.serverRefused}var K={keys:`/settings/personal/ai`,personalKey:`/settings/personal/ai`,companyKey:`/settings/company/ai/providers`,plan:`/settings/company/billing/plan`,users:`/settings/company/ai/limits`,models:`/settings/company/ai/models`};function q(e){return K[e]}function J(e,t){return n(e,t)}function ce(e){return e.selectable&&e.sendable}var Y=[`Claude `,`Anthropic `];function le(e){for(let t of Y)if(e.startsWith(t)){let n=e.slice(t.length).trim();if(n!==``)return n}return e}function X(e,t){let n=e.groups.find(e=>e.type===t.keySource);if(n===void 0)return null;let r=n.models.find(e=>e.id===t.modelId);return r===void 0?null:{model:r,source:n.type}}function ue(e){let{pair:t}=e.userModel.inUse;return t===null?null:X(e,t)}var Z=class extends Error{constructor(e,t){super(t instanceof Error?t.message:`Model read failed`),this.occurredAt=/* @__PURE__ */ new Date,this.path=e,this.status=t instanceof s?t.status:void 0}};function de(e){return Promise.all([e.request({...g.availableModels,path:g.availableModels.path(),schema:S}).catch(e=>{throw new Z(g.availableModels.path(),e)}),e.request({...g.userModel,path:g.userModel.path(),schema:w}).catch(e=>{throw new Z(g.userModel.path(),e)})]).then(([e,t])=>({groups:e.providers,userModel:t}))}function Q({error:e,onRetry:t,surface:n=`chat`}){let i=_().shell.modelPicker,a=E(),[s]=(0,N.useState)(()=>/* @__PURE__ */ new Date),c=n===`popup`,l=e instanceof Z?e:null,d=((l==null?void 0:l.occurredAt)??s).toLocaleTimeString(a,{hour:`2-digit`,minute:`2-digit`}),f=(l==null?void 0:l.status)===void 0||l.status===0?null:l.status,m=[l===null?null:`GET ${l.path}`,f,d].filter(e=>e!==null).join(` \u00B7 `),g=[f,d].filter(e=>e!==null).join(` \u00B7 `),v=u(m,()=>void 0),y=/* @__PURE__ */ (0,P.jsxs)(`span`,{className:`qa-model-load-support`,children:[/* @__PURE__ */ (0,P.jsx)(`code`,{children:c?g:m}),/* @__PURE__ */ (0,P.jsx)(h,{content:i.copySupport,children:/* @__PURE__ */ (0,P.jsx)(`button`,{type:`button`,className:`qa-model-picker-icon-button`,"aria-label":i.copySupport,onClick:v.copy,disabled:v.status===`pending`,children:v.status===`copied`?/* @__PURE__ */ (0,P.jsx)(o,{"aria-hidden":`true`}):/* @__PURE__ */ (0,P.jsx)(p,{"aria-hidden":`true`})})}),/* @__PURE__ */ (0,P.jsx)(`span`,{className:`sr-only`,role:`status`,children:v.status===`copied`?i.copied:v.status===`failed`?i.copyFailed:``})]}),ee=/* @__PURE__ */ (0,P.jsx)(x,{type:`button`,variant:`secondary`,size:`xs`,onClick:t,children:i.retry});return/* @__PURE__ */ (0,P.jsxs)(`div`,{role:`alert`,className:`qa-model-load-failure qa-model-load-failure--${n}`,"data-testid":`ai-chat-capabilities-unavailable`,children:[c?/* @__PURE__ */ (0,P.jsx)(`span`,{className:`qa-model-load-failure-icon`,children:/* @__PURE__ */ (0,P.jsx)(r,{"aria-hidden":`true`})}):/* @__PURE__ */ (0,P.jsx)(r,{"aria-hidden":`true`}),/* @__PURE__ */ (0,P.jsxs)(`div`,{className:`qa-model-load-failure-message`,children:[/* @__PURE__ */ (0,P.jsx)(`span`,{children:i.loadingFailed}),!c&&y]}),ee,c&&y]})}var fe={company:re,personal:i};function pe(){return/* @__PURE__ */ (0,P.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:[/* @__PURE__ */ (0,P.jsx)(`path`,{d:`M6 20V6a2 2 0 0 1 2-2h5.5a5 5 0 0 1 0 10H9`}),/* @__PURE__ */ (0,P.jsx)(`circle`,{cx:`16.5`,cy:`18.5`,r:`1.6`,fill:`currentColor`,stroke:`none`})]})}var me=[`managed`,`company`,`personal`],he=`[role="menuitemradio"], [role="menuitem"]`;function $({source:e}){let t=_().shell.modelPicker.sources[e].label,n=e===`managed`?pe:fe[e];return/* @__PURE__ */ (0,P.jsxs)(`span`,{className:`qa-model-source`,role:`img`,"aria-label":t,children:[/* @__PURE__ */ (0,P.jsx)(n,{"aria-hidden":`true`}),/* @__PURE__ */ (0,P.jsx)(`span`,{className:`qa-model-source-text`,"aria-hidden":`true`,children:t})]})}function ge({capabilities:e,onOpen:n,onSelect:a,pending:s,writeFailure:c,onDismissWriteFailure:u,onRetryLoad:f,surface:p=`chat`,isStreaming:m=!1,onNavigate:g,openRequest:v=0,flagged:y=!1}){let b=_().shell.modelPicker,S=e.status===`ready`?e.value:null,C=p===`popup`,w=S==null?void 0:S.userModel,T=s??(w==null?void 0:w.selection)??(w==null?void 0:w.inUse.pair)??null,E=w==null?void 0:w.selection,re=ae(S==null?void 0:S.userModel,b),D=s===null&&E!=null&&!E.sendable?W(E,b):null,k=T===null?null:b.sources[T.keySource],A=T===null?S===null?b.selectModel:b.empty:C?T.name:le(T.name),j=T===null||k===null?A:`${T.name}, ${k.spoken}`,M=D===null?re:b.unavailableDescription(D),F=M===null?j:`${j} \u2014 ${M}`,I=S===null||m||s!==null,[ie,L]=(0,N.useState)(!1),R=(0,N.useId)(),z=(0,N.useRef)(null),B=(0,N.useRef)(null),V=(0,N.useRef)(null),H=t(),U=(0,N.useRef)(v),G=ie&&!I;(0,N.useEffect)(()=>{v!==U.current&&(U.current=v,I||(L(!0),n()))},[v,I,n]),(0,N.useEffect)(()=>{I&&L(!1)},[I]),(0,N.useLayoutEffect)(()=>{var e;if(!G||V.current===null)return;let t=V.current,n=t.querySelector(`[aria-checked="true"]`)??t.querySelector(he)??t.querySelector(`button`),r=H??((e=z.current)==null?void 0:e.querySelector(`.qa-model-picker-anchor`));if(r==null)return;let i=C?r.parentElement:ee(r);for(;C&&i!==null&&![`auto`,`scroll`,`hidden`,`clip`].includes(getComputedStyle(i).overflowY);)i=i.parentElement;let a=()=>{let e=i===null?0:Math.max(0,i.getBoundingClientRect().top);t.style.setProperty(`--qa-ai-chat-modelpicker-room`,`${r.getBoundingClientRect().top-e}px`)};a(),n==null||n.focus({preventScroll:!0}),n==null||n.scrollIntoView({block:`nearest`});let o=new ResizeObserver(a);return o.observe(r),i!==null&&o.observe(i),i==null||i.addEventListener(`scroll`,a),window.addEventListener(`resize`,a),()=>{o.disconnect(),i==null||i.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a)}},[G,H,C]),(0,N.useLayoutEffect)(()=>{let e=B.current,t=z.current,n=t==null?void 0:t.parentElement,r=e==null?void 0:e.querySelector(`.qa-model-picker-name-text`),i=r==null?void 0:r.parentElement,a=e==null?void 0:e.querySelector(`.qa-model-source-text`);if(C||t==null||n==null||e==null||i==null||r==null||a==null)return;let o=n.querySelector(`.qa-ai-chat-composer-grow`),s=()=>{e.removeAttribute(`data-compact`);let n=t.clientWidth+((o==null?void 0:o.clientWidth)??0);(i.scrollWidth>i.clientWidth||e.scrollWidth>e.clientWidth||e.clientWidth>n+1)&&(e.dataset.compact=``)};s();let c=new ResizeObserver(s);return c.observe(n),c.observe(i),o!==null&&c.observe(o),()=>c.disconnect()},[C,T==null?void 0:T.keySource,A,M]),(0,N.useEffect)(()=>{if(!G)return;let e=e=>{var t;e.target instanceof Node&&!((t=z.current)!=null&&t.contains(e.target))&&L(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[G]);let K=()=>{var e;L(!1),(e=B.current)==null||e.focus({preventScroll:!0})},J=e=>{K(),g(e)},Y=e=>{K(),a(e)},X=e=>{var t,n;if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),K();return}let r=Array.from(((t=V.current)==null?void 0:t.querySelectorAll(he))??[]);if(r.length===0)return;let i=r.indexOf(document.activeElement),a;switch(e.key){case`ArrowDown`:a=(i+1)%r.length;break;case`ArrowUp`:a=i<=0?r.length-1:i-1;break;case`Home`:a=0;break;case`End`:a=r.length-1;break;default:return}e.preventDefault(),(n=r[a])==null||n.focus()},ue=me.flatMap(e=>{let t=S==null?void 0:S.groups.find(t=>t.type===e);if(t===void 0||t.state===`toggle_disabled`&&e!==`managed`||t.state===`no_key`&&e===`company`)return[];let n=t.state===`ok`?t.models.filter(ce):[];if(t.state===`ok`&&n.length===0)return[];let r=t.state===`ok`?null:oe(e,t.state,b),i=t.canFix?r==null?void 0:r.link:void 0,a=t.state===`no_key`?O:t.state===`key_invalid`?ne:l,s=`${R}-${e}`;return/* @__PURE__ */ (0,P.jsxs)(`div`,{"data-testid":`model-picker-group-${e}`,className:`qa-model-menu-group`,role:`group`,"aria-labelledby":s,children:[/* @__PURE__ */ (0,P.jsx)(`div`,{id:s,className:`qa-model-menu-group-label`,"data-unavailable":r!==null,children:/* @__PURE__ */ (0,P.jsx)($,{source:e})}),r===null?n.map(t=>{let n=(T==null?void 0:T.keySource)===e&&T.modelId===t.id;return/* @__PURE__ */ (0,P.jsxs)(`button`,{"data-testid":`model-picker-option-${t.id}`,type:`button`,role:`menuitemradio`,tabIndex:-1,"aria-checked":n,className:`qa-model-menu-option`,"aria-label":`${t.name}, ${b.sources[e].spoken}`,onClick:()=>Y({keySource:e,modelId:t.id,name:t.name}),children:[/* @__PURE__ */ (0,P.jsx)(`span`,{children:t.name}),/* @__PURE__ */ (0,P.jsx)(o,{"aria-hidden":`true`,"data-testid":n?`model-picker-active-check`:void 0})]},t.id)}):/* @__PURE__ */ (0,P.jsxs)(`div`,{className:`qa-model-menu-reason`,children:[/* @__PURE__ */ (0,P.jsx)(a,{"aria-hidden":`true`,"data-warning":t.state===`key_invalid`}),/* @__PURE__ */ (0,P.jsx)(`span`,{children:r.label}),i!==void 0&&/* @__PURE__ */ (0,P.jsx)(`button`,{type:`button`,className:`qa-model-picker-link`,role:`menuitem`,tabIndex:-1,onClick:()=>J(q(i.to)),children:i.label})]})]},e)}),Z=c===null||G||S===null?null:/* @__PURE__ */ (0,P.jsxs)(`div`,{role:`alert`,className:`qa-model-picker-write-failure`,"data-testid":`model-picker-reject-error`,children:[/* @__PURE__ */ (0,P.jsx)(r,{"aria-hidden":`true`}),/* @__PURE__ */ (0,P.jsxs)(`span`,{children:[b.notSaved,`: `,se(c.error,b),`.`,` `,/* @__PURE__ */ (0,P.jsx)(`button`,{type:`button`,className:`qa-model-picker-link`,"aria-disabled":I,onClick:()=>{I||Y(c.selection)},children:b.retry})]}),!C&&/* @__PURE__ */ (0,P.jsx)(h,{content:b.dismiss,children:/* @__PURE__ */ (0,P.jsx)(`button`,{type:`button`,className:`qa-model-picker-icon-button`,"aria-label":b.dismiss,onClick:()=>{var e;u(),(e=B.current)==null||e.focus()},children:/* @__PURE__ */ (0,P.jsx)(d,{"aria-hidden":`true`})})})]});return/* @__PURE__ */ (0,P.jsxs)(`div`,{ref:z,className:`qa-ai-chat-modelpicker qa-ai-chat-modelpicker--${p}`,onBlur:e=>{G&&e.relatedTarget instanceof Node&&!e.currentTarget.contains(e.relatedTarget)&&L(!1)},children:[C&&/* @__PURE__ */ (0,P.jsx)(`div`,{className:`qa-model-picker-popup-label`,children:b.title}),C&&e.status===`failed`?/* @__PURE__ */ (0,P.jsx)(Q,{error:e.cause,onRetry:f,surface:`popup`}):/* @__PURE__ */ (0,P.jsxs)(`div`,{className:`qa-model-picker-anchor`,children:[e.status===`loading`&&s===null?/* @__PURE__ */ (0,P.jsx)(`span`,{className:`qa-ai-chat-modelpicker-skeleton`,"data-testid":`model-picker-trigger-skeleton`,role:`status`,"aria-label":b.loading}):/* @__PURE__ */ (0,P.jsx)(h,{relationship:`description`,content:m?b.streaming:e.status===`failed`?b.loadingFailed:F,children:/* @__PURE__ */ (0,P.jsxs)(`button`,{type:`button`,ref:B,className:`qa-ai-chat-modelpicker-trigger`,"data-testid":`model-picker-trigger`,"data-flagged":y,"data-empty":T===null,"aria-label":`${b.title}: ${F}`,"aria-haspopup":`menu`,"aria-expanded":G,"aria-controls":G?R:void 0,"aria-disabled":I||void 0,onKeyDown:e=>{G&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),K())},onClick:()=>{I||(G?K():(L(!0),n()))},children:[/* @__PURE__ */ (0,P.jsx)(`span`,{className:`qa-model-picker-name`,children:/* @__PURE__ */ (0,P.jsx)(`span`,{className:`qa-model-picker-name-text`,children:A})}),T!==null&&/* @__PURE__ */ (0,P.jsx)($,{source:T.keySource}),M!==null&&s===null&&/* @__PURE__ */ (0,P.jsx)(ne,{className:`qa-model-picker-warning`,"aria-hidden":`true`}),/* @__PURE__ */ (0,P.jsx)(te,{className:`qa-model-picker-chevron`,"aria-hidden":`true`})]})}),G&&/* @__PURE__ */ (0,P.jsxs)(`div`,{className:`qa-model-menu`,"data-testid":`model-picker-dropdown`,ref:V,onKeyDown:X,children:[/* @__PURE__ */ (0,P.jsxs)(`div`,{className:`qa-model-menu-head`,children:[/* @__PURE__ */ (0,P.jsx)(`h3`,{children:b.title}),/* @__PURE__ */ (0,P.jsx)(x,{type:`button`,variant:`ghost`,"data-testid":`model-picker-manage-keys-link`,size:`xs`,icon:/* @__PURE__ */ (0,P.jsx)(i,{}),onClick:()=>J(q(`keys`)),children:b.manageKeys})]}),e.status===`ready`&&e.refreshFailure!==void 0&&/* @__PURE__ */ (0,P.jsx)(Q,{error:e.refreshFailure.cause,onRetry:n,surface:p}),/* @__PURE__ */ (0,P.jsx)(`div`,{className:`qa-model-menu-scroll`,id:R,role:`menu`,"aria-label":b.title,children:ue})]})]}),Z]})}function _e(){return{now:()=>Date.now(),setTimeout:(e,t)=>globalThis.setTimeout(e,t),clearTimeout:e=>globalThis.clearTimeout(e)}}function ve(e,t){return e.request({...g.selectUserModel,path:g.selectUserModel.path(),body:y.parse({selection:{keySource:t.keySource,modelId:t.modelId}}),schema:w})}function ye(e,t){let n=`starting`,r=e.subscribe(()=>{n===`active`&&t(!0)});return queueMicrotask(()=>{n!==`disposed`&&(n=`active`,t(!1))}),()=>{n=`disposed`,r()}}function be(e,t,n){let r=null;return{async load(){return await(r==null?void 0:r.catch(()=>void 0)),de(e.http)},async select(i,a){if(r===null){r=b(ve(e.http,a),t,n).finally(()=>{r=null});try{await r}catch(e){throw await i.reloadCapabilities({background:!G(e)}),e}await i.reloadCapabilities()}},subscribe(t){var n;let r=e.userModelChanges.subscribe(t),i=(n=e.capabilityChanges)==null?void 0:n.subscribe(t);return()=>{i==null||i(),r()}}}}function xe(e,t,n){let[r,i]=(0,N.useState)(null),[a,o]=(0,N.useState)(null),s=(0,N.useRef)(!1);return a!==null&&U(n,a)&&o(null),{pending:r,writeFailure:a,onSelect:(0,N.useCallback)(n=>{s.current||(s.current=!0,o(null),i(n),e(n).catch(e=>{t.warn(`Chat: model selection failed`,{keySource:n.keySource,modelId:n.modelId,error:e}),o({selection:n,error:e})}).finally(()=>{s.current=!1,i(null)}))},[e,t]),onDismissWriteFailure:()=>o(null)}}export{O as C,k as S,I as _,_e as a,j as b,Q as c,de as d,J as f,H as g,W as h,ve as i,ue as l,ae as m,be as n,ge as o,G as p,ye as r,$ as s,xe as t,X as u,F as v,D as w,A as x,M as y};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
function e(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 t(e,t=`|`){return e.map(e=>ue(e)).join(t)}function n(e,t){return typeof t==`bigint`?t.toString():t}var r=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function i(e){return new r(e)}function a(e){return e==null}function o(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function s(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var c=/* @__PURE__*/ Symbol(`evaluating`);function l(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==c)return r===void 0&&(r=c,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function u(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function d(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t!=null&&t.get?t.get.raw:t==null?void 0:t.value}function f(e){return d(e._zod.def)??e._zod.def.shape}function p(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return u(this,t,e),e},enumerable:!0,configurable:!0})}function m(e,t,n){t in e?u(e,t,n):e[t]=n}function h(e,t,n,r){let i=f(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?p(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):m(e,a,r?r(n.value,a):n.value))}}function ee(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?p(e,n,()=>t[n]):m(e,n,r.value))}}function g(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function te(e){return JSON.stringify(e)}function ne(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var re=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ie(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ae=/* @__PURE__*/ i(()=>{var e;if(D.jitless||typeof navigator<`u`&&(e=navigator)!=null&&(e=e.userAgent)!=null&&e.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function oe(e){if(ie(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ie(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function se(e){return oe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ce=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]),le=/* @__PURE__*/ new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function _(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function v(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function y(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ue(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function de(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var fe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},pe={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};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`);let i={};return h(i,e,he(e,t)),v(e,g(n,{shape:i,checks:[]}))}function he(e,t){let n=f(e),r=[];for(let e of Reflect.ownKeys(t)){var i;if(!((i=Object.getOwnPropertyDescriptor(n,e))!=null&&i.enumerable))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function ge(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`);let i=new Set(he(e,t)),a={};return h(a,e,Reflect.ownKeys(f(e)).filter(e=>!i.has(e))),v(e,g(n,{shape:a,checks:[]}))}function _e(e,t){if(!oe(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=f(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return v(e,g(e._zod.def,{shape:ve(e,t)}))}function ve(e,t){let n={};return h(n,e,Reflect.ownKeys(f(e))),ee(n,t),n}function ye(e,t){if(!oe(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return v(e,g(e._zod.def,{shape:ve(e,t)}))}function be(e,t){var n,r;if(!(t!=null&&(n=t._zod)!=null&&n.def))throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((r=e._zod.def.checks)!=null&&r.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let i={};return h(i,e,Reflect.ownKeys(f(e))),h(i,t,Reflect.ownKeys(f(t))),v(e,g(e._zod.def,{shape:i,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function xe(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(he(t,n)):void 0,o={};return h(o,t,Reflect.ownKeys(f(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),v(t,g(t._zod.def,{shape:o,checks:[]}))}function Se(e,t,n){let r=n?new Set(he(t,n)):void 0,i={};return h(i,t,Reflect.ownKeys(f(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),v(t,g(t._zod.def,{shape:i}))}function b(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++){var n;if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0}return!1}function Ce(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++){var n;if(((n=e.issues[r])==null?void 0:n.continue)===!1)return!0}return!1}function x(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==null?void 0:e.message}function Te(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Ee(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function S(e,t,n){var r,i,a,o,s,c,l,u;let d=(r=e.inst)==null||(r=r._zod)==null?void 0:r.traits;d!=null&&d.has(`$ZodType`)&&(d.has(`$ZodCheck`)?(u=e).schema??(u.schema=e.inst):e.schema=e.inst);let f=e.schema===e.inst||(i=e.schema)==null||(i=i._zod.def)==null?void 0:i.error,p=e.message?e.message:we((a=e.inst)==null||(a=a._zod.def)==null||(o=a.error)==null?void 0:o.call(a,e))??we(f==null?void 0:f(e))??we(t==null||(s=t.error)==null?void 0:s.call(t,e))??we((c=n.customError)==null?void 0:c.call(n,e))??we((l=n.localeError)==null?void 0:l.call(n,e))??`Invalid input`,m={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(m[t]=e[t]);return m.path??=[],m.message=p,t!=null&&t.reportInput&&(m.input=e.input),m}var De=/[\uD800-\uDBFF]/;function Oe(e){let t=e.length;if(!De.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function ke(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ae(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function je(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Me(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Fe(e,n,r.value)}}function C(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ne(e,t,n){return C(e,t,n,!1)}/* @__NO_SIDE_EFFECTS__ */
|
|
2
|
+
function Pe(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return C(this,n,r(this))},set(e){C(this,n,e)}})}return t}function Fe(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:C(this,t,n.bind(this))},set(e){C(this,t,e)}})}function Ie(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Le,Re=!1,ze={configurable:!0,get(){Re=!0}};function w(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Le!==e._zod?Le=void 0:(Le=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,ze);let e=Re;Re=!1;try{let r=n(this);return Re?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Re||=e,r}catch(n){throw delete this[t],Re||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function Be(e,t,n,r){let i=Ie(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Ve=`~constantCatch`;function He(e){let t=()=>e;return t[Ve]=!0,t}var Ue,We=/*@__PURE__*/ Object.freeze({status:`aborted`}),Ge={value:void 0,enumerable:!1},Ke=`captureStackTrace`in Error?Error:null;function qe(e){let t=Ke;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Ke=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}/* @__NO_SIDE_EFFECTS__ */
|
|
3
|
+
function T(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){Ge.value=new a(r);try{Object.defineProperty(n,"_zod",Ge)}finally{Ge.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Me(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=(r==null?void 0:r.Parent)??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){var t;let n=r!=null&&r.Parent?qe(u):this;c(n,e);let i=n._zod.deferred;if(i){for(let e of i)e();n._zod.deferred=void 0}let a=(t=globalThis.__zod_globalConfig)==null?void 0:t.postProcessor;return a&&a(n),n}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>{var n;return r!=null&&r.Parent&&t instanceof r.Parent?!0:t==null||(n=t._zod)==null||(n=n.traits)==null?void 0:n.has(e)}}),Object.defineProperty(d,"name",{value:e}),d}var E=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Je=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Ue=globalThis).__zod_globalConfig??(Ue.__zod_globalConfig={});var D=globalThis.__zod_globalConfig;function O(e){return e&&Object.assign(D,e),D}function Ye(){let e=this._zod;return e.message??=JSON.stringify(e.def,n,2),e.message}function Xe(e){this._zod.message=e}var Ze={get:Ye,set:Xe,enumerable:!0,configurable:!0},Qe={value:void 0,enumerable:!1},$e=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),et=/* @__PURE__ */ T(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Qe.value=t,Object.defineProperty(e,"issues",Qe),Qe.value=void 0,Object.defineProperty(e,"message",Ze);let n=Object.getPrototypeOf(e);$e.has(n)||($e.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function tt(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function nt(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?tt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function rt(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],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function it(e,t){return{callee:(t==null?void 0:t.callee)??e,Err:t==null?void 0:t.Err}}var at=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new E;if(s.issues.length){let n=new((a==null?void 0:a.Err)??e)(s.issues.map(e=>S(e,o,O())));throw re(n,(a==null?void 0:a.callee)??t),n}return s.value};return t},ot=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a==null?void 0:a.Err)??e)(s.issues.map(e=>S(e,o,O())));throw re(n,(a==null?void 0:a.callee)??t),n}return s.value};return t},st=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 E;return a.issues.length?ct(e,a.issues,i):{success:!0,data:a.value}};function ct(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>S(e,n,O()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var lt=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?ct(e,a.issues,i):{success:!0,data:a.value}},ut=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),dt=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),ft=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==ut)return!0;if(r.definite===!0&&n===void 0)return!1}return pt(e,t,n)});function pt(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[dt]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new E;return a.issues.length===0}var mt=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},ht=e=>{let t=at(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,it(n,a))};return n},gt=e=>{let t=at(e),n=(e,r,i,a)=>t(e,r,i,it(n,a));return n},_t=e=>{let t=ot(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,it(n,a))};return n},vt=e=>{let t=ot(e),n=async(e,r,i,a)=>await t(e,r,i,it(n,a));return n},yt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return st(e)(t,n,i)},bt=e=>(t,n,r)=>st(e)(t,n,r),xt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return lt(e)(t,n,i)},St=e=>async(t,n,r)=>lt(e)(t,n,r),Ct=/^[cC][0-9a-z]{6,}$/,wt=/^[0-9a-z]+$/,Tt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Et=/^[0-9a-vA-V]{20}$/,Dt=/^[A-Za-z0-9]{27}$/,Ot=/^[a-zA-Z0-9_-]{21}$/;function kt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var At=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,jt=/^([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})$/,Mt=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)$/,Nt=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Pt=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Ft(){return new RegExp(Pt,`u`)}var It=/^(?:(?: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])$/,Lt=/^(([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}|:))$/,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])\/([0-9]|[1-2][0-9]|3[0-2])$/,zt=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Bt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Vt=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Ht=/^https?$/,Ut=/^\+[1-9]\d{6,14}$/,Wt=`(?:(?:\\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])))`;function Gt(e){return RegExp(`^${e}$`)}var Kt=/*@__PURE__*/ Gt(Wt);function qt(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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Jt(e){return RegExp(`^${qt(e)}$`)}function Yt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${qt({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${qt({precision:e.precision})}`:n;return RegExp(`^${Wt}T(?:${r})$`)}var Xt=/^[\s\S]{0,}$/,Zt=e=>{let t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Qt=/^-?\d+n?$/,$t=/^-?\d+$/,en=/^-?\d+(?:\.\d+)?$/,tn=/^(?:true|false)$/i,nn=/^null$/i,rn=/^[^A-Z]*$/,an=/^[^a-z]*$/,k=/*@__PURE__*/ T(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),on=e=>{let t=e.value;return!a(t)&&t.length!==void 0},sn={number:`number`,bigint:`bigint`,object:`date`},cn=/*@__PURE__*/ T(`$ZodCheckLessThan`,(e,t)=>{k.init(e,t);let n=sn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:sn[typeof r.value]??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})}}),ln=/*@__PURE__*/ T(`$ZodCheckGreaterThan`,(e,t)=>{k.init(e,t);let n=sn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:sn[typeof r.value]??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})}}),un=/*@__PURE__*/ T(`$ZodCheckMultipleOf`,(e,t)=>{k.init(e,t),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`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):s(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),dn=/*@__PURE__*/ T(`$ZodCheckNumberFormat`,(e,t)=>{var n;k.init(e,t),t.format=t.format||`float64`;let r=(n=t.format)==null?void 0:n.includes(`int`),i=r?`int`:`number`,[a,o]=fe[t.format];e._zod.check=n=>{let s=n.value;if(r){if(!Number.isInteger(s)){n.issues.push({expected:i,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?n.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:i,inclusive:!0,continue:!t.abort}):n.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}s<a&&n.issues.push({origin:`number`,input:s,code:`too_small`,minimum:a,inclusive:!0,inst:e,continue:!t.abort}),s>o&&n.issues.push({origin:`number`,input:s,code:`too_big`,maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),fn=/*@__PURE__*/ T(`$ZodCheckMaxLength`,(e,t)=>{var n;k.init(e,t),(n=e._zod.def).when??(n.when=on),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Oe(r):i)<=t.maximum)return;let a=ke(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),pn=/*@__PURE__*/ T(`$ZodCheckMinLength`,(e,t)=>{var n;k.init(e,t),(n=e._zod.def).when??(n.when=on),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Oe(r):i)>=t.minimum)return;let a=ke(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),mn=/*@__PURE__*/ T(`$ZodCheckLengthEquals`,(e,t)=>{var n;k.init(e,t),(n=e._zod.def).when??(n.when=on),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Oe(r):i;if(a===t.length)return;let o=ke(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),hn=/*@__PURE__*/ T(`$ZodCheckStringFormat`,(e,t)=>{var n,r;k.init(e,t),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=()=>{})}),gn=/*@__PURE__*/ T(`$ZodCheckRegex`,(e,t)=>{hn.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})}}),_n=/*@__PURE__*/ T(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=rn,hn.init(e,t)}),vn=/*@__PURE__*/ T(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=an,hn.init(e,t)}),yn=/*@__PURE__*/ T(`$ZodCheckIncludes`,(e,t)=>{k.init(e,t);let n=_(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),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})}}),bn=/*@__PURE__*/ T(`$ZodCheckStartsWith`,(e,t)=>{k.init(e,t);let n=RegExp(`^${_(t.prefix)}.*`);t.pattern??=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})}}),xn=/*@__PURE__*/ T(`$ZodCheckEndsWith`,(e,t)=>{k.init(e,t);let n=RegExp(`.*${_(t.suffix)}$`);t.pattern??=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})}}),Sn=/*@__PURE__*/ T(`$ZodCheckOverwrite`,(e,t)=>{k.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Cn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--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(){var e;let t=Function,n=((e=this)==null?void 0:e.content)??[``];return new t(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${n.join(`
|
|
5
|
+
`)}\n};`)(...Object.values(this.closed))}},wn={major:4,minor:6,patch:7},A=/*@__PURE__*/ T(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wn;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r!=null&&r.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0){var a;(n=e._zod).deferred??(n.deferred=[]),(a=e._zod.deferred)==null||a.push(()=>{e._zod.run=e._zod.parse})}else{let t=(t,n,r)=>{if(t.memo)return t;let i=b(t),a;for(let o of n){if(o._zod.def.when){if(Ce(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&(r==null?void 0:r.async)===!1)throw new E;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Ee(t.issues,n,e),i||=b(t,n))});else{if(t.issues.length===n)continue;Ee(t.issues,n,e),i||=b(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(b(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new E;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new E;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Ne(this,`~standard`,Dn(this))},set"~standard"(e){C(this,`~standard`,e)}}),Tn=(e,t)=>e.issues.length?{issues:e.issues.map(e=>S(e,t,O()))}:{value:e.value};async function En(e,t){let n={async:!0};return Tn(await e._zod.run({value:t,issues:[]},n),n)}function Dn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Tn(r,n)}catch{}return En(e,t)},vendor:`zod`,version:1}}var On=/*@__PURE__*/ T(`$ZodString`,(e,t)=>{A.init(e,t),e._zod.pattern=t.pattern??Xt,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}}),j=/*@__PURE__*/ T(`$ZodStringFormat`,(e,t)=>{hn.init(e,t),On.init(e,t)}),kn=/*@__PURE__*/ T(`$ZodGUID`,(e,t)=>{t.pattern??=jt,j.init(e,t)}),An=/*@__PURE__*/ T(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Mt(e)}else t.pattern??=Mt();j.init(e,t)}),jn=/*@__PURE__*/ T(`$ZodEmail`,(e,t)=>{t.pattern??=Nt,j.init(e,t)});function Mn(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Nn(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Mn(e)||2:Pn(e,t)}function Pn(e,t){var n;if(!t.normalize&&((n=t.protocol)==null?void 0:n.source)===Ht.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var Fn=/[\t\n\r]/g;function In(e){return e.replace(Fn,``)}function Ln(e,t){return t.lastIndex=0,t.test(e.hostname)}function Rn(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var zn=/*@__PURE__*/ T(`$ZodURL`,(e,t)=>{j.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Nn(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=In(r);return}t.hostname&&!Ln(i,t.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&&!Rn(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:In(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Bn=/*@__PURE__*/ T(`$ZodEmoji`,(e,t)=>{t.pattern??=Ft(),j.init(e,t)}),Vn=/*@__PURE__*/ T(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Ot:kt(t.length),j.init(e,t)}),Hn=/*@__PURE__*/ T(`$ZodCUID`,(e,t)=>{t.pattern??=Ct,j.init(e,t)}),Un=/*@__PURE__*/ T(`$ZodCUID2`,(e,t)=>{t.pattern??=wt,j.init(e,t)}),Wn=/*@__PURE__*/ T(`$ZodULID`,(e,t)=>{t.pattern??=Tt,j.init(e,t)}),Gn=/*@__PURE__*/ T(`$ZodXID`,(e,t)=>{t.pattern??=Et,j.init(e,t)}),Kn=/*@__PURE__*/ T(`$ZodKSUID`,(e,t)=>{t.pattern??=Dt,j.init(e,t)}),qn=/*@__PURE__*/ T(`$ZodISODateTime`,(e,t)=>{t.pattern??=Yt(t),j.init(e,t)}),Jn=/*@__PURE__*/ T(`$ZodISODate`,(e,t)=>{t.pattern??=Kt,j.init(e,t)}),Yn=/*@__PURE__*/ T(`$ZodISOTime`,(e,t)=>{t.pattern??=Jt(t),j.init(e,t)}),Xn=/*@__PURE__*/ T(`$ZodISODuration`,(e,t)=>{t.pattern??=At,j.init(e,t)}),Zn=/*@__PURE__*/ T(`$ZodIPv4`,(e,t)=>{t.pattern??=It,j.init(e,t)}),Qn=/^[0-9a-fA-F:.]+$/;function $n(e){return Qn.test(e)?Mn(`http://[${e}]`):!1}var er=/*@__PURE__*/ T(`$ZodIPv6`,(e,t)=>{t.pattern??=Lt,j.init(e,t),e._zod.check=n=>{$n(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),tr=/*@__PURE__*/ T(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Rt,j.init(e,t)});function nr(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:$n(n)}var rr=/*@__PURE__*/ T(`$ZodCIDRv6`,(e,t)=>{t.pattern??=zt,j.init(e,t),e._zod.check=n=>{nr(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function ir(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var ar=/^[0-9a-zA-Z+/]*={0,2}$/,or=/*@__PURE__*/ T(`$ZodBase64`,(e,t)=>{t.pattern??=ar,j.init(e,t),e._zod.check=n=>{ir(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),sr=/^[A-Za-z0-9_-]*$/;function cr(e){if(!sr.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return ir(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var lr=/*@__PURE__*/ T(`$ZodBase64URL`,(e,t)=>{t.pattern??=sr,j.init(e,t),e._zod.check=n=>{cr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),ur=/*@__PURE__*/ T(`$ZodE164`,(e,t)=>{t.pattern??=Ut,j.init(e,t)});function dr(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==null?void 0:i.typ)!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var fr=/*@__PURE__*/ T(`$ZodJWT`,(e,t)=>{j.init(e,t),e._zod.check=n=>{dr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),pr=/*@__PURE__*/ T(`$ZodNumber`,(e,t)=>{A.init(e,t),e._zod.pattern=en,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:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),mr=/*@__PURE__*/ T(`$ZodNumberFormat`,(e,t)=>{dn.init(e,t),pr.init(e,t)}),hr=/*@__PURE__*/ T(`$ZodBoolean`,(e,t)=>{A.init(e,t),e._zod.pattern=tn,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}}),gr=/*@__PURE__*/ T(`$ZodBigInt`,(e,t)=>{A.init(e,t),e._zod.pattern=Qt,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}}),_r=/*@__PURE__*/ T(`$ZodNull`,(e,t)=>{A.init(e,t),e._zod.pattern=nn,e._zod.values=/* @__PURE__ */ 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}}),vr=/*@__PURE__*/ T(`$ZodUnknown`,(e,t)=>{A.init(e,t),e._zod.parse=e=>e}),yr=/*@__PURE__*/ T(`$ZodNever`,(e,t)=>{A.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),br=/*@__PURE__*/ T(`$ZodDate`,(e,t)=>{A.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function xr(e,t){let n=Te(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!(a!=null&&a.skipChecks)&&(a==null?void 0:a.direction)!==`backward`){for(let[t,r]of Te(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Ee(n.issues,t,e),n}}return i(n,a)}}var Sr=e=>Array.isArray(e)?e.length:-1;function Cr(e,t,n){e.issues.length&&t.issues.push(...x(n,e.issues)),t.value[n]=e.value}var wr=/*@__PURE__*/ T(`$ZodArray`,(e,t)=>{A.init(e,t);let n=D.memoizer;n==null||n.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i==null?void 0:i.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Cr(t,r,e)));else if(Cr(c,r,e),s&&c.issues.length!==0&&b(c))break}return o.length?Promise.all(o).then(()=>r):r},xr(e,Sr)});function Tr(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...x(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var Er=[];function Dr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Er,i=r.length?[...t,...r]:t;for(let t of i){var a;if(!((a=e.shape)!=null&&(a=a[t])!=null&&(a=a._zod)!=null&&(a=a.traits)!=null&&a.has(`$ZodType`)))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`)}let o=de(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function Or(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(b(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Tr(e,n,i,t,d,f))):Tr(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var kr=/*@__PURE__*/ T(`$ZodObject`,(e,t)=>{A.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n!=null&&n.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let a=i(()=>Dr(t));w(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||u(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let o=ie,s=t.catchall,c,l=D.memoizer;l==null||l.attach(e),e._zod.parse=(t,n)=>{c??=a.value;let r=t.value;if(!o(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=l?l.alloc(e,t,{},n):{};let i=[],u=c.shape,d=n==null?void 0:n.abortEarly,f=t.issues.length;for(let e of c.allKeys){if(d&&t.issues.length!==f){if(b(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let a=u[e],o=a._zod.optin,s=a._zod.optout,c=a._zod.run({value:r[e],issues:[]},n);c instanceof Promise?i.push(c.then(n=>Tr(n,t,e,r,o,s))):Tr(c,t,e,r,o,s)}return s?Or(i,r,t,n,a.value,e,d===!0):i.length?Promise.all(i).then(()=>t):t}}),Ar=/*@__PURE__*/ T(`$ZodObjectJIT`,(e,t)=>{kr.init(e,t);let n=e._zod.parse,r=i(()=>Dr(t)),a=D.memoizer,o=t=>{let n=r.value,i=n.symbolKeys,o=new Cn([`payload`,`ctx`],{shape:t,inst:e,memo:a,syms:i}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
6
|
+
let ${e}_ab = false;
|
|
7
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
8
|
+
const iss = ${e}.issues[i];
|
|
9
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
10
|
+
payload.issues.push(iss);
|
|
11
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
12
|
+
}
|
|
13
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
14
|
+
payload.value = newResult;
|
|
15
|
+
return payload;
|
|
16
|
+
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(a?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){var d,f;if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${i.indexOf(e)}]`:te(e),a=`${r} in input`,u=t[e],p=u==null||(d=u._zod)==null?void 0:d.optin,m=p!==void 0,h=(u==null||(f=u._zod)==null?void 0:f.optout)===`optional`;if(o.write(`const ${n} = ${s(r)};`),m&&h){let e=p===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
17
|
+
const ${n}_present = ${a};
|
|
18
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
19
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (${e}) {
|
|
23
|
+
newResult[${r}] = ${n}.value;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
`)}else m?(o.write(`
|
|
28
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
29
|
+
}
|
|
30
|
+
`),p===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
31
|
+
if (${n}.value !== undefined || ${a}) {
|
|
32
|
+
newResult[${r}] = ${n}.value;
|
|
33
|
+
}
|
|
34
|
+
`)):o.write(`
|
|
35
|
+
const ${n}_present = ${a};
|
|
36
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
37
|
+
}
|
|
38
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
39
|
+
payload.issues.push({
|
|
40
|
+
code: "invalid_type",
|
|
41
|
+
expected: "nonoptional",
|
|
42
|
+
input: undefined,
|
|
43
|
+
path: [${r}]
|
|
44
|
+
});
|
|
45
|
+
if (ctx && ctx.abortEarly) {
|
|
46
|
+
payload.value = newResult;
|
|
47
|
+
return payload;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (${n}_present) {
|
|
52
|
+
newResult[${r}] = ${n}.value;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},s,c=ie,l=!D.jitless,u=l&&ae.value,d=t.catchall,f;e._zod.parse=(i,a)=>{f??=r.value;let p=i.value;return c(p)?l&&u&&(a==null?void 0:a.async)===!1&&a.jitless!==!0?(s||=o(t.shape),i=s(i,a),d?Or([],p,i,a,f,e,(a==null?void 0:a.abortEarly)===!0):i):n(i,a):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function jr(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=>!b(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=>S(e,r,O())))}),t)}var Mr=/*@__PURE__*/ T(`$ZodUnion`,(e,t)=>{A.init(e,t),w(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),w(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),w(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),w(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>o(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=>jr(t,r,e,i)):jr(o,r,e,i)}});function Nr(e){let t=/* @__PURE__ */ new Map;for(let r of e.options){var n;let i=(n=r._zod.propValues)==null?void 0:n[e.discriminator];if(!i||i.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let e of i)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,r)}return t}var Pr=/*@__PURE__*/ T(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Mr.init(e,t);let n=e._zod.parse;w(e,`propValues`,e=>{var t;let n={},r=0;for(let t of e.def.options){var i;let a=t._zod.propValues;if(!a||Object.keys(a).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(t)}"`);(i=a[e.def.discriminator])!=null&&i.has(void 0)&&r++;for(let[e,t]of Object.entries(a)){Object.prototype.hasOwnProperty.call(n,e)||u(n,e,/* @__PURE__ */ new Set);for(let r of t)n[e].add(r)}}return!e.def.unionFallback&&r>1&&((t=n[e.def.discriminator])==null||t.delete(void 0)),n}),t.options.forEach((e,n)=>{let r=d(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=i(()=>Nr(t));e._zod.parse=(i,a)=>{let o=i.value;if(!ie(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o==null?void 0:o[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),Fr=/*@__PURE__*/ T(`$ZodIntersection`,(e,t)=>{A.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])=>Lr(e,t,n)):Lr(e,i,a)}});function Ir(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(oe(e)&&oe(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Ir(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=Ir(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 Lr(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ new Map,o=(e,t)=>{var n,o;let s;if(e.code===`unrecognized_keys`&&!((n=e.path)!=null&&n.length))i??=e,s=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&((o=e.path)==null?void 0:o.length)===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),s=[t]}else return!1;for(let e of s)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Ir(t.value,n.value);if(!c.valid){if(b(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Rr=/*@__PURE__*/ T(`$ZodTuple`,(e,t)=>{A.init(e,t);let n=t.items,r=D.memoizer;r==null||r.attach(e),e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=r?r.alloc(e,i,[],a):[];let s=[],c=zr(n,`optin`),l=zr(n,`optout`);if(!t.rest){if(o.length<c)return i.issues.push({code:`too_small`,minimum:c,inclusive:!0,input:o,inst:e,origin:`array`}),i;o.length>n.length&&i.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:o,inst:e,origin:`array`})}let u=Array(n.length),d=t.rest?a==null?void 0:a.abortEarly:void 0,f=!1;for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:o[e],issues:[]},a);t instanceof Promise?s.push(t.then(t=>{u[e]=t})):(u[e]=t,d&&!f&&t.issues.length&&(f=b(t)))}if(t.rest&&!f){let e=n.length-1,r=o.slice(n.length),c=i.issues.length;for(let n of r){if(d&&i.issues.length!==c){if(b(i,c))break;c=i.issues.length}e++;let r=t.rest._zod.run({value:n,issues:[]},a);r instanceof Promise?s.push(r.then(t=>Br(t,i,e))):Br(r,i,e)}}return s.length?Promise.all(s).then(()=>Vr(u,i,n,o,l)):Vr(u,i,n,o,l)}});function zr(e,t){for(let n=e.length-1;n>=0;n--)if(!(t===`optin`?e[n]._zod.optin!==void 0:e[n]._zod.optout===`optional`))return n+1;return 0}function Br(e,t,n){e.issues.length&&t.issues.push(...x(n,e.issues)),t.value[n]=e.value}function Vr(e,t,n,r,i){for(let a=0;a<n.length;a++){let o=e[a],s=a<r.length;if(!s&&a>=i&&n[a]._zod.optin===`optional`){t.value.length=a;break}if(o.issues.length){if(!s&&a>=i){t.value.length=a;break}t.issues.push(...x(a,o.issues))}t.value[a]=o.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}var Hr=/*@__PURE__*/ T(`$ZodRecord`,(e,t)=>{A.init(e,t);let n=D.memoizer;n==null||n.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!oe(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=/* @__PURE__ */ new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>S(e,i,O())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...x(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...x(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&en.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>S(e,i,O())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...x(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...x(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Ur=/*@__PURE__*/ T(`$ZodEnum`,(t,n)=>{A.init(t,n);let r=e(n.entries),i=new Set(r);t._zod.values=i,w(t,`pattern`,t=>{let n=e(t.def.entries).filter(e=>ce.has(typeof e));return RegExp(n.length?`^(${n.map(e=>_(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),t._zod.parse=(e,n)=>{let a=e.value;return i.has(a)||e.issues.push({code:`invalid_value`,values:r,input:a,inst:t}),e}}),Wr=/*@__PURE__*/ T(`$ZodLiteral`,(e,t)=>{A.init(e,t);let n=new Set(t.values);e._zod.values=n,w(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?_(e):e?_(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Gr=/*@__PURE__*/ T(`$ZodTransform`,(e,t)=>{var n;A.init(e,t),e._zod.optin=`optional`,(n=D.memoizer)==null||n.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Je(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new E;return n.value=i,n}});function Kr(e,t){return e.value=t.issues.length?void 0:t.value,e}var qr=/*@__PURE__*/ T(`$ZodOptional`,(e,t)=>{A.init(e,t),w(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,w(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),w(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${o(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Kr(e,t)):Kr(e,r)}return t.innerType._zod.run(e,n)}}),Jr=/*@__PURE__*/ T(`$ZodExactOptional`,(e,t)=>{qr.init(e,t),w(e,`values`,e=>e.def.innerType._zod.values),w(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Yr=/*@__PURE__*/ T(`$ZodNullable`,(e,t)=>{A.init(e,t),w(e,`optin`,e=>e.def.innerType._zod.optin),w(e,`optout`,e=>e.def.innerType._zod.optout),w(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${o(t.source)}|null)$`):void 0}),w(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Xr=/*@__PURE__*/ T(`$ZodDefault`,(e,t)=>{A.init(e,t),e._zod.optin=`defaulted`,w(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Zr(e,t)):Zr(r,t)}});function Zr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Qr=/*@__PURE__*/ T(`$ZodPrefault`,(e,t)=>{A.init(e,t),e._zod.optin=`defaulted`,w(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),$r=/*@__PURE__*/ T(`$ZodNonOptional`,(e,t)=>{A.init(e,t),w(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ei(t,e)):ei(i,e)}});function ei(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function ti(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>S(e,r,O()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var ni=/*@__PURE__*/ T(`$ZodCatch`,(e,t)=>{A.init(e,t),w(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),w(e,`optout`,e=>e.def.innerType._zod.optout),w(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>ti(e,r,t,n)):ti(e,r,t,n)}}),ri=/*@__PURE__*/ T(`$ZodPipe`,(e,t)=>{A.init(e,t),w(e,`values`,e=>e.def.in._zod.values),w(e,`optin`,e=>e.def.in._zod.optin),w(e,`optout`,e=>e.def.out._zod.optout),w(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ii(e,t.in,n)):ii(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ii(e,t.out,n)):ii(r,t.out,n)}});function ii(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var ai=/*@__PURE__*/ T(`$ZodPreprocess`,(e,t)=>{ri.init(e,t)}),oi=/*@__PURE__*/ T(`$ZodReadonly`,(e,t)=>{A.init(e,t),w(e,`propValues`,e=>e.def.innerType._zod.propValues),w(e,`values`,e=>e.def.innerType._zod.values),w(e,`optin`,e=>{var t;return(t=e.def.innerType)==null||(t=t._zod)==null?void 0:t.optin}),w(e,`optout`,e=>{var t;return(t=e.def.innerType)==null||(t=t._zod)==null?void 0:t.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(si):si(r)}});function si(e){return e.memo||(e.value=Object.freeze(e.value)),e}function ci(e){var t,n;let r=e._zod.def,i=r.pattern,a=!!((t=r.format)!=null&&t.includes(`int`)),o,s;for(let e of r.checks??[]){var c;let t=e._zod.def;t.pattern&&(i=t.pattern),a||=!!((c=t.format)!=null&&c.includes(`int`));let n=t.minimum??t.length,r=t.maximum??t.length;n!==void 0&&(o===void 0||n>o)&&(o=n),r!==void 0&&(s===void 0||r<s)&&(s=r)}if(i)return i.source;if(o!==void 0&&s!==void 0&&o>s)return`(?!)`;if(o!==void 0||s!==void 0)return Zt({minimum:o,maximum:s}).source;let l=e._zod.pattern;return(n=a&&l===en?$t:l)==null?void 0:n.source}function li(e){var t;let n=e._zod.def,r=(t=e._zod.pattern)==null?void 0:t.source,i=n.innerType??e._zod.innerType;if(i){var a;let e=(a=i._zod.pattern)==null?void 0:a.source,t=li(i);return r&&e&&t&&t!==e?r.replace(o(e),()=>o(t)):r}if(n.options){let e=n.options.map(li);if(e.every(Boolean))return`^(${e.map(e=>o(e)).join(`|`)})$`}return ci(e)}var ui=/*@__PURE__*/ T(`$ZodTemplateLiteral`,(e,t)=>{A.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){let t=li(e);if(!t)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);n.push(o(t))}else if(e===null||le.has(typeof e))n.push(_(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`string`,code:`invalid_type`}),n)}),di=/*@__PURE__*/ T(`$ZodLazy`,(e,t)=>{A.init(e,t),l(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),w(e,`pattern`,e=>{var t;return(t=e.innerType)==null||(t=t._zod)==null?void 0:t.pattern}),w(e,`propValues`,e=>{var t;return(t=e.innerType)==null||(t=t._zod)==null?void 0:t.propValues}),w(e,`optin`,e=>{var t;return((t=e.innerType)==null||(t=t._zod)==null?void 0:t.optin)??void 0}),w(e,`optout`,e=>{var t;return((t=e.innerType)==null||(t=t._zod)==null?void 0:t.optout)??void 0}),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),fi=/*@__PURE__*/ T(`$ZodCustom`,(e,t)=>{k.init(e,t),A.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=>pi(t,n,r,e));pi(i,n,r,e)}});function pi(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(je(e))}}var mi=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},hi=`~memo`,gi=[];function _i(e){return typeof e==`object`&&!!e}function vi(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var yi=/*@__PURE__*/ new WeakMap,bi=0,xi=1,Si=2;function Ci(e,t,n){let r=yi.get(e);if(r!==void 0)return r?Si:bi;if(t.has(e))return Si;t.add(e);let i=bi,a=e=>{if(i!==Si&&e!=null&&e._zod){let r=Ci(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=bi;for(let o of Reflect.ownKeys(e)){var a;let s=Object.getOwnPropertyDescriptor(e,o);if(r&&!s.enumerable)continue;let c=s.get?xi:(a=s.value)!=null&&a._zod?Ci(s.value,t,n):bi;c>i&&(i=c)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=d(c);s(e?o(e,!0):xi),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Ci(r,t,!1):xi);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),wi(e,i)}function wi(e,t){return t!==xi&&yi.set(e,t===Si),t}function Ti(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}var Ei,Di=[],Oi={alloc(e,t,n){let r=Ei;if(!r)return n;Ei=void 0;let i={value:n,issues:null};return r.set(t.value,i),Di.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Ai(n,e.value))throw new mi;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Ci(e,/* @__PURE__ */ new Set,!1);if(i===bi)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Si||r?n=!0:r=!0}let l=s.value;if(!_i(l))return t(s,c);let u=c[hi];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[hi]=u);let d;i===c?d=a:(d=Ti(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...vi(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;Ei=d;let p=Di.length,m=t(s,c);Ei=void 0;let h=Di.length>p?Di.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?vi(e.issues):gi),e)):(h&&(h.issues=m.issues.length?vi(m.issues):gi),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function ki(){return Oi}function Ai(e,t){var n;let r=(n=e[hi])==null?void 0:n.backEdges;return r!==void 0&&_i(t)&&r.has(t)}var ji=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function n(t){return e[t]??null}let r={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},i={nan:`NaN`};function a(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):i[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${a(e.expected)}, received ${a(Ae(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${ue(e.values[0])}`:`Invalid option: expected one of ${t(e.values,`|`)}`;case`too_big`:{let t=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=n(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${t}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${t}${e.maximum.toString()}`}case`too_small`:{let t=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=n(e.origin);return r?`Too small: expected ${e.origin} to have ${t}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${t}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${t(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Mi(){return{localeError:ji()}}var Ni,Pi=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ 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=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ 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 Fi(){return new Pi}(Ni=globalThis).__zod_globalRegistry??(Ni.__zod_globalRegistry=Fi());var Ii=globalThis.__zod_globalRegistry;function Li(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
|
|
56
|
+
function Ri(e,t){return new e(Li({type:`string`,...y(t)}))}// @__NO_SIDE_EFFECTS__
|
|
57
|
+
function zi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
58
|
+
function Bi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
59
|
+
function Vi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
60
|
+
function Hi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
61
|
+
function Ui(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
62
|
+
function Wi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
63
|
+
function Gi(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
64
|
+
function Ki(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
65
|
+
function qi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
66
|
+
function Ji(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
67
|
+
function Yi(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
68
|
+
function Xi(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
69
|
+
function Zi(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
70
|
+
function Qi(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
71
|
+
function $i(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
72
|
+
function ea(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
73
|
+
function ta(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
74
|
+
function na(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
75
|
+
function ra(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
76
|
+
function ia(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
77
|
+
function aa(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
78
|
+
function oa(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
79
|
+
function sa(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
80
|
+
function ca(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
81
|
+
function la(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
82
|
+
function ua(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
83
|
+
function da(e,t){return new e(Li({type:`number`,checks:[],...y(t)}))}// @__NO_SIDE_EFFECTS__
|
|
84
|
+
function fa(e,t){return new e(Li({type:`number`,coerce:!0,checks:[],...y(t)}))}// @__NO_SIDE_EFFECTS__
|
|
85
|
+
function pa(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
86
|
+
function ma(e,t){return new e({type:`boolean`,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
87
|
+
function ha(e,t){return new e({type:`bigint`,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
88
|
+
function ga(e,t){return new e({type:`bigint`,coerce:!0,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
89
|
+
function _a(e,t){return new e({type:`null`,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
90
|
+
function va(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
|
|
91
|
+
function ya(e,t){return new e({type:`never`,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
92
|
+
function ba(e,t){return new e({type:`date`,...y(t)})}// @__NO_SIDE_EFFECTS__
|
|
93
|
+
function xa(e,t){return new cn({check:`less_than`,...y(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
|
|
94
|
+
function M(e,t){return new cn({check:`less_than`,...y(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
|
|
95
|
+
function Sa(e,t){return new ln({check:`greater_than`,...y(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
|
|
96
|
+
function N(e,t){return new ln({check:`greater_than`,...y(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
|
|
97
|
+
function Ca(e,t){return new un({check:`multiple_of`,...y(t),value:e})}// @__NO_SIDE_EFFECTS__
|
|
98
|
+
function wa(e,t){return new fn({check:`max_length`,...y(t),maximum:e})}// @__NO_SIDE_EFFECTS__
|
|
99
|
+
function Ta(e,t){return new pn({check:`min_length`,...y(t),minimum:e})}// @__NO_SIDE_EFFECTS__
|
|
100
|
+
function Ea(e,t){return new mn({check:`length_equals`,...y(t),length:e})}// @__NO_SIDE_EFFECTS__
|
|
101
|
+
function Da(e,t){return new gn({check:`string_format`,format:`regex`,...y(t),pattern:e})}// @__NO_SIDE_EFFECTS__
|
|
102
|
+
function Oa(e){return new _n({check:`string_format`,format:`lowercase`,...y(e)})}// @__NO_SIDE_EFFECTS__
|
|
103
|
+
function ka(e){return new vn({check:`string_format`,format:`uppercase`,...y(e)})}// @__NO_SIDE_EFFECTS__
|
|
104
|
+
function Aa(e,t){return new yn({check:`string_format`,format:`includes`,...y(t),includes:e})}// @__NO_SIDE_EFFECTS__
|
|
105
|
+
function ja(e,t){return new bn({check:`string_format`,format:`starts_with`,...y(t),prefix:e})}// @__NO_SIDE_EFFECTS__
|
|
106
|
+
function Ma(e,t){return new xn({check:`string_format`,format:`ends_with`,...y(t),suffix:e})}// @__NO_SIDE_EFFECTS__
|
|
107
|
+
function P(e){return new Sn({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
|
|
108
|
+
function Na(e){return/* @__PURE__ */ P(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
|
|
109
|
+
function Pa(){return/* @__PURE__ */ P(e=>e.trim())}// @__NO_SIDE_EFFECTS__
|
|
110
|
+
function Fa(){return/* @__PURE__ */ P(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
|
|
111
|
+
function Ia(){return/* @__PURE__ */ P(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
|
|
112
|
+
function La(){return/* @__PURE__ */ P(e=>ne(e))}// @__NO_SIDE_EFFECTS__
|
|
113
|
+
function Ra(e,t,n){return new e({type:`array`,element:t,...y(n)})}// @__NO_SIDE_EFFECTS__
|
|
114
|
+
function za(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...y(n)})}// @__NO_SIDE_EFFECTS__
|
|
115
|
+
function Ba(e,t){let n=/* @__PURE__ */ Va(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(je(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(je(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
|
|
116
|
+
function Va(e,t){let n=new k({check:`custom`,...y(t)});return n._zod.check=e,n}function Ha(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&u(e,t,n[t]);return e}function Ua(e){let t=(e==null?void 0:e.target)??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Ii,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??`throw`,override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(e==null?void 0:e.cycles)??`ref`,reused:(e==null?void 0:e.reused)??`inline`,intersections:[],deferred:[],external:(e==null?void 0:e.external)??void 0}}function F(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function I(e,t,n={path:[],schemaPath:[]}){var r,i,a;let o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;let c={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,c),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let l=(r=(i=e._zod).toJSONSchema)==null?void 0:r.call(i);if(l)c.schema=l;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,r);else{let n=c.schema,i=t.processors[o.type];if(!i)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);i(e,t,n,r)}let i=e._zod.parent;i&&(c.ref||=i,I(i,t,r),t.seen.get(i).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Ha(c.schema,u),t.io===`input`&&L(e)&&(delete c.schema.examples,delete c.schema.default),t.io===`input`&&`_prefault`in c.schema&&((a=c.schema).default??(a.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}function Wa(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Ga(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){var i;let n=(i=e.metadataRegistry.get(t[0]))==null?void 0:i.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 a=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){var i;let n=(i=e.external.registry.get(t[0]))==null?void 0:i.id,a=e.external.uri??(e=>e);if(n)return{ref:a(n)};let o=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=o,{defId:o,ref:`${a(`__shared`)}#/${r}/${Wa(o)}`}}let a=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let o=t[1].schema.id??`__schema${e.counter++}`;return{defId:o,ref:a+Wa(o)}},o=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=a(e);t.def={...t.schema},r&&(t.defId=r);let i=t.schema;for(let e in i)delete i[e];i.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle){var s;throw Error(`Cycle detected: #/${(s=e.cycle)==null?void 0:s.join(`/`)}/<root>
|
|
117
|
+
|
|
118
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}}for(let n of e.seen.entries()){var c;let r=n[1];if(t===n[0])o(n);else{if(e.external){var l;let r=(l=e.external.registry.get(n[0]))==null?void 0:l.id;if(t!==n[0]&&r){o(n);continue}}((c=e.metadataRegistry.get(n[0]))!=null&&c.id||r.cycle||r.count>1&&e.reused===`ref`)&&o(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ka(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ka(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var qa=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Ja=[`oneOf`,`anyOf`];function Ya(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Xa(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!qa.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){var i;let t=((i=n.properties)==null?void 0:i[r])??Ya(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}u(n,r,e.length===1?e[0]:Xa(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let a={type:`object`,properties:n};if(r.size&&(a.required=[...r]),t.every(e=>e.additionalProperties===!1))a.additionalProperties=!1;else{let e=[];for(let n of t){let t=Ya(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?a.additionalProperties=e[0]:e.length>1&&(a.additionalProperties={allOf:e})}return a}function Za(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of qa)if(t in e)return;let n=t.filter(e=>Ja.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Xa(t);else{let e=n[0],i=Ja.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Xa([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ha(e,r))}function Qa(e,t){var n,r,i;let a=e.seen.get(t);if(!a)throw Error(`Unprocessed schema. This is a bug in Zod.`);let o=t=>{let n=e.seen.get(t);if(n.ref===null)return;let r=n.def??n.schema,i={...r},a=n.ref;if(n.ref=null,a){o(a);let n=e.seen.get(a),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(r.allOf=r.allOf??[],r.allOf.push(s)):Ha(r,s),Ha(r,i),t._zod.parent===a)for(let e in r)e!==`$ref`&&e!==`allOf`&&(e in i||delete r[e]);if(s.$ref&&n.def)for(let e in r)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(r[e])===JSON.stringify(n.def[e])&&delete r[e]}let s=t._zod.parent;if(s&&s!==a){o(s);let t=e.seen.get(s);if(t!=null&&t.schema.$ref&&(r.$ref=t.schema.$ref,t.def))for(let e in r)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(r[e])===JSON.stringify(t.def[e])&&delete r[e]}e.override({zodSchema:t,jsonSchema:r,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())o(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ka(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e==null?void 0:e.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Za(e)}}let s={};if(e.target===`draft-2020-12`?s.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?s.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?s.$schema=`http://json-schema.org/draft-04/schema#`:e.target,(n=e.external)!=null&&n.uri){var c;let n=(c=e.external.registry.get(t))==null?void 0:c.id;if(!n)throw Error("Schema is missing an `id` property");s.$id=e.external.uri(n)}Ha(s,a.defId?a.schema:a.def??a.schema);let l=(r=e.metadataRegistry.get(t))==null?void 0:r.id;l!==void 0&&s.id===l&&delete s.id;let d=((i=e.external)==null?void 0:i.defs)??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,u(d,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(d).length>0&&(e.target===`draft-2020-12`?s.$defs=d:s.definitions=d);try{let n=JSON.parse(JSON.stringify(s));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:eo(t,`input`,e.processors),output:eo(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function L(e,t){let n=t??{seen:/* @__PURE__ */ 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 L(r.element,n);if(r.type===`set`)return L(r.valueType,n);if(r.type===`lazy`)return L(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return L(r.innerType,n);if(r.type===`intersection`)return L(r.left,n)||L(r.right,n);if(r.type===`record`||r.type===`map`)return L(r.keyType,n)||L(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:L(r.in,n)||L(r.out,n);if(r.type===`object`){for(let e in r.shape)if(L(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(L(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(L(e,n))return!0;return!!(r.rest&&L(r.rest,n))}return!1}var $a=(e,t={})=>n=>{let r=Ua({...n,processors:t});return I(e,r),Ga(r,e),Qa(r,e)},eo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ua({...i??{},target:a,io:t,processors:n});return I(e,o),Ga(o,e),Qa(o,e)},to=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},no=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},ro=(e,t)=>{to(e,`minimum`,t),no(e,`maximum`,t)},io=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},ao=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},oo=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},so=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},co=(e,t)=>to(e,`minimum`,t.minimum),lo=(e,t)=>no(e,`maximum`,t.maximum),uo=e=>(t,n)=>{so(t,n.format);let[r,i]=e[n.format];to(t,`minimum`,r),no(t,`maximum`,i)},fo={greater_than:(e,t)=>to(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>no(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>io(e,t.value),number_format:uo(fe),bigint_format:uo(pe),min_length:co,max_length:lo,length_equals:(e,t)=>ro(e,t.length),min_size:co,max_size:lo,size_equals:(e,t)=>ro(e,t.size),string_format:(e,t)=>{so(e,t.format),t.pattern&&ao(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>oo(e,t.mime)};function R(e){var t;let n={},r=e._zod.def,i=e._zod.traits.has(`$ZodCheck`)?[e,...r.checks??[]]:r.checks??[];for(let e of i)(t=fo[e._zod.def.check])==null||t.call(fo,n,e._zod.def);let a=e._zod.bag;a.minimum!==void 0&&to(n,`minimum`,a.minimum),a.exclusiveMinimum!==void 0&&to(n,`exclusiveMinimum`,a.exclusiveMinimum),a.maximum!==void 0&&no(n,`maximum`,a.maximum),a.exclusiveMaximum!==void 0&&no(n,`exclusiveMaximum`,a.exclusiveMaximum),a.multipleOf!==void 0&&io(n,a.multipleOf),a.format!==void 0&&(n.format??=a.format,a.format.includes(`int`)&&(n.isInt=!0)),a.mime&&oo(n,a.mime);for(let e of a.patterns??[])ao(n,e);return n}var po={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},mo=/* @__PURE__ */ new Map([[ar,Bt],[sr,Vt]]),ho=e=>mo.get(e)??e,go=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=R(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=po[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(ho);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}))])}},_o=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=R(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):F(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},vo=(e,t,n,r)=>{n.type=`boolean`},yo=(e,t,n,r)=>{F(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},bo=(e,t,n,r)=>{F(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},xo=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},So=(e,t,n,r)=>{F(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},Co=(e,t,n,r)=>{F(e,t,n,r,`Void cannot be represented in JSON Schema`)},wo=(e,t,n,r)=>{n.not={}},To=(e,t,n,r)=>{},Eo=(e,t,n,r)=>{},Do=(e,t,n,r)=>{F(e,t,n,r,`Date cannot be represented in JSON Schema`)},Oo=(t,n,r,i)=>{let a=t._zod.def,o=e(a.entries);o.length===0?r.not={}:(o.every(e=>typeof e==`number`)&&(r.type=`number`),o.every(e=>typeof e==`string`)&&(r.type=`string`),r.enum=o)},ko=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(F(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(F(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Ao=(e,t,n,r)=>{F(e,t,n,r,`NaN cannot be represented in JSON Schema`)},jo=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Mo=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=R(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},No=(e,t,n,r)=>{n.type=`boolean`},Po=(e,t,n,r)=>{F(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Fo=(e,t,n,r)=>{F(e,t,n,r,`Function types cannot be represented in JSON Schema`)},Io=(e,t,n,r)=>{F(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Lo=(e,t,n,r)=>{F(e,t,n,r,`Map cannot be represented in JSON Schema`)},Ro=(e,t,n,r)=>{F(e,t,n,r,`Set cannot be represented in JSON Schema`)},zo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=R(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=I(a.element,t,{...r,path:[...r.path,`items`]})};function Bo(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Bo(t.out):t.type===`catch`?Bo(t.innerType):e._zod.optin}var Vo=(e,t,n,r)=>{var i;let a=n,o=e._zod.def,s=o.shape;if(Object.getOwnPropertySymbols(s).length&&F(e,t,a,r,`Symbol keys cannot be represented in JSON Schema`))return;a.type=`object`,a.properties={};for(let e in s)u(a.properties,e,I(s[e],t,{...r,path:[...r.path,`properties`,e]}));let c=[];for(let e of Object.keys(s)){let n=o.shape[e];(t.io===`input`?Bo(n)===void 0:n._zod.optout===void 0)&&c.push(e)}c.length>0&&(a.required=c),((i=o.catchall)==null?void 0:i._zod.def.type)===`never`?a.additionalProperties=!1:o.catchall?o.catchall&&(a.additionalProperties=I(o.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(a.additionalProperties=!1)},Ho=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>I(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Uo=(e,t,n,r)=>{let i=e._zod.def,a=I(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=I(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Wo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>I(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?I(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?Bo(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=R(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Go(e,t,n){if(t.$ref){var r;if(n.has(t))return t;n.add(t);let i=(r=e.get(t))==null?void 0:r.def;if(!i)return t;let a=Go(e,i,n);return a===i?t:a}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Go(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let i=Array.isArray(t.type)?t.type:[t.type],a=!i.includes(`string`)&&i.some(e=>e===`number`||e===`integer`),o=t.enum??(t.const===void 0?void 0:[t.const]);if(!a&&!(o!=null&&o.some(e=>typeof e==`number`)))return t;let{minimum:s,maximum:c,exclusiveMinimum:l,exclusiveMaximum:u,multipleOf:d,format:f,id:p,...m}=t;return m.enum?m.enum=m.enum.map(e=>typeof e==`number`?String(e):e):typeof m.const==`number`&&(m.const=String(m.const)),a&&(m.type=`string`,o||(m.pattern=(i.includes(`number`)?en:$t).source)),m}var Ko=/* @__PURE__ */ new WeakMap;function qo(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let i of Ko.get(e)??[]){var r;let a=e.seen.get(i),o=(r=(a==null?void 0:a.def)??(a==null?void 0:a.schema))==null?void 0:r.propertyNames;if(!o||o===!0||n.has(o))continue;let s=Go(t,o,/* @__PURE__ */ new Set);s!==o&&n.set(o,s)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var Jo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=R(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=I(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)u(i.patternProperties,ho(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=I(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Ko.get(t);n||(n=[],Ko.set(t,n),t.deferred.push(()=>qo(t))),n.push(e)}i.additionalProperties=I(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Bo(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Yo=(e,t,n,r)=>{let i=e._zod.def,a=I(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`}]},Xo=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Zo=Symbol();function Qo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(F(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Zo):JSON.parse(o)}var $o=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Qo(i.defaultValue,e,t,n,r);o!==Zo&&(n.default=o)},es=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Qo(i.defaultValue,e,t,n,r);o!==Zo&&(n._prefault=o)},ts=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{F(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},ns=(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;I(o,t,r);let s=t.seen.get(e);s.ref=o},rs=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},is=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},as=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},os=(e,t,n,r)=>{let i=e._zod.innerType;I(i,t,r);let a=t.seen.get(e);a.ref=i},ss={string:go,number:_o,boolean:vo,bigint:yo,symbol:bo,null:xo,undefined:So,void:Co,never:wo,any:To,unknown:Eo,date:Do,enum:Oo,literal:ko,nan:Ao,template_literal:jo,file:Mo,success:No,custom:Po,function:Fo,transform:Io,map:Lo,set:Ro,array:zo,object:Vo,union:Ho,intersection:Uo,tuple:Wo,record:Jo,nullable:Yo,nonoptional:Xo,default:$o,prefault:es,catch:ts,pipe:ns,readonly:rs,promise:is,optional:as,lazy:os};function cs(e,t){if(`_idmap`in e){let n=e,r=Ua({...t,processors:ss}),i={};for(let e of n._idmap.entries()){let[t,n]=e;I(n,r)}let a={};r.external={registry:n,uri:t==null?void 0:t.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Ga(r,n),u(a,t,Qa(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Ua({...t,processors:ss});return I(e,n),Ga(n,e),Qa(n,e)}var ls=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function us(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var ds=(e,t)=>{et.init(e,t),e.name=`ZodError`;let r=Object.getPrototypeOf(e);ls.has(r)||(ls.add(r),us(r,`format`,e=>t=>rt(e,t)),us(r,`flatten`,e=>t=>nt(e,t)),us(r,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,n,2)}),us(r,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,n,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},fs=/*@__PURE__*/ T(`ZodError`,ds),z=/*@__PURE__*/ T(`ZodError`,ds,void 0,{Parent:Error}),ps=/* @__PURE__ */ at(z),ms=/* @__PURE__ */ ot(z),hs=/* @__PURE__ */ st(z),gs=/* @__PURE__ */ lt(z),_s=/* @__PURE__ */ ht(z),vs=/* @__PURE__ */ gt(z),ys=/* @__PURE__ */ _t(z),bs=/* @__PURE__ */ vt(z),xs=/* @__PURE__ */ yt(z),Ss=/* @__PURE__ */ bt(z),Cs=/* @__PURE__ */ xt(z),ws=/* @__PURE__ */ St(z);function Ts(){D.localeError||O(Mi())}function Es(){D.memoizer||O({memoizer:ki()})}var B=/*@__PURE__*/ T(`ZodType`,(e,t)=>(Ts(),A.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(g(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 v(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check($c(e,t))},superRefine(e,t){return this.check(el(e,t))},overwrite(e){return this.check(/* @__PURE__ */ P(e))},optional(){return Ac(this)},exactOptional(){return Mc(this)},nullable(){return Pc(this)},nullish(){return Ac(Pc(this))},nonoptional(e){return Bc(this,e)},array(){return K(this)},or(e){return X([this,e])},and(e){return bc(this,e)},transform(e){return Wc(this,Oc(e))},default(e){return Ic(this,e)},prefault(e){return Rc(this,e)},catch(e){return Hc(this,e)},pipe(e){return Wc(this,e)},readonly(){return qc(this)},describe(e){let t=this.clone();return Ii.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ii.get(this);let t=this.clone();return Ii.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Ne(this,`~standard`,{...Dn(this),jsonSchema:{input:eo(this,`input`),output:eo(this,`output`)}})},set"~standard"(e){C(this,`~standard`,e)},parse:function e(t,n){return ps(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await ms(this,t,n,{callee:e})},safeParse(e,t){return hs(this,e,t)},async safeParseAsync(e,t){return gs(this,e,t)},get spa(){var e;return(e=this)==null?void 0:e.safeParseAsync},set spa(e){C(this,`spa`,e)},validate(e,t){return ft(this,e,t)},validateAsync(e,t){return mt(this,e,t)},encode:function e(t,n){return _s(this,t,n,{callee:e})},decode:function e(t,n){return vs(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await ys(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await bs(this,t,n,{callee:e})},safeEncode(e,t){return xs(this,e,t)},safeDecode(e,t){return Ss(this,e,t)},async safeEncodeAsync(e,t){return Cs(this,e,t)},async safeDecodeAsync(e,t){return ws(this,e,t)},toJSONSchema(e){return $a(this,{})(e)},get description(){var e;return(e=Ii.get(this))==null?void 0:e.description},get _def(){return this._zod.def}}),Ds=/*@__PURE__*/ T(`_ZodString`,(e,t)=>{On.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r)},/*@__PURE__*/ Pe({format:e=>R(e).format??null,minLength:e=>R(e).minimum??null,maxLength:e=>R(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ Da(...e))},includes(...e){return this.check(/* @__PURE__ */ Aa(...e))},startsWith(...e){return this.check(/* @__PURE__ */ ja(...e))},endsWith(...e){return this.check(/* @__PURE__ */ Ma(...e))},min(...e){return this.check(/* @__PURE__ */ Ta(...e))},max(...e){return this.check(/* @__PURE__ */ wa(...e))},length(...e){return this.check(/* @__PURE__ */ Ea(...e))},nonempty(...e){return this.check(/* @__PURE__ */ Ta(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ Oa(e))},uppercase(e){return this.check(/* @__PURE__ */ ka(e))},trim(){return this.check(/* @__PURE__ */ Pa())},normalize(...e){return this.check(/* @__PURE__ */ Na(...e))},toLowerCase(){return this.check(/* @__PURE__ */ Fa())},toUpperCase(){return this.check(/* @__PURE__ */ Ia())},slugify(){return this.check(/* @__PURE__ */ La())}})),Os=/*@__PURE__*/ T(`ZodString`,(e,t)=>{On.init(e,t),Ds.init(e,t)},{email(e){return this.check(/* @__PURE__ */ zi(Ns,e))},url(e){return this.check(/* @__PURE__ */ Gi(Ls,e))},jwt(e){return this.check(/* @__PURE__ */ oa(ec,e))},emoji(e){return this.check(/* @__PURE__ */ Ki(zs,e))},guid(e){return this.check(/* @__PURE__ */ Bi(Ps,e))},uuid(e){return this.check(/* @__PURE__ */ Vi(Is,e))},uuidv4(e){return this.check(/* @__PURE__ */ Hi(Is,e))},uuidv6(e){return this.check(/* @__PURE__ */ Ui(Is,e))},uuidv7(e){return this.check(/* @__PURE__ */ Wi(Is,e))},nanoid(e){return this.check(/* @__PURE__ */ qi(Bs,e))},cuid(e){return this.check(/* @__PURE__ */ Ji(Vs,e))},cuid2(e){return this.check(/* @__PURE__ */ Yi(Hs,e))},ulid(e){return this.check(/* @__PURE__ */ Xi(Us,e))},base64(e){return this.check(/* @__PURE__ */ ra(Xs,e))},base64url(e){return this.check(/* @__PURE__ */ ia(Qs,e))},xid(e){return this.check(/* @__PURE__ */ Zi(Ws,e))},ksuid(e){return this.check(/* @__PURE__ */ Qi(Gs,e))},ipv4(e){return this.check(/* @__PURE__ */ $i(Ks,e))},ipv6(e){return this.check(/* @__PURE__ */ ea(qs,e))},cidrv4(e){return this.check(/* @__PURE__ */ ta(Js,e))},cidrv6(e){return this.check(/* @__PURE__ */ na(Ys,e))},e164(e){return this.check(/* @__PURE__ */ aa($s,e))},datetime(e){return this.check(/* @__PURE__ */ sa(ks,e))},date(e){return this.check(/* @__PURE__ */ ca(As,e))},time(e){return this.check(/* @__PURE__ */ la(js,e))},duration(e){return this.check(/* @__PURE__ */ ua(Ms,e))}});function V(e){return/* @__PURE__ */ Ri(Os,e)}var H=/*@__PURE__*/ T(`ZodStringFormat`,(e,t)=>{j.init(e,t),Ds.init(e,t)}),ks=/*@__PURE__*/ T(`ZodISODateTime`,(e,t)=>{qn.init(e,t),H.init(e,t)}),As=/*@__PURE__*/ T(`ZodISODate`,(e,t)=>{Jn.init(e,t),H.init(e,t)}),js=/*@__PURE__*/ T(`ZodISOTime`,(e,t)=>{Yn.init(e,t),H.init(e,t)}),Ms=/*@__PURE__*/ T(`ZodISODuration`,(e,t)=>{Xn.init(e,t),H.init(e,t)}),Ns=/*@__PURE__*/ T(`ZodEmail`,(e,t)=>{jn.init(e,t),H.init(e,t)}),Ps=/*@__PURE__*/ T(`ZodGUID`,(e,t)=>{kn.init(e,t),H.init(e,t)});function Fs(e){return/* @__PURE__ */ Bi(Ps,e)}var Is=/*@__PURE__*/ T(`ZodUUID`,(e,t)=>{An.init(e,t),H.init(e,t)});function U(e){return/* @__PURE__ */ Vi(Is,e)}var Ls=/*@__PURE__*/ T(`ZodURL`,(e,t)=>{zn.init(e,t),H.init(e,t)});function Rs(e){return/* @__PURE__ */ Gi(Ls,e)}var zs=/*@__PURE__*/ T(`ZodEmoji`,(e,t)=>{Bn.init(e,t),H.init(e,t)}),Bs=/*@__PURE__*/ T(`ZodNanoID`,(e,t)=>{Vn.init(e,t),H.init(e,t)}),Vs=/*@__PURE__*/ T(`ZodCUID`,(e,t)=>{Hn.init(e,t),H.init(e,t)}),Hs=/*@__PURE__*/ T(`ZodCUID2`,(e,t)=>{Un.init(e,t),H.init(e,t)}),Us=/*@__PURE__*/ T(`ZodULID`,(e,t)=>{Wn.init(e,t),H.init(e,t)}),Ws=/*@__PURE__*/ T(`ZodXID`,(e,t)=>{Gn.init(e,t),H.init(e,t)}),Gs=/*@__PURE__*/ T(`ZodKSUID`,(e,t)=>{Kn.init(e,t),H.init(e,t)}),Ks=/*@__PURE__*/ T(`ZodIPv4`,(e,t)=>{Zn.init(e,t),H.init(e,t)}),qs=/*@__PURE__*/ T(`ZodIPv6`,(e,t)=>{er.init(e,t),H.init(e,t)}),Js=/*@__PURE__*/ T(`ZodCIDRv4`,(e,t)=>{tr.init(e,t),H.init(e,t)}),Ys=/*@__PURE__*/ T(`ZodCIDRv6`,(e,t)=>{rr.init(e,t),H.init(e,t)}),Xs=/*@__PURE__*/ T(`ZodBase64`,(e,t)=>{or.init(e,t),H.init(e,t)});function Zs(e){return/* @__PURE__ */ ra(Xs,e)}var Qs=/*@__PURE__*/ T(`ZodBase64URL`,(e,t)=>{lr.init(e,t),H.init(e,t)}),$s=/*@__PURE__*/ T(`ZodE164`,(e,t)=>{ur.init(e,t),H.init(e,t)}),ec=/*@__PURE__*/ T(`ZodJWT`,(e,t)=>{fr.init(e,t),H.init(e,t)}),tc=/*@__PURE__*/ T(`ZodNumber`,(e,t)=>{pr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ Pe({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=R(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=R(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=R(e);return!!t||!!(n!=null&&n.some(Number.isSafeInteger))},format:e=>R(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ Sa(e,t))},gte(e,t){return this.check(/* @__PURE__ */ N(e,t))},min(e,t){return this.check(/* @__PURE__ */ N(e,t))},lt(e,t){return this.check(/* @__PURE__ */ xa(e,t))},lte(e,t){return this.check(/* @__PURE__ */ M(e,t))},max(e,t){return this.check(/* @__PURE__ */ M(e,t))},int(e){return this.check(rc(e))},safe(e){return this.check(rc(e))},positive(e){return this.check(/* @__PURE__ */ Sa(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ N(0,e))},negative(e){return this.check(/* @__PURE__ */ xa(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ M(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ Ca(e,t))},step(e,t){return this.check(/* @__PURE__ */ Ca(e,t))},finite(){return this}}));function W(e){return/* @__PURE__ */ da(tc,e)}var nc=/*@__PURE__*/ T(`ZodNumberFormat`,(e,t)=>{mr.init(e,t),tc.init(e,t)});function rc(e){return/* @__PURE__ */ pa(nc,e)}var ic=/*@__PURE__*/ T(`ZodBoolean`,(e,t)=>{hr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r)});function G(e){return/* @__PURE__ */ ma(ic,e)}var ac=/*@__PURE__*/ T(`ZodBigInt`,(e,t)=>{gr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r)},/*@__PURE__*/ Pe({minValue:e=>R(e).minimum??null,maxValue:e=>R(e).maximum??null,format:e=>R(e).format??null},{gte(e,t){return this.check(/* @__PURE__ */ N(e,t))},min(e,t){return this.check(/* @__PURE__ */ N(e,t))},gt(e,t){return this.check(/* @__PURE__ */ Sa(e,t))},lt(e,t){return this.check(/* @__PURE__ */ xa(e,t))},lte(e,t){return this.check(/* @__PURE__ */ M(e,t))},max(e,t){return this.check(/* @__PURE__ */ M(e,t))},positive(e){return this.check(/* @__PURE__ */ Sa(BigInt(0),e))},negative(e){return this.check(/* @__PURE__ */ xa(BigInt(0),e))},nonpositive(e){return this.check(/* @__PURE__ */ M(BigInt(0),e))},nonnegative(e){return this.check(/* @__PURE__ */ N(BigInt(0),e))},multipleOf(e,t){return this.check(/* @__PURE__ */ Ca(e,t))}}));function oc(e){return/* @__PURE__ */ ha(ac,e)}var sc=/*@__PURE__*/ T(`ZodNull`,(e,t)=>{_r.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xo(e,t,n,r)});function cc(e){return/* @__PURE__ */ _a(sc,e)}var lc=/*@__PURE__*/ T(`ZodUnknown`,(e,t)=>{vr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function uc(){return/* @__PURE__ */ va(lc)}var dc=/*@__PURE__*/ T(`ZodNever`,(e,t)=>{yr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r)});function fc(e){return/* @__PURE__ */ ya(dc,e)}var pc=/*@__PURE__*/ T(`ZodDate`,(e,t)=>{br.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Do(e,t,n,r),e.min=(t,n)=>e.check(/* @__PURE__ */ N(t,n)),e.max=(t,n)=>e.check(/* @__PURE__ */ M(t,n))},/*@__PURE__*/ Pe({minDate:e=>{let{minimum:t}=R(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=R(e);return t?new Date(t):null}},{}));function mc(e){return/* @__PURE__ */ ba(pc,e)}var hc=/*@__PURE__*/ T(`ZodArray`,(e,t)=>{Es(),wr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ Ta(e,t))},nonempty(e){return this.check(/* @__PURE__ */ Ta(1,e))},max(e,t){return this.check(/* @__PURE__ */ wa(e,t))},length(e,t){return this.check(/* @__PURE__ */ Ea(e,t))},unwrap(){return this.element}});function K(e,t){return/* @__PURE__ */ Ra(hc,e,t)}var gc=/*@__PURE__*/ T(`ZodObject`,(e,t)=>{Es(),Ar.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vo(e,t,n,r),Be(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Q(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(g(this._zod.def,{catchall:e}))},passthrough(){return this.clone(g(this._zod.def,{catchall:uc()}))},loose(){return this.clone(g(this._zod.def,{catchall:uc()}))},strict(){return this.clone(g(this._zod.def,{catchall:fc()}))},strip(){return this.clone(g(this._zod.def,{catchall:void 0}))},extend(e){return _e(this,e)},safeExtend(e){return ye(this,e)},merge(e){return be(this,e)},pick(e){return me(this,e)},omit(e){return ge(this,e)},partial(...e){return xe(kc,this,e[0])},exactPartial(...e){return xe(jc,this,e[0],`exactPartial`)},required(...e){return Se(zc,this,e[0])}});function q(e,t){return new gc({type:`object`,shape:e??{},...y(t)})}function J(e,t){return new gc({type:`object`,shape:e,catchall:fc(),...y(t)})}function Y(e,t){return new gc({type:`object`,shape:e,catchall:uc(),...y(t)})}var _c=/*@__PURE__*/ T(`ZodUnion`,(e,t)=>{Mr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ho(e,t,n,r),e.options=t.options});function X(e,t){return new _c({type:`union`,options:e,...y(t)})}var vc=/*@__PURE__*/ T(`ZodDiscriminatedUnion`,(e,t)=>{_c.init(e,t),Pr.init(e,t)});function Z(e,t,n){return new vc({type:`union`,options:t,discriminator:e,...y(n)})}var yc=/*@__PURE__*/ T(`ZodIntersection`,(e,t)=>{Fr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uo(e,t,n,r)});function bc(e,t){return new yc({type:`intersection`,left:e,right:t})}var xc=/*@__PURE__*/ T(`ZodTuple`,(e,t)=>{Es(),Rr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wo(e,t,n,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){var e;let t=this._zod.def;if((e=t.checks)!=null&&e.length)throw Error(`.partial() cannot be used on tuple schemas containing refinements`);return this.clone({...t,items:t.items.map(e=>new kc({type:`optional`,innerType:e}))})}});function Sc(e,t,n){let r=t instanceof A;return new xc({type:`tuple`,items:e,rest:r?t:null,...y(r?n:t)})}var Cc=/*@__PURE__*/ T(`ZodRecord`,(e,t)=>{Es(),Hr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jo(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function wc(e,t,n){return!t||!t._zod?new Cc({type:`record`,keyType:V(),valueType:e,...y(t)}):new Cc({type:`record`,keyType:e,valueType:t,...y(n)})}var Tc=/*@__PURE__*/ T(`ZodEnum`,(e,t)=>{Ur.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Tc({...t,checks:[],...y(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 Tc({...t,checks:[],...y(r),entries:i})}});function Q(e,t){return new Tc({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...y(t)})}var Ec=/*@__PURE__*/ T(`ZodLiteral`,(e,t)=>{Wr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(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 $(e,t){return new Ec({type:`literal`,values:Array.isArray(e)?e:[e],...y(t)})}var Dc=/*@__PURE__*/ T(`ZodTransform`,(e,t)=>{Es(),Gr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Je(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(je(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(je(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Oc(e){return new Dc({type:`transform`,transform:e})}var kc=/*@__PURE__*/ T(`ZodOptional`,(e,t)=>{qr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>as(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ac(e){return new kc({type:`optional`,innerType:e})}var jc=/*@__PURE__*/ T(`ZodExactOptional`,(e,t)=>{Jr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>as(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mc(e){return new jc({type:`optional`,innerType:e})}var Nc=/*@__PURE__*/ T(`ZodNullable`,(e,t)=>{Yr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pc(e){return new Nc({type:`nullable`,innerType:e})}var Fc=/*@__PURE__*/ T(`ZodDefault`,(e,t)=>{Xr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$o(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ic(e,t){return new Fc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}var Lc=/*@__PURE__*/ T(`ZodPrefault`,(e,t)=>{Qr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>es(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Rc(e,t){return new Lc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}var zc=/*@__PURE__*/ T(`ZodNonOptional`,(e,t)=>{$r.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bc(e,t){return new zc({type:`nonoptional`,innerType:e,...y(t)})}var Vc=/*@__PURE__*/ T(`ZodCatch`,(e,t)=>{ni.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ts(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Hc(e,t){return new Vc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:He(t)})}var Uc=/*@__PURE__*/ T(`ZodPipe`,(e,t)=>{ri.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ns(e,t,n,r),e.in=t.in,e.out=t.out});function Wc(e,t){return new Uc({type:`pipe`,in:e,out:t})}var Gc=/*@__PURE__*/ T(`ZodPreprocess`,(e,t)=>{Uc.init(e,t),ai.init(e,t)}),Kc=/*@__PURE__*/ T(`ZodReadonly`,(e,t)=>{oi.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qc(e){return new Kc({type:`readonly`,innerType:e})}var Jc=/*@__PURE__*/ T(`ZodTemplateLiteral`,(e,t)=>{ui.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r)});function Yc(e,t){return new Jc({type:`template_literal`,parts:e,...y(t)})}var Xc=/*@__PURE__*/ T(`ZodLazy`,(e,t)=>{di.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>os(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Zc(e){return new Xc({type:`lazy`,getter:e})}var Qc=/*@__PURE__*/ T(`ZodCustom`,(e,t)=>{fi.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r)});function $c(e,t={}){return/* @__PURE__ */ za(Qc,e,t)}function el(e,t){return/* @__PURE__ */ Ba(e,t)}function tl(e){let t=Zc(()=>X([V(e),W(),G(),cc(),K(t),wc(V(),t)]));return t}function nl(e,t){return new Gc({type:`pipe`,in:Oc(e),out:t})}function rl(e){return/* @__PURE__ */ sa(ks,e)}function il(e){return/* @__PURE__ */ ca(As,e)}function al(e){return/* @__PURE__ */ fa(tc,e)}function ol(e){return/* @__PURE__ */ ga(ac,e)}var sl=V().regex(/^[0-9a-f]{16}$/,`element hash must be 16-char lowercase hex`),cl=q({elementId:V().uuid(),accessibleName:V().nullable(),role:V().nullable(),bbox:q({x:W(),y:W(),w:W(),h:W()})}),ll=q({depth:W().int().min(0),hostElementHash:sl,hostSignature:cl}),ul=q({kind:$(`open-shadow-chain`),hostChain:K(ll).min(1).max(8,{message:`shadow chain exceeds 8 hops`})}),dl=`null`;function fl(e){if(e===`null`)return!0;if(!URL.canParse(e))return!1;let t=new URL(e);return(t.protocol===`http:`||t.protocol===`https:`)&&t.origin===e}var pl=V().refine(fl,{message:`frame origin must be a serialized http(s) origin or "null"`}),ml=q({elementHash:sl,selector:V().min(1),selectorIndex:W().int().nonnegative()}),hl={frame:ml,shadowLineage:ul.optional()},gl=K(q({...hl,origin:pl})).min(1).max(8,{message:`frame chain exceeds 8 hops`}),_l=K(X([q({...hl,applicationId:V().uuid(),origin:fc().optional()}),q({...hl,origin:pl,applicationId:fc().optional()})])).min(1).max(8,{message:`frame chain exceeds 8 hops`}),vl=/^[a-zA-Z0-9_][a-zA-Z0-9_]{0,99}$/,yl=1e4,bl=[`runtime`,`scenario`,`environment`,`project`,`company`],xl=J({name:V().regex(vl),value:V().min(1)});J({x:W(),y:W(),w:W(),h:W()}),q({selector:V().min(1),selectorIndex:W().int().nonnegative(),xpath:V().min(1),selectorStability:W().min(0).max(1).optional()}).strict();var Sl=q({domain:V().min(1),tokens:K(V().max(64)).max(64),attributes:wc(V(),V().max(256)),text:V().max(500),tagName:V().optional(),neighborText:V().max(500).optional(),role:V().optional(),accessibleName:V().max(500).optional(),dataTestId:V().optional(),placeholder:V().optional(),labelText:V().max(500).optional(),locatorIndex:W().int().optional(),shadowLineage:ul.optional(),frameChain:gl.optional()}).strict(),Cl=q(Sl.shape);function wl(e,t){return e.length>t?e.slice(0,t):e}var Tl=Q([`running`,`pausing`,`paused`,`stopping`,`completed`,`cancelled`,`failed`]),El=[`completed`,`cancelled`,`failed`];Q(El);var Dl=[`running`,`pausing`,`paused`,`stopping`];Q(Dl),Q([`running`,`pausing`,`stopping`]);var Ol=Q([`paused`,...El]),kl=Q([`user`,`credits`,`user_credit_limit`,`provider_unavailable`]);Q([`exploring`,`curation`,`done`]),Q([`queued`,`running`,`done`,`failed`,`cancelled`]);var Al=Q([`done`,`failed`,`cancelled`]),jl=Q([`lead_finished`,`user_cancelled`,`lead_failed`]),Ml=Q([`none`,`attached`,`lost`]),Nl=Q([`idle`,`active`,`awaiting_user`]),Pl=Q([`atlas`,`make_auto`,`preset`]),Fl=Q([`extension_atlas_card`,`extension_make_auto_modal`,`web_atlas_dialog`,`web_make_auto_dialog`,`web_job_repeat`,`chat`,`web_workflow_repeat`,`web_runs_prompt`,`web_test_run_dialog`,`web_map_dialog`,`web_scenarios_dialog`,`web_launch_request`]),Il=Q([`web_runs_prompt`,`web_test_run_dialog`,`web_map_dialog`,`web_scenarios_dialog`,`extension_atlas_card`,`extension_make_auto_modal`,`web_workflow_repeat`,`web_launch_request`]),Ll=Q([`web_runs_prompt`,`web_test_run_dialog`,`web_map_dialog`,`web_scenarios_dialog`,`extension_atlas_card`,`extension_make_auto_modal`,`web_workflow_repeat`]),Rl=X([Il,$(`chat`)]),zl=Q([`browser`,`agent`,`none`]),Bl=Q([`browser`,`agent`]),Vl=Q([`explore_app`,`find_bugs`,`create_tests`,`automate_scenarios`,`run_scenarios`,`custom`]),Hl=[`file_bugs`,`write_tests`,`edit_project`],Ul=Q(Hl),Wl=[`text`,`auto`],Gl=Q(Wl);Q([`project`,`scenarios`,`test_run`,`test_plan`]);var Kl=Q([`host_lost`,`awaiting_browser`,`awaiting_user`,`paused`]),ql=Q([`window`,`mcp_agent`,`agent`]),Jl=Q([`opening`,`idle`,`busy`,`closing`,`closed`]),Yl=Q([`lead`,`user`,`window_closed`,`workflow_ended`,`workflow_paused`,`unit_ended`]),Xl=Q([`lead`,`user`,`workflow_ended`,`no_connection`,`left`]),Zl=Q([`lead`,`user`,`workflow_ended`,`workflow_paused`,`unit_ended`]);Q([`lead`,`user`,`window_closed`,`workflow_ended`,`workflow_paused`,`no_connection`,`left`,`unit_ended`]);var Ql=Q([`make_auto`,`atlas`,`run`,`agent`,`mcp_task`,`check_launch`]),$l=[`finished`,`failed`,`stopped`,`credits`,`user_credit_limit`,`no_result`],eu=Q([`starting`,`running`,`ended`]),tu=Q([`completed`,`cancelled`,`failed`,`start_failed`,`lost`]),nu=Q([`user`,`lead`,`left`,`no_connection`,`workflow_ended`,`not_taken`]),ru=[`finished`,`stopped`,`lost`],iu=Q([`lead`,`user`,`window_closed`,`host_lost`,`host_refused`,`workflow_ended`,`workflow_paused`]),au=Q([`lead_choice`,`role_default`]),ou=[`observe`,`main`,`dangerous`],su=Q(ou),cu=Q([`main`,`dangerous`]),lu=`main`,uu=Q([`workflow.access_hint_lost`,`workflow.window_refused`,`workflow.tab_refused`,`workflow.scenario_needs_conversion`,`workflow.identity_busy`,`workflow.identity_not_set`]);Q(/* @__PURE__ */ `workflows.not_found,workflows.not_initiator,workflows.not_initiator_or_admin,workflows.worker_not_found,workflows.not_running,workflows.host_held,workflows.host_mismatch,workflows.host_lost,workflows.host_attached,workflows.identity_delivering,workflows.host_pending,workflows.executor_kind_mismatch,workflows.executor_mismatch,workflows.agent_mismatch,workflows.request_mismatch,workflows.scope_not_found,workflows.scope_forbidden,workflows.conversation_busy,workflows.not_preset,workflows.not_pausable,workflows.not_continuable,workflows.text_not_stored,workflows.last_stage_not_retryable,workflows.not_amendable,workflows.place_mismatch,workflows.auto_requires_browser,workflows.segment_changed,workflows.mcp_join_unavailable,workflows.mcp_code_invalid,workflows.mcp_code_used,workflows.mcp_agent_not_found,workflows.mcp_agent_disconnected,workflows.mcp_inbox_invalid_cursor,workflows.question_not_to_lead,workflows.device_handoff_not_found,workflows.device_step_already_reported,workflows.device_run_ended,workflows.mcp_task_not_found,workflows.mcp_task_ended,workflows.mcp_task_address_required`.split(`,`)),q({status:Tl});var du=q({status:Tl}),fu=Q([`conversation_deleted`,`text_not_stored`]);du.extend({reason:fu.extract([`conversation_deleted`]).optional()}),q({segment:W().int().min(1)}),q({executorKind:zl}),q({reason:Q([`ended`,`no_browser`])}),q({reason:$(`task_paused`)}),Z(`outcome`,[q({outcome:Q([`finished`,`stopped`]),lostReason:cc()}),q({outcome:$(`lost`),lostReason:nu})]),q({taskIds:K(U()).min(2)}),q({stepNumber:W().int().min(1),currentStepNumber:W().int().min(1).nullable()}),q({leaseExpiresAt:rl()}),q({workflowId:U()}),q({agentId:U()});var pu=[`conversation_mode`,`permission_mode_unavailable`,`entity_removal`,`secret_value`,`secret_outside_project`,`project_address`,`company_members`,`bug_from_finding`,`task_grant`],mu=new Set(pu);function hu(e){return Array.isArray(e)&&e.length>0&&e.every(e=>typeof e==`string`&&mu.has(e))}var gu={conversation_mode:{alwaysAsk:!1,reason:`\u0420\u0435\u0436\u0438\u043C \u00AB\u0421\u043F\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044C\u00BB: \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0435 \u0436\u0434\u0451\u0442 \u0432\u0430\u0448\u0435\u0433\u043E \u0440\u0435\u0448\u0435\u043D\u0438\u044F`,menuLabel:null},permission_mode_unavailable:{alwaysAsk:!1,reason:`\u0420\u0435\u0436\u0438\u043C \u043D\u0435 \u0441\u043C\u043E\u0433 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438`,menuLabel:null},entity_removal:{alwaysAsk:!0,reason:`\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0441\u0443\u0449\u043D\u043E\u0441\u0442\u0438 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0441\u044F \u0432 \u043B\u044E\u0431\u043E\u043C \u0440\u0435\u0436\u0438\u043C\u0435`,menuLabel:`\u0443\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0441\u0443\u0449\u043D\u043E\u0441\u0442\u0438 \u0446\u0435\u043B\u0438\u043A\u043E\u043C \u2014 \u0441\u0446\u0435\u043D\u0430\u0440\u0438\u044F, \u0447\u0435\u043A-\u043B\u0438\u0441\u0442\u0430, \u043E\u0431\u0449\u0435\u0433\u043E \u0448\u0430\u0433\u0430, API-\u0437\u0430\u043F\u0440\u043E\u0441\u0430, \u043E\u043A\u0440\u0443\u0436\u0435\u043D\u0438\u044F, \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439 \u043F\u0440\u043E\u0435\u043A\u0442\u0430, \u0431\u0430\u0433\u0430, \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u043A\u0430\u0440\u0442\u044B`},secret_value:{alwaysAsk:!0,reason:`\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0441\u0435\u043A\u0440\u0435\u0442\u0430 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0441\u044F \u0432 \u043B\u044E\u0431\u043E\u043C \u0440\u0435\u0436\u0438\u043C\u0435`,menuLabel:`\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u0441\u0435\u043A\u0440\u0435\u0442\u043E\u0432`},secret_outside_project:{alwaysAsk:!0,reason:`\u0421\u0435\u043A\u0440\u0435\u0442 \u043D\u0430 \u0430\u0434\u0440\u0435\u0441 \u0432\u043D\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0441\u044F \u0432 \u043B\u044E\u0431\u043E\u043C \u0440\u0435\u0436\u0438\u043C\u0435`,menuLabel:`\u0441\u0435\u043A\u0440\u0435\u0442 \u0432\u043D\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u0430`},project_address:{alwaysAsk:!0,reason:`\u0410\u0434\u0440\u0435\u0441 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u0438\u043B\u0438 \u0434\u043E\u0432\u0435\u0440\u0435\u043D\u043D\u044B\u0439 \u0441\u0430\u0439\u0442 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0441\u044F \u0432 \u043B\u044E\u0431\u043E\u043C \u0440\u0435\u0436\u0438\u043C\u0435`,menuLabel:`\u0430\u0434\u0440\u0435\u0441\u0430 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u0438 \u0434\u043E\u0432\u0435\u0440\u0435\u043D\u043D\u044B\u0435 \u0441\u0430\u0439\u0442\u044B`},company_members:{alwaysAsk:!0,reason:`\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0435 \u0441\u043E\u0441\u0442\u0430\u0432\u0430 \u043A\u043E\u043C\u043F\u0430\u043D\u0438\u0438 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0441\u044F \u0432 \u043B\u044E\u0431\u043E\u043C \u0440\u0435\u0436\u0438\u043C\u0435`,menuLabel:`\u0441\u043E\u0441\u0442\u0430\u0432 \u043A\u043E\u043C\u043F\u0430\u043D\u0438\u0438`},bug_from_finding:{alwaysAsk:!0,reason:`\u0412 \u044D\u0442\u043E\u043C \u0437\u0430\u0434\u0430\u043D\u0438\u0438 \u043D\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u043E \u0437\u0430\u0432\u043E\u0434\u0438\u0442\u044C \u0431\u0430\u0433\u0438`,menuLabel:`\u0431\u0430\u0433, \u0435\u0441\u043B\u0438 \u0437\u0430\u0432\u043E\u0434\u0438\u0442\u044C \u0431\u0430\u0433\u0438 \u043D\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u043E`},task_grant:{alwaysAsk:!0,reason:`\u041F\u0440\u0438 \u0437\u0430\u043F\u0443\u0441\u043A\u0435 \u0437\u0430\u0434\u0430\u043D\u0438\u044F \u044D\u0442\u043E \u043D\u0435 \u0431\u044B\u043B\u043E \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u043E`,menuLabel:null}},_u=[`normal`,`thinking`,`max`],vu=`normal`;function yu(e){return e!==`normal`}function bu(e){return typeof e==`object`&&!!e&&`toolCallId`in e&&typeof e.toolCallId==`string`&&e.toolCallId.length>0&&`decisionLaneId`in e&&typeof e.decisionLaneId==`string`&&e.decisionLaneId.length>0}function xu(e){return typeof e!=`object`||!e||!(`accepted`in e)||e.accepted!==!0||!(`decisionLanes`in e)||!Array.isArray(e.decisionLanes)||e.decisionLanes.length===0||!e.decisionLanes.every(bu)||!(`stopsTurn`in e)||typeof e.stopsTurn!=`boolean`?!1:Su(e.decisionLanes)}function Su(e){return new Set(e.map(e=>e.toolCallId)).size===e.length&&new Set(e.map(e=>e.decisionLaneId)).size===e.length}var Cu=[`scenarios`,`shared-steps`,`api-collections`,`api-catalog`,`checklists`,`bugs`,`test-runs`,`imports`,`map`,`dashboard`,`map-history`,`map-changes`,`environments`,`trash`,`settings-general`,`settings-rules`,`settings-scenarios`,`settings-custom-fields`,`settings-variables`,`settings-capture-rules`];function wu(e){return Cu.includes(e)}var Tu={ru:{scenarios:`\u0421\u0446\u0435\u043D\u0430\u0440\u0438\u0438`,"shared-steps":`\u041E\u0431\u0449\u0438\u0435 \u0448\u0430\u0433\u0438`,"api-collections":`API \u0417\u0430\u043F\u0440\u043E\u0441\u044B`,"api-catalog":`API \u0417\u0430\u043F\u0440\u043E\u0441\u044B`,checklists:`\u0427\u0435\u043A-\u043B\u0438\u0441\u0442\u044B`,bugs:`\u0411\u0430\u0433\u0438`,"test-runs":`\u041F\u0440\u043E\u0433\u043E\u043D\u044B`,imports:`\u0418\u043C\u043F\u043E\u0440\u0442`,map:`\u041A\u0430\u0440\u0442\u0430 \u043F\u0440\u043E\u0435\u043A\u0442\u0430`,dashboard:`\u041E\u0431\u0437\u043E\u0440`,"map-history":`\u0418\u0441\u0442\u043E\u0440\u0438\u044F \u043A\u0430\u0440\u0442\u044B`,"map-changes":`\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043A\u0430\u0440\u0442\u044B`,environments:`\u041E\u043A\u0440\u0443\u0436\u0435\u043D\u0438\u044F`,trash:`\u041A\u043E\u0440\u0437\u0438\u043D\u0430`,"settings-general":`\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u00B7 \u041E\u0441\u043D\u043E\u0432\u043D\u044B\u0435`,"settings-rules":`\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u00B7 \u041F\u0440\u0430\u0432\u0438\u043B\u0430 \u0438 \u043F\u0430\u043C\u044F\u0442\u044C`,"settings-scenarios":`\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u00B7 \u0421\u0446\u0435\u043D\u0430\u0440\u0438\u0438`,"settings-custom-fields":`\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u00B7 \u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0435 \u043F\u043E\u043B\u044F`,"settings-variables":`\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u00B7 \u041F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435`,"settings-capture-rules":`\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u00B7 \u041F\u0440\u0430\u0432\u0438\u043B\u0430 \u0437\u0430\u0445\u0432\u0430\u0442\u0430`},en:{scenarios:`Scenarios`,"shared-steps":`Shared Steps`,"api-collections":`API Requests`,"api-catalog":`API Requests`,checklists:`Checklists`,bugs:`Bugs`,"test-runs":`Test Runs`,imports:`Import`,map:`Project Map`,dashboard:`Overview`,"map-history":`Map history`,"map-changes":`Map changes`,environments:`Environments`,trash:`Trash`,"settings-general":`Settings \u00B7 General`,"settings-rules":`Settings \u00B7 Rules and memory`,"settings-scenarios":`Settings \u00B7 Scenarios`,"settings-custom-fields":`Settings \u00B7 Custom fields`,"settings-variables":`Settings \u00B7 Variables`,"settings-capture-rules":`Settings \u00B7 Capture rules`}},Eu=/^S\d+$/;function Du(e){if(!URL.canParse(e))return!1;let t=new URL(e);return t.host!==``&&t.origin===e}var Ou=V().regex(Eu),ku=Z(`kind`,[J({kind:$(`map_application`),id:U()}),J({kind:$(`map_unbound_address`),id:V().refine(Du,`id must be an origin scheme://host[:port]`)}),J({kind:$(`map_page`),id:Ou}),J({kind:$(`map_state`),id:Ou}),J({kind:$(`map_scenario`),id:U()}),J({kind:$(`scenario`),id:U()}),J({kind:$(`checklist`),id:U()}),J({kind:$(`shared-step`),id:U()}),J({kind:$(`saved-request`),id:U()}),J({kind:$(`test-run`),id:U()}),J({kind:$(`bug`),id:U()})]),Au=V().uuid(),ju=K(q({questionId:Au,selectedOptionIds:K(Au).min(1).max(6).refine(e=>new Set(e).size===e.length,`selectedOptionIds must be unique`).optional(),customText:V().optional(),skip:$(!0).optional()}).strict().superRefine((e,t)=>{[e.selectedOptionIds!==void 0,e.customText!==void 0,e.skip===!0].filter(Boolean).length!==1&&t.addIssue({code:`custom`,message:`exactly one answer resolution is required`})})).min(1).max(10).refine(e=>new Set(e.map(e=>e.questionId)).size===e.length,`questionId must be unique within answers`),Mu=q({name:$(`chat-question-answer`),batchId:Au,revision:W().int().positive(),idempotencyKey:Au,answers:ju,tabFreeTestRunId:V().uuid().nullable().optional(),browserId:U().optional()}).strict(),Nu=q({name:$(`chat-question-cancel`),batchId:Au,revision:W().int().positive(),idempotencyKey:Au,tabFreeTestRunId:V().uuid().nullable().optional(),browserId:U().optional()}).strict(),Pu=Y({accepted:$(!0),decisionLanes:K(Y({toolCallId:V().min(1),decisionLaneId:V().min(1)})).min(1).refine(Su,`Decision lanes must be distinct`),stopsTurn:G()}),Fu=Y({accepted:$(!0)}),Iu=Q([`accepted`,`replayed`]),Lu={batchId:V().uuid(),status:$(`answered`),revision:W().int().positive(),outcome:Iu},Ru=Z(`originKind`,[Y({...Lu,originKind:$(`assistant`),continuationTurnId:V().min(1)}),Y({...Lu,originKind:$(`agent`)})]),zu=Y({batchId:V().uuid(),status:$(`cancelled`),revision:W().int().positive(),outcome:Iu}),Bu=X([Pu,Fu,Y({done:G()}),Y({released_runner:G()}),Ru,zu]),Vu={t:$(`ack`),request_id:V().guid(),error_code:V().optional(),error_message:V().optional()},Hu=Z(`status`,[q({...Vu,status:$(`accepted`),result:Bu}),q({...Vu,status:$(`duplicate`),result:Bu}),q({...Vu,status:$(`rejected`),result:uc().optional()})]),Uu=X([oc(),W().int(),V().regex(/^\d{1,19}$/)]).transform(e=>BigInt(e)).pipe(oc().nonnegative().max(9223372036854775807n)),Wu=q({t:$(`hello`),protocol_version:$(`1c.1`),resume:q({epoch:V().nullable(),last_seen_seq:Uu}).optional(),runner_type:Q([`extension`,`web`,`playwright`]).optional(),client_capabilities:K(V().min(1).max(64)).max(16).optional(),panel_id:U().optional()}),Gu=q({t:$(`ping`),ts:W().int()}),Ku=Z(`kind`,[q({kind:$(`this_browser`)}).strict(),q({kind:$(`runner`),agentId:U()}).strict(),q({kind:$(`none`)}).strict()]),qu=[`calling_conversation`,`new_conversation`],Ju=q({name:$(`chat-send`),message:V().min(1),mode:V(),effort:Q(_u),maxAgents:W().int().min(1).nullable().optional(),place:Ku,tabFreeTestRunId:V().uuid().nullable().optional(),browserId:U().optional(),attachmentIds:K(U()).min(1).optional(),activeObject:ku.optional(),section:Q(Cu).optional()}).strict().superRefine((e,t)=>{e.attachmentIds!==void 0&&new Set(e.attachmentIds).size!==e.attachmentIds.length&&t.addIssue({code:`custom`,message:`attachmentIds must be distinct`,path:[`attachmentIds`]})}),Yu=q({name:$(`chat-stop`)}),Xu=K(V().min(1)).min(1).refine(e=>new Set(e).size===e.length,`toolCallIds must be distinct`);q({t:$(`cmd`),request_id:Fs(),cmd:q({name:Q([`chat-tool-confirm`,`chat-tool-reject`])})});var Zu=Z(`name`,[Ju,Yu,J({name:$(`chat-tool-confirm`),toolCallIds:Xu,tabFreeTestRunId:V().uuid().nullable().optional(),browserId:U().optional(),declinedItemIds:K(U()).optional()}),J({name:$(`chat-tool-reject`),toolCallIds:Xu,comment:V().min(1).optional(),tabFreeTestRunId:V().uuid().nullable().optional(),browserId:U().optional()}),q({name:$(`run-cancel`)}),q({name:$(`session-bye`),release_runner:G().optional()}),q({name:$(`onboarding-start`)}).strict(),q({name:$(`onboarding-send`),message:V().min(1)}).strict(),q({name:$(`onboarding-advance`),action:Q([`continue`,`skip_stage`]),stageId:V().min(1).max(50),stateRevision:W().int().positive()}).strict(),Mu,Nu]);Z(`t`,[Wu,Gu,q({t:$(`cmd`),request_id:V().guid(),cmd:Zu}),q({t:$(`auth:refresh`),token:V().min(1)})]);var Qu=[`scenario-run`,`make-auto-queue`,`scenario-launch`,`user-notifications`,`user-model`,`workflow`,`browser-host`];Z(`t`,[q({t:$(`hello-ack`),session_id:V().guid(),channel:Q([`run`,`conversation`,...Qu]),channel_id:V().guid(),epoch:V(),top_seq:ol(),recovered:G(),server_time:W().int()}),q({t:$(`event`),seq:ol().positive(),epoch:V(),event_type:V(),recorded_at:W().int().nonnegative(),payload:uc(),payload_version:V()}),q({t:$(`notify`),channel:Q(Qu),channel_id:V().guid(),seq:ol().positive()}).strict(),Hu,q({t:$(`pong`),ts:W().int(),server_ts:W().int()}),q({t:$(`auth:refresh-required`),expires_in_ms:W().int().nonnegative()}),q({t:$(`auth:refreshed`),expires_at:W().int()})]);var $u=(()=>{let e=globalThis.PROGON_DEBUG;if(typeof e==`boolean`)return e;let t={};if(t!=null&&t.PROGON_DEBUG){let e=t.PROGON_DEBUG;return e===`true`||e===`1`}try{if(typeof localStorage<`u`)return localStorage.getItem(`progon-debug`)===`true`}catch{}return!1})(),ed=`Progon`;function td(e){return e?`[${ed} ${e}]`:`[${ed}]`}function nd(e,t,n,r){r===void 0?console[e](t,n):console[e](t,n,r)}function rd(e){let t=typeof e==`function`?()=>td(e()):()=>td(e);return{debug:(e,n)=>{$u&&nd(`log`,t(),e,n)},info:(e,n)=>{nd(`info`,t(),e,n)},warn:(e,n)=>{nd(`warn`,t(),e,n)},error:(e,n)=>{nd(`error`,t(),e,n)}}}export{Cl as $,fu as A,q as At,Xl as B,U as Bt,Al as C,rc as Ct,Zl as D,Y as Dt,Rl as E,$ as Et,Ml as F,Yc as Ft,Ql as G,Tl as H,cs as Ht,Bl as I,Sc as It,iu as J,au as K,Pl as L,X as Lt,zl as M,wc as Mt,Ll as N,J as Nt,Kl as O,fc as Ot,uu as P,V as Pt,Sl as Q,Fl as R,uc as Rt,su as S,Z as St,Vl as T,Zc as Tt,Il as U,We as Ut,kl as V,fs as Vt,tu as W,ql as X,Yl as Y,Jl as Z,$l as _,cc as _t,wu as a,dl as at,Ul as b,G as bt,vu as c,pl as ct,gu as d,il as dt,wl as et,hu as f,rl as ft,Wl as g,Q as gt,ou as h,gc as ht,Tu as i,vl as it,jl as j,nl as jt,Ol as k,W as kt,yu as l,ul as lt,Hl as m,vc as mt,qu as n,yl as nt,xu as o,_l as ot,lu as p,hc as pt,eu as q,Ku as r,bl as rt,_u as s,ml as st,rd as t,xl as tt,pu as u,al as ut,Dl as v,K as vt,Gl as w,tl as wt,cu as x,mc as xt,ru as y,Zs as yt,Nl as z,Rs as zt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Hd as e,Ki as t,Qs as n,Zs as r}from"./shared-iMtAwxmT.js";var i=class extends TypeError{constructor(e,t){super(`${e} ${t}: no HTTP answer`),this.name=`XhrNoAnswerError`}};function a(e){let{method:t,url:n,headers:r,body:a,signal:o,onProgress:s}=e;return o.aborted?Promise.reject(o.reason):new Promise((e,c)=>{let l=new XMLHttpRequest,u=a instanceof Blob?a.size:a.byteLength,d=()=>{o.removeEventListener(`abort`,f)},f=()=>{l.abort(),d(),c(o.reason)};l.open(t,n);for(let[e,t]of Object.entries(r))l.setRequestHeader(e,t);l.upload.addEventListener(`progress`,e=>s(e.loaded)),l.upload.addEventListener(`load`,()=>s(u)),l.addEventListener(`load`,()=>{d(),e({status:l.status,body:l.responseText})}),l.addEventListener(`error`,()=>{d(),c(new i(t,n))}),o.addEventListener(`abort`,f,{once:!0}),s(0),l.send(a)})}async function o(e){let{url:n,headers:r,contentType:o,bytes:s,signal:c,onProgress:l}=e;try{return await a({method:`POST`,url:n,headers:{...r,"Content-Type":o},body:s,signal:c,onProgress:l})}catch(e){throw e instanceof i?new t({status:0,errorCode:null,params:null,message:`POST ${n}: no HTTP answer`}):e}}var s=401;async function c(e){let{contentType:t,bytes:n,signal:r,onProgress:i,authorize:a,refuse:c}=e,l=async()=>{let{url:e,headers:s}=await a();return o({url:e,headers:s,contentType:t,bytes:n,signal:r,onProgress:i})},u=await l();return u.status===s&&(u=await l()),u.status<200||u.status>=300?c(u):JSON.parse(u.body)}function l(e,n){return(n==null?void 0:n.aborted)===!0?n.reason:e instanceof TypeError?new t({status:0,errorCode:null,params:null,message:e.message}):e}async function u(e,t){try{return await e()}catch(e){throw l(e,t)}}var d=401;async function f(t,r){let i=await n.call(`API_DIRECT_AUTHORIZE`,{path:r});if(`error`in i)throw new e(i.error,i.status,{method:t,path:r});return{url:i.url,headers:i.headers}}async function p(t,r,i,a){let o=await n.call(`API_DIRECT_REFUSED`,{path:r,status:i,body:a});throw new e(o.error,o.status,{method:t,path:r})}function m(e){let{path:t,contentType:n,bytes:r,signal:i,onProgress:a}=e;return c({contentType:n,bytes:r,signal:i,onProgress:a,authorize:()=>f(`POST`,t),refuse:({status:e,body:n})=>p(`POST`,t,e,n)})}async function h(e){let{path:t,signal:n}=e,r=async()=>{let{url:e,headers:r}=await f(`GET`,t);return u(()=>fetch(e,{headers:r,...n!==void 0&&{signal:n}}),n)},i=await r();if(i.status===d&&(i=await r()),!i.ok){let e=await u(()=>i.text(),n);return p(`GET`,t,i.status,e)}let a=i.headers.get(`content-type`);if(a===null)throw Error(`GET ${t} answered ${String(i.status)} without a Content-Type`);let o=await u(()=>i.arrayBuffer(),n);return{contentType:a,bytes:new Uint8Array(o)}}function g(){return{async request({method:e,path:t,body:n,schema:i}){let a=await _(r(t,{method:e,...n!==void 0&&{body:JSON.stringify(n)}}));return i.parse(a)},async upload({path:e,contentType:t,bytes:n,schema:r,signal:i,onProgress:a}){let o=await _(m({path:e,contentType:t,bytes:n,signal:i,onProgress:a}));return r.parse(o)},download({path:e,signal:t}){return _(h({path:e,signal:t}))}}}async function _(t){try{return await t}catch(t){throw t instanceof e?v(t):t}}function v(e){let n=typeof e.payload.message==`string`&&e.payload.message!==``?e.payload.message:`Chat request failed with HTTP ${String(e.status)}`;return new t({status:e.status,errorCode:e.errorCode??null,params:e.params??null,message:n})}export{g as t};
|