fix(ui): one text colour scale, Empty for page empty states, token requests through api

This commit is contained in:
sam committed 2026-10-18 15:03:44 +11:00
1 parent 5f19a95a9e
commit 60ba915587
79 files changed
+227 -224

No files matched your search

+1 -1
View File
@@ -1 +1 @@
import{A as e,Ct as t,D as n,Jt as r,O as i,_ as a,b as o,ht as s,kn as c,lt as l,nr as u,s as d,t as f,v as p,x as m,xt as h,y as g,yn as _}from"./PageHeader.js";import{K as v,_ as y,n as b}from"./api.js";import{C as x,S,T as C,w,x as T}from"./index.js";var E={class:`rounded-lg border border-border bg-card p-5`,"aria-labelledby":`personal-tokens`},D={class:`mb-3 flex items-center justify-between gap-2`},O={key:0,class:`mb-3 text-sm text-fg-subtle`},k={key:1,class:`mb-3 text-xs text-fg-subtle`},A={key:2,role:`alert`,class:`mb-3 text-sm text-danger`},j={key:3,class:`mb-3 rounded-lg border border-border bg-card p-3`},M={key:4,class:`text-sm text-fg-subtle`},N={key:5,class:`divide-y divide-border rounded-lg border border-border bg-card`,"aria-label":`API tokens`},P={class:`flex-1 truncate text-xs`},F={class:`text-xs text-fg-subtle`},I=e({__name:`PersonalTokensCard`,setup(e){let t=_(!1),a=_([]),f=_(``),v=_(``),b=_(!1);async function x(e,t={}){let n=await fetch(e,{...t,headers:{Accept:`application/json`,"X-Archie-CSRF":`1`}});if(!n.ok)throw Error((await n.text()).trim());return n.status===204?void 0:await n.json()}async function S(e){b.value=!0;try{await e(),v.value=``}catch(e){v.value=String(e.message||e)}finally{b.value=!1}}let w=()=>S(async()=>{let e=await x(`/api/tokens`);t.value=e?.available??!1,a.value=e?.tokens??[]}),I=()=>S(async()=>{f.value=(await x(`/api/tokens`,{method:`POST`}))?.token??``,await w()}),L=e=>S(async()=>{await x(`/api/tokens/${e}`,{method:`DELETE`}),await w()});return l(w),(e,l)=>(s(),m(`section`,E,[p(`div`,D,[l[2]||=p(`h2`,{id:`personal-tokens`,class:`font-medium`},`API tokens`,-1),t.value?(s(),g(c(y),{key:0,size:`sm`,disabled:b.value,onClick:I},{default:r(()=>[i(c(T),{"data-icon":`inline-start`}),l[1]||=n(`New token`,-1)]),_:1},8,[`disabled`])):o(``,!0)]),!t.value&&!b.value&&!v.value?(s(),m(`p`,O,`Personal tokens need a signed-in person.`)):o(``,!0),t.value?(s(),m(`p`,k,[...l[3]||=[n(`Send it as `,-1),p(`code`,null,`Authorization: Bearer <token>`,-1),n(`.`,-1)]])):o(``,!0),v.value?(s(),m(`p`,A,u(v.value),1)):o(``,!0),f.value?(s(),m(`div`,j,[l[4]||=p(`p`,{class:`mb-2 text-xs`},`Not shown again.`,-1),i(c(C),{"model-value":f.value,readonly:``,"aria-label":`New token`,onFocus:l[0]||=e=>e.target.select()},null,8,[`model-value`])])):o(``,!0),t.value&&!a.value.length&&!b.value&&!v.value?(s(),m(`p`,M,`No tokens yet.`)):o(``,!0),a.value.length?(s(),m(`ul`,N,[(s(!0),m(d,null,h(a.value,e=>(s(),m(`li`,{key:e.id,class:`flex items-center gap-3 px-4 py-2.5`},[p(`code`,P,u(e.id.slice(0,12)),1),p(`span`,F,u(new Date(e.created_at).toLocaleString()),1),i(c(y),{variant:`ghost`,size:`sm`,class:`text-danger`,disabled:b.value,onClick:t=>L(e.id)},{default:r(()=>[...l[5]||=[n(`Revoke`,-1)]]),_:1},8,[`disabled`,`onClick`])]))),128))])):o(``,!0)]))}}),L={class:`max-w-2xl space-y-6`},R={class:`text-sm`},z={key:0,class:`rounded-lg border border-border bg-card p-4 text-sm`},B={key:1,role:`alert`,class:`text-sm text-danger`},V={class:`rounded-lg border border-border bg-card p-5`},H={class:`mt-4 divide-y divide-border`},U={class:`min-w-0 flex-1 truncate`},W={key:1,class:`mt-3 text-sm text-muted-foreground`},G={class:`rounded-lg border border-border bg-card p-5 space-y-3`},K={key:0,class:`break-all rounded border border-border p-3 font-mono text-sm`,role:`status`},q={class:`rounded-lg border border-border bg-card p-5`},J={class:`block space-y-1 text-sm`,for:`current-password`},Y={class:`block space-y-1 text-sm`,for:`new-password`},X=e({__name:`AccountPage`,setup(e){let g=_(``),T=()=>F(async()=>{g.value=(await b.recoveryCode()).code}),E=x(),D=_([]),O=_(``),k=_(!1),A=_(``),j=_(``),M=_(``),N=a(()=>S(E.status?.public_url??``));async function P(){try{D.value=(await b.passkeys()).passkeys}catch(e){O.value=String(e.message||e)}}l(P);async function F(e){k.value=!0,O.value=``;try{await e()}catch(e){O.value=String(e.message||e)}finally{k.value=!1}}let X=()=>F(async()=>{await w(!0,A.value),A.value=``,await P()}),Z=e=>F(async()=>{await b.deletePasskey(e),await P()}),Q=()=>F(async()=>{await b.changePassword(j.value,M.value),j.value=M.value=``,window.location.assign(`/`)});return(e,a)=>{let l=t(`RouterLink`);return s(),m(`div`,L,[i(f,{title:`Your account`}),p(`p`,R,u(c(E).status?.user?.display_name),1),e.$route.query.welcome?(s(),m(`p`,z,[a[5]||=n(`Your organisation and admin account are ready. Add a passkey below, `,-1),i(l,{class:`underline`,to:`/org/members`},{default:r(()=>[...a[3]||=[n(`add members`,-1)]]),_:1}),a[6]||=n(`, or `,-1),i(l,{class:`underline`,to:`/settings/authentication`},{default:r(()=>[...a[4]||=[n(`configure OIDC`,-1)]]),_:1}),a[7]||=n(`.`,-1)])):o(``,!0),O.value?(s(),m(`p`,B,[n(u(O.value)+` `,1),a[8]||=p(`a`,{class:`underline`,href:`/?reauth=1`},`Sign in again`,-1)])):o(``,!0),p(`section`,V,[a[14]||=p(`h2`,{class:`font-medium`},`Passkeys`,-1),a[15]||=p(`p`,{class:`mt-1 text-sm text-muted-foreground`},`Sign in with your device or security key.`,-1),p(`ul`,H,[(s(!0),m(d,null,h(D.value,e=>(s(),m(`li`,{key:e.id,Line truncated
import{A as e,Ct as t,D as n,Jt as r,O as i,_ as a,b as o,ht as s,kn as c,lt as l,nr as u,s as d,t as f,v as p,x as m,xt as h,y as g,yn as _}from"./PageHeader.js";import{$ as v,n as y,w as b}from"./api.js";import{t as x}from"./Input.js";import{C as S,S as C,b as w,x as T}from"./index.js";var E={class:`rounded-lg border border-border bg-card p-5`,"aria-labelledby":`personal-tokens`},D={class:`mb-3 flex items-center justify-between gap-2`},O={key:0,class:`mb-3 text-sm text-fg-subtle`},k={key:1,class:`mb-3 text-xs text-fg-subtle`},A={key:2,role:`alert`,class:`mb-3 text-sm text-danger`},j={key:3,class:`mb-3 rounded-lg border border-border bg-card p-3`},M={key:4,class:`text-sm text-fg-subtle`},N={key:5,class:`divide-y divide-border rounded-lg border border-border bg-card`,"aria-label":`API tokens`},P={class:`flex-1 truncate text-xs`},F={class:`text-xs text-fg-subtle`},I=e({__name:`PersonalTokensCard`,setup(e){let t=_(!1),a=_([]),f=_(``),v=_(``),S=_(!1);async function C(e){S.value=!0;try{await e(),v.value=``}catch(e){v.value=String(e.message||e)}finally{S.value=!1}}let T=()=>C(async()=>{let e=await y.tokens();t.value=e?.available??!1,a.value=e?.tokens??[]}),I=()=>C(async()=>{f.value=(await y.createToken())?.token??``,await T()}),L=e=>C(async()=>{await y.revokeToken(e),await T()});return l(T),(e,l)=>(s(),m(`section`,E,[p(`div`,D,[l[2]||=p(`h2`,{id:`personal-tokens`,class:`font-medium`},`API tokens`,-1),t.value?(s(),g(c(b),{key:0,size:`sm`,disabled:S.value,onClick:I},{default:r(()=>[i(c(w),{"data-icon":`inline-start`}),l[1]||=n(`New token`,-1)]),_:1},8,[`disabled`])):o(``,!0)]),!t.value&&!S.value&&!v.value?(s(),m(`p`,O,`Personal tokens need a signed-in person.`)):o(``,!0),t.value?(s(),m(`p`,k,[...l[3]||=[n(`Send it as `,-1),p(`code`,null,`Authorization: Bearer <token>`,-1),n(`.`,-1)]])):o(``,!0),v.value?(s(),m(`p`,A,u(v.value),1)):o(``,!0),f.value?(s(),m(`div`,j,[l[4]||=p(`p`,{class:`mb-2 text-xs`},`Not shown again.`,-1),i(c(x),{"model-value":f.value,readonly:``,"aria-label":`New token`,onFocus:l[0]||=e=>e.target.select()},null,8,[`model-value`])])):o(``,!0),t.value&&!a.value.length&&!S.value&&!v.value?(s(),m(`p`,M,`No tokens yet.`)):o(``,!0),a.value.length?(s(),m(`ul`,N,[(s(!0),m(d,null,h(a.value,e=>(s(),m(`li`,{key:e.id,class:`flex items-center gap-3 px-4 py-2.5`},[p(`code`,P,u(e.id.slice(0,12)),1),p(`span`,F,u(new Date(e.created_at).toLocaleString()),1),i(c(b),{variant:`ghost`,size:`sm`,class:`text-danger`,disabled:S.value,onClick:t=>L(e.id)},{default:r(()=>[...l[5]||=[n(`Revoke`,-1)]]),_:1},8,[`disabled`,`onClick`])]))),128))])):o(``,!0)]))}}),L={class:`max-w-2xl space-y-6`},R={class:`text-sm`},z={key:0,class:`rounded-lg border border-border bg-card p-4 text-sm`},B={key:1,role:`alert`,class:`text-sm text-danger`},V={class:`rounded-lg border border-border bg-card p-5`},H={class:`mt-4 divide-y divide-border`},U={class:`min-w-0 flex-1 truncate`},W={key:1,class:`mt-3 text-sm text-fg-muted`},G={class:`rounded-lg border border-border bg-card p-5 space-y-3`},K={key:0,class:`break-all rounded border border-border p-3 font-mono text-sm`,role:`status`},q={class:`rounded-lg border border-border bg-card p-5`},J={class:`block space-y-1 text-sm`,for:`current-password`},Y={class:`block space-y-1 text-sm`,for:`new-password`},X=e({__name:`AccountPage`,setup(e){let g=_(``),w=()=>F(async()=>{g.value=(await y.recoveryCode()).code}),E=C(),D=_([]),O=_(``),k=_(!1),A=_(``),j=_(``),M=_(``),N=a(()=>T(E.status?.public_url??``));async function P(){try{D.value=(await y.passkeys()).passkeys}catch(e){O.value=String(e.message||e)}}l(P);async function F(e){k.value=!0,O.value=``;try{await e()}catch(e){O.value=String(e.message||e)}finally{k.value=!1}}let X=()=>F(async()=>{await S(!0,A.value),A.value=``,await P()}),Z=e=>F(async()=>{await y.deletePasskey(e),await P()}),Q=()=>F(async()=>{await y.changePassword(j.value,M.value),j.value=M.value=``,window.location.assign(`/`)});return(e,a)=>{let l=t(`RouterLink`);return s(),m(`div`,L,[i(f,{title:`Your account`}),p(`p`,R,u(c(E).status?.user?.display_name),1),e.$route.query.welcome?(s(),m(`p`,z,[a[5]||=n(`Your organisation and admin account are ready. Add a passkey below, `,-1),i(l,{class:`underline`,to:`/org/members`},{default:r(()=>[...a[3]||=[n(`add members`,-1)]]),_:1}),a[6]||=n(`, or `,-1),i(l,{class:`underline`,to:`/settings/authentication`},{default:r(()=>[...a[4]||=[n(`configure OIDC`,-1)]]),_:1}),a[7]||=n(`.`,-1)])):o(``,!0),O.value?(s(),m(`p`,B,[n(u(O.value)+` `,1),a[8]||=p(`a`,{class:`underline`,href:`/?reauth=1`},`Sign in again`,-1)])):o(``,!0),p(`section`,V,[a[14]||=p(`h2`,{class:`font-medium`},`Passkeys`,-1),p(`ul`,H,[(s(!0),m(d,null,h(D.value,e=>(s(),m(`li`,{key:e.id,class:`flex items-center gap-3 py-2 text-sm`},[p(`span`,U,u(e.name),1),i(c(b),{variant:`ghost`,size:`sm`,disabled:k.value,onClick:t=>Z(e.id)},{default:r(()=>[...a[9]||=[n(`Remove`,-1)]]),_:1},8,[`disabled`,`onClick`])]))),128))]),N.value?(s(),m(`form`,{key:0,class:`mt-3 flex flex-wrap gap-2`,onSubmit:v(X,[`prevent`])},[i(c(xLine truncated
+1 -1
View File
@@ -1 +1 @@
import{d as e,o as t,s as n,t as r}from"./CardAccordion.js";import{A as i,D as a,Jt as o,O as s,_ as c,b as l,ht as u,kn as d,lt as f,nr as p,t as m,v as h,x as g,yn as _}from"./PageHeader.js";import{K as v,_ as y}from"./api.js";import{T as b,y as x}from"./index.js";var S={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},C={key:1,class:`text-sm text-fg-muted`},w=`agent-profiles`,T=i({__name:`AgentProfilesPage`,setup(i){let T=e();f(T.load);let E=c(()=>T.drafts[w]?.value),D=_(``),O=_(``),k=c(()=>T.changesFor(w).length>0),A=c(()=>Object.entries(E.value??{}));function j(){if(k.value)return;let e=D.value.trim();if(!e||E.value?.[e])return;let t=T.drafts[w];t&&(t.value||={},t.value[e]={image:``,kit:``,adapter:``,tools:[]},D.value=``,O.value=String(Object.keys(t.value).indexOf(e)))}function M(e,t){e.tools=String(t).split(`,`).map(e=>e.trim()).filter(Boolean)}return(e,i)=>(u(),g(`div`,null,[s(m,{title:`Agent profiles`},{default:o(()=>[s(t,{kinds:[w]},null,8,[`kinds`])]),_:1}),s(n,{kind:w,class:`mb-4`}),d(T).catalogError||d(T).pageErrorFor(w)?(u(),g(`p`,S,p(d(T).catalogError||d(T).pageErrorFor(w)),1)):l(``,!0),h(`form`,{class:`mb-4 flex gap-2`,onSubmit:v(j,[`prevent`])},[s(d(b),{modelValue:D.value,"onUpdate:modelValue":i[0]||=e=>D.value=e,"aria-label":`Profile name`,placeholder:`Profile name`,class:`max-w-xs`,disabled:k.value},null,8,[`modelValue`,`disabled`]),s(d(y),{type:`submit`,disabled:k.value||!D.value.trim()||!!E.value?.[D.value.trim()]},{default:o(()=>[...i[3]||=[a(`Add profile`,-1)]]),_:1},8,[`disabled`])],32),Object.keys(E.value??{}).length?l(``,!0):(u(),g(`p`,C,`No agent profiles.`)),s(r,{open:O.value,"onUpdate:open":i[1]||=e=>O.value=e,items:A.value,title:([e])=>e,"remove-label":`Remove`,mono:``,onRemove:i[2]||=e=>delete E.value[A.value[e][0]]},{default:o(({item:[e,t]})=>[s(d(x),{label:`Image`,for:`${e}-image`},{default:o(()=>[s(d(b),{id:`${e}-image`,modelValue:t.image,"onUpdate:modelValue":e=>t.image=e,placeholder:`Container image`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(x),{label:`Kit`,for:`${e}-kit`,hint:`Pinned digest. Used only when Image is empty.`},{default:o(()=>[s(d(b),{id:`${e}-kit`,modelValue:t.kit,"onUpdate:modelValue":e=>t.kit=e,placeholder:`registry/kit@sha256:…`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(x),{label:`Adapter`,for:`${e}-adapter`},{default:o(()=>[s(d(b),{id:`${e}-adapter`,modelValue:t.adapter,"onUpdate:modelValue":e=>t.adapter=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(x),{label:`Tools`,for:`${e}-tools`,hint:`Comma-separated tool names.`},{default:o(()=>[s(d(b),{id:`${e}-tools`,"model-value":(t.tools??[]).join(`, `),"onUpdate:modelValue":e=>M(t,e)},null,8,[`id`,`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`for`])]),_:1},8,[`open`,`items`,`title`])]))}});export{T as default};
import{i as e,r as t,t as n}from"./empty.js";import{A as r,D as i,Jt as a,O as o,_ as s,b as c,ht as l,kn as u,lt as d,nr as f,t as p,v as m,x as h,y as g,yn as _}from"./PageHeader.js";import{$ as v,w as y}from"./api.js";import{t as b}from"./Input.js";import{_ as x,g as S,h as C,m as w,r as T}from"./index.js";var E={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},D=`agent-profiles`,O=r({__name:`AgentProfilesPage`,setup(r){let O=x();d(O.load);let k=s(()=>O.drafts[D]?.value),A=_(``),j=_(``),M=s(()=>O.changesFor(D).length>0),N=s(()=>Object.entries(k.value??{}));function P(){if(M.value)return;let e=A.value.trim();if(!e||k.value?.[e])return;let t=O.drafts[D];t&&(t.value||={},t.value[e]={image:``,kit:``,adapter:``,tools:[]},A.value=``,j.value=String(Object.keys(t.value).indexOf(e)))}function F(e,t){e.tools=String(t).split(`,`).map(e=>e.trim()).filter(Boolean)}return(r,s)=>(l(),h(`div`,null,[o(p,{title:`Agent profiles`},{default:a(()=>[o(C,{kinds:[D]},null,8,[`kinds`])]),_:1}),o(S,{kind:D,class:`mb-4`}),u(O).catalogError||u(O).pageErrorFor(D)?(l(),h(`p`,E,f(u(O).catalogError||u(O).pageErrorFor(D)),1)):c(``,!0),m(`form`,{class:`mb-4 flex flex-wrap gap-2`,onSubmit:v(P,[`prevent`])},[o(u(b),{modelValue:A.value,"onUpdate:modelValue":s[0]||=e=>A.value=e,"aria-label":`Profile name`,placeholder:`Profile name`,class:`max-w-xs`,disabled:M.value},null,8,[`modelValue`,`disabled`]),o(u(y),{type:`submit`,disabled:M.value||!A.value.trim()||!!k.value?.[A.value.trim()]},{default:a(()=>[...s[3]||=[i(`Add profile`,-1)]]),_:1},8,[`disabled`])],32),Object.keys(k.value??{}).length?c(``,!0):(l(),g(u(e),{key:1},{default:a(()=>[o(u(t),null,{default:a(()=>[o(u(n),null,{default:a(()=>[...s[4]||=[i(`No agent profiles`,-1)]]),_:1})]),_:1})]),_:1})),o(T,{open:j.value,"onUpdate:open":s[1]||=e=>j.value=e,items:N.value,title:([e])=>e,"remove-label":`Remove`,mono:``,onRemove:s[2]||=e=>delete k.value[N.value[e][0]]},{default:a(({item:[e,t]})=>[o(u(w),{label:`Image`,for:`${e}-image`},{default:a(()=>[o(u(b),{id:`${e}-image`,modelValue:t.image,"onUpdate:modelValue":e=>t.image=e,placeholder:`Container image`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),o(u(w),{label:`Kit`,for:`${e}-kit`,hint:`Pinned digest. Used only when Image is empty.`},{default:a(()=>[o(u(b),{id:`${e}-kit`,modelValue:t.kit,"onUpdate:modelValue":e=>t.kit=e,placeholder:`registry/kit@sha256:…`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),o(u(w),{label:`Adapter`,for:`${e}-adapter`},{default:a(()=>[o(u(b),{id:`${e}-adapter`,modelValue:t.adapter,"onUpdate:modelValue":e=>t.adapter=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),o(u(w),{label:`Tools`,for:`${e}-tools`,hint:`Comma-separated tool names.`},{default:a(()=>[o(u(b),{id:`${e}-tools`,"model-value":(t.tools??[]).join(`, `),"onUpdate:modelValue":e=>F(t,e)},null,8,[`id`,`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`for`])]),_:1},8,[`open`,`items`,`title`])]))}});export{O as default};
+1 -1
View File
@@ -1 +1 @@
import{A as e,Ct as t,D as n,Jt as r,O as i,b as a,ht as o,kn as s,lt as c,nr as l,t as u,v as d,x as f,yn as p}from"./PageHeader.js";import{K as m,_ as h,n as g}from"./api.js";import{T as _}from"./index.js";var v={class:`max-w-2xl`},y={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},b={class:`space-y-3 rounded-lg border border-border bg-card p-5`},x={for:`instance-url`,class:`block space-y-1 text-sm`},S={class:`space-y-3 rounded-lg border border-border bg-card p-5`},C={for:`oidc-issuer`,class:`block space-y-1 text-sm`},w={for:`oidc-client`,class:`block space-y-1 text-sm`},T={for:`oidc-audience`,class:`block space-y-1 text-sm`},E={class:`break-all text-xs text-muted-foreground`},D={class:`text-xs text-muted-foreground`},O={key:0,role:`status`,class:`text-sm`},k=e({__name:`AuthenticationPage`,setup(e){let k=p({public_url:``,oidc_issuer:``,oidc_audience:``,oidc_client_id:``}),A=p(!1),j=p(``),M=p(!1),N=p(!1);c(async()=>{try{k.value=await g.authentication(),A.value=!0}catch(e){j.value=String(e.message||e)}});async function P(){M.value=!0,j.value=``,N.value=!1;try{await g.saveAuthentication(k.value),N.value=!0}catch(e){j.value=String(e.message||e)}finally{M.value=!1}}return(e,c)=>{let p=t(`RouterLink`);return o(),f(`div`,v,[i(u,{title:`Authentication`}),j.value?(o(),f(`p`,y,[n(l(j.value)+` `,1),c[4]||=d(`a`,{class:`underline`,href:`/?reauth=1`},`Sign in again`,-1)])):a(``,!0),A.value?(o(),f(`form`,{key:1,class:`space-y-6`,onSubmit:m(P,[`prevent`])},[d(`section`,b,[c[6]||=d(`h2`,{class:`font-medium`},`Instance URL`,-1),d(`label`,x,[c[5]||=n(`Public address`,-1),i(s(_),{id:`instance-url`,modelValue:k.value.public_url,"onUpdate:modelValue":c[0]||=e=>k.value.public_url=e,type:`url`,required:``},null,8,[`modelValue`])]),c[7]||=d(`p`,{class:`text-xs text-muted-foreground`},`Passkeys require HTTPS and a domain name, or localhost. Once passkeys are enrolled, their domain is fixed.`,-1)]),d(`section`,S,[c[14]||=d(`h2`,{class:`font-medium`},`OpenID Connect`,-1),c[15]||=d(`p`,{class:`text-sm text-muted-foreground`},`Register a public client with authorization code flow and PKCE. Local accounts remain available.`,-1),d(`label`,C,[c[8]||=n(`Issuer URL`,-1),i(s(_),{id:`oidc-issuer`,modelValue:k.value.oidc_issuer,"onUpdate:modelValue":c[1]||=e=>k.value.oidc_issuer=e,type:`url`,placeholder:`https://identity.example.com`},null,8,[`modelValue`])]),d(`label`,w,[c[9]||=n(`Client ID`,-1),i(s(_),{id:`oidc-client`,modelValue:k.value.oidc_client_id,"onUpdate:modelValue":c[2]||=e=>k.value.oidc_client_id=e},null,8,[`modelValue`])]),d(`label`,T,[c[10]||=n(`Access token audience`,-1),i(s(_),{id:`oidc-audience`,modelValue:k.value.oidc_audience,"onUpdate:modelValue":c[3]||=e=>k.value.oidc_audience=e},null,8,[`modelValue`])]),d(`p`,E,`Redirect URI: `+l(k.value.public_url.replace(/\/$/,``))+`/oauth2/callback`,1),d(`p`,D,[c[12]||=n(`Add permitted people by their verified email or provider subject in `,-1),i(p,{class:`underline`,to:`/org/members`},{default:r(()=>[...c[11]||=[n(`Organisation → Members`,-1)]]),_:1}),c[13]||=n(`. Clear the OIDC fields to disable provider sign-in.`,-1)])]),N.value?(o(),f(`p`,O,`Authentication settings saved.`)):a(``,!0),i(s(h),{type:`submit`,disabled:M.value},{default:r(()=>[...c[16]||=[n(`Save`,-1)]]),_:1},8,[`disabled`])],32)):a(``,!0)])}}});export{k as default};
import{A as e,Ct as t,D as n,Jt as r,O as i,b as a,ht as o,kn as s,lt as c,nr as l,t as u,v as d,x as f,yn as p}from"./PageHeader.js";import{$ as m,n as h,w as g}from"./api.js";import{t as _}from"./Input.js";var v={class:`max-w-2xl`},y={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},b={class:`space-y-3 rounded-lg border border-border bg-card p-5`},x={for:`instance-url`,class:`block space-y-1 text-sm`},S={class:`space-y-3 rounded-lg border border-border bg-card p-5`},C={for:`oidc-issuer`,class:`block space-y-1 text-sm`},w={for:`oidc-client`,class:`block space-y-1 text-sm`},T={for:`oidc-audience`,class:`block space-y-1 text-sm`},E={class:`break-all text-xs text-fg-muted`},D={class:`text-xs text-fg-muted`},O={key:0,role:`status`,class:`text-sm`},k=e({__name:`AuthenticationPage`,setup(e){let k=p({public_url:``,oidc_issuer:``,oidc_audience:``,oidc_client_id:``}),A=p(!1),j=p(``),M=p(!1),N=p(!1);c(async()=>{try{k.value=await h.authentication(),A.value=!0}catch(e){j.value=String(e.message||e)}});async function P(){M.value=!0,j.value=``,N.value=!1;try{await h.saveAuthentication(k.value),N.value=!0}catch(e){j.value=String(e.message||e)}finally{M.value=!1}}return(e,c)=>{let p=t(`RouterLink`);return o(),f(`div`,v,[i(u,{title:`Authentication`}),j.value?(o(),f(`p`,y,[n(l(j.value)+` `,1),c[4]||=d(`a`,{class:`underline`,href:`/?reauth=1`},`Sign in again`,-1)])):a(``,!0),A.value?(o(),f(`form`,{key:1,class:`space-y-6`,onSubmit:m(P,[`prevent`])},[d(`section`,b,[c[6]||=d(`h2`,{class:`font-medium`},`Instance URL`,-1),d(`label`,x,[c[5]||=n(`Public address`,-1),i(s(_),{id:`instance-url`,modelValue:k.value.public_url,"onUpdate:modelValue":c[0]||=e=>k.value.public_url=e,type:`url`,required:``},null,8,[`modelValue`])]),c[7]||=d(`p`,{class:`text-xs text-fg-muted`},`Passkeys require HTTPS and a domain name, or localhost. Once passkeys are enrolled, their domain is fixed.`,-1)]),d(`section`,S,[c[14]||=d(`h2`,{class:`font-medium`},`OpenID Connect`,-1),c[15]||=d(`p`,{class:`text-sm text-fg-muted`},`Register a public client with authorization code flow and PKCE. Local accounts remain available.`,-1),d(`label`,C,[c[8]||=n(`Issuer URL`,-1),i(s(_),{id:`oidc-issuer`,modelValue:k.value.oidc_issuer,"onUpdate:modelValue":c[1]||=e=>k.value.oidc_issuer=e,type:`url`,placeholder:`https://identity.example.com`},null,8,[`modelValue`])]),d(`label`,w,[c[9]||=n(`Client ID`,-1),i(s(_),{id:`oidc-client`,modelValue:k.value.oidc_client_id,"onUpdate:modelValue":c[2]||=e=>k.value.oidc_client_id=e},null,8,[`modelValue`])]),d(`label`,T,[c[10]||=n(`Access token audience`,-1),i(s(_),{id:`oidc-audience`,modelValue:k.value.oidc_audience,"onUpdate:modelValue":c[3]||=e=>k.value.oidc_audience=e},null,8,[`modelValue`])]),d(`p`,E,`Redirect URI: `+l(k.value.public_url.replace(/\/$/,``))+`/oauth2/callback`,1),d(`p`,D,[c[12]||=n(`Add permitted people by their verified email or provider subject in `,-1),i(p,{class:`underline`,to:`/org/members`},{default:r(()=>[...c[11]||=[n(`Organisation → Members`,-1)]]),_:1}),c[13]||=n(`. Clear the OIDC fields to disable provider sign-in.`,-1)])]),N.value?(o(),f(`p`,O,`Authentication settings saved.`)):a(``,!0),i(s(g),{type:`submit`,disabled:M.value},{default:r(()=>[...c[16]||=[n(`Save`,-1)]]),_:1},8,[`disabled`])],32)):a(``,!0)])}}});export{k as default};
-3
View File
@@ -1,3 +0,0 @@
import{$ as e,$t as t,A as n,At as r,B as i,Bt as a,C as o,Cn as s,Ct as c,D as l,Dn as u,Dt as d,E as f,En as p,Et as m,F as h,Ft as g,G as _,Gt as v,H as y,Ht as b,I as x,It as S,J as C,Jt as w,K as T,Kt as E,L as ee,Lt as te,M as D,Mn as ne,Mt as re,N as ie,Nn as ae,Nt as oe,O,On as se,Ot as ce,P as le,Pt as ue,Q as de,Qn as fe,Qt as pe,R as k,Rt as me,S as he,Sn as ge,St as A,T as _e,Tn as ve,Tt as ye,U as be,Ut as j,V as xe,Vt as Se,W as Ce,Wt as M,X as we,Xt as Te,Y as Ee,Yt as De,Z as Oe,Zt as ke,_ as N,_n as Ae,_t as je,a as Me,an as Ne,at as Pe,b as Fe,bn as Ie,bt as Le,c as Re,cn as ze,ct as Be,d as Ve,dn as He,dt as Ue,en as We,er as Ge,et as Ke,f as qe,fn as Je,ft as Ye,g as Xe,gn as Ze,gt as Qe,h as $e,hn as et,ht as P,i as tt,in as nt,it as rt,j as it,jt as at,k as ot,kn as F,kt as st,l as ct,ln as lt,lt as ut,m as dt,mn as ft,mt as pt,n as mt,nn as ht,nr as gt,nt as I,o as _t,on as vt,ot as yt,p as bt,pn as xt,pt as St,q as Ct,qt as wt,r as Tt,rn as Et,rr as Dt,rt as Ot,s as kt,sn as At,st as jt,tn as Mt,tr as Nt,tt as L,u as Pt,un as Ft,ut as It,v as Lt,vn as Rt,vt as zt,w as Bt,wn as Vt,wt as Ht,x as Ut,xn as Wt,xt as Gt,y as R,yn as z,yt as Kt,z as qt,zt as Jt}from"./PageHeader.js";import{A as Yt,B as Xt,C as Zt,D as Qt,E as $t,F as en,G as tn,H as nn,I as rn,K as an,L as on,M as sn,N as cn,O as ln,P as un,R as dn,T as fn,U as pn,V as mn,W as hn,_ as gn,a as _n,i as vn,j as yn,k as bn,m as xn,n as Sn,s as Cn,v as wn,w as Tn,x as En,y as B,z as Dn}from"./api.js";import{n as On}from"./pinia.js";import{t as kn}from"./createLucideIcon.js";import{a as An,i as jn,n as Mn,r as Nn,t as Pn}from"./alert.js";var Fn=Object.defineProperty,In=((e,t)=>{let n={};for(var r in e)Fn(n,r,{get:e[r],enumerable:!0});return t||Fn(n,Symbol.toStringTag,{value:`Module`}),n})({BaseTransition:()=>mt,BaseTransitionPropsValidators:()=>Tt,Comment:()=>tt,DeprecationTypes:()=>null,EffectScope:()=>t,ErrorCodes:()=>Me,ErrorTypeStrings:()=>_t,Fragment:()=>kt,KeepAlive:()=>Re,ReactiveEffect:()=>We,Static:()=>ct,Suspense:()=>Pt,Teleport:()=>Ve,Text:()=>qe,TrackOpTypes:()=>Mt,Transition:()=>Zt,TransitionGroup:()=>Tn,TriggerOpTypes:()=>ht,VueElement:()=>fn,assertNumber:()=>bt,callWithAsyncErrorHandling:()=>dt,callWithErrorHandling:()=>$e,camelize:()=>ne,capitalize:()=>ae,cloneVNode:()=>Xe,compatUtils:()=>null,compile:()=>Ln,computed:()=>N,createApp:()=>$t,createBlock:()=>R,createCommentVNode:()=>Fe,createElementBlock:()=>Ut,createElementVNode:()=>Lt,createHydrationRenderer:()=>he,createPropsRestProxy:()=>o,createRenderer:()=>Bt,createSSRApp:()=>Qt,createSlots:()=>_e,createStaticVNode:()=>f,createTextVNode:()=>l,createVNode:()=>O,customRef:()=>Et,defineAsyncComponent:()=>ot,defineComponent:()=>n,defineCustomElement:()=>ln,defineEmits:()=>it,defineExpose:()=>D,defineModel:()=>ie,defineOptions:()=>le,defineProps:()=>h,defineSSRCustomElement:()=>bn,defineSlots:()=>x,devtools:()=>ee,effect:()=>nt,effectScope:()=>Ne,getCurrentInstance:()=>k,getCurrentScope:()=>vt,getCurrentWatcher:()=>At,getTransitionRawChildren:()=>qt,guardReactiveProps:()=>i,h:()=>xe,handleError:()=>y,hasInjectionContext:()=>be,hydrate:()=>Yt,hydrateOnIdle:()=>Ce,hydrateOnInteraction:()=>_,hydrateOnMediaQuery:()=>T,hydrateOnVisible:()=>Ct,initCustomFormatter:()=>C,initDirectivesForSSR:()=>yn,inject:()=>Ee,isMemoSame:()=>we,isProxy:()=>ze,isReactive:()=>lt,isReadonly:()=>Ft,isRef:()=>He,isRuntimeOnly:()=>Oe,isShallow:()=>Je,isVNode:()=>de,markRaw:()=>xt,mergeDefaults:()=>e,mergeModels:()=>Ke,mergeProps:()=>L,nextTick:()=>I,nodeOps:()=>sn,normalizeClass:()=>fe,normalizeProps:()=>Ge,normalizeStyle:()=>Nt,onActivated:()=>Ot,onBeforeMount:()=>rt,onBeforeUnmount:()=>Pe,onBeforeUpdate:()=>yt,onDeactivated:()=>jt,onErrorCaptured:()=>Be,onMounted:()=>ut,onRenderTracked:()=>It,onRenderTriggered:()=>Ue,onScopeDispose:()=>ft,onServerPrefetch:()=>Ye,onUnmounted:()=>St,onUpdated:()=>pt,onWatcherCleanup:()=>et,openBlock:()=>P,patchProp:()=>cn,popScopeId:()=>Qe,provide:()=>je,proxyRefs:()=>Ze,pushScopeId:()=>zt,queuePostFlushCb:()=>Kt,reactive:()=>Ae,readonly:()=>Rt,ref:()=>z,registerRuntimeCompiler:()=>Le,render:()=>un,renderList:()=>Gt,renderSlot:()=>A,resolveComponent:()=>c,resolveDirective:()=>Ht,resolveDynamicComponent:()=>ye,resolveFilter:()=>null,resolveTransitionHooks:()=>m,setBlockTracking:()=>d,setDevtoolsHook:()=>ce,setTransitionHooks:()=>st,shallowReactive:()=>Ie,shallowReadonly:()=>Wt,shallowRef:()=>ge,ssrContextKey:()=>r,ssrUtils:()=>at,stop:()=>s,toDisplayString:()=>gt,toHandlerKey:()=>Dt,toHandlers:()=>re,toRaw:()=>Vt,toRef:()=>ve,toRefs:()=>p,toValue:()=>u,transformVNodeArgs:()=>oe,triggerRef:()=>se,unref:()=>F,useAttrs:()=>ue,useCssModule:()=>en,useCssVars:()=>rn,useHost:()=>on,useId:()=>g,useModel:()=>S,useSSRContext:()=>te,useShadowRoot:()=>dn,useSlots:()=>me,useTemplateRef:()=>Jt,useTransitionState:()=>a,vModelCheckbox:()=>Dn,vModelDynamic:()=>Xt,vModelRadio:()=>mn,vModelSelect:()=>nn,vModelText:()=>pn,vShow:()=>hn,version:()=>Se,warn:()=>b,watch:()=>j,watchEffLine truncated
`)].join(`
`))}return()=>i.value||r.value||o.value?xe(t.default({present:o.value})[0],{ref:e=>{let t=U(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),[_i,vi]=Wn(`CollapsibleRoot`),yi=n({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=kr(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:a,unmountOnHide:o}=p(r);return vi({contentId:``,disabled:a,open:i,unmountOnHide:o,onOpenToggle:()=>{a.value||(i.value=!i.value)}}),t({open:i}),W(),(t,n)=>(P(),R(F(B),{as:e.as,"as-child":r.asChild,"data-state":F(i)?`open`:`closed`,"data-disabled":F(a)?``:void 0},{default:w(()=>[A(t.$slots,`default`,{open:F(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),bi=n({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`contentFound`],setup(e,{emit:t}){let n=e,r=t,i=_i();i.contentId||=di(void 0,`reka-collapsible-content`);let a=z(),{forwardRef:o,currentElement:s}=W(),c=z(0),l=z(0),u=N(()=>i.open.value),d=z(u.value),f=z();j(()=>[u.value,a.value?.present],async()=>{await I();let e=s.value;if(!e)return;f.value=f.value||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();l.value=t.height,c.value=t.width,d.value||(e.style.transitionDuration=f.value.transitionDuration,e.style.animationName=f.value.animationName)},{immediate:!0});let p=N(()=>d.value&&i.open.value);return ut(()=>{requestAnimationFrame(()=>{d.value=!1})}),hr(s,`beforematch`,e=>{requestAnimationFrame(()=>{i.onOpenToggle(),r(`contentFound`)})}),(t,r)=>(P(),R(F(gi),{ref_key:`presentRef`,ref:a,present:e.forceMount||F(i).open.value,"force-mount":!0},{default:w(({present:r})=>[O(F(B),L(t.$attrs,{id:F(i).contentId,ref:F(o),"as-child":n.asChild,as:e.as,hidden:r?void 0:F(i).unmountOnHide.value?``:`until-found`,"data-state":p.value?void 0:F(i).open.value?`open`:`closed`,"data-disabled":F(i).disabled?.value?``:void 0,style:{"--reka-collapsible-content-height":`${l.value}px`,"--reka-collapsible-content-width":`${c.value}px`}}),{default:w(()=>[!F(i).unmountOnHide.value||r?A(t.$slots,`default`,{},void 0,void 0,0):Fe(`v-if`,!0)]),_:2},1040,[`id`,`as-child`,`as`,`hidden`,`data-state`,`data-disabled`,`style`])]),_:3},8,[`present`]))}}),xi=n({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;W();let n=_i();return(r,i)=>(P(),R(F(B),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":F(n).contentId,"aria-expanded":F(n).open.value,"data-state":F(n).open.value?`open`:`closed`,"data-disabled":F(n).disabled?.value?``:void 0,disabled:F(n).disabled?.value,onClick:F(n).onOpenToggle},{default:w(()=>[A(r.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`]))}});function Si({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function Ci({type:e,defaultValue:t,modelValue:n}){return e||Si({type:e,defaultValue:t,modelValue:n})}function wi({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function Ti(e,t){let n=N(()=>Ci(e)),r=kr(e,`modelValue`,t,{defaultValue:wi(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=Un(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(qn(t,e)){let n=t.findIndex(t=>Un(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:N(()=>n.value===`single`)}}var[Ei,Di]=Wn(`AccordionRoot`),Oi=n({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},orientation:{type:String,required:!1,default:`vertical`},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},type:{type:String,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{dir:i,disabled:a,unmountOnHide:o}=p(n),s=qr(i),{modelValue:c,changeModelValue:l,isSingle:u}=Ti(n,r),{forwardRef:d,currentElement:f}=W();return Di({disabled:a,direction:s,orientation:n.orientation,parentElement:f,isSingle:u,collapsible:n.collapsible,modelValue:c,changeModelValue:l,unmountOnHide:o}),(t,n)=>(P(),R(F(B),{ref:F(d),"as-child":e.asChild,as:e.as},{default:w(()=>[A(t.$sl Line truncated
+1 -1
View File
@@ -1 +1 @@
import{d as e,o as t,s as n,t as r}from"./CardAccordion.js";import{A as i,D as a,Jt as o,O as s,_ as c,b as l,ht as u,kn as d,lt as f,nr as p,t as m,x as h,yn as g}from"./PageHeader.js";import{_}from"./api.js";import{T as v,v as y,y as b}from"./index.js";var x={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},S={key:1,class:`text-sm text-fg-muted`},C=`credential-bindings`,w=i({__name:`CredentialBindingsPage`,setup(i){let w=e();f(w.load);let T=c(()=>w.drafts[C]?.value),E=g(``),D=c(()=>w.changesFor(C).length>0);function O(){if(D.value)return;let e=w.drafts[C];e&&(e.value||=[],e.value.push({service:``,org:``,secret:{engine:``,key:``}}),E.value=String(e.value.length-1))}return(e,i)=>(u(),h(`div`,null,[s(m,{title:`Credential bindings`},{default:o(()=>[s(t,{kinds:[C]},null,8,[`kinds`]),s(d(_),{disabled:D.value,onClick:O},{default:o(()=>[...i[2]||=[a(`Add binding`,-1)]]),_:1},8,[`disabled`])]),_:1}),s(n,{kind:C,class:`mb-4`}),d(w).catalogError||d(w).pageErrorFor(C)?(u(),h(`p`,x,p(d(w).catalogError||d(w).pageErrorFor(C)),1)):l(``,!0),T.value?.length?l(``,!0):(u(),h(`p`,S,`No credential bindings.`)),s(r,{open:E.value,"onUpdate:open":i[0]||=e=>E.value=e,items:T.value??[],title:e=>e.service||`New binding`,"remove-label":`Remove`,mono:``,onRemove:i[1]||=e=>T.value.splice(e,1)},{default:o(({item:e,index:t})=>[s(d(b),{label:`Service`,for:`binding-${t}-service`},{default:o(()=>[s(d(v),{id:`binding-${t}-service`,modelValue:e.service,"onUpdate:modelValue":t=>e.service=t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(b),{label:`Organisation`,for:`binding-${t}-org`,hint:`Empty uses the default organisation.`},{default:o(()=>[s(d(v),{id:`binding-${t}-org`,modelValue:e.org,"onUpdate:modelValue":t=>e.org=t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(b),{label:`Secret`},{default:o(()=>[s(y,{modelValue:e.secret,"onUpdate:modelValue":t=>e.secret=t,"id-prefix":`binding-${t}-secret`},null,8,[`modelValue`,`onUpdate:modelValue`,`id-prefix`])]),_:2},1024)]),_:1},8,[`open`,`items`,`title`])]))}});export{w as default};
import{i as e,r as t,t as n}from"./empty.js";import{A as r,D as i,Jt as a,O as o,_ as s,b as c,ht as l,kn as u,lt as d,nr as f,t as p,x as m,y as h,yn as g}from"./PageHeader.js";import{w as _}from"./api.js";import{t as v}from"./Input.js";import{_ as y,g as b,h as x,m as S,p as C,r as w}from"./index.js";var T={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},E=`credential-bindings`,D=r({__name:`CredentialBindingsPage`,setup(r){let D=y();d(D.load);let O=s(()=>D.drafts[E]?.value),k=g(``),A=s(()=>D.changesFor(E).length>0);function j(){if(A.value)return;let e=D.drafts[E];e&&(e.value||=[],e.value.push({service:``,org:``,secret:{engine:``,key:``}}),k.value=String(e.value.length-1))}return(r,s)=>(l(),m(`div`,null,[o(p,{title:`Credential bindings`},{default:a(()=>[o(x,{kinds:[E]},null,8,[`kinds`]),o(u(_),{disabled:A.value,onClick:j},{default:a(()=>[...s[2]||=[i(`Add binding`,-1)]]),_:1},8,[`disabled`])]),_:1}),o(b,{kind:E,class:`mb-4`}),u(D).catalogError||u(D).pageErrorFor(E)?(l(),m(`p`,T,f(u(D).catalogError||u(D).pageErrorFor(E)),1)):c(``,!0),O.value?.length?c(``,!0):(l(),h(u(e),{key:1},{default:a(()=>[o(u(t),null,{default:a(()=>[o(u(n),null,{default:a(()=>[...s[3]||=[i(`No credential bindings`,-1)]]),_:1})]),_:1})]),_:1})),o(w,{open:k.value,"onUpdate:open":s[0]||=e=>k.value=e,items:O.value??[],title:e=>e.service||`New binding`,"remove-label":`Remove`,mono:``,onRemove:s[1]||=e=>O.value.splice(e,1)},{default:a(({item:e,index:t})=>[o(u(S),{label:`Service`,for:`binding-${t}-service`},{default:a(()=>[o(u(v),{id:`binding-${t}-service`,modelValue:e.service,"onUpdate:modelValue":t=>e.service=t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),o(u(S),{label:`Organisation`,for:`binding-${t}-org`,hint:`Empty uses the default organisation.`},{default:a(()=>[o(u(v),{id:`binding-${t}-org`,modelValue:e.org,"onUpdate:modelValue":t=>e.org=t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),o(u(S),{label:`Secret`},{default:a(()=>[o(C,{modelValue:e.secret,"onUpdate:modelValue":t=>e.secret=t,"id-prefix":`binding-${t}-secret`},null,8,[`modelValue`,`onUpdate:modelValue`,`id-prefix`])]),_:2},1024)]),_:1},8,[`open`,`items`,`title`])]))}});export{D as default};
+1 -1
View File
@@ -1 +1 @@
import{A as e,D as t,Jt as n,O as r,at as i,b as a,ht as o,kn as s,lt as c,nr as l,s as u,t as d,v as f,x as p,xt as m,y as h,yn as g}from"./PageHeader.js";import{_,n as v,t as y}from"./api.js";import{i as b,n as x,r as S,t as C}from"./alert.js";import{_ as w,a as T,c as E,d as D,f as O,g as k,h as A,i as j,l as M,m as N,n as P,o as F,p as I,r as L,s as R,t as z,u as B}from"./index.js";function V(e,t=Date.now()){if(!e.captured)return`unconfigured`;if(!e.expires_at)return`ready`;let n=Date.parse(e.expires_at);return Number.isNaN(n)?`ready`:n<=t?`expired`:n-t<=18e5?`expiring`:`ready`}function H(e,t,n=80,r=24){let i=t.protocol===`https:`?`wss:`:`ws:`,a=new URLSearchParams({profile:e,cols:String(n),rows:String(r)}).toString();return`${i}//${t.host}/api/harness/terminal?${a}`}var U={class:`flex h-full min-h-0 flex-col gap-2`},W={key:0,class:`text-sm text-muted-foreground`,role:`status`},G=e({__name:`SetupTerminal`,props:{profile:{}},setup(e){let n=e,r=g(null),s=g(`connecting`),l=null,d=null,m=null,h=null;function _(){try{m?.fit()}catch{}}return c(()=>{let e=r.value;if(!e)return;l=new P({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),m=new z,l.loadAddon(m),l.open(e),_(),l.focus();let t=new WebSocket(H(n.profile,window.location,l?.cols??80,l?.rows??24));d=t,t.binaryType=`arraybuffer`,t.onopen=()=>{s.value=`open`},t.onmessage=e=>{l&&(typeof e.data==`string`?l.write(e.data):l.write(new Uint8Array(e.data)))},t.onerror=()=>{s.value=`failed`},t.onclose=()=>{s.value=`closed`},l.onData(e=>{t.readyState===WebSocket.OPEN&&t.send(e)}),h=new ResizeObserver(_),h.observe(e)}),i(()=>{h?.disconnect(),h=null,d?.close(),d=null,l?.dispose(),l=null,m=null}),(e,n)=>(o(),p(`div`,U,[s.value===`open`?a(``,!0):(o(),p(`p`,W,[s.value===`connecting`?(o(),p(u,{key:0},[t(`Connecting…`)],64)):s.value===`closed`?(o(),p(u,{key:1},[t(`The terminal session ended.`)],64)):(o(),p(u,{key:2},[t(`Could not open the setup terminal.`)],64))])),f(`div`,{ref_key:`host`,ref:r,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),K={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},q={key:1,class:`space-y-2`},J={class:`flex flex-col gap-1 text-sm`},Y=e({__name:`HarnessPage`,setup(e){let i=g(null),P=g(!0),z=g(null),H=g(!1),U=g(``),W=g(!1),Y={ready:{label:`Ready`,variant:`ok`},expiring:{label:`Expiring soon`,variant:`warn`},expired:{label:`Expired`,variant:`danger`},unconfigured:{label:`Not set up`,variant:`idle`}};c(X);async function X(){P.value=!0,z.value=null,H.value=!1;try{let e=await v.harnessBindings();i.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},U.value=i.value.profiles[0]??``}catch(e){let t=e instanceof y?e.status:void 0;t===501||t===503?H.value=!0:z.value=e instanceof Error?e.message:String(e),i.value=null}finally{P.value=!1}}function Z(){i.value?.terminal&&U.value&&(W.value=!0)}function Q(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function $(e){return e.scopes?.length?e.scopes.join(`, `):`—`}return(e,c)=>(o(),p(`div`,null,[r(d,{title:`Harness`}),z.value?(o(),p(`p`,K,l(z.value),1)):a(``,!0),P.value?(o(),p(`div`,q,[r(s(L),{class:`h-24 w-full`}),r(s(L),{class:`h-40 w-full`})])):H.value?(o(),h(s(w),{key:2},{default:n(()=>[r(s(A),null,{default:n(()=>[r(s(N),null,{default:n(()=>[...c[1]||=[t(`Harness bindings are not configured`,-1)]]),_:1}),r(s(k),null,{default:n(()=>[...c[2]||=[t(`Credential bindings and OAuth tokens unavailable.`,-1)]]),_:1})]),_:1})]),_:1})):i.value?(o(),p(u,{key:3},[i.value.terminal?(o(),h(s(I),{key:1,class:`mb-4`},{default:n(()=>[r(s(O),{class:`flex flex-wrap items-end gap-3`},{default:n(()=>[f(`label`,J,[c[6]||=f(`span`,{class:`text-muted-foreground`},`Profile`,-1),r(s(T),{size:`sm`,modelValue:U.value,"onUpdate:modelValue":c[0]||=e=>U.value=e,class:`min-w-48`,disabled:!i.value.profiles.length},{default:n(()=>[i.value.profiles.length?a(``,!0):(o(),h(s(j),{key:0,value:``},{default:n(()=>[...c[5]||=[t(`No profiles configured`,-1)]]),_:1})),(o(!0),p(u,null,m(i.value.profiles,e=>(o(),h(s(j),{key:e,value:e},{default:n(()=>[t(l(e),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`,`disabled`])]),r(s(_),{disabled:!U.value,onClick:Z},{default:n(()=>[...c[7]||=[t(`Open setup terminal`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})):(o(),h(s(S),{key:0,class:`mb-4`},{default:n(()=>[r(s(C),null,{default:n(()=>[...c[3]||=[t(`Setup terminal unavailable`,-1)]]),_:1}),r(s(x),null,{default:n(()=>[...c[4]||=[t(`Start the daemon with a container runtime and a harness token to log in to a CLI from here. Bindings are still listed below.`,-1)]]),_:1})]),_:1})),W.value&&U.value?(o(),h(s(I),{key:2,class:`mb-4`},{default:n(()=>[r(s(O),{class:`h-96`},{default:n(()=>[r(G,{profile:U.value},null,8,[`profile`])]),_:1})]),_:1})):a(``,!0),r(s(I),null,{default:n(()=>[r(s(O),null,Line truncated
import{a as e,c as t,i as n,o as r,r as i,s as a,t as o}from"./empty.js";import{A as s,D as c,Jt as l,O as u,at as d,b as f,ht as p,kn as m,lt as h,nr as g,s as _,t as v,v as y,x as b,xt as x,y as S,yn as C}from"./PageHeader.js";import{n as w,t as T,w as ee}from"./api.js";import{a as E,i as D,n as O,o as k,r as A,t as j}from"./SelectValue.js";import{a as M,c as N,d as P,f as F,i as I,l as L,n as R,o as z,s as B,t as V,u as H,y as U}from"./index.js";function W(e,t=Date.now()){if(!e.captured)return`unconfigured`;if(!e.expires_at)return`ready`;let n=Date.parse(e.expires_at);return Number.isNaN(n)?`ready`:n<=t?`expired`:n-t<=18e5?`expiring`:`ready`}function G(e,t,n=80,r=24){let i=t.protocol===`https:`?`wss:`:`ws:`,a=new URLSearchParams({profile:e,cols:String(n),rows:String(r)}).toString();return`${i}//${t.host}/api/harness/terminal?${a}`}var K={class:`flex h-full min-h-0 flex-col gap-2`},q={key:0,class:`text-sm text-fg-muted`,role:`status`},J=s({__name:`SetupTerminal`,props:{profile:{}},setup(e){let t=e,n=C(null),r=C(`connecting`),i=null,a=null,o=null,s=null;function l(){try{o?.fit()}catch{}}return h(()=>{let e=n.value;if(!e)return;i=new R({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),o=new V,i.loadAddon(o),i.open(e),l(),i.focus();let c=new WebSocket(G(t.profile,window.location,i?.cols??80,i?.rows??24));a=c,c.binaryType=`arraybuffer`,c.onopen=()=>{r.value=`open`},c.onmessage=e=>{i&&(typeof e.data==`string`?i.write(e.data):i.write(new Uint8Array(e.data)))},c.onerror=()=>{r.value=`failed`},c.onclose=()=>{r.value=`closed`},i.onData(e=>{c.readyState===WebSocket.OPEN&&c.send(e)}),s=new ResizeObserver(l),s.observe(e)}),d(()=>{s?.disconnect(),s=null,a?.close(),a=null,i?.dispose(),i=null,o=null}),(e,t)=>(p(),b(`div`,K,[r.value===`open`?f(``,!0):(p(),b(`p`,q,[r.value===`connecting`?(p(),b(_,{key:0},[c(`Connecting…`)],64)):r.value===`closed`?(p(),b(_,{key:1},[c(`The terminal session ended.`)],64)):(p(),b(_,{key:2},[c(`Could not open the setup terminal.`)],64))])),y(`div`,{ref_key:`host`,ref:n,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),Y={key:1,class:`flex flex-col gap-2`},X={class:`flex flex-col gap-1 text-sm`},Z=s({__name:`HarnessPage`,setup(s){let d=C(null),R=C(!0),V=C(null),G=C(!1),K=C(``),q=C(!1),Z={ready:{label:`Ready`,variant:`ok`},expiring:{label:`Expiring soon`,variant:`warn`},expired:{label:`Expired`,variant:`danger`},unconfigured:{label:`Not set up`,variant:`idle`}};h(Q);async function Q(){R.value=!0,V.value=null,G.value=!1;try{let e=await w.harnessBindings();d.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},K.value=d.value.profiles[0]??``}catch(e){let t=e instanceof T?e.status:void 0;t===501||t===503?G.value=!0:V.value=e instanceof Error?e.message:String(e),d.value=null}finally{R.value=!1}}function te(){d.value?.terminal&&K.value&&(q.value=!0)}function $(e){if(!e)return`–`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function ne(e){return e.scopes?.length?e.scopes.join(`, `):`–`}return(s,h)=>(p(),b(`div`,null,[u(v,{title:`Harness`}),V.value?(p(),S(m(a),{key:0,variant:`destructive`,class:`mb-4`},{default:l(()=>[u(m(e),null,{default:l(()=>[...h[1]||=[c(`Could not load the harness`,-1)]]),_:1}),u(m(r),null,{default:l(()=>[c(g(V.value),1)]),_:1})]),_:1})):f(``,!0),R.value?(p(),b(`div`,Y,[u(m(I),{class:`h-24 w-full`}),u(m(I),{class:`h-40 w-full`})])):G.value?(p(),S(m(n),{key:2},{default:l(()=>[u(m(i),null,{default:l(()=>[u(m(o),null,{default:l(()=>[...h[2]||=[c(`Harness bindings are not configured`,-1)]]),_:1})]),_:1})]),_:1})):d.value?(p(),b(_,{key:3},[d.value.terminal?(p(),S(m(F),{key:1,class:`mb-4`},{default:l(()=>[u(m(P),{class:`flex flex-wrap items-end gap-3`},{default:l(()=>[y(`div`,X,[u(m(U),{for:`harness-profile`,class:`text-fg-muted`},{default:l(()=>[...h[5]||=[c(`Profile`,-1)]]),_:1}),u(m(k),{modelValue:K.value,"onUpdate:modelValue":h[0]||=e=>K.value=e,disabled:!d.value.profiles.length},{default:l(()=>[u(m(O),{id:`harness-profile`,size:`sm`,class:`min-w-48`},{default:l(()=>[u(m(j),{placeholder:`No profiles configured`})]),_:1}),u(m(E),null,{default:l(()=>[u(m(D),null,{default:l(()=>[(p(!0),b(_,null,x(d.value.profiles,e=>(p(),S(m(A),{key:e,value:e},{default:l(()=>[c(g(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`modelValue`,`disabled`])]),u(m(ee),{disabled:!K.value,onClick:te},{default:l(()=>[...h[6]||=[c(`Open setup terminal`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})):(p(),S(m(a),{key:0,class:`mb-4`},{default:l(()=>[u(m(e),null,{default:l(()=>[...h[3]||=[c(`Setup terminal unavailable`,-1)]]),_:1}),u(m(r),null,{default:l(()=>[...h[4]||=[c(`Start the daemon with a container runtime and a harness token to log in to a CLI from here.`,-1)]]),_:1})]),_:1})),q.value&&K.value?(p(),S(m(F),{key:2,class:`mb-4`},{default:l(()=>[Line truncated
+1
View File
@@ -0,0 +1 @@
import{A as e,Dn as t,Qn as n,R as r,Sn as i,U as a,Ut as o,Wt as s,Xt as c,_ as l,dn as u,ht as d,kn as f,lt as p,mt as m,nt as h,x as g,yn as _}from"./PageHeader.js";import{S as v,T as y,X as b,b as x,c as S,d as C,f as w,g as T,h as E,l as D,m as O,p as k,u as A,v as j,y as M}from"./api.js";var N=w?window:void 0;w&&window.document,w&&window.navigator,w&&window.location;function P(e){let n=t(e);return n?.$el??n}function F(...e){let n=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),r=l(()=>{let n=j(t(e[0])).filter(e=>e!=null);return n.every(e=>typeof e!=`string`)?n:void 0});return v(()=>[r.value?.map(e=>P(e))??[N].filter(e=>e!=null),j(t(r.value?e[1]:e[0])),j(f(r.value?e[2]:e[1])),t(r.value?e[3]:e[2])],([e,t,r,i],a,o)=>{if(!e?.length||!t?.length||!r?.length)return;let s=O(i)?{...i}:i,c=e.flatMap(e=>t.flatMap(t=>r.map(r=>n(e,t,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function I(){let e=i(!1),t=r();return t&&p(()=>{e.value=!0},t),e}function L(e){let t=I();return l(()=>(t.value,!!e()))}var R=Symbol(`vueuse-ssr-width`);function z(){let e=a()?C(R,null):null;return typeof e==`number`?e:void 0}function B(e,n={}){let{window:r=N,ssrWidth:a=z()}=n,o=L(()=>r&&`matchMedia`in r&&typeof r.matchMedia==`function`),c=i(typeof a==`number`),u=i(),d=i(!1);return s(()=>{if(c.value){c.value=!o.value;let n=t(e).split(`,`);d.value=n.some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),r=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=!!(n||r);return n&&i&&(i=a>=T(n[1])),r&&i&&(i=a<=T(r[1])),t?!i:i})}else o.value&&(u.value=r.matchMedia(t(e)),d.value=u.value.matches)}),F(u,`change`,e=>{d.value=e.matches},{passive:!0}),l(()=>d.value)}var V={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function H(e,n={}){function r(n,r){let i=t(e[t(n)]);return r!=null&&(i=A(i,r)),typeof i==`number`&&(i=`${i}px`),i}let{window:a=N,strategy:o=`min-width`,ssrWidth:s=z()}=n,c=typeof s==`number`,u=c?i(!1):{value:!0};c&&M(()=>u.value=!!a);function d(e,t){return!u.value&&c?e===`min`?s>=T(t):s<=T(t):a?a.matchMedia(`(${e}-width: ${t})`).matches:!1}let f=e=>B(()=>`(min-width: ${r(e)})`,n),p=e=>B(()=>`(max-width: ${r(e)})`,n),m=Object.keys(e).reduce((e,t)=>(Object.defineProperty(e,t,{get:()=>o===`min-width`?f(t):p(t),enumerable:!0,configurable:!0}),e),{});function h(){let t=Object.keys(e).map(e=>[e,m[e],T(r(e))]).sort((e,t)=>e[2]-t[2]);return l(()=>t.filter(([,e])=>e.value).map(([e])=>e))}return Object.assign(m,{greaterOrEqual:f,smallerOrEqual:p,greater(e){return B(()=>`(min-width: ${r(e,.1)})`,n)},smaller(e){return B(()=>`(max-width: ${r(e,-.1)})`,n)},between(e,t){return B(()=>`(min-width: ${r(e)}) and (max-width: ${r(t,-.1)})`,n)},isGreater(e){return d(`min`,r(e,.1))},isGreaterOrEqual(e){return d(`min`,r(e))},isSmaller(e){return d(`max`,r(e,-.1))},isSmallerOrEqual(e){return d(`max`,r(e))},isInBetween(e,t){return d(`min`,r(e))&&d(`max`,r(t,-.1))},current:h,active(){let e=h();return l(()=>e.value.length===0?``:e.value.at(o===`min-width`?-1:0))}})}function U(e){return JSON.parse(JSON.stringify(e))}function W(e){let t=r(),n=S(()=>null,()=>e?P(e):t.proxy.$el);return m(n.trigger),p(n.trigger),n}function G(e){let t=B(`(prefers-reduced-motion: reduce)`,e);return l(()=>t.value?`reduce`:`no-preference`)}function K([e,t,n,r]){let i=(e,t)=>1-3*t+3*e,a=(e,t)=>3*t-6*e,o=e=>3*e,s=(e,t,n)=>((i(t,n)*e+a(t,n))*e+o(t))*e,c=(e,t,n)=>3*i(t,n)*e*e+2*a(t,n)*e+o(t),l=t=>{let r=t;for(let i=0;i<4;++i){let i=c(r,e,n);if(i===0)return r;let a=s(r,e,n)-t;r-=a/i}return r};return i=>e===t&&n===r?i:s(l(i),t,r)}function q(e,t,n){return e+n*(t-e)}function J(e,n,r){let i=t(e),a=t(n);if(typeof i==`number`&&typeof a==`number`)return q(i,a,r);if(Array.isArray(i)&&Array.isArray(a))return i.map((e,n)=>q(e,t(a[n]),r));throw TypeError(`Unknown transition type, specify an interpolation function.`)}function Y(e){return typeof e==`function`?e:t(e)??D}function X(e,n,r,i={}){let{window:a=N}=i,o=t(n),s=t(r),c=t(i.duration)??1e3,l=Date.now(),u=Date.now()+c,d=typeof i.interpolation==`function`?i.interpolation:J,f=i.easing===void 0?Y(i.transition):Y(i.easing),p=typeof f==`function`?f:K(f);return new Promise(t=>{e.value=o;let n=()=>{if(i.abort?.call(i)){t();return}let r=Date.now(),f=p((r-l)/c);e.value=d(o,s,f),r<u?a?.requestAnimationFrame(n):(e.value=s,t())};n()})}function Z(e,n={}){let r=0,a=()=>{let r=t(e);return n.interpolation===void 0&&Array.isArray(r)?r.map(t):r},s=i(a());return o(a,async e=>{var i,a;if(t(n.disabled))return;let o=++r;n.delay&&await E(t(n.delay)),o===r&&((i=n.onStarted)==null||i.call(n),await X(s,s.value,e,{...n,abort:()=>o!==r||n.abort?.call(n)}),(a=n.onFinished)==null||a.call(n))},{deep:!0}),o(()=>t(n.disabled),e=>{e&&(r++,s.value=a())}),x(()=>{r++}),l(()=>t(n.disabled)?a():s.value)}function Q(e,t,n,i={}){var a,s;let{clone:c=!1,passive:u=!1,eventName:d,deep:f=!1,defaultValue:p,shouldEmit:m}=i,g=r(),v=n||g?.emit||(g==null||(a=g.$emit)==null?void 0:a.bind(g))||(g==null||(s=g.proxy)==null||(s=s.$emit)==nuLine truncated
+1 -1
View File
@@ -1 +1 @@
import{d as e,o as t,s as n,t as r}from"./CardAccordion.js";import{A as i,D as a,Jt as o,O as s,_ as c,b as l,ht as u,kn as d,lt as f,nr as p,t as m,v as h,x as g,yn as _}from"./PageHeader.js";import{K as v,_ as y}from"./api.js";import{T as b,b as x}from"./index.js";var S={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},C={key:1,class:`text-sm text-fg-muted`},w=`eda-playbooks`,T=i({__name:`PlaybooksPage`,setup(i){let T=e();f(T.load);let E=c(()=>T.drafts[w]?.value),D=_(``),O=_(``),k=c(()=>T.changesFor(w).length>0);function A(){if(k.value)return;let e=D.value.trim();if(!e||E.value?.playbooks.some(t=>t.id===e))return;let t=T.drafts[w];t&&(t.value||={playbooks:[]},t.value.playbooks.push({id:e,yaml:``}),D.value=``,O.value=String(t.value.playbooks.length-1))}return(e,i)=>(u(),g(`div`,null,[s(m,{title:`Playbooks`},{default:o(()=>[s(t,{kinds:[w]},null,8,[`kinds`])]),_:1}),s(n,{kind:w,class:`mb-4`}),d(T).catalogError||d(T).pageErrorFor(w)?(u(),g(`p`,S,p(d(T).catalogError||d(T).pageErrorFor(w)),1)):l(``,!0),h(`form`,{class:`mb-4 flex gap-2`,onSubmit:v(A,[`prevent`])},[s(d(b),{modelValue:D.value,"onUpdate:modelValue":i[0]||=e=>D.value=e,"aria-label":`Playbook ID`,placeholder:`Playbook ID`,class:`max-w-xs`,disabled:k.value},null,8,[`modelValue`,`disabled`]),s(d(y),{type:`submit`,disabled:k.value||!D.value.trim()||E.value?.playbooks.some(e=>e.id===D.value.trim())},{default:o(()=>[...i[3]||=[a(`Add playbook`,-1)]]),_:1},8,[`disabled`])],32),E.value?.playbooks.length?l(``,!0):(u(),g(`p`,C,`No playbooks installed.`)),s(r,{open:O.value,"onUpdate:open":i[1]||=e=>O.value=e,items:E.value?.playbooks??[],title:e=>e.id,"remove-label":`Remove`,mono:``,onRemove:i[2]||=e=>E.value.playbooks.splice(e,1)},{default:o(({item:e,index:t})=>[s(d(x),{id:`playbook-${t}`,modelValue:e.yaml,"onUpdate:modelValue":t=>e.yaml=t,"aria-label":`${e.id} YAML`,class:`mb-3 min-h-64 font-mono`,spellcheck:`false`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`aria-label`])]),_:1},8,[`open`,`items`,`title`])]))}});export{T as default};
import{i as e,r as t,t as n}from"./empty.js";import{A as r,D as i,Jt as a,O as o,_ as s,b as c,ht as l,kn as u,lt as d,nr as f,t as p,v as m,x as h,y as g,yn as _}from"./PageHeader.js";import{$ as v,w as y}from"./api.js";import{t as b}from"./Input.js";import{_ as x,g as S,h as C,r as w,v as T}from"./index.js";var E={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},D=`eda-playbooks`,O=r({__name:`PlaybooksPage`,setup(r){let O=x();d(O.load);let k=s(()=>O.drafts[D]?.value),A=_(``),j=_(``),M=s(()=>O.changesFor(D).length>0);function N(){if(M.value)return;let e=A.value.trim();if(!e||k.value?.playbooks.some(t=>t.id===e))return;let t=O.drafts[D];t&&(t.value||={playbooks:[]},t.value.playbooks.push({id:e,yaml:``}),A.value=``,j.value=String(t.value.playbooks.length-1))}return(r,s)=>(l(),h(`div`,null,[o(p,{title:`Playbooks`},{default:a(()=>[o(C,{kinds:[D]},null,8,[`kinds`])]),_:1}),o(S,{kind:D,class:`mb-4`}),u(O).catalogError||u(O).pageErrorFor(D)?(l(),h(`p`,E,f(u(O).catalogError||u(O).pageErrorFor(D)),1)):c(``,!0),m(`form`,{class:`mb-4 flex flex-wrap gap-2`,onSubmit:v(N,[`prevent`])},[o(u(b),{modelValue:A.value,"onUpdate:modelValue":s[0]||=e=>A.value=e,"aria-label":`Playbook ID`,placeholder:`Playbook ID`,class:`max-w-xs`,disabled:M.value},null,8,[`modelValue`,`disabled`]),o(u(y),{type:`submit`,disabled:M.value||!A.value.trim()||k.value?.playbooks.some(e=>e.id===A.value.trim())},{default:a(()=>[...s[3]||=[i(`Add playbook`,-1)]]),_:1},8,[`disabled`])],32),k.value?.playbooks.length?c(``,!0):(l(),g(u(e),{key:1},{default:a(()=>[o(u(t),null,{default:a(()=>[o(u(n),null,{default:a(()=>[...s[4]||=[i(`No playbooks installed`,-1)]]),_:1})]),_:1})]),_:1})),o(w,{open:j.value,"onUpdate:open":s[1]||=e=>j.value=e,items:k.value?.playbooks??[],title:e=>e.id,"remove-label":`Remove`,mono:``,onRemove:s[2]||=e=>k.value.playbooks.splice(e,1)},{default:a(({item:e,index:t})=>[o(u(T),{id:`playbook-${t}`,modelValue:e.yaml,"onUpdate:modelValue":t=>e.yaml=t,"aria-label":`${e.id} YAML`,class:`mb-3 min-h-64 font-mono`,spellcheck:`false`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`aria-label`])]),_:1},8,[`open`,`items`,`title`])]))}});export{O as default};
+1
View File
@@ -0,0 +1 @@
import{A as e,B as t,C as n,D as r,F as i,G as a,J as o,K as s,O as c,P as l,S as u,T as d,V as f,W as p,_ as m,b as h,f as g,g as _,h as v,j as y,l as b,m as x,q as S,u as C,v as w,w as T,x as E,y as D}from"./empty.js";import{A as O,B as k,D as A,Dn as ee,En as te,Jt as j,O as M,Pt as ne,Qn as re,St as N,Tt as ie,Ut as P,V as ae,Wt as F,Y as oe,_ as I,_t as se,at as ce,b as L,d as le,er as ue,ht as R,kn as z,lt as B,nr as de,nt as V,pn as fe,pt as pe,s as me,tr as he,tt as H,v as ge,x as U,xt as _e,y as W,yn as G}from"./PageHeader.js";import{$ as K,D as ve,E as q,T as J,_ as Y}from"./api.js";import{t as ye}from"./createLucideIcon.js";function be(e,t=-1/0,n=1/0){return Math.min(n,Math.max(t,e))}function xe(e,t){let n=e,r=t.toString(),i=r.indexOf(`.`),a=i>=0?r.length-i:0;if(a>0){let e=10**a;n=Math.round(n*e)/e}return n}function Se(e,t,n,r){t=Number(t),n=Number(n);let i=(e-(Number.isNaN(t)?0:t))%r,a=xe(Math.abs(i)*2>=r?e+Math.sign(i)*(r-Math.abs(i)):e-i,r);return Number.isNaN(t)?!Number.isNaN(n)&&a>n&&(a=Math.floor(xe(n/r,r))*r):a<t?a=t:!Number.isNaN(n)&&a>n&&(a=t+Math.floor(xe((n-t)/r,r))*r),a=xe(a,r),a}function Ce(e){return I(()=>!ee(e)||!!y(e)?.closest(`form`))}function we(e){let t=f(``,1e3);return{search:t,handleTypeaheadSearch:(n,r)=>{if(t.value+=n,e)e(n);else{let e=s(),n=r.map(e=>({...e,textValue:e.value?.textValue??e.ref.textContent?.trim()??``})),i=n.find(t=>t.ref===e),a=Ee(n.map(e=>e.textValue),t.value,i?.textValue),o=n.find(e=>e.textValue===a);return o&&o.ref.focus(),o?.ref}},resetTypeahead:()=>{t.value=``}}}function Te(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Ee(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Te(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function De(){let e=G();return{primitiveElement:e,currentElement:I(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:y(e))}}var Oe=`menu.itemSelect`,ke=[`Enter`,` `],Ae=[`ArrowDown`,`PageUp`,`Home`],je=[`ArrowUp`,`PageDown`,`End`],Me=[...Ae,...je],Ne={ltr:[...ke,`ArrowRight`],rtl:[...ke,`ArrowLeft`]},Pe={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]};function Fe(e){return e?`open`:`closed`}function Ie(e){let{onEntryFocus:t,onEntryFocusOnce:n,...r}=e;return r}function Le(e){let t=s();for(let n of e)if(n===t||(n.focus(),s()!==t))return}function Re(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function ze(e,t){return t?Re({x:e.clientX,y:e.clientY},t):!1}function Be(e){return e.pointerType===`mouse`}var Ve=`data-reka-collection-item`;function X(e={}){let{key:t=``,isProvider:n=!1}=e,r=`${t}CollectionProvider`,i;if(n){let e=G(new Map);i={collectionRef:G(),itemMap:e},se(r,i)}else i=oe(r);let a=(e,t=!1)=>{if(!i.collectionRef.value)return;let n=i.itemMap.value.get(e);return n&&(t||n.ref.dataset.disabled!==``)?n:void 0},o=(e=!1)=>{let t=i.collectionRef.value;if(!t)return[];let n=Array.from(t.querySelectorAll(`[${Ve}]`)),r=new Map(n.map((e,t)=>[e,t])),a=Array.from(i.itemMap.value.values()).sort((e,t)=>(r.get(e.ref)??-1)-(r.get(t.ref)??-1));return e?a:a.filter(e=>e.ref.dataset.disabled!==``)},s=O({name:`CollectionSlot`,inheritAttrs:!1,setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=De();return P(a,()=>{i.collectionRef.value=a.value}),()=>ae(ve,{ref:r,...n},t)}}),c=O({name:`CollectionItem`,inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=De();return F(t=>{if(a.value){let n=fe(a.value);i.itemMap.value.set(n,{ref:a.value,value:e.value}),t(()=>i.itemMap.value.delete(n))}}),()=>ae(ve,{...n,[Ve]:``,ref:r},t)}});return{getItems:o,getItem:a,reactiveItems:I(()=>Array.from(i.itemMap.value.values())),itemMapSize:I(()=>i.itemMap.value.size),CollectionSlot:s,CollectionItem:c}}var He=O({__name:`VisuallyHidden`,props:{feature:{type:String,required:!1,default:`focusable`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(t,n)=>(R(),W(z(q),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature===`fully-hidden`?`true`:void 0,"data-hidden":e.feature===`fully-hidden`?``:void 0,tabindex:e.feature===`fully-hidden`?`-1`:void 0,style:{position:`absolute`,border:0,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`,wordWrap:`normal`,top:`-1px`,left:`-1px`}},{default:j(()=>[N(t.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}});function Ue(t){let n=e({nonce:G()});return I(()=>t?.value||n.nonce?.value)}var[We,Ge]=S(`FieldRoot`),Ke=[` `,`Enter`,`ArrowUp`,`ArrowDown`],qe=[` `,`Enter`];function Z(e,t,n){return e===void 0?!1:Array.isArray(e)?e.some(e=>Je(e,t,n)):Je(e,t,n)}function Je(e,t,n){return e===void 0||t===void 0?!1:typeof e==`string`?e===t:typeof n==`funct Line truncated
-1
View File
@@ -1 +0,0 @@
import{A as e,Jt as t,Qn as n,St as r,ht as i,kn as a,tt as o,x as s,y as c}from"./PageHeader.js";import{S as l,m as u,v as d,y as f}from"./api.js";import{t as p}from"./createLucideIcon.js";var m=p({name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}),h=e({__name:`Badge`,props:{asChild:{type:Boolean},as:{},variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let n=e,s=u(n,`class`);return(l,u)=>(i(),c(a(f),o({"data-slot":`badge`,"data-variant":e.variant,class:a(d)(a(g)({variant:e.variant}),n.class)},a(s)),{default:t(()=>[r(l.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),g=l(`h-5 gap-1 rounded-sm border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`,ok:`bg-ok-soft text-ok`,warn:`bg-warn-soft text-warn`,danger:`bg-danger-soft text-danger`,info:`bg-info-soft text-info`,idle:`bg-idle-soft text-idle`}},defaultVariants:{variant:`default`}}),_=e({__name:`Alert`,props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(e){let t=e;return(o,c)=>(i(),s(`div`,{"data-slot":`alert`,class:n(a(d)(a(b)({variant:e.variant}),t.class)),role:`alert`},[r(o.$slots,`default`)],2))}}),v=e({__name:`AlertDescription`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,o)=>(i(),s(`div`,{"data-slot":`alert-description`,class:n(a(d)(`text-muted-foreground text-sm text-balance md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,t.class))},[r(e.$slots,`default`)],2))}}),y=e({__name:`AlertTitle`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,o)=>(i(),s(`div`,{"data-slot":`alert-title`,class:n(a(d)(`font-medium group-has-[>svg]/alert:col-start-2 cn-font-heading [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,t.class))},[r(e.$slots,`default`)],2))}}),b=l(`grid gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*=size-])]:size-4 group/alert relative w-full`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});export{m as a,h as i,v as n,_ as r,y as t};
+3 -3
View File
@@ -1,3 +1,3 @@
import{$n as e,A as t,An as n,Bn as r,Bt as i,Dn as a,En as o,Et as s,Fn as c,Gn as l,Hn as u,In as d,Jn as f,Jt as p,Kn as m,Ln as h,Mn as g,Nn as _,O as ee,Pn as v,Qn as y,R as b,Rn as te,S as ne,Sn as x,St as S,U as C,Un as re,Ut as w,V as ie,Vn as ae,Wn as T,Wt as E,Xn as D,Y as oe,Yn as O,Zn as k,_ as A,_n as se,dn as ce,g as le,ht as j,i as M,ir as ue,jn as de,kn as N,kt as fe,l as pe,lt as P,m as me,mn as he,mt as ge,n as _e,nt as ve,on as ye,ot as be,pt as xe,qn as Se,r as Ce,rn as we,s as Te,tt as Ee,w as De,wn as Oe,xn as ke,y as Ae,yn as je,yt as Me,z as Ne,zn as F}from"./PageHeader.js";var Pe=void 0,Fe=typeof window<`u`&&window.trustedTypes;if(Fe)try{Pe=Fe.createPolicy(`vue`,{createHTML:e=>e})}catch{}var Ie=Pe?e=>Pe.createHTML(e):e=>e,Le=`http://www.w3.org/2000/svg`,Re=`http://www.w3.org/1998/Math/MathML`,I=typeof document<`u`?document:null,ze=I&&I.createElement(`template`),Be={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?I.createElementNS(Le,e):t===`mathml`?I.createElementNS(Re,e):n?I.createElement(e,{is:n}):I.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>I.createTextNode(e),createComment:e=>I.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>I.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{ze.innerHTML=Ie(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=ze.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},L=`transition`,Ve=`animation`,He=Symbol(`_vtc`),Ue={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},We=v({},Ce,Ue),Ge=(e=>(e.displayName=`Transition`,e.props=We,e))((e,{slots:t})=>ie(_e,qe(e),t)),R=(e,t=[])=>{F(e)?e.forEach(e=>e(...t)):e&&e(...t)},Ke=e=>e?F(e)?e.some(e=>e.length>1):e.length>1:!1;function qe(e){let t={};for(let n in e)n in Ue||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=Je(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:_,onEnter:ee,onEnterCancelled:y,onLeave:b,onLeaveCancelled:te,onBeforeAppear:ne=_,onAppear:x=ee,onAppearCancelled:S=y}=t,C=(e,t,n,r)=>{e._enterCancelled=r,B(e,t?u:s),B(e,t?l:o),n&&n()},re=(e,t)=>{e._isLeaving=!1,B(e,d),B(e,p),B(e,f),t&&t()},w=e=>(t,n)=>{let i=e?x:ee,o=()=>C(t,e,n);R(i,[t,o]),Xe(()=>{B(t,e?c:a),z(t,e?u:s),Ke(i)||Qe(t,r,h,o)})};return v(t,{onBeforeEnter(e){R(_,[e]),z(e,a),z(e,o)},onBeforeAppear(e){R(ne,[e]),z(e,c),z(e,l)},onEnter:w(!1),onAppear:w(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>re(e,t);z(e,d),e._enterCancelled?(z(e,f),nt(e)):(nt(e),z(e,f)),Xe(()=>{e._isLeaving&&(B(e,d),z(e,p),Ke(b)||Qe(e,r,g,n))}),R(b,[e,n])},onEnterCancelled(e){C(e,!1,void 0,!0),R(y,[e])},onAppearCancelled(e){C(e,!0,void 0,!0),R(S,[e])},onLeaveCancelled(e){re(e),R(te,[e])}})}function Je(e){if(e==null)return null;if(u(e))return[Ye(e.enter),Ye(e.leave)];{let t=Ye(e);return[t,t]}}function Ye(e){return ue(e)}function z(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[He]||(e[He]=new Set)).add(t)}function B(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[He];n&&(n.delete(t),n.size||(e[He]=void 0))}function Xe(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Ze=0;function Qe(e,t,n,r){let i=e._endId=++Ze,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=$e(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function $e(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${L}Delay`),a=r(`${L}Duration`),o=et(i,a),s=r(`${Ve}Delay`),c=r(`${Ve}Duration`),l=et(s,c),u=null,d=0,f=0;t===L?o>0&&(u=L,d=o,f=a.length):t===Ve?l>0&&(u=Ve,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?L:Ve:null,f=u?u===L?a.length:c.length:0);let p=u===L&&/\b(?:transform|all)(?:,|$)/.test(r(`${L}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function et(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>tt(t)+ttLine truncated
`))),e[U]=H(i);let a=r||i.props&&i.props.type===`number`;V(e,t?`change`:`input`,t=>{t.target.composing||e[U](on(e.value,n,a))}),(n||a)&&V(e,`change`,()=>{e.value=on(e.value,n,a)}),t||(V(e,`compositionstart`,nn),V(e,`compositionend`,rn),V(e,`change`,rn))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[an];delete e[an],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[U](on(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[U]=H(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?k(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},cn={deep:!0,created(e,t,n){e[U]=H(n),V(e,`change`,()=>{let t=e._modelValue,n=mn(e),r=e.checked,i=e[U];if(F(t)){let e=D(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(l(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(hn(e,r))})},mounted:ln,beforeUpdate(e,t,n){e[U]=H(n),ln(e,t,n)}};function ln(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(F(t))i=D(t,r.props.value)>-1;else if(l(t))i=t.has(r.props.value);else{if(t===n)return;i=O(t,hn(e,!0))}e.checked!==i&&(e.checked=i)}var un={created(e,{value:t},n){e.checked=O(t,n.props.value),e[U]=H(n),V(e,`change`,()=>{e[U](mn(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[U]=H(r),t!==n&&(e.checked=O(t,r.props.value))}},dn={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,V(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?k(mn(e)):mn(e)),r=e.multiple,i=r?l(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?F(i)?t.slice():t:i];try{e[U](i)}finally{ve(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[U]=H(r)},mounted(e,{value:t}){pn(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[U]=H(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!fn(t,n[1],n[0]))&&pn(e,t)}};function fn(e,t,n){if(!n||F(e))return O(e,t);if(l(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function pn(e,t){let n=e.multiple,r=F(t);if(!n||r||l(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=mn(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):D(t,o)>-1}else a.selected=t.has(o)}else if(O(mn(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function mn(e){return`_value`in e?e._value:e.value}function hn(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var gn={created(e,t,n){vn(e,t,n,null,`created`)},mounted(e,t,n){vn(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){vn(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){vn(e,t,n,r,`updated`)}};function _n(e,t){switch(e){case`SELECT`:return dn;case`TEXTAREA`:return sn;default:switch(t){case`checkbox`:return cn;case`radio`:return un;default:return sn}}}function vn(e,t,n,r,i){let a=_n(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function yn(){sn.getSSRProps=({value:e})=>({value:e}),un.getSSRProps=({value:e},t)=>{if(t.props&&O(t.props.value,e))return{checked:!0}},cn.getSSRProps=({value:e},t)=>{if(F(e)){if(t.props&&D(e,t.props.value)>-1)return{checked:!0}}else if(l(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},gn.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=_n(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var bn=[`ctrl`,`shift`,`alt`,`meta`],xn={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>bn.some(n=>e[`${n}Key`]&&!t.includes(n))},Sn=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=xn[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Cn={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},wn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=d(n.key);if(t.some(e=>e===r||Cn[e]===r))return e(n)}))},Tn=v({patchProp:Ft},Be),En,Dn=!1;function On(){return En||=De(Tn)}function kn(){return En=Dn?En:ne(Tn),Dn=!0,En}var An=((...e)=>{On().render(...e)}),jn=((...e)=>{kn().hydrate(...e)}),Mn=((...e)=>{let t=On().createApp(...e),{mount:n}=t;return t.mount=e=>{let i=Fn(e);if(!i)return;let a=t._component;!r(a)&&!a.render&&!a.template&&(a.template=i.innerHTML),i.nodeType===1&&(i.textContent=``);let o=n(i,!1,Pn(i));return i instanceof Element&&(i.removeAttribute(`v-cloak`),i.setAttribute(`data-v-app`,``)),o},t}),Nn=((...e)=>{let t=kn().createApp(...e),{mount: Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var ca;function la(e){ca=e}var ua=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function da(e){let t=e instanceof ua?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function fa(e,t){let n=await fetch(e,t);if(ca?.(n.status===401),!n.ok)throw new ua(await sa(n),n.status);return n}async function $(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=oa,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await fa(e,s);return a?await c.json():void 0}var pa={recoveryCode:()=>$(`/api/account/recovery`,{method:`POST`,body:{}}),recoverAccount:(e,t,n)=>$(`/api/auth/recover`,{method:`POST`,body:{email:e,code:t,password:n},parse:!1}),authStatus:()=>$(`/api/auth/status`),setupAccount:e=>$(`/api/auth/setup`,{method:`POST`,body:e}),signIn:(e,t)=>$(`/api/auth/login`,{method:`POST`,body:{email:e,password:t}}),signOut:()=>$(`/api/auth/logout`,{method:`POST`,body:{},parse:!1}),createAccount:e=>$(`/api/accounts`,{method:`POST`,body:e}),changePassword:(e,t)=>$(`/api/account/password`,{method:`POST`,body:{current_password:e,new_password:t},parse:!1}),authentication:()=>$(`/api/authentication`),saveAuthentication:e=>$(`/api/authentication`,{method:`PUT`,body:e,parse:!1}),passkeys:()=>$(`/api/account/passkeys`),deletePasskey:e=>$(`/api/account/passkeys/${encodeURIComponent(e)}`,{method:`DELETE`,body:{},parse:!1}),beginPasskey:e=>$(e?`/api/account/passkeys/begin`:`/api/auth/passkey/begin`,{method:`POST`,body:{}}),finishPasskey:(e,t,n)=>$(e?`/api/account/passkeys/finish`:`/api/auth/passkey/finish`,{method:`POST`,body:{credential:t,name:n}}),secretEngines:()=>$(`/api/secret-engines`),checkSecret:e=>$(`/api/secret-references/check`,{method:`POST`,body:e}),health:()=>$(`/health/detailed`),services:()=>$(`/api/services`),policies:()=>$(`/api/access/policies`),putPolicy:e=>$(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>$(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),orgs:()=>$(`/api/orgs`),orgCreate:e=>$(`/api/orgs`,{method:`POST`,body:e}),org:e=>$(`/api/orgs/${encodeURIComponent(e)}`),orgWorkspaces:e=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`),createOrgWorkspace:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`,{method:`POST`,body:t}),orgAgents:e=>$(`/api/orgs/${encodeURIComponent(e)}/agents`),orgMembers:e=>$(`/api/orgs/${encodeURIComponent(e)}/members`),addOrgMember:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/members`,{method:`POST`,body:t}),setOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PUT`,body:n}),removeOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`+Q({workspace:n}),{method:`DELETE`,parse:!1}),assignOrgAgent:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:`PUT`}),alerts:()=>$(`/api/alerts`),dismissAlert:e=>$(`/api/alerts/${e}/dismiss`,{method:`POST`,parse:!1}),identities:()=>$(`/api/identities`),identityCreate:e=>$(`/api/identities`,{method:`POST`,body:e}),identityCommand:(e,t,n)=>$(`/api/identities/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`POST`,body:n}),summary:()=>$(`/api/summary`),tasks:()=>$(`/api/tasks`),taskPage:async e=>{let t=await fa(`/api/tasks`+Q(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(oa)});return{tasks:await t.json(),next:t.headers.get(`X-Next-Cursor`)}},taskMeta:()=>$(`/api/task-meta`),task:e=>$(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>$(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/changes`+Q(t)),taskDebug:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/debug`+Q(t)),taskAction:(e,t,n)=>$(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>$(`/api/setup`),capabilities:()=>$(`/api/capabilities`),workflows:()=>$(`/api/workflows`),workflowEnabled:(e,t)=>$(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),checkRepository:e=>$(`/api/control-plane/resources/repository-policies/check`,{method:`POST`,body:e,timeoutMs:35e3}),repositories:()=>$(`/api/repositories`),workRequest:e=>$(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>$(`/api/skills`),channels:()=>$(`/api/channels`),curators:()=>$(`/api/curators`),channelReload:e=>$(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>$(`/api/config`),logs:e=>$(`/api/logs`+Q(e)),taskLogs:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/logs`+Q(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),ver Line truncated
import{$n as e,A as t,An as n,Bn as r,Bt as i,Dn as a,En as o,Et as s,Fn as c,Gn as l,Hn as u,In as d,Jn as f,Jt as p,Kn as m,Ln as h,Mn as g,Nn as ee,O as _,Pn as v,Qn as y,R as b,Rn as te,S as ne,Sn as x,St as S,U as re,Un as ie,Ut as C,V as ae,Vn as oe,Wn as w,Xn as T,Y as E,Yn as D,Zn as se,_ as O,_n as ce,dn as le,g as ue,ht as de,i as k,ir as A,jn as fe,kn as j,kt as M,l as pe,lt as me,m as he,mn as ge,mt as _e,n as ve,nt as ye,on as be,ot as xe,pt as Se,qn as N,r as Ce,rn as we,s as Te,tt as Ee,w as De,wn as Oe,xn as ke,y as Ae,yt as je,z as Me,zn as P}from"./PageHeader.js";var Ne=void 0,Pe=typeof window<`u`&&window.trustedTypes;if(Pe)try{Ne=Pe.createPolicy(`vue`,{createHTML:e=>e})}catch{}var Fe=Ne?e=>Ne.createHTML(e):e=>e,Ie=`http://www.w3.org/2000/svg`,Le=`http://www.w3.org/1998/Math/MathML`,F=typeof document<`u`?document:null,Re=F&&F.createElement(`template`),ze={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?F.createElementNS(Ie,e):t===`mathml`?F.createElementNS(Le,e):n?F.createElement(e,{is:n}):F.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>F.createTextNode(e),createComment:e=>F.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>F.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{Re.innerHTML=Fe(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Re.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},I=`transition`,Be=`animation`,Ve=Symbol(`_vtc`),He={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Ue=v({},Ce,He),We=(e=>(e.displayName=`Transition`,e.props=Ue,e))((e,{slots:t})=>ae(ve,qe(e),t)),Ge=(e,t=[])=>{P(e)?e.forEach(e=>e(...t)):e&&e(...t)},Ke=e=>e?P(e)?e.some(e=>e.length>1):e.length>1:!1;function qe(e){let t={};for(let n in e)n in He||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=Je(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:ee,onEnter:_,onEnterCancelled:y,onLeave:b,onLeaveCancelled:te,onBeforeAppear:ne=ee,onAppear:x=_,onAppearCancelled:S=y}=t,re=(e,t,n,r)=>{e._enterCancelled=r,R(e,t?u:s),R(e,t?l:o),n&&n()},ie=(e,t)=>{e._isLeaving=!1,R(e,d),R(e,p),R(e,f),t&&t()},C=e=>(t,n)=>{let i=e?x:_,o=()=>re(t,e,n);Ge(i,[t,o]),Xe(()=>{R(t,e?c:a),L(t,e?u:s),Ke(i)||Qe(t,r,h,o)})};return v(t,{onBeforeEnter(e){Ge(ee,[e]),L(e,a),L(e,o)},onBeforeAppear(e){Ge(ne,[e]),L(e,c),L(e,l)},onEnter:C(!1),onAppear:C(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>ie(e,t);L(e,d),e._enterCancelled?(L(e,f),nt(e)):(nt(e),L(e,f)),Xe(()=>{e._isLeaving&&(R(e,d),L(e,p),Ke(b)||Qe(e,r,g,n))}),Ge(b,[e,n])},onEnterCancelled(e){re(e,!1,void 0,!0),Ge(y,[e])},onAppearCancelled(e){re(e,!0,void 0,!0),Ge(S,[e])},onLeaveCancelled(e){ie(e),Ge(te,[e])}})}function Je(e){if(e==null)return null;if(u(e))return[Ye(e.enter),Ye(e.leave)];{let t=Ye(e);return[t,t]}}function Ye(e){return A(e)}function L(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Ve]||(e[Ve]=new Set)).add(t)}function R(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[Ve];n&&(n.delete(t),n.size||(e[Ve]=void 0))}function Xe(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Ze=0;function Qe(e,t,n,r){let i=e._endId=++Ze,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=$e(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function $e(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${I}Delay`),a=r(`${I}Duration`),o=et(i,a),s=r(`${Be}Delay`),c=r(`${Be}Duration`),l=et(s,c),u=null,d=0,f=0;t===I?o>0&&(u=I,d=o,f=a.length):t===Be?l>0&&(u=Be,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?I:Be:null,f=u?u===I?a.length:c.length:0);let p=u===I&&/\b(?:transform|all)(?:,|$)/.test(r(`${I}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function et(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>tt(t)+tt(e[n])Line truncated
`))),e[V]=B(i);let a=r||i.props&&i.props.type===`number`;z(e,t?`change`:`input`,t=>{t.target.composing||e[V](on(e.value,n,a))}),(n||a)&&z(e,`change`,()=>{e.value=on(e.value,n,a)}),t||(z(e,`compositionstart`,nn),z(e,`compositionend`,rn),z(e,`change`,rn))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[an];delete e[an],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[V](on(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[V]=B(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?se(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},cn={deep:!0,created(e,t,n){e[V]=B(n),z(e,`change`,()=>{let t=e._modelValue,n=mn(e),r=e.checked,i=e[V];if(P(t)){let e=T(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(l(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(hn(e,r))})},mounted:ln,beforeUpdate(e,t,n){e[V]=B(n),ln(e,t,n)}};function ln(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(P(t))i=T(t,r.props.value)>-1;else if(l(t))i=t.has(r.props.value);else{if(t===n)return;i=D(t,hn(e,!0))}e.checked!==i&&(e.checked=i)}var un={created(e,{value:t},n){e.checked=D(t,n.props.value),e[V]=B(n),z(e,`change`,()=>{e[V](mn(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[V]=B(r),t!==n&&(e.checked=D(t,r.props.value))}},dn={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,z(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?se(mn(e)):mn(e)),r=e.multiple,i=r?l(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?P(i)?t.slice():t:i];try{e[V](i)}finally{ye(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[V]=B(r)},mounted(e,{value:t}){pn(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[V]=B(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!fn(t,n[1],n[0]))&&pn(e,t)}};function fn(e,t,n){if(!n||P(e))return D(e,t);if(l(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function pn(e,t){let n=e.multiple,r=P(t);if(!n||r||l(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=mn(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):T(t,o)>-1}else a.selected=t.has(o)}else if(D(mn(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function mn(e){return`_value`in e?e._value:e.value}function hn(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var gn={created(e,t,n){vn(e,t,n,null,`created`)},mounted(e,t,n){vn(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){vn(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){vn(e,t,n,r,`updated`)}};function _n(e,t){switch(e){case`SELECT`:return dn;case`TEXTAREA`:return sn;default:switch(t){case`checkbox`:return cn;case`radio`:return un;default:return sn}}}function vn(e,t,n,r,i){let a=_n(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function yn(){sn.getSSRProps=({value:e})=>({value:e}),un.getSSRProps=({value:e},t)=>{if(t.props&&D(t.props.value,e))return{checked:!0}},cn.getSSRProps=({value:e},t)=>{if(P(e)){if(t.props&&T(e,t.props.value)>-1)return{checked:!0}}else if(l(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},gn.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=_n(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var bn=[`ctrl`,`shift`,`alt`,`meta`],xn={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>bn.some(n=>e[`${n}Key`]&&!t.includes(n))},Sn=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=xn[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Cn={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},wn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=d(n.key);if(t.some(e=>e===r||Cn[e]===r))return e(n)}))},Tn=v({patchProp:Ft},ze),En,Dn=!1;function On(){return En||=De(Tn)}function kn(){return En=Dn?En:ne(Tn),Dn=!0,En}var An=((...e)=>{On().render(...e)}),jn=((...e)=>{kn().hydrate(...e)}),Mn=((...e)=>{let t=On().createApp(...e),{mount:n}=t;return t.mount=e=>{let i=Fn(e);if(!i)return;let a=t._component;!r(a)&&!a.render&&!a.template&&(a.template=i.innerHTML),i.nodeType===1&&(i.textContent=``);let o=n(i,!1,Pn(i));return i instanceof Element&&(i.removeAttribute(`v-cloak`),i.setAttribute(`data-v-app`,``)),o},t}),Nn=((...e)=>{let t=kn().createApp(...e),{moun Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Bi;function Vi(e){Bi=e}var Hi=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Ui(e){let t=e instanceof Hi?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function Wi(e,t){let n=await fetch(e,t);if(Bi?.(n.status===401),!n.ok)throw new Hi(await zi(n),n.status);return n}async function $(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Ri,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await Wi(e,s);return a?await c.json():void 0}var Gi={recoveryCode:()=>$(`/api/account/recovery`,{method:`POST`,body:{}}),recoverAccount:(e,t,n)=>$(`/api/auth/recover`,{method:`POST`,body:{email:e,code:t,password:n},parse:!1}),authStatus:()=>$(`/api/auth/status`),setupAccount:e=>$(`/api/auth/setup`,{method:`POST`,body:e}),signIn:(e,t)=>$(`/api/auth/login`,{method:`POST`,body:{email:e,password:t}}),signOut:()=>$(`/api/auth/logout`,{method:`POST`,body:{},parse:!1}),createAccount:e=>$(`/api/accounts`,{method:`POST`,body:e}),changePassword:(e,t)=>$(`/api/account/password`,{method:`POST`,body:{current_password:e,new_password:t},parse:!1}),authentication:()=>$(`/api/authentication`),saveAuthentication:e=>$(`/api/authentication`,{method:`PUT`,body:e,parse:!1}),tokens:()=>$(`/api/tokens`),createToken:()=>$(`/api/tokens`,{method:`POST`,body:{}}),revokeToken:e=>$(`/api/tokens/${encodeURIComponent(e)}`,{method:`DELETE`,body:{},parse:!1}),passkeys:()=>$(`/api/account/passkeys`),deletePasskey:e=>$(`/api/account/passkeys/${encodeURIComponent(e)}`,{method:`DELETE`,body:{},parse:!1}),beginPasskey:e=>$(e?`/api/account/passkeys/begin`:`/api/auth/passkey/begin`,{method:`POST`,body:{}}),finishPasskey:(e,t,n)=>$(e?`/api/account/passkeys/finish`:`/api/auth/passkey/finish`,{method:`POST`,body:{credential:t,name:n}}),secretEngines:()=>$(`/api/secret-engines`),checkSecret:e=>$(`/api/secret-references/check`,{method:`POST`,body:e}),health:()=>$(`/health/detailed`),services:()=>$(`/api/services`),policies:()=>$(`/api/access/policies`),putPolicy:e=>$(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>$(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),orgs:()=>$(`/api/orgs`),orgCreate:e=>$(`/api/orgs`,{method:`POST`,body:e}),org:e=>$(`/api/orgs/${encodeURIComponent(e)}`),orgWorkspaces:e=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`),createOrgWorkspace:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`,{method:`POST`,body:t}),orgAgents:e=>$(`/api/orgs/${encodeURIComponent(e)}/agents`),orgMembers:e=>$(`/api/orgs/${encodeURIComponent(e)}/members`),addOrgMember:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/members`,{method:`POST`,body:t}),setOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PUT`,body:n}),removeOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`+Q({workspace:n}),{method:`DELETE`,parse:!1}),assignOrgAgent:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:`PUT`}),alerts:()=>$(`/api/alerts`),dismissAlert:e=>$(`/api/alerts/${e}/dismiss`,{method:`POST`,parse:!1}),identities:()=>$(`/api/identities`),identityCreate:e=>$(`/api/identities`,{method:`POST`,body:e}),identityCommand:(e,t,n)=>$(`/api/identities/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`POST`,body:n}),summary:()=>$(`/api/summary`),tasks:()=>$(`/api/tasks`),taskPage:async e=>{let t=await Wi(`/api/tasks`+Q(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(Ri)});return{tasks:await t.json(),next:t.headers.get(`X-Next-Cursor`)}},taskMeta:()=>$(`/api/task-meta`),task:e=>$(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>$(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/changes`+Q(t)),taskDebug:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/debug`+Q(t)),taskAction:(e,t,n)=>$(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>$(`/api/setup`),capabilities:()=>$(`/api/capabilities`),workflows:()=>$(`/api/workflows`),workflowEnabled:(e,t)=>$(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),checkRepository:e=>$(`/api/control-plane/resources/repository-policies/check`,{method:`POST`,body:e,timeoutMs:35e3}),repositories:()=>$(`/api/repositories`),workRequest:e=>$(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>$(`/api/skills`),channels:()=>$(`/api/channels`),curators:()=>$(`/api/curators`),channelReload:e=>$(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>$(`/api/config`),logs:e=>$(`/api/logs`+Q(e)), Line truncated
+3
View File
@@ -0,0 +1,3 @@
import{$ as e,$t as t,A as n,At as r,B as i,Bt as a,C as o,Cn as s,Ct as c,D as l,Dn as u,Dt as d,E as f,En as p,Et as m,F as h,Ft as g,G as _,Gt as v,H as y,Ht as b,I as x,It as S,J as C,Jt as w,K as T,Kt as E,L as ee,Lt as te,M as ne,Mn as re,Mt as ie,N as ae,Nn as oe,Nt as se,O as ce,On as le,Ot as ue,P as de,Pt as fe,Q as pe,Qn as me,Qt as he,R as D,Rt as ge,S as _e,Sn as ve,St as O,T as ye,Tn as be,Tt as xe,U as Se,Ut as k,V as Ce,Vt as we,W as Te,Wt as A,X as Ee,Xt as De,Y as Oe,Yt as ke,Z as Ae,Zt as je,_ as j,_n as Me,_t as Ne,a as Pe,an as Fe,at as Ie,b as Le,bn as Re,bt as ze,c as Be,cn as Ve,ct as He,d as Ue,dn as We,dt as Ge,en as Ke,er as qe,et as Je,f as Ye,fn as Xe,ft as Ze,g as Qe,gn as $e,gt as et,h as tt,hn as nt,ht as M,i as rt,in as it,it as at,j as ot,jt as st,k as ct,kn as N,kt as lt,l as ut,ln as dt,lt as ft,m as pt,mn as mt,mt as ht,n as gt,nn as _t,nr as vt,nt as P,o as yt,on as bt,ot as xt,p as St,pn as Ct,pt as wt,q as Tt,qt as Et,r as Dt,rn as Ot,rr as kt,rt as At,s as jt,sn as Mt,st as Nt,tn as Pt,tr as Ft,tt as It,u as Lt,un as Rt,ut as zt,v as Bt,vn as Vt,vt as Ht,w as Ut,wn as Wt,wt as Gt,x as F,xn as I,xt as Kt,y as L,yn as R,yt as qt,z as Jt,zt as Yt}from"./PageHeader.js";import{$ as Xt,A as Zt,B as Qt,E as $t,F as en,G as tn,H as nn,I as rn,J as an,K as on,L as sn,M as cn,N as ln,O as un,P as dn,Q as fn,R as pn,T as z,U as mn,V as hn,W as gn,X as _n,Y as vn,Z as yn,_ as bn,j as xn,k as Sn,q as Cn,z as wn}from"./api.js";import{t as Tn}from"./createLucideIcon.js";var En=Object.defineProperty,Dn=((e,t)=>{let n={};for(var r in e)En(n,r,{get:e[r],enumerable:!0});return t||En(n,Symbol.toStringTag,{value:`Module`}),n})({BaseTransition:()=>gt,BaseTransitionPropsValidators:()=>Dt,Comment:()=>rt,DeprecationTypes:()=>null,EffectScope:()=>t,ErrorCodes:()=>Pe,ErrorTypeStrings:()=>yt,Fragment:()=>jt,KeepAlive:()=>Be,ReactiveEffect:()=>Ke,Static:()=>ut,Suspense:()=>Lt,Teleport:()=>Ue,Text:()=>Ye,TrackOpTypes:()=>Pt,Transition:()=>Zt,TransitionGroup:()=>xn,TriggerOpTypes:()=>_t,VueElement:()=>cn,assertNumber:()=>St,callWithAsyncErrorHandling:()=>pt,callWithErrorHandling:()=>tt,camelize:()=>re,capitalize:()=>oe,cloneVNode:()=>Qe,compatUtils:()=>null,compile:()=>On,computed:()=>j,createApp:()=>ln,createBlock:()=>L,createCommentVNode:()=>Le,createElementBlock:()=>F,createElementVNode:()=>Bt,createHydrationRenderer:()=>_e,createPropsRestProxy:()=>o,createRenderer:()=>Ut,createSSRApp:()=>dn,createSlots:()=>ye,createStaticVNode:()=>f,createTextVNode:()=>l,createVNode:()=>ce,customRef:()=>Ot,defineAsyncComponent:()=>ct,defineComponent:()=>n,defineCustomElement:()=>en,defineEmits:()=>ot,defineExpose:()=>ne,defineModel:()=>ae,defineOptions:()=>de,defineProps:()=>h,defineSSRCustomElement:()=>rn,defineSlots:()=>x,devtools:()=>ee,effect:()=>it,effectScope:()=>Fe,getCurrentInstance:()=>D,getCurrentScope:()=>bt,getCurrentWatcher:()=>Mt,getTransitionRawChildren:()=>Jt,guardReactiveProps:()=>i,h:()=>Ce,handleError:()=>y,hasInjectionContext:()=>Se,hydrate:()=>sn,hydrateOnIdle:()=>Te,hydrateOnInteraction:()=>_,hydrateOnMediaQuery:()=>T,hydrateOnVisible:()=>Tt,initCustomFormatter:()=>C,initDirectivesForSSR:()=>pn,inject:()=>Oe,isMemoSame:()=>Ee,isProxy:()=>Ve,isReactive:()=>dt,isReadonly:()=>Rt,isRef:()=>We,isRuntimeOnly:()=>Ae,isShallow:()=>Xe,isVNode:()=>pe,markRaw:()=>Ct,mergeDefaults:()=>e,mergeModels:()=>Je,mergeProps:()=>It,nextTick:()=>P,nodeOps:()=>wn,normalizeClass:()=>me,normalizeProps:()=>qe,normalizeStyle:()=>Ft,onActivated:()=>At,onBeforeMount:()=>at,onBeforeUnmount:()=>Ie,onBeforeUpdate:()=>xt,onDeactivated:()=>Nt,onErrorCaptured:()=>He,onMounted:()=>ft,onRenderTracked:()=>zt,onRenderTriggered:()=>Ge,onScopeDispose:()=>mt,onServerPrefetch:()=>Ze,onUnmounted:()=>wt,onUpdated:()=>ht,onWatcherCleanup:()=>nt,openBlock:()=>M,patchProp:()=>Qt,popScopeId:()=>et,provide:()=>Ne,proxyRefs:()=>$e,pushScopeId:()=>Ht,queuePostFlushCb:()=>qt,reactive:()=>Me,readonly:()=>Vt,ref:()=>R,registerRuntimeCompiler:()=>ze,render:()=>hn,renderList:()=>Kt,renderSlot:()=>O,resolveComponent:()=>c,resolveDirective:()=>Gt,resolveDynamicComponent:()=>xe,resolveFilter:()=>null,resolveTransitionHooks:()=>m,setBlockTracking:()=>d,setDevtoolsHook:()=>ue,setTransitionHooks:()=>lt,shallowReactive:()=>Re,shallowReadonly:()=>I,shallowRef:()=>ve,ssrContextKey:()=>r,ssrUtils:()=>st,stop:()=>s,toDisplayString:()=>vt,toHandlerKey:()=>kt,toHandlers:()=>ie,toRaw:()=>Wt,toRef:()=>be,toRefs:()=>p,toValue:()=>u,transformVNodeArgs:()=>se,triggerRef:()=>le,unref:()=>N,useAttrs:()=>fe,useCssModule:()=>nn,useCssVars:()=>mn,useHost:()=>gn,useId:()=>g,useModel:()=>S,useSSRContext:()=>te,useShadowRoot:()=>tn,useSlots:()=>ge,useTemplateRef:()=>Yt,useTransitionState:()=>a,vModelCheckbox:()=>on,vModelDynamic:()=>Cn,vModelRadio:()=>an,vModelSelect:()=>vn,vModelText:()=>_n,vShow:()=>yn,version:()=>we,warn:()=>b,watch:()=>k,watchEffect:()=>A,watchPostEffect:()=>v,watchSyncEffect:()=>E,withAsyncContext:()=>Et,withCtx:()=>w,withDefaults:()=>ke,withDirecLine truncated
`)].join(`
`))}return()=>i.value||r.value||o.value?Ce(t.default({present:o.value})[0],{ref:e=>{let t=U(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),ii=`dismissableLayer.pointerDownOutside`,ai=`dismissableLayer.focusOutside`;function oi(e){if(typeof e!=`object`||!e)return!1;let t=e.ownerDocument?.defaultView;return typeof Element<`u`&&e instanceof Element||!!t&&e instanceof t.Element}function si(e,t){if(!oi(t))return!1;if(e.contains(t))return!0;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r)<i.indexOf(n)))}function ci(e,t,n=!0){let r=R(!1),i=R(()=>{});return A(a=>{if(!H||!u(n))return;let o=t?.value?.ownerDocument??globalThis.document,s=async n=>{let a=n.target;if(t?.value&&a){if(si(t.value,a))o.removeEventListener(`click`,i.value),r.value=!1;else{if(n.target&&!r.value){let t={originalEvent:n};function r(){In(ii,e,t)}n.pointerType===`touch`?(o.removeEventListener(`click`,i.value),i.value=r,o.addEventListener(`click`,i.value,{once:!0})):r()}else o.removeEventListener(`click`,i.value);r.value=!1}}},c=window.setTimeout(()=>{o.addEventListener(`pointerdown`,s)},0);a(()=>{window.clearTimeout(c),o.removeEventListener(`pointerdown`,s),o.removeEventListener(`click`,i.value)})}),{onPointerDownCapture:()=>{u(n)&&(r.value=!0)}}}function li(e,t,n=!0){let r=R(!1);return A(i=>{if(!H||!u(n))return;let a=t?.value?.ownerDocument??globalThis.document,o=async n=>{if(!t?.value)return;await P(),await P();let i=n.target;t.value&&i&&!si(t.value,i)&&n.target&&!r.value&&In(ai,e,{originalEvent:n})};a.addEventListener(`focusin`,o),i(()=>a.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{u(n)&&(r.value=!0)},onBlurCapture:()=>{u(n)&&(r.value=!1)}}}var ui=Me({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),di=n({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Rr(),o=j(()=>a.value?.ownerDocument??globalThis.document),s=j(()=>ui.layersRoot),c=j(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=j(()=>ui.layersWithOutsidePointerEventsDisabled.size>0),u=j(()=>{let e=Array.from(s.value),[t]=[...ui.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=ci(async e=>{let t=[...ui.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await P(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=li(e=>{let t=[...ui.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return ur(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))},{target:()=>o.value?.defaultView??globalThis.window}),k([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{if(e&&n&&t){let t=e.ownerDocument;Sr(t,e),ui.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{ui.layersWithOutsidePointerEventsDisabled.delete(e),Cr(t,e)})}},{immediate:!0}),k([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),A(e=>{e(()=>{a.value&&(s.value.delete(a.value),ui.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(t,n)=>(M(),L(N($t),{ref:N(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:Ft({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:N(f).onFocusCapture,onBlurCapture:N(f).onBlurCapture,onPointerdownCapture:N(d).onPointerDownCapture},{default:w(()=>[O(t.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),fi=zn(()=>R([]));function pi(){let e=fi();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=mi(e.value,t),e.value.unshift(t)},remove(t){e.value=mi(e.value,t),e.value[0]?.resume()}}}function mi(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var hi=`focusScope.autoFocusOnMount`,gi=`focusScope.autoFocusOnUnmount`,_i={bubbles:!1,cancelable:!0};function vi(e,t){let n=t;for(;n;){if(e.contains(n))return!0;n=n.getRootNode().host??null}return!1}function yi(e,{select:t=!1}={}){let n=B();for(let r of e)if(W(r,{select:t}),B()!==n)return!0}function bi(e){let t=xi(e);return[Si(t,e),Si(t.reverse(),e)]}function xi(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();) Line truncated
+1 -1
View File
@@ -1 +1 @@
.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre;font-family:monospace}.xterm .xterm-accessibility-tree>div{transform-origin:0;width:fit-content}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;z-index:11;background:0 0;transition:opacity .1s linear}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{display:none;position:absolute}.xterm .xterm-scrollable-element>.shadow.top{width:100%;height:3px;box-shadow:var(--vscode-scrollbar-shadow,#000) 0 6px 6px -6px inset;display:block;top:0;left:3px}.xterm .xterm-scrollable-element>.shadow.left{width:3px;height:100%;box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset;display:block;top:3px;left:0}.xterm .xterm-scrollable-element>.shadow.top-left-corner{width:3px;height:3px;display:block;top:0;left:0}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset}.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharLine truncated
.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre;font-family:monospace}.xterm .xterm-accessibility-tree>div{transform-origin:0;width:fit-content}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;z-index:11;background:0 0;transition:opacity .1s linear}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{display:none;position:absolute}.xterm .xterm-scrollable-element>.shadow.top{width:100%;height:3px;box-shadow:var(--vscode-scrollbar-shadow,#000) 0 6px 6px -6px inset;display:block;top:0;left:3px}.xterm .xterm-scrollable-element>.shadow.left{width:3px;height:100%;box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset;display:block;top:3px;left:0}.xterm .xterm-scrollable-element>.shadow.top-left-corner{width:3px;height:3px;display:block;top:0;left:0}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset}.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharLine truncated
+82 -82
View File
@@ -1,79 +1,79 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AccountPage.js","assets/PageHeader.js","assets/api.js","assets/AuthenticationPage.js","assets/CredentialBindingsPage.js","assets/CardAccordion.js","assets/pinia.js","assets/createLucideIcon.js","assets/alert.js","assets/PlaybooksPage.js","assets/AgentProfilesPage.js","assets/HarnessPage.js","assets/NotFoundPage.js"])))=>i.map(i=>d[i]);
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,S as y,T as b,U as x,V as S,W as C,X as w,Y as ee,Z as te,_ as T,a as E,at as ne,b as re,c as ie,ct as ae,d as D,dt as oe,et as se,f as ce,ft as O,g as le,h as ue,i as de,it as fe,j as pe,k as me,l as he,lt as ge,m as _e,n as ve,nt as ye,o as be,ot as xe,p as Se,pt as Ce,q as we,r as Te,rt as Ee,s as De,st as Oe,t as ke,tt as Ae,u as je,ut as Me,v as Ne,w as Pe,x as Fe,y as Ie,z as Le}from"./CardAccordion.js";import{$ as Re,A as k,B as ze,C as Be,Ct as Ve,D as A,Dn as He,En as Ue,Ft as We,It as Ge,Jt as j,Kt as Ke,Mt as qe,O as M,Pt as Je,Qn as N,R as Ye,Rt as Xe,Sn as Ze,St as P,Tn as Qe,Tt as $e,Ut as F,V as et,Wt as tt,X as nt,Xt as rt,Y as it,Zt as at,_ as I,_n as ot,_t as st,an as ct,at as lt,b as L,bn as ut,d as dt,dn as ft,er as pt,et as mt,ht as R,it as ht,kn as z,lt as gt,mn as _t,nr as B,nt as vt,on as yt,pn as bt,pt as xt,rn as St,s as V,t as Ct,tr as wt,tt as H,v as U,vn as Tt,wn as Et,x as W,xt as G,y as K,yn as q,zt as Dt}from"./PageHeader.js";import{C as Ot,E as kt,G as At,H as jt,K as Mt,S as Nt,U as Pt,W as Ft,_ as J,b as It,c as Lt,d as Rt,f as zt,g as Bt,h as Vt,l as Ht,m as Ut,n as Y,o as Wt,p as Gt,r as Kt,t as qt,u as Jt,v as X,y as Yt}from"./api.js";import{n as Xt,r as Zt,t as Qt}from"./pinia.js";import{t as $t}from"./createLucideIcon.js";import{a as en,i as tn,n as nn,r as rn,t as an}from"./alert.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function on(e,t,n){let r=e.findIndex(e=>Ce(e,t)),i=e.findIndex(e=>Ce(e,n));if(r===-1||i===-1)return[];let[a,o]=[r,i].sort((e,t)=>e-t);return e.slice(a,o+1)}function sn(e,t=-1/0,n=1/0){return Math.min(n,Math.max(t,e))}function cn(e,t){let n=e,r=t.toString(),i=r.indexOf(`.`),a=i>=0?r.length-i:0;if(a>0){let e=10**a;n=Math.round(n*e)/e}return n}function ln(e,t,n,r){t=Number(t),n=Number(n);let i=(e-(Number.isNaN(t)?0:t))%r,a=cn(Math.abs(i)*2>=r?e+Math.sign(i)*(r-Math.abs(i)):e-i,r);return Number.isNaN(t)?!Number.isNaN(n)&&a>n&&(a=Math.floor(cn(n/r,r))*r):a<t?a=t:!Number.isNaN(n)&&a>n&&(a=t+Math.floor(cn((n-t)/r,r))*r),a=cn(a,r),a}var un=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Bopomofo}]/u,dn=/android/i;function fn(){return typeof navigator<`u`&&dn.test(navigator.userAgent)}function pn(e){let t=q(!1),n=q(!0),r=q(!1),i=I(()=>t.value&&n.value);function a(){t.value=!0,n.value=!0,r.value=!1}function o(e){e.data&&(un.test(e.data)?(n.value=!0,r.value=!0):fn()&&!r.value&&(n.value=!1))}function s(n){vt(()=>{t.value=!1,e?.(n)})}return{isComposing:t,shouldDeferInput:i,handleCompositionStart:a,handleCompositionUpdate:o,handleCompositionEnd:s}}function mn(e){let t=I(()=>z(e)),n=I(()=>new Intl.Collator(`en`,{usage:`search`,...t.value}));return{startsWith:(e,t)=>t.length===0||(e=e.normalize(`NFC`),t=t.normalize(`NFC`),n.value.compare(e.slice(0,t.length),t)===0),endsWith:(e,t)=>t.length===0||(e=e.normalize(`NFC`),t=t.normalize(`NFC`),n.value.compare(e.slice(-t.length),t)===0),contains:(e,t)=>{if(t.length===0)return!0;if(e=e.normalize(`NFC`),t=t.normalize(`NFC`),t.length>e.length)return!1;let r=n.value.compare;if(e.includes(t))return!0;let i=t.length;for(let n=0;n+i<=e.length;n++)if(r(t,e.slice(n,n+i))===0)return!0;return!1}}}function hn(e){return I(()=>!He(e)||!!ee(e)?.closest(`form`))}function gn(){let e=Ye()?.vnode?.scopeId;return e?{[e]:``}:{}}function _n(e,t){let n=ne(!1,300);xe(()=>{n.value=!1});let r=q(null),i=se();function a(){r.value=null,n.value=!1}function o(e,t){if(!t)return;let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=yn(a,vn(a,i.getBoundingClientRect()),1),s=bn(t.getBoundingClientRect()),c=Sn([...o,...s]);r.value=c,n.value=!0}return tt(n=>{if(e.value&&t.value){let r=e.value,i=t.value,a=e=>o(e,i),s=e=>o(e,r);r.addEventListener(`pointerleave`,a),i.addEventListener(`pointerleave`,s),n(()=>{r.removeEventListener(`pointerleave`,a),i.removeEventListener(`pointerleave`,s)})}}),tt(n=>{if(r.value){let o=n=>{if(!r.value||!(n.target instanceof Element))return;let o=n.target,s={x:n.clientX,y:n.clientY},c=e.value?.contains(o)||t.value?.contains(o),l=!xn(s,r.value),u=!!o.closest(`[data-grace-area-trigger]`);c?a():(l||u)&&(a(),i.trigger())},s=e.value?.ownerDocument;s?.addEventListener(`pointermove`,o),n(()=>s?.removeEventListener(`pointermove`,o))}}),{isPointerInTransLine truncated
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AccountPage.js","assets/PageHeader.js","assets/api.js","assets/Input.js","assets/AuthenticationPage.js","assets/CredentialBindingsPage.js","assets/empty.js","assets/createLucideIcon.js","assets/PlaybooksPage.js","assets/AgentProfilesPage.js","assets/HarnessPage.js","assets/SelectValue.js","assets/NotFoundPage.js"])))=>i.map(i=>d[i]);
import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,J as l,K as u,L as d,M as f,N as p,O as m,R as h,S as g,T as _,U as v,V as y,W as b,_ as x,a as S,b as ee,c as C,d as te,f as ne,g as w,h as T,i as E,j as re,k as ie,l as ae,m as oe,n as se,o as ce,p as le,q as ue,r as D,s as de,t as fe,u as pe,v as me,w as O,x as he,y as ge,z as _e}from"./empty.js";import{$ as ve,A as k,B as ye,C as be,Ct as xe,D as A,Dn as Se,En as Ce,Ft as we,It as Te,Jt as j,Kt as Ee,Mt as De,O as M,Pt as Oe,Qn as N,R as ke,Rt as Ae,Sn as je,St as P,Tn as Me,Tt as Ne,Ut as F,V as Pe,Wt as Fe,X as Ie,Xt as Le,Y as Re,Zt as ze,_ as I,_n as Be,_t as Ve,an as He,at as Ue,b as L,bn as We,d as Ge,dn as Ke,er as qe,et as Je,ht as R,it as Ye,kn as z,lt as Xe,mn as Ze,nr as B,nt as Qe,on as $e,pn as et,pt as tt,rn as nt,s as V,t as rt,tr as it,tt as H,v as U,vn as at,wn as ot,x as W,xt as G,y as K,yn as q,zt as st}from"./PageHeader.js";import{$ as ct,A as lt,C as ut,E as dt,N as ft,Q as pt,T as J,X as mt,Y as ht,Z as gt,_ as _t,a as vt,i as yt,k as bt,n as Y,o as xt,r as St,s as Ct,t as wt,w as X,x as Tt}from"./api.js";import{n as Et,r as Dt,t as Ot}from"./pinia.js";import{C as kt,E as At,S as jt,T as Mt,_ as Nt,a as Pt,b as Ft,c as It,d as Lt,f as Rt,g as zt,h as Bt,i as Vt,l as Ht,m as Ut,n as Wt,o as Gt,p as Kt,r as qt,s as Jt,t as Yt,u as Xt,v as Zt,w as Qt,x as $t,y as en}from"./SelectValue.js";import{a as tn,i as nn,n as rn,o as an,r as on,s as sn,t as Z}from"./Input.js";import{t as cn}from"./createLucideIcon.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function ln(e,t,n){let r=e.findIndex(e=>l(e,t)),i=e.findIndex(e=>l(e,n));if(r===-1||i===-1)return[];let[a,o]=[r,i].sort((e,t)=>e-t);return e.slice(a,o+1)}function un(e,t){return b(e)?!1:Array.isArray(e)?e.some(e=>l(e,t)):l(e,t)}var dn=[`INPUT`,`TEXTAREA`];function fn(e,t,n,r={}){if(!t||r.enableIgnoredElement&&dn.includes(t.nodeName))return null;let{arrowKeyOptions:i=`both`,attributeName:a=`[data-reka-collection-item]`,itemsArray:o=[],loop:s=!0,dir:c=`ltr`,preventScroll:l=!0,focus:u=!1}=r,[d,f,p,m,h,g]=[e.key===`ArrowRight`,e.key===`ArrowLeft`,e.key===`ArrowUp`,e.key===`ArrowDown`,e.key===`Home`,e.key===`End`],_=p||m,v=d||f;if(!h&&!g&&(!_&&!v||i===`vertical`&&v||i===`horizontal`&&_))return null;let y=n?Array.from(n.querySelectorAll(a)):o;if(!y.length)return null;l&&e.preventDefault();let b=null;return v||_?b=pn(y,t,{goForward:_?m:c===`ltr`?d:f,loop:s}):h?b=y.at(0)||null:g&&(b=y.at(-1)||null),u&&b?.focus(),b}function pn(e,t,n,r=e.includes(t)?e.length:e.length+1){if(--r===0)return null;let i=e.indexOf(t),a;if(a=i===-1?n.goForward?0:e.length-1:n.goForward?i+1:i-1,!n.loop&&(a<0||a>=e.length))return null;let o=e[(a+e.length)%e.length];return o?o.hasAttribute(`disabled`)&&o.getAttribute(`disabled`)!==`false`?pn(e,o,n,r):o:null}var mn=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Bopomofo}]/u,hn=/android/i;function gn(){return typeof navigator<`u`&&hn.test(navigator.userAgent)}function _n(e){let t=q(!1),n=q(!0),r=q(!1),i=I(()=>t.value&&n.value);function a(){t.value=!0,n.value=!0,r.value=!1}function o(e){e.data&&(mn.test(e.data)?(n.value=!0,r.value=!0):gn()&&!r.value&&(n.value=!1))}function s(n){Qe(()=>{t.value=!1,e?.(n)})}return{isComposing:t,shouldDeferInput:i,handleCompositionStart:a,handleCompositionUpdate:o,handleCompositionEnd:s}}function vn(e){let t=I(()=>z(e)),n=I(()=>new Intl.Collator(`en`,{usage:`search`,...t.value}));return{startsWith:(e,t)=>t.length===0||(e=e.normalize(`NFC`),t=t.normalize(`NFC`),n.value.compare(e.slice(0,t.length),t)===0),endsWith:(e,t)=>t.length===0||(e=e.normalize(`NFC`),t=t.normalize(`NFC`),n.value.compare(e.slice(-t.length),t)===0),contains:(e,t)=>{if(t.length===0)return!0;if(e=e.normalize(`NFC`),t=t.normalize(`NFC`),t.length>e.length)return!1;let r=n.value.compare;if(e.includes(t))return!0;let i=t.length;for(let n=0;n+i<=e.length;n++)if(r(t,e.slice(n,n+i))===0)return!0;return!1}}}function yn(){let e=ke()?.vnode?.scopeId;return e?{[e]:``}:{}}function bn(e,t){let n=y(!1,300);s(()=>{n.value=!1});let r=q(null),i=c();function a(){r.value=null,n.value=!1}function o(e,t){if(!t)return;let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=Sn(a,xn(a,i.getBoundingClientRect()),1),s=Cn(t.getBoundingClientRect()),c=Tn([...o,...s]);r.value=c,n.value=!0}return Fe(n=>{if(e.value&&t.value){let r=e.value,i=t.valueLine truncated
`);d=n.pop()||``;for(let e of n){let t=e.split(`
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(Gc.value=n.session_id),n.type===`delta`&&(o+=n.text,Xc.value=Xc.value?{...Xc.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],Xc.value=Xc.value?{...Xc.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),Xc.value=Xc.value?{...Xc.value,ask:n.ask}:null),n.type===`done`&&(s=!0,o||=n.text||``),n.type===`error`)throw Error(n.text)}if(t)break}if(!s)throw Error(`chat stream ended before completion`);Kc.value=[...Kc.value,{from:`assistant`,text:o,tool_calls:a}],Xc.value=null,Jc.value=`Ready`,await ul()}catch(e){let t=e;t.name===`AbortError`&&!c?(Xc.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},Jc.value=`Stopped`):(Xc.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?Rc(r):void 0,isRetry:i},Jc.value=`Error. Retry available.`)}finally{clearTimeout(l),Hc=null,cl=null,Yc.value=!1}}function Sl(){Jc.value=`Stopping…`,Gc.value&&Y.chatCancel(Gc.value).catch(()=>{}),ll()}function Cl(){gt(()=>{ul().catch(e=>{Jc.value=e.message||`Chat unavailable`})}),xt(()=>{ll()})}async function wl(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));await xl({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var Tl=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],El=k({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return X(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(R(),W(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full border border-border-strong bg-secondary text-primary shadow-[var(--shadow-md)] transition-transform duration-[140ms] hover:-translate-y-px focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":z(Bc),onClick:i[0]||=e=>n(`toggle`)},[U(`span`,{"aria-hidden":`true`,class:N(r(!e.open))},[M(z(Qs),{size:22})],2),U(`span`,{"aria-hidden":`true`,class:N(r(e.open))},[M(z(Oc),{size:22})],2)],8,Tl))}}),Dl=k({__name:`Select`,props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},nullableValue:{},by:{type:[String,Function]},dir:{},multiple:{type:Boolean},autocomplete:{},disabled:{type:Boolean},name:{},required:{type:Boolean}},emits:[`update:modelValue`,`update:open`],setup(e,{emit:t}){let n=Le(e,t);return(e,t)=>(R(),K(z(za),H({"data-slot":`select`},z(n)),{default:j(t=>[P(e.$slots,`default`,pt(ze(t)))]),_:3},16))}}),Ol=k({inheritAttrs:!1,__name:`SelectContent`,props:{forceMount:{type:Boolean},position:{default:`item-aligned`},bodyLock:{type:Boolean},loop:{type:Boolean},memoDependencies:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{default:`center`},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},dir:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Ut(n,`class`),a=Le(i,r);return(t,r)=>(R(),K(z(oo),null,{default:j(()=>[M(z(Za),H({"data-slot":`select-content`,"data-align-trigger":e.position===`item-aligned`},{...t.$attrs,...z(a)},{class:z(X)(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-lg shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 cn-menu-translucent relative z-50 max-h-(--reka-select-content-available-height) origin-(--reka-select-content-transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none`,e.position===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,n.class)}),{default:j(()=>[M(z(Nl)),M(z(po),{"data-position":e.position,class:N(z(X)(`data-[position=popper]:h-(--reka-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--reka-select-trigger-width)`))},{default:j(()=>[P(t.$slots,`default`)]),_ Line truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:Ed(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>Ed(e))}),null)};for(let e=0;e<n.length;e++){let c=n[e];if(c.startsWith("```")){o(),s(),a?(t.push({kind:`pre`,code:a.join(`
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=Od(c),u=e+1<n.length?Od(n[e+1]):null;if(l&&u&&kd(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=Od(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>Ed(e)),rows:r.map(e=>e.map(e=>Ed(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:Ed(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1])}else c.startsWith(`>`)?(o(),s(),t.push({kind:`blockquote`,inline:Ed(c.replace(/^>\s?/,``))})):r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function Od(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function kd(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var Ad={class:`[overflow-wrap:anywhere]`},jd={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},Md={class:`font-mono text-[0.85em]`},Nd={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},Pd={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Fd={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Id={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},Ld={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Rd={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},zd={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Bd={key:8,class:`mb-2.5 last:mb-0`},Vd=k({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=I(()=>Dd(t.text));return(e,t)=>(R(),W(`div`,Ad,[(R(!0),W(V,null,G(n.value,(e,t)=>(R(),W(V,{key:t},[e.kind===`pre`?(R(),W(`pre`,jd,[U(`code`,Md,B(e.code),1)])):e.kind===`table`?(R(),W(`table`,Nd,[U(`thead`,null,[U(`tr`,null,[(R(!0),W(V,null,G(e.head,(e,t)=>(R(),W(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[M(wd,{inline:e},null,8,[`inline`])]))),128))])]),U(`tbody`,null,[(R(!0),W(V,null,G(e.rows,(e,t)=>(R(),W(`tr`,{key:t},[(R(!0),W(V,null,G(e,(e,t)=>(R(),W(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[M(wd,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(R(),W(`blockquote`,Pd,[M(wd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(R(),W(`h1`,Fd,[M(wd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(R(),W(`h2`,Id,[M(wd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(R(),W(`h3`,Ld,[M(wd,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(R(),W(`ul`,Rd,[(R(!0),W(V,null,G(e.items,(e,t)=>(R(),W(`li`,{key:t},[M(wd,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(R(),W(`ol`,zd,[(R(!0),W(V,null,G(e.items,(e,t)=>(R(),W(`li`,{key:t},[M(wd,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(R(),W(`p`,Bd,[M(wd,{inline:e.inline},null,8,[`inline`])])):L(``,!0)],64))),128))]))}}),Hd={class:`truncate`},Ud=k({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Ve(`RouterLink`);return R(),K(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-md border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:j(()=>[M(z(ws),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),U(`span`,Hd,B(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Wd={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Gd={class:`font-semibold text-foreground`},Kd={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},qd=k({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=I(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=I(()=>t.tool.parameters||t.tool.Parameters||``),i=I(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=I(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(R(),K(Ud,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(R(),W(`div`,Wd,[M(z(Dc),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),U(`span`,Gd,B(n.value),1),r.value?(R(),W(`code`,Kd,B(r.value),1)):L(``,!0),U(`span`,{class:N(z(X)(`text-fg-muted`,i.value&&`text-danger`))},B(a.value),3)]))}}),Jd={key:0,class:`mb-2 grid gap-0.5 text-xs`},Yd={key:1,class:`mb-2 flex flex-wrap gap-1.5`},Xd={key:3,class:`whitespace-pre-wrap`},Zd=k({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(R(),W(`div`,{class:N([`flex`,e.assistant?`justify-start`:`justify-end`])},[U(`div`,{class:N(z(X)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(R(),W(`div`,Jd,[(R(!0),W(V,null,G(e.tools,(t,n)=>(R(),K(qd,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):L(``,!0),e.media.length?(R(),W(`div`,Yd,[(R(!0),W(V,null,G(e.media,(e,t)=>(R(),K(_d,{key:t,attachment:e},null,8,[`attachment`]))),128))])):L(``,!0),e.assistant?(R(),K(Vd,{key:2,text:e.text},null,8,[`text`])):(R(),W(`div`,Xd,B(e.text),1)),P(t.$slots,`default`)],2)],2))}}),Qd={class:`text-sm`},$d={key:0,class:`mt-1 text-fg-muted`},ef={key:1,class:`mt-2 flex flex-wrap gap-2`},tf=k({__name:`ChatChooseCard`,props:{choose:{}} Line truncated
`).map(e=>e.trim()).find(Boolean)||``,i=r.length>c_?`${r.slice(0,c_).trimEnd()}…`:r;return{text:i,full:n,truncated:i!==n}}function u_(e){return String(e||`event`).replaceAll(`_`,` `).replace(/\b\w/g,e=>e.toUpperCase())}function d_(e){let t=Number(e);if(!Number.isFinite(t)||t<0)return``;if(t<1e3)return`under 1 s`;let n=t/1e3;if(n<60)return`${n.toFixed(+(n<10))} s`;let r=Math.round(n),i=Math.floor(r/60),a=r%60;if(i<60)return a===0?`${i} min`:`${i} min ${a} s`;let o=Math.floor(i/60),s=i-o*60;return s===0?`${o} h`:`${o} h ${s} min`}function f_(e){let t=Number(e);return!Number.isFinite(t)||t<=0?``:t.toLocaleString(`en-US`)}function p_(e){return typeof e==`string`?e:``}function m_(e={}){let t=e.data||{},n=e.stage||`unknown stage`,r=e.workflow?`${e.workflow} workflow`:``;if(e.kind===`stage_start`)return{title:`Started stage: ${n}`,detail:r};if(e.kind===`stage_finish`){let e=d_(t.duration_ms),i=[r,e&&`ran for ${e}`].filter(Boolean).join(` · `);return{title:t.interrupted?`Stage interrupted: ${n}`:t.skipped?`Skipped stage: ${n}`:t.error?`Stage failed: ${n}`:`Finished stage: ${n}`,detail:[i,p_(t.error),p_(t.when)].filter(Boolean).join(` · `)}}if(e.kind===`task_retried`){let n=Number(t.retry_count);return{title:Number.isFinite(n)&&n>0?`Retry ${n}`:`Retry requested`,detail:[p_(t.previous_stage)&&`after ${p_(t.previous_stage)}`,p_(t.previous_reason)].filter(Boolean).join(`: `)||e.detail||``}}if(e.kind===`agent_finish`){let r=f_(t.iterations),i=f_(t.tokens),a=Number(t.cached_tokens)||0,o=f_((Number(t.prompt_tokens)||0)-a),s=f_(t.completion_tokens),c=f_(t.cached_tokens),l=[r&&`${r} iterations`,i&&`${i} tokens`,o&&`${o} fresh prompt`,s&&`${s} completion`,c&&`${c} cached`,p_(t.model)].filter(Boolean);return{title:`Agent ${p_(t.status)||`finished`}: ${n}`,detail:l.join(` · `)||e.detail||``}}if(e.kind===`remediation_round`){let e=Number(t.of),n=p_(t.author);return{title:`Remediation ${p_(t.round)}${e>0?` of ${e}`:``}`,detail:[n&&`answers ${n}'s review`,t.review_id?`#${p_(t.review_id)}`:``].filter(Boolean).join(` `)}}if(e.kind===`review_approved`){let e=p_(t.pr_number);return{title:`Pull request approved`,detail:[p_(t.author),e&&`#${e}`].filter(Boolean).join(` · `)}}if(e.kind===`step_retried`)return{title:`Attempt ${p_(t.attempt)} of ${p_(t.of)} failed: ${e.stage||`step`}`,detail:p_(t.error),tone:`warn`};if(e.kind===`config_captured`)return{title:`Configuration captured`,detail:`The effective task-runtime configuration for this run.`};if(e.kind===`binding_started`){let e=p_(t.source),n=p_(t.capture_id),r=[{label:`binding ${p_(t.binding_name)||p_(t.binding_id)}`,to:`/events?tab=bindings`},...n?[{label:`captured event`,to:`/events?tab=inspector&capture=${encodeURIComponent(n)}`}]:[]];return t.unsigned===!0?{title:`Started by an unsigned event`,detail:e?`source ${e}`:``,tone:`warn`,links:r}:{title:`Started by an event`,detail:e?`source ${e}`:``,links:r}}if(e.kind===`changes_captured`){let e=t.totals??{},n=Number(e.files);return{title:`Change capture recorded`,detail:[Number.isFinite(n)&&n>0?`${n} file${n===1?``:`s`} changed`:``,t.captured_after?`captured after ${p_(t.captured_after)}`:``].filter(Boolean).join(` · `)}}return{title:u_(e.kind||e.type),detail:e.detail||``}}var h_=[`title`],g_=k({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=s_();n.watchIdentities();let r=e,i=t,a=Xg(),o=I(()=>a.taskIDFor(r.event)),s=I(()=>l_(r.event,n.identityName));function c(){o.value>0&&i(`open`,o.value)}let l=I(()=>r.event.at?kg(r.event.at):`—`);return(e,t)=>(R(),K(z(r_),{class:N(o.value>0?`cursor-pointer`:``),role:o.value>0?`link`:void 0,tabindex:o.value>0?0:void 0,title:o.value>0?`Open task details`:void 0,onClick:c,onKeydown:[At(Mt(c,[`prevent`]),[`enter`]),At(Mt(c,[`prevent`]),[`space`])]},{default:j(()=>[M(z(Q),{class:`font-medium`},{default:j(()=>[A(B(z(m_)({...r.event,at:void 0,detail:void 0}).title),1)]),_:1}),M(z(Q),{class:`font-mono`},{default:j(()=>[A(B(o.value>0?`#${o.value}`:`—`),1)]),_:1}),M(z(Q),{class:`w-[55%] max-w-0`},{default:j(()=>[U(`span`,{class:`block truncate`,title:s.value.truncated?s.value.full:void 0},B(s.value.text),9,h_)]),_:1}),M(z(Q),null,{default:j(()=>[A(B(l.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),__=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function v_(e){return(Number(e?.task_id)||0)>0}function y_(e,t){return t===`tasks`?v_(e):t!==`system`||!v_(e)}function b_(e,t){return e.filter(e=>y_(e,t))}function x_(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function S_(e,t){return`${e}:${t??0}`}function C_(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=S_(l_(n).text,r),a=t[t.length-1];a&&a.key===i?(a.count+=1,a.events.push(n)):t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var w_={key:0,class:`font-normal text-fg-subtle`},T_={role:`region`,"aria-label":`Activity`,"ari Line truncated
`,1)[0]??``;return t.length>80?`${t.slice(0,79)}…`:t}function Hv(e){return(e?.merged||0)+(e?.completed||0)}function Uv(e){return Object.entries(e?.inputs??{}).map(([e,t])=>({name:e,type:t.type,required:t.required===!0})).sort((e,t)=>e.name.localeCompare(t.name))}function Wv(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function Gv(e,t){switch(t){case`number`:{let t=e.trim();return t!==``&&!Number.isNaN(Number(t))?Number(t):e}case`bool`:return e===`true`||e!==`false`&&e;case`string`:return e;default:try{return JSON.parse(e)}catch{return e}}}function Kv(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=Gv(e,r.type))}return n}var qv=[`onKeydown`],Jv={key:0,class:`text-sm text-danger`,role:`alert`},Yv={key:1,class:`grid gap-1.5`},Xv=[`for`],Zv={key:0,class:`font-normal text-fg-subtle`},Qv=[`id`],$v=[`value`],ey={key:0,class:`text-xs text-fg-subtle`},ty={key:2,class:`grid gap-1.5`},ny=[`id`],ry={class:`block truncate font-mono text-[13px] font-medium`},iy={class:`block text-xs text-fg-subtle`},ay={key:0,class:`text-xs text-fg-subtle`},oy={key:3,class:`grid gap-3`},sy=[`for`],cy={class:`font-mono`},ly={key:0,class:`text-fg-subtle`},uy={class:`text-xs text-fg-subtle`},dy={class:`grid gap-1.5`},fy=[`for`],py={class:`grid gap-1.5`},see=[`for`],my={key:4,class:`text-sm text-danger`,role:`alert`},hy={class:`flex items-center gap-2 border-t border-border pt-4`},gy={class:`mr-auto text-xs text-fg-subtle`},_y=k({__name:`NewTaskForm`,props:{workflow:{},draft:{},initialWorkflow:{},initialInstructions:{}},emits:[`started`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=We(),a=q([]),o=q([]),s=q([]),c=q(``);gt(async()=>{try{let[e,t]=await Promise.all([Y.workflows(),Y.repositories()]);a.value=(e?.definitions??[]).filter(e=>e.enabled),o.value=e?.workflows??[],s.value=(t??[]).map(e=>`${e.owner}/${e.name}`)}catch(e){c.value=String(e.message||e)}});let l=q(``),u=q(n.workflow??n.initialWorkflow??``),d=q(n.initialInstructions??``),f=q(Vv(d.value)),p=q({});tt(()=>{!u.value&&a.value[0]&&(u.value=a.value[0].id)});let m=I(()=>a.value.find(e=>e.id===u.value)),h=I(()=>Uv(m.value)),g=I(()=>Wv(h.value,p.value)),_=I(()=>m.value?.repository??`required`),v=I(()=>_.value!==`optional`&&_.value!==`none`),y=e=>o.value.find(t=>t.workflow===e),b=q(!1),x=q(``),S=I(()=>!(!l.value.trim()&&v.value||!u.value||!f.value.trim())&&g.value.length===0);async function C(){if(S.value&&!b.value){b.value=!0,x.value=``;try{let e=await Y.workRequest({repository:_.value===`none`?``:l.value.trim(),workflow:u.value,title:f.value.trim(),instructions:d.value,inputs:Kv(h.value,p.value),...n.draft?{draft:n.draft}:{}});r(`started`,e.task_id)}catch(e){x.value=String(e.message||e)}finally{b.value=!1}}}return(e,t)=>(R(),W(`form`,{class:`grid gap-5`,onSubmit:Mt(C,[`prevent`]),onKeydown:[At(Mt(C,[`meta`,`prevent`]),[`enter`]),At(Mt(C,[`ctrl`,`prevent`]),[`enter`])]},[c.value?(R(),W(`p`,Jv,B(c.value),1)):L(``,!0),_.value===`none`?L(``,!0):(R(),W(`div`,Yv,[U(`label`,{for:`${z(i)}-repo`,class:`text-[13px] font-medium`},[t[5]||=A(`Repository`,-1),v.value?L(``,!0):(R(),W(`span`,Zv,` (optional)`))],8,Xv),M(z(Z),{id:`${z(i)}-repo`,modelValue:l.value,"onUpdate:modelValue":t[0]||=e=>l.value=e,class:`font-mono`,placeholder:`owner/repository`,list:`${z(i)}-repos`,required:v.value},null,8,[`id`,`modelValue`,`list`,`required`]),U(`datalist`,{id:`${z(i)}-repos`},[(R(!0),W(V,null,G(s.value,e=>(R(),W(`option`,{key:e,value:e},null,8,$v))),128))],8,Qv),s.value.length?(R(),W(`p`,ey,[t[6]||=A(`Configured: `,-1),(R(!0),W(V,null,G(s.value,e=>(R(),K(z(J),{key:e,type:`button`,variant:`link`,size:`xs`,class:`h-auto px-1 font-mono text-fg-subtle`,onClick:t=>l.value=e},{default:j(()=>[A(B(e),1)]),_:2},1032,[`onClick`]))),128))])):L(``,!0)])),n.workflow?L(``,!0):(R(),W(`div`,ty,[U(`span`,{id:`${z(i)}-wf`,class:`text-[13px] font-medium`},`Workflow`,8,ny),M(z(Oa),{modelValue:u.value,"onUpdate:modelValue":t[1]||=e=>u.value=e,"aria-labelledby":`${z(i)}-wf`,class:`grid grid-cols-1 gap-2 sm:grid-cols-3`,loop:``},{default:j(()=>[(R(!0),W(V,null,G(a.value,e=>(R(),K(z(Aa),{key:e.id,value:e.id,class:`rounded-md border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-secondary focus-visible:outline-2 focus-visible:outline-ring data-[state=checked]:border-primary data-[state=checked]:bg-secondary`},{default:j(()=>[U(`span`,ry,B(e.name||e.id),1),U(`span`,iy,[A(B(y(e.id)?.runs||0)+` runs`,1),y(e.id)?.runs?(R(),W(V,{key:0},[A(` · `+B(Math.round(z(Hv)(y(e.id))/(y(e.id)?.runs||1)*100))+`% delivered`,1)],64)):L(``,!0)])]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`,`aria-labelledby`]),!a.value.length&&!c.value?(R(),W(`p`,ay,`No enabled workflows.`)):L(``,!0)])),h.value.length?(R(),W(`div`,oy,[(R(!0),W(V,null,G(h.value,e=>(R(),W(`div`,{key:e.name,class:`grid gap-1.5`},[U(`label`,{for:`${z(i)}-input-${e.name}`,class:`text-[13px] font-medium`},[U(`span`,cy,B(e.name),1),e.required?(R(),W(`span`,ly,` · required`)):L(``,!0)],8,sy),M(z(Z),{id:`${Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function Fy(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function Iy(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function Ly(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function Ry(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var zy=q([]),By=q([]),Vy=q(!0),Hy=q(null),Uy=q(null),Wy=q(!1),Gy=q(null);async function Ky(){try{let e=await Y.eventTypes(Ny().workspace);Vy.value=e.enabled!==!1,zy.value=e.event_types||[],By.value=e.proposals||[],Hy.value=null}catch(e){Hy.value=e.message||String(e)}}function qy(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function Jy(e){Gy.value=null,Uy.value=e}function Yy(e){let t=rb.value.find(t=>String(t.id)===e.sample_id);Jy({mode:`proposal`,id:null,source:e.source,name:``,rule:qy(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function Xy(e=``){Jy({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function Zy(e){Jy({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:qy(e.rule),headersText:``,body:``,exampleHeaders:{}})}function Qy(){Uy.value=null}async function $y(){let e=Uy.value;if(e){Wy.value=!0;try{if(e.mode===`edit`&&e.id)await Y.eventTypeUpdate(e.id,{name:e.name,rule:Ry(e.rule)});else{let t=e.mode===`paste`?Py(e.headersText):e.exampleHeaders;await Y.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:Ry(e.rule),example:{headers:t,body:e.body}})}Uy.value=null,await Ky()}catch(e){Gy.value=e.message||String(e)}finally{Wy.value=!1}}}var eb=q(null);async function tb(){let e=eb.value;if(eb.value=null,e)try{await Y.eventTypeDelete(e.id),await Ky()}catch(e){Hy.value=e.message||String(e)}}var nb=100,rb=q([]),ib=q(!0),ab=q(null),ob=q(!0),sb=q(null);async function cb(){try{let e=await Y.captures(nb);ib.value=e.enabled!==!1,rb.value=e.captures||[],ab.value=null}catch(e){ab.value=e.message||String(e)}finally{ob.value=!1}}function lb(e){let t=rb.value.find(t=>t.id===e);return t&&(sb.value=t),!!t}function ub(){rb.value.length&&(sb.value=rb.value[0])}function db(){re(`captures`,()=>{cb(),Ky()})}var fb=k({__name:`Tabs`,props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=Ut(n,`class`),a=Le(i,r);return(e,t)=>(R(),K(z(bo),H({"data-slot":`tabs`,"data-orientation":z(a).orientation||`horizontal`},z(a),{class:z(X)(`gap-2 group/tabs flex data-horizontal:flex-col`,n.class)}),{default:j(t=>[P(e.$slots,`default`,pt(ze(t)))]),_:3},16,[`data-orientation`,`class`]))}}),pb=k({__name:`TabsContent`,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ut(t,`class`);return(e,r)=>(R(),K(z(Co),H({"data-slot":`tabs-content`,class:z(X)(`text-sm flex-1 outline-none`,t.class)},z(n)),{default:j(()=>[P(e.$slots,`default`)]),_:3},16,[`class`]))}}),mb=k({__name:`TabsList`,props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},variant:{default:`default`}},setup(e){let t=e,n=Ut(t,`class`,`variant`);return(r,i)=>(R(),K(z(wo),H({"data-slot":`tabs-list`,"data-variant":e.variant},z(n),{class:z(X)(z(gb)({variant:e.variant}),t.class)}),{default:j(()=>[P(r.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),hb=k({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,r=Ut(t,`class`),i=n(r);return(e,n)=>(R(),K(z(To),H({"data-slot":`tabs-trigger`,class:z(X)(`gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*=size-])]:size-4 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointerLine truncated
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(bc.value=n.session_id),n.type===`delta`&&(o+=n.text,Tc.value=Tc.value?{...Tc.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],Tc.value=Tc.value?{...Tc.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),Tc.value=Tc.value?{...Tc.value,ask:n.ask}:null),n.type===`done`&&(s=!0,o||=n.text||``),n.type===`error`)throw Error(n.text)}if(t)break}if(!s)throw Error(`chat stream ended before completion`);xc.value=[...xc.value,{from:`assistant`,text:o,tool_calls:a}],Tc.value=null,Cc.value=`Ready`,await zc()}catch(e){let t=e;t.name===`AbortError`&&!c?(Tc.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},Cc.value=`Stopped`):(Tc.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?pc(r):void 0,isRetry:i},Cc.value=`Error. Retry available.`)}finally{clearTimeout(l),_c=null,Lc=null,wc.value=!1}}function Zc(){Cc.value=`Stopping…`,bc.value&&Y.chatCancel(bc.value).catch(()=>{}),Rc()}function Qc(){Xe(()=>{zc().catch(e=>{Cc.value=e.message||`Chat unavailable`})}),tt(()=>{Rc()})}async function $c(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));await Xc({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var el=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],tl=k({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return J(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(R(),W(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full border border-border-strong bg-secondary text-primary shadow-[var(--shadow-md)] transition-transform duration-[140ms] hover:-translate-y-px focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":z(hc),onClick:i[0]||=e=>n(`toggle`)},[U(`span`,{"aria-hidden":`true`,class:N(r(!e.open))},[M(z(Ts),{size:22})],2),U(`span`,{"aria-hidden":`true`,class:N(r(e.open))},[M(z(rc),{size:22})],2)],8,el))}});function nl(e){return e.title||e.branch_name||`Conversation ${e.session_id.slice(0,8)}`}function rl(e,t){if(!t)return`Archie`;let n=(e||[]).find(e=>e.session_id===t);return n?nl(n):`Archie`}var il={class:`min-w-0 flex-1`},al=k({__name:`ChatSessionList`,setup(e){return(e,t)=>(R(),W(`div`,il,[M(z(Gt),{"model-value":z(bc),disabled:!z(yc).length,"onUpdate:modelValue":t[0]||=e=>z(Bc)(String(e))},{default:j(()=>[M(z(Wt),{size:`sm`,class:`w-full`,"aria-label":`Conversation`},{default:j(()=>[M(z(Yt),{placeholder:`No conversations yet`})]),_:1}),M(z(Pt),null,{default:j(()=>[M(z(Vt),null,{default:j(()=>[(R(!0),W(V,null,G(z(yc),e=>(R(),K(z(qt),{key:e.session_id,value:e.session_id},{default:j(()=>[A(B(z(nl)(e)),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`,`disabled`])]))}}),ol=[`data-orientation`],sl=k({__name:`Field`,props:{class:{type:[Boolean,null,String,Object,Array]},orientation:{default:`vertical`}},setup(e){let t=e;return(n,r)=>(R(),W(`div`,{role:`group`,"data-slot":`field`,"data-orientation":e.orientation,class:N(z(J)(z(fl)({orientation:e.orientation}),t.class))},[P(n.$slots,`default`)],10,ol))}}),cl=k({__name:`FieldDescription`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(R(),W(`p`,{"data-slot":`field-description`,class:N(z(J)(`text-fg-muted text-left text-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-data-horizontal/field:text-balance`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-link`,t.class))},[P(e.$slots,`default`)],2))}}),ll=k({__name:`FieldGroup`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(R(),W(`div`,{"data-slot":`field-group`,class:N(z(J)(`gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4 group/field-group @container/field-group flex w-full flex-col`,t.class))},[P(e.$slots,`default`)],2))}}),ul=k({__name:`Label`,props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=_t(t,`class`);return(e,r)=>(R(),K(z(ii),H({"data-slot":`label`},z(n),{class:z(J)(`gap-2 text-sm leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed`,t.class)}),{default:j(()=>[P(e.$slots,`default`)]),_:3},16,[`class`]))}}),dl=k({__name:`FieldLabel`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(R(),K(z(ul),{"data- Line truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:Yu(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>Yu(e))}),null)};for(let e=0;e<n.length;e++){let c=n[e];if(c.startsWith("```")){o(),s(),a?(t.push({kind:`pre`,code:a.join(`
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=Zu(c),u=e+1<n.length?Zu(n[e+1]):null;if(l&&u&&Qu(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=Zu(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>Yu(e)),rows:r.map(e=>e.map(e=>Yu(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:Yu(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1])}else c.startsWith(`>`)?(o(),s(),t.push({kind:`blockquote`,inline:Yu(c.replace(/^>\s?/,``))})):r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function Zu(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function Qu(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var $u={class:`[overflow-wrap:anywhere]`},ed={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},td={class:`font-mono text-[0.85em]`},nd={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},rd={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},id={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},ad={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},od={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},sd={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},cd={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},ld={key:8,class:`mb-2.5 last:mb-0`},ud=k({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=I(()=>Xu(t.text));return(e,t)=>(R(),W(`div`,$u,[(R(!0),W(V,null,G(n.value,(e,t)=>(R(),W(V,{key:t},[e.kind===`pre`?(R(),W(`pre`,ed,[U(`code`,td,B(e.code),1)])):e.kind===`table`?(R(),W(`table`,nd,[U(`thead`,null,[U(`tr`,null,[(R(!0),W(V,null,G(e.head,(e,t)=>(R(),W(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[M(qu,{inline:e},null,8,[`inline`])]))),128))])]),U(`tbody`,null,[(R(!0),W(V,null,G(e.rows,(e,t)=>(R(),W(`tr`,{key:t},[(R(!0),W(V,null,G(e,(e,t)=>(R(),W(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[M(qu,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(R(),W(`blockquote`,rd,[M(qu,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(R(),W(`h1`,id,[M(qu,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(R(),W(`h2`,ad,[M(qu,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(R(),W(`h3`,od,[M(qu,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(R(),W(`ul`,sd,[(R(!0),W(V,null,G(e.items,(e,t)=>(R(),W(`li`,{key:t},[M(qu,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(R(),W(`ol`,cd,[(R(!0),W(V,null,G(e.items,(e,t)=>(R(),W(`li`,{key:t},[M(qu,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(R(),W(`p`,ld,[M(qu,{inline:e.inline},null,8,[`inline`])])):L(``,!0)],64))),128))]))}}),dd={class:`truncate`},fd=k({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=xe(`RouterLink`);return R(),K(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-md border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:j(()=>[M(z(Qo),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),U(`span`,dd,B(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),pd={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},md={class:`font-semibold text-foreground`},hd={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},gd=k({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=I(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=I(()=>t.tool.parameters||t.tool.Parameters||``),i=I(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=I(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(R(),K(fd,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(R(),W(`div`,pd,[M(z(nc),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),U(`span`,md,B(n.value),1),r.value?(R(),W(`code`,hd,B(r.value),1)):L(``,!0),U(`span`,{class:N(z(J)(`text-fg-muted`,i.value&&`text-danger`))},B(a.value),3)]))}}),_d={key:0,class:`mb-2 grid gap-0.5 text-xs`},vd={key:1,class:`mb-2 flex flex-wrap gap-1.5`},yd={key:3,class:`whitespace-pre-wrap`},bd=k({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(R(),W(`div`,{class:N([`flex`,e.assistant?`justify-start`:`justify-end`])},[U(`div`,{class:N(z(J)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(R(),W(`div`,_d,[(R(!0),W(V,null,G(e.tools,(t,n)=>(R(),K(gd,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):L(``,!0),e.media.length?(R(),W(`div`,vd,[(R(!0),W(V,null,G(e.media,(e,t)=>(R(),K(Bu,{key:t,attachment:e},null,8,[`attachment`]))),128))])):L(``,!0),e.assistant?(R(),K(ud,{key:2,text:e.text},null,8,[`text`])):(R(),W(`div`,yd,B(e.text),1)),P(t.$slots,`default`)],2)],2))}}),xd={class:`text-sm`},Sd={key:0,class:`mt-1 text-fg-muted`},Cd={key:1,class:`mt-2 flex flex-wrap gap-2`},wd=k({__name:`ChatChooseCard`,props:{choose:{}} Line truncated
`).map(e=>e.trim()).find(Boolean)||``,i=r.length>m_?`${r.slice(0,m_).trimEnd()}…`:r;return{text:i,full:n,truncated:i!==n}}function g_(e){return String(e||`event`).replaceAll(`_`,` `).replace(/\b\w/g,e=>e.toUpperCase())}function __(e){let t=Number(e);if(!Number.isFinite(t)||t<0)return``;if(t<1e3)return`under 1 s`;let n=t/1e3;if(n<60)return`${n.toFixed(+(n<10))} s`;let r=Math.round(n),i=Math.floor(r/60),a=r%60;if(i<60)return a===0?`${i} min`:`${i} min ${a} s`;let o=Math.floor(i/60),s=i-o*60;return s===0?`${o} h`:`${o} h ${s} min`}function v_(e){let t=Number(e);return!Number.isFinite(t)||t<=0?``:t.toLocaleString(`en-US`)}function y_(e){return typeof e==`string`?e:``}function b_(e={}){let t=e.data||{},n=e.stage||`unknown stage`,r=e.workflow?`${e.workflow} workflow`:``;if(e.kind===`stage_start`)return{title:`Started stage: ${n}`,detail:r};if(e.kind===`stage_finish`){let e=__(t.duration_ms),i=[r,e&&`ran for ${e}`].filter(Boolean).join(` · `);return{title:t.interrupted?`Stage interrupted: ${n}`:t.skipped?`Skipped stage: ${n}`:t.error?`Stage failed: ${n}`:`Finished stage: ${n}`,detail:[i,y_(t.error),y_(t.when)].filter(Boolean).join(` · `)}}if(e.kind===`task_retried`){let n=Number(t.retry_count);return{title:Number.isFinite(n)&&n>0?`Retry ${n}`:`Retry requested`,detail:[y_(t.previous_stage)&&`after ${y_(t.previous_stage)}`,y_(t.previous_reason)].filter(Boolean).join(`: `)||e.detail||``}}if(e.kind===`agent_finish`){let r=v_(t.iterations),i=v_(t.tokens),a=Number(t.cached_tokens)||0,o=v_((Number(t.prompt_tokens)||0)-a),s=v_(t.completion_tokens),c=v_(t.cached_tokens),l=[r&&`${r} iterations`,i&&`${i} tokens`,o&&`${o} fresh prompt`,s&&`${s} completion`,c&&`${c} cached`,y_(t.model)].filter(Boolean);return{title:`Agent ${y_(t.status)||`finished`}: ${n}`,detail:l.join(` · `)||e.detail||``}}if(e.kind===`remediation_round`){let e=Number(t.of),n=y_(t.author);return{title:`Remediation ${y_(t.round)}${e>0?` of ${e}`:``}`,detail:[n&&`answers ${n}'s review`,t.review_id?`#${y_(t.review_id)}`:``].filter(Boolean).join(` `)}}if(e.kind===`review_approved`){let e=y_(t.pr_number);return{title:`Pull request approved`,detail:[y_(t.author),e&&`#${e}`].filter(Boolean).join(` · `)}}if(e.kind===`step_retried`)return{title:`Attempt ${y_(t.attempt)} of ${y_(t.of)} failed: ${e.stage||`step`}`,detail:y_(t.error),tone:`warn`};if(e.kind===`config_captured`)return{title:`Configuration captured`,detail:`The effective task-runtime configuration for this run.`};if(e.kind===`binding_started`){let e=y_(t.source),n=y_(t.capture_id),r=[{label:`binding ${y_(t.binding_name)||y_(t.binding_id)}`,to:`/events?tab=bindings`},...n?[{label:`captured event`,to:`/events?tab=inspector&capture=${encodeURIComponent(n)}`}]:[]];return t.unsigned===!0?{title:`Started by an unsigned event`,detail:e?`source ${e}`:``,tone:`warn`,links:r}:{title:`Started by an event`,detail:e?`source ${e}`:``,links:r}}if(e.kind===`changes_captured`){let e=t.totals??{},n=Number(e.files);return{title:`Change capture recorded`,detail:[Number.isFinite(n)&&n>0?`${n} file${n===1?``:`s`} changed`:``,t.captured_after?`captured after ${y_(t.captured_after)}`:``].filter(Boolean).join(` · `)}}return{title:g_(e.kind||e.type),detail:e.detail||``}}var x_=[`title`],S_=k({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=p_();n.watchIdentities();let r=e,i=t,a=n_(),o=I(()=>a.taskIDFor(r.event)),s=I(()=>h_(r.event,n.identityName));function c(){o.value>0&&i(`open`,o.value)}let l=I(()=>r.event.at?Ig(r.event.at):`—`);return(e,t)=>(R(),K(z(l_),{class:N(o.value>0?`cursor-pointer`:``),role:o.value>0?`link`:void 0,tabindex:o.value>0?0:void 0,title:o.value>0?`Open task details`:void 0,onClick:c,onKeydown:[pt(ct(c,[`prevent`]),[`enter`]),pt(ct(c,[`prevent`]),[`space`])]},{default:j(()=>[M(z(Q),{class:`font-medium`},{default:j(()=>[A(B(z(b_)({...r.event,at:void 0,detail:void 0}).title),1)]),_:1}),M(z(Q),{class:`font-mono`},{default:j(()=>[A(B(o.value>0?`#${o.value}`:`—`),1)]),_:1}),M(z(Q),{class:`w-[55%] max-w-0`},{default:j(()=>[U(`span`,{class:`block truncate`,title:s.value.truncated?s.value.full:void 0},B(s.value.text),9,x_)]),_:1}),M(z(Q),null,{default:j(()=>[A(B(l.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),C_=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function w_(e){return(Number(e?.task_id)||0)>0}function T_(e,t){return t===`tasks`?w_(e):t!==`system`||!w_(e)}function E_(e,t){return e.filter(e=>T_(e,t))}function D_(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function O_(e,t){return`${e}:${t??0}`}function k_(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=O_(h_(n).text,r),a=t[t.length-1];a&&a.key===i?(a.count+=1,a.events.push(n)):t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var A_={key:0,class:`font-normal text-fg-subtle`},j_={role:`region`,"aria-label":`Activity`,"ari Line truncated
`,1)[0]??``;return t.length>80?`${t.slice(0,79)}…`:t}function Jv(e){return(e?.merged||0)+(e?.completed||0)}function Yv(e){return Object.entries(e?.inputs??{}).map(([e,t])=>({name:e,type:t.type,required:t.required===!0})).sort((e,t)=>e.name.localeCompare(t.name))}function Xv(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function Zv(e,t){switch(t){case`number`:{let t=e.trim();return t!==``&&!Number.isNaN(Number(t))?Number(t):e}case`bool`:return e===`true`||e!==`false`&&e;case`string`:return e;default:try{return JSON.parse(e)}catch{return e}}}function Qv(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=Zv(e,r.type))}return n}var $v=[`onKeydown`],ey={key:0,class:`text-sm text-danger`,role:`alert`},ty={key:1,class:`grid gap-1.5`},ny=[`for`],ry={key:0,class:`font-normal text-fg-subtle`},iy=[`id`],ay=[`value`],oy={key:0,class:`text-xs text-fg-subtle`},sy={key:2,class:`grid gap-1.5`},cy=[`id`],ly={class:`block truncate font-mono text-[13px] font-medium`},uy={class:`block text-xs text-fg-subtle`},dy={key:0,class:`text-xs text-fg-subtle`},iee={key:3,class:`grid gap-3`},fy=[`for`],py={class:`font-mono`},my={key:0,class:`text-fg-subtle`},hy={class:`grid gap-1.5`},gy=[`for`],_y={class:`grid gap-1.5`},vy=[`for`],yy={key:4,class:`text-sm text-danger`,role:`alert`},by={class:`flex items-center gap-2 border-t border-border pt-4`},xy={class:`mr-auto text-xs text-fg-subtle`},Sy=k({__name:`NewTaskForm`,props:{workflow:{},draft:{},initialWorkflow:{},initialInstructions:{}},emits:[`started`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=we(),a=q([]),o=q([]),s=q([]),c=q(``);Xe(async()=>{try{let[e,t]=await Promise.all([Y.workflows(),Y.repositories()]);a.value=(e?.definitions??[]).filter(e=>e.enabled),o.value=e?.workflows??[],s.value=(t??[]).map(e=>`${e.owner}/${e.name}`)}catch(e){c.value=String(e.message||e)}});let l=q(``),u=q(n.workflow??n.initialWorkflow??``),d=q(n.initialInstructions??``),f=q(qv(d.value)),p=q({});Fe(()=>{!u.value&&a.value[0]&&(u.value=a.value[0].id)});let m=I(()=>a.value.find(e=>e.id===u.value)),h=I(()=>Yv(m.value)),g=I(()=>Xv(h.value,p.value)),_=I(()=>m.value?.repository??`required`),v=I(()=>_.value!==`optional`&&_.value!==`none`),y=e=>o.value.find(t=>t.workflow===e),b=q(!1),x=q(``),S=I(()=>!(!l.value.trim()&&v.value||!u.value||!f.value.trim())&&g.value.length===0);async function ee(){if(S.value&&!b.value){b.value=!0,x.value=``;try{let e=await Y.workRequest({repository:_.value===`none`?``:l.value.trim(),workflow:u.value,title:f.value.trim(),instructions:d.value,inputs:Qv(h.value,p.value),...n.draft?{draft:n.draft}:{}});r(`started`,e.task_id)}catch(e){x.value=String(e.message||e)}finally{b.value=!1}}}return(e,t)=>(R(),W(`form`,{class:`grid gap-5`,onSubmit:ct(ee,[`prevent`]),onKeydown:[pt(ct(ee,[`meta`,`prevent`]),[`enter`]),pt(ct(ee,[`ctrl`,`prevent`]),[`enter`])]},[c.value?(R(),W(`p`,ey,B(c.value),1)):L(``,!0),_.value===`none`?L(``,!0):(R(),W(`div`,ty,[U(`label`,{for:`${z(i)}-repo`,class:`text-[13px] font-medium`},[t[5]||=A(`Repository`,-1),v.value?L(``,!0):(R(),W(`span`,ry,` (optional)`))],8,ny),M(z(Z),{id:`${z(i)}-repo`,modelValue:l.value,"onUpdate:modelValue":t[0]||=e=>l.value=e,class:`font-mono`,placeholder:`owner/repository`,list:`${z(i)}-repos`,required:v.value},null,8,[`id`,`modelValue`,`list`,`required`]),U(`datalist`,{id:`${z(i)}-repos`},[(R(!0),W(V,null,G(s.value,e=>(R(),W(`option`,{key:e,value:e},null,8,ay))),128))],8,iy),s.value.length?(R(),W(`p`,oy,[t[6]||=A(`Configured: `,-1),(R(!0),W(V,null,G(s.value,e=>(R(),K(z(X),{key:e,type:`button`,variant:`link`,size:`xs`,class:`h-auto px-1 font-mono text-fg-subtle`,onClick:t=>l.value=e},{default:j(()=>[A(B(e),1)]),_:2},1032,[`onClick`]))),128))])):L(``,!0)])),n.workflow?L(``,!0):(R(),W(`div`,sy,[U(`span`,{id:`${z(i)}-wf`,class:`text-[13px] font-medium`},`Workflow`,8,cy),M(z(Ra),{modelValue:u.value,"onUpdate:modelValue":t[1]||=e=>u.value=e,"aria-labelledby":`${z(i)}-wf`,class:`grid grid-cols-1 gap-2 sm:grid-cols-3`,loop:``},{default:j(()=>[(R(!0),W(V,null,G(a.value,e=>(R(),K(z(Ba),{key:e.id,value:e.id,class:`rounded-md border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-secondary focus-visible:outline-2 focus-visible:outline-ring data-[state=checked]:border-primary data-[state=checked]:bg-secondary`},{default:j(()=>[U(`span`,ly,B(e.name||e.id),1),U(`span`,uy,[A(B(y(e.id)?.runs||0)+` runs`,1),y(e.id)?.runs?(R(),W(V,{key:0},[A(` · `+B(Math.round(z(Jv)(y(e.id))/(y(e.id)?.runs||1)*100))+`% delivered`,1)],64)):L(``,!0)])]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`,`aria-labelledby`]),!a.value.length&&!c.value?(R(),W(`p`,dy,`No enabled workflows.`)):L(``,!0)])),h.value.length?(R(),W(`div`,iee,[(R(!0),W(V,null,G(h.value,e=>(R(),W(`div`,{key:e.name,class:`grid gap-1.5`},[U(`label`,{for:`${z(i)}-input-${e.name}`,class:`text-[13px] font-medium`},[U(`span`,py,B(e.name),1),e.required?(R(),W(`span`,my,` · required`)):L(``,!0)],8,fy),M(z(Z),{id:`${z(i)}-input-${e.name}`,"model-v Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function By(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function Vy(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function Hy(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function Uy(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var Wy=q([]),Gy=q([]),Ky=q(!0),qy=q(null),Jy=q(null),Yy=q(!1),Xy=q(null);async function Zy(){try{let e=await Y.eventTypes(Ry().workspace);Ky.value=e.enabled!==!1,Wy.value=e.event_types||[],Gy.value=e.proposals||[],qy.value=null}catch(e){qy.value=e.message||String(e)}}function Qy(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function $y(e){Xy.value=null,Jy.value=e}function eb(e){let t=cb.value.find(t=>String(t.id)===e.sample_id);$y({mode:`proposal`,id:null,source:e.source,name:``,rule:Qy(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function tb(e=``){$y({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function nb(e){$y({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:Qy(e.rule),headersText:``,body:``,exampleHeaders:{}})}function rb(){Jy.value=null}async function ib(){let e=Jy.value;if(e){Yy.value=!0;try{if(e.mode===`edit`&&e.id)await Y.eventTypeUpdate(e.id,{name:e.name,rule:Uy(e.rule)});else{let t=e.mode===`paste`?zy(e.headersText):e.exampleHeaders;await Y.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:Uy(e.rule),example:{headers:t,body:e.body}})}Jy.value=null,await Zy()}catch(e){Xy.value=e.message||String(e)}finally{Yy.value=!1}}}var ab=q(null);async function ob(){let e=ab.value;if(ab.value=null,e)try{await Y.eventTypeDelete(e.id),await Zy()}catch(e){qy.value=e.message||String(e)}}var sb=100,cb=q([]),lb=q(!0),ub=q(null),db=q(!0),fb=q(null);async function pb(){try{let e=await Y.captures(sb);lb.value=e.enabled!==!1,cb.value=e.captures||[],ub.value=null}catch(e){ub.value=e.message||String(e)}finally{db.value=!1}}function mb(e){let t=cb.value.find(t=>t.id===e);return t&&(fb.value=t),!!t}function hb(){cb.value.length&&(fb.value=cb.value[0])}function gb(){Qd(`captures`,()=>{pb(),Zy()})}var _b=k({__name:`Tabs`,props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=_t(n,`class`),a=g(i,r);return(e,t)=>(R(),K(z(qa),H({"data-slot":`tabs`,"data-orientation":z(a).orientation||`horizontal`},z(a),{class:z(J)(`gap-2 group/tabs flex data-horizontal:flex-col`,n.class)}),{default:j(t=>[P(e.$slots,`default`,qe(ye(t)))]),_:3},16,[`data-orientation`,`class`]))}}),vb=k({__name:`TabsContent`,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=_t(t,`class`);return(e,r)=>(R(),K(z(Xa),H({"data-slot":`tabs-content`,class:z(J)(`text-sm flex-1 outline-none`,t.class)},z(n)),{default:j(()=>[P(e.$slots,`default`)]),_:3},16,[`class`]))}}),yb=k({__name:`TabsList`,props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},variant:{default:`default`}},setup(e){let t=e,n=_t(t,`class`,`variant`);return(r,i)=>(R(),K(z(Za),H({"data-slot":`tabs-list`,"data-variant":e.variant},z(n),{class:z(J)(z(xb)({variant:e.variant}),t.class)}),{default:j(()=>[P(r.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),bb=k({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,r=_t(t,`class`),i=n(r);return(e,n)=>(R(),K(z(Qa),H({"data-slot":`tabs-trigger`,class:z(J)(`gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*=size-])]:size-4 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-Line truncated
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var fM=Qj(`CharSizeService`),pM=Qj(`CoreBrowserService`),mM=Qj(`MouseService`),hM=Qj(`RenderService`),gM=Qj(`SelectionService`),_M=Qj(`CharacterJoinerService`),vM=Qj(`ThemeService`),yM=Qj(`LinkProviderService`),bM=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?EM.isErrorNoTelemetry(e)?new EM(e.message+`
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var _M=rM(`CharSizeService`),vM=rM(`CoreBrowserService`),yM=rM(`MouseService`),bM=rM(`RenderService`),xM=rM(`SelectionService`),SM=rM(`CharacterJoinerService`),CM=rM(`ThemeService`),wM=rM(`LinkProviderService`),TM=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?jM.isErrorNoTelemetry(e)?new jM(e.message+`
`+e.stack):Error(e.message+`
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function xM(e){CM(e)||bM.onUnexpectedError(e)}var SM=`Canceled`;function CM(e){return e instanceof wM||e instanceof Error&&e.name===SM&&e.message===SM}var wM=class extends Error{constructor(){super(SM),this.name=this.message}};function TM(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var EM=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},DM=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function OM(e,t=0){return e[e.length-(1+t)]}var kM;(e=>{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(kM||={});var AM=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>!t(n)||e(n)))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>!e(n)||(t=n,!1)),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||kM.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};AM.empty=new AM(e=>{});function jM(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var MM;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=_;function v(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=v;async function y(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=y})(MM||={});var NM=null;function PM(e){return NM?.trackDisposable(e),e}function FM(e){NM?.markAsDisposed(e)}function IM(e,t){NM?.setParent(e,t)}function LM(e){return NM?.markAsSingleton(e),e}function RM(e){if(MM.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function zM(...e){return BM(()=>RM(e))}function BM(e){let t=PM({dispose:jM(()=>{FM(t),e()})});return t}var VM=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,PM(this)}dispose(){this._isDisposed||(FM(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{RM(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return IM(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),IM(e,null))}};VM.DISABLE_DISPOSED_WARNING=!1;var HM=VM,UM=class{constructor(){this._store=new HM,PM(this),IM(this._store,this)}dispose(){FM(thi Line truncated
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function EM(e){OM(e)||TM.onUnexpectedError(e)}var DM=`Canceled`;function OM(e){return e instanceof kM||e instanceof Error&&e.name===DM&&e.message===DM}var kM=class extends Error{constructor(){super(DM),this.name=this.message}};function AM(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var jM=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},MM=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function NM(e,t=0){return e[e.length-(1+t)]}var PM;(e=>{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(PM||={});var FM=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>!t(n)||e(n)))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>!e(n)||(t=n,!1)),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||PM.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};FM.empty=new FM(e=>{});function IM(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var LM;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=_;function v(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=v;async function y(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=y})(LM||={});var RM=null;function zM(e){return RM?.trackDisposable(e),e}function BM(e){RM?.markAsDisposed(e)}function VM(e,t){RM?.setParent(e,t)}function HM(e){return RM?.markAsSingleton(e),e}function UM(e){if(LM.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function WM(...e){return GM(()=>UM(e))}function GM(e){let t=zM({dispose:IM(()=>{BM(t),e()})});return t}var KM=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,zM(this)}dispose(){this._isDisposed||(BM(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{UM(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return VM(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),VM(e,null))}};KM.DISABLE_DISPOSED_WARNING=!1;var qM=KM,JM=class{constructor(){this._store=new qM,zM(this),VM(this._store,this)}dispose(){BM(thi Line truncated
`).slice(2).join(`
`))}},iN=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},aN=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},oN=0,sN=class{constructor(e){this.value=e,this.id=oN++}},cN=2,lN=class{constructor(e){this._size=0,this._options=e,this._leakageMon=eN>0||this._options?.leakWarningThreshold?new nN(e?.onListenerError??xM,this._options?.leakWarningThreshold??eN):void 0,this._perfMon=this._options?._profName?new $M(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new aN(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||xM)(n),UM.None}if(this._disposed)return UM.None;t&&(e=e.bind(t));let r=new sN(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=rN.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof sN?(this._deliveryQueue??=new uN,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=BM(()=>{i?.(),this._removeListener(r)});return n instanceof HM?n.add(a):Array.isArray(n)&&n.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*cN<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||xM;if(!n)e.value(t);else try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners){if(this._listeners instanceof sN)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}}this._perfMon?.stop()}hasListeners(){return this._size>0}},uN=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},dN=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new lN,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new lN,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};dN.INSTANCE=new dN;var fN=dN;function pN(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}fN.INSTANCE.onDidChangeZoomLevel;function mN(e){return fN.INSTANCE.getZoomFactor(e)}fN.INSTANCE.onDidChangeFullscreen;var hN=typeof navigator==`object`?navigator.userAgent:``,gN=hN.indexOf(`Firefox`)>=0,_N=hN.indexOf(`AppleWebKit`)>=0,vN=hN.indexOf(`Chrome`)>=0,yN=!vN&&hN.indexOf(`Safari`)>=0;hN.indexOf(`Electron/`),hN.indexOf(`Android`);var bN=!1;if(typeof GM.matchMedia==`function`){let e=GM.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=GM.matchMedia(`(display-mode: fullscreen)`);bN=e.matches,pN(GM,e,({matches:e})=>{bN&&t.matches||(bN=e)} Line truncated
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};gF=Ej([Dj(2,eM),Dj(3,pM),Dj(4,tM),Dj(5,vM),Dj(6,oM),Dj(7,hM)],gF);var _F=class extends UM{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e))),this._register(BM(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?`none`:`block`,this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderLine truncated
`,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``))($||={});var CF;(e=>(e.PAD=`€`,e.HOP=``,e.BPH=`‚`,e.NBH=`ƒ`,e.IND=`„`,e.NEL=`…`,e.SSA=`†`,e.ESA=`‡`,e.HTS=`ˆ`,e.HTJ=`‰`,e.VTS=`Š`,e.PLD=`‹`,e.PLU=`Œ`,e.RI=``,e.SS2=`Ž`,e.SS3=``,e.DCS=``,e.PU1=`‘`,e.PU2=`’`,e.STS=`“`,e.CCH=`”`,e.MW=`•`,e.SPA=`–`,e.EPA=`—`,e.SOS=`˜`,e.SGCI=`™`,e.SCI=`š`,e.CSI=`›`,e.ST=`œ`,e.OSC=``,e.PM=`ž`,e.APC=`Ÿ`))(CF||={});var wF;(e=>e.ST=`${$.ESC}\\`)(wF||={});var TF=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${$.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};TF=Ej([Dj(2,eM),Dj(3,oM),Dj(4,nM),Dj(5,hM)],TF);var EF=0,DF=0,OF=0,kF=0,AF={css:`#00000000`,rgba:0},jF;(e=>{function t(e,t,n,r){return r===void 0?`#${IF(e)}${IF(t)}${IF(n)}`:`#${IF(e)}${IF(t)}${IF(n)}${IF(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(jF||={});var MF;(e=>{function t(e,t){if(kF=(t.rgba&255)/255,kF===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return EF=a+Math.round((n-a)*kF),DF=o+Math.round((r-o)*kF),OF=s+Math.round((i-s)*kF),{css:jF.toCss(EF,DF,OF),rgba:jF.toRgba(EF,DF,OF)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=FF.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return jF.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[EF,DF,OF]=FF.toChannels(t),{css:jF.toCss(EF,DF,OF),rgba:t}}e.opaque=i;function a(e,t){return kF=Math.round(t*255),[EF,DF,OF]=FF.toChannels(e.rgba),{css:jF.toCss(EF,DF,OF,kF),rgba:jF.toRgba(EF,DF,OF,kF)}}e.opacity=a;function o(e,t){return kF=e.rgba&255,a(e,kF*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.r Line truncated
`))}},lN=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},uN=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},dN=0,fN=class{constructor(e){this.value=e,this.id=dN++}},pN=2,mN=class{constructor(e){this._size=0,this._options=e,this._leakageMon=aN>0||this._options?.leakWarningThreshold?new sN(e?.onListenerError??EM,this._options?.leakWarningThreshold??aN):void 0,this._perfMon=this._options?._profName?new iN(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new uN(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||EM)(n),JM.None}if(this._disposed)return JM.None;t&&(e=e.bind(t));let r=new fN(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=cN.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof fN?(this._deliveryQueue??=new hN,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=GM(()=>{i?.(),this._removeListener(r)});return n instanceof qM?n.add(a):Array.isArray(n)&&n.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*pN<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||EM;if(!n)e.value(t);else try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners){if(this._listeners instanceof fN)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}}this._perfMon?.stop()}hasListeners(){return this._size>0}},hN=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},gN=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new mN,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new mN,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};gN.INSTANCE=new gN;var _N=gN;function vN(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}_N.INSTANCE.onDidChangeZoomLevel;function yN(e){return _N.INSTANCE.getZoomFactor(e)}_N.INSTANCE.onDidChangeFullscreen;var bN=typeof navigator==`object`?navigator.userAgent:``,xN=bN.indexOf(`Firefox`)>=0,SN=bN.indexOf(`AppleWebKit`)>=0,CN=bN.indexOf(`Chrome`)>=0,wN=!CN&&bN.indexOf(`Safari`)>=0;bN.indexOf(`Electron/`),bN.indexOf(`Android`);var TN=!1;if(typeof XM.matchMedia==`function`){let e=XM.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=XM.matchMedia(`(display-mode: fullscreen)`);TN=e.matches,vN(XM,e,({matches:e})=>{TN&&t.matches||(TN=e)} Line truncated
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};xF=jj([Mj(2,aM),Mj(3,vM),Mj(4,oM),Mj(5,CM),Mj(6,dM),Mj(7,bM)],xF);var SF=class extends JM{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e))),this._register(GM(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?`none`:`block`,this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderLine truncated
`,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``))($||={});var OF;(e=>(e.PAD=`€`,e.HOP=``,e.BPH=`‚`,e.NBH=`ƒ`,e.IND=`„`,e.NEL=`…`,e.SSA=`†`,e.ESA=`‡`,e.HTS=`ˆ`,e.HTJ=`‰`,e.VTS=`Š`,e.PLD=`‹`,e.PLU=`Œ`,e.RI=``,e.SS2=`Ž`,e.SS3=``,e.DCS=``,e.PU1=`‘`,e.PU2=`’`,e.STS=`“`,e.CCH=`”`,e.MW=`•`,e.SPA=`–`,e.EPA=`—`,e.SOS=`˜`,e.SGCI=`™`,e.SCI=`š`,e.CSI=`›`,e.ST=`œ`,e.OSC=``,e.PM=`ž`,e.APC=`Ÿ`))(OF||={});var kF;(e=>e.ST=`${$.ESC}\\`)(kF||={});var AF=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${$.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};AF=jj([Mj(2,aM),Mj(3,dM),Mj(4,sM),Mj(5,bM)],AF);var jF=0,MF=0,NF=0,PF=0,FF={css:`#00000000`,rgba:0},IF;(e=>{function t(e,t,n,r){return r===void 0?`#${VF(e)}${VF(t)}${VF(n)}`:`#${VF(e)}${VF(t)}${VF(n)}${VF(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(IF||={});var LF;(e=>{function t(e,t){if(PF=(t.rgba&255)/255,PF===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return jF=a+Math.round((n-a)*PF),MF=o+Math.round((r-o)*PF),NF=s+Math.round((i-s)*PF),{css:IF.toCss(jF,MF,NF),rgba:IF.toRgba(jF,MF,NF)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=BF.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return IF.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[jF,MF,NF]=BF.toChannels(t),{css:IF.toCss(jF,MF,NF),rgba:t}}e.opaque=i;function a(e,t){return PF=Math.round(t*255),[jF,MF,NF]=BF.toChannels(e.rgba),{css:IF.toCss(jF,MF,NF,PF),rgba:IF.toRgba(jF,MF,NF,PF)}}e.opacity=a;function o(e,t){return PF=e.rgba&255,a(e,PF*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.r Line truncated
`:`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),DI&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=XI(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=dI(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-ZI),ZI),t/=ZI,t/Math.abs(t)+Math.round(t*(QI-1)))}shouldForceSelection(e){return CI?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener(`mouseup`,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),$I)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener(`mouseup`,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(CI&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._active Line truncated
`))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(EP(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(BM(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<$R+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===$R+1&&(this._liveRegion.textContent+=jj.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(a&&o){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform=``;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let Line truncated
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return kj.get()},set promptLabel(e){kj.set(e)},get tooMuchOutput(){return jj.get()},set tooMuchOutput(e){jj.set(e)}}}_verifyIntegers(...e){for(fz of e)if(fz===1/0||isNaN(fz)||fz%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(fz of e)if(fz&&(fz===1/0||isNaN(fz)||fz%1!=0||fz<0))throw Error(`This API only accepts positive integers`)}},mz=2,hz=1,gz=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(mz,Math.floor(u/e.css.cell.width)),rows:Math.max(hz,Math.floor(l/e.css.cell.height))}}},_z={class:`flex h-[32rem] min-h-0 flex-col gap-2`},vz={key:0,class:`text-sm text-muted-foreground`,role:`status`},yz=k({__name:`SandboxView`,props:{taskId:{},attempt:{}},setup(e){let t=e,n=q(null),r=q(`connecting`),i=null,a=null,o=null,s=null;function c(){try{o?.fit()}catch{}}return gt(()=>{let e=n.value;if(!e)return;i=new pz({convertEol:!0,disableStdin:!0,cursorBlink:!1,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`}}),o=new gz,i.loadAddon(o),i.open(e),c();let l=window.location.protocol===`https:`?`wss:`:`ws:`,u=new URLSearchParams({attempt:String(t.attempt)}),d=new WebSocket(`${l}//${window.location.host}/api/tasks/${encodeURIComponent(t.taskId)}/sandbox?${u}`);a=d,d.binaryType=`arraybuffer`,d.onopen=()=>{r.value=`open`},d.onmessage=e=>{i&&(typeof e.data==`string`&&(r.value=`failed`),i.write(typeof e.data==`string`?e.data:new Uint8Array(e.data)))},d.onerror=()=>{r.value=`failed`},d.onclose=()=>{r.value!==`failed`&&(r.value=`closed`)},s=new ResizeObserver(c),s.observe(e)}),lt(()=>{s?.disconnect(),s=null,a?.close(),a=null,i?.dispose(),i=null,o=null}),(e,t)=>(R(),W(`div`,_z,[r.value===`open`?L(``,!0):(R(),W(`p`,vz,[r.value===`connecting`?(R(),W(V,{key:0},[A(`Connecting…`)],64)):r.value===`closed`?(R(),W(V,{key:1},[A(`The sandbox view ended.`)],64)):(R(),W(V,{key:2},[A(`The sandbox view is unavailable.`)],64))])),U(`div`,{ref_key:`host`,ref:n,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),bz={class:`flex flex-wrap items-center gap-3 border-b border-border pb-3`},xz={class:`inline-flex items-center gap-2`},Sz={class:`inline-flex items-center gap-2`},Cz=`__all__`,wz=k({__name:`TaskLogFilters`,props:{filters:{},stages:{}},emits:[`filter`],setup(e,{emit:t}){let n=e,r=t,i=I(()=>sw.map(e=>({value:e.value||Cz,label:e.label}))),a=I(()=>n.filters.level||Cz),o=I(()=>n.filters.stage||Cz);function s(e){r(`filter`,{...n.filters,...e})}function c(e){s({level:String(e)===Cz?``:String(e)})}function l(e){s({stage:String(e)===Cz?``:String(e)})}return(t,n)=>(R(),W(`div`,bz,[U(`div`,xz,[M(z(Dl),{"model-value":a.value,"aria-label":`Filter log entries by level`,"onUpdate:modelValue":c},{default:j(()=>[M(z(Pl),{size:`sm`},{default:j(()=>[M(z(Fl))]),_:1}),M(z(Ol),null,{default:j(()=>[M(z(kl),null,{default:j(()=>[(R(!0),W(V,null,G(i.value,e=>(R(),K(z(jl),{key:e.value,value:e.value},{default:j(()=>[A(B(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])]),U(`div`,Sz,[M(z(Dl),{"model-value":o.value,"aria-label":`Filter log entries by stage`,"onUpdate:modelValue":l},{default:j(()=>[M(z(Pl),{size:`sm`},{default:j(()=>[M(z(Fl))]),_:1}),M(z(Ol),null,{default:j(()=>[M(z(kl),null,{default:j(()=>[M(z(jl),{value:Cz},{default:j(()=>[...n[0]||=[A(`All stages`,-1)]]),_:1}),(R(!0),W(V,null,G(e.stages,e=>(R(),K(z(jl),{key:e,value:e},{default:j(()=>[A(B(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])])]))}}),Tz={class:`sr-only`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`},Ez={key:2,class:`flex flex-col items-start gap-2 py-3`},Dz={key:0,class:`mt-2 Line truncated
`)}};zW.defaultYaml={explicit:!1,version:`1.2`},zW.defaultTags={"!!":`tag:yaml.org,2002:`};function BW(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function VW(e){let t=new Set;return MW(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function HW(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function UW(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=VW(e);let a=HW(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(wW(t.node)||EW(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function WW(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=WW(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=WW(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=WW(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=WW(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function GW(e,t,n){if(Array.isArray(e))return e.map((e,t)=>GW(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!OW(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var KW=class{constructor(e){Object.defineProperty(this,yW,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!xW(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=GW(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?WW(i,{"":o},``,o):o}},qW=class extends KW{constructor(e){super(pW),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],MW(e,{Node:(e,t)=>{(bW(t)||OW(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(GW(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=JW(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(BW(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function JW(e,t,n){if(bW(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(EW(t)){let r=0;for(let i of t.items){let t=JW(e,i,n);t>r&&(r=t)}return r}if(CW(t)){let r=JW(e,t.key,n),i=JW(e,t.value,n);return Math.max(r,i)}return 1}var YW=e=>!e||typeof e!=`function`&&typeof e!=`object`,XW=class extends KW{constructor(e){super(_W),this.value=e}toJSON(e,t){return t?.keep?this.value:GW(this.value,e,t)}toString(){return String(this.value)}};XW.BLOCK_FOLDED=`BLOCK_FOLDED`,XW.BLOCK_LITERAL=`BLOCK_LITERAL`,XW.PLAIN=`PLAIN`,XW.QUOTE_DOUBLE=`QUOTE_DOUBLE`,XW.QUOTE_SINGLE=`QUOTE_SINGLE`;var ZW=`tag:yaml.org,2002:`;function QW(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function $W(e,t,n){if(xW(e)&&(e=e.contents),DW(e))return e;if(CW(e)){let t=n.schema[hW].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new qW(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=ZW+t.slice(2));let l=QW(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new XW(e);return c&&(c.node=t),t Line truncated
`)?iG(n,t):n.includes(`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),MI&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=tL(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=gI(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-nL),nL),t/=nL,t/Math.abs(t)+Math.round(t*(rL-1)))}shouldForceSelection(e){return OI?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener(`mouseup`,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),iL)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener(`mouseup`,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(OI&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._active Line truncated
`))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(jP(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(GM(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<iz+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===iz+1&&(this._liveRegion.textContent+=Ij.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(a&&o){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform=``;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let Line truncated
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Pj.get()},set promptLabel(e){Pj.set(e)},get tooMuchOutput(){return Ij.get()},set tooMuchOutput(e){Ij.set(e)}}}_verifyIntegers(...e){for(_z of e)if(_z===1/0||isNaN(_z)||_z%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(_z of e)if(_z&&(_z===1/0||isNaN(_z)||_z%1!=0||_z<0))throw Error(`This API only accepts positive integers`)}},yz=2,bz=1,xz=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(yz,Math.floor(u/e.css.cell.width)),rows:Math.max(bz,Math.floor(l/e.css.cell.height))}}},Sz={class:`flex h-[32rem] min-h-0 flex-col gap-2`},Cz={key:0,class:`text-sm text-fg-muted`,role:`status`},wz=k({__name:`SandboxView`,props:{taskId:{},attempt:{}},setup(e){let t=e,n=q(null),r=q(`connecting`),i=null,a=null,o=null,s=null;function c(){try{o?.fit()}catch{}}return Xe(()=>{let e=n.value;if(!e)return;i=new vz({convertEol:!0,disableStdin:!0,cursorBlink:!1,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`}}),o=new xz,i.loadAddon(o),i.open(e),c();let l=window.location.protocol===`https:`?`wss:`:`ws:`,u=new URLSearchParams({attempt:String(t.attempt)}),d=new WebSocket(`${l}//${window.location.host}/api/tasks/${encodeURIComponent(t.taskId)}/sandbox?${u}`);a=d,d.binaryType=`arraybuffer`,d.onopen=()=>{r.value=`open`},d.onmessage=e=>{i&&(typeof e.data==`string`&&(r.value=`failed`),i.write(typeof e.data==`string`?e.data:new Uint8Array(e.data)))},d.onerror=()=>{r.value=`failed`},d.onclose=()=>{r.value!==`failed`&&(r.value=`closed`)},s=new ResizeObserver(c),s.observe(e)}),Ue(()=>{s?.disconnect(),s=null,a?.close(),a=null,i?.dispose(),i=null,o=null}),(e,t)=>(R(),W(`div`,Sz,[r.value===`open`?L(``,!0):(R(),W(`p`,Cz,[r.value===`connecting`?(R(),W(V,{key:0},[A(`Connecting…`)],64)):r.value===`closed`?(R(),W(V,{key:1},[A(`The sandbox ended.`)],64)):(R(),W(V,{key:2},[A(`Sandbox unavailable.`)],64))])),U(`div`,{ref_key:`host`,ref:n,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),Tz={class:`flex flex-wrap items-center gap-3 border-b border-border pb-3`},Ez={class:`inline-flex items-center gap-2`},Dz={class:`inline-flex items-center gap-2`},Oz=`__all__`,kz=k({__name:`TaskLogFilters`,props:{filters:{},stages:{}},emits:[`filter`],setup(e,{emit:t}){let n=e,r=t,i=I(()=>fw.map(e=>({value:e.value||Oz,label:e.label}))),a=I(()=>n.filters.level||Oz),o=I(()=>n.filters.stage||Oz);function s(e){r(`filter`,{...n.filters,...e})}function c(e){s({level:String(e)===Oz?``:String(e)})}function l(e){s({stage:String(e)===Oz?``:String(e)})}return(t,n)=>(R(),W(`div`,Tz,[U(`div`,Ez,[M(z(Gt),{"model-value":a.value,"onUpdate:modelValue":c},{default:j(()=>[M(z(Wt),{size:`sm`,"aria-label":`Filter log entries by level`},{default:j(()=>[M(z(Yt))]),_:1}),M(z(Pt),null,{default:j(()=>[M(z(Vt),null,{default:j(()=>[(R(!0),W(V,null,G(i.value,e=>(R(),K(z(qt),{key:e.value,value:e.value},{default:j(()=>[A(B(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])]),U(`div`,Dz,[M(z(Gt),{"model-value":o.value,"onUpdate:modelValue":l},{default:j(()=>[M(z(Wt),{size:`sm`,"aria-label":`Filter log entries by stage`},{default:j(()=>[M(z(Yt))]),_:1}),M(z(Pt),null,{default:j(()=>[M(z(Vt),null,{default:j(()=>[M(z(qt),{value:Oz},{default:j(()=>[...n[0]||=[A(`All stages`,-1)]]),_:1}),(R(!0),W(V,null,G(e.stages,e=>(R(),K(z(qt),{key:e,value:e},{default:j(()=>[A(B(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])])]))}}),Az={class:`sr-only`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`},jz={key:2,class:`flex flex-col items-start gap-2 py-3`},Mz={key:0,class:`mt-2 flex flex-wrap items-cent Line truncated
`)}};WW.defaultYaml={explicit:!1,version:`1.2`},WW.defaultTags={"!!":`tag:yaml.org,2002:`};function GW(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function KW(e){let t=new Set;return LW(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function qW(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function JW(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=KW(e);let a=qW(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(kW(t.node)||jW(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function YW(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=YW(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=YW(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=YW(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=YW(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function XW(e,t,n){if(Array.isArray(e))return e.map((e,t)=>XW(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!NW(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var ZW=class{constructor(e){Object.defineProperty(this,wW,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!EW(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=XW(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?YW(i,{"":o},``,o):o}},QW=class extends ZW{constructor(e){super(vW),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],LW(e,{Node:(e,t)=>{(TW(t)||NW(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(XW(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=$W(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(GW(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function $W(e,t,n){if(TW(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(jW(t)){let r=0;for(let i of t.items){let t=$W(e,i,n);t>r&&(r=t)}return r}if(OW(t)){let r=$W(e,t.key,n),i=$W(e,t.value,n);return Math.max(r,i)}return 1}var eG=e=>!e||typeof e!=`function`&&typeof e!=`object`,tG=class extends ZW{constructor(e){super(SW),this.value=e}toJSON(e,t){return t?.keep?this.value:XW(this.value,e,t)}toString(){return String(this.value)}};tG.BLOCK_FOLDED=`BLOCK_FOLDED`,tG.BLOCK_LITERAL=`BLOCK_LITERAL`,tG.PLAIN=`PLAIN`,tG.QUOTE_DOUBLE=`QUOTE_DOUBLE`,tG.QUOTE_SINGLE=`QUOTE_SINGLE`;var nG=`tag:yaml.org,2002:`;function rG(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function iG(e,t,n){if(EW(e)&&(e=e.contents),MW(e))return e;if(OW(e)){let t=n.schema[bW].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new QW(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=nG+t.slice(2));let l=rG(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new tG(e);return c&&(c.node=t),t Line truncated
`)?lG(n,t):n.includes(`
`)?`
`+iG(n,t):(e.endsWith(` `)?``:` `)+n,oG=`flow`,sG=`block`,cG=`quoted`;function lG(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=uG(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
`)n===`block`&&(h=uG(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`+lG(n,t):(e.endsWith(` `)?``:` `)+n,dG=`flow`,fG=`block`,pG=`quoted`;function mG(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=hG(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
`)n===`block`&&(h=hG(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function uG(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
`);r=t,i=t+1,a=e[i]}return r}var dG=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),fG=e=>/^(%|---|\.\.\.)/m.test(e);function pG(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function mG(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(fG(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function hG(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
`);r=t,i=t+1,a=e[i]}return r}var gG=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),_G=e=>/^(%|---|\.\.\.)/m.test(e);function vG(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function yG(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(_G(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:lG(o,a,cG,dG(t,!1))}function hG(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return mG(e,t);let n=t.indent||(fG(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:lG(r,n,oG,dG(t,!1))}function gG(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=mG;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?hG:i&&!t?mG:n?hG:mG}return r(e,t)}var _G;try{_G=RegExp(`(^|(?<!
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:mG(o,a,pG,gG(t,!1))}function bG(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return yG(e,t);let n=t.indent||(_G(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:mG(r,n,dG,gG(t,!1))}function xG(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=yG;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?bG:i&&!t?yG:n?bG:yG}return r(e,t)}var SG;try{SG=RegExp(`(^|(?<!
))
+(?!
|$)`,`g`)}catch{_G=/\n+(?!\n|$)/g}function vG({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return gG(n,r);let l=r.indent||(r.forceBlockIndent||fG(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===XW.BLOCK_FOLDED?!1:t===XW.BLOCK_LITERAL||!pG(n,c,l.length);if(!n)return u?`|
|$)`,`g`)}catch{SG=/\n+(?!\n|$)/g}function CG({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return xG(n,r);let l=r.indent||(r.forceBlockIndent||_G(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===tG.BLOCK_FOLDED?!1:t===tG.BLOCK_LITERAL||!vG(n,c,l.length);if(!n)return u?`|
`:`>
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
`&&(p=p.slice(0,-1)),p.replace(_G,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
`&&(p=p.slice(0,-1)),p.replace(SG,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=dG(r,!0);o!==`folded`&&t!==XW.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=lG(`${v}${e}${p}`,l,sG,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function yG(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
`)||u&&/[[\]{},]/.test(a))return gG(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?gG(a,t):vG(e,t,n,r);if(!s&&!u&&i!==XW.PLAIN&&a.includes(`
`))return vG(e,t,n,r);if(fG(a)){if(c===``)return t.forceBlockIndent=!0,vG(e,t,n,r);if(s&&c===l)return gG(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return gG(a,t)}return s?d:lG(d,c,oG,dG(t,!1))}function bG(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==XW.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=XW.QUOTE_DOUBLE);let c=e=>{switch(e){case XW.BLOCK_FOLDED:case XW.BLOCK_LITERAL:return i||a?gG(o.value,t):vG(o,t,n,r);case XW.QUOTE_DOUBLE:return mG(o.value,t);case XW.QUOTE_SINGLE:return hG(o.value,t);case XW.PLAIN:return yG(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function xG(e,t){let n=Object.assign({blockQuote:!0,commentString:rG,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function SG(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(wW(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function CG(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(wW(e)||EW(e))&&e.anchor;a&&BW(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function wG(e,t,n,r){if(CW(e))return e.toString(t,n,r);if(bW(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=DW(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=SG(t.doc.schema.tags,a);let o=CG(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):wW(a)?bG(a,t,n,r):a.toString(t,n,r);return o?wW(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function TG({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=DW(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(EW(e)||!DW(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||EW(e)||(wW(e)?e.type===XW.BLOCK_FOLDED||e.type===XW.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=wG(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=aG(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=aG(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=aG(g,n.indent,l(f))));let _,v,y;DW(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&wW(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&TW(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=wG(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${iG(e,n.indent)}`}x===``&&!n.inFlow?S===`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=gG(r,!0);o!==`folded`&&t!==tG.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=mG(`${v}${e}${p}`,l,fG,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function wG(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
`)||u&&/[[\]{},]/.test(a))return xG(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?xG(a,t):CG(e,t,n,r);if(!s&&!u&&i!==tG.PLAIN&&a.includes(`
`))return CG(e,t,n,r);if(_G(a)){if(c===``)return t.forceBlockIndent=!0,CG(e,t,n,r);if(s&&c===l)return xG(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return xG(a,t)}return s?d:mG(d,c,dG,gG(t,!1))}function TG(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==tG.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=tG.QUOTE_DOUBLE);let c=e=>{switch(e){case tG.BLOCK_FOLDED:case tG.BLOCK_LITERAL:return i||a?xG(o.value,t):CG(o,t,n,r);case tG.QUOTE_DOUBLE:return yG(o.value,t);case tG.QUOTE_SINGLE:return bG(o.value,t);case tG.PLAIN:return wG(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function EG(e,t){let n=Object.assign({blockQuote:!0,commentString:cG,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function DG(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(kW(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function OG(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(kW(e)||jW(e))&&e.anchor;a&&GW(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function kG(e,t,n,r){if(OW(e))return e.toString(t,n,r);if(TW(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=MW(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=DG(t.doc.schema.tags,a);let o=OG(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):kW(a)?TG(a,t,n,r):a.toString(t,n,r);return o?kW(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function AG({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=MW(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(jW(e)||!MW(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||jW(e)||(kW(e)?e.type===tG.BLOCK_FOLDED||e.type===tG.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=kG(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=uG(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=uG(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=uG(g,n.indent,l(f))));let _,v,y;MW(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&kW(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&AW(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=kG(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${lG(e,n.indent)}`}x===``&&!n.inFlow?S===`
`&&y&&(S=`
`):S+=`\n${n.indent}`}else if(!p&&EW(t)){let e=x[0],r=x.indexOf(`
`):S+=`\n${n.indent}`}else if(!p&&jW(t)){let e=x[0],r=x.indexOf(`
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=aG(g,n.indent,l(y)):h&&i&&i(),g}function EG(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var DG=`<<`,OG={identify:e=>e===DG||typeof e==`symbol`&&e.description===DG,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new XW(Symbol(DG)),{addToJSMap:AG}),stringify:()=>DG},kG=(e,t)=>(OG.identify(t)||wW(t)&&(!t.type||t.type===XW.PLAIN)&&OG.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===OG.tag&&e.default);function AG(e,t,n){let r=MG(e,n);if(TW(r))for(let n of r.items)jG(e,t,n);else if(Array.isArray(r))for(let n of r)jG(e,t,n);else jG(e,t,r)}function jG(e,t,n){let r=MG(e,n);if(!SW(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function MG(e,t){return e&&bW(t)?t.resolve(e.doc,e):t}function NG(e,t,{key:n,value:r}){if(DW(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(kG(e,n))AG(e,t,r);else{let i=GW(n,``,e);if(t instanceof Map)t.set(i,GW(r,i,e));else if(t instanceof Set)t.add(i);else{let a=PG(n,i,e),o=GW(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function PG(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(DW(e)&&n?.doc){let t=xG(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),EG(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function FG(e,t,n){return new IG($W(e,void 0,n),$W(t,void 0,n))}var IG=class e{constructor(e,t=null){Object.defineProperty(this,yW,{value:gW}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return DW(n)&&(n=n.clone(t)),DW(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return NG(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?TG(this,e,t,n):JSON.stringify(this)}};function LG(e,t,n){return(t.inFlow??e.flow?zG:RG)(e,t,n)}function RG({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(DW(i))!d&&i.spaceBefore&&f.push(``),BG(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(CW(i)){let e=DW(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),BG(n,f,e.commentBefore,d))}d=!1;let s=wG(i,u,()=>o=null,()=>d=!0);o&&(s+=aG(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=uG(g,n.indent,l(y)):h&&i&&i(),g}function jG(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var MG=`<<`,NG={identify:e=>e===MG||typeof e==`symbol`&&e.description===MG,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new tG(Symbol(MG)),{addToJSMap:FG}),stringify:()=>MG},PG=(e,t)=>(NG.identify(t)||kW(t)&&(!t.type||t.type===tG.PLAIN)&&NG.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===NG.tag&&e.default);function FG(e,t,n){let r=LG(e,n);if(AW(r))for(let n of r.items)IG(e,t,n);else if(Array.isArray(r))for(let n of r)IG(e,t,n);else IG(e,t,r)}function IG(e,t,n){let r=LG(e,n);if(!DW(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function LG(e,t){return e&&TW(t)?t.resolve(e.doc,e):t}function RG(e,t,{key:n,value:r}){if(MW(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(PG(e,n))FG(e,t,r);else{let i=XW(n,``,e);if(t instanceof Map)t.set(i,XW(r,i,e));else if(t instanceof Set)t.add(i);else{let a=zG(n,i,e),o=XW(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function zG(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(MW(e)&&n?.doc){let t=EG(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),jG(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function BG(e,t,n){return new VG(iG(e,void 0,n),iG(t,void 0,n))}var VG=class e{constructor(e,t=null){Object.defineProperty(this,wW,{value:xW}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return MW(n)&&(n=n.clone(t)),MW(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return RG(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?AG(this,e,t,n):JSON.stringify(this)}};function HG(e,t,n){return(t.inFlow??e.flow?WG:UG)(e,t,n)}function UG({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(MW(i))!d&&i.spaceBefore&&f.push(``),GG(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(OW(i)){let e=MW(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),GG(n,f,e.commentBefore,d))}d=!1;let s=kG(i,u,()=>o=null,()=>d=!0);o&&(s+=uG(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
`}}return e?(p+=`
`+iG(l(e),c),s&&s()):d&&o&&o(),p}function zG({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(DW(i))i.spaceBefore&&d.push(``),BG(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(CW(i)){let e=DW(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),BG(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=DW(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=wG(i,c,()=>a=null);l||=d.length>u||o.includes(`
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=aG(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function BG({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=iG(t(r),e);n.push(i.trimStart())}}function VG(e,t){let n=wW(t)?t.value:t;for(let r of e)if(CW(r)&&(r.key===t||r.key===n||wW(r.key)&&r.key.value===n))return r}var HG=class extends nG{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(hW,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(FG(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=CW(e)?e:!e||typeof e!=`object`||!(`key`in e)?new IG(e,e?.value):new IG(e.key,e.value);let r=VG(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);wW(r.value)&&YW(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=VG(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=VG(this.items,e)?.value;return(!t&&wW(n)?n.value:n)??void 0}has(e){return!!VG(this.items,e)}set(e,t){this.add(new IG(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)NG(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!CW(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),LG(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},UG={collection:`map`,default:!0,nodeClass:HG,tag:`tag:yaml.org,2002:map`,resolve(e,t){return SW(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>HG.from(e,t,n)},WG=class extends nG{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(vW,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=GG(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=GG(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&wW(r)?r.value:r}has(e){let t=GG(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=GG(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];wW(r)&&YW(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(GW(e,String(r++),t));return n}toString(e,t,n){return e?LG(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push($W(a,void 0,n))}}return i}};function GG(e){let t=wW(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var KG={collection:`seq`,default:!0,nodeClass:WG,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return TW(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>WG.from(e,t,n)},qG={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),bG(e,t,n,r)}},JG={identify:e=>e==null,createNode:()=>new XW(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new XW(null),stringify:({source:e},t)=>typeof e==`string`&&JG.test.test(e)?e:t.options.nullStr},YG={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new XW(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&YG.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function XG({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var ZG={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:XG},QG={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),string Line truncated
`:` `)}return bG({comment:e,type:t,value:s},r,i,a)}};function fK(e,t){if(TW(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!CW(r)){if(SW(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new IG(new XW(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=CW(r)?r:new IG(r)}}else t(`Expected a sequence for this tag`);return e}function pK(e,t,n){let{replacer:r}=n,i=new WG(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(FG(o,s,n))}return i}var mK={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:fK,createNode:pK},hK=class e extends WG{constructor(){super(),this.add=HG.prototype.add.bind(this),this.delete=HG.prototype.delete.bind(this),this.get=HG.prototype.get.bind(this),this.has=HG.prototype.has.bind(this),this.set=HG.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(CW(e)?(r=GW(e.key,``,t),i=GW(e.value,r,t)):r=GW(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=pK(e,t,n),i=new this;return i.items=r.items,i}};hK.tag=`tag:yaml.org,2002:omap`;var gK={collection:`seq`,identify:e=>e instanceof Map,nodeClass:hK,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=fK(e,t),r=[];for(let{key:e}of n.items)wW(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new hK,n)},createNode:(e,t,n)=>hK.from(e,t,n)};function _K({value:e,source:t},n){return t&&(e?vK:yK).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var vK={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new XW(!0),stringify:_K},yK={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new XW(!1),stringify:_K},bK={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:XG},xK={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():XG(e)}},SK={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new XW(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:XG},CK=e=>typeof e==`bigint`||Number.isInteger(e);function wK(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function TK(e,t,n){let{value:r}=e;if(CK(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return XG(e)}var EK={identify:CK,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>wK(e,2,2,n),stringify:e=>TK(e,2,`0b`)},DK={identify:CK,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>wK(e,1,8,n),stringify:e=>TK(e,8,`0`)},OK={identify:CK,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>wK(e,0,10,n),stringify:XG},kK={identify:CK,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>wK(e,2,16,n),stringify:e=>TK(e,16,`0x`)},AK=class e extends HG{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=CW(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new IG(e.key,null):new IG(e,null),VG(this.items,t.key)||this.items.push(t)}get(e,t){let n=VG(this.items,e);return!t&&CW(n)?wW(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=VG(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new IG(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return s Line truncated
`)?(n.push(`...`),n.push(iG(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(iG(a(t),``)))}return n.join(`
`+lG(l(e),c),s&&s()):d&&o&&o(),p}function WG({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(MW(i))i.spaceBefore&&d.push(``),GG(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(OW(i)){let e=MW(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),GG(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=MW(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=kG(i,c,()=>a=null);l||=d.length>u||o.includes(`
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=uG(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function GG({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=lG(t(r),e);n.push(i.trimStart())}}function KG(e,t){let n=kW(t)?t.value:t;for(let r of e)if(OW(r)&&(r.key===t||r.key===n||kW(r.key)&&r.key.value===n))return r}var qG=class extends sG{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(bW,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(BG(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=OW(e)?e:!e||typeof e!=`object`||!(`key`in e)?new VG(e,e?.value):new VG(e.key,e.value);let r=KG(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);kW(r.value)&&eG(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=KG(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=KG(this.items,e)?.value;return(!t&&kW(n)?n.value:n)??void 0}has(e){return!!KG(this.items,e)}set(e,t){this.add(new VG(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)RG(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!OW(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),HG(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},JG={collection:`map`,default:!0,nodeClass:qG,tag:`tag:yaml.org,2002:map`,resolve(e,t){return DW(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>qG.from(e,t,n)},YG=class extends sG{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(CW,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=XG(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=XG(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&kW(r)?r.value:r}has(e){let t=XG(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=XG(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];kW(r)&&eG(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(XW(e,String(r++),t));return n}toString(e,t,n){return e?HG(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(iG(a,void 0,n))}}return i}};function XG(e){let t=kW(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var ZG={collection:`seq`,default:!0,nodeClass:YG,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return AW(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>YG.from(e,t,n)},QG={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),TG(e,t,n,r)}},$G={identify:e=>e==null,createNode:()=>new tG(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new tG(null),stringify:({source:e},t)=>typeof e==`string`&&$G.test.test(e)?e:t.options.nullStr},eK={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new tG(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&eK.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function tK({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var nK={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:tK},rK={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),string Line truncated
`:` `)}return TG({comment:e,type:t,value:s},r,i,a)}};function _K(e,t){if(AW(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!OW(r)){if(DW(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new VG(new tG(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=OW(r)?r:new VG(r)}}else t(`Expected a sequence for this tag`);return e}function vK(e,t,n){let{replacer:r}=n,i=new YG(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(BG(o,s,n))}return i}var yK={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:_K,createNode:vK},bK=class e extends YG{constructor(){super(),this.add=qG.prototype.add.bind(this),this.delete=qG.prototype.delete.bind(this),this.get=qG.prototype.get.bind(this),this.has=qG.prototype.has.bind(this),this.set=qG.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(OW(e)?(r=XW(e.key,``,t),i=XW(e.value,r,t)):r=XW(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=vK(e,t,n),i=new this;return i.items=r.items,i}};bK.tag=`tag:yaml.org,2002:omap`;var xK={collection:`seq`,identify:e=>e instanceof Map,nodeClass:bK,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=_K(e,t),r=[];for(let{key:e}of n.items)kW(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new bK,n)},createNode:(e,t,n)=>bK.from(e,t,n)};function SK({value:e,source:t},n){return t&&(e?CK:wK).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var CK={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new tG(!0),stringify:SK},wK={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new tG(!1),stringify:SK},TK={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:tK},EK={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():tK(e)}},DK={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new tG(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:tK},OK=e=>typeof e==`bigint`||Number.isInteger(e);function kK(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function AK(e,t,n){let{value:r}=e;if(OK(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return tK(e)}var jK={identify:OK,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>kK(e,2,2,n),stringify:e=>AK(e,2,`0b`)},MK={identify:OK,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>kK(e,1,8,n),stringify:e=>AK(e,8,`0`)},NK={identify:OK,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>kK(e,0,10,n),stringify:tK},PK={identify:OK,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>kK(e,2,16,n),stringify:e=>AK(e,16,`0x`)},FK=class e extends qG{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=OW(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new VG(e.key,null):new VG(e,null),KG(this.items,t.key)||this.items.push(t)}get(e,t){let n=KG(this.items,e);return!t&&OW(n)?kW(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=KG(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new VG(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return s Line truncated
`)?(n.push(`...`),n.push(lG(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(lG(a(t),``)))}return n.join(`
`)+`
`}var GK=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,yW,{value:mW});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new zW({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[yW]:{value:mW}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=DW(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){KK(this.contents)&&this.contents.add(e)}addIn(e,t){KK(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=VW(this);e.anchor=!t||n.has(t)?HW(t||`a`,n):t}return new qW(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=UW(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=$W(e,l,p);return o&&EW(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new IG(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return KK(this.contents)?this.contents.delete(e):!1}deleteIn(e){return tG(e)?this.contents!=null&&(this.contents=null,!0):KK(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return EW(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return tG(e)?!t&&wW(this.contents)?this.contents.value:this.contents:EW(this.contents)?this.contents.getIn(e,t):void 0}has(e){return EW(this.contents)?this.contents.has(e):!1}hasIn(e){return tG(e)?this.contents!==void 0:EW(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=eG(this.schema,[e],t):KK(this.contents)&&this.contents.set(e,t)}setIn(e,t){tG(e)?this.contents=t:this.contents==null?this.contents=eG(this.schema,Array.from(e),t):KK(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new zW({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new zW({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new UK(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=GW(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?WW(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return WK(this,e)}};function KK(e){if(EW(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var qK=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},JK=class extends qK{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},YK=class extends qK{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},XK=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function ZK(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function QK(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(QK(t.key)||QK(t.value))return!0}return!1;default:return!0}}function $K(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&QK(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function eq(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||wW(e)&&wW(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var tq=`All mapping items must start at the same column`;function nq({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??HG)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=ZK(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,tq)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||QK(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,tq);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&$K(r.indent,u,i),n.atKey=!1,eq(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=ZK(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&$K(r.indent,f,i),s=c.range[2];let l=new IG(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let e=new IG(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function rq({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??WG)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=ZK(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&$K(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function iq(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var aq=`Block collections are not allowed within flow collections`,oq=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function sq({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?HG:WG))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=ZK(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&QK(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];CW(t)&&(t=t.value??t.key),t.comment?t.comment+=`
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],oq(m)&&i(r.range,`BLOCK_IN_FLOW`,aq)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);oq(f)&&i(g.range,`BLOCK_IN_FLOW`,aq),n.atKey=!1;let _=ZK(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?oq(m)&&i(v.range,`BLOCK_IN_FLOW`,aq):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new IG(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;eq(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new HG(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=iq(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function cq(e,t,n,r,i,a){let o=n.type===`block-map`?nq(e,t,n,r,a):n.type===`block-seq`?rq(e,t,n,r,a):sq(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function lq(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===HG.tagName&&s===`map`||o===WG.tagName&&s===`seq`)return cq(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),cq(e,t,n,i,o)}let l=cq(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=DW(u)?u:new XW(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function uq(e,t,n){let r=t.offset,i=dq(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?XW.BLOCK_FOLDED:XW.BLOCK_LITERAL,o=t.source?fq(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
`}var XK=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,wW,{value:yW});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new WW({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[wW]:{value:yW}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=MW(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){ZK(this.contents)&&this.contents.add(e)}addIn(e,t){ZK(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=KW(this);e.anchor=!t||n.has(t)?qW(t||`a`,n):t}return new QW(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=JW(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=iG(e,l,p);return o&&jW(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new VG(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return ZK(this.contents)?this.contents.delete(e):!1}deleteIn(e){return oG(e)?this.contents!=null&&(this.contents=null,!0):ZK(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return jW(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return oG(e)?!t&&kW(this.contents)?this.contents.value:this.contents:jW(this.contents)?this.contents.getIn(e,t):void 0}has(e){return jW(this.contents)?this.contents.has(e):!1}hasIn(e){return oG(e)?this.contents!==void 0:jW(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=aG(this.schema,[e],t):ZK(this.contents)&&this.contents.set(e,t)}setIn(e,t){oG(e)?this.contents=t:this.contents==null?this.contents=aG(this.schema,Array.from(e),t):ZK(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new WW({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new WW({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new JK(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=XW(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?YW(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return YK(this,e)}};function ZK(e){if(jW(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var QK=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},$K=class extends QK{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},eq=class extends QK{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},tq=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function nq(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],ee=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:ee,start:x??ee}}function rq(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(rq(t.key)||rq(t.value))return!0}return!1;default:return!0}}function iq(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&rq(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function aq(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||kW(e)&&kW(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var oq=`All mapping items must start at the same column`;function sq({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??qG)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=nq(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,oq)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||rq(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,oq);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&iq(r.indent,u,i),n.atKey=!1,aq(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=nq(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&iq(r.indent,f,i),s=c.range[2];let l=new VG(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let e=new VG(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function cq({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??YG)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=nq(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&iq(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function lq(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var uq=`Block collections are not allowed within flow collections`,dq=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function fq({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?qG:YG))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=nq(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&rq(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];OW(t)&&(t=t.value??t.key),t.comment?t.comment+=`
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],dq(m)&&i(r.range,`BLOCK_IN_FLOW`,uq)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);dq(f)&&i(g.range,`BLOCK_IN_FLOW`,uq),n.atKey=!1;let _=nq(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?dq(m)&&i(v.range,`BLOCK_IN_FLOW`,uq):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new VG(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;aq(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new qG(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=lq(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function pq(e,t,n,r,i,a){let o=n.type===`block-map`?sq(e,t,n,r,a):n.type===`block-seq`?cq(e,t,n,r,a):fq(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function mq(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===qG.tagName&&s===`map`||o===YG.tagName&&s===`seq`)return pq(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),pq(e,t,n,i,o)}let l=pq(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=MW(u)?u:new tG(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function hq(e,t,n){let r=t.offset,i=gq(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?tG.BLOCK_FOLDED:tG.BLOCK_LITERAL,o=t.source?_q(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===XW.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===tG.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`):t.length>c||r[0]===` `?(f===` `?f=`
`:!p&&f===`
`&&(f=`
@@ -86,59 +86,59 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
`+o[e][0].slice(c);d[d.length-1]!==`
`&&(d+=`
`);break;default:d+=`
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function dq({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function fq(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function pq(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=XW.PLAIN,c=mq(a,l);break;case`single-quoted-scalar`:s=XW.QUOTE_SINGLE,c=hq(a,l);break;case`double-quoted-scalar`:s=XW.QUOTE_DOUBLE,c=_q(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=iq(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function mq(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),gq(e)}function hq(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),gq(e.slice(1,-1)).replace(/''/g,`'`)}function gq(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function gq({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function _q(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function vq(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=tG.PLAIN,c=yq(a,l);break;case`single-quoted-scalar`:s=tG.QUOTE_SINGLE,c=bq(a,l);break;case`double-quoted-scalar`:s=tG.QUOTE_DOUBLE,c=Sq(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=lq(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function yq(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),xq(e)}function bq(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),xq(e.slice(1,-1)).replace(/''/g,`'`)}function xq(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
`?a+=o:o=`
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function _q(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function Sq(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
`){if(i===`
`){let{fold:t,offset:i}=vq(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=yq[i];if(a)n+=a;else if(i===`
`){let{fold:t,offset:i}=Cq(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=wq[i];if(a)n+=a;else if(i===`
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=bq(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=Tq(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
`&&(a!==`\r`||e[r+2]!==`
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function vq(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function Cq(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
`||r===`\r`)&&(r!==`\r`||e[t+2]===`
`);)r===`
`&&(n+=`
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var yq={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function bq(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function xq(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?uq(e,t,r):pq(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[_W]:c?Sq(e.schema,i,c,n,r):t.type===`scalar`?Cq(e,i,t,r):e.schema[_W];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=wW(a)?a:new XW(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new XW(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function Sq(e,t,n,r,i){if(n===`!`)return e[_W];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[_W])}function Cq({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[_W];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[_W];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function wq(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var Tq={composeNode:Eq,composeEmptyNode:Dq};function Eq(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=Oq(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=xq(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=lq(Tq,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=Dq(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!wW(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function Dq(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=xq(e,{type:`scalar`,offset:wq(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function Oq({options:e},{offset:t,source:n,end:r},i){let a=new qW(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=iq(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function kq(e,t,{offset:n,start:r,value:i,end:a},o){let s=new GK(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=ZK(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?Eq(c,i,l,o):Dq(c,l.end,r,null,l,o);let u=s.contents.range[2],d=iq(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function Aq(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function jq(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var wq={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function Tq(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function Eq(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?hq(e,t,r):vq(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[SW]:c?Dq(e.schema,i,c,n,r):t.type===`scalar`?Oq(e,i,t,r):e.schema[SW];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=kW(a)?a:new tG(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new tG(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function Dq(e,t,n,r,i){if(n===`!`)return e[SW];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[SW])}function Oq({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[SW];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[SW];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function kq(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var Aq={composeNode:jq,composeEmptyNode:Mq};function jq(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=Nq(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=Eq(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=mq(Aq,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=Mq(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!kW(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function Mq(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=Eq(e,{type:`scalar`,offset:kq(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function Nq({options:e},{offset:t,source:n,end:r},i){let a=new QW(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=lq(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function Pq(e,t,{offset:n,start:r,value:i,end:a},o){let s=new XK(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=nq(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?jq(c,i,l,o):Mq(c,l.end,r,null,l,o);let u=s.contents.range[2],d=lq(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function Fq(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function Iq(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
`:`
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var Mq=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=Aq(e);r?this.warnings.push(new YK(i,t,n)):this.errors.push(new JK(i,t,n))},this.directives=new zW({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=jq(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(EW(i)&&!i.flow&&i.items.length>0){let e=i.items[0];CW(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:jq(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=Aq(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=kq(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new JK(Aq(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new JK(Aq(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=iq(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new JK(Aq(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new GK(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},Nq=Symbol(`break visit`),Pq=Symbol(`skip children`),Fq=Symbol(`remove item`);function Iq(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),Lq(Object.freeze([]),e,t)}Iq.BREAK=Nq,Iq.SKIP=Pq,Iq.REMOVE=Fq,Iq.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},Iq.parentCollection=(e,t)=>{let n=Iq.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function Lq(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=Lq(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===Nq)return Nq;else r===Fq&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function Rq(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var Lq=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=Fq(e);r?this.warnings.push(new eq(i,t,n)):this.errors.push(new $K(i,t,n))},this.directives=new WW({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=Iq(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(jW(i)&&!i.flow&&i.items.length>0){let e=i.items[0];OW(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Iq(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=Fq(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=Pq(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new $K(Fq(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new $K(Fq(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=lq(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new $K(Fq(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new XK(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},Rq=Symbol(`break visit`),zq=Symbol(`skip children`),Bq=Symbol(`remove item`);function Vq(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),Hq(Object.freeze([]),e,t)}Vq.BREAK=Rq,Vq.SKIP=zq,Vq.REMOVE=Bq,Vq.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},Vq.parentCollection=(e,t)=>{let n=Vq.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function Hq(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=Hq(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===Rq)return Rq;else r===Bq&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function Uq(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
`:case`\r
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function zq(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var Bq=new Set(`0123456789ABCDEFabcdef`),Vq=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),Hq=new Set(`,[]{}`),Uq=new Set(` ,[]{}
\r `),Wq=e=>!e||Uq.has(e),Gq=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function Wq(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var Gq=new Set(`0123456789ABCDEFabcdef`),Kq=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),qq=new Set(`,[]{}`),Jq=new Set(` ,[]{}
\r `),Yq=e=>!e||Jq.has(e),Xq=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
`||t===`\r`&&this.buffer[e+1]===`
`}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
`||!t&&!this.atEnd)return e+n+1}return t===`
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&zq(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&zq(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!zq(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&zq(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(Wq),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&zq(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(Wq),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||zq(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&Wq(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&Wq(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Wq(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&Wq(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(Yq),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&Wq(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(Yq),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||Wq(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>zq(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>Wq(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(zq(r)||e&&Hq.has(r))break;t=n}else if(zq(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(Wq(r)||e&&qq.has(r))break;t=n}else if(Wq(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`?(n+=1,r=`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&Hq.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&Hq.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(Wq),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(zq(n)||t&&Hq.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!zq(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Vq.has(t))t=this.buffer[++e];else if(t===`%`&&Bq.has(this.buffer[e+1])&&Bq.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&qq.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&qq.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(Yq),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(Wq(n)||t&&qq.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!Wq(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Kq.has(t))t=this.buffer[++e];else if(t===`%`&&Gq.has(this.buffer[e+1])&&Gq.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},Kq=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function qq(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Jq(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function Yq(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function Xq(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function Zq(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function Qq(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function $q(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!qq(t.start,`explicit-key-ind`)&&!qq(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,Yq(t.value)?t.value.end?Qq(t.value.end,t.sep):t.value.end=t.sep:Qq(t.start,t.sep),delete t.sep)}var eJ=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new Gq,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Rq(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source})}else{if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&$q(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&Jq(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.in Line truncated
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},Zq=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function Qq(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function $q(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function eJ(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function tJ(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function nJ(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function rJ(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function iJ(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!Qq(t.start,`explicit-key-ind`)&&!Qq(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,eJ(t.value)?t.value.end?rJ(t.value.end,t.sep):t.value.end=t.sep:rJ(t.start,t.sep),delete t.sep)}var aJ=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new Xq,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Uq(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source})}else{if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&iJ(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&$q(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.in Line truncated
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Qq(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(qq(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=Zq(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(qq(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Yq(t.key)&&!qq(t.sep,`newline`)){let e=Zq(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):qq(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!qq(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Qq(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||qq(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.ite Line truncated
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){rJ(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(Qq(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=nJ(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Qq(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(eJ(t.key)&&!Qq(t.sep,`newline`)){let e=nJ(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):Qq(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!Qq(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){rJ(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||Qq(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.ite Line truncated
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=Zq(Xq(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=Zq(Xq(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function tJ(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Kq||null,prettyErrors:t}}function nJ(e,t={}){let{lineCounter:n,prettyErrors:r}=tJ(t),i=new eJ(n?.addNewLine),a=new Mq(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new JK(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(XK(e,n)),o.warnings.forEach(XK(e,n))),o}function rJ(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=nJ(e,n);if(!i)return null;if(i.warnings.forEach(e=>EG(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function iJ(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return xW(e)&&!r?e.toString(n):new GK(e,r,n).toString(n)}var aJ=e=>typeof e==`object`&&!!e&&!Array.isArray(e),oJ=e=>aJ(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function sJ(e){if(aJ(e)){if(aJ(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:oJ(e.parallel)};if(aJ(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:oJ(e.switch.cases)}}}function cJ(e){return e.slice(2).includes(`parallel`)}function lJ(e,t){let n=nJ(e).getIn(t,!0);if(SW(n))return n.toJSON()}function uJ(e,t,n){let r=nJ(e);return r.setIn(t,r.createNode(xJ(n))),r.toString()}function dJ(e,t,n){let r=nJ(e),i=t.slice(0,-1),a=cJ(i);if(a&&![`agent.run`,`workflow.call`].includes(n))throw Error(`Branches allow only read-only agents and workflow calls.`);let o=r.getIn(i,!0);if(TW(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!TW(o))return{source:e,path:[]};let s=Math.min(Math.max(Number(t.at(-1))+1,0),o.items.length),c=n===`parallel`?{parallel:{"branch-1":[],"branch-2":[]}}:n===`switch`?{switch:{on:``,cases:{true:[],default:[]}}}:{type:n,...a&&n===`agent.run`?{settings:{read_only:!0}}:{}};return o.items.splice(s,0,r.createNode(c)),{source:r.toString(),path:[...i,s]}}function fJ(e,t){if(t===`switch`){if(!e||e.includes(`/`))throw Error(`A case is the value it matches, without a slash.`)}else if(!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/.test(e))throw Error(`Use a lowercase branch name with letters, digits, dots or dashes.`)}function pJ(e,t){let n=e.getIn(t,!0),r=sJ(SW(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!SW(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function mJ(e,t,n){let r=nJ(e),{kind:i,branches:a}=pJ(r,t);if(fJ(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function hJ(e,t,n,r){let i=nJ(e),{kind:a,branches:o}=pJ(i,t);if(fJ(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>wW(e.key)&&e.key.value===n);if(!s||!wW(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function gJ(e,t,n){let r=nJ(e),{kind:i,branches:a}=pJ(r,t);if(i===`parallel`&&a.items.length<=2)throw Error(`Parallel needs at least two branches.`);if(a.items.length<=1)throw Error(`A switch needs at least one case.`);return Line truncated
`).find(e=>e.trim())?.trim()}}function IJ(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(MJ)].map(e=>e[1]))]}function LJ(e){let t=nJ(e).toJS(),n=NJ(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=new Set,c=`start`;r.push({id:c,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let l=[c],u=1,d=new Map,f=e=>{let t=d.get(e)??0;return d.set(e,t+1),t},p=(e,t,n,i,s,c,l,u)=>{let d=NJ(e)?e:{},p=sJ(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=NJ(d.settings)?d.settings:{},g=typeof d.id==`string`?d.id:``,_=`step-${t}`,v=s?`${s}/${g||m}`:g||m;r.push({id:_,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:g||t,name:g||void 0,title:g||jJ(m),type:m,step:l?.length===2?String(Number(l[1])+1).padStart(2,`0`):void 0,detail:p?.on?`on ${p.on.replace(/^steps\./,``)}`:PJ(m,h),summary:FJ(h),when:typeof d.when==`string`?d.when:void 0,retry:NJ(d.retry)&&typeof d.retry.attempts==`number`?d.retry.attempts:void 0,continues:d.on_failure===`continue`,branch:s,lane:u,path:l,stage:v,occurrence:f(v),...c?{resume:c}:{}}}),g&&a.set(g,_);let y=p?.on?`{{ ${p.on} }}`:``;for(let e of IJ([d.settings,y],d.when))o.push({from:e,to:_});return _},m=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,...s.has(r)?{otherwise:!0}:{},insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){let n=sJ(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*OJ,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=NJ(t)&&typeof t.id==`string`?t.id:i,f=i===`switch`&&!o.some(([e])=>e==="default"),h=o.length+ +!!f,g=[],_=0;o.forEach(([t,n],o)=>{let s=(o-(h-1)/2)*kJ,l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*OJ,t,d,[...f,r],i);m(l,a,[...f,r-1]),l=[a]}),_=Math.max(_,n.length);let v=`add-${e}-${t}`;r.push({id:v,type:`add`,position:{x:s+104,y:(u+n.length)*OJ},data:{kind:`step`,key:v,title:``,type:``,detail:``,branch:t,lane:i,insertAfter:[...f,n.length-1]}}),m(l,v),g.push(v)});let v=(Math.max(_,1)+1)*OJ-24;o.forEach(([t],n)=>{let a=(n-(h-1)/2)*kJ;r.push({id:`lane-${e}-${t}`,type:`lane`,position:{x:a-12,y:u*OJ-40},style:{width:`264px`,height:`${v}px`},zIndex:-1,data:{kind:`step`,key:t,title:t,type:``,detail:``,lane:i}})}),f&&(g.push(c),s.add(c)),l=g,u+=Math.max(_,1)+1;continue}let i=p(t,String(e+1),0,u*OJ,void 0,void 0,[`steps`,e]);m(l,i,[`steps`,e-1]),l=[i],u++}r.push({id:`add-end`,type:`add`,position:{x:104,y:u*OJ-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``,insertAfter:[`steps`,n.length-1]}}),m(l,`add-end`);for(let{from:e,to:t}of o){let n=a.get(e);n&&(i.some(e=>e.kind===`flow`&&e.source===n&&e.target===t)||i.push({id:`data-${n}-${t}`,source:n,target:t,kind:`data`,label:e,offset:24+14*i.filter(e=>e.kind===`data`).length,sourceHandle:`data-out`,targetHandle:`data-in`}))}return{nodes:r,edges:i}}var RJ=`\0`,zJ=k({inheritAttrs:!1,__name:`OptionSelect`,props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},size:{},class:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=t;return(t,r)=>(R(),K(z(Dl),{"model-value":e.modelValue===``&&e.options.some(e=>e.value===``)?RJ:e.modelValue||void 0,disabled:e.disabled,"onUpdate:modelValue":r[0]||=e=>n(`update:modelValue`,e===RJ?``:String(e))},{default:j(()=>[M(z(Pl),H({size:e.size??`sm`,class:t.$props.class},t.$attrs),{default:j(()=>[M(z(Fl),{placeholder:e.placeholder},null,8,[`placeholder`])]),_:1},16,[`size`,`class`]),M(z(Ol),null,{default:j(()=>[(R(!0),W(V,null,G(e.options,e=>(R(),K(z(jl),{key:e.value,value:e.value===``?RJ:e.value,disabled:e.disabled},{default:j(()=>[A(B(e.label),1)]),_:2},1032,[`value`,`disabled`]))),128))]),_:1})]),_:1},8,[`model-value`,`disabled`]))}}),BJ=k({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{}},emits:[`pick`],setup(e,{emit:t}){let n=t;return(t,r)=>(R(),K(z(Dl),{"model-value":e.value||void 0,"onUpdate:modelValue":r[0]||=e=>n(`pick`,String(e))},{default:j(()=>[M(z(Pl),{"aria-label":e.label},{default:j(()=>[M(z(Fl),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`]),M(z(Ol),null,{default:j(()=>[e.value&&!e.workflows.some(t=>t.id===e.value)?(R(),K(z(jl),{key:0,value:e.value,disabled:``},{default:j(()=>[A(B(e.value)+` (unavailable)`,1)]),_:1},8,[`value`])):L(``,!0),(R(!0),W(V,null,G(e.workflows,e=>(R(),K(z(jl),{key:e.id,value:e.id},{default:j(()=>[A(B(e.id),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`]))}});function VJ(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function HJ(e,t=[]){let n=nJ(e),r=n.errors[0];if(r)return{ok:!1,message:rY(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!iY(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`string`?i.id.trim():``;if(!a)return{ok:!1,message:`workflow id is required`};let o=i.steps;if(o==null||o===``)return{ok:!1,message:`workflow ${a} has no steps`};if(!Array.isAr Line truncated
`).map((e,t)=>({number:t+1,text:e,tokens:$J(e)}))}var ZJ=/^(\s*)(-\s+)?/,QJ=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function $J(e){let{code:t,comment:n}=eY(e),r=tY(t);return n&&r.push({text:n,kind:`comment`}),r}function eY(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t)r===t&&(t=``);else if(r===`"`||r===`'`)t=r;else if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function tY(e){if(!e)return[];let t=[],n=ZJ.exec(e);n?.[1]&&t.push({text:n[1],kind:`plain`}),n?.[2]&&t.push({text:n[2],kind:`punct`});let r=e.slice(n?.[0].length??0);if(!r)return t;let i=QJ.exec(r);return i?(t.push({text:i[1]??``,kind:`key`}),t.push({text:i[2]??`:`,kind:`punct`}),i[3]&&t.push({text:i[3],kind:`plain`}),[...t,...nY(i[4]??``)]):[...t,...nY(r)]}function nY(e){if(!e)return[];let t=/^("[^"]*"?|'[^']*'?)([\s\S]*)$/.exec(e);if(!t)return[{text:e,kind:`plain`}];let n=[{text:t[1]??``,kind:`string`}];return t[2]&&n.push({text:t[2],kind:`plain`}),n}function rY(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function iY(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function aY(e){return typeof e==`string`&&e.trim()!==``}var oY={class:`space-y-4 px-3 py-3`},sY={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},cY={key:1,class:`space-y-3`},lY={key:0,class:`block space-y-1.5`},uY=[`id`],dY=[`value`],fY={class:`text-xs font-medium text-muted-foreground`},pY={class:`flex items-center gap-2`},mY={key:1,role:`alert`,class:`text-xs text-danger`},hY={key:2,class:`space-y-1.5`},gY=[`title`],_Y={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},vY={key:0,class:`divide-y divide-border rounded-md border border-border`},yY=[`title`],bY={key:0,class:`space-y-3`},xY={class:`text-[13px]`},SY={key:0,class:`text-danger`},CY={class:`ml-2 text-xs text-fg-subtle`},wY={key:1,class:`space-y-3`},TY={class:`text-[13px]`},EY={class:`ml-2 text-xs text-fg-subtle`},DY=[`title`],OY={key:0,class:`text-xs text-danger`},kY={class:`space-y-1.5`},AY={key:0,role:`alert`,class:`text-xs text-danger`},jY={class:`divide-y divide-border rounded-md border border-border`},MY={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},NY={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},PY={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},FY={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},IY=[`for`],LY=k({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=We(),r=e,i=t,a=I(()=>lJ(r.yaml,r.path)??{}),o=I(()=>sJ(a.value)),s=I(()=>o.value?.kind??(typeof a.value.type==`string`?a.value.type:``)),c=I(()=>o.value?.branches.map(([e])=>e)??[]),l=I(()=>s.value===`parallel`?2:1);function u(e){i(`update:yaml`,uJ(r.yaml,r.path,{...a.value,switch:{...a.value.switch,on:e}}))}let d=q(``),f=q(``);function p(e,t,n=``){try{let a=e===`add`?mJ(r.yaml,r.path,t):e===`rename`?hJ(r.yaml,r.path,t,n):gJ(r.yaml,r.path,t);i(`update:yaml`,a),d.value=``,f.value=``}catch(e){f.value=String(e.message)}}let m=I(()=>r.vocabulary.find(e=>e.name===s.value)),h=I(()=>typeof a.value.settings==`object`&&a.value.settings!==null?a.value.settings:{}),g=I(()=>bJ(r.yaml,r.path)),_=I(()=>KJ(a.value)),v=I(()=>m.value?.settings&&a.value.settings?JJ(a.value.settings,m.value.settings,`settings`):``),y=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],x=/mission|body|detail|plan|rules/;function S(e,t){return[`workflow.call`,`workflow.handoff`].includes(s.value)&&e===`workflow`||s.value===`human.approve`&&e===`then`?`workflow`:s.value===`agent.run`&&e===`model`?`select`:t.type===`string`?t.enum?`select`:x.test(e)?`text`:`line`:t.type===`boolean`?`boolean`:t.type===`integer`||t.type===`number`?`number`:t.type===`array`&&t.items?.type===`string`?`lines`:`yaml`}let C=I(()=>{let e=Object.entries(m.value?.settings?.properties??{}).filter(([e])=>s.value!==`workflow.call`||![`inputs`,`outputs`].includes(e)).map(([e,t])=>({key:e,schema:t,kind:S(e,t),options:s.value===`agent.run`&&e===`model`?r.modelAliases:t.enum??[]})),t=e.filter(e=>y.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>y.indexOf(e.key)-y.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`workflow`,`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}}),w=q(!C.value.lead&&!o.value),ee=e=>[{value:``,label:`Default`},...e.map(e=>({value:e,label:e}))];function te(e){let{id:t,type:n,...a}=e;i(`update:yaml`,uJ(r.yaml,r.path,{id:t,type:n,...a}))}function T(e,t){te({...a.value,[e]:t})}function E(e){let t={...a.value.retry,...e};T(`retry`,t.attempts===void 0&&!t.backoff?void 0:{...t,attempts:t.attempts??1})}function ne(e,t){let n={...h.value,[e]:t};s.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,te({...a.value,settings:n})}function re(e,t){let n={...h.value,[e]:t};s.value===`workflow.call`&&t!==h.value[e]&&(delete n.inputs,delete n.outputs),te({...a.value,settings:n})}let ie=I(()=>r.workflows.find(e=>e.id===h.value.workflow)),ae=I(()=>Object.entries(SJ(ie.value?.yaml??``,`inputs`)??{})),D=I(()=>Object.entries(SJ(ie.value?.yaml??``,`outputs`)??{})),oe=I(()=>Object.entries(SJ(r.yaml,`inputs`)??{})),se=I(()=>Object.entries(SJ(r.yaml,`outputs`)??{})),ce=I(()=>h.value.inputs??{}),O=I(()=>h.value.outputs??{}),le=e=>typeof e==`string`&&e.startsWith(`inputs.`),ue=e=>[`object`,`array`].includes(e.type??``),de=e=>ce.value[e]===void 0?``:String(ce.value[e]);function fe(e,t,n){ne(`inputs`,{...ce.value,[e]:t===``?void 0:le(t)?t:Gv(t,n??`string`)})}let pe=(e,t,n)=>e.filter(([,e])=>e.type===t.type||e.type===`any`||t.type===`any`).map(([e])=>({value:`${n}.${e}`,label:e})),me=q(null);function he(e,t){let n=me.value??C.value.lead?.key;if(!n)return;let r=typeof h.value[n]==`string`?h.value[n]:``,i=`{{ steps.${e}.${t} }}`;ne(n,r?`${r.trimEnd()} ${i}`:i)}let ge=q({});function _e(e,t){try{ne(e,t.trim()?rJ(t):void 0),ge.value={...ge.value,[e]:``}}catch(t){ge.value={...ge.value,[ Line truncated
`)[0]}}}let ve=e=>e===void 0?``:iJ(e).trimEnd(),ye=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),be=e=>typeof h.value[e]==`string`?h.value[e]:``,xe=[{value:``,label:`Park the task`},{value:`continue`,label:`Continue`}];return(t,r)=>(R(),W(`div`,oY,[v.value?(R(),W(`p`,sY,B(v.value),1)):L(``,!0),o.value?(R(),W(`section`,cY,[s.value===`switch`?(R(),W(`label`,lY,[r[15]||=U(`span`,{class:`text-xs font-medium text-muted-foreground`,title:`The value whose case runs; a case named default runs when none matches`},`Switch on`,-1),M(z(Z),{"model-value":o.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,list:`${z(n)}-switch-on`,onChange:r[0]||=e=>u(e.target.value.trim())},null,8,[`model-value`,`list`]),U(`datalist`,{id:`${z(n)}-switch-on`},[(R(!0),W(V,null,G(g.value,e=>(R(),W(`option`,{key:e,value:`steps.${e}.result.`},null,8,dY))),128))],8,uY)])):L(``,!0),U(`div`,fY,B(s.value===`switch`?`Cases`:`Branches`),1),(R(!0),W(V,null,G(c.value,e=>(R(),W(`div`,{key:e,class:`flex items-center gap-2`},[M(z(Z),{"model-value":e,class:N(s.value===`switch`&&`font-mono`),"aria-label":`${s.value===`switch`?`Case`:`Branch`} ${e}`,onChange:t=>p(`rename`,e,t.target.value.trim())},null,8,[`model-value`,`class`,`aria-label`,`onChange`]),M(z(J),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:c.value.length<=l.value,onClick:t=>p(`delete`,e)},{default:j(()=>[M(z(b))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),U(`div`,pY,[M(z(Z),{modelValue:d.value,"onUpdate:modelValue":r[1]||=e=>d.value=e,"aria-label":s.value===`switch`?`New case value`:`New branch name`,placeholder:s.value===`switch`?`Value, or default`:`Branch name`,onKeydown:r[2]||=At(Mt(e=>p(`add`,d.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),M(z(J),{type:`button`,size:`icon-sm`,variant:`outline`,"aria-label":s.value===`switch`?`Add case`:`Add branch`,disabled:!d.value.trim(),onClick:r[3]||=e=>p(`add`,d.value.trim())},{default:j(()=>[M(z(oc))]),_:1},8,[`aria-label`,`disabled`])]),f.value?(R(),W(`p`,mY,B(f.value),1)):L(``,!0)])):L(``,!0),C.value.lead?(R(),W(`section`,hY,[U(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:C.value.lead.schema.description},[A(B(ye(C.value.lead.key,C.value.lead.schema))+` `,1),C.value.lead.schema.description?(R(),K(z(Fs),{key:0,class:`size-3 text-fg-subtle`})):L(``,!0)],8,gY),C.value.lead.kind===`workflow`?(R(),K(BJ,{key:0,value:be(C.value.lead.key),workflows:e.workflows,label:ye(C.value.lead.key,C.value.lead.schema),onPick:r[4]||=e=>re(C.value.lead.key,e)},null,8,[`value`,`workflows`,`label`])):C.value.lead.kind===`select`?(R(),K(zJ,{key:1,class:`w-full`,"model-value":be(C.value.lead.key),options:ee(C.value.lead.options),"aria-label":ye(C.value.lead.key,C.value.lead.schema),"onUpdate:modelValue":r[5]||=e=>ne(C.value.lead.key,e||void 0)},null,8,[`model-value`,`options`,`aria-label`])):C.value.lead.kind===`text`?(R(),K(z(Ql),{key:2,"model-value":be(C.value.lead.key),class:`min-h-32 text-[13px] leading-relaxed`,onFocus:r[6]||=e=>me.value=C.value.lead.key,"onUpdate:modelValue":r[7]||=e=>ne(C.value.lead.key,String(e))},null,8,[`model-value`])):(R(),K(z(Z),{key:3,"model-value":be(C.value.lead.key),onFocus:r[8]||=e=>me.value=C.value.lead.key,"onUpdate:modelValue":r[9]||=e=>ne(C.value.lead.key,String(e))},null,8,[`model-value`])),g.value.length&&C.value.lead.kind!==`select`?(R(),W(`div`,_Y,[r[16]||=U(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(R(!0),W(V,null,G(g.value,e=>(R(),W(V,{key:e},[M(z(J),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>he(e,`summary`)},{default:j(()=>[A(B(e),1)]),_:2},1032,[`onClick`]),M(z(J),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>he(e,`result`)},{default:j(()=>[A(B(e)+`.result`,1)]),_:2},1032,[`onClick`])],64))),128))])):L(``,!0)])):L(``,!0),M(z(J),{type:`button`,variant:`ghost`,size:`xs`,class:`-ml-2 text-muted-foreground`,"aria-expanded":w.value,onClick:r[10]||=e=>w.value=!w.value},{default:j(()=>[M(z(en),{"data-icon":`inline-start`,class:N([`transition-transform`,!w.value&&`-rotate-90`])},null,8,[`class`]),r[17]||=A(`More `,-1)]),_:1},8,[`aria-expanded`]),w.value?(R(),W(V,{key:3},[C.value.compact.length?(R(),W(`section`,vY,[(R(!0),W(V,null,G(C.value.compact,t=>(R(),W(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[U(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:t.schema.description},[A(B(ye(t.key,t.schema))+` `,1),t.schema.description?(R(),K(z(Fs),{key:0,class:`size-3 text-fg-subtle`})):L(``,!0)],8,yY),t.kind===`workflow`?(R(),K(BJ,{key:0,class:`max-w-48`,value:be(t.key),workflows:e.workflows,label:ye(t.key,t.schema),onPick:e=>re(t.key,e)},null,8,[`value`,`workflows`,`label`,`onPick`])):t.kind===`boolean`?(R(),K(z(Ah),{key:1,"model-value":h.value[t.key]===!0,"onUpdate:modelValue":e=>ne(t.key,e||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):t.kind===`sLine truncated
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>ne(e.key,String(t).split(`
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(R(),W(V,{key:2},[M(z(Ql),{"model-value":ve(h.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>_e(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),ge.value[e.key]?(R(),W(`span`,OY,B(ge.value[e.key]),1)):L(``,!0)],64))]))),128)),U(`section`,kY,[_.value?(R(),W(`p`,AY,B(_.value),1)):L(``,!0),U(`div`,jY,[U(`label`,MY,[r[20]||=U(`span`,{class:`flex-1 text-[13px]`,title:`Empty always runs. A field such as inputs.enabled, !inputs.skip, or steps.plan.result.ready == true`},`Run only when`,-1),M(z(Z),{class:`h-7 w-48 font-mono text-xs`,placeholder:`inputs.enabled`,"aria-invalid":_.value&&_.value.startsWith(`when`)?!0:void 0,"model-value":a.value.when??``,"onUpdate:modelValue":r[11]||=e=>T(`when`,String(e))},null,8,[`aria-invalid`,`model-value`])]),U(`label`,NY,[r[21]||=U(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),M(zJ,{class:`w-36`,"aria-label":`If it fails`,"model-value":a.value.on_failure??``,options:xe,"onUpdate:modelValue":r[12]||=e=>T(`on_failure`,e||void 0)},null,8,[`model-value`])]),U(`label`,PY,[r[22]||=U(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),M(z(Z),{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 text-right text-[13px]`,"model-value":a.value.retry?.attempts??``,"onUpdate:modelValue":r[13]||=e=>E({attempts:String(e)===``?void 0:Number(String(e))})},null,8,[`model-value`])]),U(`div`,FY,[U(`label`,{for:`${z(n)}-backoff`,class:`flex-1 text-[13px]`},`Retry backoff`,8,IY),M(z(yh),{id:`${z(n)}-backoff`,"model-value":a.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":r[14]||=e=>E({backoff:e||void 0})},null,8,[`id`,`model-value`])])])])],64)):L(``,!0)]))}}),RY={class:`space-y-1.5`},zY={class:`flex items-center text-xs font-medium text-muted-foreground`},BY={key:0,class:`divide-y divide-border rounded-md border border-border`},VY=k({__name:`SpecList`,props:{yaml:{},field:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=e,r=t,i=[`string`,`number`,`bool`,`object`,`array`,`any`].map(e=>({value:e,label:e})),a=I(()=>Object.entries(SJ(n.yaml,n.field)??{}));function o(e){r(`update:yaml`,CJ(n.yaml,n.field,Object.fromEntries(e.filter(([e])=>e))))}function s(e,t,n){o(a.value.map((r,i)=>i===e?[t,n]:r))}function c(){let e=n.field.slice(0,-1),t=a.value.length+1;for(;a.value.some(([n])=>n===`${e}_${t}`);)t++;o([...a.value,[`${e}_${t}`,{type:`string`}]])}return(t,n)=>(R(),W(`section`,RY,[U(`div`,zY,[A(B(e.field===`inputs`?`Inputs`:`Outputs`)+` `,1),M(z(J),{type:`button`,variant:`ghost`,size:`xs`,class:`ml-auto`,onClick:c},{default:j(()=>[M(z(oc),{"data-icon":`inline-start`}),n[0]||=A(`Add`,-1)]),_:1})]),a.value.length?(R(),W(`div`,BY,[(R(!0),W(V,null,G(a.value,([t,n],r)=>(R(),W(`div`,{key:r,class:`flex items-center gap-2 px-2 py-1.5`},[M(z(Z),{"model-value":t,class:`h-7 min-w-0 flex-1 font-mono text-xs`,"aria-label":`${e.field} name`,onChange:e=>s(r,e.target.value.trim(),n)},null,8,[`model-value`,`aria-label`,`onChange`]),M(zJ,{"model-value":n.type??`string`,options:z(i),class:`w-24`,"aria-label":`${t} type`,"onUpdate:modelValue":e=>s(r,t,{...n,type:e})},null,8,[`model-value`,`options`,`aria-label`,`onUpdate:modelValue`]),M(z(Ah),{"model-value":n.required===!0,title:n.required?`Required`:`Optional`,"aria-label":`${t} required`,"onUpdate:modelValue":e=>s(r,t,{...n,required:e||void 0})},null,8,[`model-value`,`title`,`aria-label`,`onUpdate:modelValue`]),M(z(J),{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Remove ${t}`,onClick:e=>o(a.value.filter((e,t)=>t!==r))},{default:j(()=>[M(z(b))]),_:1},8,[`aria-label`,`onClick`])]))),128))])):L(``,!0)]))}}),HY={class:`space-y-4 px-3 py-3`},UY={class:`divide-y divide-border rounded-md border border-border`},WY={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},GY={key:0,role:`alert`,class:`px-3 py-2 text-xs text-danger`},KY={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},qY={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},JY={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},YY={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},XY={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},ZY={class:`space-y-1.5`},QY=`6f129e29-0e26-5246-99bd-74cb4496203b`,$Y=k({__name:`WorkflowSettings`,props:{yaml:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=e,r=t,i=e=>{let t=SJ(n.yaml,e);return typeof t==`string`?t:``};function a(e,t){r(`update:yaml`,CJ(n.yaml,e,t))}let o=s_(),s=q([]),c=q(!0),l=q(``);async function u(){c.value=!0,l.value=``,s.value=[];try{await o.loadOrg();let e=await Y.orgAgents(o.homeOrg);s.value=e.agents.filter(e=>e.lifecycle===`active`),!i(`identity`)&&s.value.some(e=>e.id===QY)&&a(`identity`,QY)}catch(e){l.value=String(e.message||e)}finally{c.value=!1}}gt(u);let d=I(()=>{let e=i(`identity`),t=s.value.map(e=>({value:e.id,label:e.display_name}));return e&&!s.value.some(t=>t.id===e)?[{value:e,label:`${e} (unknown)`,disabled:!0},...t]:t}),f=D(),p=I(()=>{let e=Object.keys(f.stateFor(`agent-profilesLine truncated
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=nJ(tJ(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=nJ(tJ(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function oJ(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Zq||null,prettyErrors:t}}function sJ(e,t={}){let{lineCounter:n,prettyErrors:r}=oJ(t),i=new aJ(n?.addNewLine),a=new Lq(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new $K(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(tq(e,n)),o.warnings.forEach(tq(e,n))),o}function cJ(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=sJ(e,n);if(!i)return null;if(i.warnings.forEach(e=>jG(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function lJ(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return EW(e)&&!r?e.toString(n):new XK(e,r,n).toString(n)}var uJ=e=>typeof e==`object`&&!!e&&!Array.isArray(e),dJ=e=>uJ(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function fJ(e){if(uJ(e)){if(uJ(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:dJ(e.parallel)};if(uJ(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:dJ(e.switch.cases)}}}function pJ(e){return e.slice(2).includes(`parallel`)}function mJ(e,t){let n=sJ(e).getIn(t,!0);if(DW(n))return n.toJSON()}function hJ(e,t,n){let r=sJ(e);return r.setIn(t,r.createNode(EJ(n))),r.toString()}function gJ(e,t,n){let r=sJ(e),i=t.slice(0,-1),a=pJ(i);if(a&&![`agent.run`,`workflow.call`].includes(n))throw Error(`Branches allow only read-only agents and workflow calls.`);let o=r.getIn(i,!0);if(AW(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!AW(o))return{source:e,path:[]};let s=Math.min(Math.max(Number(t.at(-1))+1,0),o.items.length),c=n===`parallel`?{parallel:{"branch-1":[],"branch-2":[]}}:n===`switch`?{switch:{on:``,cases:{true:[],default:[]}}}:{type:n,...a&&n===`agent.run`?{settings:{read_only:!0}}:{}};return o.items.splice(s,0,r.createNode(c)),{source:r.toString(),path:[...i,s]}}function _J(e,t){if(t===`switch`){if(!e||e.includes(`/`))throw Error(`A case is the value it matches, without a slash.`)}else if(!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/.test(e))throw Error(`Use a lowercase branch name with letters, digits, dots or dashes.`)}function vJ(e,t){let n=e.getIn(t,!0),r=fJ(DW(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!DW(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function yJ(e,t,n){let r=sJ(e),{kind:i,branches:a}=vJ(r,t);if(_J(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function bJ(e,t,n,r){let i=sJ(e),{kind:a,branches:o}=vJ(i,t);if(_J(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>kW(e.key)&&e.key.value===n);if(!s||!kW(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function xJ(e,t,n){let r=sJ(e),{kind:i,branches:a}=vJ(r,t);if(i===`parallel`&&a.items.length<=2)throw Error(`Parallel needs at least two branches.`);if(a.items.length<=1)throw Error(`A switch needs at least one case.`);return Line truncated
`).find(e=>e.trim())?.trim()}}function VJ(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(LJ)].map(e=>e[1]))]}function HJ(e){let t=sJ(e).toJS(),n=RJ(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=new Set,c=`start`;r.push({id:c,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let l=[c],u=1,d=new Map,f=e=>{let t=d.get(e)??0;return d.set(e,t+1),t},p=(e,t,n,i,s,c,l,u)=>{let d=RJ(e)?e:{},p=fJ(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=RJ(d.settings)?d.settings:{},g=typeof d.id==`string`?d.id:``,_=`step-${t}`,v=s?`${s}/${g||m}`:g||m;r.push({id:_,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:g||t,name:g||void 0,title:g||IJ(m),type:m,step:l?.length===2?String(Number(l[1])+1).padStart(2,`0`):void 0,detail:p?.on?`on ${p.on.replace(/^steps\./,``)}`:zJ(m,h),summary:BJ(h),when:typeof d.when==`string`?d.when:void 0,retry:RJ(d.retry)&&typeof d.retry.attempts==`number`?d.retry.attempts:void 0,continues:d.on_failure===`continue`,branch:s,lane:u,path:l,stage:v,occurrence:f(v),...c?{resume:c}:{}}}),g&&a.set(g,_);let y=p?.on?`{{ ${p.on} }}`:``;for(let e of VJ([d.settings,y],d.when))o.push({from:e,to:_});return _},m=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,...s.has(r)?{otherwise:!0}:{},insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){let n=fJ(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*NJ,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=RJ(t)&&typeof t.id==`string`?t.id:i,f=i===`switch`&&!o.some(([e])=>e==="default"),h=o.length+ +!!f,g=[],_=0;o.forEach(([t,n],o)=>{let s=(o-(h-1)/2)*PJ,l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*NJ,t,d,[...f,r],i);m(l,a,[...f,r-1]),l=[a]}),_=Math.max(_,n.length);let v=`add-${e}-${t}`;r.push({id:v,type:`add`,position:{x:s+104,y:(u+n.length)*NJ},data:{kind:`step`,key:v,title:``,type:``,detail:``,branch:t,lane:i,insertAfter:[...f,n.length-1]}}),m(l,v),g.push(v)});let v=(Math.max(_,1)+1)*NJ-24;o.forEach(([t],n)=>{let a=(n-(h-1)/2)*PJ;r.push({id:`lane-${e}-${t}`,type:`lane`,position:{x:a-12,y:u*NJ-40},style:{width:`264px`,height:`${v}px`},zIndex:-1,data:{kind:`step`,key:t,title:t,type:``,detail:``,lane:i}})}),f&&(g.push(c),s.add(c)),l=g,u+=Math.max(_,1)+1;continue}let i=p(t,String(e+1),0,u*NJ,void 0,void 0,[`steps`,e]);m(l,i,[`steps`,e-1]),l=[i],u++}r.push({id:`add-end`,type:`add`,position:{x:104,y:u*NJ-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``,insertAfter:[`steps`,n.length-1]}}),m(l,`add-end`);for(let{from:e,to:t}of o){let n=a.get(e);n&&(i.some(e=>e.kind===`flow`&&e.source===n&&e.target===t)||i.push({id:`data-${n}-${t}`,source:n,target:t,kind:`data`,label:e,offset:24+14*i.filter(e=>e.kind===`data`).length,sourceHandle:`data-out`,targetHandle:`data-in`}))}return{nodes:r,edges:i}}var UJ=`\0`,WJ=k({inheritAttrs:!1,__name:`OptionSelect`,props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},size:{},class:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=t;return(t,r)=>(R(),K(z(Gt),{"model-value":e.modelValue===``&&e.options.some(e=>e.value===``)?UJ:e.modelValue||void 0,disabled:e.disabled,"onUpdate:modelValue":r[0]||=e=>n(`update:modelValue`,e===UJ?``:String(e))},{default:j(()=>[M(z(Wt),H({size:e.size??`sm`,class:t.$props.class},t.$attrs),{default:j(()=>[M(z(Yt),{placeholder:e.placeholder},null,8,[`placeholder`])]),_:1},16,[`size`,`class`]),M(z(Pt),null,{default:j(()=>[(R(!0),W(V,null,G(e.options,e=>(R(),K(z(qt),{key:e.value,value:e.value===``?UJ:e.value,disabled:e.disabled},{default:j(()=>[A(B(e.label),1)]),_:2},1032,[`value`,`disabled`]))),128))]),_:1})]),_:1},8,[`model-value`,`disabled`]))}}),GJ=k({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{}},emits:[`pick`],setup(e,{emit:t}){let n=t;return(t,r)=>(R(),K(z(Gt),{"model-value":e.value||void 0,"onUpdate:modelValue":r[0]||=e=>n(`pick`,String(e))},{default:j(()=>[M(z(Wt),{"aria-label":e.label},{default:j(()=>[M(z(Yt),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`]),M(z(Pt),null,{default:j(()=>[e.value&&!e.workflows.some(t=>t.id===e.value)?(R(),K(z(qt),{key:0,value:e.value,disabled:``},{default:j(()=>[A(B(e.value)+` (unavailable)`,1)]),_:1},8,[`value`])):L(``,!0),(R(!0),W(V,null,G(e.workflows,e=>(R(),K(z(qt),{key:e.id,value:e.id},{default:j(()=>[A(B(e.id),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`]))}});function KJ(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function qJ(e,t=[]){let n=sJ(e),r=n.errors[0];if(r)return{ok:!1,message:cY(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!lY(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`string`?i.id.trim():``;if(!a)return{ok:!1,message:`workflow id is required`};let o=i.steps;if(o==null||o===``)return{ok:!1,message:`workflow ${a} has no steps`};if(!Array.isAr Line truncated
`).map((e,t)=>({number:t+1,text:e,tokens:iY(e)}))}var nY=/^(\s*)(-\s+)?/,rY=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function iY(e){let{code:t,comment:n}=aY(e),r=oY(t);return n&&r.push({text:n,kind:`comment`}),r}function aY(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t)r===t&&(t=``);else if(r===`"`||r===`'`)t=r;else if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function oY(e){if(!e)return[];let t=[],n=nY.exec(e);n?.[1]&&t.push({text:n[1],kind:`plain`}),n?.[2]&&t.push({text:n[2],kind:`punct`});let r=e.slice(n?.[0].length??0);if(!r)return t;let i=rY.exec(r);return i?(t.push({text:i[1]??``,kind:`key`}),t.push({text:i[2]??`:`,kind:`punct`}),i[3]&&t.push({text:i[3],kind:`plain`}),[...t,...sY(i[4]??``)]):[...t,...sY(r)]}function sY(e){if(!e)return[];let t=/^("[^"]*"?|'[^']*'?)([\s\S]*)$/.exec(e);if(!t)return[{text:e,kind:`plain`}];let n=[{text:t[1]??``,kind:`string`}];return t[2]&&n.push({text:t[2],kind:`plain`}),n}function cY(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function lY(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function uY(e){return typeof e==`string`&&e.trim()!==``}var dY={class:`space-y-4 px-3 py-3`},fY={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},pY={key:1,class:`space-y-3`},mY={key:0,class:`block space-y-1.5`},hY=[`id`],gY=[`value`],_Y={class:`text-xs font-medium text-fg-muted`},vY={class:`flex items-center gap-2`},yY={key:1,role:`alert`,class:`text-xs text-danger`},bY={key:2,class:`space-y-1.5`},xY=[`title`],SY={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},CY={key:0,class:`divide-y divide-border rounded-md border border-border`},wY=[`title`],TY={key:0,class:`space-y-3`},EY={class:`text-[13px]`},DY={key:0,class:`text-danger`},OY={class:`ml-2 text-xs text-fg-subtle`},kY={key:1,class:`space-y-3`},AY={class:`text-[13px]`},jY={class:`ml-2 text-xs text-fg-subtle`},MY=[`title`],NY={key:0,class:`text-xs text-danger`},PY={class:`space-y-1.5`},FY={key:0,role:`alert`,class:`text-xs text-danger`},IY={class:`divide-y divide-border rounded-md border border-border`},LY={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},RY={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},zY={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},BY={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},VY=[`for`],HY=k({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=we(),r=e,i=t,a=I(()=>mJ(r.yaml,r.path)??{}),o=I(()=>fJ(a.value)),s=I(()=>o.value?.kind??(typeof a.value.type==`string`?a.value.type:``)),c=I(()=>o.value?.branches.map(([e])=>e)??[]),l=I(()=>s.value===`parallel`?2:1);function u(e){i(`update:yaml`,hJ(r.yaml,r.path,{...a.value,switch:{...a.value.switch,on:e}}))}let d=q(``),f=q(``);function p(e,t,n=``){try{let a=e===`add`?yJ(r.yaml,r.path,t):e===`rename`?bJ(r.yaml,r.path,t,n):xJ(r.yaml,r.path,t);i(`update:yaml`,a),d.value=``,f.value=``}catch(e){f.value=String(e.message)}}let m=I(()=>r.vocabulary.find(e=>e.name===s.value)),h=I(()=>typeof a.value.settings==`object`&&a.value.settings!==null?a.value.settings:{}),g=I(()=>TJ(r.yaml,r.path)),_=I(()=>ZJ(a.value)),v=I(()=>m.value?.settings&&a.value.settings?$J(a.value.settings,m.value.settings,`settings`):``),y=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],b=/mission|body|detail|plan|rules/;function x(e,t){return[`workflow.call`,`workflow.handoff`].includes(s.value)&&e===`workflow`||s.value===`human.approve`&&e===`then`?`workflow`:s.value===`agent.run`&&e===`model`?`select`:t.type===`string`?t.enum?`select`:b.test(e)?`text`:`line`:t.type===`boolean`?`boolean`:t.type===`integer`||t.type===`number`?`number`:t.type===`array`&&t.items?.type===`string`?`lines`:`yaml`}let S=I(()=>{let e=Object.entries(m.value?.settings?.properties??{}).filter(([e])=>s.value!==`workflow.call`||![`inputs`,`outputs`].includes(e)).map(([e,t])=>({key:e,schema:t,kind:x(e,t),options:s.value===`agent.run`&&e===`model`?r.modelAliases:t.enum??[]})),t=e.filter(e=>y.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>y.indexOf(e.key)-y.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`workflow`,`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}}),ee=q(!S.value.lead&&!o.value),C=e=>[{value:``,label:`Default`},...e.map(e=>({value:e,label:e}))];function te(e){let{id:t,type:n,...a}=e;i(`update:yaml`,hJ(r.yaml,r.path,{id:t,type:n,...a}))}function ne(e,t){te({...a.value,[e]:t})}function w(e){let t={...a.value.retry,...e};ne(`retry`,t.attempts===void 0&&!t.backoff?void 0:{...t,attempts:t.attempts??1})}function T(e,t){let n={...h.value,[e]:t};s.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,te({...a.value,settings:n})}function E(e,t){let n={...h.value,[e]:t};s.value===`workflow.call`&&t!==h.value[e]&&(delete n.inputs,delete n.outputs),te({...a.value,settings:n})}let re=I(()=>r.workflows.find(e=>e.id===h.value.workflow)),ie=I(()=>Object.entries(DJ(re.value?.yaml??``,`inputs`)??{})),ae=I(()=>Object.entries(DJ(re.value?.yaml??``,`outputs`)??{})),oe=I(()=>Object.entries(DJ(r.yaml,`inputs`)??{})),se=I(()=>Object.entries(DJ(r.yaml,`outputs`)??{})),ce=I(()=>h.value.inputs??{}),le=I(()=>h.value.outputs??{}),ue=e=>typeof e==`string`&&e.startsWith(`inputs.`),D=e=>[`object`,`array`].includes(e.type??``),de=e=>ce.value[e]===void 0?``:String(ce.value[e]);function fe(e,t,n){T(`inputs`,{...ce.value,[e]:t===``?void 0:ue(t)?t:Zv(t,n??`string`)})}let me=(e,t,n)=>e.filter(([,e])=>e.type===t.type||e.type===`any`||t.type===`any`).map(([e])=>({value:`${n}.${e}`,label:e})),O=q(null);function he(e,t){let n=O.value??S.value.lead?.key;if(!n)return;let r=typeof h.value[n]==`string`?h.value[n]:``,i=`{{ steps.${e}.${t} }}`;T(n,r?`${r.trimEnd()} ${i}`:i)}let ge=q({});function _e(e,t){try{T(e,t.trim()?cJ(t):void 0),ge.value={...ge.value,[e]:``}}catch(t){ge.value={...ge.value,[e]:String(t. Line truncated
`)[0]}}}let ve=e=>e===void 0?``:lJ(e).trimEnd(),k=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),ye=e=>typeof h.value[e]==`string`?h.value[e]:``,be=[{value:``,label:`Park the task`},{value:`continue`,label:`Continue`}];return(t,r)=>(R(),W(`div`,dY,[v.value?(R(),W(`p`,fY,B(v.value),1)):L(``,!0),o.value?(R(),W(`section`,pY,[s.value===`switch`?(R(),W(`label`,mY,[r[15]||=U(`span`,{class:`text-xs font-medium text-fg-muted`,title:`The value whose case runs; a case named default runs when none matches`},`Switch on`,-1),M(z(Z),{"model-value":o.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,list:`${z(n)}-switch-on`,onChange:r[0]||=e=>u(e.target.value.trim())},null,8,[`model-value`,`list`]),U(`datalist`,{id:`${z(n)}-switch-on`},[(R(!0),W(V,null,G(g.value,e=>(R(),W(`option`,{key:e,value:`steps.${e}.result.`},null,8,gY))),128))],8,hY)])):L(``,!0),U(`div`,_Y,B(s.value===`switch`?`Cases`:`Branches`),1),(R(!0),W(V,null,G(c.value,e=>(R(),W(`div`,{key:e,class:`flex items-center gap-2`},[M(z(Z),{"model-value":e,class:N(s.value===`switch`&&`font-mono`),"aria-label":`${s.value===`switch`?`Case`:`Branch`} ${e}`,onChange:t=>p(`rename`,e,t.target.value.trim())},null,8,[`model-value`,`class`,`aria-label`,`onChange`]),M(z(X),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:c.value.length<=l.value,onClick:t=>p(`delete`,e)},{default:j(()=>[M(z(Ys))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),U(`div`,vY,[M(z(Z),{modelValue:d.value,"onUpdate:modelValue":r[1]||=e=>d.value=e,"aria-label":s.value===`switch`?`New case value`:`New branch name`,placeholder:s.value===`switch`?`Value, or default`:`Branch name`,onKeydown:r[2]||=pt(ct(e=>p(`add`,d.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),M(z(X),{type:`button`,size:`icon-sm`,variant:`outline`,"aria-label":s.value===`switch`?`Add case`:`Add branch`,disabled:!d.value.trim(),onClick:r[3]||=e=>p(`add`,d.value.trim())},{default:j(()=>[M(z(Ns))]),_:1},8,[`aria-label`,`disabled`])]),f.value?(R(),W(`p`,yY,B(f.value),1)):L(``,!0)])):L(``,!0),S.value.lead?(R(),W(`section`,bY,[U(`div`,{class:`flex items-center gap-1 text-xs font-medium text-fg-muted`,title:S.value.lead.schema.description},[A(B(k(S.value.lead.key,S.value.lead.schema))+` `,1),S.value.lead.schema.description?(R(),K(z(cs),{key:0,class:`size-3 text-fg-subtle`})):L(``,!0)],8,xY),S.value.lead.kind===`workflow`?(R(),K(GJ,{key:0,value:ye(S.value.lead.key),workflows:e.workflows,label:k(S.value.lead.key,S.value.lead.schema),onPick:r[4]||=e=>E(S.value.lead.key,e)},null,8,[`value`,`workflows`,`label`])):S.value.lead.kind===`select`?(R(),K(WJ,{key:1,class:`w-full`,"model-value":ye(S.value.lead.key),options:C(S.value.lead.options),"aria-label":k(S.value.lead.key,S.value.lead.schema),"onUpdate:modelValue":r[5]||=e=>T(S.value.lead.key,e||void 0)},null,8,[`model-value`,`options`,`aria-label`])):S.value.lead.kind===`text`?(R(),K(z(xl),{key:2,"model-value":ye(S.value.lead.key),class:`min-h-32 text-[13px] leading-relaxed`,onFocus:r[6]||=e=>O.value=S.value.lead.key,"onUpdate:modelValue":r[7]||=e=>T(S.value.lead.key,String(e))},null,8,[`model-value`])):(R(),K(z(Z),{key:3,"model-value":ye(S.value.lead.key),onFocus:r[8]||=e=>O.value=S.value.lead.key,"onUpdate:modelValue":r[9]||=e=>T(S.value.lead.key,String(e))},null,8,[`model-value`])),g.value.length&&S.value.lead.kind!==`select`?(R(),W(`div`,SY,[r[16]||=U(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(R(!0),W(V,null,G(g.value,e=>(R(),W(V,{key:e},[M(z(X),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>he(e,`summary`)},{default:j(()=>[A(B(e),1)]),_:2},1032,[`onClick`]),M(z(X),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>he(e,`result`)},{default:j(()=>[A(B(e)+`.result`,1)]),_:2},1032,[`onClick`])],64))),128))])):L(``,!0)])):L(``,!0),M(z(X),{type:`button`,variant:`ghost`,size:`xs`,class:`-ml-2 text-fg-muted`,"aria-expanded":ee.value,onClick:r[10]||=e=>ee.value=!ee.value},{default:j(()=>[M(z(pe),{"data-icon":`inline-start`,class:N([`transition-transform`,!ee.value&&`-rotate-90`])},null,8,[`class`]),r[17]||=A(`More `,-1)]),_:1},8,[`aria-expanded`]),ee.value?(R(),W(V,{key:3},[S.value.compact.length?(R(),W(`section`,CY,[(R(!0),W(V,null,G(S.value.compact,t=>(R(),W(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[U(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:t.schema.description},[A(B(k(t.key,t.schema))+` `,1),t.schema.description?(R(),K(z(cs),{key:0,class:`size-3 text-fg-subtle`})):L(``,!0)],8,wY),t.kind===`workflow`?(R(),K(GJ,{key:0,class:`max-w-48`,value:ye(t.key),workflows:e.workflows,label:k(t.key,t.schema),onPick:e=>E(t.key,e)},null,8,[`value`,`workflows`,`label`,`onPick`])):t.kind===`boolean`?(R(),K(z(Uh),{key:1,"model-value":h.value[t.key]===!0,"onUpdate:modelValue":e=>T(t.key,e||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):t.kind===`select`?(R(),K(WJ,{key:2,class:`w-Line truncated
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>T(e.key,String(t).split(`
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(R(),W(V,{key:2},[M(z(xl),{"model-value":ve(h.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>_e(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),ge.value[e.key]?(R(),W(`span`,NY,B(ge.value[e.key]),1)):L(``,!0)],64))]))),128)),U(`section`,PY,[_.value?(R(),W(`p`,FY,B(_.value),1)):L(``,!0),U(`div`,IY,[U(`label`,LY,[r[20]||=U(`span`,{class:`flex-1 text-[13px]`,title:`Empty always runs. A field such as inputs.enabled, !inputs.skip, or steps.plan.result.ready == true`},`Run only when`,-1),M(z(Z),{class:`h-7 w-48 font-mono text-xs`,placeholder:`inputs.enabled`,"aria-invalid":_.value&&_.value.startsWith(`when`)?!0:void 0,"model-value":a.value.when??``,"onUpdate:modelValue":r[11]||=e=>ne(`when`,String(e))},null,8,[`aria-invalid`,`model-value`])]),U(`label`,RY,[r[21]||=U(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),M(WJ,{class:`w-36`,"aria-label":`If it fails`,"model-value":a.value.on_failure??``,options:be,"onUpdate:modelValue":r[12]||=e=>ne(`on_failure`,e||void 0)},null,8,[`model-value`])]),U(`label`,zY,[r[22]||=U(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),M(z(Z),{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 text-right text-[13px]`,"model-value":a.value.retry?.attempts??``,"onUpdate:modelValue":r[13]||=e=>w({attempts:String(e)===``?void 0:Number(String(e))})},null,8,[`model-value`])]),U(`div`,BY,[U(`label`,{for:`${z(n)}-backoff`,class:`flex-1 text-[13px]`},`Retry backoff`,8,VY),M(z(Mh),{id:`${z(n)}-backoff`,"model-value":a.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":r[14]||=e=>w({backoff:e||void 0})},null,8,[`id`,`model-value`])])])])],64)):L(``,!0)]))}}),UY={class:`space-y-1.5`},WY={class:`flex items-center text-xs font-medium text-fg-muted`},GY={key:0,class:`divide-y divide-border rounded-md border border-border`},KY=k({__name:`SpecList`,props:{yaml:{},field:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=e,r=t,i=[`string`,`number`,`bool`,`object`,`array`,`any`].map(e=>({value:e,label:e})),a=I(()=>Object.entries(DJ(n.yaml,n.field)??{}));function o(e){r(`update:yaml`,OJ(n.yaml,n.field,Object.fromEntries(e.filter(([e])=>e))))}function s(e,t,n){o(a.value.map((r,i)=>i===e?[t,n]:r))}function c(){let e=n.field.slice(0,-1),t=a.value.length+1;for(;a.value.some(([n])=>n===`${e}_${t}`);)t++;o([...a.value,[`${e}_${t}`,{type:`string`}]])}return(t,n)=>(R(),W(`section`,UY,[U(`div`,WY,[A(B(e.field===`inputs`?`Inputs`:`Outputs`)+` `,1),M(z(X),{type:`button`,variant:`ghost`,size:`xs`,class:`ml-auto`,onClick:c},{default:j(()=>[M(z(Ns),{"data-icon":`inline-start`}),n[0]||=A(`Add`,-1)]),_:1})]),a.value.length?(R(),W(`div`,GY,[(R(!0),W(V,null,G(a.value,([t,n],r)=>(R(),W(`div`,{key:r,class:`flex items-center gap-2 px-2 py-1.5`},[M(z(Z),{"model-value":t,class:`h-7 min-w-0 flex-1 font-mono text-xs`,"aria-label":`${e.field} name`,onChange:e=>s(r,e.target.value.trim(),n)},null,8,[`model-value`,`aria-label`,`onChange`]),M(WJ,{"model-value":n.type??`string`,options:z(i),class:`w-24`,"aria-label":`${t} type`,"onUpdate:modelValue":e=>s(r,t,{...n,type:e})},null,8,[`model-value`,`options`,`aria-label`,`onUpdate:modelValue`]),M(z(Uh),{"model-value":n.required===!0,title:n.required?`Required`:`Optional`,"aria-label":`${t} required`,"onUpdate:modelValue":e=>s(r,t,{...n,required:e||void 0})},null,8,[`model-value`,`title`,`aria-label`,`onUpdate:modelValue`]),M(z(X),{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Remove ${t}`,onClick:e=>o(a.value.filter((e,t)=>t!==r))},{default:j(()=>[M(z(Ys))]),_:1},8,[`aria-label`,`onClick`])]))),128))])):L(``,!0)]))}}),qY={class:`space-y-4 px-3 py-3`},JY={class:`divide-y divide-border rounded-md border border-border`},YY={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},XY={key:0,role:`alert`,class:`px-3 py-2 text-xs text-danger`},ZY={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},QY={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},$Y={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},eX={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},tX={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},nX={class:`space-y-1.5`},rX=`6f129e29-0e26-5246-99bd-74cb4496203b`,iX=k({__name:`WorkflowSettings`,props:{yaml:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=e,r=t,i=e=>{let t=DJ(n.yaml,e);return typeof t==`string`?t:``};function a(e,t){r(`update:yaml`,OJ(n.yaml,e,t))}let o=p_(),s=q([]),c=q(!0),l=q(``);async function u(){c.value=!0,l.value=``,s.value=[];try{await o.loadOrg();let e=await Y.orgAgents(o.homeOrg);s.value=e.agents.filter(e=>e.lifecycle===`active`),!i(`identity`)&&s.value.some(e=>e.id===rX)&&a(`identity`,rX)}catch(e){l.value=String(e.message||e)}finally{c.value=!1}}Xe(u);let d=I(()=>{let e=i(`identity`),t=s.value.map(e=>({value:e.id,label:e.display_name}));return e&&!s.value.some(t=>t.id===e)?[{value:e,label:`${e} (unknown)`,disabled:!0},...t]:t}),f=_h(),p=I(()=>{let e=Object.keys(f.stateFor(`agent-profiles`).r Line truncated
`).replace(`
`,`
+`).split(`
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function S4(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=C4(n.code,e);return Array.isArray(e)?e.some(e=>x4(n[r],e,t,n.type===`keyup`)):x4(n[r],e,t,n.type===`keyup`)}}function C4(e,t){return t.includes(e)?`code`:`key`}function w4(e,t){let n=I(()=>He(t?.target)??v4),r=Ze(He(e)===!0),i=!1,a=new Set,o=c(He(e));F(()=>He(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),gZ([`blur`,`contextmenu`],s),vZ((...e)=>o(...e),e=>{let n=He(t?.actInsideInputWithModifier)??!0,a=He(t?.preventDefault)??!1;if(i=b4(e),(!i||i&&!n)&&y4(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),vZ((...e)=>o(...e),e=>{let n=He(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&y4(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=He(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?S4(e,a):e}return r}var T4=`vue-flow__node-desc`,E4=`vue-flow__edge-desc`,D4=`vue-flow__aria-live`,O4=[`Enter`,` `,`Escape`],k4={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function A4(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function j4(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function M4(e){return{width:e.offsetWidth,height:e.offsetHeight}}function N4(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function P4(e,t){return{x:N4(e.x,t[0][0],t[1][0]),y:N4(e.y,t[0][1],t[1][1])}}function F4(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function I4(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function L4(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!I4(e)}function R4(e){return L4(e)&&`computedPosition`in e}function z4(e){return!Number.isNaN(e)&&Number.isFinite(e)}function B4(e){return z4(e.width)&&z4(e.height)&&z4(e.x)&&z4(e.y)}function V4(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:bt({width:0,height:0}),computedPosition:bt({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:i6(e.data)?e.data:{},events:bt(i6(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function H4(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:i6(e.data)?e.data:{},events:bt(i6(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function U4(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function W4(...e){if(e.length===3){let[t,n,r]=e;return U4(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>I4(e)&&e.source===r).map(e=>n.find(t=>L4(t)&&t.id===e.target))}function G4(...e){if(e.length===3){let[t,n,r]=e;return U4(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>I4(e)&&e.target===r).map(e=>n.find(t=>L4(t)&&t.id===e.source))}function K4({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function q4(e,t){return t.some(t=>I4(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function J4({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function Y4({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?V3(s,o):s}function X4(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function Z4({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function Q4({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function $4(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=X4(t,Z4({...r.computedPosition,...r.dimensions}))}return Q4(t)}function e3(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...Y4(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s= Line truncated
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function D4(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=O4(n.code,e);return Array.isArray(e)?e.some(e=>E4(n[r],e,t,n.type===`keyup`)):E4(n[r],e,t,n.type===`keyup`)}}function O4(e,t){return t.includes(e)?`code`:`key`}function k4(e,t){let n=I(()=>Se(t?.target)??C4),r=je(Se(e)===!0),i=!1,a=new Set,o=c(Se(e));F(()=>Se(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),xZ([`blur`,`contextmenu`],s),CZ((...e)=>o(...e),e=>{let n=Se(t?.actInsideInputWithModifier)??!0,a=Se(t?.preventDefault)??!1;if(i=T4(e),(!i||i&&!n)&&w4(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),CZ((...e)=>o(...e),e=>{let n=Se(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&w4(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=Se(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?D4(e,a):e}return r}var A4=`vue-flow__node-desc`,j4=`vue-flow__edge-desc`,M4=`vue-flow__aria-live`,N4=[`Enter`,` `,`Escape`],P4={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function F4(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function I4(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function L4(e){return{width:e.offsetWidth,height:e.offsetHeight}}function R4(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function z4(e,t){return{x:R4(e.x,t[0][0],t[1][0]),y:R4(e.y,t[0][1],t[1][1])}}function B4(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function V4(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function H4(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!V4(e)}function U4(e){return H4(e)&&`computedPosition`in e}function W4(e){return!Number.isNaN(e)&&Number.isFinite(e)}function G4(e){return W4(e.width)&&W4(e.height)&&W4(e.x)&&W4(e.y)}function K4(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:et({width:0,height:0}),computedPosition:et({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:l6(e.data)?e.data:{},events:et(l6(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function q4(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:l6(e.data)?e.data:{},events:et(l6(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function J4(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function Y4(...e){if(e.length===3){let[t,n,r]=e;return J4(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>V4(e)&&e.source===r).map(e=>n.find(t=>H4(t)&&t.id===e.target))}function X4(...e){if(e.length===3){let[t,n,r]=e;return J4(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>V4(e)&&e.target===r).map(e=>n.find(t=>H4(t)&&t.id===e.source))}function Z4({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function Q4(e,t){return t.some(t=>V4(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function $4({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function e3({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?K3(s,o):s}function t3(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function n3({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function r3({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function i3(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=t3(t,n3({...r.computedPosition,...r.dimensions}))}return r3(t)}function a3(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...e3(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s= Line truncated
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
Node: ${e}
@@ -158,10 +158,10 @@ Edge: ${e}
Source: ${t}
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},F3=class extends Error{constructor(e,...t){super(P3[e]?.call(P3,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function I3(e){return`clientX`in e}function L3(e){return`sourceEvent`in e}function R3(e,t){let n=I3(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var z3=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function B3(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function V3(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var H3=()=>!0;function U3(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function W3(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())j4(i,A4(e))>0&&r.push(e);return r}var G3=250;function K3(e,t,n,r){let i=[],a=1/0,o=W3(e,n,t+G3);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=k3(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function q3(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=H3},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=R3(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=J3(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===p4.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=Z3(t,e,a,p,n,!0)}return b}function J3(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Y3(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function X3(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function Z3(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===p4.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...k3(o,c,c.position,!0)}:c}var Q3={[u4.Left]:u4.Right,[u4.Right]:u4.Left,[u4.Top]:u4.Bottom,[u4.Bottom]:u4.Top},$3=[`production`,`prod`];function e6(e,...t){t6()&&console.warn(`[Vue Flow]: ${e}`,...t)}function t6(){return!$3.includes(`production`)}function n6(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...M4(t)}}):null}function r6(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),vt(()=>{o.blur()})):n([e])}function i6(e){return z(e)!==void 0}function a6(e,t,n,r){if(!e||!e.source||!e.target)return n(new F3(N3.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=I4(e)?e:{...e,id:K4(e)},i=H4(i,void 0,r),!q4(i,t)&&i}function o6(e,t,n,r,i){if(!t.source||!t.target)return i(new F3(N3.EDGE_INVALID,e.id)),!1;if(!n)return i(new F3(N3.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?K4(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function s6(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!L4(o)){n(new F3(N3.NODE_INVALID,o?.id));continue}let s=V4(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new F3(N3.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function c6(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function l6(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;c6(`source`,o,`${r}-${a}--Line truncated
`)},B(e.data.summary||e.data.detail),9,c7)):L(``,!0),e.data.when||e.data.retry||e.data.continues?(R(),W(`div`,l7,[e.data.when?(R(),W(`span`,{key:0,class:`flex max-w-full min-w-0 items-center gap-0.5 rounded bg-secondary px-1 font-mono`,title:`Runs only when ${e.data.when}`},[M(z(Us),{class:`size-3 shrink-0`,"aria-hidden":`true`}),U(`span`,d7,B(e.data.when),1)],8,u7)):L(``,!0),e.data.retry?(R(),W(`span`,{key:1,class:`flex items-center gap-0.5 rounded bg-secondary px-1`,title:`Up to ${e.data.retry} attempts`},[M(z(cc),{class:`size-3`,"aria-hidden":`true`}),A(`×`+B(e.data.retry),1)],8,f7)):L(``,!0),e.data.continues?(R(),W(`span`,p7,[M(z(hc),{class:`size-3`,"aria-hidden":`true`}),n[10]||=A(`continues`,-1)])):L(``,!0)])):L(``,!0),e.data.run?.error?(R(),W(`p`,{key:4,class:`mt-1 line-clamp-2 text-[11px] text-danger`,title:e.data.run.error},B(e.data.run.error),9,m7)):L(``,!0)],64))]),M(Ot,{"enter-from-class":`opacity-0 -translate-y-1`,"enter-active-class":`transition duration-200`,"leave-to-class":`opacity-0`,"leave-active-class":`transition duration-100`},{default:j(()=>[e.data.expanded?(R(),W(`div`,{key:0,class:`nodrag nopan nowheel cursor-auto border-t border-border`,onClick:n[6]||=Mt(()=>{},[`stop`])},[P(t.$slots,`default`)])):L(``,!0)]),_:3}),M(z(U6),{type:`source`,position:z(u4).Bottom},null,8,[`position`]),M(z(U6),{id:`data-out`,type:`source`,position:z(u4).Right,class:`!opacity-0`},null,8,[`position`]),e.data.type===`switch`?(R(),K(z(U6),{key:1,id:`otherwise`,type:`source`,position:z(u4).Right,class:`!opacity-0`},null,8,[`position`])):L(``,!0)],2))}}),g7={class:`pointer-events-none size-full rounded-xl border border-dashed border-border bg-muted/30`},_7={class:`flex items-center gap-1 px-2.5 pt-1.5 text-[11px] text-fg-subtle`},v7={key:0},y7={key:1,class:`font-mono`},b7=k({__name:`LaneNode`,props:{data:{}},setup(e){return(t,n)=>(R(),W(`div`,g7,[U(`div`,_7,[e.data.lane===`switch`?(R(),W(V,{key:0},[M(z(_c),{class:`size-3`,"aria-hidden":`true`}),e.data.title==="default"?(R(),W(`span`,v7,`otherwise`)):(R(),W(`span`,y7,`= `+B(e.data.title),1))],64)):(R(),W(V,{key:1},[M(z(Gs),{class:`size-3`,"aria-hidden":`true`}),A(B(e.data.title),1)],64))])]))}}),x7=240,S7=416,C7=-140,w7=72,T7=.9,E7=k({__name:`WorkflowCanvas`,props:{yaml:{},stages:{},open:{},triggers:{},types:{},restartable:{type:Boolean},marks:{},problems:{},title:{},summary:{}},emits:[`toggle`,`insert`,`duplicate`,`move`,`remove`,`rename`,`restart`],setup(e,{emit:t}){let n=e,r=t,i=I(()=>!!n.types?.length),a=I(()=>[...n.types??[],`parallel`,`switch`]),o=I(()=>a.value.filter(e=>[`agent.run`,`workflow.call`].includes(e))),s=e=>e&&cJ(e)?o.value:a.value,c=e=>e.kind===`step`?JSON.stringify(e.path??null):e.kind,l=q(null),u=I(()=>{let e=EJ(LJ(n.yaml),n.stages??[]);return i.value?{nodes:[{id:`workflow`,type:`step`,position:{x:0,y:C7},data:{kind:`workflow`,key:`workflow`,title:n.title||`Workflow`,type:``,detail:n.summary??``}},...e.nodes],edges:[{id:`flow-workflow-start`,source:`workflow`,target:`start`,kind:`flow`},...e.edges]}:e}),d=I(()=>u.value.nodes.filter(e=>e.data.path?.length===2).length),f=q({}),p=q({}),m=I(()=>u.value.nodes.find(e=>e.type===`step`&&c(e.data)===n.open));function h(e,t){f.value={...f.value,[e]:t},m.value?.id!==e&&(p.value={...p.value,[e]:t})}let g=I(()=>{let e=m.value?.id;return e&&f.value[e]?Math.max(0,f.value[e]-(p.value[e]??f.value[e])):0}),_=Rt(),v=zt(g,{duration:I(()=>_.value===`reduce`?0:200)}),y=I(()=>{let e=new Map;for(let t of u.value.nodes){if(t.type!==`step`)continue;let n=(t.id===m.value?.id?p.value[t.id]:void 0)??f.value[t.id];n!==void 0&&e.set(t.position.y,Math.max(e.get(t.position.y)??-72,n-w7))}return[...e]}),x=e=>y.value.reduce((t,[n,r])=>n<e?t+r:t,0);function S(e){let t=e.data,a=c(t),o=t.path,s={triggers:t.kind===`start`?n.triggers??[]:t.triggers,expanded:a===n.open,editable:i.value,problem:o?n.problems?.[a]:void 0,onResize:t=>h(e.id,t)};return i.value&&(s.onToggle=()=>r(`toggle`,a),o&&(s.onRename=e=>r(`rename`,o,e),s.onDuplicate=()=>r(`duplicate`,o),s.onRemove=()=>r(`remove`,o))),{...e,data:{...t,...s}}}let C=I(()=>{let e=m.value;return u.value.nodes.map(t=>{let a=t;t.type===`add`?t={...t,data:{...t.data,types:s(t.data.insertAfter),editable:i.value,onInsert:e=>r(`insert`,t.data.insertAfter,e)}}:t.type===`step`&&(t=S(t));let o=n.marks?.[t.id];o&&(t={...t,data:{...t.data,mark:o}});let{x:c}=t.position,l=t=>e&&t>e.position.y?v.value:0,u=t.position.y+x(t.position.y)+l(t.position.y);if(a===e)return{...t,position:{x:c-88,y:u},zIndex:10};if(t.type===`lane`&&t.style){let e=t.position.y+parseFloat(t.style.height),n=e+x(e)+l(e)-u;return{...t,position:{x:c,y:u},style:{...t.style,height:`${n}px`}}}return{...t,position:{x:c,y:u}}})}),w=I(()=>new Map(u.value.nodes.map(e=>[e.id,e.data.run?.status]))),ee=q(null),te=I(()=>ee.value??m.value?.id),T=I(()=>u.value.edges.filter(e=>e.kind===`flow`||e.source===te.value||e.target===te.value).map(({label:e,offset:t,insertAfter:n,otherwise:a,...o})=>o.kind===`flow`?{...o,type:`insert`,...a?{sourceHandl Line truncated
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},B3=class extends Error{constructor(e,...t){super(z3[e]?.call(z3,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function V3(e){return`clientX`in e}function H3(e){return`sourceEvent`in e}function U3(e,t){let n=V3(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var W3=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function G3(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function K3(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var q3=()=>!0;function J3(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function Y3(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())I4(i,F4(e))>0&&r.push(e);return r}var X3=250;function Z3(e,t,n,r){let i=[],a=1/0,o=Y3(e,n,t+X3);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=P3(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function Q3(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=q3},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=U3(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=$3(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===v4.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=n6(t,e,a,p,n,!0)}return b}function $3(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function e6(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function t6(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function n6(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===v4.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...P3(o,c,c.position,!0)}:c}var r6={[h4.Left]:h4.Right,[h4.Right]:h4.Left,[h4.Top]:h4.Bottom,[h4.Bottom]:h4.Top},i6=[`production`,`prod`];function a6(e,...t){o6()&&console.warn(`[Vue Flow]: ${e}`,...t)}function o6(){return!i6.includes(`production`)}function s6(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...L4(t)}}):null}function c6(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),Qe(()=>{o.blur()})):n([e])}function l6(e){return z(e)!==void 0}function u6(e,t,n,r){if(!e||!e.source||!e.target)return n(new B3(R3.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=V4(e)?e:{...e,id:Z4(e)},i=q4(i,void 0,r),!Q4(i,t)&&i}function d6(e,t,n,r,i){if(!t.source||!t.target)return i(new B3(R3.EDGE_INVALID,e.id)),!1;if(!n)return i(new B3(R3.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?Z4(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function f6(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!H4(o)){n(new B3(R3.NODE_INVALID,o?.id));continue}let s=K4(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new B3(R3.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function p6(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function m6(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;p6(`source`,o,`${r}-${a}--Line truncated
`)},B(e.data.summary||e.data.detail),9,p7)):L(``,!0),e.data.when||e.data.retry||e.data.continues?(R(),W(`div`,m7,[e.data.when?(R(),W(`span`,{key:0,class:`flex max-w-full min-w-0 items-center gap-0.5 rounded bg-secondary px-1 font-mono`,title:`Runs only when ${e.data.when}`},[M(z(gs),{class:`size-3 shrink-0`,"aria-hidden":`true`}),U(`span`,g7,B(e.data.when),1)],8,h7)):L(``,!0),e.data.retry?(R(),W(`span`,{key:1,class:`flex items-center gap-0.5 rounded bg-secondary px-1`,title:`Up to ${e.data.retry} attempts`},[M(z(Fs),{class:`size-3`,"aria-hidden":`true`}),A(`×`+B(e.data.retry),1)],8,_7)):L(``,!0),e.data.continues?(R(),W(`span`,v7,[M(z(Us),{class:`size-3`,"aria-hidden":`true`}),n[10]||=A(`continues`,-1)])):L(``,!0)])):L(``,!0),e.data.run?.error?(R(),W(`p`,{key:4,class:`mt-1 line-clamp-2 text-[11px] text-danger`,title:e.data.run.error},B(e.data.run.error),9,y7)):L(``,!0)],64))]),M(lt,{"enter-from-class":`opacity-0 -translate-y-1`,"enter-active-class":`transition duration-200`,"leave-to-class":`opacity-0`,"leave-active-class":`transition duration-100`},{default:j(()=>[e.data.expanded?(R(),W(`div`,{key:0,class:`nodrag nopan nowheel cursor-auto border-t border-border`,onClick:n[6]||=ct(()=>{},[`stop`])},[P(t.$slots,`default`)])):L(``,!0)]),_:3}),M(z(J6),{type:`source`,position:z(h4).Bottom},null,8,[`position`]),M(z(J6),{id:`data-out`,type:`source`,position:z(h4).Right,class:`!opacity-0`},null,8,[`position`]),e.data.type===`switch`?(R(),K(z(J6),{key:1,id:`otherwise`,type:`source`,position:z(h4).Right,class:`!opacity-0`},null,8,[`position`])):L(``,!0)],2))}}),x7={class:`pointer-events-none size-full rounded-xl border border-dashed border-border bg-muted/30`},S7={class:`flex items-center gap-1 px-2.5 pt-1.5 text-[11px] text-fg-subtle`},C7={key:0},w7={key:1,class:`font-mono`},T7=k({__name:`LaneNode`,props:{data:{}},setup(e){return(t,n)=>(R(),W(`div`,x7,[U(`div`,S7,[e.data.lane===`switch`?(R(),W(V,{key:0},[M(z(Gs),{class:`size-3`,"aria-hidden":`true`}),e.data.title==="default"?(R(),W(`span`,C7,`otherwise`)):(R(),W(`span`,w7,`= `+B(e.data.title),1))],64)):(R(),W(V,{key:1},[M(z(vs),{class:`size-3`,"aria-hidden":`true`}),A(B(e.data.title),1)],64))])]))}}),E7=240,D7=416,O7=-140,k7=72,A7=.9,j7=k({__name:`WorkflowCanvas`,props:{yaml:{},stages:{},open:{},triggers:{},types:{},restartable:{type:Boolean},marks:{},problems:{},title:{},summary:{}},emits:[`toggle`,`insert`,`duplicate`,`move`,`remove`,`rename`,`restart`],setup(e,{emit:t}){let n=e,r=t,i=I(()=>!!n.types?.length),a=I(()=>[...n.types??[],`parallel`,`switch`]),o=I(()=>a.value.filter(e=>[`agent.run`,`workflow.call`].includes(e))),s=e=>e&&pJ(e)?o.value:a.value,c=e=>e.kind===`step`?JSON.stringify(e.path??null):e.kind,l=q(null),u=I(()=>{let e=jJ(HJ(n.yaml),n.stages??[]);return i.value?{nodes:[{id:`workflow`,type:`step`,position:{x:0,y:O7},data:{kind:`workflow`,key:`workflow`,title:n.title||`Workflow`,type:``,detail:n.summary??``}},...e.nodes],edges:[{id:`flow-workflow-start`,source:`workflow`,target:`start`,kind:`flow`},...e.edges]}:e}),d=I(()=>u.value.nodes.filter(e=>e.data.path?.length===2).length),f=q({}),p=q({}),m=I(()=>u.value.nodes.find(e=>e.type===`step`&&c(e.data)===n.open));function h(e,t){f.value={...f.value,[e]:t},m.value?.id!==e&&(p.value={...p.value,[e]:t})}let g=I(()=>{let e=m.value?.id;return e&&f.value[e]?Math.max(0,f.value[e]-(p.value[e]??f.value[e])):0}),_=tn(),v=an(g,{duration:I(()=>_.value===`reduce`?0:200)}),y=I(()=>{let e=new Map;for(let t of u.value.nodes){if(t.type!==`step`)continue;let n=(t.id===m.value?.id?p.value[t.id]:void 0)??f.value[t.id];n!==void 0&&e.set(t.position.y,Math.max(e.get(t.position.y)??-72,n-k7))}return[...e]}),b=e=>y.value.reduce((t,[n,r])=>n<e?t+r:t,0);function x(e){let t=e.data,a=c(t),o=t.path,s={triggers:t.kind===`start`?n.triggers??[]:t.triggers,expanded:a===n.open,editable:i.value,problem:o?n.problems?.[a]:void 0,onResize:t=>h(e.id,t)};return i.value&&(s.onToggle=()=>r(`toggle`,a),o&&(s.onRename=e=>r(`rename`,o,e),s.onDuplicate=()=>r(`duplicate`,o),s.onRemove=()=>r(`remove`,o))),{...e,data:{...t,...s}}}let S=I(()=>{let e=m.value;return u.value.nodes.map(t=>{let a=t;t.type===`add`?t={...t,data:{...t.data,types:s(t.data.insertAfter),editable:i.value,onInsert:e=>r(`insert`,t.data.insertAfter,e)}}:t.type===`step`&&(t=x(t));let o=n.marks?.[t.id];o&&(t={...t,data:{...t.data,mark:o}});let{x:c}=t.position,l=t=>e&&t>e.position.y?v.value:0,u=t.position.y+b(t.position.y)+l(t.position.y);if(a===e)return{...t,position:{x:c-88,y:u},zIndex:10};if(t.type===`lane`&&t.style){let e=t.position.y+parseFloat(t.style.height),n=e+b(e)+l(e)-u;return{...t,position:{x:c,y:u},style:{...t.style,height:`${n}px`}}}return{...t,position:{x:c,y:u}}})}),ee=I(()=>new Map(u.value.nodes.map(e=>[e.id,e.data.run?.status]))),C=q(null),te=I(()=>C.value??m.value?.id),ne=I(()=>u.value.edges.filter(e=>e.kind===`flow`||e.source===te.value||e.target===te.value).map(({label:e,offset:t,insertAfter:n,otherwise:a,...o})=>o.kind===`flow`?{...o,type:`insert`,...a?{sourceHandl Line truncated
`),r=t.split(`
`),i=Array.from({length:n.length+1},()=>Array(r.length+1).fill(0));for(let e=n.length-1;e>=0;e--)for(let t=r.length-1;t>=0;t--)i[e][t]=n[e]===r[t]?i[e+1][t+1]+1:Math.max(i[e+1][t],i[e][t+1]);let a=[],o=0,s=0;for(;o<n.length&&s<r.length;)n[o]===r[s]?(a.push({kind:`same`,text:n[o++]}),s++):i[o+1][s]>=i[o][s+1]?a.push({kind:`del`,text:n[o++]}):a.push({kind:`add`,text:r[s++]});for(;o<n.length;)a.push({kind:`del`,text:n[o++]});for(;s<r.length;)a.push({kind:`add`,text:r[s++]});return a}function j7(e){let t=nJ(e).toJS(),n=new Map;for(let r of LJ(e).nodes){let{kind:e,path:i,stage:a,occurrence:o}=r.data;if(r.type!==`step`||e!==`step`||!i||a===void 0)continue;let s=t;for(let e of i)s=s?.[e];n.set(`${a}#${o??0}`,{node:r.id,signature:JSON.stringify(s??null)})}return n}function M7(e,t,n){let r=j7(e),i=j7(t),a={};for(let[e,t]of r){let r=i.get(e);r?r.signature!==t.signature&&(a[t.node]=`changed`):a[t.node]=n}return a}var N7={class:`flex flex-col gap-3 md:grid md:h-[calc(100dvh-17rem)] md:min-h-[26rem] md:grid-cols-[18rem_1fr]`},P7=[`aria-current`,`onClick`],F7={class:`flex items-center gap-2 text-sm`},I7={class:`font-mono text-xs text-fg-subtle`},L7=[`title`],R7={key:0,class:`px-3 py-2 text-sm text-muted-foreground`},z7={key:1,class:`flex min-h-0 flex-col gap-2`},B7={class:`flex items-center gap-2 max-md:flex-wrap`},V7={key:0,class:`rounded-lg border border-border p-4 text-sm text-muted-foreground`},H7={key:1,class:`min-h-0 flex-1 overflow-auto rounded-lg border border-border py-2 font-mono text-[13px] leading-6`},U7={class:`inline-block w-4 select-none text-fg-subtle`},W7={key:2,class:`grid min-h-0 flex-1 gap-3 max-md:flex-none md:grid-cols-2`},G7={class:`flex min-h-0 flex-col gap-1`},K7={class:`text-xs font-medium text-muted-foreground`},q7={class:`min-h-0 flex-1 max-md:h-72 max-md:flex-none`},J7={class:`flex min-h-0 flex-col gap-1`},Y7={class:`min-h-0 flex-1 max-md:h-72 max-md:flex-none`},X7=k({__name:`WorkflowHistory`,props:mt({revisions:{},current:{},error:{}},{selected:{default:0},selectedModifiers:{},mode:{default:`yaml`},modeModifiers:{}}),emits:mt([`restore`],[`update:selected`,`update:mode`]),setup(e,{emit:t}){let n=e,r=t,i=Ge(e,`selected`),a=Ge(e,`mode`);F(()=>n.revisions,e=>{e.some(e=>e.version===i.value)||(i.value=(e.find(e=>e.yaml!==n.current)??e[0])?.version??0)},{immediate:!0});let o=I(()=>n.revisions.find(e=>e.version===i.value)),s=I(()=>o.value?.yaml??null),c=I(()=>s.value===null?[]:A7(s.value,n.current)),l=I(()=>s.value!==null&&s.value===n.current),u=I(()=>s.value===null?{}:M7(s.value,n.current,`removed`)),d=I(()=>s.value===null?{}:M7(n.current,s.value,`added`)),f={added:`default`,edited:`secondary`,removed:`destructive`};return(t,n)=>(R(),W(`div`,N7,[U(`ol`,{class:N(z(X)(`min-h-0 divide-y divide-border overflow-y-auto rounded-lg border border-border`,e.revisions.length&&`max-md:hidden`)),"aria-label":`Revisions`},[(R(!0),W(V,null,G(e.revisions,e=>(R(),W(`li`,{key:e.version},[U(`button`,{type:`button`,class:N([`block w-full px-3 py-2 text-left hover:bg-secondary`,e.version===i.value&&`bg-secondary`]),"aria-current":e.version===i.value,onClick:t=>i.value=e.version},[U(`span`,F7,[U(`span`,I7,`v`+B(e.version),1),M(z(tn),{variant:f[e.change]},{default:j(()=>[A(B(e.change),1)]),_:2},1032,[`variant`])]),U(`span`,{class:`mt-0.5 block truncate text-xs text-muted-foreground`,title:e.at},B(e.actor||`unknown`)+` · `+B(e.source||`unknown`)+` · `+B(z(kg)(e.at)),9,L7)],10,P7)]))),128)),e.revisions.length?L(``,!0):(R(),W(`li`,R7,B(e.error||`No recorded changes`),1))],2),e.revisions.length?(R(),K(z(Dl),{key:0,"model-value":String(i.value),"onUpdate:modelValue":n[0]||=e=>i.value=Number(e)},{default:j(()=>[M(z(Pl),{class:`w-full md:hidden`,"aria-label":`Revision`},{default:j(()=>[M(z(Fl))]),_:1}),M(z(Ol),null,{default:j(()=>[(R(!0),W(V,null,G(e.revisions,e=>(R(),K(z(jl),{key:e.version,value:String(e.version)},{default:j(()=>[A(`v`+B(e.version)+` · `+B(e.change)+` · `+B(e.actor||`unknown`)+` · `+B(z(kg)(e.at)),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`])):L(``,!0),o.value?(R(),W(`div`,z7,[U(`div`,B7,[M(z(fb),{modelValue:a.value,"onUpdate:modelValue":n[1]||=e=>a.value=e},{default:j(()=>[M(z(mb),null,{default:j(()=>[M(z(hb),{value:`yaml`},{default:j(()=>[...n[3]||=[A(`YAML`,-1)]]),_:1}),M(z(hb),{value:`canvas`},{default:j(()=>[...n[4]||=[A(`Canvas`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),M(z(J),{type:`button`,size:`sm`,variant:`outline`,class:`ml-auto`,disabled:s.value===null||l.value,title:s.value===null?`Workflow removed`:void 0,onClick:n[2]||=e=>r(`restore`,s.value)},{default:j(()=>[M(z(lc),{"data-icon":`inline-start`}),n[5]||=A(` Restore this version`,-1)]),_:1},8,[`disabled`,`title`])]),s.value===null?(R(),W(`p`,V7,`Workflow removed in this revision.`)):a.value===`yaml`?(R(),W(`pre`,H7,[U(`code`,null,[(R(!0),W(V,null,G(c.value,(e,t)=>(R(),W(`span`,{key:t,class:N([`block min-h-6 px-3 whitespace-pre-wrap`,{"bg-ok/10":e.kind===`add`,"bg-danger/10 text-danger":e.kind===`del`}])},[U(`span`Line truncated
`),i=Array.from({length:n.length+1},()=>Array(r.length+1).fill(0));for(let e=n.length-1;e>=0;e--)for(let t=r.length-1;t>=0;t--)i[e][t]=n[e]===r[t]?i[e+1][t+1]+1:Math.max(i[e+1][t],i[e][t+1]);let a=[],o=0,s=0;for(;o<n.length&&s<r.length;)n[o]===r[s]?(a.push({kind:`same`,text:n[o++]}),s++):i[o+1][s]>=i[o][s+1]?a.push({kind:`del`,text:n[o++]}):a.push({kind:`add`,text:r[s++]});for(;o<n.length;)a.push({kind:`del`,text:n[o++]});for(;s<r.length;)a.push({kind:`add`,text:r[s++]});return a}function I7(e){let t=sJ(e).toJS(),n=new Map;for(let r of HJ(e).nodes){let{kind:e,path:i,stage:a,occurrence:o}=r.data;if(r.type!==`step`||e!==`step`||!i||a===void 0)continue;let s=t;for(let e of i)s=s?.[e];n.set(`${a}#${o??0}`,{node:r.id,signature:JSON.stringify(s??null)})}return n}function L7(e,t,n){let r=I7(e),i=I7(t),a={};for(let[e,t]of r){let r=i.get(e);r?r.signature!==t.signature&&(a[t.node]=`changed`):a[t.node]=n}return a}var R7={class:`flex flex-col gap-3 md:grid md:h-[calc(100dvh-17rem)] md:min-h-[26rem] md:grid-cols-[18rem_1fr]`},z7=[`aria-current`,`onClick`],B7={class:`flex items-center gap-2 text-sm`},V7={class:`font-mono text-xs text-fg-subtle`},H7=[`title`],U7={key:0,class:`px-3 py-2 text-sm text-fg-muted`},W7={key:1,class:`flex min-h-0 flex-col gap-2`},G7={class:`flex items-center gap-2 max-md:flex-wrap`},K7={key:0,class:`rounded-lg border border-border p-4 text-sm text-fg-muted`},q7={key:1,class:`min-h-0 flex-1 overflow-auto rounded-lg border border-border py-2 font-mono text-[13px] leading-6`},J7={class:`inline-block w-4 select-none text-fg-subtle`},Y7={key:2,class:`grid min-h-0 flex-1 gap-3 max-md:flex-none md:grid-cols-2`},X7={class:`flex min-h-0 flex-col gap-1`},Z7={class:`text-xs font-medium text-fg-muted`},Q7={class:`min-h-0 flex-1 max-md:h-72 max-md:flex-none`},$7={class:`flex min-h-0 flex-col gap-1`},e9={class:`min-h-0 flex-1 max-md:h-72 max-md:flex-none`},t9=k({__name:`WorkflowHistory`,props:Je({revisions:{},current:{},error:{}},{selected:{default:0},selectedModifiers:{},mode:{default:`yaml`},modeModifiers:{}}),emits:Je([`restore`],[`update:selected`,`update:mode`]),setup(e,{emit:t}){let n=e,r=t,i=Te(e,`selected`),a=Te(e,`mode`);F(()=>n.revisions,e=>{e.some(e=>e.version===i.value)||(i.value=(e.find(e=>e.yaml!==n.current)??e[0])?.version??0)},{immediate:!0});let o=I(()=>n.revisions.find(e=>e.version===i.value)),s=I(()=>o.value?.yaml??null),c=I(()=>s.value===null?[]:F7(s.value,n.current)),l=I(()=>s.value!==null&&s.value===n.current),u=I(()=>s.value===null?{}:L7(s.value,n.current,`removed`)),d=I(()=>s.value===null?{}:L7(n.current,s.value,`added`)),f={added:`default`,edited:`secondary`,removed:`destructive`};return(t,n)=>(R(),W(`div`,R7,[U(`ol`,{class:N(z(J)(`min-h-0 divide-y divide-border overflow-y-auto rounded-lg border border-border`,e.revisions.length&&`max-md:hidden`)),"aria-label":`Revisions`},[(R(!0),W(V,null,G(e.revisions,e=>(R(),W(`li`,{key:e.version},[U(`button`,{type:`button`,class:N([`block w-full px-3 py-2 text-left hover:bg-secondary`,e.version===i.value&&`bg-secondary`]),"aria-current":e.version===i.value,onClick:t=>i.value=e.version},[U(`span`,B7,[U(`span`,V7,`v`+B(e.version),1),M(z(C),{variant:f[e.change]},{default:j(()=>[A(B(e.change),1)]),_:2},1032,[`variant`])]),U(`span`,{class:`mt-0.5 block truncate text-xs text-fg-muted`,title:e.at},B(e.actor||`unknown`)+` · `+B(e.source||`unknown`)+` · `+B(z(Ig)(e.at)),9,H7)],10,z7)]))),128)),e.revisions.length?L(``,!0):(R(),W(`li`,U7,B(e.error||`No recorded changes`),1))],2),e.revisions.length?(R(),K(z(Gt),{key:0,"model-value":String(i.value),"onUpdate:modelValue":n[0]||=e=>i.value=Number(e)},{default:j(()=>[M(z(Wt),{class:`w-full md:hidden`,"aria-label":`Revision`},{default:j(()=>[M(z(Yt))]),_:1}),M(z(Pt),null,{default:j(()=>[(R(!0),W(V,null,G(e.revisions,e=>(R(),K(z(qt),{key:e.version,value:String(e.version)},{default:j(()=>[A(`v`+B(e.version)+` · `+B(e.change)+` · `+B(e.actor||`unknown`)+` · `+B(z(Ig)(e.at)),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`])):L(``,!0),o.value?(R(),W(`div`,W7,[U(`div`,G7,[M(z(_b),{modelValue:a.value,"onUpdate:modelValue":n[1]||=e=>a.value=e},{default:j(()=>[M(z(yb),null,{default:j(()=>[M(z(bb),{value:`yaml`},{default:j(()=>[...n[3]||=[A(`YAML`,-1)]]),_:1}),M(z(bb),{value:`canvas`},{default:j(()=>[...n[4]||=[A(`Canvas`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),M(z(X),{type:`button`,size:`sm`,variant:`outline`,class:`ml-auto`,disabled:s.value===null||l.value,title:s.value===null?`Workflow removed`:void 0,onClick:n[2]||=e=>r(`restore`,s.value)},{default:j(()=>[M(z(Ls),{"data-icon":`inline-start`}),n[5]||=A(` Restore this version`,-1)]),_:1},8,[`disabled`,`title`])]),s.value===null?(R(),W(`p`,K7,`Workflow removed in this revision.`)):a.value===`yaml`?(R(),W(`pre`,q7,[U(`code`,null,[(R(!0),W(V,null,G(c.value,(e,t)=>(R(),W(`span`,{key:t,class:N([`block min-h-6 px-3 whitespace-pre-wrap`,{"bg-ok/10":e.kind===`add`,"bg-danger/10 text-danger":e.kind===`del`}])},[U(`span`,J7,B(e.kind===`add`?`+`:e.kind== Line truncated
`);s=n.pop()||``;for(let e of n){let t=e.split(`
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.type===`delta`&&(a.value+=n.text??``),n.type===`tool`&&n.tool&&(o.value=n.tool.replaceAll(`_`,` `)),n.type===`done`&&(c=!0,a.value||=n.text??``),n.type===`error`)throw Error(n.text)}if(t)break}if(!c)throw Error(`the turn ended early`)}catch(e){e.name!==`AbortError`&&(s.value=!0,a.value=String(e.message||e))}finally{c.value=!1,o.value=``,l=void 0,r(`proposed`)}}}return(t,n)=>(R(),W(`div`,a9,[a.value?(R(),W(`p`,{key:0,class:N([`max-h-40 overflow-y-auto whitespace-pre-wrap border-b border-border px-3 py-2 text-sm`,s.value&&`text-danger`]),role:s.value?`alert`:`status`},B(a.value),11,o9)):L(``,!0),U(`form`,{class:`flex items-center gap-2 px-3 py-2`,onSubmit:Mt(u,[`prevent`])},[M(z(gc),{class:`size-4 shrink-0 text-primary`,"aria-hidden":`true`}),rt(U(`input`,{"onUpdate:modelValue":n[0]||=e=>i.value=e,class:`min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-fg-subtle`,placeholder:e.empty?`Build with Archie`:`Iterate with Archie`,"aria-label":e.empty?`Build with Archie`:`Iterate with Archie`,disabled:c.value},null,8,s9),[[Pt,i.value]]),c.value?(R(),W(`span`,c9,[M(z(Bv)),A(B(o.value),1)])):L(``,!0),c.value?(R(),K(z(J),{key:1,type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Stop`,onClick:n[1]||=e=>z(l)?.abort()},{default:j(()=>[M(z(vc))]),_:1})):(R(),K(z(J),{key:2,type:`submit`,size:`icon-sm`,"aria-label":`Send`,disabled:!i.value.trim()},{default:j(()=>[M(z(Ts))]),_:1},8,[`disabled`]))],32)]))}}),u9=20;function d9(e){let t=q([]),n=q(``),r=q([]),i=q(0),a=!1,o=q(``),s=q(!1),c=0;async function l(){let r=e.value,i=++c;s.value=!0;try{let s=r?await Y.taskPage({workflow:r,limit:u9}):null;if(e.value!==r||i!==c)return;t.value=(s?.tasks??[]).sort((e,t)=>Number(t.id)-Number(e.id)),o.value=``,(!a||n.value&&!t.value.some(e=>String(e.id)===n.value))&&(n.value=t.value[0]?String(t.value[0].id):``)}catch(t){e.value===r&&i===c&&(o.value=String(t.message||t))}finally{i===c&&(s.value=!1)}}async function u(){if(!n.value){r.value.length&&(r.value=[]),i.value=0;return}let e=n.value,t=await Y.taskAttempts(e).catch(()=>null);if(n.value!==e)return;let a=[...t?.attempts??[]].sort((e,t)=>t.attempt-e.attempt)[0],o=a?.stages??[];JSON.stringify(o)!==JSON.stringify(r.value)&&(r.value=o),i.value=a?.attempt??0}function d(e){a=!0,n.value=e}async function f(){await l(),await u()}F(e,()=>{a=!1,t.value=[],n.value=``,o.value=``,f()},{immediate:!0}),F(n,()=>{r.value=[],i.value=0,u()}),re(`tasks`,()=>void f(),300);let p=I(()=>t.value.find(e=>String(e.id)===n.value));async function m(e){a=!0,n.value=String(e),await f()}return{runs:t,error:o,loading:s,watched:n,watchedRun:p,stages:r,attempt:i,pick:d,follow:m,refresh:f}}function f9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function p9(e){try{return rJ(e)}catch{return null}}function m9(e,t){let n=[];for(let[r,i]of Object.entries(t.routes))i===e&&n.push(r==="default"?{kind:`issue`,label:`Unlabelled issues`,detail:`anything no label routes elsewhere`}:{kind:`issue`,label:`Issues labelled ${r}`});for(let r of t.bindings)r.workflow===e&&n.push({kind:`event`,label:r.name||`Event binding`,detail:r.matcher?.source,binding:r});for(let r of t.playbooks){let t=p9(r.yaml);if(!f9(t)||!Array.isArray(t.actions)||!t.actions.some(t=>f9(t)&&t.workflow===e))continue;let i=f9(t.trigger)?t.trigger:{},a=Array.isArray(i.labels)?i.labels.join(`, `):``;n.push({kind:`playbook`,label:r.id,detail:[i.kind,a].filter(Boolean).join(` · `)})}for(let r of t.definitions){if(r.id===e)continue;let t=h9(p9(r.yaml),e);t&&n.push({kind:`workflow`,label:r.id,detail:t})}return n}function h9(e,t){let n=(f9(e)&&Array.isArray(e.steps)?e.steps:[]).flatMap(e=>sJ(e)?.branches.flatMap(([,e])=>e)??[e]);for(let e of n){if(!f9(e)||!f9(e.settings))continue;let r=e.settings;switch(e.type){case`workflow.call`:if(r.workflow===t)return`calls it`;break;case`workflow.handoff`:if(r.workflow===t||g9(n,r.workflow).includes(t))return`hands off to it`;break;case`human.approve`:if(r.then===t)return`runs it once approved`}}return``}function g9(e,t){let n=typeof t==`string`?/\{\{\s*steps\.([\w-]+)\.result\.([\w-]+)\s*\}\}/.exec(t):null;if(!n)return[];let r=e.find(e=>f9(e)&&e.id===n[1]),i=f9(r)&&f9(r.settings)?r.settings.result:void 0,a=f9(i)&&f9(i.properties)?i.properties[n[2]]:void 0;return f9(a)&&Array.isArray(a.enum)?a.enum.map(String):[]}function _9(e){let t=D(),n=vk(),r=q([]);async function i(){let e=await Y.bindings().catch(()=>null);r.value=e?.bindings??[]}return gt(i),{triggers:I(()=>m9(e.value,{routes:n.intakeRoutes,bindings:r.value,playbooks:t.stateFor(`eda-playbooks`).resource?.value?.playbooks??[],definitions:n.collection.definitions})),reload:i}}var v9={class:`flex flex-wrap items-center gap-2`},y9={class:`ml-1 font-mono text-xs text-fg-subtle`},b9={class:`ml-auto font-mono text-xs text-fg-subtle`},x9={key:0,class:`flex min-w-0 items-center gap-1`},S9={key:1,class:`ml-auto flex flex-wrap items-center justify-end gap-2`},C9=[`title`],w9={key Line truncated
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.type===`delta`&&(a.value+=n.text??``),n.type===`tool`&&n.tool&&(o.value=n.tool.replaceAll(`_`,` `)),n.type===`done`&&(c=!0,a.value||=n.text??``),n.type===`error`)throw Error(n.text)}if(t)break}if(!c)throw Error(`the turn ended early`)}catch(e){e.name!==`AbortError`&&(s.value=!0,a.value=String(e.message||e))}finally{c.value=!1,o.value=``,l=void 0,r(`proposed`)}}}return(t,n)=>(R(),W(`div`,u9,[a.value?(R(),W(`p`,{key:0,class:N([`max-h-40 overflow-y-auto whitespace-pre-wrap border-b border-border px-3 py-2 text-sm`,s.value&&`text-danger`]),role:s.value?`alert`:`status`},B(a.value),11,d9)):L(``,!0),U(`form`,{class:`flex items-center gap-2 px-3 py-2`,onSubmit:ct(u,[`prevent`])},[M(z(Ws),{class:`size-4 shrink-0 text-primary`,"aria-hidden":`true`}),Le(U(`input`,{"onUpdate:modelValue":n[0]||=e=>i.value=e,class:`min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-fg-subtle`,placeholder:e.empty?`Build with Archie`:`Iterate with Archie`,"aria-label":e.empty?`Build with Archie`:`Iterate with Archie`,disabled:c.value},null,8,f9),[[mt,i.value]]),c.value?(R(),W(`span`,p9,[M(z(Kv)),A(B(o.value),1)])):L(``,!0),c.value?(R(),K(z(X),{key:1,type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Stop`,onClick:n[1]||=e=>z(l)?.abort()},{default:j(()=>[M(z(Ks))]),_:1})):(R(),K(z(X),{key:2,type:`submit`,size:`icon-sm`,"aria-label":`Send`,disabled:!i.value.trim()},{default:j(()=>[M(z($o))]),_:1},8,[`disabled`]))],32)]))}}),h9=20;function g9(e){let t=q([]),n=q(``),r=q([]),i=q(0),a=!1,o=q(``),s=q(!1),c=0;async function l(){let r=e.value,i=++c;s.value=!0;try{let s=r?await Y.taskPage({workflow:r,limit:h9}):null;if(e.value!==r||i!==c)return;t.value=(s?.tasks??[]).sort((e,t)=>Number(t.id)-Number(e.id)),o.value=``,(!a||n.value&&!t.value.some(e=>String(e.id)===n.value))&&(n.value=t.value[0]?String(t.value[0].id):``)}catch(t){e.value===r&&i===c&&(o.value=String(t.message||t))}finally{i===c&&(s.value=!1)}}async function u(){if(!n.value){r.value.length&&(r.value=[]),i.value=0;return}let e=n.value,t=await Y.taskAttempts(e).catch(()=>null);if(n.value!==e)return;let a=[...t?.attempts??[]].sort((e,t)=>t.attempt-e.attempt)[0],o=a?.stages??[];JSON.stringify(o)!==JSON.stringify(r.value)&&(r.value=o),i.value=a?.attempt??0}function d(e){a=!0,n.value=e}async function f(){await l(),await u()}F(e,()=>{a=!1,t.value=[],n.value=``,o.value=``,f()},{immediate:!0}),F(n,()=>{r.value=[],i.value=0,u()}),Qd(`tasks`,()=>void f(),300);let p=I(()=>t.value.find(e=>String(e.id)===n.value));async function m(e){a=!0,n.value=String(e),await f()}return{runs:t,error:o,loading:s,watched:n,watchedRun:p,stages:r,attempt:i,pick:d,follow:m,refresh:f}}function _9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function v9(e){try{return cJ(e)}catch{return null}}function y9(e,t){let n=[];for(let[r,i]of Object.entries(t.routes))i===e&&n.push(r==="default"?{kind:`issue`,label:`Unlabelled issues`,detail:`anything no label routes elsewhere`}:{kind:`issue`,label:`Issues labelled ${r}`});for(let r of t.bindings)r.workflow===e&&n.push({kind:`event`,label:r.name||`Event binding`,detail:r.matcher?.source,binding:r});for(let r of t.playbooks){let t=v9(r.yaml);if(!_9(t)||!Array.isArray(t.actions)||!t.actions.some(t=>_9(t)&&t.workflow===e))continue;let i=_9(t.trigger)?t.trigger:{},a=Array.isArray(i.labels)?i.labels.join(`, `):``;n.push({kind:`playbook`,label:r.id,detail:[i.kind,a].filter(Boolean).join(` · `)})}for(let r of t.definitions){if(r.id===e)continue;let t=b9(v9(r.yaml),e);t&&n.push({kind:`workflow`,label:r.id,detail:t})}return n}function b9(e,t){let n=(_9(e)&&Array.isArray(e.steps)?e.steps:[]).flatMap(e=>fJ(e)?.branches.flatMap(([,e])=>e)??[e]);for(let e of n){if(!_9(e)||!_9(e.settings))continue;let r=e.settings;switch(e.type){case`workflow.call`:if(r.workflow===t)return`calls it`;break;case`workflow.handoff`:if(r.workflow===t||x9(n,r.workflow).includes(t))return`hands off to it`;break;case`human.approve`:if(r.then===t)return`runs it once approved`}}return``}function x9(e,t){let n=typeof t==`string`?/\{\{\s*steps\.([\w-]+)\.result\.([\w-]+)\s*\}\}/.exec(t):null;if(!n)return[];let r=e.find(e=>_9(e)&&e.id===n[1]),i=_9(r)&&_9(r.settings)?r.settings.result:void 0,a=_9(i)&&_9(i.properties)?i.properties[n[2]]:void 0;return _9(a)&&Array.isArray(a.enum)?a.enum.map(String):[]}function S9(e){let t=_h(),n=Ck(),r=q([]);async function i(){let e=await Y.bindings().catch(()=>null);r.value=e?.bindings??[]}return Xe(i),{triggers:I(()=>y9(e.value,{routes:n.intakeRoutes,bindings:r.value,playbooks:t.stateFor(`eda-playbooks`).resource?.value?.playbooks??[],definitions:n.collection.definitions})),reload:i}}var C9={class:`flex flex-wrap items-center gap-2`},w9={class:`ml-1 font-mono text-xs text-fg-subtle`},T9={class:`ml-auto font-mono text-xs text-fg-subtle`},E9={key:0,class:`flex min-w-0 items-center gap-1`},D9={key:1,class:`ml-auto flex flex-wrap items-center justify-end gap-2`},O9=[`title`],k9={ke Line truncated
+4 -3
View File
@@ -35,10 +35,11 @@
<script type="module" crossorigin src="/assets/index.js"></script>
<link rel="modulepreload" crossorigin href="/assets/PageHeader.js">
<link rel="modulepreload" crossorigin href="/assets/api.js">
<link rel="modulepreload" crossorigin href="/assets/pinia.js">
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon.js">
<link rel="modulepreload" crossorigin href="/assets/alert.js">
<link rel="modulepreload" crossorigin href="/assets/CardAccordion.js">
<link rel="modulepreload" crossorigin href="/assets/empty.js">
<link rel="modulepreload" crossorigin href="/assets/pinia.js">
<link rel="modulepreload" crossorigin href="/assets/SelectValue.js">
<link rel="modulepreload" crossorigin href="/assets/Input.js">
<link rel="stylesheet" crossorigin href="/assets/index.css">
</head>
<body>
+4 -4
View File
@@ -27,22 +27,22 @@ async function signInPasskey(){busy.value=true;error.value="";try{await usePassk
<template>
<main class="mx-auto flex min-h-[90dvh] max-w-md flex-col justify-center px-5 py-10">
<div class="rounded-xl border border-border bg-card p-6 shadow-sm">
<p class="mb-2 text-xs font-medium tracking-widest text-muted-foreground">ARCHIE</p>
<p class="mb-2 text-xs font-medium tracking-widest text-fg-muted">ARCHIE</p>
<h1 class="text-2xl font-medium">{{setup?(step===1?'Set up your organisation':'Create your admin account'):recovery?'Recover your account':'Sign in'}}</h1>
<p v-if="setup&&step===2" class="mt-2 text-sm text-muted-foreground">This account administers the installation.</p>
<p v-if="setup&&step===2" class="mt-2 text-sm text-fg-muted">This account administers the installation.</p>
<form class="mt-6 space-y-4" @submit.prevent="submit">
<template v-if="setup&&step===1">
<label class="block space-y-1.5 text-sm" for="organisation">Organisation name<Input id="organisation" v-model="organisation" autocomplete="organization" required maxlength="200" /></label>
<label class="block space-y-1.5 text-sm" for="workspace">First workspace<Input id="workspace" v-model="workspace" required maxlength="200" /></label>
<label class="block space-y-1.5 text-sm" for="public-url">Instance URL<Input id="public-url" v-model="publicURL" type="url" required autocomplete="url" /></label>
<p class="text-xs text-muted-foreground">Use the address people will visit. Passkeys require HTTPS and a domain name, or localhost for development.</p>
<p class="text-xs text-fg-muted">Use the address people will visit. Passkeys require HTTPS and a domain name, or localhost for development.</p>
</template>
<template v-else>
<label v-if="setup" class="block space-y-1.5 text-sm" for="account-name">Your name<Input id="account-name" v-model="name" autocomplete="name" required maxlength="200" /></label>
<label class="block space-y-1.5 text-sm" for="account-email">Email<Input id="account-email" v-model="email" type="email" autocomplete="username" :spellcheck="false" required /></label>
<label v-if="recovery" class="block space-y-1.5 text-sm" for="recovery-code">Recovery code<Input id="recovery-code" v-model="recoveryCode" autocomplete="off" required /></label>
<label class="block space-y-1.5 text-sm" for="account-password">{{recovery?"New password":"Password"}}<Input id="account-password" v-model="password" type="password" :autocomplete="setup||recovery?'new-password':'current-password'" :minlength="setup||recovery?15:undefined" maxlength="1024" required /></label>
<p v-if="setup" class="text-xs text-muted-foreground">At least 15 characters.</p>
<p v-if="setup" class="text-xs text-fg-muted">At least 15 characters.</p>
</template>
<p v-if="error" role="alert" class="text-sm text-danger">{{error}}</p>
<div class="flex gap-2"><Button v-if="setup&&step===2" type="button" variant="outline" :disabled="busy" @click="step=1">Back</Button><Button type="submit" class="flex-1" :disabled="busy">{{busy?'Please wait…':setup?(step===1?'Continue':'Create organisation and admin'):recovery?'Reset password':'Sign in'}}</Button></div>
+3 -3
View File
@@ -27,12 +27,12 @@ const change=()=>run(async()=>{await api.changePassword(current.value,next.value
<h2 class="font-medium">Passkeys</h2>
<ul class="mt-4 divide-y divide-border"><li v-for="key in keys" :key="key.id" class="flex items-center gap-3 py-2 text-sm"><span class="min-w-0 flex-1 truncate">{{key.name}}</span><Button variant="ghost" size="sm" :disabled="busy" @click="remove(key.id)">Remove</Button></li></ul>
<form v-if="eligible" class="mt-3 flex flex-wrap gap-2" @submit.prevent="enroll"><Input v-model="keyName" aria-label="Passkey name" placeholder="Passkey name (optional)" maxlength="200" class="min-w-40 flex-1"/><Button type="submit" :disabled="busy">Add passkey</Button></form>
<p v-else class="mt-3 text-sm text-muted-foreground">Passkeys need an HTTPS domain or localhost. Set the instance URL in <RouterLink class="underline" to="/settings/authentication">Authentication settings</RouterLink>.</p>
<p v-else class="mt-3 text-sm text-fg-muted">Passkeys need an HTTPS domain or localhost. Set the instance URL in <RouterLink class="underline" to="/settings/authentication">Authentication settings</RouterLink>.</p>
</section>
<PersonalTokensCard />
<section class="rounded-lg border border-border bg-card p-5 space-y-3">
<h2 class="font-medium">Recovery code</h2>
<p class="text-sm text-muted-foreground">Shown once. Use it to reset your password if you lose access. A new code replaces the old one.</p>
<p class="text-sm text-fg-muted">Shown once. Use it to reset your password if you lose access. A new code replaces the old one.</p>
<Button :disabled="busy" @click="makeRecovery">Generate recovery code</Button>
<p v-if="recovery" class="break-all rounded border border-border p-3 font-mono text-sm" role="status">{{recovery}}</p>
</section>
@@ -41,7 +41,7 @@ const change=()=>run(async()=>{await api.changePassword(current.value,next.value
<form class="mt-4 max-w-sm space-y-3" @submit.prevent="change">
<label class="block space-y-1 text-sm" for="current-password">Current password<Input id="current-password" v-model="current" type="password" autocomplete="current-password" required /></label>
<label class="block space-y-1 text-sm" for="new-password">New password<Input id="new-password" v-model="next" type="password" autocomplete="new-password" required minlength="15" maxlength="1024" /></label>
<p class="text-xs text-muted-foreground">Changing your password signs out all your sessions.</p>
<p class="text-xs text-fg-muted">Changing your password signs out all your sessions.</p>
<Button type="submit" :disabled="busy">Change password</Button>
</form>
</section>
+4 -4
View File
@@ -16,16 +16,16 @@ async function save(){busy.value=true;error.value="";saved.value=false;try{await
<section class="space-y-3 rounded-lg border border-border bg-card p-5">
<h2 class="font-medium">Instance URL</h2>
<label for="instance-url" class="block space-y-1 text-sm">Public address<Input id="instance-url" v-model="value.public_url" type="url" required /></label>
<p class="text-xs text-muted-foreground">Passkeys require HTTPS and a domain name, or localhost. Once passkeys are enrolled, their domain is fixed.</p>
<p class="text-xs text-fg-muted">Passkeys require HTTPS and a domain name, or localhost. Once passkeys are enrolled, their domain is fixed.</p>
</section>
<section class="space-y-3 rounded-lg border border-border bg-card p-5">
<h2 class="font-medium">OpenID Connect</h2>
<p class="text-sm text-muted-foreground">Register a public client with authorization code flow and PKCE. Local accounts remain available.</p>
<p class="text-sm text-fg-muted">Register a public client with authorization code flow and PKCE. Local accounts remain available.</p>
<label for="oidc-issuer" class="block space-y-1 text-sm">Issuer URL<Input id="oidc-issuer" v-model="value.oidc_issuer" type="url" placeholder="https://identity.example.com" /></label>
<label for="oidc-client" class="block space-y-1 text-sm">Client ID<Input id="oidc-client" v-model="value.oidc_client_id" /></label>
<label for="oidc-audience" class="block space-y-1 text-sm">Access token audience<Input id="oidc-audience" v-model="value.oidc_audience" /></label>
<p class="break-all text-xs text-muted-foreground">Redirect URI: {{value.public_url.replace(/\/$/,'')}}/oauth2/callback</p>
<p class="text-xs text-muted-foreground">Add permitted people by their verified email or provider subject in <RouterLink class="underline" to="/org/members">Organisation → Members</RouterLink>. Clear the OIDC fields to disable provider sign-in.</p>
<p class="break-all text-xs text-fg-muted">Redirect URI: {{value.public_url.replace(/\/$/,'')}}/oauth2/callback</p>
<p class="text-xs text-fg-muted">Add permitted people by their verified email or provider subject in <RouterLink class="underline" to="/org/members">Organisation → Members</RouterLink>. Clear the OIDC fields to disable provider sign-in.</p>
</section>
<p v-if="saved" role="status" class="text-sm">Authentication settings saved.</p>
<Button type="submit" :disabled="busy">Save</Button>
+4 -12
View File
@@ -4,6 +4,7 @@ import { Plus } from "@lucide/vue";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { api } from "@/lib/api";
interface PersonalToken {
id: string;
@@ -16,15 +17,6 @@ const created = ref("");
const error = ref("");
const busy = ref(false);
async function call<T>(path: string, init: RequestInit = {}): Promise<T | undefined> {
const response = await fetch(path, {
...init,
headers: { Accept: "application/json", "X-Archie-CSRF": "1" },
});
if (!response.ok) throw new Error((await response.text()).trim());
return response.status === 204 ? undefined : ((await response.json()) as T);
}
async function run(action: () => Promise<void>): Promise<void> {
busy.value = true;
try {
@@ -39,20 +31,20 @@ async function run(action: () => Promise<void>): Promise<void> {
const load = () =>
run(async () => {
const result = await call<{ tokens: PersonalToken[]; available: boolean }>("/api/tokens");
const result = await api.tokens<{ tokens: PersonalToken[]; available: boolean }>();
available.value = result?.available ?? false;
tokens.value = result?.tokens ?? [];
});
const create = () =>
run(async () => {
created.value = (await call<{ token: string }>("/api/tokens", { method: "POST" }))?.token ?? "";
created.value = (await api.createToken())?.token ?? "";
await load();
});
const revoke = (id: string) =>
run(async () => {
await call(`/api/tokens/${id}`, { method: "DELETE" });
await api.revokeToken(id);
await load();
});
+1 -1
View File
@@ -129,7 +129,7 @@ const models = computed({
:aria-labelledby="`ch-${channel.id}`"
>
<header class="flex items-center gap-3 px-5 py-4">
<span class="grid size-8 shrink-0 place-items-center rounded-md bg-secondary text-muted-foreground">
<span class="grid size-8 shrink-0 place-items-center rounded-md bg-secondary text-fg-muted">
<component :is="channel.icon" class="size-4" aria-hidden="true" />
</span>
<div class="min-w-0 flex-1">
+1 -1
View File
@@ -23,7 +23,7 @@ defineProps<{ attachment: ChatMedia }>();
:target="attachment.url ? '_blank' : undefined"
:rel="attachment.url ? 'noopener noreferrer' : undefined"
:title="mediaDetail(attachment)"
class="inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground"
class="inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted px-2.5 py-1 text-xs font-medium text-fg-muted"
>
<Paperclip aria-hidden="true" class="size-3.5 shrink-0" />
<span class="truncate">{{ mediaLabel(attachment) }}</span>
@@ -94,7 +94,7 @@ onUnmounted(() => document.removeEventListener("keydown", onGlobalKeydown));
<Button
variant="outline"
size="sm"
class="text-muted-foreground w-44 justify-start max-lg:w-auto"
class="text-fg-muted w-44 justify-start max-lg:w-auto"
aria-label="Jump to"
@click="open = true"
>
@@ -140,9 +140,9 @@ onUnmounted(() => document.removeEventListener("keydown", onGlobalKeydown));
:value="`task:${task.id}`"
@select="go(`/tasks/${task.id}`)"
>
<span class="text-muted-foreground shrink-0 tabular-nums">#{{ task.id }}</span>
<span class="text-fg-muted shrink-0 tabular-nums">#{{ task.id }}</span>
<span class="truncate">{{ task.title }}</span>
<span v-if="task.status" class="text-muted-foreground ml-auto shrink-0 text-xs">{{
<span v-if="task.status" class="text-fg-muted ml-auto shrink-0 text-xs">{{
statusLabel(task.status)
}}</span>
</CommandItem>
+1 -1
View File
@@ -36,7 +36,7 @@ watch(activePath, revealActive, { flush: "post" });
:to="entry.path"
:aria-current="activePath === entry.path ? 'page' : undefined"
:data-current="activePath === entry.path ? '' : undefined"
class="text-muted-foreground hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 inline-flex h-8 shrink-0 items-center rounded-md px-2.5 text-sm font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-[3px]"
class="text-fg-muted hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 inline-flex h-8 shrink-0 items-center rounded-md px-2.5 text-sm font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-[3px]"
>{{ entry.label }}</RouterLink
>
</nav>
+1 -1
View File
@@ -23,7 +23,7 @@ import {
</Avatar>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" class="w-48">
<DropdownMenuLabel class="text-muted-foreground text-xs font-normal">{{accounts.status?.user?.display_name}}</DropdownMenuLabel>
<DropdownMenuLabel class="text-fg-muted text-xs font-normal">{{accounts.status?.user?.display_name}}</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem as-child><RouterLink to="/account">Your account</RouterLink></DropdownMenuItem>
<DropdownMenuItem as-child>
@@ -22,7 +22,7 @@ const delegatedProps = reactiveOmit(props, 'class')
v-bind="delegatedProps"
:class="
cn(
'focus-visible:ring-ring/50 focus-visible:border-ring focus-visible:after:border-ring **:data-[slot=accordion-trigger-icon]:text-muted-foreground rounded-lg py-2.5 text-left text-sm font-medium hover:underline focus-visible:ring-3 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 group/accordion-trigger relative flex flex-1 items-start justify-between border border-transparent transition-all outline-none disabled:pointer-events-none disabled:opacity-50',
'focus-visible:ring-ring/50 focus-visible:border-ring focus-visible:after:border-ring **:data-[slot=accordion-trigger-icon]:text-fg-muted rounded-lg py-2.5 text-left text-sm font-medium hover:underline focus-visible:ring-3 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 group/accordion-trigger relative flex flex-1 items-start justify-between border border-transparent transition-all outline-none disabled:pointer-events-none disabled:opacity-50',
props.class,
)
"
@@ -18,7 +18,7 @@ const delegatedProps = reactiveOmit(props, "class");
v-bind="delegatedProps"
:class="
cn(
'text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3',
'text-fg-muted *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3',
props.class,
)
"
@@ -12,7 +12,7 @@ const props = defineProps<{
data-slot="alert-description"
:class="
cn(
'text-muted-foreground text-sm text-balance md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground',
'text-fg-muted text-sm text-balance md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground',
props.class,
)
"
@@ -18,7 +18,7 @@ const delegatedProps = reactiveOmit(props, "class");
v-bind="delegatedProps"
:class="
cn(
'bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs',
'bg-muted text-fg-muted rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs',
props.class,
)
"
@@ -12,7 +12,7 @@ const props = defineProps<{
data-slot="avatar-group-count"
:class="
cn(
'bg-muted text-muted-foreground size-8 rounded-full text-sm group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3 relative flex shrink-0 items-center justify-center ring-2 ring-background',
'bg-muted text-fg-muted size-8 rounded-full text-sm group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3 relative flex shrink-0 items-center justify-center ring-2 ring-background',
props.class,
)
"
@@ -10,7 +10,7 @@ const props = defineProps<{
<template>
<ol
data-slot="breadcrumb-list"
:class="cn('text-muted-foreground gap-1.5 text-sm flex flex-wrap items-center wrap-break-word', props.class)"
:class="cn('text-fg-muted gap-1.5 text-sm flex flex-wrap items-center wrap-break-word', props.class)"
>
<slot />
</ol>
@@ -10,7 +10,7 @@ const props = defineProps<{
<template>
<div
data-slot="card-description"
:class="cn('text-muted-foreground text-sm', props.class)"
:class="cn('text-fg-muted text-sm', props.class)"
>
<slot />
</div>
@@ -34,7 +34,7 @@ onUnmounted(() => {
v-bind="delegatedProps"
:id="id"
data-slot="command-group"
:class="cn('text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium', props.class)"
:class="cn('text-foreground **:[[cmdk-group-heading]]:text-fg-muted overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium', props.class)"
:hidden="isRender ? undefined : true"
>
<ListboxGroupLabel v-if="heading" data-slot="command-group-heading" class="">
@@ -10,7 +10,7 @@ const props = defineProps<{
<template>
<span
data-slot="command-shortcut"
:class="cn('text-muted-foreground group-data-highlighted/command-item:text-foreground ml-auto text-xs tracking-widest', props.class)"
:class="cn('text-fg-muted group-data-highlighted/command-item:text-foreground ml-auto text-xs tracking-widest', props.class)"
>
<slot />
</span>
@@ -20,7 +20,7 @@ const forwardedProps = useForwardProps(delegatedProps);
v-bind="forwardedProps"
:class="
cn(
'text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3',
'text-fg-muted *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3',
props.class,
)
"
@@ -31,7 +31,7 @@ const forwardedProps = useForwardProps(delegatedProps);
v-bind="forwardedProps"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:pl-7 [&_svg:not([class*=size-])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0',
'focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-danger data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-danger data-[variant=destructive]:*:[svg]:text-danger not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:pl-7 [&_svg:not([class*=size-])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0',
props.class,
)
"
@@ -20,7 +20,7 @@ const forwardedProps = useForwardProps(delegatedProps);
v-bind="forwardedProps"
:class="
cn(
'text-muted-foreground px-1.5 py-1 text-xs font-medium data-inset:pl-7',
'text-fg-muted px-1.5 py-1 text-xs font-medium data-inset:pl-7',
props.class,
)
"
@@ -12,7 +12,7 @@ const props = defineProps<{
data-slot="dropdown-menu-shortcut"
:class="
cn(
'text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest',
'text-fg-muted group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest',
props.class,
)
"
@@ -57,7 +57,7 @@ function emitChange() {
<select
v-model="unit"
aria-label="Unit"
class="bg-transparent font-mono text-xs text-muted-foreground outline-none"
class="bg-transparent font-mono text-xs text-fg-muted outline-none"
:disabled="disabled"
@change="emitChange"
>
@@ -12,7 +12,7 @@ defineProps<{
data-slot="empty-description"
:class="
cn(
'text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-link',
'text-sm/relaxed text-fg-muted [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-link',
$attrs.class ?? '',
)
"
@@ -12,7 +12,7 @@ const props = defineProps<{
data-slot="field-description"
:class="
cn(
'text-muted-foreground text-left text-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-data-horizontal/field:text-balance',
'text-fg-muted text-left text-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-data-horizontal/field:text-balance',
'last:mt-0 nth-last-2:-mt-1',
'[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-link',
props.class,
+1 -1
View File
@@ -37,7 +37,7 @@ const content = computed(() => {
v-if="$slots.default || content"
role="alert"
data-slot="field-error"
:class="cn('text-destructive text-sm font-normal', props.class)"
:class="cn('text-danger text-sm font-normal', props.class)"
>
<slot v-if="$slots.default" />
@@ -22,7 +22,7 @@ const props = defineProps<{
<Separator class="absolute inset-0 top-1/2" />
<span
v-if="$slots.default"
class="text-muted-foreground px-2 relative mx-auto block w-fit bg-background"
class="text-fg-muted px-2 relative mx-auto block w-fit bg-background"
data-slot="field-separator-content"
>
<slot />
@@ -11,7 +11,7 @@ const props = defineProps<{
<span
:class="
cn(
'text-muted-foreground gap-2 text-sm [&_svg:not([class*=size-])]:size-4 flex items-center [&_svg]:pointer-events-none',
'text-fg-muted gap-2 text-sm [&_svg:not([class*=size-])]:size-4 flex items-center [&_svg]:pointer-events-none',
props.class,
)
"
+1 -1
View File
@@ -25,7 +25,7 @@ const modelValue = useVModel(props, "modelValue", emits, {
data-slot="input"
:class="
cn(
'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-card px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-card px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-foreground placeholder:text-fg-muted disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
props.class,
)
"
+1 -1
View File
@@ -10,7 +10,7 @@ const props = defineProps<{
<template>
<kbd
data-slot="kbd"
:class="cn('bg-muted text-muted-foreground in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 h-5 w-fit min-w-5 gap-1 rounded-sm px-1 font-sans text-xs font-medium [&_svg:not([class*=size-])]:size-3 pointer-events-none inline-flex items-center justify-center select-none', props.class)"
:class="cn('bg-muted text-fg-muted in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 h-5 w-fit min-w-5 gap-1 rounded-sm px-1 font-sans text-xs font-medium [&_svg:not([class*=size-])]:size-3 pointer-events-none inline-flex items-center justify-center select-none', props.class)"
>
<slot />
</kbd>
@@ -38,11 +38,11 @@ const delegatedProps = reactiveOmit(props, 'class', 'size')
v-bind="{ ...$attrs, ...delegatedProps }"
v-model="modelValue"
data-slot="native-select"
class="border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-8 w-full min-w-0 appearance-none rounded-lg border bg-card py-1 pr-8 pl-2.5 text-sm transition-colors select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5 outline-none disabled:pointer-events-none disabled:cursor-not-allowed"
class="border-input placeholder:text-fg-muted selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-8 w-full min-w-0 appearance-none rounded-lg border bg-card py-1 pr-8 pl-2.5 text-sm transition-colors select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5 outline-none disabled:pointer-events-none disabled:cursor-not-allowed"
:data-size="props.size ?? 'default'"
>
<slot />
</select>
<ChevronDownIcon class="text-muted-foreground top-1/2 right-2.5 size-4 -translate-y-1/2 pointer-events-none absolute select-none" aria-hidden="true" data-slot="native-select-icon" />
<ChevronDownIcon class="text-fg-muted top-1/2 right-2.5 size-4 -translate-y-1/2 pointer-events-none absolute select-none" aria-hidden="true" data-slot="native-select-icon" />
</div>
</template>
@@ -12,7 +12,7 @@ const props = defineProps<{
<NumberFieldInput
data-slot="input"
:class="cn(
'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-card px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm w-full min-w-0 text-center outline-none placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-card px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm w-full min-w-0 text-center outline-none placeholder:text-fg-muted disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
props.class,
)"
/>
@@ -10,7 +10,7 @@ const props = defineProps<{
<template>
<p
data-slot="popover-description"
:class="cn('text-muted-foreground', props.class)"
:class="cn('text-fg-muted', props.class)"
>
<slot />
</p>
@@ -20,9 +20,9 @@ defineEmits<{ change: [] }>();
<template>
<div class="flex flex-col gap-1.5">
<div class="flex h-8 items-center gap-2 rounded-lg border border-input bg-card px-2.5 font-mono text-[13px]">
<Lock class="size-3.5 shrink-0 text-muted-foreground" aria-hidden="true" />
<span class="text-muted-foreground">{{ engine }}</span>
<span class="text-muted-foreground" aria-hidden="true">/</span>
<Lock class="size-3.5 shrink-0 text-fg-muted" aria-hidden="true" />
<span class="text-fg-muted">{{ engine }}</span>
<span class="text-fg-muted" aria-hidden="true">/</span>
<span class="min-w-0 flex-1 truncate">{{ secretKey }}</span>
<Button variant="ghost" size="sm" class="h-7" :disabled="disabled" @click="$emit('change')">Change</Button>
</div>
+1 -1
View File
@@ -12,7 +12,7 @@ const props = defineProps<
<template>
<SelectLabel
data-slot="select-label"
:class="cn('text-muted-foreground px-1.5 py-1 text-xs', props.class)"
:class="cn('text-fg-muted px-1.5 py-1 text-xs', props.class)"
>
<slot />
</SelectLabel>
@@ -28,7 +28,7 @@ const forwardedProps = useForwardProps(delegatedProps);
v-bind="forwardedProps"
:class="
cn(
'border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-lg border bg-card py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*=size-])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0',
'border-input data-placeholder:text-fg-muted dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-lg border bg-card py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*=size-])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0',
props.class,
)
"
@@ -36,7 +36,7 @@ const forwardedProps = useForwardProps(delegatedProps);
<slot />
<SelectIcon as-child>
<ChevronDownIcon
class="text-muted-foreground size-4 pointer-events-none"
class="text-fg-muted size-4 pointer-events-none"
/>
</SelectIcon>
</SelectTrigger>
@@ -15,7 +15,7 @@ const delegatedProps = reactiveOmit(props, "class");
<template>
<DialogDescription
data-slot="sheet-description"
:class="cn('text-muted-foreground text-sm', props.class)"
:class="cn('text-fg-muted text-sm', props.class)"
v-bind="delegatedProps"
>
<slot />
+1 -1
View File
@@ -10,7 +10,7 @@ const props = defineProps<{
<template>
<caption
data-slot="table-caption"
:class="cn('text-muted-foreground mt-4 text-sm', props.class)"
:class="cn('text-fg-muted mt-4 text-sm', props.class)"
>
<slot />
</caption>
+1 -1
View File
@@ -19,7 +19,7 @@ const forwardedProps = useForwardProps(delegatedProps);
data-slot="tabs-trigger"
:class="
cn(
'gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*=size-])]:size-4 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0',
'gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*=size-])]:size-4 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 dark:text-fg-muted dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0',
'group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent',
'data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground',
'after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100',
+1 -1
View File
@@ -25,7 +25,7 @@ const modelValue = useVModel(props, "modelValue", emits, {
data-slot="textarea"
:class="
cn(
'border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-lg border bg-card px-2.5 py-2 text-base transition-colors focus-visible:ring-3 aria-invalid:ring-3 md:text-sm flex field-sizing-content min-h-16 w-full outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',
'border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-lg border bg-card px-2.5 py-2 text-base transition-colors focus-visible:ring-3 aria-invalid:ring-3 md:text-sm flex field-sizing-content min-h-16 w-full outline-none placeholder:text-fg-muted disabled:cursor-not-allowed disabled:opacity-50',
props.class,
)
"
+1 -1
View File
@@ -72,7 +72,7 @@ onMounted(load);
<p v-if="store.catalogError || store.pageErrorFor(KIND)" class="mb-4 text-sm text-danger" role="alert">{{ store.catalogError || store.pageErrorFor(KIND) }}</p>
<div v-if="editing" class="mb-6">
<form class="mb-4 flex gap-2" @submit.prevent="add"><Input v-model="newName" aria-label="Curator name" placeholder="Curator name" class="max-w-xs" /><Button type="submit" :disabled="!newName.trim() || definitions?.some(def => def.name === newName.trim())">Add curator</Button></form>
<p v-if="!definitions?.length" class="text-sm text-fg-muted">No custom curator definitions.</p>
<Empty v-if="!definitions?.length"><EmptyHeader><EmptyTitle>No custom curator definitions</EmptyTitle></EmptyHeader></Empty>
<section v-for="(def, index) in definitions" :key="index" class="mb-6 border-t pt-4">
<div class="flex items-center justify-between"><h2 class="font-mono text-sm">{{ def.name }}</h2><Button variant="ghost" size="sm" @click="definitions!.splice(index, 1)">Remove curator</Button></div>
<SettingRow label="Enabled"><Switch v-model="def.enabled" :aria-label="`${def.name} enabled`" /></SettingRow>
+4 -4
View File
@@ -139,7 +139,7 @@ function scopes(binding: HarnessBinding): string {
<Card v-else class="mb-4">
<CardContent class="flex flex-wrap items-end gap-3">
<div class="flex flex-col gap-1 text-sm">
<Label for="harness-profile" class="text-muted-foreground">Profile</Label>
<Label for="harness-profile" class="text-fg-muted">Profile</Label>
<Select v-model="profile" :disabled="!state.profiles.length">
<SelectTrigger id="harness-profile" size="sm" class="min-w-48">
<SelectValue placeholder="No profiles configured" />
@@ -177,7 +177,7 @@ function scopes(binding: HarnessBinding): string {
</TableHeader>
<TableBody>
<TableRow v-if="!state.bindings.length">
<TableCell colspan="5" class="text-muted-foreground">No credential bindings are configured.</TableCell>
<TableCell colspan="5" class="text-fg-muted">No credential bindings are configured.</TableCell>
</TableRow>
<TableRow v-for="binding in state.bindings" :key="binding.service">
<TableCell class="font-medium">{{ binding.service }}</TableCell>
@@ -187,8 +187,8 @@ function scopes(binding: HarnessBinding): string {
</Badge>
</TableCell>
<TableCell>{{ formatTimestamp(binding.expires_at) }}</TableCell>
<TableCell class="text-muted-foreground">{{ scopes(binding) }}</TableCell>
<TableCell class="text-muted-foreground">
<TableCell class="text-fg-muted">{{ scopes(binding) }}</TableCell>
<TableCell class="text-fg-muted">
{{ formatTimestamp(binding.updated_at) }}
</TableCell>
</TableRow>
+1 -1
View File
@@ -103,7 +103,7 @@ onBeforeUnmount(() => {
<div class="flex h-full min-h-0 flex-col gap-2">
<p
v-if="status !== 'open'"
class="text-sm text-muted-foreground"
class="text-sm text-fg-muted"
role="status"
>
<template v-if="status === 'connecting'">Connecting…</template>
+3
View File
@@ -148,6 +148,9 @@ export const api = {
changePassword: (current_password: string,new_password: string) => request<void>("/api/account/password",{method:"POST",body:{current_password,new_password},parse:false}),
authentication: <T = unknown>() => request<T>("/api/authentication"),
saveAuthentication: (body: unknown) => request<void>("/api/authentication",{method:"PUT",body,parse:false}),
tokens: <T = unknown>() => request<T>("/api/tokens"),
createToken: () => request<{token:string}>("/api/tokens",{method:"POST",body:{}}),
revokeToken: (id:string) => request<void>(`/api/tokens/${encodeURIComponent(id)}`,{method:"DELETE",body:{},parse:false}),
passkeys: () => request<{passkeys:{id:string;name:string}[]}>("/api/account/passkeys"),
deletePasskey: (id:string) => request<void>(`/api/account/passkeys/${encodeURIComponent(id)}`,{method:"DELETE",body:{},parse:false}),
beginPasskey: <T = unknown>(registration:boolean) => request<T>(registration?"/api/account/passkeys/begin":"/api/auth/passkey/begin",{method:"POST",body:{}}),
+1 -1
View File
@@ -135,7 +135,7 @@ const isAgent = (value: Identity) =>
<ul class="divide-y divide-border rounded-lg border border-border bg-card" aria-label="Agents">
<li v-for="value in store.identities" :key="value.id" class="flex flex-wrap items-center gap-3 px-4 py-3">
<span class="grid size-8 shrink-0 place-items-center rounded-md bg-secondary text-muted-foreground">
<span class="grid size-8 shrink-0 place-items-center rounded-md bg-secondary text-fg-muted">
<component :is="icons[value.kind]" class="size-4" aria-hidden="true" />
</span>
<div class="min-w-0 flex-1">
+3 -2
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import { computed, onMounted, ref } from "vue";
import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
@@ -37,12 +38,12 @@ function tools(profile: Profile, value: string | number) {
<div>
<PageHeader title="Agent profiles"><HistoryLink :kinds="[KIND]" /></PageHeader>
<ApplyStatusRows :kind="KIND" class="mb-4" />
<p v-if="store.catalogError || store.pageErrorFor(KIND)" class="mb-4 text-sm text-destructive" role="alert">{{ store.catalogError || store.pageErrorFor(KIND) }}</p>
<p v-if="store.catalogError || store.pageErrorFor(KIND)" class="mb-4 text-sm text-danger" role="alert">{{ store.catalogError || store.pageErrorFor(KIND) }}</p>
<form class="mb-4 flex flex-wrap gap-2" @submit.prevent="add">
<Input v-model="name" aria-label="Profile name" placeholder="Profile name" class="max-w-xs" :disabled="unsaved" />
<Button type="submit" :disabled="unsaved || !name.trim() || !!profiles?.[name.trim()]">Add profile</Button>
</form>
<p v-if="!Object.keys(profiles ?? {}).length" class="text-sm text-fg-muted">No agent profiles.</p>
<Empty v-if="!Object.keys(profiles ?? {}).length"><EmptyHeader><EmptyTitle>No agent profiles</EmptyTitle></EmptyHeader></Empty>
<CardAccordion v-model:open="open" :items="entries" :title="([key]) => key" remove-label="Remove" mono @remove="delete profiles![entries[$event]![0]]">
<template #default="{ item: [key, profile] }">
<SettingRow label="Image" :for="`${key}-image`"><Input :id="`${key}-image`" v-model="profile.image" placeholder="Container image" /></SettingRow>
+3 -2
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import ApplyStatusRows from "./ApplyStatusRows.vue";
import { computed, onMounted, ref } from "vue";
import { storeToRefs } from "pinia";
@@ -70,10 +71,10 @@ function addConnection() {
<Button size="sm" :disabled="unsaved" @click="addConnection">
<Plus data-icon="inline-start" />Add connection
</Button>
<span v-if="unsaved" class="text-xs text-muted-foreground">Save the current changes first.</span>
<span v-if="unsaved" class="text-xs text-fg-muted">Save the current changes first.</span>
</div>
<p v-if="!connections.length" class="text-sm text-fg-muted">No connections.</p>
<Empty v-if="!connections.length"><EmptyHeader><EmptyTitle>No connections</EmptyTitle></EmptyHeader></Empty>
<CardAccordion
v-model:open="open"
+3 -2
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import { computed, onMounted, ref } from "vue";
import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
@@ -29,8 +30,8 @@ function add() {
<div>
<PageHeader title="Credential bindings"><HistoryLink :kinds="[KIND]" /><Button :disabled="unsaved" @click="add">Add binding</Button></PageHeader>
<ApplyStatusRows :kind="KIND" class="mb-4" />
<p v-if="store.catalogError || store.pageErrorFor(KIND)" class="mb-4 text-sm text-destructive" role="alert">{{ store.catalogError || store.pageErrorFor(KIND) }}</p>
<p v-if="!bindings?.length" class="text-sm text-fg-muted">No credential bindings.</p>
<p v-if="store.catalogError || store.pageErrorFor(KIND)" class="mb-4 text-sm text-danger" role="alert">{{ store.catalogError || store.pageErrorFor(KIND) }}</p>
<Empty v-if="!bindings?.length"><EmptyHeader><EmptyTitle>No credential bindings</EmptyTitle></EmptyHeader></Empty>
<CardAccordion v-model:open="open" :items="bindings ?? []" :title="(b) => b.service || 'New binding'" remove-label="Remove" mono @remove="bindings!.splice($event, 1)">
<template #default="{ item: binding, index }">
<SettingRow label="Service" :for="`binding-${index}-service`"><Input :id="`binding-${index}-service`" v-model="binding.service" /></SettingRow>
+3 -2
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import { computed, onMounted, ref } from "vue";
import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
@@ -32,9 +33,9 @@ function add() {
<div>
<PageHeader title="Playbooks"><HistoryLink :kinds="[KIND]" /></PageHeader>
<ApplyStatusRows :kind="KIND" class="mb-4" />
<p v-if="store.catalogError || store.pageErrorFor(KIND)" class="mb-4 text-sm text-destructive" role="alert">{{ store.catalogError || store.pageErrorFor(KIND) }}</p>
<p v-if="store.catalogError || store.pageErrorFor(KIND)" class="mb-4 text-sm text-danger" role="alert">{{ store.catalogError || store.pageErrorFor(KIND) }}</p>
<form class="mb-4 flex flex-wrap gap-2" @submit.prevent="add"><Input v-model="id" aria-label="Playbook ID" placeholder="Playbook ID" class="max-w-xs" :disabled="unsaved" /><Button type="submit" :disabled="unsaved || !id.trim() || collection?.playbooks.some(entry => entry.id === id.trim())">Add playbook</Button></form>
<p v-if="!collection?.playbooks.length" class="text-sm text-fg-muted">No playbooks installed.</p>
<Empty v-if="!collection?.playbooks.length"><EmptyHeader><EmptyTitle>No playbooks installed</EmptyTitle></EmptyHeader></Empty>
<CardAccordion v-model:open="open" :items="collection?.playbooks ?? []" :title="(entry) => entry.id" remove-label="Remove" mono @remove="collection!.playbooks.splice($event, 1)">
<template #default="{ item: entry, index }">
<Textarea :id="`playbook-${index}`" v-model="entry.yaml" :aria-label="`${entry.id} YAML`" class="mb-3 min-h-64 font-mono" spellcheck="false" />
+2 -1
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import { onMounted } from "vue";
import { useIntervalFn } from "@vueuse/core";
import PageHeader from "@/base/PageHeader.vue";
@@ -17,7 +18,7 @@ useIntervalFn(store.load, 15_000);
</PageHeader>
<p class="mb-4 text-sm text-fg-muted">Extension engines: <RouterLink to="/settings/extensions" class="underline">Extensions</RouterLink></p>
<p v-if="store.error" class="text-sm text-danger" role="alert">{{ store.error }}</p>
<p v-else-if="store.engines && !store.engines.length" class="text-sm text-fg-muted" role="status">No secret engines installed.</p>
<Empty v-else-if="store.engines && !store.engines.length"><EmptyHeader><EmptyTitle>No secret engines installed</EmptyTitle></EmptyHeader></Empty>
<Table v-else-if="store.engines">
<TableHeader><TableRow><TableHead>Engine</TableHead><TableHead>Version</TableHead><TableHead>Source</TableHead></TableRow></TableHeader>
<TableBody><TableRow v-for="engine in store.engines" :key="engine.name"><TableCell class="font-mono">{{ engine.name }}</TableCell><TableCell class="font-mono">{{ engine.version || '—' }}</TableCell><TableCell>{{ engine.source }}</TableCell></TableRow></TableBody>
+1 -1
View File
@@ -96,7 +96,7 @@ onUnmounted(() => clearInterval(timer));
<CardTitle>Services</CardTitle>
</CardHeader>
<CardContent>
<p v-if="error" class="text-sm text-destructive">{{ error }}</p>
<p v-if="error" class="text-sm text-danger">{{ error }}</p>
<Table v-else>
<TableHeader>
<TableRow>
+1 -1
View File
@@ -45,7 +45,7 @@ const items = computed(() =>
:aria-current="route.path === item.path ? 'page' : undefined"
:class="
cn(
'flex h-8 shrink-0 items-center rounded-md px-3 text-[13px] whitespace-nowrap text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring',
'flex h-8 shrink-0 items-center rounded-md px-3 text-[13px] whitespace-nowrap text-fg-muted transition-colors hover:bg-secondary hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring',
route.path === item.path &&
'bg-secondary font-medium text-foreground',
)
+2 -1
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import ApplyStatusRows from "./ApplyStatusRows.vue";
import HistoryLink from "@/settings/HistoryLink.vue";
import { computed, onMounted, ref, toRaw, watch } from "vue";
@@ -107,7 +108,7 @@ const eyebrow = "text-[11px] font-medium tracking-[0.06em] text-fg-subtle upperc
:model-value="server"
@remove="removeServer(server)"
/>
<p v-if="!tools.mcp_servers.length && !pending" class="text-sm text-fg-muted">No MCP servers.</p>
<Empty v-if="!tools.mcp_servers.length && !pending"><EmptyHeader><EmptyTitle>No MCP servers</EmptyTitle></EmptyHeader></Empty>
<div v-if="!pending">
<Button variant="outline" size="sm" @click="addServer">
<Plus data-icon="inline-start" /> Add MCP server</Button>
+1 -1
View File
@@ -132,7 +132,7 @@ function url(source: Source): string {
/>
<div
v-if="refusals[source.path]"
class="text-xs font-sans text-destructive"
class="text-xs font-sans text-danger"
:title="refusals[source.path].addrs.join(', ')"
>
{{ refusals[source.path].refused }} refused in 24h from
+1 -1
View File
@@ -92,7 +92,7 @@ onBeforeUnmount(() => {
<div class="flex h-[32rem] min-h-0 flex-col gap-2">
<p
v-if="status !== 'open'"
class="text-sm text-muted-foreground"
class="text-sm text-fg-muted"
role="status"
>
<template v-if="status === 'connecting'">Connecting…</template>
+4 -4
View File
@@ -20,7 +20,7 @@ watch(() => props.task.review_gate, () => {
<Card v-if="gate" class="mb-6">
<CardHeader>
<CardTitle>Review findings</CardTitle>
<p v-if="gate.head_sha" class="break-all font-mono text-xs text-muted-foreground">Head commit: {{ gate.head_sha }}</p>
<p v-if="gate.head_sha" class="break-all font-mono text-xs text-fg-muted">Head commit: {{ gate.head_sha }}</p>
</CardHeader>
<CardContent class="space-y-4">
<ul class="divide-y divide-border rounded-md border border-border">
@@ -34,7 +34,7 @@ watch(() => props.task.review_gate, () => {
/>
<span class="min-w-0 space-y-1">
<span class="block text-sm font-medium">{{ entry.finding.Title }}</span>
<span class="block break-all font-mono text-xs text-muted-foreground">{{ entry.finding.File }}<template v-if="entry.finding.LineStart">:{{ entry.finding.LineStart }}<template v-if="entry.finding.LineEnd > entry.finding.LineStart">–{{ entry.finding.LineEnd }}</template></template></span>
<span class="block break-all font-mono text-xs text-fg-muted">{{ entry.finding.File }}<template v-if="entry.finding.LineStart">:{{ entry.finding.LineStart }}<template v-if="entry.finding.LineEnd > entry.finding.LineStart">–{{ entry.finding.LineEnd }}</template></template></span>
</span>
</label>
<div class="flex flex-wrap items-center gap-2 text-xs">
@@ -44,12 +44,12 @@ watch(() => props.task.review_gate, () => {
<span>Confidence: {{ entry.finding.Confidence }}</span>
</div>
<p class="whitespace-pre-wrap break-words text-sm">{{ entry.finding.Body }}</p>
<p v-if="entry.finding.Evidence" class="whitespace-pre-wrap break-words text-xs text-muted-foreground">Evidence: {{ entry.finding.Evidence }}</p>
<p v-if="entry.finding.Evidence" class="whitespace-pre-wrap break-words text-xs text-fg-muted">Evidence: {{ entry.finding.Evidence }}</p>
<pre v-if="entry.finding.Suggestion" class="overflow-x-auto rounded-md bg-secondary p-2 text-xs">{{ entry.finding.Suggestion }}</pre>
</li>
</ul>
<div class="flex flex-wrap items-center justify-between gap-3">
<p class="text-xs text-muted-foreground">{{ selected.length }} of {{ gate.findings.length }} selected</p>
<p class="text-xs text-fg-muted">{{ selected.length }} of {{ gate.findings.length }} selected</p>
<TaskRowActions :task="task" :only="['approve', 'rereview', 'reject']" :findings="selected" @done="emit('done', $event)" />
</div>
</CardContent>
+3 -3
View File
@@ -263,7 +263,7 @@ const resume = () => transition(api.bindingResume, "pending_approval");
<div v-if="loading" class="flex flex-1 items-center justify-center"><Spinner /></div>
<form v-else class="flex-1 space-y-5 overflow-y-auto px-4 py-4" @submit.prevent="save">
<section class="space-y-1.5">
<label for="bind-source" class="text-xs font-medium text-muted-foreground">Source</label>
<label for="bind-source" class="text-xs font-medium text-fg-muted">Source</label>
<OptionSelect id="bind-source" aria-label="Source" :model-value="source" :options="sourceOptions" class="w-full" :disabled="!!binding" @update:model-value="source = $event" />
<Input
v-if="source === NEW_SOURCE"
@@ -278,7 +278,7 @@ const resume = () => transition(api.bindingResume, "pending_approval");
<SourceSecret v-if="revealed" :source="revealed" @dismiss="revealed = null" />
<section v-if="sourcePath" class="space-y-1.5">
<label for="bind-capture" class="text-xs font-medium text-muted-foreground">Example event</label>
<label for="bind-capture" class="text-xs font-medium text-fg-muted">Example event</label>
<Select v-if="sourceCaptures.length" :model-value="captureId ?? undefined" @update:model-value="captureId = String($event)">
<SelectTrigger id="bind-capture" size="sm" class="w-full" aria-label="Example event"><SelectValue placeholder="Pick an event" /></SelectTrigger>
<SelectContent>
@@ -289,7 +289,7 @@ const resume = () => transition(api.bindingResume, "pending_approval");
</section>
<section class="space-y-1.5">
<div class="text-xs font-medium text-muted-foreground">Inputs</div>
<div class="text-xs font-medium text-fg-muted">Inputs</div>
<datalist id="bind-paths"><option v-for="path in paths" :key="path" :value="path" /></datalist>
<div class="divide-y divide-border rounded-md border border-border">
<div v-for="[name, spec] in inputs" :key="name" class="space-y-1 px-3 py-2">
+1 -1
View File
@@ -32,7 +32,7 @@ function add(): void {
<template>
<section class="space-y-1.5">
<div class="flex items-center text-xs font-medium text-muted-foreground">
<div class="flex items-center text-xs font-medium text-fg-muted">
{{ field === "inputs" ? "Inputs" : "Outputs" }}
<Button type="button" variant="ghost" size="xs" class="ml-auto" @click="add"><Plus data-icon="inline-start" />Add</Button>
</div>
+7 -7
View File
@@ -158,11 +158,11 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
<section v-if="branching" class="space-y-3">
<label v-if="type === 'switch'" class="block space-y-1.5">
<span class="text-xs font-medium text-muted-foreground" title="The value whose case runs; a case named default runs when none matches">Switch on</span>
<span class="text-xs font-medium text-fg-muted" title="The value whose case runs; a case named default runs when none matches">Switch on</span>
<Input :model-value="branching.on" class="font-mono" placeholder="steps.assess.result.fit" :list="`${uid}-switch-on`" @change="setOn(($event.target as HTMLInputElement).value.trim())" />
<datalist :id="`${uid}-switch-on`"><option v-for="id in earlier" :key="id" :value="`steps.${id}.result.`" /></datalist>
</label>
<div class="text-xs font-medium text-muted-foreground">{{ type === "switch" ? "Cases" : "Branches" }}</div>
<div class="text-xs font-medium text-fg-muted">{{ type === "switch" ? "Cases" : "Branches" }}</div>
<div v-for="name in branches" :key="name" class="flex items-center gap-2">
<Input :model-value="name" :class="type === 'switch' && 'font-mono'" :aria-label="`${type === 'switch' ? 'Case' : 'Branch'} ${name}`" @change="changeBranch('rename', name, ($event.target as HTMLInputElement).value.trim())" />
<Button type="button" variant="ghost" size="icon-sm" :aria-label="`Remove ${name}`" :disabled="branches.length <= minBranches" @click="changeBranch('delete', name)"><Trash2 /></Button>
@@ -175,7 +175,7 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
</section>
<section v-if="fields.lead" class="space-y-1.5">
<div class="flex items-center gap-1 text-xs font-medium text-muted-foreground" :title="fields.lead.schema.description">
<div class="flex items-center gap-1 text-xs font-medium text-fg-muted" :title="fields.lead.schema.description">
{{ label(fields.lead.key, fields.lead.schema) }}
<CircleHelp v-if="fields.lead.schema.description" class="size-3 text-fg-subtle" />
</div>
@@ -203,7 +203,7 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
</div>
</section>
<Button type="button" variant="ghost" size="xs" class="-ml-2 text-muted-foreground" :aria-expanded="more" @click="more = !more">
<Button type="button" variant="ghost" size="xs" class="-ml-2 text-fg-muted" :aria-expanded="more" @click="more = !more">
<ChevronDown data-icon="inline-start" class="transition-transform" :class="!more && '-rotate-90'" />More
</Button>
@@ -230,7 +230,7 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
<template v-if="type === 'workflow.call' && callee">
<section v-if="callInputs.length" class="space-y-3">
<div class="text-xs font-medium text-muted-foreground">Inputs</div>
<div class="text-xs font-medium text-fg-muted">Inputs</div>
<div v-for="[name, spec] in callInputs" :key="name" class="space-y-1.5">
<div class="text-[13px]">{{ name }}<span v-if="spec.required" class="text-danger"> *</span><span class="ml-2 text-xs text-fg-subtle">{{ spec.type }}</span></div>
<OptionSelect
@@ -247,7 +247,7 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
</div>
</section>
<section v-if="callOutputs.length" class="space-y-3">
<div class="text-xs font-medium text-muted-foreground">Outputs</div>
<div class="text-xs font-medium text-fg-muted">Outputs</div>
<div v-for="[name, spec] in callOutputs" :key="name" class="space-y-1.5">
<div class="text-[13px]">{{ name }}<span class="ml-2 text-xs text-fg-subtle">{{ spec.type }}</span></div>
<OptionSelect class="w-full" :aria-label="`${name} output`" :disabled="settings.wait !== true" :model-value="outputMap[name] ?? ''" :options="[{ value: '', label: 'Do not publish' }, ...matching(callerOutputs, spec, 'outputs')]" @update:model-value="setSetting('outputs', { ...outputMap, [name]: $event || undefined })" />
@@ -256,7 +256,7 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
</template>
<section v-for="field in fields.long" :key="field.key" class="space-y-1.5">
<div class="flex items-center gap-1 text-xs font-medium text-muted-foreground" :title="field.schema.description">
<div class="flex items-center gap-1 text-xs font-medium text-fg-muted" :title="field.schema.description">
{{ label(field.key, field.schema) }}
<CircleHelp v-if="field.schema.description" class="size-3 text-fg-subtle" />
</div>
+3 -3
View File
@@ -141,10 +141,10 @@ function commitRename(event: Event): void {
<div v-if="data.mark" class="text-[11px] font-medium" :class="{ 'text-ok': data.mark === 'added', 'text-danger': data.mark === 'removed', 'text-warn': data.mark === 'changed' }">{{ data.mark === "added" ? "Added" : data.mark === "removed" ? "Removed" : "Changed" }}</div>
<template v-if="!data.expanded">
<ul v-if="data.kind === 'start' && data.triggers?.length" class="mt-1 space-y-0.5">
<li v-for="trigger in data.triggers" :key="trigger.kind + trigger.label" class="truncate text-xs text-muted-foreground" :title="trigger.detail">{{ trigger.label }}</li>
<li v-for="trigger in data.triggers" :key="trigger.kind + trigger.label" class="truncate text-xs text-fg-muted" :title="trigger.detail">{{ trigger.label }}</li>
</ul>
<div v-else-if="data.kind === 'start'" class="mt-0.5 text-xs text-muted-foreground">Manual runs only</div>
<div v-else-if="data.summary || data.detail" class="mt-0.5 truncate text-xs text-muted-foreground" :title="[data.detail, data.summary].filter(Boolean).join('\n')">{{ data.summary || data.detail }}</div>
<div v-else-if="data.kind === 'start'" class="mt-0.5 text-xs text-fg-muted">Manual runs only</div>
<div v-else-if="data.summary || data.detail" class="mt-0.5 truncate text-xs text-fg-muted" :title="[data.detail, data.summary].filter(Boolean).join('\n')">{{ data.summary || data.detail }}</div>
<div v-if="data.when || data.retry || data.continues" class="mt-1 flex flex-wrap gap-1 text-[11px]">
<span v-if="data.when" class="flex max-w-full min-w-0 items-center gap-0.5 rounded bg-secondary px-1 font-mono" :title="`Runs only when ${data.when}`">
<Flag class="size-3 shrink-0" aria-hidden="true" /><span class="truncate">{{ data.when }}</span>
+12 -12
View File
@@ -100,48 +100,48 @@ const scopedLogs = computed(() => logs.value ? { ...logs.value, entries: (logs.v
<div class="space-y-5 p-4 text-sm">
<div class="flex items-center gap-2">
<Badge :variant="meta.kind">{{ meta.label }}</Badge>
<span class="text-xs text-muted-foreground">{{ stage.duration_ms == null ? "Duration not recorded" : duration(stage.duration_ms) }}</span>
<span class="ml-auto text-xs text-muted-foreground">Attempt {{ attempt }}</span>
<span class="text-xs text-fg-muted">{{ stage.duration_ms == null ? "Duration not recorded" : duration(stage.duration_ms) }}</span>
<span class="ml-auto text-xs text-fg-muted">Attempt {{ attempt }}</span>
</div>
<p v-if="stage.error" class="rounded-md bg-danger-soft p-3 break-words whitespace-pre-wrap text-danger">{{ stage.error }}</p>
<p v-if="activityError" role="alert" class="text-danger">{{ activityError }}</p>
<section v-for="group in groups" :key="group.branch" class="space-y-3">
<h3 v-if="group.branch" class="font-medium">{{ group.branch }}</h3>
<p v-else-if="groups.length > 1" class="text-xs text-muted-foreground">Activity without branch attribution</p>
<p v-else-if="groups.length > 1" class="text-xs text-fg-muted">Activity without branch attribution</p>
<div v-for="agent in group.agents" :key="agent.id" class="space-y-1">
<div class="flex items-center gap-2 text-xs"><span class="font-mono">{{ agent.name.split('/').at(-1) }}</span><Badge :variant="stageStatusMeta(agent.status).kind">{{ agent.status }}</Badge></div>
<p v-if="agent.detail" class="break-words whitespace-pre-wrap">{{ agent.detail }}</p>
</div>
<div v-for="(report, i) in group.reports" :key="i" class="space-y-1">
<p v-if="report.detail && !group.agents.some((agent) => agent.detail === report.detail)" class="break-words whitespace-pre-wrap">{{ report.detail }}</p>
<p class="text-xs text-muted-foreground">Agent's own report · {{ describeTimelineEvent(report).title }}</p>
<p class="text-xs text-fg-muted">Agent's own report · {{ describeTimelineEvent(report).title }}</p>
</div>
<div v-if="group.tools.length" class="space-y-1">
<h4 class="text-xs font-medium text-muted-foreground">Tool calls · {{ group.tools.length }}</h4>
<h4 class="text-xs font-medium text-fg-muted">Tool calls · {{ group.tools.length }}</h4>
<ol class="divide-y divide-border rounded-md border border-border">
<li v-for="(tool, i) in expanded ? group.tools : group.tools.slice(0, 12)" :key="i" class="px-3 py-2">
<div class="flex justify-between gap-2 text-xs"><span class="font-mono">{{ tool.data?.tool }}</span><span :class="tool.data?.failed ? 'text-danger' : 'text-muted-foreground'">{{ tool.data?.failed ? 'Failed' : 'Returned' }}</span></div>
<p v-if="tool.detail" class="mt-1 break-words whitespace-pre-wrap text-xs text-muted-foreground">{{ tool.detail }}</p>
<div class="flex justify-between gap-2 text-xs"><span class="font-mono">{{ tool.data?.tool }}</span><span :class="tool.data?.failed ? 'text-danger' : 'text-fg-muted'">{{ tool.data?.failed ? 'Failed' : 'Returned' }}</span></div>
<p v-if="tool.detail" class="mt-1 break-words whitespace-pre-wrap text-xs text-fg-muted">{{ tool.detail }}</p>
</li>
</ol>
<Button v-if="group.tools.length > 12" type="button" variant="link" size="xs" class="px-0" @click="expanded = !expanded">{{ expanded ? 'Show first 12' : `Show all ${group.tools.length}` }}</Button>
</div>
<p v-if="group.reports.length" class="text-xs text-muted-foreground">{{ group.reports.map((report) => describeTimelineEvent(report).detail).filter(Boolean).join(' · ') }}</p>
<p v-else-if="group.agents.length" class="text-xs text-muted-foreground">{{ group.agents.reduce((sum, agent) => sum + agent.tokens_used, 0).toLocaleString() }} tokens recorded</p>
<p v-if="group.reports.length" class="text-xs text-fg-muted">{{ group.reports.map((report) => describeTimelineEvent(report).detail).filter(Boolean).join(' · ') }}</p>
<p v-else-if="group.agents.length" class="text-xs text-fg-muted">{{ group.agents.reduce((sum, agent) => sum + agent.tokens_used, 0).toLocaleString() }} tokens recorded</p>
</section>
<section v-if="suppressed.length" class="space-y-1">
<h3 class="text-xs font-medium text-muted-foreground">Skipped in test run</h3>
<h3 class="text-xs font-medium text-fg-muted">Skipped in test run</h3>
<ul class="divide-y divide-border rounded-md border border-border">
<li v-for="(event, i) in suppressed" :key="i" class="px-3 py-2 text-xs break-words whitespace-pre-wrap">{{ event.detail }}</li>
</ul>
</section>
<section class="space-y-3">
<h3 class="text-xs font-medium text-muted-foreground">Captured changes</h3>
<h3 class="text-xs font-medium text-fg-muted">Captured changes</h3>
<p v-if="changesError" role="alert" class="text-danger">{{ changesError }}</p>
<ChangeCapture v-for="(capture, i) in captures" :key="i" :capture="capture" :task="task" />
</section>
<section class="space-y-2">
<h3 class="text-xs font-medium text-muted-foreground">Log</h3>
<h3 class="text-xs font-medium text-fg-muted">Log</h3>
<TaskLogs :state="scopedLogs" :attempt="attempt" :filterable="false" />
</section>
</div>
+3 -3
View File
@@ -379,8 +379,8 @@ function syncScroll(event: Event): void {
<div v-if="runs.length && view === 'canvas'" class="flex min-w-0 items-center gap-1">
<OptionSelect :model-value="watched" :options="runOptions" aria-label="Run shown on the canvas" class="min-w-0 max-w-64" @update:model-value="pick" />
<template v-if="watchedRun">
<RouterLink :to="`/tasks/${watchedRun.id}`" class="shrink-0 px-1 text-xs text-muted-foreground hover:text-foreground hover:underline">Open</RouterLink>
<button v-if="watchedRevision" type="button" class="shrink-0 px-1 font-mono text-xs text-muted-foreground hover:text-foreground hover:underline" title="Open the version this run used" @click="openRevision(watchedRevision.version)">v{{ watchedRevision.version }}</button>
<RouterLink :to="`/tasks/${watchedRun.id}`" class="shrink-0 px-1 text-xs text-fg-muted hover:text-foreground hover:underline">Open</RouterLink>
<button v-if="watchedRevision" type="button" class="shrink-0 px-1 font-mono text-xs text-fg-muted hover:text-foreground hover:underline" title="Open the version this run used" @click="openRevision(watchedRevision.version)">v{{ watchedRevision.version }}</button>
<TaskRowActions :task="watchedRun" class="shrink-0" @done="refresh" />
</template>
</div>
@@ -421,7 +421,7 @@ function syncScroll(event: Event): void {
<p>Could not load recent runs: {{ runsError }}</p>
<Button type="button" variant="outline" size="sm" @click="refresh">Retry runs</Button>
</div>
<p v-if="watchedRun && !watchedRun.workflow_definition_yaml" class="text-xs text-fg-muted" role="status">No workflow snapshot was recorded for this run. Showing the current definition.</p>
<p v-if="watchedRun && !watchedRun.workflow_definition_yaml" class="text-xs text-fg-muted" role="status">No workflow snapshot was recorded for this run.</p>
<!-- Kept mounted so an Archie turn started here still finishes, unlocks the
editor and loads its draft when the operator switches tabs. -->
<TabsContent value="canvas" force-mount class="space-y-2 data-[state=inactive]:hidden">
+5 -5
View File
@@ -50,10 +50,10 @@ const CHANGE_VARIANTS = { added: "default", edited: "secondary", removed: "destr
<span class="font-mono text-xs text-fg-subtle">v{{ item.version }}</span>
<Badge :variant="CHANGE_VARIANTS[item.change]">{{ item.change }}</Badge>
</span>
<span class="mt-0.5 block truncate text-xs text-muted-foreground" :title="item.at">{{ item.actor || "unknown" }} · {{ item.source || "unknown" }} · {{ ago(item.at) }}</span>
<span class="mt-0.5 block truncate text-xs text-fg-muted" :title="item.at">{{ item.actor || "unknown" }} · {{ item.source || "unknown" }} · {{ ago(item.at) }}</span>
</button>
</li>
<li v-if="!revisions.length" class="px-3 py-2 text-sm text-muted-foreground">{{ error || "No recorded changes" }}</li>
<li v-if="!revisions.length" class="px-3 py-2 text-sm text-fg-muted">{{ error || "No recorded changes" }}</li>
</ol>
<!-- Below md the list above is hidden: one select picks the revision. -->
<Select v-if="revisions.length" :model-value="String(selected)" @update:model-value="selected = Number($event)">
@@ -68,7 +68,7 @@ const CHANGE_VARIANTS = { added: "default", edited: "secondary", removed: "destr
<Button type="button" size="sm" variant="outline" class="ml-auto" :disabled="then === null || identical" :title="then === null ? 'Workflow removed' : undefined" @click="emit('restore', then!)">
<RotateCcw data-icon="inline-start" /> Restore this version</Button>
</div>
<p v-if="then === null" class="rounded-lg border border-border p-4 text-sm text-muted-foreground">Workflow removed in this revision.</p>
<p v-if="then === null" class="rounded-lg border border-border p-4 text-sm text-fg-muted">Workflow removed in this revision.</p>
<pre v-else-if="mode === 'yaml'" class="min-h-0 flex-1 overflow-auto rounded-lg border border-border py-2 font-mono text-[13px] leading-6"><code><span
v-for="(line, i) in diff"
:key="i"
@@ -77,11 +77,11 @@ const CHANGE_VARIANTS = { added: "default", edited: "secondary", removed: "destr
><span class="inline-block w-4 select-none text-fg-subtle">{{ line.kind === "add" ? "+" : line.kind === "del" ? "-" : "" }}</span>{{ line.text }}</span></code></pre>
<div v-else class="grid min-h-0 flex-1 gap-3 max-md:flex-none md:grid-cols-2">
<div class="flex min-h-0 flex-col gap-1">
<span class="text-xs font-medium text-muted-foreground">v{{ revision.version }}</span>
<span class="text-xs font-medium text-fg-muted">v{{ revision.version }}</span>
<div class="min-h-0 flex-1 max-md:h-72 max-md:flex-none"><WorkflowCanvas :yaml="then" :marks="thenMarks" /></div>
</div>
<div class="flex min-h-0 flex-col gap-1">
<span class="text-xs font-medium text-muted-foreground">Current</span>
<span class="text-xs font-medium text-fg-muted">Current</span>
<div class="min-h-0 flex-1 max-md:h-72 max-md:flex-none"><WorkflowCanvas :yaml="current" :marks="nowMarks" /></div>
</div>
</div>
+1 -1
View File
@@ -129,7 +129,7 @@ const needs = computed<{ captures?: boolean; gate_retries?: number }>(() => {
</div>
<section class="space-y-1.5">
<label for="workflow-instructions" class="text-xs font-medium text-muted-foreground">Instructions</label>
<label for="workflow-instructions" class="text-xs font-medium text-fg-muted">Instructions</label>
<Textarea
id="workflow-instructions"
:model-value="text('instructions')"