@fungi.computer/grove 0.13.7 → 0.13.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{anthropic-messages-ClpVgJ8Y.js → anthropic-messages-SFxe8984.js} +3 -3
- package/dist/assets/{azure-openai-responses-CgPf71-R.js → azure-openai-responses-a3vgtcD6.js} +1 -1
- package/dist/assets/{burger-CFDnFQ00.js → burger-1D0oKXf4.js} +1 -1
- package/dist/assets/{cat-Bgukf64N.js → cat-BVhcWLNu.js} +1 -1
- package/dist/assets/{compat-Bc_hxJ5q.js → compat-DWbuBZTR.js} +2 -2
- package/dist/assets/{extension-hook-CbGLyQB9.js → extension-hook-GLdZiZGE.js} +2 -2
- package/dist/assets/{google-generative-ai--O_Ne_pg.js → google-generative-ai-g1O0UIvZ.js} +1 -1
- package/dist/assets/{google-shared-CSxRFdxN.js → google-shared-DN6-sKCP.js} +1 -1
- package/dist/assets/{google-vertex-CFb1fMOZ.js → google-vertex-BxoOrmmJ.js} +1 -1
- package/dist/assets/{index-CdahfjEX.js → index-BWg-K54G.js} +4 -4
- package/dist/assets/{mistral-conversations-CsTBF78d.js → mistral-conversations-zACah1on.js} +1 -1
- package/dist/assets/{node.browser-2vuW_jZB.js → node.browser-onFaWCHs.js} +1 -1
- package/dist/assets/{openai-codex-responses-C0feQUC9.js → openai-codex-responses-BtKg9rDW.js} +1 -1
- package/dist/assets/{openai-completions-DOg2W8sy.js → openai-completions-rjtMvJQr.js} +1 -1
- package/dist/assets/{openai-responses-CbCdTynX.js → openai-responses-CyznuTDX.js} +1 -1
- package/dist/assets/{openai-responses-shared-DtqK3J33.js → openai-responses-shared-DuWF1M-e.js} +1 -1
- package/dist/assets/{parakeet-58nClsWa.js → parakeet-BDnV9wzp.js} +2 -2
- package/dist/assets/{parakeet-conversation-Bgfcl6Wc.js → parakeet-conversation-xGOQOiFz.js} +1 -1
- package/dist/assets/{runtime-core-wCHaz0ut.js → runtime-core-nYZy1jW4.js} +1 -1
- package/dist/assets/{sigil-C4iBIL7W.js → sigil-C6HEWU0G.js} +1 -1
- package/dist/assets/{transform-messages-BwbU4JCd.js → transform-messages-Djsuvf0F.js} +1 -1
- package/dist/assets/{website-conversation-Do6bbUb7.js → website-conversation-BhGLnlYQ.js} +1 -1
- package/dist/index.html +3 -3
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Br as t,D as n,Hr as r,Li as i,Pi as a,Rr as o,Si as s,Tr as c,Vr as l,Wr as u,_ as d,d as f,ft as p,jr as m,l as ee,zr as te}from"./sigil-C4iBIL7W.js";import{Ea as h,Ta as ne,Zi as g,_a as _,ar as v,ba as re,da as ie,fa as ae,ht as oe,ra as se,sr as ce,xa as y,ya as le}from"./Effect-DeiDqvoz.js";import{Ar as ue,Ci as de,Ei as b,Fa as fe,Gi as x,Ia as S,Ii as C,La as w,Li as pe,Ma as T,Mr as me,Ni as E,Oa as D,Pi as he,Si as O,Ti as k,Ui as ge,Zi as A,ba as j,bi as _e,ea as ve,fa as M,fi as N,ga as ye,gi as P,hi as F,i as I,ii as be,la as xe,li as L,oi as Se,pi as Ce,qi as we,si as R,wa as z,wi as Te}from"./extension-hook-CbGLyQB9.js";import{a as Ee,c as De,d as B,i as Oe,l as ke,n as Ae,o as je,r as Me,s as Ne,u as Pe}from"./parakeet-58nClsWa.js";import{_ as Fe,g as V,h as Ie,m as Le,p as Re,t as ze,v as Be,y as Ve}from"./index-CdahfjEX.js";var H=e(i(),1),U=s(),W=k.check(D(1),z(256)),He=N.check(M(1),j(2**53-1)),Ue=N.check(M(0),j(2**53-1)),We=P([`write`,`external`]),Ge=b({module:O(W),access:We}),Ke=b({agentId:O(W)}),qe=b({principalId:W,agentId:O(W),sessionId:O(W),displayName:W}),Je=b({title:k.check(D(1),z(512)),inputBytes:N.check(M(0)),inputSha256:k.check(T(/^[a-f0-9]{64}$/))}),Ye=b({kind:F(`pending_approval`),recordId:W,description:Je}),Xe=P([`requested`,`pending`,`approved`,`claimed`,`applied`,`denied`,`expired`,`outcome_unknown`]),Ze=P([`not-found`,`not-eligible`,`already-answered`,`stale-revision`,`expired`,`declined`,`fenced`,`not-granted`,`read-only`,`pending`,`in-flight`,`outcome-unknown`,`identity-conflict`]),Qe=k.check(D(1),z(512),T(/^(?=.*\S)[^\p{Cc}\u2028\u2029]*$/u)),$e=R(b({kind:F(`artifact`),ref:k.check(T(/^sha256:[a-f0-9]{64}$/)),mediaType:F(`image/png`),bytes:N.check(M(1),j(5242880))})).check(z(4)),et=b({recordId:W,requester:qe,module:W,operation:W,access:We,description:Je,evidence:w($e),authorityFence:W,reversibility:P([`reversible`,`irreversible-external`]),state:Xe,by:O(E([b({kind:F(`human`),memberId:W}),b({kind:F(`policy`)})])),reason:O(Ze),denialNote:w(Qe),requestedAt:Ue,expiresAt:Ue,updatedAt:Ue,revision:He}),tt=b({record:et,canAnswer:L,canSetAutoApprove:L});b({state:w(Xe),cursor:w(W),limit:w(N.check(M(1),j(100)))}),b({recordId:W}),b({recordId:W,decision:P([`approve`,`deny`]),expectedRevision:He,denialNote:w(Qe)});var nt=b({scope:Ke,family:Ge,enabled:L}),rt=b({kind:F(`refused`),reason:Ze,denialNote:w(Qe)});x(A(et),{onExcessProperty:`error`}),we(A(et)),x(b({record_json:k})),x(A(Ce)),we(A(Ce)),x(b({input_json:k,output_json:O(k)}));var it=rt,at=b({items:R(tt),nextCursor:O(k)}),ot=E([b({kind:F(`answered`),view:tt}),it]),st=E([b({kind:F(`updated`),rule:nt}),it]),G=e=>Le(ne().transform(t=>x(e,{onExcessProperty:`error`})(t))),ct=Be(`approvals`,1,ae(()=>Ie({list:V(G(at)),get:V(G(O(tt))),answer:V(G(ot)),setAutoApprove:V(G(st))}))),lt=(e,t)=>{if(e.length<=t)return e;let n=Math.max(1,Math.floor((t-1)/2));return`${e.slice(0,n)}…${e.slice(-(t-n-1))}`},ut=(e,t)=>e.length<=t?e:`${e.slice(0,t-1)}…`,dt=e=>e.map(([e,t])=>({label:e,value:t}));function ft(e,t){let{record:n}=e,r=Math.max(0,n.expiresAt-t);return[[`Agent`,`${n.requester.displayName} · ${n.requester.agentId??`none`}`],[`Session`,n.requester.sessionId??`none`],[`Requester`,n.requester.principalId],[`Request`,`${n.module}.${n.operation} · ${n.access}`],[`Input`,`${n.description.inputBytes.toLocaleString()} bytes · SHA-256 ${n.description.inputSha256.slice(0,8)}…${n.description.inputSha256.slice(-6)}`],[`Expires`,`in ${String(Math.floor(r/36e5))} h ${String(Math.floor(r%36e5/6e4))} m`],[`Record`,`${n.recordId} · revision ${String(n.revision)}`]]}function pt(e){return[`Undo`,e.record.reversibility===`irreversible-external`?`Can't be undone`:`Can be undone`]}function mt(e,t){let{record:n}=e;return{content:{title:`Allow ${n.module} · ${n.operation}?`,summary:`${n.requester.displayName} wants to use a connected tool.`,facts:[{label:`Effect`,value:(n.access===`write`?`Changes data in Fungi`:`Changes things outside Fungi`)+(n.reversibility===`irreversible-external`?` · can't be undone`:``)}],details:dt([pt(e),...ft(e,t)])}}}function ht(e,t,n,r,i){let a=t.prefix?.join(` `),o=a!==void 0&&t.alwaysAllowUnavailableReason===void 0,s=t.command,c=`Allow \`${s}\`?`.length<=n?`Allow \`${s}\`?`:`Allow this command?`,l=t.cwd===r?`~`:t.cwd.startsWith(`${r}/`)?`~${t.cwd.slice(r.length)}`:t.cwd,u=Math.max(8,(n-8)*2-2),d=t.justification.length<=u?`“${t.justification}”`:`“${t.justification.slice(0,u-1)}…”`,f=[[`Folder`,lt(l,Math.max(8,n-10))],[`Why`,d]];t.kind===`extension-install`&&f.push([`Note`,`Extensions run inside Fungi with access to every Agent.`]),o&&t.alwaysAllowCoverage!==void 0&&f.push([`Scope`,ut(t.alwaysAllowCoverage,Math.max(8,n-12))]),!o&&t.risk!==void 0&&f.push([`Risk`,t.risk.summary]);let p=o?`Always allow “${lt(a,Math.max(8,n-5-32))}” in this project…`:void 0,m=[[`Command`,s]];return t.argv!==void 0&&m.push([`Arguments`,JSON.stringify(t.argv)]),m.push([`Folder`,t.cwd],[`Runs`,`Outside the sandbox, as you`],pt(e)),!o&&t.alwaysAllowUnavailableReason!==void 0?m.push([`Rule`,t.alwaysAllowUnavailableReason]):t.form===`shell`?m.push([`Rule`,`Shell command: no Always-allow rule can match it.`]):o&&(m.push([`Rule`,`“${a}” would match \`${a} …\` in this project`]),t.alwaysAllowCoverage!==void 0&&m.push([`Coverage`,t.alwaysAllowCoverage])),t.risk!==void 0&&m.push([`Risk`,t.risk.detail]),m.push(...ft(e,i)),{content:{title:c,body:c===`Allow this command?`?s:void 0,bodyLabel:c===`Allow this command?`?`Command`:void 0,summary:`${e.record.requester.displayName} wants to run this outside the sandbox, as you.`,facts:dt(f),details:dt(m)},always:p===void 0?void 0:ut(p,Math.max(12,n-5)),confirmation:o?{title:`Always allow “${a}” in this project?`,body:ut(t.alwaysAllowCoverage??`Any Workspace Agent here can then run \`${a} …\` without asking.`,Math.max(12,(n-8)*2-2))}:void 0,confirmWarning:o?t.risk?.summary:void 0,confirmYes:o?`Always allow “${a}” and run it now`:void 0}}function gt(e,t,n){let r=Math.min(n.width,60);return t===void 0?mt(e,n.now):ht(e,t,r,n.home,n.now)}function _t(e,t){switch(e){case`stale-revision`:case`already-answered`:return`This request changed. Look again before answering.`;case`expired`:return`This request expired. Nothing ran.`;case`not-eligible`:if(t===`always-allow`)return`Always allow isn't available for this command. Approve once or deny.`}return`Couldn't answer (${e}). Nothing ran.`}var vt=`Couldn't send your answer. It may not have been recorded.`;async function yt(e,t){let{view:n,source:r}=t,i=gt(n,r.review,{width:t.width,home:t.home,now:t.now}),a=n.record;try{let n,o,s=!1;for(;n===void 0;){let c=await e.prompt({type:`decision`,message:i.content.title,summary:s?`Automatic approval is on for this family.`:i.content.summary,facts:i.content.facts?.map(e=>({...e})),body:i.content.body,bodyLabel:i.content.bodyLabel,details:i.content.details?.map(e=>({...e})),options:[{value:`approve`,label:`Approve once`},...i.always===void 0?[]:[{value:`always`,label:i.always}],...r.family===void 0||s?[]:[{value:`family`,label:r.family.label}],{value:`deny`,label:`Deny`}],other:{label:`Deny and say why…`,placeholder:`A short reason for the Agent (optional)`,maxLength:t.noteLimit,blank:`deny`}});if(!t.stillCurrent())return{kind:`abandoned`};if(c.text!==void 0)o=c.text.trim()||void 0,n=`deny`;else if(c.selected[0]===`always`){let r=i.confirmation,a=await e.prompt({type:`decision`,message:r?.title??i.content.title,summary:i.confirmWarning,body:r?.body,options:[{value:`back`,label:`Back`},{value:`always-allow`,label:i.confirmYes??`Always allow`}],escape:`back`});if(!t.stillCurrent())return{kind:`abandoned`};a.selected[0]===`always-allow`&&(n=`always-allow`)}else if(c.selected[0]===`family`&&r.family!==void 0){let n=await e.prompt({type:`decision`,message:`${r.family.label}?`,summary:`Later ${a.module} requests that ${a.access===`write`?`change data in Fungi`:`reach outside Fungi`} will run without asking.`,options:[{value:`back`,label:`Back`},{value:`family`,label:r.family.label}],escape:`back`});if(!t.stillCurrent()||n.selected[0]===`family`&&(s=await r.family.enable(),!t.stillCurrent()))return{kind:`abandoned`}}else c.selected[0]===`approve`?n=`approve`:c.selected[0]===`deny`&&(n=`deny`)}let c={recordId:a.recordId,decision:n,expectedRevision:a.revision},l=await r.answer(o===void 0?c:{...c,denialNote:o});return t.stillCurrent()?l.kind===`refused`?{kind:`refused`,message:_t(l.reason??`unknown`,n)}:{kind:`answered`}:{kind:`abandoned`}}catch(n){return e.signal.aborted?{kind:`abandoned`}:(t.onFailure(n),{kind:`refused`,message:vt})}}var bt=()=>void 0,xt=()=>()=>void 0;function St(e){let{source:t,store:n,enabled:r,home:i,width:a,noteLimit:o,onFailure:s}=e,c=(0,H.useRef)(s);c.current=s;let l=(0,H.useRef)({home:i,width:a,noteLimit:o});l.current={home:i,width:a,noteLimit:o};let u=(0,H.useSyncExternalStore)(t?.subscribe??xt,t?.snapshot??bt),d=(0,H.useRef)(u);d.current=u;let f=u===void 0?void 0:JSON.stringify([`approval`,u.record.recordId,u.record.revision,u.canAnswer]);(0,H.useEffect)(()=>{let e=d.current;if(!r||t===void 0||e===void 0||!e.canAnswer||f===void 0)return;let{home:i,width:a,noteLimit:o}=l.current,s=ke({title:`Approval`}),u=s.begin(),p=()=>{let n=t.snapshot();return!u.interaction.signal.aborted&&n?.record.recordId===e.record.recordId&&n.record.revision===e.record.revision&&n.canAnswer},m=n.awaiting.add({key:f,kind:`approval`,arrivedAt:Date.now(),host:s});return yt(u.interaction,{view:e,source:t,home:i,width:a,now:Date.now(),noteLimit:o,stillCurrent:p,onFailure:e=>{c.current(e)}}).then(e=>{e.kind===`refused`?u.settle({status:`failed`,message:e.message}):(m(),u.settle(e.kind===`answered`?{status:`handled`}:{status:`cancelled`}))}),()=>{m(),s.cancel()}},[t,f,r,n])}var K=pe(e=>Pe.safeParse(e).success,{representation:{id:`@fungi.computer/whistle/catalog-step/v1`,payload:null}});oe(()=>Se());var q=k.pipe(C(D(1)),C(z(4e3)),C(T(/\S/u,{message:`Goal objective is blank`}))),Ct=k.pipe(C(D(1)),C(z(1e3)),C(T(/\S/u))),wt=k.pipe(C(D(1)),C(z(256))),Tt=N.check(M(0)),Et=b({kind:P([`person`,`delegator`,`blocked`,`stalled`,`cancelled`,`failed`,`no-terminal`]),detail:O(k)}),J=b({revision:k,objective:q,state:P([`active`,`paused`]),startedAt:Tt,pauseCause:O(Et)}),Dt=b({sequence:N.check(xe(0)),objective:q,outcome:P([`achieved`,`cleared`]),reason:O(Ct),clearedBy:w(_e.check(z(256))),endedAt:Tt,afterSequence:N.check(M(0))}),Ot=E([b({action:F(`set`),objective:q,requestId:wt,expectedRevision:S(O(k)),confirmed:S(L)}),b({action:P([`pause`,`resume`,`replace`,`clear`,`clear-ask`]),confirmed:S(L)}),b({})]),kt=b({goal:O(J),ended:R(Dt).check(z(16)),omitted:N.check(M(0))}),At={id:I.make(`botanical-session-goal`),commands:{controlAgent:{scope:`session`,input:b({action:P([`pause`,`resume`,`clear`]),reason:Ct}),output:E([b({result:F(`paused`),goal:J}),b({result:F(`resumed`),goal:J}),b({result:F(`cleared`)}),b({result:F(`no_goal`)}),b({result:F(`refused`),reason:P([`not_delegator`,`not_paused_by_delegator`])})])},goal:{scope:`session`,input:Ot,output:K},pause:{scope:`session`,input:b({}),output:J},resume:{scope:`session`,input:b({}),output:J},clear:{scope:`session`,input:b({}),output:b({})},set:{scope:`session`,input:b({objective:q,expectedRevision:O(k),requestId:wt,adoptCommandId:w(wt)}),output:b({goal:J,accepted:b({status:F(`accepted`),commandId:k})})}},projection:{schema:kt}},Y=e=>{let t=e.replace(/\s+/gu,` `).trim();return t.length<=80?t:`${t.slice(0,79)}…`},jt=e=>{let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`};function Mt(e){let t=e.state===`active`,n=t?`Pursuing goal since ${jt(e.startedAt)}`:e.pauseCause?.kind===`delegator`?`Goal paused by ${Y(e.pauseCause.detail??`delegator`)} (/goal resume)`:`Goal paused (/goal resume)`,r=!t&&e.pauseCause?.kind!==`delegator`&&e.pauseCause?.detail!=null?[Y(e.pauseCause.detail)]:[],i={id:`goal`,title:[n,Y(e.objective),...r].join(` · `),tone:t?`running`:`muted`,actions:[{id:`goal`,label:t?`Pause goal`:`Resume goal`,input:{action:t?`pause`:`resume`}}]};return Y(e.objective)===e.objective?i:{...i,detail:e.objective.slice(0,1024)}}function Nt(e){let t={id:`goal-ended`,title:`${e.outcome===`achieved`?`Goal achieved`:`Goal cleared`} · ${Y(e.objective)}`,tone:e.outcome===`achieved`?`settled`:`muted`},n=e.reason===null?t:{...t,detail:e.reason};return{id:String(e.sequence),sequence:e.sequence,at:e.endedAt,commandId:null,afterSequence:e.afterSequence,rows:[n]}}var Pt=B(At,{promptPresentation:`footer`,contribute:e=>{if(e.status!==`running`||e.value===null)return{chips:[],panel:[],timeline:{cells:[],omitted:0},waiting:null};let{goal:t,ended:n,omitted:r}=e.value;return{chips:[],panel:t===null?[]:[Mt(t)],timeline:{cells:n.map(Nt),omitted:r},waiting:null}}}),Ft=k.pipe(C(D(1)),C(z(256))),It=k.pipe(C(D(1)),C(z(262144))),Lt=b({expression:k.pipe(C(D(1)),C(z(256))),timeZone:k.pipe(C(D(1)),C(z(128)))}),X=b({loopId:k,origin:P([`human`,`model`]),expiresAt:O(N),prompt:It,mode:P([`self_paced`,`fixed_interval`]),cron:O(Lt),state:P([`active`,`paused`,`finished`,`failed`,`cancelled`]),commandId:k,reason:O(k),nextDueAt:O(N),lastError:O(k),consecutiveFailures:N.pipe(C(M(0)))}),Rt=b({after:w(Ft),limit:w(N.pipe(C(ve({minimum:1,maximum:64}))))}),zt=k.pipe(C(D(1)),C(z(200))),Bt=b({loop:X,accepted:b({status:F(`accepted`),commandId:k})}),Vt=E([b({action:F(`start`),text:It,requestId:zt}),b({action:P([`status`,`pause`,`resume`,`stop`,`stop-ask`,`new`]),confirmed:S(L)}),b({})]),Ht=b({loop:X}),Ut=b({sessionId:Ft,loopId:X.fields.loopId}),Wt={id:I.make(`botanical-session-loop`),commands:{list:{scope:`agent`,input:Rt,output:R(b({...X.fields,sessionId:Ft})).pipe(C(z(64)))},pauseLoop:{scope:`agent`,input:Ut,output:X},resumeLoop:{scope:`agent`,input:Ut,output:X},stopLoop:{scope:`agent`,input:Ut,output:X},loop:{scope:`session`,input:Vt,output:K},startSelfPaced:{scope:`session`,input:b({prompt:It,requestId:zt}),output:Bt},startFixedInterval:{scope:`session`,input:b({prompt:It,requestId:zt,...Lt.fields}),output:Bt},pause:{scope:`session`,input:b({}),output:X},resume:{scope:`session`,input:b({}),output:X},stop:{scope:`session`,input:b({}),output:X}},projection:{schema:Ht}},Gt=e=>{let t=e.replace(/\s+/gu,` `).trim();return t.length<=60?t:`${t.slice(0,59)}…`},Kt=e=>e.state===`failed`?`error`:e.state===`active`?`running`:e.state===`paused`?`muted`:`settled`,qt=e=>new Intl.DateTimeFormat(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,timeZoneName:`short`}).format(e),Jt=B(Wt,{promptPresentation:`footer`,contribute:e=>{if(e.status!==`running`||e.value===null)return{chips:[],panel:[],timeline:{cells:[],omitted:0},waiting:null};let{loop:t}=e.value,n=t.state===`active`&&t.nextDueAt!==null;return{chips:t.state!==`active`&&t.state!==`paused`?[]:[{id:`loop`,order:2,row:{id:`loop`,title:`Loop ${t.mode===`self_paced`?`self-paced`:`fixed`}${n?` (waiting)`:``}`,tone:Kt(t)}}],panel:[{id:`loop`,title:`Loop · ${t.state} · ${t.mode===`self_paced`?`self-paced`:`${t.cron?.expression??`fixed`} ${t.cron?.timeZone??``}`}${t.nextDueAt===null?``:` · Next ${qt(t.nextDueAt)}`} · ${Gt(t.prompt)}`,detail:[t.reason,t.prompt].filter(e=>e!==null).join(`
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Br as t,D as n,Hr as r,Li as i,Pi as a,Rr as o,Si as s,Tr as c,Vr as l,Wr as u,_ as d,d as f,ft as p,jr as m,l as ee,zr as te}from"./sigil-C6HEWU0G.js";import{Ea as h,Ta as ne,Zi as g,_a as _,ar as v,ba as re,da as ie,fa as ae,ht as oe,ra as se,sr as ce,xa as y,ya as le}from"./Effect-DeiDqvoz.js";import{Ar as ue,Ci as de,Ei as b,Fa as fe,Gi as x,Ia as S,Ii as C,La as w,Li as pe,Ma as T,Mr as me,Ni as E,Oa as D,Pi as he,Si as O,Ti as k,Ui as ge,Zi as A,ba as j,bi as _e,ea as ve,fa as M,fi as N,ga as ye,gi as P,hi as F,i as I,ii as be,la as xe,li as L,oi as Se,pi as Ce,qi as we,si as R,wa as z,wi as Te}from"./extension-hook-GLdZiZGE.js";import{a as Ee,c as De,d as B,i as Oe,l as ke,n as Ae,o as je,r as Me,s as Ne,u as Pe}from"./parakeet-BDnV9wzp.js";import{_ as Fe,g as V,h as Ie,m as Le,p as Re,t as ze,v as Be,y as Ve}from"./index-BWg-K54G.js";var H=e(i(),1),U=s(),W=k.check(D(1),z(256)),He=N.check(M(1),j(2**53-1)),Ue=N.check(M(0),j(2**53-1)),We=P([`write`,`external`]),Ge=b({module:O(W),access:We}),Ke=b({agentId:O(W)}),qe=b({principalId:W,agentId:O(W),sessionId:O(W),displayName:W}),Je=b({title:k.check(D(1),z(512)),inputBytes:N.check(M(0)),inputSha256:k.check(T(/^[a-f0-9]{64}$/))}),Ye=b({kind:F(`pending_approval`),recordId:W,description:Je}),Xe=P([`requested`,`pending`,`approved`,`claimed`,`applied`,`denied`,`expired`,`outcome_unknown`]),Ze=P([`not-found`,`not-eligible`,`already-answered`,`stale-revision`,`expired`,`declined`,`fenced`,`not-granted`,`read-only`,`pending`,`in-flight`,`outcome-unknown`,`identity-conflict`]),Qe=k.check(D(1),z(512),T(/^(?=.*\S)[^\p{Cc}\u2028\u2029]*$/u)),$e=R(b({kind:F(`artifact`),ref:k.check(T(/^sha256:[a-f0-9]{64}$/)),mediaType:F(`image/png`),bytes:N.check(M(1),j(5242880))})).check(z(4)),et=b({recordId:W,requester:qe,module:W,operation:W,access:We,description:Je,evidence:w($e),authorityFence:W,reversibility:P([`reversible`,`irreversible-external`]),state:Xe,by:O(E([b({kind:F(`human`),memberId:W}),b({kind:F(`policy`)})])),reason:O(Ze),denialNote:w(Qe),requestedAt:Ue,expiresAt:Ue,updatedAt:Ue,revision:He}),tt=b({record:et,canAnswer:L,canSetAutoApprove:L});b({state:w(Xe),cursor:w(W),limit:w(N.check(M(1),j(100)))}),b({recordId:W}),b({recordId:W,decision:P([`approve`,`deny`]),expectedRevision:He,denialNote:w(Qe)});var nt=b({scope:Ke,family:Ge,enabled:L}),rt=b({kind:F(`refused`),reason:Ze,denialNote:w(Qe)});x(A(et),{onExcessProperty:`error`}),we(A(et)),x(b({record_json:k})),x(A(Ce)),we(A(Ce)),x(b({input_json:k,output_json:O(k)}));var it=rt,at=b({items:R(tt),nextCursor:O(k)}),ot=E([b({kind:F(`answered`),view:tt}),it]),st=E([b({kind:F(`updated`),rule:nt}),it]),G=e=>Le(ne().transform(t=>x(e,{onExcessProperty:`error`})(t))),ct=Be(`approvals`,1,ae(()=>Ie({list:V(G(at)),get:V(G(O(tt))),answer:V(G(ot)),setAutoApprove:V(G(st))}))),lt=(e,t)=>{if(e.length<=t)return e;let n=Math.max(1,Math.floor((t-1)/2));return`${e.slice(0,n)}…${e.slice(-(t-n-1))}`},ut=(e,t)=>e.length<=t?e:`${e.slice(0,t-1)}…`,dt=e=>e.map(([e,t])=>({label:e,value:t}));function ft(e,t){let{record:n}=e,r=Math.max(0,n.expiresAt-t);return[[`Agent`,`${n.requester.displayName} · ${n.requester.agentId??`none`}`],[`Session`,n.requester.sessionId??`none`],[`Requester`,n.requester.principalId],[`Request`,`${n.module}.${n.operation} · ${n.access}`],[`Input`,`${n.description.inputBytes.toLocaleString()} bytes · SHA-256 ${n.description.inputSha256.slice(0,8)}…${n.description.inputSha256.slice(-6)}`],[`Expires`,`in ${String(Math.floor(r/36e5))} h ${String(Math.floor(r%36e5/6e4))} m`],[`Record`,`${n.recordId} · revision ${String(n.revision)}`]]}function pt(e){return[`Undo`,e.record.reversibility===`irreversible-external`?`Can't be undone`:`Can be undone`]}function mt(e,t){let{record:n}=e;return{content:{title:`Allow ${n.module} · ${n.operation}?`,summary:`${n.requester.displayName} wants to use a connected tool.`,facts:[{label:`Effect`,value:(n.access===`write`?`Changes data in Fungi`:`Changes things outside Fungi`)+(n.reversibility===`irreversible-external`?` · can't be undone`:``)}],details:dt([pt(e),...ft(e,t)])}}}function ht(e,t,n,r,i){let a=t.prefix?.join(` `),o=a!==void 0&&t.alwaysAllowUnavailableReason===void 0,s=t.command,c=`Allow \`${s}\`?`.length<=n?`Allow \`${s}\`?`:`Allow this command?`,l=t.cwd===r?`~`:t.cwd.startsWith(`${r}/`)?`~${t.cwd.slice(r.length)}`:t.cwd,u=Math.max(8,(n-8)*2-2),d=t.justification.length<=u?`“${t.justification}”`:`“${t.justification.slice(0,u-1)}…”`,f=[[`Folder`,lt(l,Math.max(8,n-10))],[`Why`,d]];t.kind===`extension-install`&&f.push([`Note`,`Extensions run inside Fungi with access to every Agent.`]),o&&t.alwaysAllowCoverage!==void 0&&f.push([`Scope`,ut(t.alwaysAllowCoverage,Math.max(8,n-12))]),!o&&t.risk!==void 0&&f.push([`Risk`,t.risk.summary]);let p=o?`Always allow “${lt(a,Math.max(8,n-5-32))}” in this project…`:void 0,m=[[`Command`,s]];return t.argv!==void 0&&m.push([`Arguments`,JSON.stringify(t.argv)]),m.push([`Folder`,t.cwd],[`Runs`,`Outside the sandbox, as you`],pt(e)),!o&&t.alwaysAllowUnavailableReason!==void 0?m.push([`Rule`,t.alwaysAllowUnavailableReason]):t.form===`shell`?m.push([`Rule`,`Shell command: no Always-allow rule can match it.`]):o&&(m.push([`Rule`,`“${a}” would match \`${a} …\` in this project`]),t.alwaysAllowCoverage!==void 0&&m.push([`Coverage`,t.alwaysAllowCoverage])),t.risk!==void 0&&m.push([`Risk`,t.risk.detail]),m.push(...ft(e,i)),{content:{title:c,body:c===`Allow this command?`?s:void 0,bodyLabel:c===`Allow this command?`?`Command`:void 0,summary:`${e.record.requester.displayName} wants to run this outside the sandbox, as you.`,facts:dt(f),details:dt(m)},always:p===void 0?void 0:ut(p,Math.max(12,n-5)),confirmation:o?{title:`Always allow “${a}” in this project?`,body:ut(t.alwaysAllowCoverage??`Any Workspace Agent here can then run \`${a} …\` without asking.`,Math.max(12,(n-8)*2-2))}:void 0,confirmWarning:o?t.risk?.summary:void 0,confirmYes:o?`Always allow “${a}” and run it now`:void 0}}function gt(e,t,n){let r=Math.min(n.width,60);return t===void 0?mt(e,n.now):ht(e,t,r,n.home,n.now)}function _t(e,t){switch(e){case`stale-revision`:case`already-answered`:return`This request changed. Look again before answering.`;case`expired`:return`This request expired. Nothing ran.`;case`not-eligible`:if(t===`always-allow`)return`Always allow isn't available for this command. Approve once or deny.`}return`Couldn't answer (${e}). Nothing ran.`}var vt=`Couldn't send your answer. It may not have been recorded.`;async function yt(e,t){let{view:n,source:r}=t,i=gt(n,r.review,{width:t.width,home:t.home,now:t.now}),a=n.record;try{let n,o,s=!1;for(;n===void 0;){let c=await e.prompt({type:`decision`,message:i.content.title,summary:s?`Automatic approval is on for this family.`:i.content.summary,facts:i.content.facts?.map(e=>({...e})),body:i.content.body,bodyLabel:i.content.bodyLabel,details:i.content.details?.map(e=>({...e})),options:[{value:`approve`,label:`Approve once`},...i.always===void 0?[]:[{value:`always`,label:i.always}],...r.family===void 0||s?[]:[{value:`family`,label:r.family.label}],{value:`deny`,label:`Deny`}],other:{label:`Deny and say why…`,placeholder:`A short reason for the Agent (optional)`,maxLength:t.noteLimit,blank:`deny`}});if(!t.stillCurrent())return{kind:`abandoned`};if(c.text!==void 0)o=c.text.trim()||void 0,n=`deny`;else if(c.selected[0]===`always`){let r=i.confirmation,a=await e.prompt({type:`decision`,message:r?.title??i.content.title,summary:i.confirmWarning,body:r?.body,options:[{value:`back`,label:`Back`},{value:`always-allow`,label:i.confirmYes??`Always allow`}],escape:`back`});if(!t.stillCurrent())return{kind:`abandoned`};a.selected[0]===`always-allow`&&(n=`always-allow`)}else if(c.selected[0]===`family`&&r.family!==void 0){let n=await e.prompt({type:`decision`,message:`${r.family.label}?`,summary:`Later ${a.module} requests that ${a.access===`write`?`change data in Fungi`:`reach outside Fungi`} will run without asking.`,options:[{value:`back`,label:`Back`},{value:`family`,label:r.family.label}],escape:`back`});if(!t.stillCurrent()||n.selected[0]===`family`&&(s=await r.family.enable(),!t.stillCurrent()))return{kind:`abandoned`}}else c.selected[0]===`approve`?n=`approve`:c.selected[0]===`deny`&&(n=`deny`)}let c={recordId:a.recordId,decision:n,expectedRevision:a.revision},l=await r.answer(o===void 0?c:{...c,denialNote:o});return t.stillCurrent()?l.kind===`refused`?{kind:`refused`,message:_t(l.reason??`unknown`,n)}:{kind:`answered`}:{kind:`abandoned`}}catch(n){return e.signal.aborted?{kind:`abandoned`}:(t.onFailure(n),{kind:`refused`,message:vt})}}var bt=()=>void 0,xt=()=>()=>void 0;function St(e){let{source:t,store:n,enabled:r,home:i,width:a,noteLimit:o,onFailure:s}=e,c=(0,H.useRef)(s);c.current=s;let l=(0,H.useRef)({home:i,width:a,noteLimit:o});l.current={home:i,width:a,noteLimit:o};let u=(0,H.useSyncExternalStore)(t?.subscribe??xt,t?.snapshot??bt),d=(0,H.useRef)(u);d.current=u;let f=u===void 0?void 0:JSON.stringify([`approval`,u.record.recordId,u.record.revision,u.canAnswer]);(0,H.useEffect)(()=>{let e=d.current;if(!r||t===void 0||e===void 0||!e.canAnswer||f===void 0)return;let{home:i,width:a,noteLimit:o}=l.current,s=ke({title:`Approval`}),u=s.begin(),p=()=>{let n=t.snapshot();return!u.interaction.signal.aborted&&n?.record.recordId===e.record.recordId&&n.record.revision===e.record.revision&&n.canAnswer},m=n.awaiting.add({key:f,kind:`approval`,arrivedAt:Date.now(),host:s});return yt(u.interaction,{view:e,source:t,home:i,width:a,now:Date.now(),noteLimit:o,stillCurrent:p,onFailure:e=>{c.current(e)}}).then(e=>{e.kind===`refused`?u.settle({status:`failed`,message:e.message}):(m(),u.settle(e.kind===`answered`?{status:`handled`}:{status:`cancelled`}))}),()=>{m(),s.cancel()}},[t,f,r,n])}var K=pe(e=>Pe.safeParse(e).success,{representation:{id:`@fungi.computer/whistle/catalog-step/v1`,payload:null}});oe(()=>Se());var q=k.pipe(C(D(1)),C(z(4e3)),C(T(/\S/u,{message:`Goal objective is blank`}))),Ct=k.pipe(C(D(1)),C(z(1e3)),C(T(/\S/u))),wt=k.pipe(C(D(1)),C(z(256))),Tt=N.check(M(0)),Et=b({kind:P([`person`,`delegator`,`blocked`,`stalled`,`cancelled`,`failed`,`no-terminal`]),detail:O(k)}),J=b({revision:k,objective:q,state:P([`active`,`paused`]),startedAt:Tt,pauseCause:O(Et)}),Dt=b({sequence:N.check(xe(0)),objective:q,outcome:P([`achieved`,`cleared`]),reason:O(Ct),clearedBy:w(_e.check(z(256))),endedAt:Tt,afterSequence:N.check(M(0))}),Ot=E([b({action:F(`set`),objective:q,requestId:wt,expectedRevision:S(O(k)),confirmed:S(L)}),b({action:P([`pause`,`resume`,`replace`,`clear`,`clear-ask`]),confirmed:S(L)}),b({})]),kt=b({goal:O(J),ended:R(Dt).check(z(16)),omitted:N.check(M(0))}),At={id:I.make(`botanical-session-goal`),commands:{controlAgent:{scope:`session`,input:b({action:P([`pause`,`resume`,`clear`]),reason:Ct}),output:E([b({result:F(`paused`),goal:J}),b({result:F(`resumed`),goal:J}),b({result:F(`cleared`)}),b({result:F(`no_goal`)}),b({result:F(`refused`),reason:P([`not_delegator`,`not_paused_by_delegator`])})])},goal:{scope:`session`,input:Ot,output:K},pause:{scope:`session`,input:b({}),output:J},resume:{scope:`session`,input:b({}),output:J},clear:{scope:`session`,input:b({}),output:b({})},set:{scope:`session`,input:b({objective:q,expectedRevision:O(k),requestId:wt,adoptCommandId:w(wt)}),output:b({goal:J,accepted:b({status:F(`accepted`),commandId:k})})}},projection:{schema:kt}},Y=e=>{let t=e.replace(/\s+/gu,` `).trim();return t.length<=80?t:`${t.slice(0,79)}…`},jt=e=>{let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`};function Mt(e){let t=e.state===`active`,n=t?`Pursuing goal since ${jt(e.startedAt)}`:e.pauseCause?.kind===`delegator`?`Goal paused by ${Y(e.pauseCause.detail??`delegator`)} (/goal resume)`:`Goal paused (/goal resume)`,r=!t&&e.pauseCause?.kind!==`delegator`&&e.pauseCause?.detail!=null?[Y(e.pauseCause.detail)]:[],i={id:`goal`,title:[n,Y(e.objective),...r].join(` · `),tone:t?`running`:`muted`,actions:[{id:`goal`,label:t?`Pause goal`:`Resume goal`,input:{action:t?`pause`:`resume`}}]};return Y(e.objective)===e.objective?i:{...i,detail:e.objective.slice(0,1024)}}function Nt(e){let t={id:`goal-ended`,title:`${e.outcome===`achieved`?`Goal achieved`:`Goal cleared`} · ${Y(e.objective)}`,tone:e.outcome===`achieved`?`settled`:`muted`},n=e.reason===null?t:{...t,detail:e.reason};return{id:String(e.sequence),sequence:e.sequence,at:e.endedAt,commandId:null,afterSequence:e.afterSequence,rows:[n]}}var Pt=B(At,{promptPresentation:`footer`,contribute:e=>{if(e.status!==`running`||e.value===null)return{chips:[],panel:[],timeline:{cells:[],omitted:0},waiting:null};let{goal:t,ended:n,omitted:r}=e.value;return{chips:[],panel:t===null?[]:[Mt(t)],timeline:{cells:n.map(Nt),omitted:r},waiting:null}}}),Ft=k.pipe(C(D(1)),C(z(256))),It=k.pipe(C(D(1)),C(z(262144))),Lt=b({expression:k.pipe(C(D(1)),C(z(256))),timeZone:k.pipe(C(D(1)),C(z(128)))}),X=b({loopId:k,origin:P([`human`,`model`]),expiresAt:O(N),prompt:It,mode:P([`self_paced`,`fixed_interval`]),cron:O(Lt),state:P([`active`,`paused`,`finished`,`failed`,`cancelled`]),commandId:k,reason:O(k),nextDueAt:O(N),lastError:O(k),consecutiveFailures:N.pipe(C(M(0)))}),Rt=b({after:w(Ft),limit:w(N.pipe(C(ve({minimum:1,maximum:64}))))}),zt=k.pipe(C(D(1)),C(z(200))),Bt=b({loop:X,accepted:b({status:F(`accepted`),commandId:k})}),Vt=E([b({action:F(`start`),text:It,requestId:zt}),b({action:P([`status`,`pause`,`resume`,`stop`,`stop-ask`,`new`]),confirmed:S(L)}),b({})]),Ht=b({loop:X}),Ut=b({sessionId:Ft,loopId:X.fields.loopId}),Wt={id:I.make(`botanical-session-loop`),commands:{list:{scope:`agent`,input:Rt,output:R(b({...X.fields,sessionId:Ft})).pipe(C(z(64)))},pauseLoop:{scope:`agent`,input:Ut,output:X},resumeLoop:{scope:`agent`,input:Ut,output:X},stopLoop:{scope:`agent`,input:Ut,output:X},loop:{scope:`session`,input:Vt,output:K},startSelfPaced:{scope:`session`,input:b({prompt:It,requestId:zt}),output:Bt},startFixedInterval:{scope:`session`,input:b({prompt:It,requestId:zt,...Lt.fields}),output:Bt},pause:{scope:`session`,input:b({}),output:X},resume:{scope:`session`,input:b({}),output:X},stop:{scope:`session`,input:b({}),output:X}},projection:{schema:Ht}},Gt=e=>{let t=e.replace(/\s+/gu,` `).trim();return t.length<=60?t:`${t.slice(0,59)}…`},Kt=e=>e.state===`failed`?`error`:e.state===`active`?`running`:e.state===`paused`?`muted`:`settled`,qt=e=>new Intl.DateTimeFormat(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,timeZoneName:`short`}).format(e),Jt=B(Wt,{promptPresentation:`footer`,contribute:e=>{if(e.status!==`running`||e.value===null)return{chips:[],panel:[],timeline:{cells:[],omitted:0},waiting:null};let{loop:t}=e.value,n=t.state===`active`&&t.nextDueAt!==null;return{chips:t.state!==`active`&&t.state!==`paused`?[]:[{id:`loop`,order:2,row:{id:`loop`,title:`Loop ${t.mode===`self_paced`?`self-paced`:`fixed`}${n?` (waiting)`:``}`,tone:Kt(t)}}],panel:[{id:`loop`,title:`Loop · ${t.state} · ${t.mode===`self_paced`?`self-paced`:`${t.cron?.expression??`fixed`} ${t.cron?.timeZone??``}`}${t.nextDueAt===null?``:` · Next ${qt(t.nextDueAt)}`} · ${Gt(t.prompt)}`,detail:[t.reason,t.prompt].filter(e=>e!==null).join(`
|
|
2
2
|
`).slice(0,1024),tone:Kt(t)},...t.lastError===null?[]:[{id:`error`,title:t.lastError.slice(0,4096),tone:`error`}]],timeline:{cells:[],omitted:0},waiting:n?{summary:`Waiting until ${qt(t.nextDueAt)}`,cancel:{id:`loop`,label:`stop loop`,input:{action:`stop-ask`}}}:null}}});function Yt(e){return b({nextSequence:N.check(xe(0)),omitted:N.check(M(0)),events:R(b({id:k,sequence:N,at:N,commandId:O(k),event:e}))})}new TextEncoder;var Xt=b({explanation:w(k.pipe(C(z(2e3)))),steps:R(b({step:k.pipe(C(D(1)),C(z(500))),status:P([`pending`,`in_progress`,`completed`])})).pipe(C(z(50)))});Xt.pipe(C(fe(e=>e.steps.filter(e=>e.status===`in_progress`).length<=1||`At most one plan step may be in progress`)));function Zt(e){return e.steps.some(e=>e.status!==`completed`)}var Qt=b({plan:Xt,history:Yt(Xt)}),$t=E([b({action:F(`clear`)}),b({})]),en={id:I.make(`botanical-session-plan`),commands:{plan:{scope:`session`,input:$t,output:K}},projection:{schema:Qt}},tn=e=>{let t=e.steps.findIndex(e=>e.status===`in_progress`),n=e.steps.filter(e=>e.status===`completed`).length;return{title:(t<0?e.steps.find(e=>e.status===`pending`):e.steps[t])?.step??`Plan complete`,detail:`${String(t<0?n:t+1)}/${String(e.steps.length)}`}},nn=e=>e.steps.map((e,t)=>({id:String(t),title:e.step,tone:e.status===`completed`?`settled`:e.status===`in_progress`?`running`:`muted`})),rn=B(en,{contribute:e=>({chips:[],panel:e.status!==`running`||e.value===null||!Zt(e.value.plan)?[]:[{id:`plan`,...tn(e.value.plan),actions:[{id:`plan`,label:`Clear plan`,input:{action:`clear`}}],inspection:{commandId:`plan`,title:`Plan`,rows:nn(e.value.plan)}}],timeline:{cells:[],omitted:0},waiting:null})}),Z=e=>k.check(D(1),z(e),T(/\S/u)),an=b({id:Z(32).check(T(/^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$/u)),header:Z(12),question:Z(1e3),options:R(b({label:Z(60),description:Z(300)})).check(D(2),z(4),fe(e=>new Set(e.map(e=>e.label)).size===e.length||`Option labels must be unique`,{representation:{id:`botanical/ask/unique-option-labels`,payload:null}})),multiple:w(L)}),on=R(an).check(D(1),z(4),fe(e=>new Set(e.map(e=>e.id)).size===e.length||`Question ids must be unique`,{representation:{id:`botanical/ask/unique-question-ids`,payload:null}})),sn=b({askId:k,waitingOn:w(me),escalated:w(ue),questions:on,status:P([`live`,`parked`]),createdAt:de,expiresAt:O(de)}),cn=b({asks:R(sn).check(z(4))}),ln=Z(256),un=Te(an.fields.id,b({selected:R(Z(60)).check(z(4)),text:w(k.check(z(4e3)))})),dn=b({askId:Z(256),requestId:ln,answers:un}),fn=b({askId:Z(256),requestId:ln,note:w(k.check(z(4e3)))}),pn=P([`answered`,`declined`,`withdrawn`,`expired`,`cancelled`,`undeliverable`]),mn=E([b({result:F(`accepted`),via:P([`in_turn`,`follow_up`]),commandId:w(Z(256))}),b({result:F(`closed`),status:pn}),b({result:F(`not_found`)})]),hn=b({result:F(`refused`),reason:F(`not_sender`)}),gn=E([mn,hn]),_n=b({kind:F(`agent`),agentId:Z(256)}),vn=E([b({result:F(`escalated`),to:F(`agent`),waitingOn:me}),b({result:F(`escalated`),to:F(`person`)}),b({result:F(`closed`),status:pn}),b({result:F(`not_found`)}),hn]),yn=b({askId:Z(256),note:S(k.check(z(1e3)))}),bn={askId:dn.fields.askId,requestId:ln,index:de.check(ye(),ve({minimum:0,maximum:3})),answers:un},xn=E([b({stage:F(`decision`),...bn,answer:un.value}),b({askId:dn.fields.askId}),b({})]),Sn={id:I.make(`botanical-session-question`),commands:{answerFlow:{scope:`session`,input:xn,output:K},answer:{scope:`session`,input:dn,output:mn},answerAgent:{scope:`session`,input:dn,output:b({result:gn,answeredBy:_n})},escalateAgent:{scope:`session`,input:yn,output:vn},decline:{scope:`session`,input:fn,output:mn},list:{scope:`session`,input:b({}),output:cn}},projection:{schema:cn}},Cn=B(Sn,{contribute:e=>({chips:[],panel:e.status!==`running`||e.value===null?[]:e.value.asks.map(e=>{let t=e.questions[0],n=`${t?.question??`Question`}${e.questions.length>1?` (+${String(e.questions.length-1)} more)`:``}`,r=t?.options.map(e=>e.label).join(` · `)??``;if(e.escalated!==void 0){let{by:t,reason:i,note:a}=e.escalated;n=`${i===`escalated`?`escalated by ${t.name}`:i===`sender_archived`?`${t.name} archived`:`${t.name} is gone`} · ${n}`,a!==void 0&&(r=`${r}\n${a}`)}return e.waitingOn===void 0?{id:e.askId,title:n,detail:r,tone:`attention`,actions:[{id:`answerFlow`,label:`Answer`,input:{askId:e.askId},awaiting:`question`}]}:{id:e.askId,title:`waiting on ${e.waitingOn.name} · ${n}`,detail:r,tone:`muted`,actions:[{id:`answerFlow`,label:`Answer`,input:{askId:e.askId}}]}}),timeline:{cells:[],omitted:0},waiting:null})}),Q=k.check(D(1),z(256)),wn=P([`escalated`,`sender_archived`,`sender_absent`]),Tn=P([`working`,`waiting_on_agent`,`needs_you`,`idle`,`failed`,`unavailable`]),En=b({agentId:Q,name:Q,sessionId:O(Q),state:Tn,attention:w(k.check(z(200))),waitingOn:w(Q),escalated:w(b({by:Q,reason:wn})),ask:w(b({askId:Q,questions:on}))}),Dn=b({agents:R(En).check(z(16)),more:N.check(M(0)),uncounted:N.check(M(0)),counts:b({working:N.check(M(0)),waiting_on_agent:N.check(M(0)),needs_you:N.check(M(0)),idle:N.check(M(0)),failed:N.check(M(0)),unavailable:N.check(M(0))}),escalated:N.check(M(0)),waitingOn:R(b({name:Q,count:N.check(xe(0))})),escalatedBy:R(b({name:Q,reason:wn,count:N.check(xe(0))})),expanded:L}),On={agentId:Q,sessionId:Q},kn=E(xn.members.map(e=>b({...e.fields,...On}))),An={agents:{scope:`session`,input:b({}),output:K},answerChild:{scope:`session`,input:kn,output:K}},jn={id:I.make(`botanical-session-subagents`),commands:An,projection:{schema:Dn}};function Mn(e){if(e!==void 0)return e.reason===`escalated`?`escalated by ${e.by}`:e.reason===`sender_archived`?`${e.by} archived`:`${e.by} is gone`}var $={working:{label:`working`,tone:`running`,status:`info`},waiting_on_agent:{label:`waiting`,tone:`muted`,status:`neutral`},needs_you:{label:`needs you`,tone:`attention`,status:`warning`},idle:{label:`idle`,tone:`settled`,status:`success`},failed:{label:`failed`,tone:`error`,status:`error`},unavailable:{label:`unavailable`,tone:`muted`,status:`neutral`}};function Nn(e){let t=e.state===`waiting_on_agent`?`waiting on ${e.waitingOn??`its parent`}`:$[e.state].label,n=Mn(e.escalated);return n===void 0?t:`${t} · ${n}`}function Pn(e){let t=$[e.state],n={id:e.agentId,title:`${e.name} · ${Nn(e)}`,tone:t.tone,status:{label:Nn(e),tone:t.status}},r=e.ask?.questions[0]?.question??e.attention,i=r===void 0?n:{...n,detail:r.slice(0,200)};if(e.sessionId===null)return{...i,detail:e.attention??`not messaged yet`};let a={...i,open:{params:[{key:`agent`,value:e.agentId},{key:`session`,value:e.sessionId}]}};if(e.ask===void 0)return a;let o={id:`answerChild`,label:`Answer`,input:{agentId:e.agentId,sessionId:e.sessionId,askId:e.ask.askId}};return{...a,actions:[e.state===`needs_you`?{...o,awaiting:`question`}:o]}}function Fn(e){let t=t=>e.counts[t],n=e.waitingOn.map(({name:e,count:t})=>`${String(t)} waiting on ${e}`),r=e.escalatedBy.map(({name:n,reason:r,count:i})=>{let a=Mn({by:n,reason:r});return e.escalated===t(`needs_you`)&&e.escalatedBy.length===1?a:`${String(i)} ${a}`}),i=r.length===0?`needs you`:`needs you (${r.join(`; `)})`,a=[...[`working`].map(e=>[e,t(e)]).filter(([,e])=>e>0).map(([e,t])=>`${String(t)} ${$[e].label}`),...n,...[`needs_you`,`failed`,`unavailable`].map(e=>[e,t(e)]).filter(([,e])=>e>0).map(([e,t])=>`${String(t)} ${e===`needs_you`?i:$[e].label}`)],o=t(`working`)+t(`needs_you`),s=t(`needs_you`)>0?`attention`:t(`failed`)>0?`error`:t(`working`)>0?`running`:`muted`;return{id:`summary`,title:[`${String(o)} sub-agent${o===1?``:`s`}`,...a,...e.uncounted>0?[`${String(e.uncounted)} not read`]:[],`/agents shows them`].join(` · `),tone:s}}var In=B(jn,{contribute:e=>({chips:[],panel:e.status!==`running`||e.value===null?[]:e.value.agents.length>0&&!e.value.expanded?[Fn(e.value)]:[...e.value.agents.map(Pn),...e.value.more===0&&e.value.uncounted===0?[]:[{id:`more`,title:[...e.value.more===0?[]:[`${String(e.value.more)} more sub-agent${e.value.more===1?``:`s`}`],...e.value.uncounted===0?[]:[`${String(e.value.uncounted)} not read`]].join(` · `),tone:`muted`}]],timeline:{cells:[],omitted:0},waiting:null})});function Ln(e,t){if(e===null||!URL.canParse(t))return!1;let n=new URL(t);return n.protocol!==`https:`||n.hash!==`#team-billing`?!1:(e.openTeamBilling().catch(t=>(console.error(`Chat Billing navigation failed`,t),e.showToast({message:`Billing could not be opened. Please try again.`,tone:`error`}))),!0)}function Rn(e,t){e!==null&&e.showToast({message:t.message,tone:t.variant}).catch(e=>{console.error(`Chat toast failed`,e)})}function zn(e){if(e.name!==`execute`||e.status!==`completed`)return;let t=e.result?.content;if(t?.length!==1||t[0]?.type!==`text`)return;let n=ge(A(he))(t[0].text);if(v(n))return;let r=p.safeParse(n.value);return r.success?r.data.file:void 0}function Bn({item:e,ui:t}){let n=zn(e),[r,i]=(0,H.useState)(!1),[a,o]=(0,H.useState)(!1);if(!n)return null;let s=async()=>{i(!0),o(!1);try{await t.openNavigation(n)}catch(e){console.error(`Chat file navigation failed`,e),o(!0)}finally{i(!1)}};return(0,U.jsxs)(`div`,{className:`px-3 py-2`,children:[(0,U.jsx)(c,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void s(),type:`button`,children:r?`Opening file…`:`Open ${n.path} in Inkcap`}),a?(0,U.jsx)(`p`,{role:`alert`,children:`The file could not be opened. Try again.`}):null]})}var Vn=E([b({kind:F(`compose`),text:k.pipe(C(D(1)),C(z(2e3)))}),b({kind:F(`navigate`),params:R(b({key:k.pipe(C(D(1)),C(z(64))),value:k.pipe(C(z(1024)))})).pipe(C(z(16)))})]);E([b({role:k.pipe(C(D(1)),C(z(80))),intent:Vn}),b({appId:k.pipe(C(D(1)),C(z(128))),intent:Vn})],{mode:`oneOf`});var Hn=re({displayName:y().min(1).max(80).nullable()}).nullable(),Un=Be(`apps.open`,1,ae(()=>Ie({open:Fe,role:V(Le(Hn))}))),Wn=(e,t)=>e.require(Un).open(t);Be(`apps.call`,1,ae(()=>Ie({call:V(Le(ne().transform(e=>a(e))))})));var Gn=_({printId:y().min(1).max(256),destination:re({computerId:y().min(1),path:y().min(1)}),format:g([`png`,`jpeg`,`gif`,`webp`])}),Kn=ie(),qn=se(Kn).or(le(y(),Kn).transform(e=>Object.values(e)));function Jn(e,t){let n=Gn.safeParse(e);if(n.success)return[n.data];if(t>=3)return[];let r=qn.safeParse(e);return r.success?r.data.flatMap(e=>Jn(e,t+1)):[]}var Yn=Kn.transform(e=>Jn(e,0)).pipe(se(Gn).min(1).max(8));function Xn(e){if(e.name!==`execute`||e.status!==`completed`||e.result===void 0)return;let t=e.result.content,n=t.at(0);if(n?.type!==`text`||t.slice(1).some(e=>e.type!==`image`))return;let r=ge(A(he))(n.text);if(v(r))return;let i=Yn.safeParse(r.value);return i.success?i.data:void 0}function Zn(e){return Xn(e)!==void 0}function Qn({printId:e,pictures:t,capabilities:n}){let[r,i]=(0,H.useState)(!1),[a,o]=(0,H.useState)(!1),s=async()=>{i(!0),o(!1);try{await Wn(n,{role:`media`,intent:{kind:`navigate`,params:[{key:`print`,value:e}]}})}catch(e){console.error(`Chat print navigation failed`,e),o(!0)}finally{i(!1)}};return(0,U.jsxs)(`div`,{className:`flex flex-col items-start gap-2 px-3 py-2`,children:[t.map((e,t)=>(0,U.jsx)(`img`,{alt:`Panel saved in Prints`,className:`max-w-full rounded-box`,src:`data:${e.mimeType};base64,${e.data}`,style:{maxHeight:320}},t)),(0,U.jsx)(c,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>void s(),type:`button`,children:r?`Opening Prints…`:`Open in Prints`}),a?(0,U.jsx)(`p`,{role:`alert`,children:`Prints could not be opened. Try again.`}):null]})}function $n({item:e,capabilities:t}){let n=Xn(e);if(n&&t){let r=(e.result?.content??[]).flatMap(e=>e.type===`image`?[e]:[]),i=r.length===n.length;return(0,U.jsx)(U.Fragment,{children:n.map((e,n)=>(0,U.jsx)(Qn,{printId:e.printId,pictures:i?r.slice(n,n+1):n===0?r:[],capabilities:t},e.printId))})}return null}var er=ge(A(Ye),{onExcessProperty:`error`});function tr(e){if(!(e.status!==`completed`||e.result?.isError))for(let t of e.result?.content??[]){if(t.type!==`text`)continue;let e=er(t.text);if(ce(e))return e.value.recordId}}var nr=(0,H.createContext)(void 0);function rr(){return(0,H.useContext)(nr)}var ir=`Couldn't send your answer. It may not have been recorded.`;function ar({recordId:e,attempt:t,capabilities:n,agentId:r,publish:i}){let a=Ne(),[o,s]=(0,H.useState)(),c=(0,H.useRef)(void 0),l=(0,H.useRef)(new Set),u=(0,H.useCallback)(t=>{c.current=t??void 0,s(t),i(e,{view:t,failed:!1});for(let e of l.current)e()},[i,e]);(0,H.useEffect)(()=>{c.current=void 0,s(void 0)},[n]),(0,H.useEffect)(()=>{let t=!0;async function r(){try{let r=await n.require(ct).get({recordId:e});t&&u(r)}catch(n){console.warn(`Grove could not read the approval`,n),t&&i(e,{view:null,failed:!0})}}return r(),()=>{t=!1}},[n,e,t,u,i]);let d=o?.canAnswer===!0&&o.record.state===`pending`,f=o?.canSetAutoApprove===!0,p=o?.record.module,m=o?.record.access;return St({source:(0,H.useMemo)(()=>{if(d)return{snapshot:()=>c.current,subscribe:e=>(l.current.add(e),()=>{l.current.delete(e)}),answer:async e=>{let t=n.require(ct),r=e.decision===`always-allow`?void 0:{recordId:e.recordId,decision:e.decision,expectedRevision:e.expectedRevision};if(r===void 0)return{kind:`refused`,reason:`not-eligible`};let i=await t.answer(e.denialNote===void 0?r:{...r,denialNote:e.denialNote});return i.kind===`answered`&&u(i.view),i},family:!f||p===void 0||m===void 0?void 0:{label:`Always approve this family`,enable:async()=>(await n.require(ct).setAutoApprove({scope:{agentId:r},family:{module:p,access:m},enabled:!0})).kind===`updated`}}},[d,n,r,f,p,m,u]),store:a,enabled:!0,home:``,width:72,noteLimit:512,onFailure:or}),null}function or(e){console.warn(ir,e)}function sr({capabilities:e,agentId:t,children:n}){let r=De(),i=(0,H.useMemo)(()=>{let e=new Set;for(let t of[...r.settled,...r.tail])if(t.kind===`tool_group`)for(let n of t.tools){let t=tr(n);t!==void 0&&e.add(t)}return[...e]},[r.settled,r.tail]),[a,o]=(0,H.useState)(new Map),[s,c]=(0,H.useState)(new Map),l=(0,H.useCallback)((e,t)=>{o(n=>new Map(n).set(e,t))},[]),u=(0,H.useMemo)(()=>({entry:e=>a.get(e),refresh:e=>{c(t=>new Map(t).set(e,(t.get(e)??0)+1))},agentId:t}),[a,t]);return(0,U.jsxs)(nr.Provider,{value:e===void 0?void 0:u,children:[e===void 0?null:i.map(n=>(0,U.jsx)(ar,{recordId:n,attempt:s.get(n)??0,capabilities:e,agentId:t,publish:l},n)),n]})}var cr={requested:`Approval requested.`,pending:`Pending approval.`,approved:`Approved. Waiting to run.`,applied:`Done.`,denied:`Denied.`,expired:`Expired. Nothing ran.`,claimed:`Dispatch in progress.`,outcome_unknown:`Outcome unknown. Check before trying again.`};function lr({view:e,scope:n,onRefresh:i,onAnswer:a}){let{record:s}=e,u=e.canAnswer&&s.state===`pending`;return(0,U.jsxs)(o,{role:`group`,"aria-label":`Approval request`,density:`compact`,children:[(0,U.jsxs)(l,{children:[(0,U.jsxs)(r,{children:[u?`Allow `:``,s.module,` · `,s.operation,u?`?`:``]}),(0,U.jsxs)(`p`,{children:[s.requester.displayName,` wants to use a connected tool.`]})]}),(0,U.jsxs)(te,{className:`min-w-0 space-y-2`,children:[(0,U.jsxs)(`p`,{children:[`Effect`,` `,s.access===`write`?`Changes data in Fungi`:`Changes things outside Fungi`,s.reversibility===`irreversible-external`?` · can't be undone`:``]}),(0,U.jsx)(`p`,{role:`status`,children:u?`Waiting for your answer.`:cr[s.state]}),(0,U.jsxs)(`details`,{children:[(0,U.jsx)(`summary`,{children:`Details`}),(0,U.jsxs)(`p`,{children:[`Requester: `,s.requester.principalId]}),(0,U.jsxs)(`p`,{children:[`Agent: `,s.requester.displayName,` ·`,` `,s.requester.agentId??`none`]}),(0,U.jsxs)(`p`,{children:[`Session: `,s.requester.sessionId??`none`]}),(0,U.jsxs)(`p`,{children:[`Request: `,s.module,`.`,s.operation,` · `,s.access]}),(0,U.jsxs)(`p`,{children:[`Undo:`,` `,s.reversibility===`irreversible-external`?`Can't be undone`:`Can be undone`]}),(0,U.jsxs)(`p`,{children:[`Can answer: `,e.canAnswer?`Yes`:`No`]}),(0,U.jsxs)(`p`,{children:[`Can set auto-approve: `,e.canSetAutoApprove?`Yes`:`No`]}),s.by?.kind===`policy`?(0,U.jsx)(`p`,{children:`Auto-approved by policy`}):null,(0,U.jsx)(`p`,{children:s.description.title}),(0,U.jsxs)(`p`,{className:`break-all`,children:[`Input: `,s.description.inputBytes,` bytes · SHA-256`,` `,s.description.inputSha256]}),(0,U.jsxs)(`p`,{children:[`Record: `,s.recordId,` · revision `,s.revision]}),e.canSetAutoApprove?(0,U.jsxs)(`p`,{children:[`Policy scope:`,` `,n.agentId===null?`whole home`:`agent ${n.agentId}`]}):null]})]}),(0,U.jsxs)(t,{className:`flex flex-wrap gap-2`,children:[u?(0,U.jsx)(c,{variant:`outline`,onClick:a,children:`Answer`}):null,(0,U.jsx)(c,{variant:`ghost`,onClick:i,children:`Refresh approval`})]})]})}function ur({recordId:e}){let t=rr(),n=Ne(),r=t?.entry(e);return t===void 0||r===void 0?null:r.failed?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{role:`alert`,children:`Couldn't load this approval. Try again.`}),(0,U.jsx)(c,{variant:`ghost`,onClick:()=>{t.refresh(e)},children:`Refresh approval`})]}):r.view===null||r.view.record.state===`expired`?null:(0,U.jsx)(lr,{view:r.view,scope:{agentId:t.agentId},onRefresh:()=>{t.refresh(e)},onAnswer:()=>{n.awaiting.focus()}})}var dr=(0,H.forwardRef)(function({heading:e,eyebrow:n,cover:r,action:i,children:a,className:s,...d},f){return(0,U.jsxs)(o,{...d,className:u(`caps-game-share`,s),ref:f,children:[r?(0,U.jsx)(`div`,{className:`caps-game-share-cover`,children:r}):null,(0,U.jsxs)(l,{children:[n,(0,U.jsx)(`h3`,{className:`caps-game-share-heading`,children:e})]}),(0,U.jsx)(te,{className:`gap-sm`,children:a}),(0,U.jsx)(t,{children:(0,U.jsx)(c,{asChild:!0,variant:`primary`,className:`caps-game-share-action`,children:i})})]})});function fr(e){let t=0;return e.map(e=>{let n={...e,offset:t};return t+=e.text.length,n})}function pr({value:e,label:t,fieldLabel:r,displayValue:i,layout:a,title:o,tokens:s,className:l,...p}){let te=(0,H.useId)(),[h,ne]=(0,H.useState)({kind:`ready`}),g=s?s.map(e=>e.text).join(``):e,_=async()=>{ne(await navigator.clipboard.writeText(g).then(()=>({kind:`copied`}),e=>({kind:`failed`,cause:e})))};if(r!==void 0)return(0,U.jsxs)(`div`,{...p,className:u(`caps-copy-field-input`,l),children:[(0,U.jsx)(f,{htmlFor:te,children:r}),(0,U.jsxs)(ee,{children:[(0,U.jsx)(d,{className:`caps-copy-field-control`,"aria-label":r,id:te,onFocus:e=>{e.currentTarget.select()},readOnly:!0,value:i??g}),(0,U.jsx)(c,{onClick:()=>void _(),variant:`outline`,children:h.kind===`copied`?`Copied`:t??`Copy`})]}),h.kind===`failed`?(0,U.jsx)(`span`,{role:`status`,children:`Could not copy. Select the text to copy it.`}):null]});let v=h.kind===`copied`?`Copied`:h.kind===`failed`?`Copy failed`:t??`Copy`;return a===`block`?(0,U.jsxs)(`figure`,{...p,className:u(`caps-copy-field-block`,l),"data-state":h.kind,children:[(0,U.jsxs)(`figcaption`,{className:`caps-copy-field-header`,children:[(0,U.jsx)(`span`,{className:`caps-copy-field-title`,children:o}),(0,U.jsxs)(c,{onClick:()=>void _(),size:`sm`,variant:h.kind===`copied`?`ghost`:`outline`,children:[h.kind===`copied`?(0,U.jsx)(n,{"aria-hidden":`true`,size:15}):(0,U.jsx)(Oe,{"aria-hidden":`true`,size:15}),v]}),(0,U.jsx)(m,{role:`status`,children:h.kind===`copied`?`Copied to the clipboard`:h.kind===`failed`?`Could not copy. Select the code to copy it.`:``})]}),(0,U.jsx)(`pre`,{className:`caps-copy-field-code`,tabIndex:0,children:(0,U.jsx)(`code`,{children:s?fr(s).map(e=>(0,U.jsx)(`span`,{className:`caps-copy-field-token`,"data-kind":e.kind,children:e.text},e.offset)):g})})]}):(0,U.jsxs)(`div`,{...p,className:u(`caps-copy-field`,l),children:[(0,U.jsx)(`code`,{className:`caps-copy-field-value`,children:g}),(0,U.jsxs)(c,{"aria-label":`${v}: ${g}`,onClick:()=>void _(),size:`sm`,variant:`outline`,children:[h.kind===`copied`?(0,U.jsx)(n,{size:15}):(0,U.jsx)(Oe,{size:15}),v]})]})}var mr=_({game:_({title:y().min(1),summary:y(),coverUrl:h().nullable(),shareUrl:h()})});function hr(e){let t=/(?:^|\n)\s*Share:\s*(https?:\/\/[^\s<>]+)/iu.exec(e);if(!t?.[1])return null;let n=t[1].replace(/[.,;!?]+$/u,``);if(!URL.canParse(n))return null;let r=new URL(n);return r.username||r.password||r.hash||r.protocol===`http:`&&![`localhost`,`127.0.0.1`].includes(r.hostname)?null:r.href}function gr(e){return hr(e)?e.split(`
|
|
3
3
|
`).filter(e=>!/^\s*Share:\s*/iu.test(e)).join(`
|
|
4
4
|
`).trim():e}function _r(e){let t=new URL(e),n=/^\/([a-z0-9]+(?:-[a-z0-9]+)*)\/?$/u.exec(t.pathname)?.[1];return!n||t.search?null:new URL(`/api/games/${n}`,t.origin)}function vr({reply:e,previewGame:t}){let n=hr(e),r=n?_r(n):null,{data:i}=Ve({queryKey:Re.of(null,`game-share`,n),enabled:r!==null&&t===void 0,queryFn:async({signal:e})=>{if(!r)return null;let t=await fetch(r,{signal:e});if(!t.ok)return null;let i=mr.safeParse(await t.json());return i.success&&i.data.game.shareUrl===n?i.data.game:null}}),a=t??i;if(!n)return null;let o=new URL(n),s=`${o.host}${o.pathname.replace(/\/$/u,``)}`,c=a?.coverUrl&&r?t?a.coverUrl:new URL(`${r.pathname}/cover`,r.origin).href:null;return(0,U.jsxs)(dr,{"data-game-share-card":`true`,"data-theme":`vishnu`,heading:a?.title??`Your game is ready`,eyebrow:(0,U.jsx)(Me,{tone:`secondary`,variant:`quiet`,children:`Made with your Agent`}),cover:c?(0,U.jsx)(`img`,{alt:`A scene from ${a?.title??`your game`}`,src:c}):null,action:(0,U.jsx)(`a`,{href:n,rel:`noopener noreferrer`,target:`_blank`,children:`Play ↗`}),children:[a?.summary?(0,U.jsx)(`p`,{className:`text-sm`,children:a.summary}):null,(0,U.jsx)(pr,{displayValue:s,fieldLabel:`Share link`,label:`Copy link`,value:n})]})}var yr=[Pt,Jt,rn,Cn,In],br=e=>(0,U.jsx)(vr,{reply:e});function xr({prefill:e,onPrefilled:t}){let n=je(),r=(0,H.useRef)(null);return(0,H.useEffect)(()=>{!e||r.current===e.requestId||(r.current=e.requestId,n.setDraft(e.text),e.send===!0&&n.send(),t())},[n.setDraft,n.send,t,e]),null}function Sr({session:e,draftIdentity:t,connection:n,commands:r,prefill:i=null,onPrefilled:a=()=>void 0,onOpen:o,models:s,autoFocus:c}){let l=n?.ui??null,u=n?.capabilities,d=(0,H.useMemo)(()=>({modelSetup:s===void 0?void 0:{state:s,fix:{label:`Add a model key`,onSelect:()=>{l?.openSetup(`model`).catch(e=>{console.error(`Grove could not open model setup`,e)})}}},starters:ze}),[s,l]),f=(0,H.useCallback)(e=>Ln(l,e),[l]),p=(0,H.useCallback)(e=>{let t=tr(e);return t!==void 0&&u!==void 0?(0,U.jsx)(ur,{recordId:t},t):l?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Bn,{item:e,ui:l}),(0,U.jsx)($n,{item:e,capabilities:u})]}):null},[l,u]),m=(0,H.useCallback)(e=>u!==void 0&&Zn(e),[u]),ee=(0,H.useCallback)(e=>{Rn(l,e)},[l]);return(0,U.jsxs)(Ee,{session:e,draftIdentity:t,clients:yr,authorOf:be,onToast:ee,children:[(0,U.jsx)(xr,{prefill:i,onPrefilled:a}),(0,U.jsx)(sr,{capabilities:u,agentId:t.agentId,children:(0,U.jsx)(Ae,{onLink:f,onOpen:o,hostFacts:d,autoFocus:c,composerActionVariant:`outline`,commands:r,renderAssistantAttachment:br,formatAssistantText:gr,renderToolActions:p,claimsToolMedia:m})})]})}export{Sr as ParakeetConversation};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-hePW80VL.js";import{$ as t,Ct as n,D as r,F as i,G as a,I as o,J as s,K as c,N as l,O as u,P as d,Qr as f,R as p,St as m,V as h,Y as g,Z as _,Zi as v,_ as ee,_a as y,_t as te,a as b,ar as ne,ba as x,bt as re,c as ie,ct as ae,d as oe,da as se,dr as S,dt as ce,et as le,f as C,fa as w,ft as ue,g as T,ga as de,gt as E,h as D,ht as O,i as fe,ir as k,j as A,lt as pe,m as j,mr as me,mt as M,n as he,nr as ge,o as _e,ot as ve,p as N,pa as ye,pr as P,pt as F,qn as be,r as xe,ra as Se,rr as Ce,s as I,sr as we,st as Te,t as Ee,tr as De,tt as Oe,vt as ke,w as Ae,wa as je,wt as L,xa as R,xi as Me,xt as z,y as B}from"./Effect-DeiDqvoz.js";import{$ as Ne,$n as Pe,$r as Fe,$t as Ie,A as Le,An as Re,Ao as ze,At as Be,B as Ve,Ba as V,Bi as He,Bn as Ue,Br as We,Bt as Ge,C as Ke,Ci as qe,Cn as Je,Cr as Ye,Ct as Xe,D as Ze,Di as Qe,Dn as $e,Do as et,Dt as tt,E as nt,Ei as H,En as rt,Er as U,Et as it,F as at,Fa as ot,Fn as st,Fo as ct,Ft as lt,G as ut,Gi as dt,Gn as ft,Gr as pt,Gt as mt,H as ht,Hn as gt,Hr as _t,Ht as vt,I as yt,Ia as bt,Ii as W,In as xt,Io as St,It as Ct,J as wt,Ji as Tt,Jn as Et,Jr as Dt,Jt as Ot,K as kt,Ki as At,Kn as jt,Kt as Mt,L as Nt,La as G,Lo as Pt,Lr as Ft,Lt as It,M as Lt,Ma as Rt,Mi as zt,Mn as Bt,Mo as Vt,Mt as Ht,N as Ut,Ni as Wt,Nn as Gt,No as Kt,Nr as qt,Nt as Jt,O as Yt,Oa as Xt,On as Zt,Oo as Qt,Or as $t,Ot as en,P as tn,Pi as nn,Pn as rn,Po as an,Pr as on,Pt as sn,Q as cn,Qn as ln,Qt as un,R as dn,Rn as fn,Ro as pn,Rr as mn,Rt as hn,S as gn,Sn as _n,Sr as K,St as vn,T as yn,Ti as bn,Tn as xn,Tr as Sn,Tt as Cn,U as wn,Ua as Tn,Un as En,Ur as Dn,Ut as On,V as kn,Va as An,Vn as jn,Vo as Mn,Vt as Nn,W as Pn,Wi as q,Wn as Fn,Wr as In,Wt as Ln,X as Rn,Xi as zn,Xn as Bn,Xr as Vn,Xt as Hn,Y as Un,Yn as Wn,Yr as Gn,Yt as Kn,Z as qn,Za as Jn,Zi as Yn,Zn as Xn,Zt as Zn,_ as Qn,_n as $n,_o as er,_t as tr,a as nr,ai as rr,an as ir,ar,at as or,b as sr,ba as cr,bi as lr,bn as ur,bo as dr,br as fr,bt as pr,c as mr,ci as hr,cn as J,ct as gr,di as _r,dn as vr,do as yr,dt as br,en as xr,er as Sr,et as Cr,fa as wr,fi as Tr,fn as Er,fo as Dr,fr as Or,ft as kr,g as Ar,gi as jr,gn as Mr,go as Nr,gt as Pr,h as Fr,hi as Ir,hn as Lr,ho as Rr,ht as zr,i as Br,ii as Vr,in as Hr,ir as Ur,it as Wr,j as Gr,jn as Kr,jr as qr,jt as Jr,k as Yr,ki as Xr,kn as Zr,ko as Qr,kt as $r,la as ei,li as ti,ln as ni,lr as ri,lt as ii,mi as ai,mn as oi,mo as si,mt as ci,n as li,nn as ui,nr as di,nt as fi,o as pi,oi as mi,on as hi,or as gi,ot as _i,pi as vi,pn as yi,pr as bi,pt as xi,q as Si,qi as Ci,qn as wi,qt as Ti,r as Ei,ri as Di,rn as Oi,rr as ki,rt as Ai,s as ji,si as Mi,sn as Ni,st as Pi,t as Fi,tn as Ii,tr as Li,tt as Ri,un as zi,uo as Bi,ut as Vi,v as Hi,vn as Ui,vo as Wi,vr as Gi,vt as Ki,w as qi,wa as Ji,wi as Yi,wn as Xi,wr as Zi,wt as Qi,x as $i,xn as ea,xr as ta,xt as na,y as ra,yi as ia,yn as aa,yo as oa,yr as sa,yt as ca,z as la,za as ua,zi as da,zn as fa,zo as pa,zt as ma}from"./extension-hook-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-hePW80VL.js";import{$ as t,Ct as n,D as r,F as i,G as a,I as o,J as s,K as c,N as l,O as u,P as d,Qr as f,R as p,St as m,V as h,Y as g,Z as _,Zi as v,_ as ee,_a as y,_t as te,a as b,ar as ne,ba as x,bt as re,c as ie,ct as ae,d as oe,da as se,dr as S,dt as ce,et as le,f as C,fa as w,ft as ue,g as T,ga as de,gt as E,h as D,ht as O,i as fe,ir as k,j as A,lt as pe,m as j,mr as me,mt as M,n as he,nr as ge,o as _e,ot as ve,p as N,pa as ye,pr as P,pt as F,qn as be,r as xe,ra as Se,rr as Ce,s as I,sr as we,st as Te,t as Ee,tr as De,tt as Oe,vt as ke,w as Ae,wa as je,wt as L,xa as R,xi as Me,xt as z,y as B}from"./Effect-DeiDqvoz.js";import{$ as Ne,$n as Pe,$r as Fe,$t as Ie,A as Le,An as Re,Ao as ze,At as Be,B as Ve,Ba as V,Bi as He,Bn as Ue,Br as We,Bt as Ge,C as Ke,Ci as qe,Cn as Je,Cr as Ye,Ct as Xe,D as Ze,Di as Qe,Dn as $e,Do as et,Dt as tt,E as nt,Ei as H,En as rt,Er as U,Et as it,F as at,Fa as ot,Fn as st,Fo as ct,Ft as lt,G as ut,Gi as dt,Gn as ft,Gr as pt,Gt as mt,H as ht,Hn as gt,Hr as _t,Ht as vt,I as yt,Ia as bt,Ii as W,In as xt,Io as St,It as Ct,J as wt,Ji as Tt,Jn as Et,Jr as Dt,Jt as Ot,K as kt,Ki as At,Kn as jt,Kt as Mt,L as Nt,La as G,Lo as Pt,Lr as Ft,Lt as It,M as Lt,Ma as Rt,Mi as zt,Mn as Bt,Mo as Vt,Mt as Ht,N as Ut,Ni as Wt,Nn as Gt,No as Kt,Nr as qt,Nt as Jt,O as Yt,Oa as Xt,On as Zt,Oo as Qt,Or as $t,Ot as en,P as tn,Pi as nn,Pn as rn,Po as an,Pr as on,Pt as sn,Q as cn,Qn as ln,Qt as un,R as dn,Rn as fn,Ro as pn,Rr as mn,Rt as hn,S as gn,Sn as _n,Sr as K,St as vn,T as yn,Ti as bn,Tn as xn,Tr as Sn,Tt as Cn,U as wn,Ua as Tn,Un as En,Ur as Dn,Ut as On,V as kn,Va as An,Vn as jn,Vo as Mn,Vt as Nn,W as Pn,Wi as q,Wn as Fn,Wr as In,Wt as Ln,X as Rn,Xi as zn,Xn as Bn,Xr as Vn,Xt as Hn,Y as Un,Yn as Wn,Yr as Gn,Yt as Kn,Z as qn,Za as Jn,Zi as Yn,Zn as Xn,Zt as Zn,_ as Qn,_n as $n,_o as er,_t as tr,a as nr,ai as rr,an as ir,ar,at as or,b as sr,ba as cr,bi as lr,bn as ur,bo as dr,br as fr,bt as pr,c as mr,ci as hr,cn as J,ct as gr,di as _r,dn as vr,do as yr,dt as br,en as xr,er as Sr,et as Cr,fa as wr,fi as Tr,fn as Er,fo as Dr,fr as Or,ft as kr,g as Ar,gi as jr,gn as Mr,go as Nr,gt as Pr,h as Fr,hi as Ir,hn as Lr,ho as Rr,ht as zr,i as Br,ii as Vr,in as Hr,ir as Ur,it as Wr,j as Gr,jn as Kr,jr as qr,jt as Jr,k as Yr,ki as Xr,kn as Zr,ko as Qr,kt as $r,la as ei,li as ti,ln as ni,lr as ri,lt as ii,mi as ai,mn as oi,mo as si,mt as ci,n as li,nn as ui,nr as di,nt as fi,o as pi,oi as mi,on as hi,or as gi,ot as _i,pi as vi,pn as yi,pr as bi,pt as xi,q as Si,qi as Ci,qn as wi,qt as Ti,r as Ei,ri as Di,rn as Oi,rr as ki,rt as Ai,s as ji,si as Mi,sn as Ni,st as Pi,t as Fi,tn as Ii,tr as Li,tt as Ri,un as zi,uo as Bi,ut as Vi,v as Hi,vn as Ui,vo as Wi,vr as Gi,vt as Ki,w as qi,wa as Ji,wi as Yi,wn as Xi,wr as Zi,wt as Qi,x as $i,xn as ea,xr as ta,xt as na,y as ra,yi as ia,yn as aa,yo as oa,yr as sa,yt as ca,z as la,za as ua,zi as da,zn as fa,zo as pa,zt as ma}from"./extension-hook-GLdZiZGE.js";import{l as ha,m as ga,p as _a}from"./preload-helper-DY31Aviq.js";import{a as va,c as ya,d as ba,f as xa,i as Sa,l as Ca,o as wa,s as Ta,u as Ea}from"./index-BWg-K54G.js";var Da=ua(()=>Qa),Oa=Mi(Da),ka=H({id:lr,payload:vi}),Aa=H({...ka.fields,schemas:bt(Oa)});function ja(e){let t={};for(let[n,r]of Object.entries(e))Jn(r)&&f(t,n,r);return Object.keys(t).length===0?S():P(t)}var Ma=bt(Yi(bn,nn)).pipe(Tt(G(ai),{decode:Bi(),encode:Dr(e=>ne(e)||e.value===void 0?S():ja(e.value))})),Na=ua(()=>Ia),Pa=Mi(Na),Fa={annotations:Ma,checks:Pa},Ia=Wt([H({_tag:V(`Filter`),representation:Aa,annotations:Ma,aborted:ti}),H({_tag:V(`FilterGroup`),representation:bt(Aa),annotations:Ma,checks:ia(Na)})]);function Y(e){return H({_tag:V(e),...Fa})}var La=H({_tag:V(`Declaration`),representation:ka,annotations:Ma,typeParameters:Oa,checks:Pa}),Ra=H({_tag:V(`Suspend`),annotations:Ma,checks:Xr([]),thunk:Da});function za(e,t){return t.pipe(Tt(H({type:V(e),value:t}),{decode:yr(e=>e.value),encode:yr(t=>({type:e,value:t}))}))}var Ba=za(`string`,bn),Va=za(`number`,qe),Ha=H({_tag:V(`Literal`),...Fa,literal:Wt([Ba,za(`number`,_r),za(`bigint`,hr),za(`boolean`,ti)])}),Ua=H({_tag:V(`UniqueSymbol`),...Fa,symbol:Qe}),Wa=H({_tag:V(`Enum`),...Fa,enums:Mi(Xr([bn,Wt([Ba,Va])]))}),Ga=H({_tag:V(`TemplateLiteral`),...Fa,parts:Oa}),Ka=H({isOptional:ti,type:Da,annotations:Ma}),qa=H({_tag:V(`Arrays`),...Fa,elements:Mi(Ka),rest:Oa}),Ja=H({name:Wt([Ba,Va,za(`symbol`,Qe)]),type:Da,isOptional:ti,isMutable:ti,annotations:Ma}),Ya=H({parameter:Da,type:Da}),Xa=H({_tag:V(`Objects`),...Fa,propertySignatures:Mi(Ja),indexSignatures:Mi(Ya)}),Za=H({_tag:V(`Union`),...Fa,types:Oa,options:G(H({mode:G(jr([`anyOf`,`oneOf`]))}))}),Qa=Wt([La,H({_tag:V(`Reference`),$ref:lr}),Ra,Y(`Null`),Y(`Undefined`),Y(`Void`),Y(`Never`),Y(`Unknown`),Y(`Any`),Y(`String`),Y(`Number`),Y(`Boolean`),Y(`BigInt`),Y(`Symbol`),Y(`ObjectKeyword`),Ha,Ua,Wa,Ga,qa,Xa,Za]),$a=Ci(An(H({representation:Da,references:Yi(bn,Da)})));function eo(e){return $a(e)}function to(e){return e.sql.exec(`CREATE TABLE IF NOT EXISTS shiitake_fleet_delegations (
|
|
2
2
|
request_id TEXT PRIMARY KEY, input TEXT NOT NULL, mail TEXT NOT NULL,
|
|
3
3
|
receipt TEXT
|
|
4
4
|
) STRICT`),e.sql.exec(`CREATE TABLE IF NOT EXISTS shiitake_fleet_held_delegations (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{Ba as n,Ea as r,Ga as i,Ha as a,Ia as o,Ja as s,Ka as c,La as l,Ma as u,Pa as d,Qa as f,Ra as p,Ua as m,Va as h,Wa as g,Ya as _,Za as v,Zi as y,_a as b,ba as x,ca as S,da as C,eo as w,fa as T,ga as E,ia as D,ja as ee,la as O,ma as k,oa as A,pa as j,qa as M,ra as N,to as P,wa as F,xa as I,ya as te,za as ne}from"./Effect-DeiDqvoz.js";import{Ei as L,Fa as re,Fr as ie,Gi as ae,Ia as R,Ii as z,Kr as oe,Ln as se,Ni as ce,Oa as le,Ti as ue,Vr as de,_r as fe,gi as pe,hi as me,ki as he,l as ge,li as _e,mo as ve,qr as ye,si as be,wa as xe,wi as Se,zr as Ce}from"./extension-hook-CbGLyQB9.js";import{A as we,D as Te,F as Ee,I as De,M as Oe,N as ke,R as Ae,b as je,d as Me,f as Ne,g as Pe,h as Fe,j as Ie,n as Le,p as Re,v as ze,y as Be,z as Ve}from"./animation-Ca8A_H2p.js";var He=t((e=>{var t=Symbol.for(`react.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.provider`),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.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): 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`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var O=/\/+/g;function k(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function A(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`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+k(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(O,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(O,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+k(s,l);c+=A(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+k(s,l++),c+=A(s,r,i,u,o);else if(s===`object`)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 j(e,t,n){if(e==null)return e;var r=[],i=0;return A(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function M(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var N={current:null},P={transition:null},F={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:P,ReactCurrentOwner:C};function I(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F,e.act=I,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:M}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=P.transition;P.transition={};try{e()}finally{P.transition=t}},e.unstable_act=I,e.useCallback=function(e,t){return N.current.useCallback(e,t)},e.useContext=function(e){return N.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return N.current.useDeferredValue(e)},e.useEffect=function(e,t){return N.current.useEffect(e,t)},e.useId=function(){return N.current.useId()},e.useImperativeHandle=function(e,t,n){return N.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return N.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return N.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return N.current.useMemo(e,t)},e.useReducer=function(e,t,n){return N.current.useReducer(e,t,n)},e.useRef=function(e){return N.current.useRef(e)},e.useState=function(e){return N.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return N.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return N.current.useTransition()},e.version=`18.3.1`})),Ue=t(((e,t)=>{t.exports=He()})),We=C(),Ge=T(()=>S(`status`,[b({status:j(`available`)}).strict(),b({status:j(`unavailable`),reason:I()}).strict()])),Ke=We,qe=T(()=>te(I(),Ke)),Je=e=>Ke.parse(e),Ye=e=>qe.parse(e),Xe=T(()=>b({code:I().min(1).max(160),message:I().min(1).max(512),details:Ke.optional()}).strict()),Ze=e=>Xe.parse(e),Qe=qe,$e=T(()=>I().refine(e=>e.trim().length>0)),et=Ge,tt=T(()=>F([b({type:j(`action`)}).strict(),b({type:j(`custom`),data:qe}).strict(),b({type:j(`choice`),options:N(b({value:Ke,label:$e,description:$e.optional()}))}).strict(),b({type:j(`form`),submitLabel:$e.optional()}).strict(),b({type:j(`confirmation`),message:$e,confirmLabel:$e.optional(),cancelLabel:$e.optional()}).strict()])),nt=T(()=>b({inputSchema:Qe.optional(),outputSchema:Qe.optional(),presentation:tt.optional()}).strict()),rt=T(()=>E().int().refine(e=>Number.isSafeInteger(e))),it=T(()=>b({hint:$e.pipe(I().max(120)),words:N(b({word:I().regex(/^\S{1,64}$/u),description:$e.pipe(I().max(512)).optional(),arguments:qe}).strict()).max(32).optional(),text:b({field:$e.pipe(I().max(120)),arguments:qe,requestIdField:$e.pipe(I().max(120)).optional()}).strict().optional()}).strict().refine(e=>e.words!==void 0||e.text!==void 0,`slash arguments need words or text`)),at=T(()=>b({order:rt.optional()}).strict()),ot=T(()=>b({bindings:b({order:rt.optional(),values:N($e).max(16)}).strict().optional(),agent:b({keybind:$e.optional(),order:rt.optional()}).strict().optional(),help:at.optional(),menu:at.optional(),palette:at.optional(),slash:b({aliases:N($e).max(16),consumesDraft:A().optional(),order:rt.optional(),arguments:it.optional()}).strict().optional()}).strict()),st=T(()=>b({id:$e.refine(e=>!e.includes(`:`)),title:$e,category:$e,description:$e.optional(),projections:ot.optional(),action:nt.optional(),availability:et.optional()}).strict()),ct=e=>st.parse(e),lt=T(()=>b({inputSchema:Qe.optional(),outputSchema:Qe.optional()}).strict()),ut=I().min(1).brand(),dt=T(()=>b({commandId:ut,command:b({namespace:I(),id:I()}).strict(),sourceId:I(),scope:I().optional(),title:I(),category:I(),description:I().optional(),order:E(),availability:Ge,action:lt.optional(),keybind:I().optional()}).strict());N(dt);var ft=8192,B=$e.pipe(I().max(ft)),pt=$e.pipe(I().max(60)),mt=r({protocol:/^https?$/u}),ht=b({label:B,value:B}).strict(),gt={summary:B.optional(),facts:N(ht).max(4).optional(),body:B.optional(),bodyLabel:B.optional(),details:N(ht).max(24).optional()},_t=S(`type`,[b({type:j(`choice`),message:pt,...gt,current:B.optional(),collapsedGroup:B.optional(),options:N(b({value:B,label:B,description:B.optional(),group:B.optional(),destructive:j(!0).optional()}).strict()).min(1).max(256)}).strict(),b({type:j(`text`),message:pt,...gt,placeholder:B.optional(),secret:A().optional()}).strict(),b({type:j(`confirmation`),message:pt,...gt,confirmLabel:B.optional(),cancelLabel:B.optional(),destructive:j(!0).optional()}).strict(),b({type:j(`decision`),message:pt,...gt,options:N(b({value:B,label:B,description:B.optional(),destructive:j(!0).optional()}).strict()).min(1).max(8).refine(e=>new Set(e.map(e=>e.value)).size===e.length,`Decision option values must be unique`),multiple:A().optional(),other:b({label:B,placeholder:B.optional(),maxLength:E().int().min(1).max(ft),blank:B.optional()}).strict().optional(),escape:B.optional()}).strict().refine(e=>[e.escape,e.other?.blank].every(t=>t===void 0||e.options.some(e=>e.value===t)),`A decision's escape and blank answers must be offered options`)]),vt=T(()=>S(`type`,[b({type:j(`info`),message:B,links:N(b({url:mt,label:B.optional()}).strict()).max(16).optional()}).strict(),b({type:j(`progress`),message:B}).strict(),b({type:j(`handoff`),url:mt,code:B.optional(),message:B.optional()}).strict(),b({type:j(`success`),message:B}).strict()])),yt=e=>_t.parse(e),bt=e=>vt.parse(e),xt={decision:e=>{let t=_t.options[3].parse(e),n=new Set(t.options.map(e=>e.value));return b({selected:N(I()).max(t.options.length),text:O($e.pipe(I().max(t.other?.maxLength??1)))}).strict().superRefine((e,r)=>{let i=e=>{r.addIssue({code:`custom`,message:e})};(e.selected.some(e=>!n.has(e))||new Set(e.selected).size!==e.selected.length)&&i(`Pick each offered option at most once`),t.multiple!==!0&&e.selected.length>1&&i(`Pick one option`),e.selected.length===0&&e.text===void 0&&i(`Pick an option or write an answer`),t.other===void 0&&e.text!==void 0&&i(`This decision takes no written answer`),t.multiple!==!0&&e.selected.length>0&&e.text!==void 0&&i(`Pick an option or write an answer, not both`)})},confirmation:e=>(_t.options[2].parse(e),A()),text:e=>(_t.options[1].parse(e),I().max(ft)),choice:e=>{let t=_t.options[0].parse(e);return I().refine(e=>t.options.some(t=>t.value===e))}};function St(e){let t=xt[e.type](e);return e=>{let n=t.safeParse(e);return n.success?{kind:`accepted`,value:n.data}:{kind:`invalid`,cause:n.error}}}var Ct=class extends Error{code;details;constructor(e,t,n){super(t),this.code=e,this.details=n,this.name=`WhistleActionError`}},wt=class extends Error{constructor(){super(`Whistle runtime is closed`),this.name=`WhistleClosedError`}};function Tt(){let e=!1,t=rn,n=[],r=[],i=!1,a=[],o=new Set,s=()=>{for(let e of o)e()};return Object.freeze({close:()=>{e||(e=!0,n=[],a=[],r=[],t=rn,s(),o.clear())},contribute:t=>{if(Pt(t),e)throw new wt;Ft(t,n),It(t,n);let r=Symbol(`whistle-contribution`);Nt(t)||(n=[...n,{contribution:Lt(t),generation:r}],i=!0,s());let a=!0;return tn(o=>{if(!a||e)return;let c={...t,commands:o};Pt(c);let l=n.findIndex(e=>e.generation===r),u=n.filter(e=>e.generation!==r);Ft(c,u),It(c,u);let d=Lt(c);if(Nt(c)){if(l<0)return;n=u}else n=l<0?[...n,{contribution:d,generation:r}]:n.map(e=>e.generation===r?{contribution:d,generation:r}:e);i=!0,s()},()=>{a&&(a=!1,n.find(e=>e.generation===r)!==void 0&&(n=n.filter(e=>e.generation!==r),i=!0,s()))})},execute:async(t,r)=>{if(t.namespace.trim().length===0||t.id.trim().length===0)return{status:`invalid`};if(e)return{status:`closed`};let i=Mt(t,n);if(i===void 0)return{status:`missing`};let o;try{let e=on(i);if(e.status===`unavailable`)return e;let n=a.at(-1)?.presenter;r.interaction===void 0&&n!==void 0&&Et.has(r.origin)&&(o=n({commandId:jt(t.namespace,t.id),title:i.title}));let s={...r,signal:r.signal??new AbortController().signal};o!==void 0&&(s.interaction=o.interaction,s.signal=AbortSignal.any([s.signal,o.interaction.signal]));let c=await i.handler(s);return o?.settle({status:`handled`}),c===void 0?{status:`handled`}:{status:`handled`,result:c}}catch(e){let t=cn(e instanceof Error?e:Error(`Command handler threw a non-Error value`));return o?.settle(o.interaction.signal.aborted?{status:`cancelled`}:{status:`failed`,message:t.message}),{status:`failed`,error:t}}},present:t=>{let n={presenter:t};return e||(a=[...a,n]),()=>{a=a.filter(e=>e!==n)}},snapshot:()=>{if(e)return rn;let a=n.flatMap(e=>e.contribution.commands.map(on));return(i||a.some((e,t)=>!sn(e,r[t])))&&(t=ln(n,a),r=a,i=!1),t},subscribe:t=>e?()=>void 0:(o.add(t),()=>{o.delete(t)})})}var Et=new Set([`browser`,`keyboard`,`menu`,`palette`,`slash`,`terminal`]),Dt=16,Ot=32,kt=64,At=256;function jt(e,t){return ut.parse(`${e}:${t}`)}function Mt(e,t){for(let n of t)if(n.contribution.namespace===e.namespace){for(let t of n.contribution.commands)if(t.id===e.id)return t}}function Nt(e){return e.commands.length===0}function Pt(e){$t(e.sourceId,`source ID`),$t(e.namespace,`namespace`),e.scope!==void 0&&$t(e.scope,`scope`);for(let t of e.commands)Jt(t)}function Ft(e,t){t.find(t=>t.contribution.namespace===e.namespace&&t.contribution.sourceId!==e.sourceId)!==void 0&&nn(`Namespace is already owned by another source`);let n=new Set,r=new Set;for(let i of t){let t=i.contribution.scope===e.scope;for(let e of i.contribution.commands)if(n.add(jt(i.contribution.namespace,e.id)),t)for(let t of e.projections?.slash?.aliases??[])r.add(t)}for(let t of e.commands){let i=jt(e.namespace,t.id);n.has(i)&&nn(`Canonical command ID is already registered`),n.add(i);for(let e of t.projections?.slash?.aliases??[])r.has(e)&&nn(`Slash alias is already registered`),r.add(e)}}function It(e,t){t.length>=kt&&nn(`Live contribution capacity exceeded`),t.reduce((e,t)=>e+t.contribution.commands.length,0)+e.commands.length>At&&nn(`Live command capacity exceeded`)}function Lt(e){let t={sourceId:e.sourceId,namespace:e.namespace,commands:e.commands.map(Rt)};return e.scope===void 0?t:{...t,scope:e.scope}}function Rt(e){let t={id:e.id,title:e.title,category:e.category,handler:e.handler};return e.description!==void 0&&(t.description=e.description),e.action!==void 0&&(t.action=zt(e.action)),e.availability!==void 0&&(t.availability=e.availability),e.projections!==void 0&&(t.projections=Ht(e.projections)),t}function zt(e){let t={};return e.inputSchema!==void 0&&(t.inputSchema=V(e.inputSchema)),e.outputSchema!==void 0&&(t.outputSchema=V(e.outputSchema)),e.presentation!==void 0&&(t.presentation=Vt(e.presentation)),Object.freeze(t)}function V(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Bt(t)])))}function Bt(e){return Array.isArray(e)?Object.freeze(e.map(Bt)):e!==null&&e instanceof Object?Object.freeze(Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Bt(t)]))):e}function Vt(e){switch(e.type){case`action`:return Object.freeze({type:`action`});case`custom`:return Object.freeze({type:`custom`,data:V(e.data)});case`choice`:return Object.freeze({type:`choice`,options:Object.freeze(e.options.map(e=>Object.freeze({...e,value:Bt(e.value)})))});case`form`:return Object.freeze({...e});case`confirmation`:return Object.freeze({...e})}}function Ht(e){let t={};return e.bindings!==void 0&&(t.bindings=Ut(e.bindings)),e.agent!==void 0&&(t.agent=Wt(e.agent)),e.help!==void 0&&(t.help=Gt(e.help.order)),e.menu!==void 0&&(t.menu=Gt(e.menu.order)),e.palette!==void 0&&(t.palette=Gt(e.palette.order)),e.slash!==void 0&&(t.slash=Kt(e.slash)),t}function Ut(e){let t={values:[...e.values]};return e.order!==void 0&&(t.order=e.order),t}function Wt(e){let t={};return e.keybind!==void 0&&(t.keybind=e.keybind),e.order!==void 0&&(t.order=e.order),t}function Gt(e){let t={};return e!==void 0&&(t.order=e),t}function Kt(e){let t={aliases:[...e.aliases]};return e.order!==void 0&&(t.order=e.order),e.consumesDraft!==void 0&&(t.consumesDraft=e.consumesDraft),e.arguments!==void 0&&(t.arguments=qt(e.arguments)),t}function qt(e){let t={hint:e.hint};return e.words!==void 0&&(t.words=Object.freeze(e.words.map(e=>Object.freeze({...e,arguments:V(e.arguments)})))),e.text!==void 0&&(t.text=Object.freeze({...e.text,arguments:V(e.text.arguments)})),Object.freeze(t)}function Jt(e){$t(e.id,`command ID`,!0),$t(e.title,`title`),$t(e.category,`category`),Yt(e.action),Xt(e.projections)}function Yt(e){if(e?.presentation!==void 0)switch(e.presentation.type){case`action`:case`custom`:return;case`choice`:for(let t of e.presentation.options)$t(t.label,`choice label`),t.description!==void 0&&$t(t.description,`choice description`);return;case`form`:e.presentation.submitLabel!==void 0&&$t(e.presentation.submitLabel,`submit label`);return;case`confirmation`:$t(e.presentation.message,`confirmation message`),e.presentation.confirmLabel!==void 0&&$t(e.presentation.confirmLabel,`confirmation label`),e.presentation.cancelLabel!==void 0&&$t(e.presentation.cancelLabel,`cancellation label`)}}function Xt(e){if(e!==void 0){for(let t of[e.bindings,e.palette,e.slash,e.help,e.menu,e.agent])t!==void 0&&en(t.order);if(e.bindings!==void 0&&Qt(e.bindings.values,`binding`),e.slash!==void 0){Qt(e.slash.aliases,`slash alias`);for(let t of e.slash.aliases)/\s/u.test(t)&&nn(`slash alias must not contain whitespace`);Zt(e.slash.arguments)}e.agent?.keybind!==void 0&&$t(e.agent.keybind,`agent keybind`)}}function Zt(e){if(e===void 0)return;$t(e.hint,`argument hint`),e.words===void 0&&e.text===void 0&&nn(`slash arguments need words or text`);let t=new Set;for(let n of e.words??[])$t(n.word,`argument word`),/\s/u.test(n.word)&&nn(`argument word must not contain whitespace`),t.has(n.word)&&nn(`argument word is repeated`),t.add(n.word),n.description!==void 0&&$t(n.description,`argument word description`);t.size>Ot&&nn(`argument word count exceeds 32`),e.text!==void 0&&($t(e.text.field,`argument text field`),e.text.requestIdField!==void 0&&$t(e.text.requestIdField,`request id field`))}function Qt(e,t){e.length>Dt&&nn(`${t} count exceeds 16`);for(let n of e)$t(n,t)}function $t(e,t,n=!1){e.trim().length===0&&nn(`${t} must not be blank`),n&&e.includes(`:`)&&nn(`${t} must not contain a colon`)}function en(e){e!==void 0&&!Number.isSafeInteger(e)&&nn(`order must be a safe integer`)}function tn(e=()=>void 0,t=()=>void 0){return Object.freeze({update:e,dispose:t})}function nn(e){throw Error(e)}var rn=Object.freeze({bindings:Object.freeze([]),palette:Object.freeze([]),slash:Object.freeze([]),help:Object.freeze([]),menu:Object.freeze([]),agent:Object.freeze([])}),an=Object.freeze({status:`available`});function on(e){let t=e.availability?.()??an;return t.status===`available`?an:Object.freeze({status:`unavailable`,reason:t.reason})}function sn(e,t){return e.status===`available`?t?.status===`available`:t?.status===`unavailable`&&e.reason===t.reason}function cn(e){if(e instanceof Ct){let t={code:e.code,message:e.message};return Object.freeze(e.details===void 0?t:{...t,details:Bt(e.details)})}return Object.freeze({code:`command_failed`,message:e.message})}function ln(e,t){let n=[],r=[],i=[],a=[],o=[],s=[],c=0;for(let l of e){let e=l.contribution;for(let l of e.commands){let u=l.projections,d=t[c++]??an;if(u?.bindings!==void 0)for(let t of u.bindings.values)n.push({...gn(e,l,u.bindings.order,d),binding:t});if(u?.palette!==void 0&&r.push({...gn(e,l,u.palette.order,d)}),u?.slash!==void 0)for(let t of u.slash.aliases){let n={...gn(e,l,u.slash.order,d),alias:t};u.slash.consumesDraft!==void 0&&(n={...n,consumesDraft:u.slash.consumesDraft}),u.slash.arguments!==void 0&&(n={...n,arguments:u.slash.arguments}),i.push(n)}u?.help!==void 0&&a.push({...gn(e,l,u.help.order,d)}),u?.menu!==void 0&&o.push({...gn(e,l,u.menu.order,d)}),u?.agent!==void 0&&s.push(vn(e,l,u.agent,d))}}return pn(n),mn(i),fn(r),fn(a),fn(o),fn(s),Object.freeze({bindings:hn(n),palette:hn(r),slash:hn(i),help:hn(a),menu:hn(o),agent:hn(s)})}var un=new TextEncoder;function dn(e,t){let n=un.encode(e),r=un.encode(t),i=Math.min(n.length,r.length);for(let e=0;e<i;e+=1){let t=n[e]??0,i=r[e]??0;if(t!==i)return t<i?-1:1}return n.length<r.length?-1:+(n.length>r.length)}function fn(e){e.sort((e,t)=>e.order-t.order||dn(e.commandId,t.commandId))}function pn(e){e.sort((e,t)=>e.order-t.order||dn(e.commandId,t.commandId)||dn(e.binding,t.binding))}function mn(e){e.sort((e,t)=>e.order-t.order||dn(e.commandId,t.commandId)||dn(e.alias,t.alias))}function hn(e){return Object.freeze(e.map(e=>Object.freeze(e)))}function gn(e,t,n,r){let i=_n(e,t,n,r);return e.scope===void 0?i:{...i,scope:e.scope}}function _n(e,t,n,r){let i={commandId:jt(e.namespace,t.id),command:Object.freeze({namespace:e.namespace,id:t.id}),sourceId:e.sourceId,title:t.title,category:t.category,order:n??0,availability:r},a=t.description===void 0?i:{...i,description:t.description};return t.action===void 0?a:{...a,action:t.action}}function vn(e,t,n,r){let i=gn(e,t,n.order,r),a=i.action===void 0?i:{...i,action:yn(i.action)};return n.keybind===void 0?a:{...a,keybind:n.keybind}}function yn(e){let t={};return e.inputSchema!==void 0&&(t.inputSchema=e.inputSchema),e.outputSchema!==void 0&&(t.outputSchema=e.outputSchema),Object.freeze(t)}var bn=t((e=>{var t=Ue(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),xn=t(((e,t)=>{t.exports=bn()})),H=e(Ue(),1),U=xn(),Sn=H.createContext(void 0),Cn=e=>{let t=H.useContext(Sn);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},wn=({client:e,children:t})=>(H.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,U.jsx)(Sn.Provider,{value:e,children:t})),Tn={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},En=new class{#e=Tn;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 Dn(e){setTimeout(e,0)}var On=typeof window>`u`||`Deno`in globalThis;function kn(){}function An(e,t){return typeof e==`function`?e(t):e}function jn(e){return typeof e==`number`&&e>=0&&e!==1/0}function Mn(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Nn(e,t){return typeof e==`function`?e(t):e}function Pn(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==In(o,t.options))return!1}else if(!Rn(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 Fn(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Ln(t.options.mutationKey)!==Ln(a))return!1}else if(!Rn(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function In(e,t){return(t?.queryKeyHashFn||Ln)(e)}function Ln(e){return JSON.stringify(e,(e,t)=>Un(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Rn(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)){for(let n=0;n<t.length;n++)if(!Rn(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Rn(e[r],t[r]))return!1;return!0}return!1}var zn=Object.prototype.hasOwnProperty;function Bn(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Hn(e)&&Hn(t);if(!r&&!(Un(e)&&Un(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:zn.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Bn(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Vn(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 Hn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Un(e){if(!Wn(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Wn(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Wn(e){return Object.prototype.toString.call(e)===`[object Object]`}function Gn(e){return new Promise(t=>{En.setTimeout(t,e)})}function Kn(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Bn(e,t)}function qn(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Jn(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Yn=Symbol();function Xn(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Yn?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Zn(e,t){return typeof e==`function`?e(...t):!!e}function Qn(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 $n=()=>On,er=()=>$n(),tr=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(){}},nr=new class extends tr{#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`}},rr=Dn;function ir(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=rr,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 ar=ir(),or=new class extends tr{#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 sr(e){return Math.min(1e3*2**e,3e4)}function cr(e){return(e??`online`)!==`online`||or.isOnline()}var lr=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ur(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(kn);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new lr(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>nr.isFocused()&&(e.networkMode===`always`||or.isOnline())&&e.canRun(),p=()=>cr(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{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??(er()?0:3),a=e.retryDelay??sr,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),Gn(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var dr=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),jn(this.gcTime)&&(this.#e=En.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(er()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(En.clearTimeout(this.#e),this.#e=void 0)}};function fr(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=>{Qn(e,()=>t.signal,()=>n=!0)},u=Xn(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?Jn:qn;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?mr:pr,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:pr(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 pr(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 mr(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function hr(e,t){return t?pr(e,t)!=null:!1}function gr(e,t){return!t||!e.getPreviousPageParam?!1:mr(e,t)!=null}var _r=class extends dr{#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=br(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=br(this.options);e.data!==void 0&&(this.setState(yr(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Kn(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(kn).catch(kn):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=>Nn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Yn||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Nn(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:!Mn(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=Xn(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`?fr(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=ur({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof lr&&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 lr){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,...vr(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...yr(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),ar.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function vr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:cr(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function yr(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function br(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 xr=class extends tr{#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),Cr(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wr(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wr(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 Nn(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&&!Vn(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Tr(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Nn(this.options.enabled,this.#t)!==Nn(t.enabled,this.#t)||Nn(this.options.staleTime,this.#t)!==Nn(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Nn(this.options.enabled,this.#t)!==Nn(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 Vn(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(kn)),t}#h(e){return!er()&&Nn(this.options.enabled,this.#t)!==!1&&jn(e)}#g(){this.#b();let e=Nn(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Mn(this.#r.dataUpdatedAt,e)+1;this.#u=En.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=En.setInterval(()=>{(this.options.refetchIntervalInBackground||nr.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(En.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(En.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&&Cr(e,t),o=i&&Tr(e,n,t,r);(a||o)&&(l={...l,...vr(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=Kn(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=Kn(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 g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,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:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Er(e,t),refetch:this.refetch,isEnabled:Nn(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),Vn(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)})})();ar.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 Sr(e,t){return Nn(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Nn(t.retryOnMount,e)!==!1)}function Cr(e,t){return Sr(e,t)||e.state.data!==void 0&&wr(e,t,t.refetchOnMount)}function wr(e,t,n){if(Nn(t.enabled,e)!==!1&&Nn(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Er(e,t)}return!1}function Tr(e,t,n,r){return(e!==t||Nn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Er(e,n)}function Er(e,t){return Nn(t.enabled,e)!==!1&&e.isStaleByTime(Nn(t.staleTime,e))}var Dr=class extends dr{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Or(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=ur({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ar.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Or(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var kr=class extends tr{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Dr({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Ar(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Ar(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Ar(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Ar(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ar.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Fn(t,e))}findAll(e={}){return this.getAll().filter(t=>Fn(e,t))}notify(e){ar.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ar.batch(()=>Promise.all(e.map(e=>e.continue().catch(kn))))}};function Ar(e){return e.options.scope?.id}var jr=class extends tr{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Vn(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Ln(t.mutationKey)!==Ln(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Or();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ar.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Mr=class extends tr{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??In(r,t),a=this.get(i);return a||(a=new _r({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ar.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Pn(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Pn(e,t)):t}notify(e){ar.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ar.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ar.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Nr=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Mr,this.#t=e.mutationCache||new kr,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=nr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=or.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Nn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=An(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ar.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ar.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ar.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=ar.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(kn).catch(kn)}invalidateQueries(e,t={}){return ar.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ar.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(kn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(kn)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Nn(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Nn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(kn).catch(kn)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(kn).catch(kn)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return or.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Ln(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Rn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Ln(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Rn(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=In(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Yn&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function Pr({streamFn:e,refetchMode:t=`reset`,reducer:n=(e,t)=>qn(e,t),initialValue:r=[]}){return async i=>{let a=i.client.getQueryCache().find({queryKey:i.queryKey,exact:!0}),o=!!a&&a.isFetched();o&&t===`reset`&&a.setState({...a.resetState,fetchStatus:`fetching`});let s=r,c=!1,l=await e(Qn({client:i.client,meta:i.meta,queryKey:i.queryKey,pageParam:i.pageParam,direction:i.direction},()=>i.signal,()=>c=!0)),u=o&&t===`replace`;for await(let e of l){if(c)break;u?s=n(s,e):i.client.setQueryData(i.queryKey,t=>n(t===void 0?r:t,e))}return u&&!c&&i.client.setQueryData(i.queryKey,s),i.client.getQueryData(i.queryKey)??r}}function Fr(e){return e}function Ir(e){return e}var Lr=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m){if(n(c)!==null)m=!0,j(x);else{var t=n(l);t!==null&&M(b,t.startTime-e)}}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&M(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function ee(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?O():(S=!1,C=null)}}else S=!1}var O;if(typeof v==`function`)O=function(){v(ee)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=ee,O=function(){A.postMessage(null)}}else O=function(){g(ee,0)};function j(e){C=e,S||(S=!0,O())}function M(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,j(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,M(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,j(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Rr=t(((e,t)=>{t.exports=Lr()})),zr=t((e=>{var t=Ue(),n=Rr();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},f={};function p(e){return l.call(f,e)?!0:l.call(d,e)?!1:u.test(e)?f[e]=!0:(d[e]=!0,!1)}function m(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function h(e,t,n,r){if(t==null||m(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function g(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var _={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){_[e]=new g(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];_[t]=new g(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){_[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){_[e]=new g(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){_[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){_[e]=new g(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){_[e]=new g(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){_[e]=new g(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){_[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)}),_.xlinkHref=new g(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,n,r){var i=_.hasOwnProperty(t)?_[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(h(t,n,i,r)&&(n=null),r||i===null?p(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type!==3&&``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for(`react.element`),C=Symbol.for(`react.portal`),w=Symbol.for(`react.fragment`),T=Symbol.for(`react.strict_mode`),E=Symbol.for(`react.profiler`),D=Symbol.for(`react.provider`),ee=Symbol.for(`react.context`),O=Symbol.for(`react.forward_ref`),k=Symbol.for(`react.suspense`),A=Symbol.for(`react.suspense_list`),j=Symbol.for(`react.memo`),M=Symbol.for(`react.lazy`),N=Symbol.for(`react.offscreen`),P=Symbol.iterator;function F(e){return typeof e!=`object`||!e?null:(e=P&&e[P]||e[`@@iterator`],typeof e==`function`?e:null)}var I=Object.assign,te;function ne(e){if(te===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);te=t&&t[1]||``}return`
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{Ba as n,Ea as r,Ga as i,Ha as a,Ia as o,Ja as s,Ka as c,La as l,Ma as u,Pa as d,Qa as f,Ra as p,Ua as m,Va as h,Wa as g,Ya as _,Za as v,Zi as y,_a as b,ba as x,ca as S,da as C,eo as w,fa as T,ga as E,ia as D,ja as ee,la as O,ma as k,oa as A,pa as j,qa as M,ra as N,to as P,wa as F,xa as I,ya as te,za as ne}from"./Effect-DeiDqvoz.js";import{Ei as L,Fa as re,Fr as ie,Gi as ae,Ia as R,Ii as z,Kr as oe,Ln as se,Ni as ce,Oa as le,Ti as ue,Vr as de,_r as fe,gi as pe,hi as me,ki as he,l as ge,li as _e,mo as ve,qr as ye,si as be,wa as xe,wi as Se,zr as Ce}from"./extension-hook-GLdZiZGE.js";import{A as we,D as Te,F as Ee,I as De,M as Oe,N as ke,R as Ae,b as je,d as Me,f as Ne,g as Pe,h as Fe,j as Ie,n as Le,p as Re,v as ze,y as Be,z as Ve}from"./animation-Ca8A_H2p.js";var He=t((e=>{var t=Symbol.for(`react.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.provider`),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.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): 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`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var O=/\/+/g;function k(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function A(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`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+k(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(O,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(O,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+k(s,l);c+=A(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+k(s,l++),c+=A(s,r,i,u,o);else if(s===`object`)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 j(e,t,n){if(e==null)return e;var r=[],i=0;return A(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function M(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var N={current:null},P={transition:null},F={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:P,ReactCurrentOwner:C};function I(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F,e.act=I,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:M}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=P.transition;P.transition={};try{e()}finally{P.transition=t}},e.unstable_act=I,e.useCallback=function(e,t){return N.current.useCallback(e,t)},e.useContext=function(e){return N.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return N.current.useDeferredValue(e)},e.useEffect=function(e,t){return N.current.useEffect(e,t)},e.useId=function(){return N.current.useId()},e.useImperativeHandle=function(e,t,n){return N.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return N.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return N.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return N.current.useMemo(e,t)},e.useReducer=function(e,t,n){return N.current.useReducer(e,t,n)},e.useRef=function(e){return N.current.useRef(e)},e.useState=function(e){return N.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return N.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return N.current.useTransition()},e.version=`18.3.1`})),Ue=t(((e,t)=>{t.exports=He()})),We=C(),Ge=T(()=>S(`status`,[b({status:j(`available`)}).strict(),b({status:j(`unavailable`),reason:I()}).strict()])),Ke=We,qe=T(()=>te(I(),Ke)),Je=e=>Ke.parse(e),Ye=e=>qe.parse(e),Xe=T(()=>b({code:I().min(1).max(160),message:I().min(1).max(512),details:Ke.optional()}).strict()),Ze=e=>Xe.parse(e),Qe=qe,$e=T(()=>I().refine(e=>e.trim().length>0)),et=Ge,tt=T(()=>F([b({type:j(`action`)}).strict(),b({type:j(`custom`),data:qe}).strict(),b({type:j(`choice`),options:N(b({value:Ke,label:$e,description:$e.optional()}))}).strict(),b({type:j(`form`),submitLabel:$e.optional()}).strict(),b({type:j(`confirmation`),message:$e,confirmLabel:$e.optional(),cancelLabel:$e.optional()}).strict()])),nt=T(()=>b({inputSchema:Qe.optional(),outputSchema:Qe.optional(),presentation:tt.optional()}).strict()),rt=T(()=>E().int().refine(e=>Number.isSafeInteger(e))),it=T(()=>b({hint:$e.pipe(I().max(120)),words:N(b({word:I().regex(/^\S{1,64}$/u),description:$e.pipe(I().max(512)).optional(),arguments:qe}).strict()).max(32).optional(),text:b({field:$e.pipe(I().max(120)),arguments:qe,requestIdField:$e.pipe(I().max(120)).optional()}).strict().optional()}).strict().refine(e=>e.words!==void 0||e.text!==void 0,`slash arguments need words or text`)),at=T(()=>b({order:rt.optional()}).strict()),ot=T(()=>b({bindings:b({order:rt.optional(),values:N($e).max(16)}).strict().optional(),agent:b({keybind:$e.optional(),order:rt.optional()}).strict().optional(),help:at.optional(),menu:at.optional(),palette:at.optional(),slash:b({aliases:N($e).max(16),consumesDraft:A().optional(),order:rt.optional(),arguments:it.optional()}).strict().optional()}).strict()),st=T(()=>b({id:$e.refine(e=>!e.includes(`:`)),title:$e,category:$e,description:$e.optional(),projections:ot.optional(),action:nt.optional(),availability:et.optional()}).strict()),ct=e=>st.parse(e),lt=T(()=>b({inputSchema:Qe.optional(),outputSchema:Qe.optional()}).strict()),ut=I().min(1).brand(),dt=T(()=>b({commandId:ut,command:b({namespace:I(),id:I()}).strict(),sourceId:I(),scope:I().optional(),title:I(),category:I(),description:I().optional(),order:E(),availability:Ge,action:lt.optional(),keybind:I().optional()}).strict());N(dt);var ft=8192,B=$e.pipe(I().max(ft)),pt=$e.pipe(I().max(60)),mt=r({protocol:/^https?$/u}),ht=b({label:B,value:B}).strict(),gt={summary:B.optional(),facts:N(ht).max(4).optional(),body:B.optional(),bodyLabel:B.optional(),details:N(ht).max(24).optional()},_t=S(`type`,[b({type:j(`choice`),message:pt,...gt,current:B.optional(),collapsedGroup:B.optional(),options:N(b({value:B,label:B,description:B.optional(),group:B.optional(),destructive:j(!0).optional()}).strict()).min(1).max(256)}).strict(),b({type:j(`text`),message:pt,...gt,placeholder:B.optional(),secret:A().optional()}).strict(),b({type:j(`confirmation`),message:pt,...gt,confirmLabel:B.optional(),cancelLabel:B.optional(),destructive:j(!0).optional()}).strict(),b({type:j(`decision`),message:pt,...gt,options:N(b({value:B,label:B,description:B.optional(),destructive:j(!0).optional()}).strict()).min(1).max(8).refine(e=>new Set(e.map(e=>e.value)).size===e.length,`Decision option values must be unique`),multiple:A().optional(),other:b({label:B,placeholder:B.optional(),maxLength:E().int().min(1).max(ft),blank:B.optional()}).strict().optional(),escape:B.optional()}).strict().refine(e=>[e.escape,e.other?.blank].every(t=>t===void 0||e.options.some(e=>e.value===t)),`A decision's escape and blank answers must be offered options`)]),vt=T(()=>S(`type`,[b({type:j(`info`),message:B,links:N(b({url:mt,label:B.optional()}).strict()).max(16).optional()}).strict(),b({type:j(`progress`),message:B}).strict(),b({type:j(`handoff`),url:mt,code:B.optional(),message:B.optional()}).strict(),b({type:j(`success`),message:B}).strict()])),yt=e=>_t.parse(e),bt=e=>vt.parse(e),xt={decision:e=>{let t=_t.options[3].parse(e),n=new Set(t.options.map(e=>e.value));return b({selected:N(I()).max(t.options.length),text:O($e.pipe(I().max(t.other?.maxLength??1)))}).strict().superRefine((e,r)=>{let i=e=>{r.addIssue({code:`custom`,message:e})};(e.selected.some(e=>!n.has(e))||new Set(e.selected).size!==e.selected.length)&&i(`Pick each offered option at most once`),t.multiple!==!0&&e.selected.length>1&&i(`Pick one option`),e.selected.length===0&&e.text===void 0&&i(`Pick an option or write an answer`),t.other===void 0&&e.text!==void 0&&i(`This decision takes no written answer`),t.multiple!==!0&&e.selected.length>0&&e.text!==void 0&&i(`Pick an option or write an answer, not both`)})},confirmation:e=>(_t.options[2].parse(e),A()),text:e=>(_t.options[1].parse(e),I().max(ft)),choice:e=>{let t=_t.options[0].parse(e);return I().refine(e=>t.options.some(t=>t.value===e))}};function St(e){let t=xt[e.type](e);return e=>{let n=t.safeParse(e);return n.success?{kind:`accepted`,value:n.data}:{kind:`invalid`,cause:n.error}}}var Ct=class extends Error{code;details;constructor(e,t,n){super(t),this.code=e,this.details=n,this.name=`WhistleActionError`}},wt=class extends Error{constructor(){super(`Whistle runtime is closed`),this.name=`WhistleClosedError`}};function Tt(){let e=!1,t=rn,n=[],r=[],i=!1,a=[],o=new Set,s=()=>{for(let e of o)e()};return Object.freeze({close:()=>{e||(e=!0,n=[],a=[],r=[],t=rn,s(),o.clear())},contribute:t=>{if(Pt(t),e)throw new wt;Ft(t,n),It(t,n);let r=Symbol(`whistle-contribution`);Nt(t)||(n=[...n,{contribution:Lt(t),generation:r}],i=!0,s());let a=!0;return tn(o=>{if(!a||e)return;let c={...t,commands:o};Pt(c);let l=n.findIndex(e=>e.generation===r),u=n.filter(e=>e.generation!==r);Ft(c,u),It(c,u);let d=Lt(c);if(Nt(c)){if(l<0)return;n=u}else n=l<0?[...n,{contribution:d,generation:r}]:n.map(e=>e.generation===r?{contribution:d,generation:r}:e);i=!0,s()},()=>{a&&(a=!1,n.find(e=>e.generation===r)!==void 0&&(n=n.filter(e=>e.generation!==r),i=!0,s()))})},execute:async(t,r)=>{if(t.namespace.trim().length===0||t.id.trim().length===0)return{status:`invalid`};if(e)return{status:`closed`};let i=Mt(t,n);if(i===void 0)return{status:`missing`};let o;try{let e=on(i);if(e.status===`unavailable`)return e;let n=a.at(-1)?.presenter;r.interaction===void 0&&n!==void 0&&Et.has(r.origin)&&(o=n({commandId:jt(t.namespace,t.id),title:i.title}));let s={...r,signal:r.signal??new AbortController().signal};o!==void 0&&(s.interaction=o.interaction,s.signal=AbortSignal.any([s.signal,o.interaction.signal]));let c=await i.handler(s);return o?.settle({status:`handled`}),c===void 0?{status:`handled`}:{status:`handled`,result:c}}catch(e){let t=cn(e instanceof Error?e:Error(`Command handler threw a non-Error value`));return o?.settle(o.interaction.signal.aborted?{status:`cancelled`}:{status:`failed`,message:t.message}),{status:`failed`,error:t}}},present:t=>{let n={presenter:t};return e||(a=[...a,n]),()=>{a=a.filter(e=>e!==n)}},snapshot:()=>{if(e)return rn;let a=n.flatMap(e=>e.contribution.commands.map(on));return(i||a.some((e,t)=>!sn(e,r[t])))&&(t=ln(n,a),r=a,i=!1),t},subscribe:t=>e?()=>void 0:(o.add(t),()=>{o.delete(t)})})}var Et=new Set([`browser`,`keyboard`,`menu`,`palette`,`slash`,`terminal`]),Dt=16,Ot=32,kt=64,At=256;function jt(e,t){return ut.parse(`${e}:${t}`)}function Mt(e,t){for(let n of t)if(n.contribution.namespace===e.namespace){for(let t of n.contribution.commands)if(t.id===e.id)return t}}function Nt(e){return e.commands.length===0}function Pt(e){$t(e.sourceId,`source ID`),$t(e.namespace,`namespace`),e.scope!==void 0&&$t(e.scope,`scope`);for(let t of e.commands)Jt(t)}function Ft(e,t){t.find(t=>t.contribution.namespace===e.namespace&&t.contribution.sourceId!==e.sourceId)!==void 0&&nn(`Namespace is already owned by another source`);let n=new Set,r=new Set;for(let i of t){let t=i.contribution.scope===e.scope;for(let e of i.contribution.commands)if(n.add(jt(i.contribution.namespace,e.id)),t)for(let t of e.projections?.slash?.aliases??[])r.add(t)}for(let t of e.commands){let i=jt(e.namespace,t.id);n.has(i)&&nn(`Canonical command ID is already registered`),n.add(i);for(let e of t.projections?.slash?.aliases??[])r.has(e)&&nn(`Slash alias is already registered`),r.add(e)}}function It(e,t){t.length>=kt&&nn(`Live contribution capacity exceeded`),t.reduce((e,t)=>e+t.contribution.commands.length,0)+e.commands.length>At&&nn(`Live command capacity exceeded`)}function Lt(e){let t={sourceId:e.sourceId,namespace:e.namespace,commands:e.commands.map(Rt)};return e.scope===void 0?t:{...t,scope:e.scope}}function Rt(e){let t={id:e.id,title:e.title,category:e.category,handler:e.handler};return e.description!==void 0&&(t.description=e.description),e.action!==void 0&&(t.action=zt(e.action)),e.availability!==void 0&&(t.availability=e.availability),e.projections!==void 0&&(t.projections=Ht(e.projections)),t}function zt(e){let t={};return e.inputSchema!==void 0&&(t.inputSchema=V(e.inputSchema)),e.outputSchema!==void 0&&(t.outputSchema=V(e.outputSchema)),e.presentation!==void 0&&(t.presentation=Vt(e.presentation)),Object.freeze(t)}function V(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Bt(t)])))}function Bt(e){return Array.isArray(e)?Object.freeze(e.map(Bt)):e!==null&&e instanceof Object?Object.freeze(Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Bt(t)]))):e}function Vt(e){switch(e.type){case`action`:return Object.freeze({type:`action`});case`custom`:return Object.freeze({type:`custom`,data:V(e.data)});case`choice`:return Object.freeze({type:`choice`,options:Object.freeze(e.options.map(e=>Object.freeze({...e,value:Bt(e.value)})))});case`form`:return Object.freeze({...e});case`confirmation`:return Object.freeze({...e})}}function Ht(e){let t={};return e.bindings!==void 0&&(t.bindings=Ut(e.bindings)),e.agent!==void 0&&(t.agent=Wt(e.agent)),e.help!==void 0&&(t.help=Gt(e.help.order)),e.menu!==void 0&&(t.menu=Gt(e.menu.order)),e.palette!==void 0&&(t.palette=Gt(e.palette.order)),e.slash!==void 0&&(t.slash=Kt(e.slash)),t}function Ut(e){let t={values:[...e.values]};return e.order!==void 0&&(t.order=e.order),t}function Wt(e){let t={};return e.keybind!==void 0&&(t.keybind=e.keybind),e.order!==void 0&&(t.order=e.order),t}function Gt(e){let t={};return e!==void 0&&(t.order=e),t}function Kt(e){let t={aliases:[...e.aliases]};return e.order!==void 0&&(t.order=e.order),e.consumesDraft!==void 0&&(t.consumesDraft=e.consumesDraft),e.arguments!==void 0&&(t.arguments=qt(e.arguments)),t}function qt(e){let t={hint:e.hint};return e.words!==void 0&&(t.words=Object.freeze(e.words.map(e=>Object.freeze({...e,arguments:V(e.arguments)})))),e.text!==void 0&&(t.text=Object.freeze({...e.text,arguments:V(e.text.arguments)})),Object.freeze(t)}function Jt(e){$t(e.id,`command ID`,!0),$t(e.title,`title`),$t(e.category,`category`),Yt(e.action),Xt(e.projections)}function Yt(e){if(e?.presentation!==void 0)switch(e.presentation.type){case`action`:case`custom`:return;case`choice`:for(let t of e.presentation.options)$t(t.label,`choice label`),t.description!==void 0&&$t(t.description,`choice description`);return;case`form`:e.presentation.submitLabel!==void 0&&$t(e.presentation.submitLabel,`submit label`);return;case`confirmation`:$t(e.presentation.message,`confirmation message`),e.presentation.confirmLabel!==void 0&&$t(e.presentation.confirmLabel,`confirmation label`),e.presentation.cancelLabel!==void 0&&$t(e.presentation.cancelLabel,`cancellation label`)}}function Xt(e){if(e!==void 0){for(let t of[e.bindings,e.palette,e.slash,e.help,e.menu,e.agent])t!==void 0&&en(t.order);if(e.bindings!==void 0&&Qt(e.bindings.values,`binding`),e.slash!==void 0){Qt(e.slash.aliases,`slash alias`);for(let t of e.slash.aliases)/\s/u.test(t)&&nn(`slash alias must not contain whitespace`);Zt(e.slash.arguments)}e.agent?.keybind!==void 0&&$t(e.agent.keybind,`agent keybind`)}}function Zt(e){if(e===void 0)return;$t(e.hint,`argument hint`),e.words===void 0&&e.text===void 0&&nn(`slash arguments need words or text`);let t=new Set;for(let n of e.words??[])$t(n.word,`argument word`),/\s/u.test(n.word)&&nn(`argument word must not contain whitespace`),t.has(n.word)&&nn(`argument word is repeated`),t.add(n.word),n.description!==void 0&&$t(n.description,`argument word description`);t.size>Ot&&nn(`argument word count exceeds 32`),e.text!==void 0&&($t(e.text.field,`argument text field`),e.text.requestIdField!==void 0&&$t(e.text.requestIdField,`request id field`))}function Qt(e,t){e.length>Dt&&nn(`${t} count exceeds 16`);for(let n of e)$t(n,t)}function $t(e,t,n=!1){e.trim().length===0&&nn(`${t} must not be blank`),n&&e.includes(`:`)&&nn(`${t} must not contain a colon`)}function en(e){e!==void 0&&!Number.isSafeInteger(e)&&nn(`order must be a safe integer`)}function tn(e=()=>void 0,t=()=>void 0){return Object.freeze({update:e,dispose:t})}function nn(e){throw Error(e)}var rn=Object.freeze({bindings:Object.freeze([]),palette:Object.freeze([]),slash:Object.freeze([]),help:Object.freeze([]),menu:Object.freeze([]),agent:Object.freeze([])}),an=Object.freeze({status:`available`});function on(e){let t=e.availability?.()??an;return t.status===`available`?an:Object.freeze({status:`unavailable`,reason:t.reason})}function sn(e,t){return e.status===`available`?t?.status===`available`:t?.status===`unavailable`&&e.reason===t.reason}function cn(e){if(e instanceof Ct){let t={code:e.code,message:e.message};return Object.freeze(e.details===void 0?t:{...t,details:Bt(e.details)})}return Object.freeze({code:`command_failed`,message:e.message})}function ln(e,t){let n=[],r=[],i=[],a=[],o=[],s=[],c=0;for(let l of e){let e=l.contribution;for(let l of e.commands){let u=l.projections,d=t[c++]??an;if(u?.bindings!==void 0)for(let t of u.bindings.values)n.push({...gn(e,l,u.bindings.order,d),binding:t});if(u?.palette!==void 0&&r.push({...gn(e,l,u.palette.order,d)}),u?.slash!==void 0)for(let t of u.slash.aliases){let n={...gn(e,l,u.slash.order,d),alias:t};u.slash.consumesDraft!==void 0&&(n={...n,consumesDraft:u.slash.consumesDraft}),u.slash.arguments!==void 0&&(n={...n,arguments:u.slash.arguments}),i.push(n)}u?.help!==void 0&&a.push({...gn(e,l,u.help.order,d)}),u?.menu!==void 0&&o.push({...gn(e,l,u.menu.order,d)}),u?.agent!==void 0&&s.push(vn(e,l,u.agent,d))}}return pn(n),mn(i),fn(r),fn(a),fn(o),fn(s),Object.freeze({bindings:hn(n),palette:hn(r),slash:hn(i),help:hn(a),menu:hn(o),agent:hn(s)})}var un=new TextEncoder;function dn(e,t){let n=un.encode(e),r=un.encode(t),i=Math.min(n.length,r.length);for(let e=0;e<i;e+=1){let t=n[e]??0,i=r[e]??0;if(t!==i)return t<i?-1:1}return n.length<r.length?-1:+(n.length>r.length)}function fn(e){e.sort((e,t)=>e.order-t.order||dn(e.commandId,t.commandId))}function pn(e){e.sort((e,t)=>e.order-t.order||dn(e.commandId,t.commandId)||dn(e.binding,t.binding))}function mn(e){e.sort((e,t)=>e.order-t.order||dn(e.commandId,t.commandId)||dn(e.alias,t.alias))}function hn(e){return Object.freeze(e.map(e=>Object.freeze(e)))}function gn(e,t,n,r){let i=_n(e,t,n,r);return e.scope===void 0?i:{...i,scope:e.scope}}function _n(e,t,n,r){let i={commandId:jt(e.namespace,t.id),command:Object.freeze({namespace:e.namespace,id:t.id}),sourceId:e.sourceId,title:t.title,category:t.category,order:n??0,availability:r},a=t.description===void 0?i:{...i,description:t.description};return t.action===void 0?a:{...a,action:t.action}}function vn(e,t,n,r){let i=gn(e,t,n.order,r),a=i.action===void 0?i:{...i,action:yn(i.action)};return n.keybind===void 0?a:{...a,keybind:n.keybind}}function yn(e){let t={};return e.inputSchema!==void 0&&(t.inputSchema=e.inputSchema),e.outputSchema!==void 0&&(t.outputSchema=e.outputSchema),Object.freeze(t)}var bn=t((e=>{var t=Ue(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),xn=t(((e,t)=>{t.exports=bn()})),H=e(Ue(),1),U=xn(),Sn=H.createContext(void 0),Cn=e=>{let t=H.useContext(Sn);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},wn=({client:e,children:t})=>(H.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,U.jsx)(Sn.Provider,{value:e,children:t})),Tn={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},En=new class{#e=Tn;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 Dn(e){setTimeout(e,0)}var On=typeof window>`u`||`Deno`in globalThis;function kn(){}function An(e,t){return typeof e==`function`?e(t):e}function jn(e){return typeof e==`number`&&e>=0&&e!==1/0}function Mn(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Nn(e,t){return typeof e==`function`?e(t):e}function Pn(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==In(o,t.options))return!1}else if(!Rn(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 Fn(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Ln(t.options.mutationKey)!==Ln(a))return!1}else if(!Rn(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function In(e,t){return(t?.queryKeyHashFn||Ln)(e)}function Ln(e){return JSON.stringify(e,(e,t)=>Un(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Rn(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)){for(let n=0;n<t.length;n++)if(!Rn(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Rn(e[r],t[r]))return!1;return!0}return!1}var zn=Object.prototype.hasOwnProperty;function Bn(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Hn(e)&&Hn(t);if(!r&&!(Un(e)&&Un(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:zn.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Bn(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Vn(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 Hn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Un(e){if(!Wn(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Wn(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Wn(e){return Object.prototype.toString.call(e)===`[object Object]`}function Gn(e){return new Promise(t=>{En.setTimeout(t,e)})}function Kn(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Bn(e,t)}function qn(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Jn(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Yn=Symbol();function Xn(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Yn?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Zn(e,t){return typeof e==`function`?e(...t):!!e}function Qn(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 $n=()=>On,er=()=>$n(),tr=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(){}},nr=new class extends tr{#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`}},rr=Dn;function ir(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=rr,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 ar=ir(),or=new class extends tr{#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 sr(e){return Math.min(1e3*2**e,3e4)}function cr(e){return(e??`online`)!==`online`||or.isOnline()}var lr=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ur(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(kn);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new lr(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>nr.isFocused()&&(e.networkMode===`always`||or.isOnline())&&e.canRun(),p=()=>cr(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{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??(er()?0:3),a=e.retryDelay??sr,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),Gn(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var dr=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),jn(this.gcTime)&&(this.#e=En.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(er()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(En.clearTimeout(this.#e),this.#e=void 0)}};function fr(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=>{Qn(e,()=>t.signal,()=>n=!0)},u=Xn(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?Jn:qn;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?mr:pr,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:pr(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 pr(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 mr(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function hr(e,t){return t?pr(e,t)!=null:!1}function gr(e,t){return!t||!e.getPreviousPageParam?!1:mr(e,t)!=null}var _r=class extends dr{#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=br(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=br(this.options);e.data!==void 0&&(this.setState(yr(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Kn(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(kn).catch(kn):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=>Nn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Yn||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Nn(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:!Mn(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=Xn(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`?fr(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=ur({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof lr&&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 lr){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,...vr(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...yr(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),ar.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function vr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:cr(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function yr(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function br(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 xr=class extends tr{#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),Cr(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wr(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wr(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 Nn(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&&!Vn(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Tr(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Nn(this.options.enabled,this.#t)!==Nn(t.enabled,this.#t)||Nn(this.options.staleTime,this.#t)!==Nn(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Nn(this.options.enabled,this.#t)!==Nn(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 Vn(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(kn)),t}#h(e){return!er()&&Nn(this.options.enabled,this.#t)!==!1&&jn(e)}#g(){this.#b();let e=Nn(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Mn(this.#r.dataUpdatedAt,e)+1;this.#u=En.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=En.setInterval(()=>{(this.options.refetchIntervalInBackground||nr.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(En.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(En.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&&Cr(e,t),o=i&&Tr(e,n,t,r);(a||o)&&(l={...l,...vr(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=Kn(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=Kn(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 g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,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:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Er(e,t),refetch:this.refetch,isEnabled:Nn(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),Vn(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)})})();ar.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 Sr(e,t){return Nn(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Nn(t.retryOnMount,e)!==!1)}function Cr(e,t){return Sr(e,t)||e.state.data!==void 0&&wr(e,t,t.refetchOnMount)}function wr(e,t,n){if(Nn(t.enabled,e)!==!1&&Nn(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Er(e,t)}return!1}function Tr(e,t,n,r){return(e!==t||Nn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Er(e,n)}function Er(e,t){return Nn(t.enabled,e)!==!1&&e.isStaleByTime(Nn(t.staleTime,e))}var Dr=class extends dr{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Or(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=ur({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ar.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Or(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var kr=class extends tr{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Dr({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Ar(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Ar(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Ar(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Ar(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ar.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Fn(t,e))}findAll(e={}){return this.getAll().filter(t=>Fn(e,t))}notify(e){ar.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ar.batch(()=>Promise.all(e.map(e=>e.continue().catch(kn))))}};function Ar(e){return e.options.scope?.id}var jr=class extends tr{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Vn(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Ln(t.mutationKey)!==Ln(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Or();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ar.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Mr=class extends tr{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??In(r,t),a=this.get(i);return a||(a=new _r({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ar.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Pn(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Pn(e,t)):t}notify(e){ar.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ar.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ar.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Nr=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Mr,this.#t=e.mutationCache||new kr,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=nr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=or.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Nn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=An(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ar.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ar.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ar.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=ar.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(kn).catch(kn)}invalidateQueries(e,t={}){return ar.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ar.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(kn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(kn)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Nn(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Nn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(kn).catch(kn)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(kn).catch(kn)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return or.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Ln(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Rn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Ln(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Rn(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=In(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Yn&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function Pr({streamFn:e,refetchMode:t=`reset`,reducer:n=(e,t)=>qn(e,t),initialValue:r=[]}){return async i=>{let a=i.client.getQueryCache().find({queryKey:i.queryKey,exact:!0}),o=!!a&&a.isFetched();o&&t===`reset`&&a.setState({...a.resetState,fetchStatus:`fetching`});let s=r,c=!1,l=await e(Qn({client:i.client,meta:i.meta,queryKey:i.queryKey,pageParam:i.pageParam,direction:i.direction},()=>i.signal,()=>c=!0)),u=o&&t===`replace`;for await(let e of l){if(c)break;u?s=n(s,e):i.client.setQueryData(i.queryKey,t=>n(t===void 0?r:t,e))}return u&&!c&&i.client.setQueryData(i.queryKey,s),i.client.getQueryData(i.queryKey)??r}}function Fr(e){return e}function Ir(e){return e}var Lr=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m){if(n(c)!==null)m=!0,j(x);else{var t=n(l);t!==null&&M(b,t.startTime-e)}}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&M(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function ee(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?O():(S=!1,C=null)}}else S=!1}var O;if(typeof v==`function`)O=function(){v(ee)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=ee,O=function(){A.postMessage(null)}}else O=function(){g(ee,0)};function j(e){C=e,S||(S=!0,O())}function M(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,j(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,M(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,j(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Rr=t(((e,t)=>{t.exports=Lr()})),zr=t((e=>{var t=Ue(),n=Rr();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},f={};function p(e){return l.call(f,e)?!0:l.call(d,e)?!1:u.test(e)?f[e]=!0:(d[e]=!0,!1)}function m(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function h(e,t,n,r){if(t==null||m(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function g(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var _={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){_[e]=new g(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];_[t]=new g(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){_[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){_[e]=new g(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){_[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){_[e]=new g(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){_[e]=new g(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){_[e]=new g(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){_[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)}),_.xlinkHref=new g(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,n,r){var i=_.hasOwnProperty(t)?_[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(h(t,n,i,r)&&(n=null),r||i===null?p(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type!==3&&``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for(`react.element`),C=Symbol.for(`react.portal`),w=Symbol.for(`react.fragment`),T=Symbol.for(`react.strict_mode`),E=Symbol.for(`react.profiler`),D=Symbol.for(`react.provider`),ee=Symbol.for(`react.context`),O=Symbol.for(`react.forward_ref`),k=Symbol.for(`react.suspense`),A=Symbol.for(`react.suspense_list`),j=Symbol.for(`react.memo`),M=Symbol.for(`react.lazy`),N=Symbol.for(`react.offscreen`),P=Symbol.iterator;function F(e){return typeof e!=`object`||!e?null:(e=P&&e[P]||e[`@@iterator`],typeof e==`function`?e:null)}var I=Object.assign,te;function ne(e){if(te===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);te=t&&t[1]||``}return`
|
|
2
2
|
`+te+e}var L=!1;function re(e,t){if(!e||L)return``;L=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t){if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
|
|
3
3
|
`),a=r.stack.split(`
|
|
4
4
|
`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./models-BM_0GHMS.js";import{r as t}from"./runtime-core-
|
|
1
|
+
import{n as e}from"./models-BM_0GHMS.js";import{r as t}from"./runtime-core-nYZy1jW4.js";function n(){return typeof process>`u`||!(process.versions?.node||process.versions?.bun)?null:process.getBuiltinModule?.(`node:os`)??null}var r=n();function i(){return r?`pi (${r.platform()} ${r.release()}; ${r.arch()})`:`pi (browser)`}var a=class extends Error{},o=[`$ref`,`$defs`,`definitions`,`allOf`,`oneOf`,`patternProperties`,`dependentSchemas`,`dependencies`,`unevaluatedProperties`,`propertyNames`,`contains`,`prefixItems`,`not`,`if`,`then`,`else`];function s(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function c(e){if(!s(e))return!1;let t=typeof e.type==`string`?[e.type]:Array.isArray(e.type)?e.type:[];return t.includes(`object`)||t.includes(`array`)||e.properties!==void 0||e.items!==void 0}function l(e){return s(e)?e.type===`null`||Array.isArray(e.type)&&e.type.includes(`null`)||e.const===null||Array.isArray(e.enum)&&e.enum.includes(null)?!0:Array.isArray(e.anyOf)&&e.anyOf.some(e=>l(e)):!1}function u(e,t){if(!s(e))throw new a(`boolean schemas are unsupported`);for(let t of o)if(e[t]!==void 0)throw new a(`${t} schemas are unsupported`);if(t){for(let[n,r]of Object.entries(e))if(t(n,r))throw new a(`${n}: ${JSON.stringify(r)} is unsupported`)}if(e.anyOf!==void 0){if(!Array.isArray(e.anyOf)||e.anyOf.length===0)throw new a(`anyOf must contain at least one schema`);for(let n of e.anyOf){if(c(n))throw new a(`object and array unions are unsupported`);u(n,t)}}if(e.items!==void 0){if(Array.isArray(e.items))throw new a(`tuple schemas are unsupported`);u(e.items,t)}let n=e.type===`object`;if(e.properties!==void 0&&!n)throw new a(`properties require type object`);if(!n)return;if(e.additionalProperties!==void 0&&e.additionalProperties!==!1)throw new a(`schema-valued or true additionalProperties is unsupported`);if(e.properties!==void 0&&!s(e.properties))throw new a(`object properties must be a schema map`);if(e.required!==void 0&&(!Array.isArray(e.required)||e.required.some(e=>typeof e!=`string`)))throw new a(`object required must be a string array`);let r=e.properties??{},i=Object.keys(r),d=new Set(Array.isArray(e.required)?e.required:[]);if([...d].some(e=>!i.includes(e)))throw new a(`required contains an unknown property`);for(let[e,n]of Object.entries(r))u(n,t),!d.has(e)&&!l(n)&&(r[e]={anyOf:[n,{type:`null`}]});e.required=i,e.additionalProperties=!1}function d(e,t){let n=structuredClone(e);if(!s(n)||(u(n,t),n.type!==`object`))throw new a(`root schema must have type object`);return n}function f(e,t){return t===!0?d(e.parameters):e.parameters}function p(e,t,n){let r=t[n];if(typeof r!=`string`)throw Error(`Grammar tool call "${e}" requires argument "${n}" to be a string.`);return r}function m(e,t,n,r){if(e.closed){if(r&&n===e.input)return;throw Error(`grammar tool input for property "${t}" changed after it was closed`)}if(!n.startsWith(e.input))throw Error(`grammar tool input for property "${t}" changed non-monotonically`);let i=n.slice(e.input.length);if(!r&&i.length===0)return;let a=``;return e.started||=(a+=`{${JSON.stringify(t)}:"`,!0),a+=JSON.stringify(i).slice(1,-1),e.input=n,r&&(a+=`"}`,e.closed=!0),a}function h(e){let t=e.parameters;if(t.type!==`object`)throw Error(`grammar constrained sampling requires an object parameter schema`);if(!Array.isArray(t.required)||t.required.length!==1||typeof t.required[0]!=`string`)throw Error(`grammar constrained sampling requires exactly one required string property`);let n=t.required[0];if(!t.properties?.[n])throw Error(`grammar constrained sampling requires a properties entry for ${n}`);if(t.properties[n]?.type!==`string`)throw Error(`grammar constrained sampling property ${n} must have type string`);return n}function g(e,t,n){let r=e.constrainedSampling;if(!(!r||r.type!==`json_schema`)){if(t)try{return d(e.parameters,n),!0}catch(t){if(!(t instanceof a))throw t;if(r.strict!==`require`)return;throw Error(`Tool "${e.name}" requires JSON-schema constrained sampling, but ${t.message}.`)}if(r.strict===`require`)throw Error(`Tool "${e.name}" requires JSON-schema constrained sampling, but strict tools are unsupported.`)}}function _(e,t){let n=e.constrainedSampling;if(!n||n.type!==`grammar`||!t)return;let r=n.variants.openai_lark,i=n.variants.openai_regex,a=typeof r==`string`&&r.trim().length>0,o=typeof i==`string`&&i.trim().length>0;if(!a&&!o)throw Error(`Tool "${e.name}" cannot use grammar constrained sampling: no supported grammar variant was provided.`);try{return{format:a?`lark`:`regex`,definition:a?r:i,inputProperty:h(e)}}catch(t){let n=t instanceof Error?t.message:String(t);throw Error(`Tool "${e.name}" cannot use grammar constrained sampling: ${n}.`)}}function v(e,t){let n=new Map;for(let r of e??[]){let e=_(r,t);e&&n.set(r.name,e.inputProperty)}return n}var y=4096,b=1;function x(e,n,r){if(e.contextWindow<=0)return Math.max(b,r);let i=e.contextWindow-t(n).tokens-y;return Math.min(r,Math.max(b,i))}function S(t,n,r){let i=e(t,n),a=t.samplingParamsByThinkingLevel?.[i];return t.samplingParams||a||r?{...t.samplingParams,...a,...r}:void 0}function C(e,t,n,r){let i=S(e,n?.reasoning??`off`,n?.samplingParams);return{temperature:n?.temperature,samplingParams:i,maxTokens:x(e,t,n?.maxTokens??e.maxTokens),signal:n?.signal,telemetryContext:n?.telemetryContext,apiKey:r||n?.apiKey,fetch:n?.fetch,transport:n?.transport,cacheRetention:n?.cacheRetention,sessionId:n?.sessionId,headers:n?.headers,onPayload:n?.onPayload,onResponse:n?.onResponse,onProviderStreamEvent:n?.onProviderStreamEvent,timeoutMs:n?.timeoutMs,websocketConnectTimeoutMs:n?.websocketConnectTimeoutMs,maxRetries:n?.maxRetries,maxRetryDelayMs:n?.maxRetryDelayMs,metadata:n?.metadata,env:n?.env}}var w=1024,T={minimal:1024,low:2048,medium:8192,high:16384};function E(e){return e===`xhigh`||e===`max`?`high`:e}function D(e,t){return{...T,...t}[E(e)]}function O(e,t){return Math.min(e,Math.max(0,t-w))}function k(e,t,n,r){let i=D(n,r),a=e===void 0?t:Math.min(e+i,t);return a<=i&&(i=O(i,a)),{maxTokens:a,thinkingBudget:i}}var A=`(image omitted: model does not support images)`,j=`(tool image omitted: model does not support images)`,M=`(image attached after the tool results)`;function N(e){if(!e.isError)return;let t=e.content.filter(e=>e.type===`image`);if(t.length!==0)return{content:P(e.content,M),caption:`Images from the error result of tool call ${e.toolCallId} (${e.toolName}):`,images:t}}function P(e,t){let n=[],r=!1;for(let i of e){if(i.type===`image`){r||n.push({type:`text`,text:t}),r=!0;continue}n.push(i),r=i.text===t}return n}function F(e,t){return t.input.includes(`image`)?e:e.map(e=>e.role===`user`&&Array.isArray(e.content)?{...e,content:P(e.content,A)}:e.role===`toolResult`?{...e,content:P(e.content,j)}:e)}function I(e,t,n){let r=new Map,i=F(e.map(e=>e.content==null?{...e,content:[]}:e),t).map(e=>{if(e.role===`system`||e.role===`user`)return e;if(e.role===`toolResult`){let t=r.get(e.toolCallId);return t&&t!==e.toolCallId?{...e,toolCallId:t}:e}if(e.role===`assistant`){let i=e,a=i.provider===t.provider&&i.api===t.api&&i.model===t.id,o=i.content.flatMap(e=>{if(e.type===`thinking`)return a?e.redacted||e.thinkingSignature?e:!e.thinking||e.thinking.trim()===``?[]:e:[];if(e.type===`text`)return a?e:{type:`text`,text:e.text};if(e.type===`toolCall`){let o=e,s=o;if(!a&&o.thoughtSignature&&(s={...o},delete s.thoughtSignature),!a&&n){let e=n(o.id,t,i);e!==o.id&&(r.set(o.id,e),s={...s,id:e})}return s}return e});return{...i,content:o}}return e}),a=[],o=[],s=new Set,c=[],l=()=>{if(o.length>0){for(let e of o)s.has(e.id)||a.push({role:`toolResult`,toolCallId:e.id,toolName:e.name,content:[{type:`text`,text:`No result provided`}],isError:!0,timestamp:Date.now()});o=[],s=new Set}a.push(...c),c.length=0};for(let e=0;e<i.length;e++){let t=i[e];if(t.role===`assistant`){l();let e=t;if(e.stopReason===`error`||e.stopReason===`aborted`)continue;let n=e.content.filter(e=>e.type===`toolCall`);n.length>0&&(o=n,s=new Set),a.push(t)}else t.role===`toolResult`?(s.add(t.toolCallId),a.push(t)):t.role===`system`?o.length>0?c.push(t):a.push(t):(t.role===`user`&&l(),a.push(t))}return l(),a}export{x as a,D as c,p as d,f,i as h,C as i,m as l,g as m,I as n,O as o,_ as p,k as r,S as s,N as t,v as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{F as t,Li as n,M as r,N as i,P as a,R as o,Si as s,Tr as c,j as l,k as u}from"./sigil-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{F as t,Li as n,M as r,N as i,P as a,R as o,Si as s,Tr as c,j as l,k as u}from"./sigil-C6HEWU0G.js";import{ii as d}from"./extension-hook-GLdZiZGE.js";import{t as f}from"./parakeet-BDnV9wzp.js";var p=e(n(),1),m=s();function h({inbox:e}){let{selected:n,session:s,action:h,canManage:g,openingError:_}=e,[v,y]=(0,p.useState)(null);if((0,p.useEffect)(()=>{y(null)},[n?.bindingId,n?.conversation.sessionId,g]),n===void 0)return null;let b=n.conversation;return(0,m.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":`Website conversation`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-base-300 p-2`,children:[(0,m.jsx)(`span`,{className:`min-w-0 flex-1 text-sm`,children:b.heldByYou?`You're replying. The Agent is paused.`:b.held?`${b.heldByName??`A teammate`} is replying.`:`The Agent is replying. Take over to answer as yourself.`}),g?(0,m.jsx)(c,{size:`sm`,disabled:h.isPending,onClick:()=>{let e={bindingId:n.bindingId,sessionId:b.sessionId};b.heldByYou?h.mutate({kind:`release`,...e,expectedVersion:b.holdVersion,confirm:!1}):b.held?y({...e,version:b.holdVersion,name:b.heldByName??`A teammate`}):h.mutate({kind:`hold`,...e,expectedVersion:b.holdVersion,confirm:!1})},children:b.heldByYou?`Hand back to Agent`:`Take over`}):null]}),(0,m.jsx)(u,{open:v!==null,onOpenChange:e=>{e||y(null)},children:(0,m.jsxs)(r,{children:[(0,m.jsxs)(t,{children:[(0,m.jsxs)(o,{children:[v?.name,` is replying — take over?`]}),(0,m.jsx)(i,{children:`You will reply as yourself. Their replies stop until they take over again.`})]}),(0,m.jsxs)(a,{children:[(0,m.jsx)(l,{render:(0,m.jsx)(c,{variant:`outline`}),children:`Cancel`}),(0,m.jsx)(c,{disabled:h.isPending||!g,onClick:()=>{v!==null&&(h.mutate({kind:`hold`,bindingId:v.bindingId,sessionId:v.sessionId,expectedVersion:v.version,confirm:!0}),y(null))},children:`Take over`})]})]})}),g?null:(0,m.jsx)(`p`,{className:`p-3 text-sm`,children:`Allow takeover in Grove's App permissions to reply. Your Team permissions still apply.`}),h.isError?(0,m.jsx)(`p`,{role:`alert`,className:`p-2 text-sm text-error`,children:`This conversation changed or website access was removed. Refresh and try again.`}):null,_?(0,m.jsx)(`p`,{role:`alert`,className:`p-2 text-sm text-error`,children:_}):null,s?(0,m.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,m.jsx)(f,{authorOf:d,disambiguateAuthors:!0,session:s,markdownPolicy:`visitor`,composerActionVariant:`outline`},`${n.bindingId}:${b.sessionId}`)}):null]})}export{h as WebsiteConversation};
|
package/dist/index.html
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>Inbox</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-BWg-K54G.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/Effect-DeiDqvoz.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-DY31Aviq.js">
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/extension-hook-
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/extension-hook-GLdZiZGE.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/animation-Ca8A_H2p.js">
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/sigil-
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/sigil-C6HEWU0G.js">
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/document-CEriO-BY.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/base-face-Biu4f93I.js">
|
|
16
16
|
<link rel="stylesheet" crossorigin href="/assets/index-agq4mNKF.css">
|