@kubitnodes/stellaris 0.3.1 → 0.3.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/cli/index.js +63 -1
- package/dist/server/index.js +134 -4
- package/package.json +1 -1
- package/web/dist/assets/ChannelView-CBWvCs5U.js +1 -0
- package/web/dist/assets/CitizenView-DKqzTA5L.js +2 -0
- package/web/dist/assets/{CitizensView-D7VztzDL.js → CitizensView-BtutRBPU.js} +1 -1
- package/web/dist/assets/{KnowledgeView-D2jzcn4S.js → KnowledgeView-DSinMNzK.js} +1 -1
- package/web/dist/assets/Markdown-CwjhVNEk.js +31 -0
- package/web/dist/assets/{MessageItem-BcDf-lgD.js → MessageItem-DaQY-yGb.js} +1 -1
- package/web/dist/assets/{MetricsView-lRYbAJSl.js → MetricsView-BBgZsSMk.js} +1 -1
- package/web/dist/assets/NeedsYouView-gft672O-.js +1 -0
- package/web/dist/assets/Overview-C7bUUfnY.js +1 -0
- package/web/dist/assets/{Pane-DKfOLaXj.js → Pane-JzhKR0rO.js} +1 -1
- package/web/dist/assets/{ProjectView-CSoD4RFx.js → ProjectView-CSTwTULB.js} +1 -1
- package/web/dist/assets/ProposalView-B0qXK-Vb.js +1 -0
- package/web/dist/assets/{ProposalsView-BQucmpBt.js → ProposalsView-D35XMr14.js} +1 -1
- package/web/dist/assets/{RunnersView-FbbPyu3y.js → RunnersView-DxmadMPv.js} +1 -1
- package/web/dist/assets/{SocietyView-rpbJ_PcL.js → SocietyView-DQ3w5OWp.js} +1 -1
- package/web/dist/assets/SubjectThread-XI7ydhsi.js +1 -0
- package/web/dist/assets/TaskFileView-7ljZ5Olx.js +1 -0
- package/web/dist/assets/TaskView-DyZBBjh1.js +1 -0
- package/web/dist/assets/{TasksView-CJkLuWGV.js → TasksView-nQhDOU_5.js} +1 -1
- package/web/dist/assets/ThreadCard-BZHmKArH.js +1 -0
- package/web/dist/assets/ThreadForms-TZMoO5-W.js +1 -0
- package/web/dist/assets/{ThreadView-D09wIsYl.js → ThreadView-BV2yDunm.js} +1 -1
- package/web/dist/assets/{citizen-BPzyDHNO.js → citizen-9NPRBOpv.js} +1 -1
- package/web/dist/assets/format-8m6fdeP8.js +55 -0
- package/web/dist/assets/index-C3ujZpqY.css +2 -0
- package/web/dist/assets/index-DrMc2vuA.js +23 -0
- package/web/dist/assets/{tasks-DcMvT5ru.js → tasks-Di8iatzY.js} +1 -1
- package/web/dist/assets/{useStickyScroll-B3_nksqI.js → useStickyScroll-BPuANcOs.js} +1 -1
- package/web/dist/index.html +4 -4
- package/web/dist/assets/ChannelView-UppsahaH.js +0 -1
- package/web/dist/assets/CitizenView-CvZ5sEqw.js +0 -2
- package/web/dist/assets/Markdown-Dc8gCFZz.js +0 -29
- package/web/dist/assets/NeedsYouView-C-2cU-C5.js +0 -1
- package/web/dist/assets/Overview-lKNZgZg_.js +0 -1
- package/web/dist/assets/ProposalView-BkcPia8W.js +0 -1
- package/web/dist/assets/SubjectThread-DQHf-MWF.js +0 -1
- package/web/dist/assets/TaskView-6_oFPNkL.js +0 -1
- package/web/dist/assets/ThreadCard-Cjwceioc.js +0 -1
- package/web/dist/assets/ThreadForms-CE9t-rVz.js +0 -1
- package/web/dist/assets/format-CRfcN5Lw.js +0 -55
- package/web/dist/assets/index-Ch3gW4_Z.js +0 -23
- package/web/dist/assets/index-NUcot4yn.css +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e,Yt as t,_n as n,bn as r,gn as i,m as a,t as o}from"./format-8m6fdeP8.js";import{N as s}from"./index-DrMc2vuA.js";import{t as c}from"./Markdown-CwjhVNEk.js";import{t as l}from"./MessageItem-DaQY-yGb.js";var u=r(n(),1),d=i();function f({thread:n,now:r,task:i,empty:f}){let{api:p}=e(),m=a(),h=t({queryKey:[`thread`,n.id],queryFn:()=>p.thread(n.id)}),g=h.data?.messages??[],_=g.at(-1)?.id??null;if((0,u.useEffect)(()=>s(n.id,_),[n.id,_]),h.data===void 0)return(0,d.jsx)(`p`,{className:`mt-2 text-meta`,children:`Reading the thread…`});let v=h.data.thread;return(0,d.jsxs)(`div`,{className:`-mx-4 mt-1`,children:[g.length===0?(0,d.jsx)(`p`,{className:`mx-4 mt-1 text-meta`,children:f}):g.map(e=>(0,d.jsx)(l,{message:e,members:m.data,now:r,task:i},e.id)),n.state===`closed`?(0,d.jsxs)(`div`,{className:`mx-4 mt-2`,children:[(0,d.jsxs)(`p`,{className:`text-meta`,children:[`Closed`,v.closedAt===void 0?``:` ${o(v.closedAt,r)}`,v.body.trim()===``?`.`:`:`]}),v.body.trim()===``?null:(0,d.jsx)(c,{text:v.body})]}):null]})}export{f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,J as t,L as n,M as r,_n as i,bn as a,gn as o,t as s,v as c,xt as l,y as u}from"./format-8m6fdeP8.js";import{I as d}from"./index-DrMc2vuA.js";import{c as f,i as p,l as m,n as h,o as g,r as _,s as v,t as y,u as b}from"./Markdown-CwjhVNEk.js";import{n as x,t as S}from"./Pane-JzhKR0rO.js";var C=a(i(),1),w=o(),T=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,E=`inline-flex h-7 shrink-0 items-center rounded-md px-3 text-xs text-fg-tertiary transition-colors hover:bg-surface-2/70 hover:text-fg-primary`,D=1e3;function O({taskId:e,path:t}){let n=t===``?[]:t.split(`/`),r=`text-fg-tertiary hover:text-fg-primary`;return(0,w.jsxs)(`nav`,{"aria-label":`Path`,className:`flex flex-wrap items-center gap-x-1 text-meta`,children:[n.length===0?(0,w.jsx)(`span`,{children:`Files`}):(0,w.jsx)(h,{taskId:e,path:``,className:r,children:`Files`}),n.map((t,i)=>(0,w.jsxs)(C.Fragment,{children:[(0,w.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),i===n.length-1?(0,w.jsx)(`span`,{className:`text-fg-secondary`,children:t}):(0,w.jsx)(h,{taskId:e,path:n.slice(0,i+1).join(`/`),className:r,children:t})]},n.slice(0,i+1).join(`/`)))]})}function k({taskId:e,file:t}){let n=t.entries.toSorted((e,t)=>e.kind===t.kind?e.name.localeCompare(t.name):e.kind===`dir`?-1:1);return(0,w.jsx)(`ul`,{className:`mt-3 space-y-1`,children:n.map(n=>(0,w.jsxs)(`li`,{className:`flex items-baseline gap-2`,children:[(0,w.jsx)(h,{taskId:e,path:t.path===``?n.name:`${t.path}/${n.name}`,className:`text-sm text-fg-secondary hover:text-fg-primary`,children:n.kind===`dir`?`${n.name}/`:n.name}),n.size===null?null:(0,w.jsx)(`span`,{className:`text-meta`,children:m(n.size)})]},n.name))})}function A({rows:e}){let[t,...n]=e;if(t===void 0)return(0,w.jsx)(`p`,{className:`mt-3 text-meta`,children:`The table is empty.`});let r=n.slice(0,D),i=`border border-line px-2 py-1 text-left align-top whitespace-pre-wrap`;return(0,w.jsxs)(`div`,{className:`mt-3 overflow-x-auto`,children:[(0,w.jsxs)(`table`,{className:`text-xs text-fg-secondary`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsx)(`tr`,{children:t.map((e,t)=>(0,w.jsx)(`th`,{scope:`col`,className:`${i} font-medium text-fg-primary`,children:e},t))})}),(0,w.jsx)(`tbody`,{children:r.map((e,t)=>(0,w.jsx)(`tr`,{children:e.map((e,t)=>(0,w.jsx)(`td`,{className:i,children:e},t))},t))})]}),n.length>r.length?(0,w.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,D,` of `,n.length,` rows; download the file for the rest.`]}):null]})}function j({taskId:e,file:n,url:r}){let i=(0,C.useMemo)(()=>n.content===null?null:b(n.path,p(n.content)),[n.path,n.content]),a=n.path.split(`/`).at(-1)??n.path;return i===null?(0,w.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[a,` is `,m(n.size),`, more than the `,m(t),` the board shows. Its runner still has it on the task's branch.`]}):i.kind===`markdown`?(0,w.jsx)(`div`,{className:`mt-3`,children:(0,w.jsx)(y,{text:i.text,base:{taskId:e,dir:f(n.path)}})}):i.kind===`image`?r===null?null:(0,w.jsx)(`img`,{src:r,alt:a,className:`mt-3 max-w-full rounded-lg`}):i.kind===`table`?(0,w.jsx)(A,{rows:i.rows}):i.kind===`text`?(0,w.jsx)(`pre`,{className:`mt-3 overflow-x-auto rounded-lg bg-surface-0/80 p-3 font-mono text-[12px] leading-relaxed text-fg-secondary shadow-[inset_0_0_0_1px_rgba(255,255,255,0.05)]`,children:i.text}):(0,w.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[a,` is not text (`,m(n.size),`). Download it to open it.`]})}function M(){let{taskId:t,_splat:i}=d({from:`/task/$taskId/files/$`}),a=v(i??``)??``,o=e(t),f=u(),p=r(t,a),m=c(3e4),h=p.data,y=h?.kind===`file`?h.content:null,b=_(y,g(a)??`application/octet-stream`),C=a===``?`Files`:a.split(`/`).at(-1)??a,D=o.data?.title??t,A;if(h!==void 0)A=h.kind===`dir`?(0,w.jsx)(k,{taskId:t,file:h}):(0,w.jsx)(j,{taskId:t,file:h,url:b});else if(p.error instanceof n&&p.error.status===404)A=(0,w.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[a===``?`Nothing`:a,` is not on task/`,t,` yet. What a turn writes reaches the branch when the turn ends.`]});else if(p.error instanceof n&&p.error.status===503){let e=f.data?.find(e=>e.slug===o.data?.project);A=(0,w.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[e?.runner===void 0?`The runner`:`${e.runner}, the runner`,` `,e?.name??`the project`,` lives on, is not connected, so the task's files cannot be read now.`]})}else A=p.error===null?(0,w.jsxs)(x,{children:[`Reading `,C,` from the task's runner…`]}):(0,w.jsx)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:p.error.message});return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(S,{leading:(0,w.jsx)(l,{to:`/task/$taskId`,params:{taskId:t},"aria-label":`Back to the task ${D}`,className:T,children:`←`}),title:C,subtitle:h===void 0?D:`${D} · committed by ${h.commit.author} ${s(h.commit.at,m)} · ${h.commit.id.slice(0,7)}`,trailing:b===null?null:(0,w.jsx)(`a`,{href:b,download:C,className:E,children:`Download`})}),(0,w.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:[(0,w.jsx)(O,{taskId:t,path:a}),A]})]})}export{M as TaskFileView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,E as t,L as n,P as r,gn as i,hn as a,j as o,m as s,t as c,v as l,xt as u,y as d}from"./format-8m6fdeP8.js";import{a as f,c as p,l as m,n as h,o as g,r as _,s as v,t as y}from"./tasks-Di8iatzY.js";import{I as b,L as x,a as S,c as C,s as w,t as T,v as E}from"./index-DrMc2vuA.js";import{a as D,n as O,t as k}from"./Markdown-CwjhVNEk.js";import{n as A,t as j}from"./Pane-JzhKR0rO.js";import{t as M}from"./SubjectThread-XI7ydhsi.js";var N=i();function P({task:e,now:t}){let r=o(e.id),i=d(),a=`task/${e.id}`,s;if(r.data!==void 0){let{files:n,total:i,head:o}=r.data;s=n.length===0?(0,N.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing changed on `,a,` yet. What a turn writes reaches the branch when the turn ends.`]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`p`,{className:`mt-2 text-meta`,children:[i===1?`1 file`:`${i} files`,` changed · newest commit by `,o.author,` `,c(o.at,t)]}),(0,N.jsx)(`ul`,{className:`mt-2 space-y-1`,children:n.map(n=>(0,N.jsxs)(`li`,{className:`flex items-baseline gap-2 text-sm`,children:[n.status===`deleted`?(0,N.jsx)(`span`,{className:`min-w-0 truncate text-fg-tertiary line-through`,title:n.path,children:n.path}):(0,N.jsx)(O,{taskId:e.id,path:n.path,className:`min-w-0 truncate text-fg-secondary hover:text-fg-primary`,children:n.path}),(0,N.jsx)(`span`,{className:`shrink-0 text-meta`,children:D(n)}),n.lastChange===void 0?null:(0,N.jsxs)(`span`,{className:`ml-auto shrink-0 text-meta`,children:[n.lastChange.author,` `,c(n.lastChange.at,t)]})]},n.path))}),i>n.length?(0,N.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,n.length,` of `,i,`; browse the branch for the rest.`]}):null]})}else if(r.error instanceof n&&r.error.status===404)s=(0,N.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing on `,a,` yet. What a turn writes reaches the branch when the turn ends.`]});else if(r.error instanceof n&&r.error.status===503){let t=i.data?.find(t=>t.slug===e.project);s=(0,N.jsxs)(`p`,{className:`mt-2 text-meta`,children:[t?.runner===void 0?`The runner`:`${t.runner}, the runner`,` `,t?.name??e.project,` lives on, is not connected, so the task's files cannot be listed now.`]})}else s=r.error===null?(0,N.jsx)(`p`,{className:`mt-2 text-meta`,children:`Reading the task's branch…`}):(0,N.jsx)(`p`,{className:`mt-2 text-meta`,children:r.error.message});return(0,N.jsxs)(`section`,{"aria-label":`Files`,className:`mt-5 border-t border-line pt-4`,children:[(0,N.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,N.jsx)(`h3`,{className:`text-section`,children:`Files`}),(0,N.jsx)(O,{taskId:e.id,path:``,className:`text-meta underline decoration-line underline-offset-2 hover:text-fg-primary`,children:`Browse the branch`})]}),s]})}function F({stage:e,index:t,task:n,members:r,now:i}){let a=e.completedBy!==void 0,o=g(n,e),s=t===n.stages.length-1,l=o&&n.status===`claimed`?n.claimedBy:void 0,u=e.holders.filter(t=>t!==l&&t!==e.completedBy),d=n.returned?.from===e.id?n.returned:void 0;return(0,N.jsxs)(`li`,{className:`relative flex gap-3 pb-4`,children:[s?null:(0,N.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-6 bottom-0 left-2.5 w-px bg-line`}),(0,N.jsx)(`span`,{"aria-hidden":`true`,className:`relative z-10 grid size-5 shrink-0 place-items-center rounded-full text-[10px] ${a?`bg-emerald-400/20 text-emerald-300`:o?`bg-fg-primary text-surface-0`:`bg-surface-2 text-fg-muted`}`,children:a?`✓`:t+1}),(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsxs)(`p`,{className:`text-sm ${o?`font-medium text-fg-primary`:`text-fg-secondary`}`,children:[e.name,e.gate?(0,N.jsx)(`span`,{className:`ml-2 rounded-md bg-sky-400/10 px-1.5 py-px text-[11px] text-sky-300`,children:`gate`}):null]}),(0,N.jsxs)(`p`,{className:`mt-0.5 text-meta`,children:[`for `,_(e),l===void 0?null:(0,N.jsxs)(N.Fragment,{children:[` · held by `,(0,N.jsx)(w,{name:l,members:r})]}),e.completedBy!==void 0&&e.completedAt!==void 0?` · done by ${e.completedBy} ${c(e.completedAt,i)}`:o&&n.status===`open`?` · waiting since ${c(n.stageSince,i)}`:``,u.length>0?` · held before by ${u.join(`, `)}`:``,d===void 0?``:` · sent back by ${d.by} ${c(d.at,i)}`]})]})]})}function I({taskId:e}){let{api:n}=t(),r=a(),i=x({mutationFn:()=>n.openThread({task_id:e}),onSuccess:()=>{r.invalidateQueries({queryKey:[`threads`]})}});return(0,N.jsxs)(`div`,{className:`mt-2 flex items-center gap-3`,children:[(0,N.jsx)(S,{variant:`primary`,disabled:i.isPending,onClick:()=>i.mutate(),children:i.isPending?`Opening…`:`Open its thread`}),(0,N.jsx)(`p`,{className:`text-meta`,children:i.error===null?`This task is older than task threads. It closes when the task ends.`:i.error.message})]})}function L(){let{taskId:t}=b({from:`/task/$taskId`}),i=e(t),a=r(),o=d(),g=s(),_=l(3e4);if(i.data===void 0)return(0,N.jsx)(A,{children:i.error instanceof n&&i.error.status===404?`There is no task ${t}.`:`Reading the task…`});let x=i.data,S=v(x),w=o.data?.find(e=>e.slug===x.project),D=a.data?.find(e=>e.id===x.id);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(j,{leading:(0,N.jsx)(u,{to:`/p/$slug/tasks`,params:{slug:x.project},"aria-label":`Back to the tasks of ${w?.name??x.project}`,className:`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`←`}),title:x.title,subtitle:`${w?.name??x.project} · ${p(x)} · created by ${C(x.createdBy)} ${c(x.createdAt,_)}`,trailing:(0,N.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${h[S]}`,children:y.find(e=>e.phase===S)?.label.toLowerCase()})}),(0,N.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:[(0,N.jsx)(`h3`,{className:`text-section`,children:`Plan`}),x.returned===void 0?null:(0,N.jsxs)(`p`,{className:`mt-2 rounded-lg bg-orange-500/10 px-3 py-2 text-xs leading-relaxed text-orange-200`,children:[`Sent back from `,m(x,x.returned.from),` by `,x.returned.by,` `,c(x.returned.at,_),`. The work is redone from`,` `,m(x,x.stage),` until it reaches that stage again.`]}),(0,N.jsx)(`ol`,{className:`mt-3`,children:x.stages.map((e,t)=>(0,N.jsx)(F,{stage:e,index:t,task:x,members:g.data,now:_},e.id))}),(0,N.jsxs)(`p`,{className:`text-meta`,children:[`When the last stage is done:`,` `,x.onDone===`merge`?`task/${x.id} merges onto the default branch`:`nothing more`,x.blockedBy.length>0?(0,N.jsxs)(N.Fragment,{children:[` · blocked by `,(0,N.jsx)(E,{text:x.blockedBy.join(`, `)})]}):null]}),x.body.trim()===``?null:(0,N.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,N.jsx)(`h3`,{className:`text-section`,children:`Brief`}),(0,N.jsx)(`div`,{className:`mt-2`,children:(0,N.jsx)(k,{text:x.body})})]}),(0,N.jsx)(P,{task:x,now:_}),(0,N.jsxs)(`section`,{"aria-label":`Thread`,className:`mt-5 border-t border-line pt-4`,children:[(0,N.jsx)(`h3`,{className:`text-section`,children:`Thread`}),a.data===void 0?null:D===void 0?f(x)?(0,N.jsx)(I,{taskId:x.id}):(0,N.jsx)(`p`,{className:`mt-2 text-meta`,children:`No thread on this task.`}):(0,N.jsx)(M,{thread:D,now:_,task:x,empty:`Nothing said yet. Each stage's handover lands here, and so does anything written below.`})]})]}),D?.state===`open`?(0,N.jsx)(T,{target:{threadId:x.id},placeholder:`Write in the task's thread`}):null]})}export{L as TaskView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{N as e,_n as t,bn as n,gn as r,m as i,ot as a,t as o,v as s,xt as c,y as l}from"./format-8m6fdeP8.js";import{c as u,i as d,l as f,o as p,r as m,s as h,t as g}from"./tasks-Di8iatzY.js";import{I as _,s as v}from"./index-DrMc2vuA.js";import{n as y,t as b}from"./Pane-JzhKR0rO.js";var x=n(t(),1),S=r();function C({task:e}){let t=h(e);return(0,S.jsx)(`ol`,{className:`flex gap-1`,"aria-hidden":`true`,children:e.stages.map((n,r)=>{let i=n.completedBy!==void 0,a=p(e,n),o=i?`bg-emerald-400/60`:a?e.status===`claimed`?`bg-fg-primary/90`:`bg-amber-300/80`:t===`abandoned`?`bg-surface-2/50`:`bg-surface-2`;return(0,S.jsx)(`li`,{title:`${r+1}. ${n.name} · ${m(n)}${n.gate?` · gate`:``}`,className:`h-1.5 min-w-3 flex-1 rounded-full ${o} ${n.gate?`ring-1 ring-sky-300/70 ring-offset-1 ring-offset-surface-1`:``}`},n.id)})})}var w=5;function T({task:e,members:t,now:n}){let r=h(e),i=a(e);return(0,S.jsx)(`li`,{children:(0,S.jsxs)(c,{to:`/task/$taskId`,params:{taskId:e.id},className:`block rounded-xl px-3 py-2.5 transition-colors hover:bg-surface-2/50`,children:[(0,S.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,S.jsx)(`span`,{className:`text-title min-w-0 flex-1 truncate`,children:e.title}),(0,S.jsx)(`span`,{className:`shrink-0 text-meta`,children:u(e)})]}),(0,S.jsx)(`div`,{className:`mt-2`,children:(0,S.jsx)(C,{task:e})}),e.returned===void 0?null:(0,S.jsxs)(`p`,{className:`mt-1.5 truncate text-xs text-orange-300/90`,children:[`Sent back from `,f(e,e.returned.from),` by `,e.returned.by,` `,o(e.returned.at,n)]}),(0,S.jsx)(`p`,{className:`mt-1.5 truncate text-meta`,children:e.status===`claimed`&&r!==`landing`&&i!==void 0?(0,S.jsxs)(S.Fragment,{children:[i.name,` · held by `,(0,S.jsx)(v,{name:e.claimedBy??``,members:t})]}):e.status===`open`&&r!==`landing`&&i!==void 0?`${i.name} · waiting for ${m(i)} since ${o(e.stageSince,n)}`:r===`landing`?`landing task/${e.id} on the default branch`:`${r} ${o(e.updatedAt,n)}`})]})})}function E(){let{slug:t}=_({from:`/p/$slug/tasks`}),n=e(t),r=l(),a=i(),o=s(3e4),[c,u]=(0,x.useState)(new Set),f=r.data?.find(e=>e.slug===t),p=d(n.data??[]),m=p.filter(e=>e.phase!==`done`&&e.phase!==`abandoned`).reduce((e,t)=>e+t.tasks.length,0);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(b,{title:`Tasks`,subtitle:`${f?.name??t} · ${m} in play · ${n.data?.length??0} in all`}),(0,S.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:n.data===void 0?(0,S.jsx)(y,{children:`Reading the tasks…`}):p.length===0?(0,S.jsx)(y,{children:`No tasks in this project yet.`}):p.map(e=>{let t=e.phase!==`done`&&e.phase!==`abandoned`||c.has(e.phase)?e.tasks:e.tasks.slice(0,w);return(0,S.jsxs)(`section`,{className:`mb-3`,children:[(0,S.jsxs)(`h3`,{className:`px-3 pt-2 pb-1 text-[11px] font-semibold tracking-wider text-fg-muted uppercase`,children:[g.find(t=>t.phase===e.phase)?.label,` · `,e.tasks.length]}),(0,S.jsx)(`ul`,{children:t.map(e=>(0,S.jsx)(T,{task:e,members:a.data,now:o},e.id))}),t.length<e.tasks.length?(0,S.jsxs)(`button`,{type:`button`,onClick:()=>u(new Set([...c,e.phase])),className:`px-3 pt-1 text-xs text-fg-tertiary hover:text-fg-primary`,children:[`Show all `,e.tasks.length]}):null]},e.phase)})})]})}export{E as TasksView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{gn as e,n as t,t as n,xt as r}from"./format-8m6fdeP8.js";import{v as i}from"./index-DrMc2vuA.js";var a=e();function o(e){return e?.kind??`topic`}function s({state:e}){return(0,a.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${e===`open`?`bg-emerald-500/15 text-emerald-300`:`bg-surface-2 text-fg-tertiary`}`,children:e})}function c({thread:e,now:c}){let l=e.state===`closed`?t(e.body,180):``,u=e.messages===1?`1 message`:`${e.messages} messages`;return(0,a.jsxs)(r,{to:`/thread/$threadId`,params:{threadId:e.id},className:`mx-4 my-2 block rounded-xl bg-surface-2/40 px-3.5 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors hover:bg-surface-2/70`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,a.jsx)(`span`,{"aria-hidden":`true`,className:`text-fg-muted`,children:`↳`}),(0,a.jsx)(`span`,{className:`text-title min-w-0 flex-1 truncate`,children:e.title}),(0,a.jsx)(s,{state:e.state})]}),(0,a.jsxs)(`p`,{className:`mt-1 text-meta`,children:[o(e.subject),` thread by `,e.openedBy,` · `,u,` · opened`,` `,n(e.openedAt,c)]}),l===``?null:(0,a.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-relaxed text-fg-secondary`,children:(0,a.jsx)(i,{text:l,links:!1})})]})}export{c as n,o as r,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,E as t,L as n,_n as r,bn as i,gn as a,hn as o,m as s}from"./format-8m6fdeP8.js";import{L as c,P as l,a as u,n as d,r as f}from"./index-DrMc2vuA.js";var p=i(r(),1),m=a(),h=`block w-full rounded-lg bg-surface-2/50 px-3 py-2 text-sm text-fg-primary outline-none shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] placeholder:text-fg-muted focus:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.16)]`;function g({error:e}){return e===null?null:(0,m.jsx)(`p`,{role:`alert`,className:`text-xs text-red-400`,children:e instanceof n?e.message:`The board did not take it.`})}function _({channel:n,onDone:r}){let{api:i}=t(),a=o(),_=l(),v=s(),y=e(),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(``),w=(0,p.useRef)(null);(0,p.useEffect)(()=>w.current?.focus(),[]);let T=c({mutationFn:async()=>{let e=await i.openThread({channel:n,title:b.trim()});return S.trim()!==``&&await i.sendMessage({thread_id:e.id,body:S.trim()}),e},onSuccess:e=>{a.invalidateQueries({queryKey:[`threads`]}),r(),_({to:`/thread/$threadId`,params:{threadId:e.id}})}}),E=S.trim()===``?[]:f(S,v.data??[],y.data??[]);return(0,m.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),T.mutate()},children:[(0,m.jsx)(`input`,{ref:w,value:b,maxLength:200,placeholder:`What is the thread about?`,"aria-label":`Thread title`,onChange:e=>x(e.target.value),className:h}),(0,m.jsx)(`textarea`,{value:S,rows:3,placeholder:`First message, optional`,"aria-label":`First message`,onChange:e=>C(e.target.value),className:`${h} resize-none`}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-[11px] text-fg-muted`,children:E.length>0?`The first message wakes ${d(E)}.`:`Only its participants and anyone mentioned will read it.`}),(0,m.jsx)(u,{onClick:r,children:`Cancel`}),(0,m.jsx)(u,{variant:`primary`,type:`submit`,disabled:b.trim()===``||T.isPending,children:T.isPending?`Opening…`:`Open thread`})]}),(0,m.jsx)(g,{error:T.error})]})}function v({threadId:e,channel:n,onDone:r}){let{api:i}=t(),a=o(),[s,l]=(0,p.useState)(``),d=(0,p.useRef)(null);(0,p.useEffect)(()=>d.current?.focus(),[]);let f=c({mutationFn:()=>i.closeThread({thread_id:e,summary:s.trim()}),onSuccess:()=>{for(let t of[[`thread`,e],[`threads`],[`channel`,n]])a.invalidateQueries({queryKey:t});r()}});return(0,m.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),f.mutate()},children:[(0,m.jsx)(`textarea`,{ref:d,value:s,rows:3,placeholder:`What did it settle? The summary is posted to #${n}.`,"aria-label":`Closing summary`,onChange:e=>l(e.target.value),className:`${h} resize-none`}),(0,m.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,m.jsx)(u,{onClick:r,children:`Cancel`}),(0,m.jsx)(u,{variant:`primary`,type:`submit`,disabled:s.trim()===``||f.isPending,children:f.isPending?`Closing…`:`Close thread`})]}),(0,m.jsx)(g,{error:f.error})]})}export{_ as i,h as n,g as r,v as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,E as t,
|
|
1
|
+
import{A as e,E as t,L as n,Yt as r,_n as i,bn as a,gn as o,m as s,t as c,v as l,xt as u}from"./format-8m6fdeP8.js";import{I as d,N as f,a as p,c as m,t as h}from"./index-DrMc2vuA.js";import{t as g}from"./Markdown-CwjhVNEk.js";import{t as _}from"./MessageItem-DaQY-yGb.js";import{n as v,t as y}from"./Pane-JzhKR0rO.js";import{r as b,t as x}from"./ThreadCard-BZHmKArH.js";import{t as S}from"./ThreadForms-TZMoO5-W.js";import{t as C}from"./useStickyScroll-BPuANcOs.js";var w=a(i(),1),T=o();function E(){let{threadId:e}=d({from:`/thread/$threadId`});return(0,T.jsx)(D,{id:e},e)}function D({id:i}){let{api:a}=t(),o=r({queryKey:[`thread`,i],queryFn:()=>a.thread(i)}),d=s(),E=l(3e4),D=o.data?.messages??[],O=D.at(-1)?.id??null;(0,w.useEffect)(()=>f(i,O),[i,O]);let{ref:k,onScroll:A}=C(),[j,M]=(0,w.useState)(!1),N=o.data?.thread.subject,P=e(N?.kind===`task`?N.id:null);if(o.data===void 0)return(0,T.jsx)(v,{children:o.error instanceof n&&o.error.status===404?`There is no thread ${i}.`:`Reading the thread…`});let{thread:F}=o.data;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(y,{leading:(0,T.jsx)(u,{to:`/c/$`,params:{_splat:F.channel},"aria-label":`Back to #${F.channel}`,className:`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`←`}),title:F.title,subtitle:`${b(F.subject)} thread in #${F.channel} · opened by ${m(F.openedBy)} ${c(F.openedAt,E)}`,trailing:(0,T.jsxs)(T.Fragment,{children:[F.subject?.kind===`task`?(0,T.jsx)(u,{to:`/task/$taskId`,params:{taskId:F.subject.id},className:`shrink-0 rounded-md px-2 py-1 text-xs text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`Task →`}):F.subject?.kind===`proposal`?(0,T.jsx)(u,{to:`/proposal/$proposalId`,params:{proposalId:F.subject.id},className:`shrink-0 rounded-md px-2 py-1 text-xs text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`Proposal →`}):null,F.state===`open`&&!j&&F.subject?.kind!==`task`?(0,T.jsx)(p,{onClick:()=>M(!0),children:`Close`}):(0,T.jsx)(x,{state:F.state})]})}),j&&F.state===`open`?(0,T.jsx)(S,{threadId:F.id,channel:F.channel,onDone:()=>M(!1)}):null,(0,T.jsxs)(`div`,{ref:k,onScroll:A,className:`flex-1 overflow-y-auto py-2`,children:[D.length===0?(0,T.jsx)(v,{children:`No messages in this thread yet.`}):null,D.map(e=>(0,T.jsx)(_,{message:e,members:d.data,now:E,task:P.data},e.id)),F.state===`closed`?(0,T.jsxs)(`section`,{className:`mx-4 mt-3 mb-2 rounded-xl bg-surface-2/40 px-3.5 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]`,children:[(0,T.jsxs)(`p`,{className:`text-caps`,children:[`Closed by `,m(F.closedBy??`board`),F.closedAt===void 0?``:` ${c(F.closedAt,E)}`]}),F.body.trim()===``?(0,T.jsxs)(`p`,{className:`mt-1 text-meta`,children:[`It ended with its `,b(F.subject),`.`]}):(0,T.jsx)(g,{text:F.body})]}):null]}),F.state===`open`?(0,T.jsx)(h,{target:{threadId:F.id},placeholder:`Reply in the thread`}):null]})}export{E as ThreadView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{it as e}from"./format-8m6fdeP8.js";import{u as t}from"./index-DrMc2vuA.js";function n(e){return e===`society`?`the society`:e}function r(t){return[...t.memberships,e]}function i(e){return e.startedAt===void 0?null:t(e.startedAt,Date.parse(e.ts))}var a={completed:`completed`,timeout:`timed out`,error:`failed`,interrupted:`interrupted`,blocked:`blocked`,stopped:`stopped by you`};function o(e){return e.exitReason===null?e.outcome===`failed`?`failed`:`completed`:a[e.exitReason]??e.exitReason}function s(e){return e.outcome===`failed`||e.exitReason!==null&&e.exitReason!==`completed`&&e.exitReason!==`stopped`}function c(e,t){return t===`codex`&&e.costUsd===0?`unmetered`:`$${e.costUsd.toFixed(2)}`}function l(e){return{turns:e.length,failed:e.filter(s).length,costUsd:e.reduce((e,t)=>e+t.costUsd,0)}}function u(e,t){let n=/^\s*#{1,6}\s+(.+?)\s*(?:\n|$)/.exec(e);return n?.[1]?.toLowerCase()===t.toLowerCase()?e.slice(n[0].length).trim():e}function d(e,t){let n=[...e.homeRunner===void 0?[]:[{what:`outside projects`,runner:e.homeRunner}],...e.memberships.map(e=>({what:e,runner:t.get(e)}))],r=[...new Set(n.flatMap(e=>e.runner===void 0?[]:[e.runner]))],i=n.map(e=>`${e.what}: ${e.runner??`placed on its first turn`}`).join(`; `);return{label:r.length===0?`no runner yet`:`on ${r.join(`, `)}`,detail:i===``?`pinned to a runner on its first turn`:i}}export{n as a,u as c,d as i,o as n,i as o,l as r,r as s,c as t};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var ee={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,te={};function ne(e,t,n){this.props=e,this.context=t,this.refs=te,this.updater=n||ee}ne.prototype.isReactComponent={},ne.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},ne.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function _(){}_.prototype=ne.prototype;function re(e,t,n){this.props=e,this.context=t,this.refs=te,this.updater=n||ee}var ie=re.prototype=new _;ie.constructor=re,g(ie,ne.prototype),ie.isPureReactComponent=!0;var ae=Array.isArray;function oe(){}var v={H:null,A:null,T:null,S:null},se=Object.prototype.hasOwnProperty;function y(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ce(e,t){return y(e.type,t,e.props)}function b(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function le(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ue=/\/+/g;function de(e,t){return typeof e==`object`&&e&&e.key!=null?le(``+e.key):t.toString(36)}function fe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(oe,oe):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function x(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,x(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+de(e,0):a,ae(o)?(i=``,c!=null&&(i=c.replace(ue,`$&/`)+`/`),x(o,r,i,``,function(e){return e})):o!=null&&(b(o)&&(o=ce(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ue,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(ae(e))for(var u=0;u<e.length;u++)a=e[u],s=l+de(a,u),c+=x(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+de(a,u++),c+=x(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return x(fe(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function S(e,t,n){if(e==null)return e;var r=[],i=0;return x(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function pe(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var C=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function me(e){var t=v.T,n={};n.types=t===null?null:t.types,v.T=n;try{var r=e(),i=v.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(oe,C)}catch(e){C(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),v.T=t}}function he(e){var t=v.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else me(he.bind(null,e))}var w={map:S,forEach:function(e,t,n){S(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return S(e,function(){t++}),t},toArray:function(e){return S(e,function(e){return e})||[]},only:function(e){if(!b(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=w,e.Component=ne,e.Fragment=r,e.Profiler=a,e.PureComponent=re,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=v,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return v.H.useMemoCache(e)}},e.addTransitionType=he,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!se.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return y(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)se.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return y(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=b,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:pe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=me,e.unstable_useCacheRefresh=function(){return v.H.useCacheRefresh()},e.use=function(e){return v.H.use(e)},e.useActionState=function(e,t,n){return v.H.useActionState(e,t,n)},e.useCallback=function(e,t){return v.H.useCallback(e,t)},e.useContext=function(e){return v.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return v.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return v.H.useEffect(e,t)},e.useEffectEvent=function(e){return v.H.useEffectEvent(e)},e.useId=function(){return v.H.useId()},e.useImperativeHandle=function(e,t,n){return v.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return v.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return v.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return v.H.useMemo(e,t)},e.useOptimistic=function(e,t){return v.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return v.H.useReducer(e,t,n)},e.useRef=function(e){return v.H.useRef(e)},e.useState=function(e){return v.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return v.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return v.H.useTransition()},e.version=`19.3.0`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),p=o(((e,t)=>{t.exports=f()})),m=l(d(),1),h=p(),ee=m.createContext(void 0),g=e=>{let t=m.useContext(ee);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},te=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,h.jsx)(ee.Provider,{value:e,children:t})),ne={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},_=new class{#e=ne;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function re(e){setTimeout(e,0)}var ie=typeof window>`u`||`Deno`in globalThis;function ae(){}function oe(e,t){return typeof e==`function`?e(t):e}function v(e){return typeof e==`number`&&e>=0&&e!==1/0}function se(e,t){return Math.max(e+(t||0)-Date.now(),0)}function y(e,t){return typeof e==`function`?e(t):e}function ce(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==le(o,t.options))return!1}else if(!de(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function b(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ue(t.options.mutationKey)!==ue(a))return!1}else if(!de(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function le(e,t){return(t?.queryKeyHashFn||ue)(e)}function ue(e){return JSON.stringify(e,(e,t)=>C(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function de(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!de(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!de(e[r],t[r]))return!1;return!0}return!1}var fe=Object.prototype.hasOwnProperty;function x(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=pe(e)&&pe(t);if(!r&&!(C(e)&&C(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:fe.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=x(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function S(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function pe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function C(e){if(!me(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!me(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function me(e){return Object.prototype.toString.call(e)===`[object Object]`}function he(e){return new Promise(t=>{_.setTimeout(t,e)})}function w(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:x(e,t)}function ge(e){return e}function _e(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ve(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ye=Symbol();function be(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ye?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function xe(e,t){return typeof e==`function`?e(...t):!!e}function Se(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Ce=()=>ie,we=()=>Ce(),Te=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ee=new class extends Te{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},De=re;function Oe(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=De,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ke=Oe(),Ae=new class extends Te{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function je(e){return Math.min(1e3*2**e,3e4)}function Me(e){return(e??`online`)!==`online`||Ae.isOnline()}var Ne=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Pe(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(ae);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Ne(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Ee.isFocused()&&(e.networkMode===`always`||Ae.isOnline())&&e.canRun(),p=()=>Me(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},ee=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),g=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(we()?0:3),a=e.retryDelay??je,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),he(o).then(()=>f()?void 0:ee()).then(()=>{t?h(r):g()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?g():ee().then(g),s)}}var Fe=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),v(this.gcTime)&&(this.#e=_.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(we()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(_.clearTimeout(this.#e),this.#e=void 0)}};function Ie(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Se(e,()=>t.signal,()=>n=!0)},u=be(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ve:_e;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Re:Le,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Le(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Le(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Re(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ze=class extends Fe{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=He(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=He(this.options);e.data!==void 0&&(this.setState(Ve(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=w(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(ae).catch(ae):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>y(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ye||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>y(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!se(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=be(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ie(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Pe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ne&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Ne){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Be(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ve(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ke.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Be(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Me(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ve(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function He(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ue=class extends Te{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ge(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ke(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ke(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof y(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!S(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&qe(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||y(this.options.enabled,this.#t)!==y(t.enabled,this.#t)||y(this.options.staleTime,this.#t)!==y(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||y(this.options.enabled,this.#t)!==y(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return S(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ae)),t}#h(e){return!we()&&y(this.options.enabled,this.#t)!==!1&&v(e)}#g(){this.#b();let e=y(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=se(this.#r.dataUpdatedAt,e)+1;this.#u=_.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return y(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=_.setInterval(()=>{(this.options.refetchIntervalInBackground||Ee.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(_.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(_.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Ge(e,t),o=i&&qe(e,n,t,r);(a||o)&&(l={...l,...Be(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=w(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=w(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let ee=l.fetchStatus===`fetching`,g=m===`pending`,te=m===`error`,ne=g&&ee,_=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:g,isSuccess:m===`success`,isError:te,isInitialLoading:ne,isLoading:ne,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:ee,isRefetching:ee&&!g,isLoadingError:te&&!_,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:te&&_,isStale:Je(e,t),refetch:this.refetch,isEnabled:y(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),S(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();ke.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function We(e,t){return y(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||y(t.retryOnMount,e)!==!1)}function Ge(e,t){return We(e,t)||e.state.data!==void 0&&Ke(e,t,t.refetchOnMount)}function Ke(e,t,n){if(y(t.enabled,e)!==!1&&y(t.staleTime,e)!==`static`){let r=y(n,e);return r===`always`||r!==!1&&Je(e,t)}return!1}function qe(e,t,n,r){return(e!==t||y(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Je(e,n)}function Je(e,t){return y(t.enabled,e)!==!1&&e.isStaleByTime(y(t.staleTime,e))}function Ye(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var Xe=class extends Te{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,ke.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!S(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Ye(e,n).forEach(e=>{e.destroy()}),Ye(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=x(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Ue(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&ke.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Ze=m.createContext(!1),Qe=()=>m.useContext(Ze);Ze.Provider;function $e(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var et=m.createContext($e()),tt=()=>m.useContext(et),nt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?xe(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},rt=e=>{m.useEffect(()=>{e.clearReset()},[e])},it=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||xe(n,[e.error,r])),at=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ot=(e,t)=>e?.suspense&&t.isPending,st=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ct({queries:e,...t},n){let r=g(n),i=Qe(),a=tt(),o=t.subscribed!==!1,s=m.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{at(e);let t=r.getQueryCache().get(e.queryHash);nt(e,a,t)}),rt(a);let[c]=m.useState(()=>new Xe(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;m.useSyncExternalStore(m.useCallback(e=>f?c.subscribe(ke.batchCalls(e)):ae,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),m.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>ot(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&ot(n,e)?st(n,new Ue(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let h=l.find((e,t)=>{let n=s[t];return n&&it({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(h)throw h.error;return u(d())}function lt(e,t,n){let r=Qe(),i=tt(),a=g(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,at(o),nt(o,i,s),rt(i);let[l]=m.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(m.useSyncExternalStore(m.useCallback(e=>{let t=d?l.subscribe(ke.batchCalls(e)):ae;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),m.useEffect(()=>{l.setOptions(o)},[o,l]),ot(o,u))throw st(o,l,i);if(it({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function T(e,t){return lt(e,Ue,t)}function ut(e){return e[e.length-1]}function dt(e,t){return typeof e==`function`?e(t):e}var ft=Object.prototype.hasOwnProperty;function pt(e){for(let t in e)if(ft.call(e,t))return!0;return!1}var mt=()=>Object.create(null),ht=(e,t)=>gt(e,t,!0);function gt(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;let i=Array.isArray(e)&&Array.isArray(t);if(!i&&!(_t(e)&&_t(t)))return t;let a=Object.keys(e),o=a.length,s=Object.keys(t),c=s.length;if(i?o!==e.length||c!==t.length||o&&ut(a)!==`${o-1}`||c&&ut(s)!==`${c-1}`:o!==Object.getOwnPropertyNames(e).length||c!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let l=0,u,d,f;if(i){for(;l<c&&(f=l,d=e[f],u=t[f],u=d===u?d:typeof d==`object`?gt(d,u,n,r):u,u===d);l++);if(l===c&&o===c)return e}else{let i=o===c,p=!0;for(;l<c;l++){f=s[l],d=e[f];let o=t[f];u=d===o?d:typeof d==`object`?gt(d,o,n,r):o,i&&=u===d&&(a[l]===f||ft.call(e,f)),p&&=Object.is(u,o),a[l]=u}if(i)return Object.getOwnPropertySymbols(e).length?t:e;if(p)return t}let p=i?s.fill(0):n?mt():{};for(let o=0;o<c;o++)f=i?o:s[o],i?(d=e[f],o>l&&(u=t[f],u=d===u?d:typeof d==`object`?gt(d,u,n,r):u),p[f]=o<l?d:u):p[f]=a[o];return p}function _t(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function vt(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=t[i];if(a!==o&&!vt(a,o,n,r))return!1}return!0}if(_t(e)&&_t(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!vt(e[i],t[i],n,r))return!1;return!0}let i=0;if(r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;for(let a in t)if((r||t[a]!==void 0)&&(i--===0||!vt(e[a],t[a],n,r)))return!1;return i===0}return!1}function yt(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}var bt=/[\x00-\x1f\x7f"<>`{}]/g;function xt(e){return e.replace(bt,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function St(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return xt(t)}var Ct=[`http:`,`https:`,`mailto:`,`tel:`];function wt(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var Tt=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function Et(e,t){if(!e)return!1;if(Tt.test(e))return!0;let n=wt(e);return n?!t.has(n):!1}function Dt(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=St(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=St(r?e.slice(r):e)}return t}function Ot(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function kt(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function At(e){return e.replace(/\/{2,}/g,`/`)}function jt(e){return e===`/`?e:e.replace(/^\/+/,``)}function Mt(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function Nt(e){return Mt(jt(e))}function Pt(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Ft(e,t,n=`never`,r){if(t.includes(`//`)&&(t=At(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=At(e)),o=e.split(`/`);o.length>1&&ut(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(ut(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?At(s):s)||`/`;return a&&r&&r.set(a,c),c}function It(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function Lt(e){return e==null||e===``}function Rt(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function zt(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&Lt(f)){if(c===`/`&&!d)continue;f=``}o+=c+Rt(s,f,r)+(d||``)}}return o+a||`/`}var Bt=`Error preloading route! ☝️`,Vt=()=>!0,Ht=()=>!1;function Ut({children:e,fallback:t=null}){return(0,h.jsx)(m.Fragment,{children:Wt()?e:t})}function Wt(e=!0){return m.useSyncExternalStore(Gt,Vt,e?Ht:Vt)}function Gt(){return()=>{}}var Kt=m.createContext(null);function qt(e){return m.useContext(Kt)}var Jt=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Yt=o(((e,t)=>{t.exports=Jt()})),Xt=o((e=>{var t=d(),n=Yt();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Zt=o(((e,t)=>{t.exports=Xt()}))();function Qt(e,t){return e===t}function $t(e,t=e=>e,n){let r=n?.compare??Qt,i=(0,m.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,m.useCallback)(()=>e.get(),[e]);return(0,Zt.useSyncExternalStoreWithSelector)(i,a,a,t,r)}function en(...e){let t=m.useRef(e),n=t.current;return e.forEach((e,t)=>{vt(n[t],e,!1,!0)||(n[t]=e)}),t.current}function tn(e,t){e.preloadRoute(t).catch(e=>{console.warn(e),console.warn(Bt)})}var nn={compare:(e,t)=>e[0]===t[0]&&e[1]===t[1]};function rn(e,t){let n=typeof e==`string`&&wt(e);if(n)return t.has(n)?e:null}function an(e,t,n,r,i){let a=Pt(e.pathname,r),o=Pt(t.pathname,r);return(n?.exact?a!==o:!a.startsWith(o)||a.length!==o.length&&a[o.length]!==`/`)||(n?.includeSearch??!0)&&!vt(e.search,t.search,!n?.exact,n?.explicitUndefined)?!1:!n?.includeHash||i&&e.hash===t.hash}function on(e,t,n){let r=qt(),i=m.useRef(null),a=m.useCallback(e=>{if(i.current=e,typeof t==`function`)return t(e);t&&(t.current=e)},[t]),{activeOptions:o,to:s,preload:c,preloadDelay:l,hashScrollIntoView:u,replace:d,startTransition:f,resetScroll:p,viewTransition:h,ignoreBlocker:ee,disabled:g,target:te,onClick:ne,onBlur:_,onFocus:re,onMouseEnter:ie,onMouseLeave:ae,onTouchStart:oe}=e,v=Wt(!!o?.includeHash),[se,y,ce]=en(e.search,e.params,o),[b,le]=m.useMemo(()=>[e,{...e}],[r,e.from,e._fromLocation,e.hash,e.to,se,y,e.state,e.mask,e.unsafeRelative]),ue=m.useCallback(e=>{let t=rn(s,r.protocolAllowlist);if(t!==void 0)return[t??void 0];b._fromLocation||(le._fromLocation=e);let n=r.buildLocation(le),i=hn(n,r,g);return[i,!g&&(!i||wt(i))?void 0:an(e,n,ce,r.basepath,v)]},[ce,g,v,b,le,r,s]),[de,fe]=$t(r.stores.location,ue,nn),x=fe===void 0?de:void 0,S=g||de===void 0,pe=m.useRef(!1),C=e.reloadDocument||x||S?!1:c??r.options.defaultPreload,me=l??r.options.defaultPreloadDelay??0,he=m.useCallback(e=>{let t=e?.isIntersecting;if(!(t??C===`intent`)){t===!1&&pn(i);return}if(!me){tn(r,b);return}fn.has(i)||fn.set(i,setTimeout(()=>{fn.delete(i),tn(r,b)},me))},[r,b,i,C,me]);m.useEffect(()=>{if(!C)return;C===`render`&&!pe.current&&(pe.current=!0,tn(r,b));let e=!0,t;return C===`viewport`&&i.current&&typeof IntersectionObserver==`function`&&(t=new IntersectionObserver(t=>{e&&he(t.pop())},{rootMargin:`100px`}),t.observe(i.current)),()=>{e=!1,t?.disconnect(),pn(i)}},[r,b,C,he,i]);let w=un(e,n);if(w.ref=t?a:i,x)return w.href=x,w;let ge=e=>{let t=te??e.currentTarget.getAttribute(`target`);!S&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!t||t===`_self`)&&e.button===0&&(e.preventDefault(),r.navigate({...b,replace:d,resetScroll:p,hashScrollIntoView:u,startTransition:f,viewTransition:h,ignoreBlocker:ee}))},_e=()=>{C===`intent`&&tn(r,b)},ve=()=>{C===`intent`&&pn(i)};return w.onClick=mn(ne,ge),w.onBlur=mn(_,ve),w.onFocus=mn(re,he),w.onMouseEnter=mn(ie,he),w.onMouseLeave=mn(ae,ve),w.onTouchStart=mn(oe,_e),dn(w,e,fe,de,S,n)}var sn={},cn={className:`active`},ln=new Set([`to`,`params`,`search`,`hash`,`state`,`mask`,`from`,`unsafeRelative`,`_fromLocation`,`reloadDocument`,`preload`,`preloadDelay`,`preloadIntentProximity`,`hashScrollIntoView`,`replace`,`startTransition`,`resetScroll`,`viewTransition`,`ignoreBlocker`,`activeProps`,`inactiveProps`,`activeOptions`,`_asChild`]);function un(e,t){let n={};for(let r in e)ln.has(r)||r===`type`&&t!==void 0||r===`disabled`&&t===`a`||(n[r]=e[r]);return n}function dn(e,t,n,r,i,a){let{activeProps:o,inactiveProps:s,className:c,style:l,target:u}=t,d=dt(n?o:s,{})??(n?cn:sn);Object.assign(e,d),e.href=r,a!==`a`&&(e.disabled=i),e.target=u;let f=d.style;(l||f)&&(e.style=l&&f?{...l,...f}:l||f);let p=d.className;return(c||p)&&(e.className=c?p?`${c} ${p}`:c:p),i&&(e.role=`link`,e[`aria-disabled`]=!0),n&&(e[`data-status`]=`active`,e[`aria-current`]=`page`),e}var fn=new WeakMap,pn=e=>{clearTimeout(fn.get(e)),fn.delete(e)},mn=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function hn(e,t,n){if(n)return;let r=e.maskedLocation??e,i=r.external?r.publicHref:t.history.createHref(r.publicHref)||`/`;if(!r.external&&i===r.publicHref||!Et(i,t.protocolAllowlist))return i}var gn=m.memo(m.forwardRef((e,t)=>{let n=e._asChild||`a`,r=on(e,t,n),i=typeof e.children==`function`?e.children({isActive:r[`data-status`]===`active`}):e.children;return m.createElement(n,r,i)}),_n);function _n(e,t){let n=0;for(let r in t)if(n++,e[r]!==t[r]&&(!ln.has(r)||!vt(e[r],t[r],!1,!0)))return!1;for(let t in e)n--;return n===0}function vn(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 yn(e,t=`|`){return e.map(e=>Un(e)).join(t)}function bn(e,t){return typeof t==`bigint`?t.toString():t}var xn=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 Sn(e){return new xn(e)}function Cn(e){return e==null}function wn(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Tn(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}function En(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Dn(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function On(e){return Dn(e._zod.def)??e._zod.def.shape}function kn(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return En(this,t,e),e},enumerable:!0,configurable:!0})}function An(e,t,n){t in e?En(e,t,n):e[t]=n}function jn(e,t,n,r){let i=On(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?kn(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):An(e,a,r?r(n.value,a):n.value))}}function Mn(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?kn(e,n,()=>t[n]):An(e,n,r.value))}}function E(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Nn(e){return JSON.stringify(e)}function Pn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Fn=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function In(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ln=Sn(()=>{if(jr.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Rn(e){if(In(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return In(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function zn(e){return Rn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Bn=new Set([`string`,`number`,`symbol`]);function Vn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Hn(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function D(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Un(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Wn(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Gn={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Kn={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function qn(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 jn(i,e,Jn(e,t)),Hn(e,E(n,{shape:i,checks:[]}))}function Jn(e,t){let n=On(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Yn(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(Jn(e,t)),a={};return jn(a,e,Reflect.ownKeys(On(e)).filter(e=>!i.has(e))),Hn(e,E(n,{shape:a,checks:[]}))}function Xn(e,t){if(!Rn(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=On(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 Hn(e,E(e._zod.def,{shape:Zn(e,t)}))}function Zn(e,t){let n={};return jn(n,e,Reflect.ownKeys(On(e))),Mn(n,t),n}function Qn(e,t){if(!Rn(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Hn(e,E(e._zod.def,{shape:Zn(e,t)}))}function $n(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return jn(n,e,Reflect.ownKeys(On(e))),jn(n,t,Reflect.ownKeys(On(t))),Hn(e,E(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function er(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(Jn(t,n)):void 0,o={};return jn(o,t,Reflect.ownKeys(On(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Hn(t,E(t._zod.def,{shape:o,checks:[]}))}function tr(e,t,n){let r=n?new Set(Jn(t,n)):void 0,i={};return jn(i,t,Reflect.ownKeys(On(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Hn(t,E(t._zod.def,{shape:i}))}function nr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function rr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ir(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ar(e){return typeof e==`string`?e:e?.message}function or(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function sr(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:ar(e.inst?._zod.def?.error?.(e))??ar(a?.(e))??ar(t?.error?.(e))??ar(n.customError?.(e))??ar(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var cr=/[\uD800-\uDBFF]/;function lr(e){let t=e.length;if(!cr.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 ur(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function dr(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 fr(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function pr(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):_r(e,n,r.value)}}function mr(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function hr(e,t,n){return mr(e,t,n,!1)}function gr(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return mr(this,n,r(this))},set(e){mr(this,n,e)}})}return t}function _r(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:mr(this,t,n.bind(this))},set(e){mr(this,t,e)}})}function vr(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var yr,br=!1,xr={configurable:!0,get(){br=!0}};function O(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&yr!==e._zod){yr=void 0;return}yr=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,xr);let e=br;br=!1;try{let r=n(this);return br?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),br||=e,r}catch(n){throw delete this[t],br||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function Sr(e,t,n,r){let i=vr(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 Cr=`~constantCatch`;function wr(e){let t=()=>e;return t[Cr]=!0,t}var Tr,Er={value:void 0,enumerable:!1},Dr=`captureStackTrace`in Error?Error:null;function Or(e){let t=Dr;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Dr=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function k(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Er.value=new a(r);try{Object.defineProperty(n,"_zod",Er)}finally{Er.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),pr(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?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Or(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var kr=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ar=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Tr=globalThis).__zod_globalConfig??(Tr.__zod_globalConfig={});var jr=globalThis.__zod_globalConfig;function Mr(e){return e&&Object.assign(jr,e),jr}function Nr(){let e=this._zod;return e.message??=JSON.stringify(e.def,bn,2),e.message}function Pr(e){this._zod.message=e}var Fr={get:Nr,set:Pr,enumerable:!0,configurable:!0},Ir={value:void 0,enumerable:!1},Lr=new WeakSet([Object.prototype,Error.prototype]),Rr=(e,t)=>{e.name=`$ZodError`,Ir.value=t,Object.defineProperty(e,"issues",Ir),Ir.value=void 0,Object.defineProperty(e,"message",Fr);let n=Object.getPrototypeOf(e);Lr.has(n)||(Lr.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})}}))},zr=k(`$ZodError`,Rr);k(`$ZodError`,Rr,void 0,{Parent:Error});function Br(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 Vr(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Br(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Hr(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 Ur(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Wr=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 kr;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>sr(e,o,Mr())));throw Fn(n,a?.callee??t),n}return s.value};return t},Gr=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?.Err)??e)(s.issues.map(e=>sr(e,o,Mr())));throw Fn(n,a?.callee??t),n}return s.value};return t},Kr=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 kr;return a.issues.length?qr(e,a.issues,i):{success:!0,data:a.value}};function qr(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>sr(e,n,Mr()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Jr=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?qr(e,a.issues,i):{success:!0,data:a.value}},Yr=Symbol.for(`zod.compile.invalid`),Xr=Symbol.for(`zod.compile.fallback`),Zr=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Yr)return!0;if(r.definite===!0&&n===void 0)return!1}return Qr(e,t,n)});function Qr(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Xr]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new kr;return a.issues.length===0}var $r=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},ei=e=>{let t=Wr(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Ur(n,a))};return n},ti=e=>{let t=Wr(e),n=(e,r,i,a)=>t(e,r,i,Ur(n,a));return n},ni=e=>{let t=Gr(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Ur(n,a))};return n},ri=e=>{let t=Gr(e),n=async(e,r,i,a)=>await t(e,r,i,Ur(n,a));return n},ii=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Kr(e)(t,n,i)},ai=e=>(t,n,r)=>Kr(e)(t,n,r),oi=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Jr(e)(t,n,i)},si=e=>async(t,n,r)=>Jr(e)(t,n,r),ci=/^[cC][0-9a-z]{6,}$/,li=/^[0-9a-z]+$/,ui=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,di=/^[0-9a-vA-V]{20}$/,fi=/^[A-Za-z0-9]{27}$/,pi=/^[a-zA-Z0-9_-]{21}$/;function mi(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var hi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gi=/^([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})$/,_i=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)$/,vi=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,yi=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function bi(){return new RegExp(yi,`u`)}var xi=/^(?:(?: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])$/,Si=/^(([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}|:))$/,Ci=/^((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])$/,wi=/^(([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])$/,Ti=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ei=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Di=/^https?$/,Oi=/^\+[1-9]\d{6,14}$/,ki=`(?:(?:\\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 Ai(e){return RegExp(`^${e}$`)}var ji=Ai(ki);function Mi(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 Ni(e){return RegExp(`^${Mi(e)}$`)}function Pi(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Mi({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Mi({precision:e.precision})}`:n;return RegExp(`^${ki}T(?:${r})$`)}var Fi=/^[\s\S]{0,}$/,Ii=/^-?\d+$/,Li=/^-?\d+(?:\.\d+)?$/,Ri=/^(?:true|false)$/i,zi=/^[^A-Z]*$/,Bi=/^[^a-z]*$/,A=k(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Vi=e=>{let t=e.value;return!Cn(t)&&t.length!==void 0},Hi={number:`number`,bigint:`bigint`,object:`date`},Ui=k(`$ZodCheckLessThan`,(e,t)=>{A.init(e,t);let n=Hi[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Hi[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})}}),Wi=k(`$ZodCheckGreaterThan`,(e,t)=>{A.init(e,t);let n=Hi[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Hi[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})}}),Gi=k(`$ZodCheckMultipleOf`,(e,t)=>{A.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):Tn(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})}}),Ki=k(`$ZodCheckNumberFormat`,(e,t)=>{A.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Gn[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),qi=k(`$ZodCheckMaxLength`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=Vi),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?lr(r):i)<=t.maximum)return;let a=ur(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ji=k(`$ZodCheckMinLength`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=Vi),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?lr(r):i)>=t.minimum)return;let a=ur(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Yi=k(`$ZodCheckLengthEquals`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=Vi),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?lr(r):i;if(a===t.length)return;let o=ur(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})}}),Xi=k(`$ZodCheckStringFormat`,(e,t)=>{var n,r;A.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=()=>{})}),Zi=k(`$ZodCheckRegex`,(e,t)=>{Xi.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})}}),Qi=k(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=zi,Xi.init(e,t)}),$i=k(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Bi,Xi.init(e,t)}),ea=k(`$ZodCheckIncludes`,(e,t)=>{A.init(e,t);let n=Vn(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})}}),ta=k(`$ZodCheckStartsWith`,(e,t)=>{A.init(e,t);let n=RegExp(`^${Vn(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})}}),na=k(`$ZodCheckEndsWith`,(e,t)=>{A.init(e,t);let n=RegExp(`.*${Vn(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})}}),ra=k(`$ZodCheckOverwrite`,(e,t)=>{A.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),ia=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(`
|
|
2
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
3
|
+
`)}\n};`)(...Object.values(this.closed))}},aa={major:4,minor:6,patch:5},j=k(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=aa;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=nr(t),a;for(let o of n){if(o._zod.def.when){if(rr(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?.async===!1)throw new kr;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(or(t.issues,n,e),i||=nr(t,n))});else{if(t.issues.length===n)continue;or(t.issues,n,e),i||=nr(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(nr(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new kr;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 kr;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return hr(this,`~standard`,ca(this))},set"~standard"(e){mr(this,`~standard`,e)}}),oa=(e,t)=>e.issues.length?{issues:e.issues.map(e=>sr(e,t,Mr()))}:{value:e.value};async function sa(e,t){let n={async:!0};return oa(await e._zod.run({value:t,issues:[]},n),n)}function ca(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return oa(r,n)}catch{}return sa(e,t)},vendor:`zod`,version:1}}var la=k(`$ZodString`,(e,t)=>{j.init(e,t),e._zod.pattern=t.pattern??Fi,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}}),M=k(`$ZodStringFormat`,(e,t)=>{Xi.init(e,t),la.init(e,t)}),ua=k(`$ZodGUID`,(e,t)=>{t.pattern??=gi,M.init(e,t)}),da=k(`$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??=_i(e)}else t.pattern??=_i();M.init(e,t)}),fa=k(`$ZodEmail`,(e,t)=>{t.pattern??=vi,M.init(e,t)});function pa(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function ma(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?pa(e)||2:ha(e,t)}function ha(e,t){if(!t.normalize&&t.protocol?.source===Di.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 ga=/[\t\n\r]/g;function _a(e){return e.replace(ga,``)}function va(e,t){return t.lastIndex=0,t.test(e.hostname)}function ya(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var ba=k(`$ZodURL`,(e,t)=>{M.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=ma(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=_a(r);return}t.hostname&&!va(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&&!ya(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:_a(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),xa=k(`$ZodEmoji`,(e,t)=>{t.pattern??=bi(),M.init(e,t)}),Sa=k(`$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?pi:mi(t.length),M.init(e,t)}),Ca=k(`$ZodCUID`,(e,t)=>{t.pattern??=ci,M.init(e,t)}),wa=k(`$ZodCUID2`,(e,t)=>{t.pattern??=li,M.init(e,t)}),Ta=k(`$ZodULID`,(e,t)=>{t.pattern??=ui,M.init(e,t)}),Ea=k(`$ZodXID`,(e,t)=>{t.pattern??=di,M.init(e,t)}),Da=k(`$ZodKSUID`,(e,t)=>{t.pattern??=fi,M.init(e,t)}),Oa=k(`$ZodISODateTime`,(e,t)=>{t.pattern??=Pi(t),M.init(e,t)}),ka=k(`$ZodISODate`,(e,t)=>{t.pattern??=ji,M.init(e,t)}),Aa=k(`$ZodISOTime`,(e,t)=>{t.pattern??=Ni(t),M.init(e,t)}),ja=k(`$ZodISODuration`,(e,t)=>{t.pattern??=hi,M.init(e,t)}),Ma=k(`$ZodIPv4`,(e,t)=>{t.pattern??=xi,M.init(e,t)}),Na=/^[0-9a-fA-F:.]+$/;function Pa(e){return Na.test(e)?pa(`http://[${e}]`):!1}var Fa=k(`$ZodIPv6`,(e,t)=>{t.pattern??=Si,M.init(e,t),e._zod.check=n=>{Pa(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Ia=k(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Ci,M.init(e,t)});function La(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:Pa(n)}var Ra=k(`$ZodCIDRv6`,(e,t)=>{t.pattern??=wi,M.init(e,t),e._zod.check=n=>{La(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function za(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Ba=/^[0-9a-zA-Z+/]*={0,2}$/,Va=k(`$ZodBase64`,(e,t)=>{t.pattern??=Ba,M.init(e,t),e._zod.check=n=>{za(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Ha=/^[A-Za-z0-9_-]*$/;function Ua(e){if(!Ha.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return za(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Wa=k(`$ZodBase64URL`,(e,t)=>{t.pattern??=Ha,M.init(e,t),e._zod.check=n=>{Ua(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Ga=k(`$ZodE164`,(e,t)=>{t.pattern??=Oi,M.init(e,t)});function Ka(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var qa=k(`$ZodJWT`,(e,t)=>{M.init(e,t),e._zod.check=n=>{Ka(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Ja=k(`$ZodNumber`,(e,t)=>{j.init(e,t),e._zod.pattern=Li,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}}),Ya=k(`$ZodNumberFormat`,(e,t)=>{Ki.init(e,t),Ja.init(e,t)}),Xa=k(`$ZodBoolean`,(e,t)=>{j.init(e,t),e._zod.pattern=Ri,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}}),Za=k(`$ZodUnknown`,(e,t)=>{j.init(e,t),e._zod.parse=e=>e}),Qa=k(`$ZodNever`,(e,t)=>{j.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function $a(e,t,n){e.issues.length&&t.issues.push(...ir(n,e.issues)),t.value[n]=e.value}var eo=k(`$ZodArray`,(e,t)=>{j.init(e,t);let n=jr.memoizer;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?.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=>$a(t,r,e)));else if($a(c,r,e),s&&c.issues.length!==0&&nr(c))break}return o.length?Promise.all(o).then(()=>r):r}});function to(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(...ir(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var no=[];function ro(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:no,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Wn(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function io(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(nr(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=>to(e,n,i,t,d,f))):to(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 ao=k(`$ZodObject`,(e,t)=>{j.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=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 i=Sn(()=>ro(t));O(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)||En(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=In,o=t.catchall,s,c=jr.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(nr(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>to(n,t,e,r,a,o))):to(s,t,e,r,a,o)}return o?io(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),oo=k(`$ZodObjectJIT`,(e,t)=>{ao.init(e,t);let n=e._zod.parse,r=Sn(()=>ro(t)),i=jr.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new ia([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
4
|
+
let ${e}_ab = false;
|
|
5
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
6
|
+
const iss = ${e}.issues[i];
|
|
7
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
8
|
+
payload.issues.push(iss);
|
|
9
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
10
|
+
}
|
|
11
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
12
|
+
payload.value = newResult;
|
|
13
|
+
return payload;
|
|
14
|
+
}`;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(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:Nn(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
15
|
+
const ${n}_present = ${i};
|
|
16
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
17
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (${e}) {
|
|
21
|
+
newResult[${r}] = ${n}.value;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
`)}else f?(o.write(`
|
|
26
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
27
|
+
}
|
|
28
|
+
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
29
|
+
if (${n}.value !== undefined || ${i}) {
|
|
30
|
+
newResult[${r}] = ${n}.value;
|
|
31
|
+
}
|
|
32
|
+
`)):o.write(`
|
|
33
|
+
const ${n}_present = ${i};
|
|
34
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
35
|
+
}
|
|
36
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
37
|
+
payload.issues.push({
|
|
38
|
+
code: "invalid_type",
|
|
39
|
+
expected: "nonoptional",
|
|
40
|
+
input: undefined,
|
|
41
|
+
path: [${r}]
|
|
42
|
+
});
|
|
43
|
+
if (ctx && ctx.abortEarly) {
|
|
44
|
+
payload.value = newResult;
|
|
45
|
+
return payload;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (${n}_present) {
|
|
50
|
+
newResult[${r}] = ${n}.value;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=In,c=!jr.jitless,l=c&&Ln.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?io([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function so(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=>!nr(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=>sr(e,r,Mr())))}),t)}var co=k(`$ZodUnion`,(e,t)=>{j.init(e,t),O(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),O(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),O(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)))}),O(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=>wn(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=>so(t,r,e,i)):so(o,r,e,i)}});function lo(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var uo=k(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,co.init(e,t);let n=e._zod.parse;O(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||En(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=Dn(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=Sn(()=>lo(t));e._zod.parse=(i,a)=>{let o=i.value;if(!In(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=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)}}),fo=k(`$ZodIntersection`,(e,t)=>{j.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])=>mo(e,t,n)):mo(e,i,a)}});function po(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Rn(e)&&Rn(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=po(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=po(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 mo(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)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=po(t.value,n.value);if(!c.valid){if(nr(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var ho=k(`$ZodRecord`,(e,t)=>{j.init(e,t);let n=jr.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Rn(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=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=>sr(e,i,Mr())),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(...ir(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...ir(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`&&Li.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=>sr(e,i,Mr())),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(...ir(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...ir(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}}),go=k(`$ZodEnum`,(e,t)=>{j.init(e,t);let n=vn(t.entries),r=new Set(n);e._zod.values=r,O(e,`pattern`,e=>{let t=vn(e.def.entries).filter(e=>Bn.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Vn(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),_o=k(`$ZodLiteral`,(e,t)=>{j.init(e,t);let n=new Set(t.values);e._zod.values=n,O(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Vn(e):e?Vn(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}}),vo=k(`$ZodTransform`,(e,t)=>{j.init(e,t),e._zod.optin=`optional`,jr.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ar(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 kr;return n.value=i,n}});function yo(e,t){return e.value=t.issues.length?void 0:t.value,e}var bo=k(`$ZodOptional`,(e,t)=>{j.init(e,t),O(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,O(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),O(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${wn(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=>yo(e,t)):yo(e,r)}return t.innerType._zod.run(e,n)}}),xo=k(`$ZodExactOptional`,(e,t)=>{bo.init(e,t),O(e,`values`,e=>e.def.innerType._zod.values),O(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),So=k(`$ZodNullable`,(e,t)=>{j.init(e,t),O(e,`optin`,e=>e.def.innerType._zod.optin),O(e,`optout`,e=>e.def.innerType._zod.optout),O(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${wn(t.source)}|null)$`):void 0}),O(e,`values`,e=>e.def.innerType._zod.values?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)}),Co=k(`$ZodDefault`,(e,t)=>{j.init(e,t),e._zod.optin=`defaulted`,O(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=>wo(e,t)):wo(r,t)}});function wo(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var To=k(`$ZodPrefault`,(e,t)=>{j.init(e,t),e._zod.optin=`defaulted`,O(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))}),Eo=k(`$ZodNonOptional`,(e,t)=>{j.init(e,t),O(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=>Do(t,e)):Do(i,e)}});function Do(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 Oo(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>sr(e,r,Mr()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var ko=k(`$ZodCatch`,(e,t)=>{j.init(e,t),O(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),O(e,`optout`,e=>e.def.innerType._zod.optout),O(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=>Oo(e,r,t,n)):Oo(e,r,t,n)}}),Ao=k(`$ZodPipe`,(e,t)=>{j.init(e,t),O(e,`values`,e=>e.def.in._zod.values),O(e,`optin`,e=>e.def.in._zod.optin),O(e,`optout`,e=>e.def.out._zod.optout),O(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=>jo(e,t.in,n)):jo(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>jo(e,t.out,n)):jo(r,t.out,n)}});function jo(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 Mo=k(`$ZodPreprocess`,(e,t)=>{Ao.init(e,t)}),No=k(`$ZodReadonly`,(e,t)=>{j.init(e,t),O(e,`propValues`,e=>e.def.innerType._zod.propValues),O(e,`values`,e=>e.def.innerType._zod.values),O(e,`optin`,e=>e.def.innerType?._zod?.optin),O(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Po):Po(r)}});function Po(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Fo=k(`$ZodCustom`,(e,t)=>{A.init(e,t),j.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=>Io(t,n,r,e));Io(i,n,r,e)}});function Io(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(fr(e))}}var Lo=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Ro=`~memo`,zo=[];function Bo(e){return typeof e==`object`&&!!e}function Vo(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Ho=new WeakMap,Uo=0,Wo=1,Go=2;function Ko(e,t,n){let r=Ho.get(e);if(r!==void 0)return r?Go:Uo;if(t.has(e))return Go;t.add(e);let i=Uo,a=e=>{if(i!==Go&&e?._zod){let r=Ko(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Uo;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Wo:o.value?._zod?Ko(o.value,t,n):Uo;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Dn(c);s(e?o(e,!0):Wo),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?Ko(r,t,!1):Wo);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),qo(e,i)}function qo(e,t){return t!==Wo&&Ho.set(e,t===Go),t}function Jo(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Yo,Xo=[],Zo={alloc(e,t,n){let r=Yo;if(!r)return n;Yo=void 0;let i={value:n,issues:null};return r.set(t.value,i),Xo.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`&&$o(n,e.value))throw new Lo;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=Ko(e,new Set,!1);if(i===Uo)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Go||r?n=!0:r=!0}let l=s.value;if(!Bo(l))return t(s,c);let u=c[Ro];u||(u={buckets:new WeakMap,backEdges:void 0},c[Ro]=u);let d;i===c?d=a:(d=Jo(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(...Vo(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Yo=d;let p=Xo.length,m=t(s,c);Yo=void 0;let h=Xo.length>p?Xo.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Vo(e.issues):zo),e)):(h&&(h.issues=m.issues.length?Vo(m.issues):zo),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Qo(){return Zo}function $o(e,t){let n=e[Ro]?.backEdges;return n!==void 0&&Bo(t)&&n.has(t)}var es=()=>{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 t(t){return e[t]??null}let n={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`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(dr(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Un(e.values[0])}`:`Invalid option: expected one of ${yn(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${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 ${n[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`:``}: ${yn(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 ts(){return{localeError:es()}}var ns,rs=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function is(){return new rs}(ns=globalThis).__zod_globalRegistry??(ns.__zod_globalRegistry=is());var as=globalThis.__zod_globalRegistry;function os(e){return e.checks&&=[...e.checks],e}function ss(e,t){return new e(os({type:`string`,...D(t)}))}function cs(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...D(t)})}function ls(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...D(t)})}function us(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...D(t)})}function ds(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...D(t)})}function fs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...D(t)})}function ps(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...D(t)})}function ms(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...D(t)})}function hs(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...D(t)})}function gs(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...D(t)})}function _s(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...D(t)})}function vs(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...D(t)})}function ys(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...D(t)})}function bs(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...D(t)})}function xs(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...D(t)})}function Ss(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...D(t)})}function Cs(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...D(t)})}function ws(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...D(t)})}function Ts(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...D(t)})}function Es(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...D(t)})}function Ds(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...D(t)})}function Os(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...D(t)})}function ks(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...D(t)})}function As(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...D(t)})}function js(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...D(t)})}function Ms(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...D(t)})}function Ns(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...D(t)})}function Ps(e,t){return new e(os({type:`number`,checks:[],...D(t)}))}function Fs(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...D(t)})}function Is(e,t){return new e({type:`boolean`,...D(t)})}function Ls(e){return new e({type:`unknown`})}function Rs(e,t){return new e({type:`never`,...D(t)})}function zs(e,t){return new Ui({check:`less_than`,...D(t),value:e,inclusive:!1})}function Bs(e,t){return new Ui({check:`less_than`,...D(t),value:e,inclusive:!0})}function Vs(e,t){return new Wi({check:`greater_than`,...D(t),value:e,inclusive:!1})}function Hs(e,t){return new Wi({check:`greater_than`,...D(t),value:e,inclusive:!0})}function Us(e,t){return new Gi({check:`multiple_of`,...D(t),value:e})}function Ws(e,t){return new qi({check:`max_length`,...D(t),maximum:e})}function Gs(e,t){return new Ji({check:`min_length`,...D(t),minimum:e})}function Ks(e,t){return new Yi({check:`length_equals`,...D(t),length:e})}function qs(e,t){return new Zi({check:`string_format`,format:`regex`,...D(t),pattern:e})}function Js(e){return new Qi({check:`string_format`,format:`lowercase`,...D(e)})}function Ys(e){return new $i({check:`string_format`,format:`uppercase`,...D(e)})}function Xs(e,t){return new ea({check:`string_format`,format:`includes`,...D(t),includes:e})}function Zs(e,t){return new ta({check:`string_format`,format:`starts_with`,...D(t),prefix:e})}function Qs(e,t){return new na({check:`string_format`,format:`ends_with`,...D(t),suffix:e})}function $s(e){return new ra({check:`overwrite`,tx:e})}function ec(e){return $s(t=>t.normalize(e))}function tc(){return $s(e=>e.trim())}function nc(){return $s(e=>e.toLowerCase())}function rc(){return $s(e=>e.toUpperCase())}function ic(){return $s(e=>Pn(e))}function ac(e,t,n){return new e({type:`array`,element:t,...D(n)})}function oc(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...D(n)})}function sc(e,t){let n=cc(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(fr(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(fr(r))}},e(t.value,t)),t);return n}function cc(e,t){let n=new A({check:`custom`,...D(t)});return n._zod.check=e,n}function lc(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&En(e,t,n[t]);return e}function uc(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??as,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function dc(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 N(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,N(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&lc(o.schema,c),t.io===`input`&&P(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function fc(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function pc(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=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${fc(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+fc(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
54
|
+
|
|
55
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function mc(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;mc(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 hc=new Set([`type`,`properties`,`required`,`additionalProperties`]),gc=[`oneOf`,`anyOf`];function _c(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function vc(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!hc.has(e))return null;t.push(n)}let n={},r=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){let t=n.properties?.[r]??_c(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}En(n,r,e.length===1?e[0]:vc(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=_c(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function yc(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of hc)if(t in e)return;let n=t.filter(e=>gc.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=vc(t);else{let e=n[0],i=gc.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=>vc([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,lc(e,r))}function bc(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):lc(i,s),lc(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())mc(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=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)??[])yc(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}lc(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};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,En(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Sc(t,`input`,e.processors),output:Sc(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function P(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return P(r.element,n);if(r.type===`set`)return P(r.valueType,n);if(r.type===`lazy`)return P(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 P(r.innerType,n);if(r.type===`intersection`)return P(r.left,n)||P(r.right,n);if(r.type===`record`||r.type===`map`)return P(r.keyType,n)||P(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:P(r.in,n)||P(r.out,n);if(r.type===`object`){for(let e in r.shape)if(P(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(P(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(P(e,n))return!0;return!!(r.rest&&P(r.rest,n))}return!1}var xc=(e,t={})=>n=>{let r=uc({...n,processors:t});return N(e,r),pc(r,e),bc(r,e)},Sc=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=uc({...i??{},target:a,io:t,processors:n});return N(e,o),pc(o,e),bc(o,e)},Cc=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},wc=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Tc=(e,t)=>{Cc(e,`minimum`,t),wc(e,`maximum`,t)},Ec=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Dc=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Oc=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},kc=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Ac=(e,t)=>Cc(e,`minimum`,t.minimum),jc=(e,t)=>wc(e,`maximum`,t.maximum),Mc=e=>(t,n)=>{kc(t,n.format);let[r,i]=e[n.format];Cc(t,`minimum`,r),wc(t,`maximum`,i)},Nc={greater_than:(e,t)=>Cc(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>wc(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Ec(e,t.value),number_format:Mc(Gn),bigint_format:Mc(Kn),min_length:Ac,max_length:jc,length_equals:(e,t)=>Tc(e,t.length),min_size:Ac,max_size:jc,size_equals:(e,t)=>Tc(e,t.size),string_format:(e,t)=>{kc(e,t.format),t.pattern&&Dc(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)=>Oc(e,t.mime)};function F(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Nc[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Cc(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Cc(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&wc(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&wc(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Ec(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Oc(t,i.mime);for(let e of i.patterns??[])Dc(t,e);return t}var Pc={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Fc=new Map([[Ba,Ti],[Ha,Ei]]),Ic=e=>Fc.get(e)??e,Lc=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=F(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Pc[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(Ic);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}))])}},Rc=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=F(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=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):dc(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}))])}},zc=(e,t,n,r)=>{n.type=`boolean`},Bc=(e,t,n,r)=>{n.not={}},Vc=(e,t,n,r)=>{let i=e._zod.def,a=vn(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Hc=(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(dc(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(dc(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}},Uc=(e,t,n,r)=>{dc(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Wc=(e,t,n,r)=>{dc(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Gc=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=F(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=N(a.element,t,{...r,path:[...r.path,`items`]})};function Kc(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Kc(t.out):t.type===`catch`?Kc(t.innerType):e._zod.optin}var qc=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&dc(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)En(i.properties,e,N(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Kc(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=N(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Jc=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>N(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Yc=(e,t,n,r)=>{let i=e._zod.def,a=N(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=N(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)};function Xc(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Xc(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Xc(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Li:Ii).source),p):p}var Zc=new WeakMap;function Qc(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Zc.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Xc(t,a,new Set);o!==a&&n.set(a,o)}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 $c=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=F(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=N(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)En(i.patternProperties,Ic(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=N(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Zc.get(t);n||(n=[],Zc.set(t,n),t.deferred.push(()=>Qc(t))),n.push(e)}i.additionalProperties=N(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Kc(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))}},el=(e,t,n,r)=>{let i=e._zod.def,a=N(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`}]},tl=(e,t,n,r)=>{let i=e._zod.def;N(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},nl=Symbol();function rl(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(dc(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),nl):JSON.parse(o)}var il=(e,t,n,r)=>{let i=e._zod.def;N(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=rl(i.defaultValue,e,t,n,r);o!==nl&&(n.default=o)},al=(e,t,n,r)=>{let i=e._zod.def;N(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=rl(i.defaultValue,e,t,n,r);o!==nl&&(n._prefault=o)},ol=(e,t,n,r)=>{let i=e._zod.def;N(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{dc(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},sl=(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;N(o,t,r);let s=t.seen.get(e);s.ref=o},cl=(e,t,n,r)=>{let i=e._zod.def;N(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},ll=(e,t,n,r)=>{let i=e._zod.def;N(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ul=new WeakSet([Object.prototype,Error.prototype]);function dl(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 I=k(`ZodError`,(e,t)=>{zr.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);ul.has(n)||(ul.add(n),dl(n,`format`,e=>t=>Hr(e,t)),dl(n,`flatten`,e=>t=>Vr(e,t)),dl(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,bn,2)}),dl(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,bn,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),fl=Wr(I),pl=Gr(I),ml=Kr(I),hl=Jr(I),gl=ei(I),_l=ti(I),vl=ni(I),yl=ri(I),bl=ii(I),xl=ai(I),Sl=oi(I),Cl=si(I);function wl(){jr.localeError||Mr(ts())}function Tl(){jr.memoizer||Mr({memoizer:Qo()})}var L=k(`ZodType`,(e,t)=>(wl(),j.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(E(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 Hn(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Bu(e,t))},superRefine(e,t){return this.check(Vu(e,t))},overwrite(e){return this.check($s(e))},optional(){return xu(this)},exactOptional(){return Cu(this)},nullable(){return Tu(this)},nullish(){return xu(Tu(this))},nonoptional(e){return ju(this,e)},array(){return H(this)},or(e){return lu([this,e])},and(e){return pu(this,e)},transform(e){return Fu(this,yu(e))},default(e){return Du(this,e)},prefault(e){return ku(this,e)},catch(e){return Nu(this,e)},pipe(e){return Fu(this,e)},readonly(){return Ru(this)},describe(e){let t=this.clone();return as.add(t,{description:e}),t},meta(...e){if(e.length===0)return as.get(this);let t=this.clone();return as.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 hr(this,`~standard`,{...ca(this),jsonSchema:{input:Sc(this,`input`),output:Sc(this,`output`)}})},set"~standard"(e){mr(this,`~standard`,e)},parse:function e(t,n){return fl(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await pl(this,t,n,{callee:e})},safeParse(e,t){return ml(this,e,t)},async safeParseAsync(e,t){return hl(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){mr(this,`spa`,e)},validate(e,t){return Zr(this,e,t)},validateAsync(e,t){return $r(this,e,t)},encode:function e(t,n){return gl(this,t,n,{callee:e})},decode:function e(t,n){return _l(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await vl(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await yl(this,t,n,{callee:e})},safeEncode(e,t){return bl(this,e,t)},safeDecode(e,t){return xl(this,e,t)},async safeEncodeAsync(e,t){return Sl(this,e,t)},async safeDecodeAsync(e,t){return Cl(this,e,t)},toJSONSchema(e){return xc(this,{})(e)},get description(){return as.get(this)?.description},get _def(){return this._zod.def}}),El=k(`_ZodString`,(e,t)=>{la.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lc(e,t,n,r)},gr({format:e=>F(e).format??null,minLength:e=>F(e).minimum??null,maxLength:e=>F(e).maximum??null},{regex(...e){return this.check(qs(...e))},includes(...e){return this.check(Xs(...e))},startsWith(...e){return this.check(Zs(...e))},endsWith(...e){return this.check(Qs(...e))},min(...e){return this.check(Gs(...e))},max(...e){return this.check(Ws(...e))},length(...e){return this.check(Ks(...e))},nonempty(...e){return this.check(Gs(1,...e))},lowercase(e){return this.check(Js(e))},uppercase(e){return this.check(Ys(e))},trim(){return this.check(tc())},normalize(...e){return this.check(ec(...e))},toLowerCase(){return this.check(nc())},toUpperCase(){return this.check(rc())},slugify(){return this.check(ic())}})),Dl=k(`ZodString`,(e,t)=>{la.init(e,t),El.init(e,t)},{email(e){return this.check(cs(Ml,e))},url(e){return this.check(ms(Il,e))},jwt(e){return this.check(ks(Zl,e))},emoji(e){return this.check(hs(Ll,e))},guid(e){return this.check(ls(Nl,e))},uuid(e){return this.check(us(Pl,e))},uuidv4(e){return this.check(ds(Pl,e))},uuidv6(e){return this.check(fs(Pl,e))},uuidv7(e){return this.check(ps(Pl,e))},nanoid(e){return this.check(gs(Rl,e))},cuid(e){return this.check(_s(zl,e))},cuid2(e){return this.check(vs(Bl,e))},ulid(e){return this.check(ys(Vl,e))},base64(e){return this.check(Es(Jl,e))},base64url(e){return this.check(Ds(Yl,e))},xid(e){return this.check(bs(Hl,e))},ksuid(e){return this.check(xs(Ul,e))},ipv4(e){return this.check(Ss(Wl,e))},ipv6(e){return this.check(Cs(Gl,e))},cidrv4(e){return this.check(ws(Kl,e))},cidrv6(e){return this.check(Ts(ql,e))},e164(e){return this.check(Os(Xl,e))},datetime(e){return this.check(As(Ol,e))},date(e){return this.check(js(kl,e))},time(e){return this.check(Ms(Al,e))},duration(e){return this.check(Ns(jl,e))}});function R(e){return ss(Dl,e)}var z=k(`ZodStringFormat`,(e,t)=>{M.init(e,t),El.init(e,t)}),Ol=k(`ZodISODateTime`,(e,t)=>{Oa.init(e,t),z.init(e,t)}),kl=k(`ZodISODate`,(e,t)=>{ka.init(e,t),z.init(e,t)}),Al=k(`ZodISOTime`,(e,t)=>{Aa.init(e,t),z.init(e,t)}),jl=k(`ZodISODuration`,(e,t)=>{ja.init(e,t),z.init(e,t)}),Ml=k(`ZodEmail`,(e,t)=>{fa.init(e,t),z.init(e,t)}),Nl=k(`ZodGUID`,(e,t)=>{ua.init(e,t),z.init(e,t)}),Pl=k(`ZodUUID`,(e,t)=>{da.init(e,t),z.init(e,t)});function Fl(e){return us(Pl,e)}var Il=k(`ZodURL`,(e,t)=>{ba.init(e,t),z.init(e,t)}),Ll=k(`ZodEmoji`,(e,t)=>{xa.init(e,t),z.init(e,t)}),Rl=k(`ZodNanoID`,(e,t)=>{Sa.init(e,t),z.init(e,t)}),zl=k(`ZodCUID`,(e,t)=>{Ca.init(e,t),z.init(e,t)}),Bl=k(`ZodCUID2`,(e,t)=>{wa.init(e,t),z.init(e,t)}),Vl=k(`ZodULID`,(e,t)=>{Ta.init(e,t),z.init(e,t)}),Hl=k(`ZodXID`,(e,t)=>{Ea.init(e,t),z.init(e,t)}),Ul=k(`ZodKSUID`,(e,t)=>{Da.init(e,t),z.init(e,t)}),Wl=k(`ZodIPv4`,(e,t)=>{Ma.init(e,t),z.init(e,t)}),Gl=k(`ZodIPv6`,(e,t)=>{Fa.init(e,t),z.init(e,t)}),Kl=k(`ZodCIDRv4`,(e,t)=>{Ia.init(e,t),z.init(e,t)}),ql=k(`ZodCIDRv6`,(e,t)=>{Ra.init(e,t),z.init(e,t)}),Jl=k(`ZodBase64`,(e,t)=>{Va.init(e,t),z.init(e,t)}),Yl=k(`ZodBase64URL`,(e,t)=>{Wa.init(e,t),z.init(e,t)}),Xl=k(`ZodE164`,(e,t)=>{Ga.init(e,t),z.init(e,t)}),Zl=k(`ZodJWT`,(e,t)=>{qa.init(e,t),z.init(e,t)}),Ql=k(`ZodNumber`,(e,t)=>{Ja.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rc(e,t,n,r),e.isFinite=!0},gr({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=F(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=F(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=F(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>F(e).format??null},{gt(e,t){return this.check(Vs(e,t))},gte(e,t){return this.check(Hs(e,t))},min(e,t){return this.check(Hs(e,t))},lt(e,t){return this.check(zs(e,t))},lte(e,t){return this.check(Bs(e,t))},max(e,t){return this.check(Bs(e,t))},int(e){return this.check(eu(e))},safe(e){return this.check(eu(e))},positive(e){return this.check(Vs(0,e))},nonnegative(e){return this.check(Hs(0,e))},negative(e){return this.check(zs(0,e))},nonpositive(e){return this.check(Bs(0,e))},multipleOf(e,t){return this.check(Us(e,t))},step(e,t){return this.check(Us(e,t))},finite(){return this}}));function B(e){return Ps(Ql,e)}var $l=k(`ZodNumberFormat`,(e,t)=>{Ya.init(e,t),Ql.init(e,t)});function eu(e){return Fs($l,e)}var tu=k(`ZodBoolean`,(e,t)=>{Xa.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zc(e,t,n,r)});function V(e){return Is(tu,e)}var nu=k(`ZodUnknown`,(e,t)=>{Za.init(e,t),L.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ru(){return Ls(nu)}var iu=k(`ZodNever`,(e,t)=>{Qa.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bc(e,t,n,r)});function au(e){return Rs(iu,e)}var ou=k(`ZodArray`,(e,t)=>{Tl(),eo.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gc(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Gs(e,t))},nonempty(e){return this.check(Gs(1,e))},max(e,t){return this.check(Ws(e,t))},length(e,t){return this.check(Ks(e,t))},unwrap(){return this.element}});function H(e,t){return ac(ou,e,t)}var su=k(`ZodObject`,(e,t)=>{Tl(),oo.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qc(e,t,n,r),Sr(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return W(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(E(this._zod.def,{catchall:e}))},passthrough(){return this.clone(E(this._zod.def,{catchall:ru()}))},loose(){return this.clone(E(this._zod.def,{catchall:ru()}))},strict(){return this.clone(E(this._zod.def,{catchall:au()}))},strip(){return this.clone(E(this._zod.def,{catchall:void 0}))},extend(e){return Xn(this,e)},safeExtend(e){return Qn(this,e)},merge(e){return $n(this,e)},pick(e){return qn(this,e)},omit(e){return Yn(this,e)},partial(...e){return er(bu,this,e[0])},exactPartial(...e){return er(Su,this,e[0],`exactPartial`)},required(...e){return tr(Au,this,e[0])}});function U(e,t){return new su({type:`object`,shape:e??{},...D(t)})}var cu=k(`ZodUnion`,(e,t)=>{co.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jc(e,t,n,r),e.options=t.options});function lu(e,t){return new cu({type:`union`,options:e,...D(t)})}var uu=k(`ZodDiscriminatedUnion`,(e,t)=>{cu.init(e,t),uo.init(e,t)});function du(e,t,n){return new uu({type:`union`,options:t,discriminator:e,...D(n)})}var fu=k(`ZodIntersection`,(e,t)=>{fo.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yc(e,t,n,r)});function pu(e,t){return new fu({type:`intersection`,left:e,right:t})}var mu=k(`ZodRecord`,(e,t)=>{Tl(),ho.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$c(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function hu(e,t,n){return!t||!t._zod?new mu({type:`record`,keyType:R(),valueType:e,...D(t)}):new mu({type:`record`,keyType:e,valueType:t,...D(n)})}var gu=k(`ZodEnum`,(e,t)=>{go.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vc(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 gu({...t,checks:[],...D(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 gu({...t,checks:[],...D(r),entries:i})}});function W(e,t){return new gu({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...D(t)})}var _u=k(`ZodLiteral`,(e,t)=>{_o.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hc(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 G(e,t){return new _u({type:`literal`,values:Array.isArray(e)?e:[e],...D(t)})}var vu=k(`ZodTransform`,(e,t)=>{Tl(),vo.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wc(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ar(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(fr(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(fr(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function yu(e){return new vu({type:`transform`,transform:e})}var bu=k(`ZodOptional`,(e,t)=>{bo.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ll(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xu(e){return new bu({type:`optional`,innerType:e})}var Su=k(`ZodExactOptional`,(e,t)=>{xo.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ll(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cu(e){return new Su({type:`optional`,innerType:e})}var wu=k(`ZodNullable`,(e,t)=>{So.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>el(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tu(e){return new wu({type:`nullable`,innerType:e})}var Eu=k(`ZodDefault`,(e,t)=>{Co.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>il(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Du(e,t){return new Eu({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():zn(t)}})}var Ou=k(`ZodPrefault`,(e,t)=>{To.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>al(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ku(e,t){return new Ou({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():zn(t)}})}var Au=k(`ZodNonOptional`,(e,t)=>{Eo.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ju(e,t){return new Au({type:`nonoptional`,innerType:e,...D(t)})}var Mu=k(`ZodCatch`,(e,t)=>{ko.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ol(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Nu(e,t){return new Mu({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:wr(t)})}var Pu=k(`ZodPipe`,(e,t)=>{Ao.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sl(e,t,n,r),e.in=t.in,e.out=t.out});function Fu(e,t){return new Pu({type:`pipe`,in:e,out:t})}var Iu=k(`ZodPreprocess`,(e,t)=>{Pu.init(e,t),Mo.init(e,t)}),Lu=k(`ZodReadonly`,(e,t)=>{No.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ru(e){return new Lu({type:`readonly`,innerType:e})}var zu=k(`ZodCustom`,(e,t)=>{Fo.init(e,t),L.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uc(e,t,n,r)});function Bu(e,t={}){return oc(zu,e,t)}function Vu(e,t){return sc(e,t)}function Hu(e,t){return new Iu({type:`pipe`,in:yu(e),out:t})}function Uu(e){return As(Ol,e)}var K=R().regex(/^[a-z0-9][a-z0-9-]{0,31}$/,`expected 1-32 lowercase letters, digits, or hyphens, starting with a letter or digit`),q=R().regex(/^[0-9A-HJKMNP-TV-Z]{26}$/,`expected a ULID`),J=R().regex(/^(?:[a-z0-9][a-z0-9-]{0,31}\/)?[a-z0-9][a-z0-9-]{0,31}$/,`expected <channel> or <project>/<channel>`);function Wu(e){let t=e.indexOf(`/`);return t===-1?{project:null,channel:e}:{project:e.slice(0,t),channel:e.slice(t+1)}}function Gu(e,t){return e===null?t:`${e}/${t}`}var Y=Hu(e=>e instanceof Date?e.toISOString():e,Uu()),Ku=W([`post_message`,`read_inbox`,`search`,`open_thread`,`close_thread`,`create_task`,`claim_task`,`release_task`,`update_task`,`get_task`,`subscribe`,`unsubscribe`,`propose`,`approve`,`reject`,`create_project`,`join_project`,`leave_project`,`write_knowledge`,`plan_task`,`advance_task`,`configure_project`,`archive_project`]),qu=W([`user_post`,`ops_event`,`heartbeat`]),Ju=U({name:K,purpose:R().min(1),verbs:H(Ku),wakeTriggers:H(qu).default([`heartbeat`]),reviewDate:R().optional(),maxReplicas:B().int().min(1).default(1),backlogThreshold:B().positive().default(3),resident:V().default(!1),societyScope:V().default(!1),reflects:V().default(!0)}),Yu=`user`,Xu=`user`,Zu=[`post_message`,`read_inbox`,`search`,`open_thread`,`close_thread`,`create_task`,`claim_task`,`release_task`,`update_task`,`get_task`,`subscribe`,`unsubscribe`,`propose`,`join_project`,`leave_project`,`write_knowledge`,`plan_task`,`advance_task`],Qu=[`approve`,`reject`],$u=[`create_project`],ed=[`configure_project`],td=[`archive_project`];[...Zu,...Qu,...$u,...ed,...td],[...Zu,...Qu,...ed],[...Zu,...$u,...ed];var nd=`asks`,rd=`society`;function id(e,t){return t!==null&&e.memberships.includes(t)?t:rd}var X=W([`claude`,`codex`]),ad=U({name:R().min(1),version:G(1),createdAt:Y,channels:H(K)}),od=W([`none`,`merge`]),sd=R().regex(/^s[1-9][0-9]*$/,`expected a stage id such as s1`),cd={name:R().trim().min(1).max(120),role:K.optional(),agent:K.optional(),gate:V().default(!1)};function ld(e){return e.role===void 0||e.agent===void 0}var ud={message:`a stage names a role or an agent, not both`},dd=U(cd).refine(ld,ud),fd=U({id:sd.optional(),...cd}).refine(ld,ud),pd=U({slug:K,name:R().min(1),repo:R().nullable(),defaultBranch:R().min(1),channels:H(K),members:H(K),approvers:H(K),requiredCapabilities:H(R()),createdAt:Y,onDone:od.default(`none`),runner:K.optional(),archived:U({at:Y,by:K,reason:R().min(1)}).optional()}),md=lu([U({action:W([`advanced`,`returned`,`abandoned`,`landed`,`reopened`]),stage:sd,to:sd.nullable()}),U({action:W([`approved`,`rejected`])})]);function hd(e){return`stage`in e}var gd=U({id:q,author:K,channel:J,thread:q.optional(),task:q.optional(),closes:q.optional(),step:md.optional(),ts:Y,mentions:H(K)}),_d=W([`open`,`claimed`,`done`,`abandoned`]),vd=W([`open`,`closed`]),yd=U({kind:W([`task`,`proposal`]),id:q}),bd=U({id:q,channel:J,title:R().min(1).max(200),subject:yd.optional(),state:vd,openedBy:K,openedAt:Y,closedBy:K.optional(),closedAt:Y.optional()}),xd=U({id:sd,name:R().min(1),role:K.optional(),agent:K.optional(),gate:V().default(!1),holders:H(K).default([]),completedBy:K.optional(),completedAt:Y.optional()}),Sd=U({from:sd,by:K,at:Y}),Cd=U({id:q,project:K,title:R().min(1),status:_d,createdBy:K,createdAt:Y,updatedAt:Y,claimedBy:K.optional(),leaseExpiresAt:Y.optional(),parentId:q.optional(),blockedBy:H(q),requiredCapabilities:H(R()),stages:H(xd).min(1),stage:sd,stageSince:Y,stageSeq:B().int().positive(),onDone:od.default(`none`),completing:V().default(!1),returned:Sd.optional()});function wd(e,t){return e.stages.findIndex(e=>e.id===t)}function Td(e){return e.stages.find(t=>t.id===e.stage)}var Ed=U({id:R().trim().min(1).max(120).regex(/^[\w.:/[\]-]+$/,`a model name is one word of letters, digits, and . _ : / - [ ]`),name:R(),description:R().default(``),isDefault:V().default(!1)}),Dd=W([`active`,`retired`]),Od=U({name:K,role:K,cli:X.nullable(),model:R().optional(),homeRunner:K.optional(),memberships:H(K),subscriptions:H(J),status:Dd,createdAt:Y,tokenHash:R().min(1),retiredAt:Y.optional(),retiredReason:R().optional()}),kd=U({name:K,role:K,cli:X.nullable(),homeRunner:K.optional(),status:Dd,resident:V().default(!1),model:R().optional(),lastModel:R().optional(),skills:H(K).default([]),memberships:H(K),subscriptions:H(J),claimsHeld:B().int().nonnegative().default(0),tasksDone:B().int().nonnegative().default(0),lastTurnAt:Y.optional(),lastTurnOutcome:R().optional(),createdAt:Y,retiredAt:Y.optional()}),Ad=W([`linux`,`windows`,`darwin`]),jd=U({name:K,os:Ad,clis:H(X),capabilities:H(R()),status:W([`connected`,`disconnected`]),lastSeen:Y.optional()}),Md=W([`role`,`member`,`channel`,`reallocation`,`retirement`,`skill`,`archive`]),Nd=W([`proposed`,`approved`,`rejected`,`provisioned`,`retired`]),Pd=U({name:K,role:K,cli:X,model:R().optional(),homeRunner:K.optional(),memberships:H(K).default([]),subscriptions:H(J).default([]),seedInstructions:R().optional()}),Fd=U({project:K.nullable().default(null),name:K,purpose:R().min(1)}),Id=U({description:R().min(1)}),Ld=U({agent:K,reason:R().min(1)}),Rd=U({project:K,reason:R().min(1)}),zd=U({name:K,summary:R().min(1).max(200),body:R().min(1)}),Bd={role:[Yu],member:[Yu],retirement:[Yu],archive:[Yu],channel:[Yu,`steward`],reallocation:[Yu,`steward`],skill:[Yu,`steward`]};function Vd(e,t){switch(e){case`member`:{let e=Pd.safeParse(t);if(!e.success)break;let{name:n,role:r,cli:i,memberships:a}=e.data;return`member ${n} as ${r} on ${i}${a.length===0?``:` for ${a.join(`, `)}`}`}case`role`:{let e=Ju.safeParse(t);if(!e.success)break;let{name:n,verbs:r,maxReplicas:i}=e.data;return`role ${n} (${r.length} verbs, up to ${i} per project)`}case`channel`:{let e=Fd.safeParse(t);if(!e.success)break;return`channel ${Gu(e.data.project,e.data.name)}: ${e.data.purpose}`}case`retirement`:{let e=Ld.safeParse(t);if(!e.success)break;return`retirement of ${e.data.agent}: ${e.data.reason}`}case`reallocation`:{let e=Id.safeParse(t);if(!e.success)break;return`reallocation: ${e.data.description}`}case`skill`:{let e=zd.safeParse(t);if(!e.success)break;return`skill ${e.data.name}: ${e.data.summary.trim().replace(/\.+$/,``)}`}case`archive`:{let e=Rd.safeParse(t);if(!e.success)break;return`archive of project ${e.data.project}: ${e.data.reason}`}}return`${e} ${JSON.stringify(t)}`}var Hd=U({name:K,summary:R().default(``),scope:W([`own`,`society`]),path:R().min(1)}),Ud=U({path:R().min(1),file:R().min(1),since:Y}),Wd=R().regex(/^[0-9a-f]{40}([0-9a-f]{24})?$/),Gd=U({path:R().min(1),status:W([`added`,`modified`,`deleted`]),added:B().int().nonnegative().nullable(),removed:B().int().nonnegative().nullable()}),Kd=U({changes:H(U({commit:Wd,at:Y,kind:W([`turn`,`board`,`merge`]),author:R(),turnId:q.optional(),subject:R(),files:H(Gd)})),more:V()}),qd=Gd.pick({path:!0,status:!0}).extend({patch:R().nullable(),truncated:V()}),Jd=U({topic:K,project:K.nullable(),updatedBy:K,updatedAt:Y}),Yd=U({id:q,kind:Md,proposedBy:K,status:Nd,createdAt:Y,decidedBy:K.optional(),decidedAt:Y.optional(),reason:R().optional(),charter:hu(R(),ru()),provisionedAt:Y.optional(),provision:hu(R(),ru()).optional()}),Xd=U({id:q,proposalId:q,decidedBy:K,outcome:W([`approved`,`rejected`]),reason:R().optional(),ts:Y});U({channel:J.optional(),body:R().min(1),thread_id:q.optional()}),U({since_cursor:q.nullable().optional(),limit:B().int().positive().max(200).default(50),advance:V().default(!0)}),U({query:R().min(1),project:K.optional(),channel:J.optional(),limit:B().int().positive().max(100).default(20)}),U({task_id:q.optional(),proposal_id:q.optional(),channel:J.optional(),title:R().min(1).max(200).optional()}),U({thread_id:q,summary:R().min(1)}),U({project:K,title:R().min(1).max(200),body:R().default(``),parent_id:q.optional(),required_capabilities:H(R()).default([]),stages:H(dd).min(1).optional()}),U({task_id:q}),U({task_id:q}),U({task_id:q,stage:sd.optional(),status:W([`abandoned`]).optional(),note:R().min(1).optional(),blocked_by:H(q).optional()}),U({task_id:q}),U({channel:J}),U({channel:J}),U({kind:Md,charter:hu(R(),ru()),rationale:R().default(``)}),U({proposal_id:q,reason:R().optional()}),U({proposal_id:q,reason:R().min(1)}),U({slug:K,name:R().min(1).optional(),repo:R().min(1).nullable().default(null),default_branch:R().min(1).default(`main`),on_done:od.optional()}),U({project:K,agent:K.optional()}),U({project:K,agent:K.optional()}),U({project:K.nullable().default(null),topic:K,body:R().min(1)}),U({task_id:q,stages:H(fd),on_done:od.optional()}),U({task_id:q,note:R().min(1).optional()}),U({project:K,on_done:od}),U({project:K,reason:R().min(1)});var Zd=U({id:q,ts:Y,type:W(`society.initialized,project.added,project.configured,project.archived,project.placed,agent.added,agent.configured,agent.placed,message.posted,thread.opened,thread.closed,task.created,task.claimed,task.released,task.updated,task.planned,task.advanced,task.moved,task.completing,task.completed,task.reopened,lease.expired,subscription.changed,proposal.created,proposal.decided,proposal.provisioned,channel.added,role.added,agent.retired,agent.joined,agent.left,knowledge.written,skill.promoted,runner.added,user.signed_in,user.signed_out,user.token_rotated,runner.changed,ops.signal,paused.changed,wake.requested,turn.started,turn.steered,turn.stopped,turn.completed,turn.failed,merge.completed,merge.failed`.split(`,`)),actor:K,payload:hu(R(),ru())}),Qd=U({inputTokens:B().int().nonnegative(),outputTokens:B().int().nonnegative(),cacheReadTokens:B().int().nonnegative().default(0),cacheWriteTokens:B().int().nonnegative().default(0)}),$d=U({summary:R().min(1),claimsHeld:H(q).default([]),blockedOn:H(R()).default([]),needsUserDecision:V().default(!1),memoryUpdated:V().default(!1)}),ef=W([`completed`,`timeout`,`error`,`interrupted`,`blocked`,`stopped`]),tf=du(`type`,[U({type:G(`turn_started`),agent:K,session:R(),runner:K,model:R().optional()}),U({type:G(`steered`),steer:R().min(1),messages:H(q).optional(),text:R().optional()}),U({type:G(`text`),delta:R()}),U({type:G(`tool_call`),name:R(),input:ru()}),U({type:G(`tool_result`),name:R(),ok:V(),output:R().optional()}),U({type:G(`approval_requested`),kind:R(),detail:ru()}),U({type:G(`turn_completed`),usage:Qd,costUsd:B().nonnegative(),status:$d.nullable(),exitReason:ef}),U({type:G(`error`),message:R()})]),nf=U({ts:Y,event:tf}),rf=U({seq:B().int().positive(),ts:Y,agent:K,project:K,thread:q.optional(),event:tf});U({protocol:B().int().positive(),version:R().min(1),os:Ad,clis:H(X),residentClis:H(X).default([]),steerableClis:H(X).default([]),stoppableClis:H(X).default([]),branchReads:V().default(!1),branchChanges:V().default(!1),capabilities:H(R()).default([]),slots:B().int().positive().nullable(),turns:H(q).default([])}),U({name:K,version:R()}),U({protocol:B().int().positive(),version:R().min(1).max(64),hostname:R().min(1).max(253),os:Ad,clis:H(X).max(8),capabilities:H(R().min(1).max(64)).max(32).default([])}),U({deviceCode:R().min(1),userCode:R().min(1),expiresAt:Y,intervalMs:B().int().positive()}),U({deviceCode:R().min(1)}),du(`status`,[U({status:G(`pending`)}),U({status:G(`approved`),name:K,token:R().min(1)}),U({status:G(`denied`)})]);var af=U({userCode:R().min(1),hostname:R(),os:Ad,clis:H(X),capabilities:H(R()),version:R(),requestedAt:Y,expiresAt:Y}),of=U({slug:K,origin:R().nullable(),defaultBranch:R().min(1)}),sf=du(`kind`,[U({kind:G(`home`)}),U({kind:G(`project`),repo:of,branches:H(R().min(1))}),U({kind:G(`task`),repo:of,taskId:q})]),cf=U({turnId:q,agent:K,role:K,cli:X,model:R().optional(),scope:K,thread:q.optional(),session:R().min(1).nullable(),costSoFarUsd:B().nonnegative(),instructions:R(),prompt:R(),mcp:U({url:R().min(1),token:R().min(1)}),limits:U({timeoutMs:B().int().positive().nullable(),maxTurns:B().int().positive().nullable()}),resident:U({key:R().min(1),idleMs:B().int().positive()}).optional(),workspace:sf}),lf=U({branch:R().min(1),head:R().min(1)});U({entries:H(nf)}),U({exitReason:ef,status:$d.nullable(),error:R().nullable(),usage:Qd,costUsd:B().nonnegative(),sessionCostUsd:B().nonnegative().optional(),session:R().min(1),model:R().nullable(),work:lf.nullable()}),U({dropWorktree:V()});var uf=U({repo:of,branch:R().min(1)});U({ok:V(),detail:R()});var df=8388608,ff=R().max(4096).refine(e=>e===``||e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&!e.includes(`\0`)),{message:"a path inside the branch, with no empty, `.`, or `..` segment"}),pf=R().regex(/^[A-Za-z0-9][A-Za-z0-9._/-]*$/),mf=U({repo:of,branch:pf,path:ff}),hf=U({id:R().min(1),at:Y,author:R()}),gf=du(`kind`,[U({kind:G(`file`),path:ff,commit:hf,size:B().int().nonnegative(),content:R().nullable()}),U({kind:G(`dir`),path:ff,commit:hf,entries:H(U({name:R().min(1),kind:W([`file`,`dir`]),size:B().int().nonnegative().nullable()}))})]),_f=U({repo:of,branch:pf}),vf=U({head:hf,files:H(U({path:R().min(1),status:W([`added`,`modified`,`deleted`]),added:B().int().nonnegative().nullable(),removed:B().int().nonnegative().nullable(),lastChange:U({author:R(),at:Y}).optional()})),total:B().int().nonnegative()}),yf=U({id:Fl(),text:R().min(1)});du(`type`,[U({type:G(`turn`),job:cf}),U({type:G(`land`),request:R().min(1),land:uf}),U({type:G(`models`),request:R().min(1),cli:X}),U({type:G(`file`),request:R().min(1),read:mf}),U({type:G(`changes`),request:R().min(1),read:_f}),U({type:G(`steer`),request:R().min(1),turnId:q,steer:yf}),U({type:G(`stop`),request:R().min(1),turnId:q})]),du(`ok`,[U({ok:G(!0),value:ru()}),U({ok:G(!1),error:R()})]),U({warm:H(R())}),U({files:hu(R(),R())}),U({paths:H(R())}),U({files:hu(R(),R())});var bf=U({kind:W([`mention`,`stage`,`task_done`,`proposal_decided`,`heartbeat`,`reflection`,`onboarding`,`manual`,`ops_event`,`user_post`]),from:K.optional(),fromUser:V().default(!1),reason:R().default(``),taskId:q.optional(),messageId:q.optional(),channel:J.optional()});U({agent:K,project:K,thread:U({id:q,task:V()}).optional(),trigger:bf,priority:B().int().min(0).max(2),onboarding:V().default(!1)});function xf(e,t,n){return n===void 0?`${e}/${t}`:`${e}/${t}/${n}`}function Sf(e){let[t,n,r,i]=e.split(`/`);return t===void 0||n===void 0||i!==void 0?null:r===void 0?{agent:t,scope:n}:{agent:t,scope:n,thread:r}}U({id:q.optional(),agent:K,project:K,thread:q.optional(),runner:K,cli:X.nullable(),session:R().nullable(),trigger:bf,startedAt:Y,endedAt:Y.nullable(),exitReason:ef.nullable(),status:$d.nullable(),error:R().nullable(),usage:Qd.nullable(),costUsd:B().nonnegative().default(0),sessionCostUsd:B().nonnegative().optional(),toolCalls:B().int().nonnegative().default(0),model:R().nullable().default(null),work:lf.optional(),stoppedBy:K.optional()});var Cf=U({turnId:q,agent:K,scope:K,thread:q.optional(),cli:X,channel:J.optional(),steerable:V(),stoppable:V()});U({claude:R().optional(),codex:R().optional(),runner:K.optional()}),U({agent:K,project:K,reason:R().default(`manual wake`),kind:W([`manual`,`reflection`]).default(`manual`)});var wf=U({id:q,turnId:q.optional(),ts:Y,outcome:W([`completed`,`failed`]),project:K,thread:q.optional(),trigger:R(),exitReason:R().nullable(),costUsd:B(),model:R().nullable(),summary:R().nullable(),error:R().nullable(),startedAt:Y.optional(),toolCalls:B().int().nonnegative().optional()}),Tf=W([`waiting_stage`,`backlog`,`role_gap`,`churn`,`stale_thread`,`idle_member`,`blocked_capability`,`turn_cost`,`scaled`,`runner`,`home_conflict`]),Ef=[`backlog`,`role_gap`,`churn`,`stale_thread`,`idle_member`,`blocked_capability`,`scaled`],Df=U({kind:Tf,key:R().min(1),summary:R().min(1),value:B(),threshold:B().optional(),project:K.optional(),agent:K.optional(),role:K.optional(),taskId:q.optional()}),Of=W([`24h`,`7d`,`all`]),Z=B().int().nonnegative(),kf=B().nonnegative(),Af=U({window:Of,since:Y.nullable(),until:Y,idle:U({turns:Z,idle:Z,unknown:Z,byTrigger:H(U({trigger:R(),turns:Z,idle:Z})),byAgent:H(U({agent:K,role:K.nullable(),turns:Z,idle:Z}))}),sentBack:U({finished:Z,sendBacks:Z,tasksSentBack:Z,byStage:H(U({project:K,stage:R(),count:Z})),bySender:H(U({agent:K,count:Z}))}),messages:U({finished:Z,messages:Z,byProject:H(U({project:K,finished:Z,messages:Z})),busiest:H(U({taskId:q,title:R(),project:K,messages:Z}))}),latency:U({mentions:Z,unanswered:Z,medianMs:kf.nullable(),slowestMs:kf.nullable(),byAgent:H(U({agent:K,mentions:Z,medianMs:kf,slowestMs:kf}))}),decisions:U({total:Z,byDay:H(U({day:R(),proposals:Z,answers:Z,stages:Z}))}),blocked:H(U({taskId:q,title:R().nullable(),project:K.nullable(),summary:R(),firstAt:Y,lastAt:Y,holds:V()}))}),jf=W([`trace`,`debug`,`info`,`warn`,`error`,`fatal`]),Mf=U({clientId:R().min(1),clientSecret:R().min(1),users:H(R().min(1)).min(1)});U({dataDir:R().min(1),host:R().min(1),port:B().int().positive().max(65535),publicUrl:R().min(1).nullable(),logLevel:jf,concurrency:B().int().positive().nullable(),turnTimeoutMs:B().int().positive().nullable(),toolRounds:B().int().positive().nullable(),residentIdleMs:B().int().positive(),github:Mf.nullable(),trustedProxies:B().int().min(0).max(16)}),U({serverUrl:R().url(),token:R().min(1).nullable(),dataDir:R().min(1),logLevel:jf,slots:B().int().positive().nullable(),clis:H(X).min(1),capabilities:H(R())});var Nf=`stellaris.token`;function Pf(){return localStorage.getItem(Nf)}function Ff(e){localStorage.setItem(Nf,e)}function If(){localStorage.removeItem(Nf)}var Lf=U({github:V()});async function Rf(){try{let e=Lf.safeParse(await(await fetch(`/auth/config`)).json());return e.success?e.data:{github:!1}}catch{return{github:!1}}}var zf=class extends Error{status;constructor(e,t){super(t),this.status=e}},Bf=U({name:K,role:K}),Vf=kd.extend({profile:R()}).array(),Hf=U({paused:V(),running:H(R()),pending:H(R()),resident:H(R()),signals:H(R()),turns:H(Cf).default([])});function Uf(e){return e.flatMap(e=>{let t=Sf(e);return t===null?[]:[t]})}var Wf=gd.extend({body:R()}),Gf=Wf.array(),Kf=U({ref:J,project:K.nullable(),name:K,messages:B().int(),lastMessageId:q.nullable(),lastAt:R().nullable()}),qf=bd.extend({body:R()}),Jf=qf.extend({messages:B().int(),lastMessageId:q.nullable(),lastAuthor:K.nullable().default(null)}),Yf=U({thread:qf,messages:Gf}),Xf=U({message:Wf,thread:qf.nullable()}),Zf=Cd.extend({body:R()}),Qf=Yd.extend({body:R()}),$f=Jd.extend({body:R()}),ep=U({body:R()}),tp=U({data:hu(R(),ru()),body:R()});function np(e){return e.split(`/`).map(encodeURIComponent).join(`/`)}var rp=U({message:R()});async function Q(e,t,n){let r;try{r=await fetch(e,{headers:{authorization:`Bearer ${t}`}})}catch{throw new zf(0,`The board server is not reachable.`)}if(!r.ok){let t=rp.safeParse(await r.json().catch(()=>null));throw new zf(r.status,t.success?t.data.message:`${e} answered ${r.status}`)}return n.parse(await r.json())}async function ip(e,t,n,r,i){let a;try{a=await fetch(t,{method:e,headers:{authorization:`Bearer ${n}`,"content-type":`application/json`},body:JSON.stringify(r)})}catch{throw new zf(0,`The board server is not reachable.`)}if(!a.ok){let e=rp.safeParse(await a.json().catch(()=>null));throw new zf(a.status,e.success?e.data.message:`${t} answered ${a.status}`)}return i.parse(await a.json())}function ap(e,t,n,r){return ip(`POST`,`/api/verbs/${e}`,t,n,r)}var op=U({paused:V()}),sp=U({id:q,ts:R(),signal:Df}),cp=Od.omit({tokenHash:!0}),lp=U({signedOut:V()}),up=U({denied:V()}),dp=U({stopped:V()});function fp(e){return{me:()=>Q(`/api/me`,e,Bf),signOut:()=>ip(`DELETE`,`/api/sign-in`,e,{},lp),society:()=>Q(`/api/society`,e,ad),members:()=>Q(`/api/members`,e,Vf),projects:()=>Q(`/api/projects`,e,pd.array()),roles:()=>Q(`/api/roles`,e,Ju.array()),scheduler:()=>Q(`/api/scheduler`,e,Hf),signals:t=>Q(`/api/signals?limit=${t}`,e,sp.array()),metrics:t=>Q(`/api/metrics?window=${t}`,e,Af),channels:()=>Q(`/api/channels`,e,Kf.array()),channel:t=>Q(`/api/channels/${np(t)}`,e,Gf),threads:()=>Q(`/api/threads`,e,Jf.array()),requests:()=>Q(`/api/requests`,e,Xf.array()),thread:t=>Q(`/api/threads/${encodeURIComponent(t)}`,e,Yf),tasks:t=>Q(`/api/projects/${encodeURIComponent(t)}/tasks`,e,Zf.array()),task:t=>Q(`/api/tasks/${encodeURIComponent(t)}`,e,Zf),taskFile:(t,n)=>Q(`/api/tasks/${encodeURIComponent(t)}/files${n.split(`/`).filter(e=>e!==``).map(e=>`/${encodeURIComponent(e)}`).join(``)}`,e,gf),taskChanges:t=>Q(`/api/tasks/${encodeURIComponent(t)}/changes`,e,vf),proposals:()=>Q(`/api/proposals`,e,Qf.array()),proposal:t=>Q(`/api/proposals/${encodeURIComponent(t)}`,e,Qf),skills:()=>Q(`/api/skills`,e,Hd.array()),turns:(t,n)=>Q(`/api/agents/${encodeURIComponent(t)}/turns?limit=${n}`,e,wf.array()),transcript:(t,n)=>Q(`/api/agents/${encodeURIComponent(t)}/turns/${encodeURIComponent(n)}`,e,nf.array()),memory:t=>Q(`/api/agents/${encodeURIComponent(t)}/memory`,e,ep),agentSkills:t=>Q(`/api/agents/${encodeURIComponent(t)}/skills`,e,Hd.array()),history:(t,n)=>Q(`/api/agents/${encodeURIComponent(t)}/history?limit=${n}`,e,Kd),change:(t,n)=>Q(`/api/agents/${encodeURIComponent(t)}/history/${encodeURIComponent(n)}`,e,qd.array()),conflicts:t=>Q(`/api/agents/${encodeURIComponent(t)}/conflicts`,e,Ud.array()),dashboard:t=>Q(`/api/projects/${encodeURIComponent(t)}/dashboard`,e,tp),knowledge:t=>Q(t===`society`?`/api/society/knowledge`:`/api/projects/${encodeURIComponent(t)}/knowledge`,e,$f.array()),sendMessage:t=>ap(`post_message`,e,t,Wf),openThread:t=>ap(`open_thread`,e,t,qf),closeThread:t=>ap(`close_thread`,e,t,Wf),approve:t=>ap(`approve`,e,t,Xd),reject:t=>ap(`reject`,e,t,Xd),wake:t=>ip(`POST`,`/api/wake`,e,t,Zd),setPaused:t=>ip(`POST`,t?`/api/pause`:`/api/resume`,e,{},op),stopTurn:t=>ip(`POST`,`/api/turns/${encodeURIComponent(t)}/stop`,e,{},dp),models:t=>Q(`/api/models/${t}`,e,Ed.array()),runners:()=>Q(`/api/runners`,e,jd.array()),enrollments:()=>Q(`/api/enrollments`,e,af.array()),approveEnrollment:(t,n)=>ip(`POST`,`/api/enrollments/${encodeURIComponent(t)}/approve`,e,{name:n},jd),denyEnrollment:t=>ip(`POST`,`/api/enrollments/${encodeURIComponent(t)}/deny`,e,{},up),setRunner:(t,n)=>ip(`PUT`,`/api/agents/${encodeURIComponent(t)}/runner`,e,{runner:n},cp),setModel:(t,n)=>ip(`PUT`,`/api/agents/${encodeURIComponent(t)}/model`,e,{model:n},cp)}}var pp=(0,m.createContext)(null);function $(){let e=(0,m.useContext)(pp);if(e===null)throw Error(`useSession needs a signed-in SessionContext`);return e}function mp(){let{api:e}=$();return T({queryKey:[`society`],queryFn:e.society,staleTime:6e4})}function hp(){let{api:e}=$();return T({queryKey:[`members`],queryFn:e.members,refetchInterval:3e4})}function gp(){let{api:e}=$();return T({queryKey:[`projects`],queryFn:e.projects,refetchInterval:6e4})}function _p(){let{api:e}=$();return T({queryKey:[`roles`],queryFn:e.roles,refetchInterval:6e4})}function vp(){let{api:e}=$();return T({queryKey:[`scheduler`],queryFn:e.scheduler,refetchInterval:3e3})}function yp(){let{api:e}=$();return T({queryKey:[`requests`],queryFn:e.requests,refetchInterval:6e4})}function bp(e){let{api:t}=$();return T({queryKey:[`signals`],queryFn:()=>t.signals(200),enabled:e,refetchInterval:6e4})}function xp(e){let{api:t}=$();return T({queryKey:[`metrics`,e],queryFn:()=>t.metrics(e),refetchInterval:6e4})}function Sp(){let{api:e}=$();return T({queryKey:[`channels`],queryFn:e.channels,refetchInterval:6e4})}function Cp(){let{api:e}=$();return T({queryKey:[`threads`],queryFn:e.threads,refetchInterval:6e4})}function wp(e){let{api:t}=$();return T({queryKey:[`tasks`,e],queryFn:()=>t.tasks(e),refetchInterval:6e4})}function Tp(e){return e.flatMap(e=>e.data??[])}function Ep(){let{api:e}=$();return ct({queries:(gp().data??[]).map(t=>({queryKey:[`tasks`,t.slug],queryFn:()=>e.tasks(t.slug),refetchInterval:6e4})),combine:Tp})}function Dp(e){let{api:t}=$();return T({queryKey:[`task`,e],queryFn:()=>t.task(e??``),enabled:e!==null})}function Op(e,t){let{api:n}=$();return T({queryKey:[`task-file`,e,t],queryFn:()=>n.taskFile(e,t),staleTime:3e4,retry:(e,t)=>e<1&&!(t instanceof zf&&(t.status===404||t.status===503))})}function kp(e){let{api:t}=$();return T({queryKey:[`task-changes`,e],queryFn:()=>t.taskChanges(e),staleTime:3e4,retry:(e,t)=>e<1&&!(t instanceof zf&&(t.status===404||t.status===503))})}function Ap(){let{api:e}=$();return T({queryKey:[`proposals`],queryFn:e.proposals,refetchInterval:6e4})}function jp(e){let{api:t}=$();return T({queryKey:[`proposal`,e],queryFn:()=>t.proposal(e)})}function Mp(){let{api:e}=$();return T({queryKey:[`skills`],queryFn:e.skills,staleTime:6e4})}function Np(e,t){let{api:n}=$();return T({queryKey:[`turns`,e,t],queryFn:()=>n.turns(e,t),refetchInterval:6e4})}function Pp(e,t){let{api:n}=$();return T({queryKey:[`transcript`,e,t],queryFn:()=>n.transcript(e,t??``),enabled:t!==null,staleTime:1/0})}function Fp(e){let{api:t}=$();return T({queryKey:[`memory`,e],queryFn:()=>t.memory(e)})}function Ip(e){let{api:t}=$();return T({queryKey:[`agent-skills`,e],queryFn:()=>t.agentSkills(e)})}function Lp(e,t){let{api:n}=$();return T({queryKey:[`history`,e,t],queryFn:()=>n.history(e,t),placeholderData:ge})}function Rp(e,t,n){let{api:r}=$();return T({queryKey:[`home-change`,e,t],queryFn:()=>r.change(e,t),enabled:n,staleTime:1/0})}function zp(e){let{api:t}=$();return T({queryKey:[`conflicts`,e],queryFn:()=>t.conflicts(e)})}function Bp(e){let{api:t}=$();return T({queryKey:[`dashboard`,e],queryFn:()=>t.dashboard(e),refetchInterval:6e4})}function Vp(e){let{api:t}=$();return T({queryKey:[`knowledge`,e],queryFn:()=>t.knowledge(e),refetchInterval:12e4})}function Hp(){let{api:e}=$();return T({queryKey:[`runners`],queryFn:()=>e.runners(),refetchInterval:6e4})}function Up(){let{api:e}=$();return T({queryKey:[`enrollments`],queryFn:e.enrollments,refetchInterval:5e3})}function Wp(e){let{api:t}=$();return T({queryKey:[`models`,e],queryFn:()=>t.models(e??`claude`),enabled:e!==null,staleTime:6e5,retry:!1})}function Gp(e){let[t,n]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var Kp=[[`day`,86400],[`hour`,3600],[`minute`,60]],qp=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`});function Jp(e,t){let n=Math.round((Date.parse(e)-t)/1e3);for(let[e,t]of Kp)if(Math.abs(n)>=t)return qp.format(Math.round(n/t),e);return`just now`}function Yp(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m`:`${Math.floor(n/60)}h ${n%60}m`}function Xp(e,t=220){let n=(e.split(/\n\s*\n/).map(e=>e.trim()).find(e=>e.length>0&&!e.startsWith(`#`))??``).replaceAll(/[*_`>]/g,``).replaceAll(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,t-1).trimEnd()}…`}export{Fd as $,Ae as $t,Dp as A,Nt as At,fp as B,wt as Bt,_p as C,qt as Ct,bp as D,It as Dt,$ as E,At as Et,Pp as F,mt as Ft,Ef as G,ut as Gt,Ff as H,ft as Ht,Np as I,Dt as It,df as J,gt as Jt,Sf as K,ht as Kt,zf as L,vt as Lt,Op as M,Mt,wp as N,Ct as Nt,Mp as O,zt as Ot,Cp as P,kt as Pt,Rd as Q,Pe as Qt,Rf as R,Ot as Rt,yp as S,$t as St,vp as T,Ut as Tt,Pf as U,Et as Ut,Uf as V,pt as Vt,Of as W,yt as Wt,rf as X,ze as Xt,Zd as Y,T as Yt,nd as Z,Fe as Zt,Wp as _,d as _n,V as _t,Ip as a,le as an,zd as at,jp as b,l as bn,R as bt,Bp as c,ae as cn,hd as ct,zp as d,S as dn,Ju as dt,ke as en,Pd as et,Lp as f,xe as fn,Xu as ft,xp as g,p as gn,H as gt,Fp as h,g as hn,Wu as ht,pp as i,ue as in,rd as it,kp as j,jt,mp as k,Ft as kt,Up as l,de as ln,wd as lt,hp as m,te as mn,Gu as mt,Xp as n,Te as nn,Id as nt,Ep as o,b as on,Td as ot,Vp as p,ye as pn,Yu as pt,xf as q,Tt as qt,Yp as r,oe as rn,Ld as rt,Sp as s,ce as sn,Vd as st,Jp as t,Ee as tn,Bd as tt,Rp as u,y as un,id as ut,Gp as v,o as vn,U as vt,Hp as w,Kt as wt,Ap as x,gn as xt,gp as y,s as yn,hu as yt,If as z,dt as zt};
|