build(ui): regenerate dashboard
This commit is contained in:
13 files changed
+94
-96
No files matched your search
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{A as e,C as t,Ct as n,M as r,S as i,Tt as a,Xt as o,_t as s,b as c,dt as l,ir as u,jn as d,k as f,l as p,t as m,x as h,xn as g,y as _}from"./PageHeader.js";import{Z as v,n as y,w as b}from"./api.js";import{t as x}from"./Input.js";import{A as S,M as C,N as w,j 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=r({__name:`PersonalTokensCard`,setup(r){let a=g(!1),m=g([]),_=g(``),v=g(``),C=g(!1);async function w(e){C.value=!0;try{await e(),v.value=``}catch(e){v.value=String(e.message||e)}finally{C.value=!1}}let T=()=>w(async()=>{let e=await y.tokens();a.value=e?.available??!1,m.value=e?.tokens??[]}),I=()=>w(async()=>{_.value=(await y.createToken())?.token??``,await T()}),L=e=>w(async()=>{await y.revokeToken(e),await T()});return l(T),(r,l)=>(s(),t(`section`,E,[c(`div`,D,[l[2]||=c(`h2`,{id:`personal-tokens`,class:`font-medium`},`API tokens`,-1),a.value?(s(),h(d(b),{key:0,size:`sm`,disabled:C.value,onClick:I},{default:o(()=>[e(d(S),{"data-icon":`inline-start`}),l[1]||=f(`New token`,-1)]),_:1},8,[`disabled`])):i(``,!0)]),!a.value&&!C.value&&!v.value?(s(),t(`p`,O,`Personal tokens need a signed-in person.`)):i(``,!0),a.value?(s(),t(`p`,k,[...l[3]||=[f(`Send it as `,-1),c(`code`,null,`Authorization: Bearer <token>`,-1),f(`.`,-1)]])):i(``,!0),v.value?(s(),t(`p`,A,u(v.value),1)):i(``,!0),_.value?(s(),t(`div`,j,[l[4]||=c(`p`,{class:`mb-2 text-xs`},`Not shown again.`,-1),e(d(x),{"model-value":_.value,readonly:``,"aria-label":`New token`,onFocus:l[0]||=e=>e.target.select()},null,8,[`model-value`])])):i(``,!0),a.value&&!m.value.length&&!C.value&&!v.value?(s(),t(`p`,M,`No tokens yet.`)):i(``,!0),m.value.length?(s(),t(`ul`,N,[(s(!0),t(p,null,n(m.value,n=>(s(),t(`li`,{key:n.id,class:`flex items-center gap-3 px-4 py-2.5`},[c(`code`,P,u(n.id.slice(0,12)),1),c(`span`,F,u(new Date(n.created_at).toLocaleString()),1),e(d(b),{variant:`ghost`,size:`sm`,class:`text-danger`,disabled:C.value,onClick:e=>L(n.id)},{default:o(()=>[...l[5]||=[f(`Revoke`,-1)]]),_:1},8,[`disabled`,`onClick`])]))),128))])):i(``,!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=r({__name:`AccountPage`,setup(r){let h=g(``),S=()=>F(async()=>{h.value=(await y.recoveryCode()).code}),E=C(),D=g([]),O=g(``),k=g(!1),A=g(``),j=g(``),M=g(``),N=_(()=>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 w(!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(r,l)=>{let g=a(`RouterLink`);return s(),t(`div`,L,[e(m,{title:`Your account`}),c(`p`,R,u(d(E).status?.user?.display_name),1),r.$route.query.welcome?(s(),t(`p`,z,[l[5]||=f(`Your organisation and admin account are ready. Add a passkey below, `,-1),e(g,{class:`underline`,to:`/org/members`},{default:o(()=>[...l[3]||=[f(`add members`,-1)]]),_:1}),l[6]||=f(`, or `,-1),e(g,{class:`underline`,to:`/settings/authentication`},{default:o(()=>[...l[4]||=[f(`configure OIDC`,-1)]]),_:1}),l[7]||=f(`.`,-1)])):i(``,!0),O.value?(s(),t(`p`,B,[f(u(O.value)+` `,1),l[8]||=c(`a`,{class:`underline`,href:`/?reauth=1`},`Sign in again`,-1)])):i(``,!0),c(`section`,V,[l[14]||=c(`h2`,{class:`font-medium`},`Passkeys`,-1),c(`ul`,H,[(s(!0),t(p,null,n(D.value,n=>(s(),t(`li`,{key:n.id,class:`flex items-center gap-3 py-2 text-sm`},[c(`span`,U,u(n.name),1),e(d(b),{variant:`ghost`,size:`sm`,disabled:k.value,onClick:e=>Z(n.id)},{default:o(()=>[...l[9]||=[f(`Remove`,-1)]]),_:1},8,[`disabled`,`onClick`])]))),128))]),N.value?(s(),t(`form`,{key:0,class:`mt-3 flex flex-wrap gap-2`,onSubmit:v(X,[`prevent`])},[e(d(xLine truncated
|
||||
import{A as e,C as t,Ct as n,M as r,S as i,Tt as a,Xt as o,_t as s,b as c,dt as l,ir as u,jn as d,k as f,l as p,t as m,x as h,xn as g,y as _}from"./PageHeader.js";import{Q as v,T as y,r as b}from"./createLucideIcon.js";import{t as x}from"./Input.js";import{A as S,F as C,N as w,P 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=r({__name:`PersonalTokensCard`,setup(r){let a=g(!1),m=g([]),_=g(``),v=g(``),C=g(!1);async function w(e){C.value=!0;try{await e(),v.value=``}catch(e){v.value=String(e.message||e)}finally{C.value=!1}}let T=()=>w(async()=>{let e=await b.tokens();a.value=e?.available??!1,m.value=e?.tokens??[]}),I=()=>w(async()=>{_.value=(await b.createToken())?.token??``,await T()}),L=e=>w(async()=>{await b.revokeToken(e),await T()});return l(T),(r,l)=>(s(),t(`section`,E,[c(`div`,D,[l[2]||=c(`h2`,{id:`personal-tokens`,class:`font-medium`},`API tokens`,-1),a.value?(s(),h(d(y),{key:0,size:`sm`,disabled:C.value,onClick:I},{default:o(()=>[e(d(S),{"data-icon":`inline-start`}),l[1]||=f(`New token`,-1)]),_:1},8,[`disabled`])):i(``,!0)]),!a.value&&!C.value&&!v.value?(s(),t(`p`,O,`Personal tokens need a signed-in person.`)):i(``,!0),a.value?(s(),t(`p`,k,[...l[3]||=[f(`Send it as `,-1),c(`code`,null,`Authorization: Bearer <token>`,-1),f(`.`,-1)]])):i(``,!0),v.value?(s(),t(`p`,A,u(v.value),1)):i(``,!0),_.value?(s(),t(`div`,j,[l[4]||=c(`p`,{class:`mb-2 text-xs`},`Not shown again.`,-1),e(d(x),{"model-value":_.value,readonly:``,"aria-label":`New token`,onFocus:l[0]||=e=>e.target.select()},null,8,[`model-value`])])):i(``,!0),a.value&&!m.value.length&&!C.value&&!v.value?(s(),t(`p`,M,`No tokens yet.`)):i(``,!0),m.value.length?(s(),t(`ul`,N,[(s(!0),t(p,null,n(m.value,n=>(s(),t(`li`,{key:n.id,class:`flex items-center gap-3 px-4 py-2.5`},[c(`code`,P,u(n.id.slice(0,12)),1),c(`span`,F,u(new Date(n.created_at).toLocaleString()),1),e(d(y),{variant:`ghost`,size:`sm`,class:`text-danger`,disabled:C.value,onClick:e=>L(n.id)},{default:o(()=>[...l[5]||=[f(`Revoke`,-1)]]),_:1},8,[`disabled`,`onClick`])]))),128))])):i(``,!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=r({__name:`AccountPage`,setup(r){let h=g(``),S=()=>F(async()=>{h.value=(await b.recoveryCode()).code}),E=T(),D=g([]),O=g(``),k=g(!1),A=g(``),j=g(``),M=g(``),N=_(()=>w(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 C(!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(r,l)=>{let g=a(`RouterLink`);return s(),t(`div`,L,[e(m,{title:`Your account`}),c(`p`,R,u(d(E).status?.user?.display_name),1),r.$route.query.welcome?(s(),t(`p`,z,[l[5]||=f(`Your organisation and admin account are ready. Add a passkey below, `,-1),e(g,{class:`underline`,to:`/org/members`},{default:o(()=>[...l[3]||=[f(`add members`,-1)]]),_:1}),l[6]||=f(`, or `,-1),e(g,{class:`underline`,to:`/settings/authentication`},{default:o(()=>[...l[4]||=[f(`configure OIDC`,-1)]]),_:1}),l[7]||=f(`.`,-1)])):i(``,!0),O.value?(s(),t(`p`,B,[f(u(O.value)+` `,1),l[8]||=c(`a`,{class:`underline`,href:`/?reauth=1`},`Sign in again`,-1)])):i(``,!0),c(`section`,V,[l[14]||=c(`h2`,{class:`font-medium`},`Passkeys`,-1),c(`ul`,H,[(s(!0),t(p,null,n(D.value,n=>(s(),t(`li`,{key:n.id,class:`flex items-center gap-3 py-2 text-sm`},[c(`span`,U,u(n.name),1),e(d(y),{variant:`ghost`,size:`sm`,disabled:k.value,onClick:e=>Z(n.id)},{default:o(()=>[...l[9]||=[f(`Remove`,-1)]]),_:1},8,[`disabled`,`onClick`])]))),128))]),N.value?(s(),t(`form`,{key:0,class:`mt-3 flex flex-wrap gap-2`,onSubmit:v(X,[`preve
Line truncated
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{Z as h,w as g}from"./api.js";import{t as _}from"./Input.js";import{b as v,g as y,m as b,p as x,r as S,v as C,x as w,y as T}from"./index.js";var E={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},D=`agent-profiles`,O=n({__name:`AgentProfilesPage`,setup(n){let O=w();s(O.load);let k=m(()=>O.drafts[D]?.value),A=p(``),j=p(``),M=m(()=>O.changesFor(D).length>0),N=m(()=>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(n,s)=>(a(),t(`div`,null,[e(d,{title:`Agent profiles`},{default:i(()=>[e(T,{kinds:[D]},null,8,[`kinds`])]),_:1}),e(v,{kind:D,class:`mb-4`}),l(O).catalogError||l(O).pageErrorFor(D)?(a(),t(`p`,E,c(l(O).catalogError||l(O).pageErrorFor(D)),1)):r(``,!0),o(`form`,{class:`mb-4 flex flex-wrap gap-2`,onSubmit:h(P,[`prevent`])},[e(l(_),{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`]),e(l(g),{type:`submit`,disabled:M.value||!A.value.trim()||!!k.value?.[A.value.trim()]},{default:i(()=>[...s[3]||=[u(`Add profile`,-1)]]),_:1},8,[`disabled`])],32),Object.keys(k.value??{}).length?r(``,!0):(a(),f(l(y),{key:1},{default:i(()=>[e(l(b),null,{default:i(()=>[e(l(x),null,{default:i(()=>[...s[4]||=[u(`No agent profiles`,-1)]]),_:1})]),_:1})]),_:1})),e(S,{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:i(({item:[t,n]})=>[e(l(C),{label:`Image`,for:`${t}-image`},{default:i(()=>[e(l(_),{id:`${t}-image`,modelValue:n.image,"onUpdate:modelValue":e=>n.image=e,placeholder:`Container image`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(l(C),{label:`Kit`,for:`${t}-kit`,hint:`Pinned digest. Used only when Image is empty.`},{default:i(()=>[e(l(_),{id:`${t}-kit`,modelValue:n.kit,"onUpdate:modelValue":e=>n.kit=e,placeholder:`registry/kit@sha256:…`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(l(C),{label:`Adapter`,for:`${t}-adapter`},{default:i(()=>[e(l(_),{id:`${t}-adapter`,modelValue:n.adapter,"onUpdate:modelValue":e=>n.adapter=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(l(C),{label:`Tools`,for:`${t}-tools`,hint:`Comma-separated tool names.`},{default:i(()=>[e(l(_),{id:`${t}-tools`,"model-value":(n.tools??[]).join(`, `),"onUpdate:modelValue":e=>F(n,e)},null,8,[`id`,`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`for`])]),_:1},8,[`open`,`items`,`title`])]))}});export{O as default};
|
||||
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{Q as h,T as g}from"./createLucideIcon.js";import{t as _}from"./Input.js";import{b as v,g as y,m as b,p as x,r as S,v as C,x as w,y as T}from"./index.js";var E={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},D=`agent-profiles`,O=n({__name:`AgentProfilesPage`,setup(n){let O=w();s(O.load);let k=m(()=>O.drafts[D]?.value),A=p(``),j=p(``),M=m(()=>O.changesFor(D).length>0),N=m(()=>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(n,s)=>(a(),t(`div`,null,[e(d,{title:`Agent profiles`},{default:i(()=>[e(T,{kinds:[D]},null,8,[`kinds`])]),_:1}),e(v,{kind:D,class:`mb-4`}),l(O).catalogError||l(O).pageErrorFor(D)?(a(),t(`p`,E,c(l(O).catalogError||l(O).pageErrorFor(D)),1)):r(``,!0),o(`form`,{class:`mb-4 flex flex-wrap gap-2`,onSubmit:h(P,[`prevent`])},[e(l(_),{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`]),e(l(g),{type:`submit`,disabled:M.value||!A.value.trim()||!!k.value?.[A.value.trim()]},{default:i(()=>[...s[3]||=[u(`Add profile`,-1)]]),_:1},8,[`disabled`])],32),Object.keys(k.value??{}).length?r(``,!0):(a(),f(l(y),{key:1},{default:i(()=>[e(l(b),null,{default:i(()=>[e(l(x),null,{default:i(()=>[...s[4]||=[u(`No agent profiles`,-1)]]),_:1})]),_:1})]),_:1})),e(S,{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:i(({item:[t,n]})=>[e(l(C),{label:`Image`,for:`${t}-image`},{default:i(()=>[e(l(_),{id:`${t}-image`,modelValue:n.image,"onUpdate:modelValue":e=>n.image=e,placeholder:`Container image`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(l(C),{label:`Kit`,for:`${t}-kit`,hint:`Pinned digest. Used only when Image is empty.`},{default:i(()=>[e(l(_),{id:`${t}-kit`,modelValue:n.kit,"onUpdate:modelValue":e=>n.kit=e,placeholder:`registry/kit@sha256:…`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(l(C),{label:`Adapter`,for:`${t}-adapter`},{default:i(()=>[e(l(_),{id:`${t}-adapter`,modelValue:n.adapter,"onUpdate:modelValue":e=>n.adapter=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(l(C),{label:`Tools`,for:`${t}-tools`,hint:`Comma-separated tool names.`},{default:i(()=>[e(l(_),{id:`${t}-tools`,"model-value":(n.tools??[]).join(`, `),"onUpdate:modelValue":e=>F(n,e)},null,8,[`id`,`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`for`])]),_:1},8,[`open`,`items`,`title`])]))}});export{O as default};
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{A as e,C as t,M as n,S as r,Tt as i,Xt as a,_t as o,b as s,dt as c,ir as l,jn as u,k as d,t as f,xn as p}from"./PageHeader.js";import{Z 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=n({__name:`AuthenticationPage`,setup(n){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(n,c)=>{let p=i(`RouterLink`);return o(),t(`div`,v,[e(f,{title:`Authentication`}),j.value?(o(),t(`p`,y,[d(l(j.value)+` `,1),c[4]||=s(`a`,{class:`underline`,href:`/?reauth=1`},`Sign in again`,-1)])):r(``,!0),A.value?(o(),t(`form`,{key:1,class:`space-y-6`,onSubmit:m(P,[`prevent`])},[s(`section`,b,[c[6]||=s(`h2`,{class:`font-medium`},`Instance URL`,-1),s(`label`,x,[c[5]||=d(`Public address`,-1),e(u(_),{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]||=s(`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)]),s(`section`,S,[c[14]||=s(`h2`,{class:`font-medium`},`OpenID Connect`,-1),c[15]||=s(`p`,{class:`text-sm text-fg-muted`},`Register a public client with authorization code flow and PKCE. Local accounts remain available.`,-1),s(`label`,C,[c[8]||=d(`Issuer URL`,-1),e(u(_),{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`])]),s(`label`,w,[c[9]||=d(`Client ID`,-1),e(u(_),{id:`oidc-client`,modelValue:k.value.oidc_client_id,"onUpdate:modelValue":c[2]||=e=>k.value.oidc_client_id=e},null,8,[`modelValue`])]),s(`label`,T,[c[10]||=d(`Access token audience`,-1),e(u(_),{id:`oidc-audience`,modelValue:k.value.oidc_audience,"onUpdate:modelValue":c[3]||=e=>k.value.oidc_audience=e},null,8,[`modelValue`])]),s(`p`,E,`Redirect URI: `+l(k.value.public_url.replace(/\/$/,``))+`/oauth2/callback`,1),s(`p`,D,[c[12]||=d(`Add permitted people by their verified email or provider subject in `,-1),e(p,{class:`underline`,to:`/org/members`},{default:a(()=>[...c[11]||=[d(`Organisation → Members`,-1)]]),_:1}),c[13]||=d(`. Clear the OIDC fields to disable provider sign-in.`,-1)])]),N.value?(o(),t(`p`,O,`Authentication settings saved.`)):r(``,!0),e(u(g),{type:`submit`,disabled:M.value},{default:a(()=>[...c[16]||=[d(`Save`,-1)]]),_:1},8,[`disabled`])],32)):r(``,!0)])}}});export{k as default};
|
||||
import{A as e,C as t,M as n,S as r,Tt as i,Xt as a,_t as o,b as s,dt as c,ir as l,jn as u,k as d,t as f,x as p,xn as m,y as h}from"./PageHeader.js";import{Q as g,T as _,r as v}from"./createLucideIcon.js";import{t as y}from"./Input.js";import{M as b,j as x}from"./index.js";var S={class:`max-w-2xl`},C={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},w={class:`space-y-3 rounded-lg border border-border bg-card p-5`},T={for:`instance-url`,class:`block space-y-1 text-sm`},E={class:`space-y-3 rounded-lg border border-border bg-card p-5`},D={for:`oidc-issuer`,class:`block space-y-1 text-sm`},O={for:`oidc-client`,class:`block space-y-1 text-sm`},k={for:`oidc-audience`,class:`block space-y-1 text-sm`},A={class:`space-y-1 text-sm`},j={class:`flex items-center gap-2`},M={class:`min-w-0 flex-1 select-all break-all rounded-md border border-border bg-muted px-2 py-1.5 font-mono text-xs`},N={class:`text-xs text-fg-muted`},P={class:`flex items-center justify-end gap-2 border-t border-border pt-3`},F=n({__name:`AuthenticationPage`,setup(n){let F=m({public_url:``,oidc_issuer:``,oidc_audience:``,oidc_client_id:``}),I=m(!1),L=m(``),R=m(!1),z=m(!1);c(async()=>{try{F.value=await v.authentication(),I.value=!0}catch(e){L.value=String(e.message||e)}});let B=h(()=>`${F.value.public_url.replace(/\/$/,``)}/oauth2/callback`),V=m(!1);async function H(){await navigator.clipboard.writeText(B.value),V.value=!0,setTimeout(()=>V.value=!1,1500)}async function U(){R.value=!0,L.value=``,z.value=!1;try{await v.saveAuthentication(F.value),z.value=!0}catch(e){L.value=String(e.message||e)}finally{R.value=!1}}return(n,c)=>{let m=i(`RouterLink`);return o(),t(`div`,S,[e(f,{title:`Authentication`}),L.value?(o(),t(`p`,C,[d(l(L.value)+` `,1),c[4]||=s(`a`,{class:`underline`,href:`/?reauth=1`},`Sign in again`,-1)])):r(``,!0),I.value?(o(),t(`form`,{key:1,class:`space-y-4`,onSubmit:g(U,[`prevent`])},[s(`section`,w,[c[6]||=s(`h2`,{class:`font-medium`},`Instance URL`,-1),s(`label`,T,[c[5]||=d(`Public address`,-1),e(u(y),{id:`instance-url`,modelValue:F.value.public_url,"onUpdate:modelValue":c[0]||=e=>F.value.public_url=e,type:`url`,required:``},null,8,[`modelValue`])]),c[7]||=s(`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)]),s(`section`,E,[c[16]||=s(`h2`,{class:`font-medium`},`OpenID Connect`,-1),s(`label`,D,[c[8]||=d(`Issuer URL`,-1),e(u(y),{id:`oidc-issuer`,modelValue:F.value.oidc_issuer,"onUpdate:modelValue":c[1]||=e=>F.value.oidc_issuer=e,type:`url`,placeholder:`https://identity.example.com`},null,8,[`modelValue`])]),s(`label`,O,[c[9]||=d(`Client ID`,-1),e(u(y),{id:`oidc-client`,modelValue:F.value.oidc_client_id,"onUpdate:modelValue":c[2]||=e=>F.value.oidc_client_id=e},null,8,[`modelValue`])]),s(`label`,k,[c[10]||=d(`Access token audience`,-1),e(u(y),{id:`oidc-audience`,modelValue:F.value.oidc_audience,"onUpdate:modelValue":c[3]||=e=>F.value.oidc_audience=e},null,8,[`modelValue`])]),s(`div`,A,[c[11]||=d(`Redirect URI `,-1),s(`div`,j,[s(`code`,M,l(B.value),1),e(u(_),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Copy redirect URI`,title:`Copy redirect URI`,onClick:H},{default:a(()=>[V.value?(o(),p(u(b),{key:0})):(o(),p(u(x),{key:1}))]),_:1})])]),s(`p`,N,[c[13]||=d(`Add permitted people in `,-1),e(m,{class:`underline`,to:`/org/members`},{default:a(()=>[...c[12]||=[d(`Organisation → Members`,-1)]]),_:1}),c[14]||=d(`.`,-1)]),s(`div`,P,[z.value?(o(),p(u(b),{key:0,role:`status`,"aria-label":`Saved`,class:`size-4 text-fg-muted`})):r(``,!0),e(u(_),{type:`submit`,disabled:R.value},{default:a(()=>[...c[15]||=[d(`Save`,-1)]]),_:1},8,[`disabled`])])])],32)):r(``,!0)])}}});export{F as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,dt as o,ir as s,jn as c,k as l,t as u,x as d,xn as f,y as p}from"./PageHeader.js";import{w as m}from"./api.js";import{t as h}from"./Input.js";import{_ as g,b as _,g as v,m as y,p as b,r as x,v as S,x as C,y as w}from"./index.js";var T={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},E=`credential-bindings`,D=n({__name:`CredentialBindingsPage`,setup(n){let D=C();o(D.load);let O=p(()=>D.drafts[E]?.value),k=f(``),A=p(()=>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(n,o)=>(a(),t(`div`,null,[e(u,{title:`Credential bindings`},{default:i(()=>[e(w,{kinds:[E]},null,8,[`kinds`]),e(c(m),{disabled:A.value,onClick:j},{default:i(()=>[...o[2]||=[l(`Add binding`,-1)]]),_:1},8,[`disabled`])]),_:1}),e(_,{kind:E,class:`mb-4`}),c(D).catalogError||c(D).pageErrorFor(E)?(a(),t(`p`,T,s(c(D).catalogError||c(D).pageErrorFor(E)),1)):r(``,!0),O.value?.length?r(``,!0):(a(),d(c(v),{key:1},{default:i(()=>[e(c(y),null,{default:i(()=>[e(c(b),null,{default:i(()=>[...o[3]||=[l(`No credential bindings`,-1)]]),_:1})]),_:1})]),_:1})),e(x,{open:k.value,"onUpdate:open":o[0]||=e=>k.value=e,items:O.value??[],title:e=>e.service||`New binding`,"remove-label":`Remove`,mono:``,onRemove:o[1]||=e=>O.value.splice(e,1)},{default:i(({item:t,index:n})=>[e(c(S),{label:`Service`,for:`binding-${n}-service`},{default:i(()=>[e(c(h),{id:`binding-${n}-service`,modelValue:t.service,"onUpdate:modelValue":e=>t.service=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(c(S),{label:`Organisation`,for:`binding-${n}-org`,hint:`Empty uses the default organisation.`},{default:i(()=>[e(c(h),{id:`binding-${n}-org`,modelValue:t.org,"onUpdate:modelValue":e=>t.org=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(c(S),{label:`Secret`},{default:i(()=>[e(g,{modelValue:t.secret,"onUpdate:modelValue":e=>t.secret=e,"id-prefix":`binding-${n}-secret`},null,8,[`modelValue`,`onUpdate:modelValue`,`id-prefix`])]),_:2},1024)]),_:1},8,[`open`,`items`,`title`])]))}});export{D as default};
|
||||
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,dt as o,ir as s,jn as c,k as l,t as u,x as d,xn as f,y as p}from"./PageHeader.js";import{T as m}from"./createLucideIcon.js";import{t as h}from"./Input.js";import{_ as g,b as _,g as v,m as y,p as b,r as x,v as S,x as C,y as w}from"./index.js";var T={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},E=`credential-bindings`,D=n({__name:`CredentialBindingsPage`,setup(n){let D=C();o(D.load);let O=p(()=>D.drafts[E]?.value),k=f(``),A=p(()=>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(n,o)=>(a(),t(`div`,null,[e(u,{title:`Credential bindings`},{default:i(()=>[e(w,{kinds:[E]},null,8,[`kinds`]),e(c(m),{disabled:A.value,onClick:j},{default:i(()=>[...o[2]||=[l(`Add binding`,-1)]]),_:1},8,[`disabled`])]),_:1}),e(_,{kind:E,class:`mb-4`}),c(D).catalogError||c(D).pageErrorFor(E)?(a(),t(`p`,T,s(c(D).catalogError||c(D).pageErrorFor(E)),1)):r(``,!0),O.value?.length?r(``,!0):(a(),d(c(v),{key:1},{default:i(()=>[e(c(y),null,{default:i(()=>[e(c(b),null,{default:i(()=>[...o[3]||=[l(`No credential bindings`,-1)]]),_:1})]),_:1})]),_:1})),e(x,{open:k.value,"onUpdate:open":o[0]||=e=>k.value=e,items:O.value??[],title:e=>e.service||`New binding`,"remove-label":`Remove`,mono:``,onRemove:o[1]||=e=>O.value.splice(e,1)},{default:i(({item:t,index:n})=>[e(c(S),{label:`Service`,for:`binding-${n}-service`},{default:i(()=>[e(c(h),{id:`binding-${n}-service`,modelValue:t.service,"onUpdate:modelValue":e=>t.service=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(c(S),{label:`Organisation`,for:`binding-${n}-org`,hint:`Empty uses the default organisation.`},{default:i(()=>[e(c(h),{id:`binding-${n}-org`,modelValue:t.org,"onUpdate:modelValue":e=>t.org=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(c(S),{label:`Secret`},{default:i(()=>[e(g,{modelValue:t.secret,"onUpdate:modelValue":e=>t.secret=e,"id-prefix":`binding-${n}-secret`},null,8,[`modelValue`,`onUpdate:modelValue`,`id-prefix`])]),_:2},1024)]),_:1},8,[`open`,`items`,`title`])]))}});export{D as default};
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{i as e,n as t,r as n,t as r}from"./alert.js";import{A as i,C as a,Ct as o,M as s,S as c,Xt as l,_t as u,b as d,dt as f,ir as p,jn as m,k as h,l as g,st as _,t as v,x as y,xn as b}from"./PageHeader.js";import{n as x,t as S,w as ee}from"./api.js";import{C,D as w,E as T,O as E,T as D,a as O,c as k,d as A,f as j,g as M,i as N,k as P,l as F,m as I,n as L,o as R,p as z,s as B,t as V,u as H,w 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=b(null),r=b(`connecting`),i=null,o=null,s=null,l=null;function p(){try{s?.fit()}catch{}}return f(()=>{let e=n.value;if(!e)return;i=new L({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),s=new V,i.loadAddon(s),i.open(e),p(),i.focus();let a=new WebSocket(G(t.profile,window.location,i?.cols??80,i?.rows??24));o=a,a.binaryType=`arraybuffer`,a.onopen=()=>{r.value=`open`},a.onmessage=e=>{i&&(typeof e.data==`string`?i.write(e.data):i.write(new Uint8Array(e.data)))},a.onerror=()=>{r.value=`failed`},a.onclose=()=>{r.value=`closed`},i.onData(e=>{a.readyState===WebSocket.OPEN&&a.send(e)}),l=new ResizeObserver(p),l.observe(e)}),_(()=>{l?.disconnect(),l=null,o?.close(),o=null,i?.dispose(),i=null,s=null}),(e,t)=>(u(),a(`div`,K,[r.value===`open`?c(``,!0):(u(),a(`p`,q,[r.value===`connecting`?(u(),a(g,{key:0},[h(`Connecting…`)],64)):r.value===`closed`?(u(),a(g,{key:1},[h(`The terminal session ended.`)],64)):(u(),a(g,{key:2},[h(`Could not open the setup terminal.`)],64))])),d(`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 _=b(null),L=b(!0),V=b(null),G=b(!1),K=b(``),q=b(!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`}};f(Q);async function Q(){L.value=!0,V.value=null,G.value=!1;try{let e=await x.harnessBindings();_.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},K.value=_.value.profiles[0]??``}catch(e){let t=e instanceof S?e.status:void 0;t===501||t===503?G.value=!0:V.value=e instanceof Error?e.message:String(e),_.value=null}finally{L.value=!1}}function te(){_.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,f)=>(u(),a(`div`,null,[i(v,{title:`Harness`}),V.value?(u(),y(m(n),{key:0,variant:`destructive`,class:`mb-4`},{default:l(()=>[i(m(r),null,{default:l(()=>[...f[1]||=[h(`Could not load the harness`,-1)]]),_:1}),i(m(t),null,{default:l(()=>[h(p(V.value),1)]),_:1})]),_:1})):c(``,!0),L.value?(u(),a(`div`,Y,[i(m(N),{class:`h-24 w-full`}),i(m(N),{class:`h-40 w-full`})])):G.value?(u(),y(m(M),{key:2},{default:l(()=>[i(m(I),null,{default:l(()=>[i(m(z),null,{default:l(()=>[...f[2]||=[h(`Harness bindings are not configured`,-1)]]),_:1})]),_:1})]),_:1})):_.value?(u(),a(g,{key:3},[_.value.terminal?(u(),y(m(j),{key:1,class:`mb-4`},{default:l(()=>[i(m(A),{class:`flex flex-wrap items-end gap-3`},{default:l(()=>[d(`div`,X,[i(m(C),{for:`harness-profile`,class:`text-fg-muted`},{default:l(()=>[...f[5]||=[h(`Profile`,-1)]]),_:1}),i(m(P),{modelValue:K.value,"onUpdate:modelValue":f[0]||=e=>K.value=e,disabled:!_.value.profiles.length},{default:l(()=>[i(m(D),{id:`harness-profile`,size:`sm`,class:`min-w-48`},{default:l(()=>[i(m(U),{placeholder:`No profiles configured`})]),_:1}),i(m(E),null,{default:l(()=>[i(m(w),null,{default:l(()=>[(u(!0),a(g,null,o(_.value.profiles,e=>(u(),y(m(T),{key:e,value:e},{default:l(()=>[h(p(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`modelValue`,`disabled`])]),i(m(ee),{disabled:!K.value,onClick:te},{default:l(()=>[...f[6]||=[h(`Open setup terminal`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})):(u(),y(m(n),{key:0,class:`mb-4`},{default:l(()=>[i(m(r),null,{default:l(()=>[...f[3]||=[h(`Setup terminal unavailable`,-1)]]),_:1}),i(m(t),null,{default:l(()=>[...f[4]||=[h(`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?(u(),y(m(j),{key:2,class:`mb-4`},{default:l(()=>[i(m(A),{class:`h-96`},{default:l(()Line truncated
|
||||
import{i as e,n as t,r as n,t as r}from"./alert.js";import{A as i,C as a,Ct as o,M as s,S as c,Xt as l,_t as u,b as d,dt as f,ir as p,jn as m,k as h,l as g,st as _,t as v,x as y,xn as b}from"./PageHeader.js";import{T as x,n as S,r as ee}from"./createLucideIcon.js";import{C,D as w,E as T,O as E,T as D,a as O,c as k,d as A,f as j,g as M,i as N,k as P,l as F,m as I,n as L,o as R,p as z,s as B,t as V,u as H,w 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=b(null),r=b(`connecting`),i=null,o=null,s=null,l=null;function p(){try{s?.fit()}catch{}}return f(()=>{let e=n.value;if(!e)return;i=new L({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),s=new V,i.loadAddon(s),i.open(e),p(),i.focus();let a=new WebSocket(G(t.profile,window.location,i?.cols??80,i?.rows??24));o=a,a.binaryType=`arraybuffer`,a.onopen=()=>{r.value=`open`},a.onmessage=e=>{i&&(typeof e.data==`string`?i.write(e.data):i.write(new Uint8Array(e.data)))},a.onerror=()=>{r.value=`failed`},a.onclose=()=>{r.value=`closed`},i.onData(e=>{a.readyState===WebSocket.OPEN&&a.send(e)}),l=new ResizeObserver(p),l.observe(e)}),_(()=>{l?.disconnect(),l=null,o?.close(),o=null,i?.dispose(),i=null,s=null}),(e,t)=>(u(),a(`div`,K,[r.value===`open`?c(``,!0):(u(),a(`p`,q,[r.value===`connecting`?(u(),a(g,{key:0},[h(`Connecting…`)],64)):r.value===`closed`?(u(),a(g,{key:1},[h(`The terminal session ended.`)],64)):(u(),a(g,{key:2},[h(`Could not open the setup terminal.`)],64))])),d(`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 _=b(null),L=b(!0),V=b(null),G=b(!1),K=b(``),q=b(!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`}};f(Q);async function Q(){L.value=!0,V.value=null,G.value=!1;try{let e=await ee.harnessBindings();_.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},K.value=_.value.profiles[0]??``}catch(e){let t=e instanceof S?e.status:void 0;t===501||t===503?G.value=!0:V.value=e instanceof Error?e.message:String(e),_.value=null}finally{L.value=!1}}function te(){_.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,f)=>(u(),a(`div`,null,[i(v,{title:`Harness`}),V.value?(u(),y(m(n),{key:0,variant:`destructive`,class:`mb-4`},{default:l(()=>[i(m(r),null,{default:l(()=>[...f[1]||=[h(`Could not load the harness`,-1)]]),_:1}),i(m(t),null,{default:l(()=>[h(p(V.value),1)]),_:1})]),_:1})):c(``,!0),L.value?(u(),a(`div`,Y,[i(m(N),{class:`h-24 w-full`}),i(m(N),{class:`h-40 w-full`})])):G.value?(u(),y(m(M),{key:2},{default:l(()=>[i(m(I),null,{default:l(()=>[i(m(z),null,{default:l(()=>[...f[2]||=[h(`Harness bindings are not configured`,-1)]]),_:1})]),_:1})]),_:1})):_.value?(u(),a(g,{key:3},[_.value.terminal?(u(),y(m(j),{key:1,class:`mb-4`},{default:l(()=>[i(m(A),{class:`flex flex-wrap items-end gap-3`},{default:l(()=>[d(`div`,X,[i(m(C),{for:`harness-profile`,class:`text-fg-muted`},{default:l(()=>[...f[5]||=[h(`Profile`,-1)]]),_:1}),i(m(P),{modelValue:K.value,"onUpdate:modelValue":f[0]||=e=>K.value=e,disabled:!_.value.profiles.length},{default:l(()=>[i(m(D),{id:`harness-profile`,size:`sm`,class:`min-w-48`},{default:l(()=>[i(m(U),{placeholder:`No profiles configured`})]),_:1}),i(m(E),null,{default:l(()=>[i(m(w),null,{default:l(()=>[(u(!0),a(g,null,o(_.value.profiles,e=>(u(),y(m(T),{key:e,value:e},{default:l(()=>[h(p(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`modelValue`,`disabled`])]),i(m(x),{disabled:!K.value,onClick:te},{default:l(()=>[...f[6]||=[h(`Open setup terminal`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})):(u(),y(m(n),{key:0,class:`mb-4`},{default:l(()=>[i(m(r),null,{default:l(()=>[...f[3]||=[h(`Setup terminal unavailable`,-1)]]),_:1}),i(m(t),null,{default:l(()=>[...f[4]||=[h(`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?(u(),y(m(j),{key:2,class:`mb-4`},{default:l(()=>[i(m(A),{class:`h-96`},Line truncated
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{B as e,C as t,G as n,Gt as r,Kt as i,M as a,Qt as o,_t as s,dt as c,er as l,gt as u,it as d,jn as f,kn as p,n as m,pn as h,wn as g,xn as _,y as v}from"./PageHeader.js";import{J as y,S 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 t=p(e);return t?.$el??t}function F(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=v(()=>{let t=j(p(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return b(()=>[n.value?.map(e=>P(e))??[N].filter(e=>e!=null),j(p(n.value?e[1]:e[0])),j(f(n.value?e[2]:e[1])),p(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=O(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function I(){let t=g(!1),n=e();return n&&c(()=>{t.value=!0},n),t}function L(e){let t=I();return v(()=>(t.value,!!e()))}var R=Symbol(`vueuse-ssr-width`);function z(){let e=n()?C(R,null):null;return typeof e==`number`?e:void 0}function B(e,t={}){let{window:n=N,ssrWidth:r=z()}=t,a=L(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),o=g(typeof r==`number`),s=g(),c=g(!1);return i(()=>{if(o.value){o.value=!a.value;let t=p(e).split(`,`);c.value=t.some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||i);return n&&a&&(a=r>=T(n[1])),i&&a&&(a=r<=T(i[1])),t?!a:a})}else a.value&&(s.value=n.matchMedia(p(e)),c.value=s.value.matches)}),F(s,`change`,e=>{c.value=e.matches},{passive:!0}),v(()=>c.value)}var V={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function H(e,t={}){function n(t,n){let r=p(e[p(t)]);return n!=null&&(r=A(r,n)),typeof r==`number`&&(r=`${r}px`),r}let{window:r=N,strategy:i=`min-width`,ssrWidth:a=z()}=t,o=typeof a==`number`,s=o?g(!1):{value:!0};o&&M(()=>s.value=!!r);function c(e,t){return!s.value&&o?e===`min`?a>=T(t):a<=T(t):r?r.matchMedia(`(${e}-width: ${t})`).matches:!1}let l=e=>B(()=>`(min-width: ${n(e)})`,t),u=e=>B(()=>`(max-width: ${n(e)})`,t),d=Object.keys(e).reduce((e,t)=>(Object.defineProperty(e,t,{get:()=>i===`min-width`?l(t):u(t),enumerable:!0,configurable:!0}),e),{});function f(){let t=Object.keys(e).map(e=>[e,d[e],T(n(e))]).sort((e,t)=>e[2]-t[2]);return v(()=>t.filter(([,e])=>e.value).map(([e])=>e))}return Object.assign(d,{greaterOrEqual:l,smallerOrEqual:u,greater(e){return B(()=>`(min-width: ${n(e,.1)})`,t)},smaller(e){return B(()=>`(max-width: ${n(e,-.1)})`,t)},between(e,r){return B(()=>`(min-width: ${n(e)}) and (max-width: ${n(r,-.1)})`,t)},isGreater(e){return c(`min`,n(e,.1))},isGreaterOrEqual(e){return c(`min`,n(e))},isSmaller(e){return c(`max`,n(e,-.1))},isSmallerOrEqual(e){return c(`max`,n(e))},isInBetween(e,t){return c(`min`,n(e))&&c(`max`,n(t,-.1))},current:f,active(){let e=f();return v(()=>e.value.length===0?``:e.value.at(i===`min-width`?-1:0))}})}function U(e){return JSON.parse(JSON.stringify(e))}function W(t){let n=e(),r=S(()=>null,()=>t?P(t):n.proxy.$el);return u(r.trigger),c(r.trigger),r}function G(e){let t=B(`(prefers-reduced-motion: reduce)`,e);return v(()=>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,t,n){let r=p(e),i=p(t);if(typeof r==`number`&&typeof i==`number`)return q(r,i,n);if(Array.isArray(r)&&Array.isArray(i))return r.map((e,t)=>q(e,p(i[t]),n));throw TypeError(`Unknown transition type, specify an interpolation function.`)}function Y(e){return typeof e==`function`?e:p(e)??D}function X(e,t,n,r={}){let{window:i=N}=r,a=p(t),o=p(n),s=p(r.duration)??1e3,c=Date.now(),l=Date.now()+s,u=typeof r.interpolation==`function`?r.interpolation:J,d=r.easing===void 0?Y(r.transition):Y(r.easing),f=typeof d==`function`?d:K(d);return new Promise(t=>{e.value=a;let n=()=>{if(r.abort?.call(r)){t();return}let d=Date.now(),p=f((d-c)/s);e.value=u(a,o,p),d<l?i?.requestAnimationFrame(n):(e.value=o,t())};n()})}function Z(e,t={}){let n=0,i=()=>{let n=p(e);return t.interpolation===void 0&&Array.isArray(n)?n.map(p):n},a=g(i());return r(i,async e=>{var r,i;if(p(t.disabled))return;let o=++n;t.delay&&await E(p(t.delay)),o===n&&((r=t.onStarted)==null||r.call(t),await X(a,a.value,e,{...t,abort:()=>o!==n||t.abort?.call(t)}),(i=t.onFinished)==null||i.call(t))},{deep:!0}),r(()=>p(t.disabled),e=>{e&&(n++,a.value=i())}),x(()=>{n++}),v(()=>p(t.disabled)?i():a.value)}function Q(t,n,i,a={}){var o,s;let{clone:c=!1,passive:l=!1,eventName:u,deep:f=!1,defaultValue:p,shouldEmit:m}=a,h=e(),g=i||h?.emit||(h==null||(o=h.$emit)==null?void 0:o.bind(h))||(h==null||(s=h.proxy)==null||(s=s.$emit)==nuLine truncated
|
||||
import{B as e,C as t,G as n,Gt as r,Kt as i,M as a,Qt as o,_t as s,dt as c,er as l,gt as u,it as d,jn as f,kn as p,n as m,pn as h,wn as g,xn as _,y as v}from"./PageHeader.js";import{C as y,Y as b,_ as x,b 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,x as j,y as M}from"./createLucideIcon.js";var N=k?window:void 0;k&&window.document,k&&window.navigator,k&&window.location;function P(e){let t=p(e);return t?.$el??t}function F(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=v(()=>{let t=M(p(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return y(()=>[n.value?.map(e=>P(e))??[N].filter(e=>e!=null),M(p(n.value?e[1]:e[0])),M(f(n.value?e[2]:e[1])),p(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=E(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function I(){let t=g(!1),n=e();return n&&c(()=>{t.value=!0},n),t}function L(e){let t=I();return v(()=>(t.value,!!e()))}var R=Symbol(`vueuse-ssr-width`);function z(){let e=n()?w(R,null):null;return typeof e==`number`?e:void 0}function B(e,t={}){let{window:n=N,ssrWidth:r=z()}=t,a=L(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),o=g(typeof r==`number`),s=g(),c=g(!1);return i(()=>{if(o.value){o.value=!a.value;let t=p(e).split(`,`);c.value=t.some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||i);return n&&a&&(a=r>=x(n[1])),i&&a&&(a=r<=x(i[1])),t?!a:a})}else a.value&&(s.value=n.matchMedia(p(e)),c.value=s.value.matches)}),F(s,`change`,e=>{c.value=e.matches},{passive:!0}),v(()=>c.value)}var V={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function H(e,t={}){function n(t,n){let r=p(e[p(t)]);return n!=null&&(r=C(r,n)),typeof r==`number`&&(r=`${r}px`),r}let{window:r=N,strategy:i=`min-width`,ssrWidth:a=z()}=t,o=typeof a==`number`,s=o?g(!1):{value:!0};o&&S(()=>s.value=!!r);function c(e,t){return!s.value&&o?e===`min`?a>=x(t):a<=x(t):r?r.matchMedia(`(${e}-width: ${t})`).matches:!1}let l=e=>B(()=>`(min-width: ${n(e)})`,t),u=e=>B(()=>`(max-width: ${n(e)})`,t),d=Object.keys(e).reduce((e,t)=>(Object.defineProperty(e,t,{get:()=>i===`min-width`?l(t):u(t),enumerable:!0,configurable:!0}),e),{});function f(){let t=Object.keys(e).map(e=>[e,d[e],x(n(e))]).sort((e,t)=>e[2]-t[2]);return v(()=>t.filter(([,e])=>e.value).map(([e])=>e))}return Object.assign(d,{greaterOrEqual:l,smallerOrEqual:u,greater(e){return B(()=>`(min-width: ${n(e,.1)})`,t)},smaller(e){return B(()=>`(max-width: ${n(e,-.1)})`,t)},between(e,r){return B(()=>`(min-width: ${n(e)}) and (max-width: ${n(r,-.1)})`,t)},isGreater(e){return c(`min`,n(e,.1))},isGreaterOrEqual(e){return c(`min`,n(e))},isSmaller(e){return c(`max`,n(e,-.1))},isSmallerOrEqual(e){return c(`max`,n(e))},isInBetween(e,t){return c(`min`,n(e))&&c(`max`,n(t,-.1))},current:f,active(){let e=f();return v(()=>e.value.length===0?``:e.value.at(i===`min-width`?-1:0))}})}function U(e){return JSON.parse(JSON.stringify(e))}function W(t){let n=e(),r=D(()=>null,()=>t?P(t):n.proxy.$el);return u(r.trigger),c(r.trigger),r}function G(e){let t=B(`(prefers-reduced-motion: reduce)`,e);return v(()=>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,t,n){let r=p(e),i=p(t);if(typeof r==`number`&&typeof i==`number`)return q(r,i,n);if(Array.isArray(r)&&Array.isArray(i))return r.map((e,t)=>q(e,p(i[t]),n));throw TypeError(`Unknown transition type, specify an interpolation function.`)}function Y(e){return typeof e==`function`?e:p(e)??A}function X(e,t,n,r={}){let{window:i=N}=r,a=p(t),o=p(n),s=p(r.duration)??1e3,c=Date.now(),l=Date.now()+s,u=typeof r.interpolation==`function`?r.interpolation:J,d=r.easing===void 0?Y(r.transition):Y(r.easing),f=typeof d==`function`?d:K(d);return new Promise(t=>{e.value=a;let n=()=>{if(r.abort?.call(r)){t();return}let d=Date.now(),p=f((d-c)/s);e.value=u(a,o,p),d<l?i?.requestAnimationFrame(n):(e.value=o,t())};n()})}function Z(e,t={}){let n=0,i=()=>{let n=p(e);return t.interpolation===void 0&&Array.isArray(n)?n.map(p):n},a=g(i());return r(i,async e=>{var r,i;if(p(t.disabled))return;let o=++n;t.delay&&await T(p(t.delay)),o===n&&((r=t.onStarted)==null||r.call(t),await X(a,a.value,e,{...t,abort:()=>o!==n||t.abort?.call(t)}),(i=t.onFinished)==null||i.call(t))},{deep:!0}),r(()=>p(t.disabled),e=>{e&&(n++,a.value=i())}),j(()=>{n++}),v(()=>p(t.disabled)?i():a.value)}function Q(t,n,i,a={}){var o,s;let{clone:c=!1,passive:l=!1,eventName:u,deep:f=!1,defaultValue:p,shouldEmit:m}=a,h=e(),g=i||h?.emit||(h==null||(o=h.$emit)==null?void 0:o.bind(h))||(h==null||(s=h.proxy)==null||(sLine truncated
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{Z as h,w as g}from"./api.js";import{t as _}from"./Input.js";import{S as v,b as y,g as b,m as x,p as S,r as C,x as w,y as T}from"./index.js";var E={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},D=`eda-playbooks`,O=n({__name:`PlaybooksPage`,setup(n){let O=w();s(O.load);let k=m(()=>O.drafts[D]?.value),A=p(``),j=p(``),M=m(()=>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(n,s)=>(a(),t(`div`,null,[e(d,{title:`Playbooks`},{default:i(()=>[e(T,{kinds:[D]},null,8,[`kinds`])]),_:1}),e(y,{kind:D,class:`mb-4`}),l(O).catalogError||l(O).pageErrorFor(D)?(a(),t(`p`,E,c(l(O).catalogError||l(O).pageErrorFor(D)),1)):r(``,!0),o(`form`,{class:`mb-4 flex flex-wrap gap-2`,onSubmit:h(N,[`prevent`])},[e(l(_),{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`]),e(l(g),{type:`submit`,disabled:M.value||!A.value.trim()||k.value?.playbooks.some(e=>e.id===A.value.trim())},{default:i(()=>[...s[3]||=[u(`Add playbook`,-1)]]),_:1},8,[`disabled`])],32),k.value?.playbooks.length?r(``,!0):(a(),f(l(b),{key:1},{default:i(()=>[e(l(x),null,{default:i(()=>[e(l(S),null,{default:i(()=>[...s[4]||=[u(`No playbooks installed`,-1)]]),_:1})]),_:1})]),_:1})),e(C,{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:i(({item:t,index:n})=>[e(l(v),{id:`playbook-${n}`,modelValue:t.yaml,"onUpdate:modelValue":e=>t.yaml=e,"aria-label":`${t.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};
|
||||
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{Q as h,T as g}from"./createLucideIcon.js";import{t as _}from"./Input.js";import{S as v,b as y,g as b,m as x,p as S,r as C,x as w,y as T}from"./index.js";var E={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},D=`eda-playbooks`,O=n({__name:`PlaybooksPage`,setup(n){let O=w();s(O.load);let k=m(()=>O.drafts[D]?.value),A=p(``),j=p(``),M=m(()=>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(n,s)=>(a(),t(`div`,null,[e(d,{title:`Playbooks`},{default:i(()=>[e(T,{kinds:[D]},null,8,[`kinds`])]),_:1}),e(y,{kind:D,class:`mb-4`}),l(O).catalogError||l(O).pageErrorFor(D)?(a(),t(`p`,E,c(l(O).catalogError||l(O).pageErrorFor(D)),1)):r(``,!0),o(`form`,{class:`mb-4 flex flex-wrap gap-2`,onSubmit:h(N,[`prevent`])},[e(l(_),{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`]),e(l(g),{type:`submit`,disabled:M.value||!A.value.trim()||k.value?.playbooks.some(e=>e.id===A.value.trim())},{default:i(()=>[...s[3]||=[u(`Add playbook`,-1)]]),_:1},8,[`disabled`])],32),k.value?.playbooks.length?r(``,!0):(a(),f(l(b),{key:1},{default:i(()=>[e(l(x),null,{default:i(()=>[e(l(S),null,{default:i(()=>[...s[4]||=[u(`No playbooks installed`,-1)]]),_:1})]),_:1})]),_:1})),e(C,{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:i(({item:t,index:n})=>[e(l(v),{id:`playbook-${n}`,modelValue:t.yaml,"onUpdate:modelValue":e=>t.yaml=e,"aria-label":`${t.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};
|
||||
Vendored
+2
-2
@@ -1,3 +1,3 @@
|
||||
import{$ as e,$t as t,A as n,An as r,At as i,B as a,Bt as o,C as s,Cn as c,Ct as l,D as u,Dn as d,Dt as f,E as p,En as m,Et as h,F as g,Fn as _,Ft as v,G as y,Gt as b,H as x,Ht as S,I as C,It as w,J as T,Jt as E,K as ee,Kt as D,L as O,Lt as te,M as k,Mt as ne,N as re,Nt as ie,O as ae,On as oe,Ot as se,P as ce,Pn as le,Pt as ue,Q as de,Qt as fe,R as pe,Rt as me,S as he,Sn as ge,St as _e,T as ve,Tn as ye,Tt as be,U as xe,Ut as Se,V as Ce,Vt as we,W as Te,Wt as Ee,X as De,Xt as Oe,Y as ke,Yt as Ae,Z as je,Zt as Me,_ as Ne,_n as Pe,_t as A,a as Fe,an as Ie,ar as Le,at as Re,b as ze,bn as Be,bt as Ve,c as He,cn as Ue,ct as We,d as Ge,dn as Ke,dt as qe,en as Je,er as Ye,et as Xe,f as Ze,fn as Qe,ft as $e,g as et,gn as tt,gt as nt,h as rt,hn as it,ht as at,i as ot,in as st,ir as ct,it as j,j as lt,jn as M,jt as ut,k as dt,kn as N,kt as ft,l as pt,ln as mt,lt as ht,m as gt,mn as _t,mt as vt,n as yt,nn as bt,nr as xt,nt as St,o as Ct,on as wt,ot as Tt,p as Et,pn as Dt,pt as Ot,q as kt,qt as At,r as jt,rn as Mt,rr as Nt,rt as Pt,s as Ft,sn as It,st as Lt,tn as Rt,tt as zt,u as Bt,un as Vt,ut as Ht,v as Ut,vn as Wt,vt as Gt,w as Kt,wn as qt,wt as P,x as F,xn as I,xt as Jt,y as L,yn as Yt,yt as Xt,z as Zt,zt as Qt}from"./PageHeader.js";import{A as $t,B as en,D as tn,F as nn,G as rn,H as an,I as on,J as sn,K as cn,L as ln,M as un,N as dn,O as fn,P as pn,R as mn,T as hn,U as gn,V as _n,W as vn,X as yn,Y as bn,Z as xn,_ as Sn,j as Cn,k as wn,q as Tn,z as En}from"./api.js";import{t as Dn}from"./createLucideIcon.js";var On=Object.defineProperty,kn=((e,t)=>{let n={};for(var r in e)On(n,r,{get:e[r],enumerable:!0});return t||On(n,Symbol.toStringTag,{value:`Module`}),n})({BaseTransition:()=>ot,BaseTransitionPropsValidators:()=>Fe,Comment:()=>Ct,DeprecationTypes:()=>null,EffectScope:()=>Rt,ErrorCodes:()=>Ft,ErrorTypeStrings:()=>He,Fragment:()=>pt,KeepAlive:()=>Bt,ReactiveEffect:()=>bt,Static:()=>Ge,Suspense:()=>Ze,Teleport:()=>Et,Text:()=>gt,TrackOpTypes:()=>Mt,Transition:()=>fn,TransitionGroup:()=>wn,TriggerOpTypes:()=>st,VueElement:()=>$t,assertNumber:()=>rt,callWithAsyncErrorHandling:()=>et,callWithErrorHandling:()=>Ne,camelize:()=>le,capitalize:()=>_,cloneVNode:()=>Ut,compatUtils:()=>null,compile:()=>An,computed:()=>L,createApp:()=>Cn,createBlock:()=>F,createCommentVNode:()=>he,createElementBlock:()=>s,createElementVNode:()=>ze,createHydrationRenderer:()=>Kt,createPropsRestProxy:()=>ve,createRenderer:()=>p,createSSRApp:()=>un,createSlots:()=>u,createStaticVNode:()=>ae,createTextVNode:()=>dt,createVNode:()=>n,customRef:()=>Ie,defineAsyncComponent:()=>lt,defineComponent:()=>k,defineCustomElement:()=>dn,defineEmits:()=>re,defineExpose:()=>ce,defineModel:()=>g,defineOptions:()=>C,defineProps:()=>O,defineSSRCustomElement:()=>pn,defineSlots:()=>pe,devtools:()=>Zt,effect:()=>wt,effectScope:()=>It,getCurrentInstance:()=>a,getCurrentScope:()=>Ue,getCurrentWatcher:()=>mt,getTransitionRawChildren:()=>Ce,guardReactiveProps:()=>x,h:()=>xe,handleError:()=>Te,hasInjectionContext:()=>y,hydrate:()=>nn,hydrateOnIdle:()=>ee,hydrateOnInteraction:()=>kt,hydrateOnMediaQuery:()=>T,hydrateOnVisible:()=>ke,initCustomFormatter:()=>De,initDirectivesForSSR:()=>on,inject:()=>je,isMemoSame:()=>de,isProxy:()=>Vt,isReactive:()=>Ke,isReadonly:()=>Qe,isRef:()=>Dt,isRuntimeOnly:()=>e,isShallow:()=>_t,isVNode:()=>Xe,markRaw:()=>it,mergeDefaults:()=>zt,mergeModels:()=>St,mergeProps:()=>Pt,nextTick:()=>j,nodeOps:()=>ln,normalizeClass:()=>Ye,normalizeProps:()=>xt,normalizeStyle:()=>Nt,onActivated:()=>Re,onBeforeMount:()=>Tt,onBeforeUnmount:()=>Lt,onBeforeUpdate:()=>We,onDeactivated:()=>ht,onErrorCaptured:()=>Ht,onMounted:()=>qe,onRenderTracked:()=>$e,onRenderTriggered:()=>Ot,onScopeDispose:()=>tt,onServerPrefetch:()=>vt,onUnmounted:()=>at,onUpdated:()=>nt,onWatcherCleanup:()=>Pe,openBlock:()=>A,patchProp:()=>mn,popScopeId:()=>Gt,provide:()=>Xt,proxyRefs:()=>Wt,pushScopeId:()=>Ve,queuePostFlushCb:()=>Jt,reactive:()=>Yt,readonly:()=>Be,ref:()=>I,registerRuntimeCompiler:()=>_e,render:()=>En,renderList:()=>l,renderSlot:()=>P,resolveComponent:()=>be,resolveDirective:()=>h,resolveDynamicComponent:()=>f,resolveFilter:()=>null,resolveTransitionHooks:()=>se,setBlockTracking:()=>ft,setDevtoolsHook:()=>i,setTransitionHooks:()=>ut,shallowReactive:()=>ge,shallowReadonly:()=>c,shallowRef:()=>qt,ssrContextKey:()=>ne,ssrUtils:()=>ie,stop:()=>ye,toDisplayString:()=>ct,toHandlerKey:()=>Le,toHandlers:()=>ue,toRaw:()=>m,toRef:()=>d,toRefs:()=>oe,toValue:()=>N,transformVNodeArgs:()=>v,triggerRef:()=>r,unref:()=>M,useAttrs:()=>w,useCssModule:()=>en,useCssVars:()=>_n,useHost:()=>an,useId:()=>te,useModel:()=>me,useSSRContext:()=>Qt,useShadowRoot:()=>gn,useSlots:()=>o,useTemplateRef:()=>we,useTransitionState:()=>S,vModelCheckbox:()=>vn,vModelDynamic:()=>rn,vModelRadio:()=>cn,vModelSelect:()=>Tn,vModelText:()=>sn,vShow:()=>bn,version:()=>Se,warn:()=>Ee,watch:()=>b,watchEffect:()=>D,watchPostEffect:()=>At,watchSyncEffect:()=>E,withAsyncContext:()=>Ae,withCtx:()=>Oe,withDefaults:()=>Me,witLine truncated
|
||||
import{$ as e,$t as t,A as n,An as r,At as i,B as a,Bt as o,C as s,Cn as c,Ct as l,D as u,Dn as d,Dt as f,E as p,En as m,Et as h,F as g,Fn as _,Ft as v,G as y,Gt as b,H as x,Ht as S,I as C,It as w,J as T,Jt as E,K as ee,Kt as D,L as O,Lt as te,M as k,Mt as ne,N as re,Nt as ie,O as ae,On as oe,Ot as se,P as ce,Pn as le,Pt as ue,Q as de,Qt as fe,R as pe,Rt as me,S as he,Sn as ge,St as _e,T as ve,Tn as ye,Tt as be,U as xe,Ut as Se,V as Ce,Vt as we,W as Te,Wt as Ee,X as De,Xt as Oe,Y as ke,Yt as Ae,Z as je,Zt as Me,_ as Ne,_n as Pe,_t as A,a as Fe,an as Ie,ar as Le,at as Re,b as ze,bn as Be,bt as Ve,c as He,cn as Ue,ct as We,d as Ge,dn as Ke,dt as qe,en as Je,er as Ye,et as Xe,f as Ze,fn as Qe,ft as $e,g as et,gn as tt,gt as nt,h as rt,hn as it,ht as at,i as ot,in as st,ir as ct,it as j,j as lt,jn as M,jt as ut,k as dt,kn as N,kt as ft,l as pt,ln as mt,lt as ht,m as gt,mn as _t,mt as vt,n as yt,nn as bt,nr as xt,nt as St,o as Ct,on as wt,ot as Tt,p as Et,pn as Dt,pt as Ot,q as kt,qt as At,r as jt,rn as Mt,rr as Nt,rt as Pt,s as Ft,sn as It,st as Lt,tn as Rt,tt as zt,u as Bt,un as Vt,ut as Ht,v as Ut,vn as Wt,vt as Gt,w as Kt,wn as qt,wt as P,x as F,xn as I,xt as Jt,y as L,yn as Yt,yt as Xt,z as Zt,zt as Qt}from"./PageHeader.js";import{A as $t,B as en,E as tn,F as nn,G as rn,H as an,I as on,J as sn,K as cn,L as ln,M as un,N as dn,O as fn,P as pn,Q as mn,R as hn,U as gn,V as _n,W as vn,X as yn,Y as bn,Z as xn,j as Sn,k as Cn,q as wn,t as Tn,v as En,z as Dn}from"./createLucideIcon.js";var On=Object.defineProperty,kn=((e,t)=>{let n={};for(var r in e)On(n,r,{get:e[r],enumerable:!0});return t||On(n,Symbol.toStringTag,{value:`Module`}),n})({BaseTransition:()=>ot,BaseTransitionPropsValidators:()=>Fe,Comment:()=>Ct,DeprecationTypes:()=>null,EffectScope:()=>Rt,ErrorCodes:()=>Ft,ErrorTypeStrings:()=>He,Fragment:()=>pt,KeepAlive:()=>Bt,ReactiveEffect:()=>bt,Static:()=>Ge,Suspense:()=>Ze,Teleport:()=>Et,Text:()=>gt,TrackOpTypes:()=>Mt,Transition:()=>Cn,TransitionGroup:()=>$t,TriggerOpTypes:()=>st,VueElement:()=>Sn,assertNumber:()=>rt,callWithAsyncErrorHandling:()=>et,callWithErrorHandling:()=>Ne,camelize:()=>le,capitalize:()=>_,cloneVNode:()=>Ut,compatUtils:()=>null,compile:()=>An,computed:()=>L,createApp:()=>un,createBlock:()=>F,createCommentVNode:()=>he,createElementBlock:()=>s,createElementVNode:()=>ze,createHydrationRenderer:()=>Kt,createPropsRestProxy:()=>ve,createRenderer:()=>p,createSSRApp:()=>dn,createSlots:()=>u,createStaticVNode:()=>ae,createTextVNode:()=>dt,createVNode:()=>n,customRef:()=>Ie,defineAsyncComponent:()=>lt,defineComponent:()=>k,defineCustomElement:()=>pn,defineEmits:()=>re,defineExpose:()=>ce,defineModel:()=>g,defineOptions:()=>C,defineProps:()=>O,defineSSRCustomElement:()=>nn,defineSlots:()=>pe,devtools:()=>Zt,effect:()=>wt,effectScope:()=>It,getCurrentInstance:()=>a,getCurrentScope:()=>Ue,getCurrentWatcher:()=>mt,getTransitionRawChildren:()=>Ce,guardReactiveProps:()=>x,h:()=>xe,handleError:()=>Te,hasInjectionContext:()=>y,hydrate:()=>on,hydrateOnIdle:()=>ee,hydrateOnInteraction:()=>kt,hydrateOnMediaQuery:()=>T,hydrateOnVisible:()=>ke,initCustomFormatter:()=>De,initDirectivesForSSR:()=>ln,inject:()=>je,isMemoSame:()=>de,isProxy:()=>Vt,isReactive:()=>Ke,isReadonly:()=>Qe,isRef:()=>Dt,isRuntimeOnly:()=>e,isShallow:()=>_t,isVNode:()=>Xe,markRaw:()=>it,mergeDefaults:()=>zt,mergeModels:()=>St,mergeProps:()=>Pt,nextTick:()=>j,nodeOps:()=>hn,normalizeClass:()=>Ye,normalizeProps:()=>xt,normalizeStyle:()=>Nt,onActivated:()=>Re,onBeforeMount:()=>Tt,onBeforeUnmount:()=>Lt,onBeforeUpdate:()=>We,onDeactivated:()=>ht,onErrorCaptured:()=>Ht,onMounted:()=>qe,onRenderTracked:()=>$e,onRenderTriggered:()=>Ot,onScopeDispose:()=>tt,onServerPrefetch:()=>vt,onUnmounted:()=>at,onUpdated:()=>nt,onWatcherCleanup:()=>Pe,openBlock:()=>A,patchProp:()=>Dn,popScopeId:()=>Gt,provide:()=>Xt,proxyRefs:()=>Wt,pushScopeId:()=>Ve,queuePostFlushCb:()=>Jt,reactive:()=>Yt,readonly:()=>Be,ref:()=>I,registerRuntimeCompiler:()=>_e,render:()=>en,renderList:()=>l,renderSlot:()=>P,resolveComponent:()=>be,resolveDirective:()=>h,resolveDynamicComponent:()=>f,resolveFilter:()=>null,resolveTransitionHooks:()=>se,setBlockTracking:()=>ft,setDevtoolsHook:()=>i,setTransitionHooks:()=>ut,shallowReactive:()=>ge,shallowReadonly:()=>c,shallowRef:()=>qt,ssrContextKey:()=>ne,ssrUtils:()=>ie,stop:()=>ye,toDisplayString:()=>ct,toHandlerKey:()=>Le,toHandlers:()=>ue,toRaw:()=>m,toRef:()=>d,toRefs:()=>oe,toValue:()=>N,transformVNodeArgs:()=>v,triggerRef:()=>r,unref:()=>M,useAttrs:()=>w,useCssModule:()=>_n,useCssVars:()=>an,useHost:()=>gn,useId:()=>te,useModel:()=>me,useSSRContext:()=>Qt,useShadowRoot:()=>vn,useSlots:()=>o,useTemplateRef:()=>we,useTransitionState:()=>S,vModelCheckbox:()=>rn,vModelDynamic:()=>cn,vModelRadio:()=>wn,vModelSelect:()=>sn,vModelText:()=>bn,vShow:()=>yn,version:()=>Se,warn:()=>Ee,watch:()=>b,watchEffect:()=>D,watchPostEffect:()=>At,watchSyncEffect:()=>E,withAsyncContext:()=>Ae,withCtx:()=>Oe,withDefaults:()=>Me,withDirectives:()=>fe,witLine truncated
|
||||
`)].join(`
|
||||
`))}return()=>i.value||r.value||s.value?xe(t.default({present:s.value})[0],{ref:e=>{let t=H(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?o.value=t.firstElementChild:o.value=t),t}}):null}}),ai=`dismissableLayer.pointerDownOutside`,oi=`dismissableLayer.focusOutside`;function si(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 ci(e,t){if(!si(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 li(e,t,n=!0){let r=I(!1),i=I(()=>{});return D(a=>{if(!B||!N(n))return;let o=t?.value?.ownerDocument??globalThis.document,s=async n=>{let a=n.target;if(t?.value&&a){if(ci(t.value,a))o.removeEventListener(`click`,i.value),r.value=!1;else{if(n.target&&!r.value){let t={originalEvent:n};function r(){Rn(ai,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:()=>{N(n)&&(r.value=!0)}}}function ui(e,t,n=!0){let r=I(!1);return D(i=>{if(!B||!N(n))return;let a=t?.value?.ownerDocument??globalThis.document,o=async n=>{if(!t?.value)return;await j(),await j();let i=n.target;t.value&&i&&!ci(t.value,i)&&n.target&&!r.value&&Rn(oi,e,{originalEvent:n})};a.addEventListener(`focusin`,o),i(()=>a.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{N(n)&&(r.value=!0)},onBlurCapture:()=>{N(n)&&(r.value=!1)}}}var U=Yt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),di=k({__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}=zr(),o=L(()=>a.value?.ownerDocument??globalThis.document),s=L(()=>U.layersRoot),c=L(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=L(()=>U.layersWithOutsidePointerEventsDisabled.size>0),u=L(()=>{let e=Array.from(s.value),[t]=[...U.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=li(async e=>{let t=[...U.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await j(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=ui(e=>{let t=[...U.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return dr(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))},{target:()=>o.value?.defaultView??globalThis.window}),b([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{if(e&&n&&t){let t=e.ownerDocument;Cr(t,e),U.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{U.layersWithOutsidePointerEventsDisabled.delete(e),wr(t,e)})}},{immediate:!0}),b([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),D(e=>{e(()=>{a.value&&(s.value.delete(a.value),U.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(t,n)=>(A(),F(M(hn),{ref:M(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:Nt({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:M(f).onFocusCapture,onBlurCapture:M(f).onBlurCapture,onPointerdownCapture:M(d).onPointerDownCapture},{default:Oe(()=>[P(t.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),fi=Vn(()=>I([]));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=R();for(let r of e)if(W(r,{select:t}),R()!==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();)t.push(n
Line truncated
|
||||
`))}return()=>i.value||r.value||s.value?xe(t.default({present:s.value})[0],{ref:e=>{let t=H(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?o.value=t.firstElementChild:o.value=t),t}}):null}}),ai=`dismissableLayer.pointerDownOutside`,oi=`dismissableLayer.focusOutside`;function si(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 ci(e,t){if(!si(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 li(e,t,n=!0){let r=I(!1),i=I(()=>{});return D(a=>{if(!B||!N(n))return;let o=t?.value?.ownerDocument??globalThis.document,s=async n=>{let a=n.target;if(t?.value&&a){if(ci(t.value,a))o.removeEventListener(`click`,i.value),r.value=!1;else{if(n.target&&!r.value){let t={originalEvent:n};function r(){Rn(ai,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:()=>{N(n)&&(r.value=!0)}}}function ui(e,t,n=!0){let r=I(!1);return D(i=>{if(!B||!N(n))return;let a=t?.value?.ownerDocument??globalThis.document,o=async n=>{if(!t?.value)return;await j(),await j();let i=n.target;t.value&&i&&!ci(t.value,i)&&n.target&&!r.value&&Rn(oi,e,{originalEvent:n})};a.addEventListener(`focusin`,o),i(()=>a.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{N(n)&&(r.value=!0)},onBlurCapture:()=>{N(n)&&(r.value=!1)}}}var U=Yt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),di=k({__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}=zr(),o=L(()=>a.value?.ownerDocument??globalThis.document),s=L(()=>U.layersRoot),c=L(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=L(()=>U.layersWithOutsidePointerEventsDisabled.size>0),u=L(()=>{let e=Array.from(s.value),[t]=[...U.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=li(async e=>{let t=[...U.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await j(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=ui(e=>{let t=[...U.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return dr(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))},{target:()=>o.value?.defaultView??globalThis.window}),b([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{if(e&&n&&t){let t=e.ownerDocument;Cr(t,e),U.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{U.layersWithOutsidePointerEventsDisabled.delete(e),wr(t,e)})}},{immediate:!0}),b([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),D(e=>{e(()=>{a.value&&(s.value.delete(a.value),U.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(t,n)=>(A(),F(M(tn),{ref:M(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:Nt({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:M(f).onFocusCapture,onBlurCapture:M(f).onBlurCapture,onPointerdownCapture:M(d).onPointerDownCapture},{default:Oe(()=>[P(t.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),fi=Vn(()=>I([]));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=R();for(let r of e)if(W(r,{select:t}),R()!==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();)t.push(n
Line truncated
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import{$n as e,A as t,B as n,Bn as r,Cn as i,E as a,En as o,Fn as s,G as c,Gn as l,Gt as u,Hn as d,Ht as f,In as p,Jn as ee,Kn as m,Ln as te,M as h,Mn as g,Nn as ne,On as _,Ot as v,Pn as y,Qn as b,Rn as x,U as S,Un as C,V as re,Vn as w,Wn as ie,Xn as ae,Xt as oe,Yn as T,Z as se,Zn as E,_t as ce,a as le,an as ue,cn as de,ct as fe,d as pe,dt as me,er as he,g as ge,gn as _e,gt as ve,ht as ye,i as be,it as xe,jn as D,jt as Se,kn as Ce,l as we,n as Te,o as Ee,or as De,pn as O,qn as k,r as Oe,rt as ke,tr as Ae,v as je,w as Me,wn as Ne,wt as Pe,x as Fe,xt as Ie,y as Le,yn as Re,zn as ze}from"./PageHeader.js";var Be=void 0,Ve=typeof window<`u`&&window.trustedTypes;if(Ve)try{Be=Ve.createPolicy(`vue`,{createHTML:e=>e})}catch{}var He=Be?e=>Be.createHTML(e):e=>e,Ue=`http://www.w3.org/2000/svg`,We=`http://www.w3.org/1998/Math/MathML`,A=typeof document<`u`?document:null,Ge=A&&A.createElement(`template`),Ke={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`?A.createElementNS(Ue,e):t===`mathml`?A.createElementNS(We,e):n?A.createElement(e,{is:n}):A.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>A.createTextNode(e),createComment:e=>A.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>A.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{Ge.innerHTML=He(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Ge.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]}},j=`transition`,M=`animation`,N=Symbol(`_vtc`),qe={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},Je=p({},le,qe),Ye=(e=>(e.displayName=`Transition`,e.props=Je,e))((e,{slots:t})=>S(be,Ze(e),t)),P=(e,t=[])=>{w(e)?e.forEach(e=>e(...t)):e&&e(...t)},Xe=e=>e?w(e)?e.some(e=>e.length>1):e.length>1:!1;function Ze(e){let t={};for(let n in e)n in qe||(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:ee=`${n}-leave-to`}=e,m=Qe(i),te=m&&m[0],h=m&&m[1],{onBeforeEnter:g,onEnter:ne,onEnterCancelled:_,onLeave:v,onLeaveCancelled:y,onBeforeAppear:b=g,onAppear:x=ne,onAppearCancelled:S=_}=t,C=(e,t,n,r)=>{e._enterCancelled=r,I(e,t?u:s),I(e,t?l:o),n&&n()},re=(e,t)=>{e._isLeaving=!1,I(e,d),I(e,ee),I(e,f),t&&t()},w=e=>(t,n)=>{let i=e?x:ne,o=()=>C(t,e,n);P(i,[t,o]),et(()=>{I(t,e?c:a),F(t,e?u:s),Xe(i)||nt(t,r,te,o)})};return p(t,{onBeforeEnter(e){P(g,[e]),F(e,a),F(e,o)},onBeforeAppear(e){P(b,[e]),F(e,c),F(e,l)},onEnter:w(!1),onAppear:w(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>re(e,t);F(e,d),e._enterCancelled?(F(e,f),ot(e)):(ot(e),F(e,f)),et(()=>{e._isLeaving&&(I(e,d),F(e,ee),Xe(v)||nt(e,r,h,n))}),P(v,[e,n])},onEnterCancelled(e){C(e,!1,void 0,!0),P(_,[e])},onAppearCancelled(e){C(e,!0,void 0,!0),P(S,[e])},onLeaveCancelled(e){re(e),P(y,[e])}})}function Qe(e){if(e==null)return null;if(ie(e))return[$e(e.enter),$e(e.leave)];{let t=$e(e);return[t,t]}}function $e(e){return De(e)}function F(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[N]||(e[N]=new Set)).add(t)}function I(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[N];n&&(n.delete(t),n.size||(e[N]=void 0))}function et(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var tt=0;function nt(e,t,n,r){let i=e._endId=++tt,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=rt(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 rt(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${j}Delay`),a=r(`${j}Duration`),o=it(i,a),s=r(`${M}Delay`),c=r(`${M}Duration`),l=it(s,c),u=null,d=0,f=0;t===j?o>0&&(u=j,d=o,f=a.length):t===M?l>0&&(u=M,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?j:M:null,f=u?u===j?a.length:c.length:0);let p=u===j&&/\b(?:transform|all)(?:,|$)/.test(r(`${j}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function it(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>at(t)+at(e[n])Line truncated
|
||||
`))),e[G]=W(i);let a=r||i.props&&i.props.type===`number`;H(e,t?`change`:`input`,t=>{t.target.composing||e[G](nn(e.value,n,a))}),(n||a)&&H(e,`change`,()=>{e.value=nn(e.value,n,a)}),t||(H(e,`compositionstart`,en),H(e,`compositionend`,tn),H(e,`change`,tn))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[K];delete e[K],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[G](nn(e.value,n,r)):e.value=i},beforeUpdate(t,{value:n,oldValue:r,modifiers:{lazy:i,trim:a,number:o}},s){if(t[G]=W(s),t.composing)return;let c=(o||t.type===`number`)&&!/^0\d/.test(t.value)?e(t.value):t.value,l=n??``;if(c===l)return;let u=t.getRootNode();(u instanceof Document||u instanceof ShadowRoot)&&u.activeElement===t&&t.type!==`range`&&(i&&n===r||a&&t.value.trim()===l)||(t.value=l)}},rn={deep:!0,created(e,t,n){e[G]=W(n),H(e,`change`,()=>{let t=e._modelValue,n=J(e),r=e.checked,i=e[G];if(w(t)){let e=b(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(k(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(un(e,r))})},mounted:an,beforeUpdate(e,t,n){e[G]=W(n),an(e,t,n)}};function an(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(w(t))i=b(t,r.props.value)>-1;else if(k(t))i=t.has(r.props.value);else{if(t===n)return;i=E(t,un(e,!0))}e.checked!==i&&(e.checked=i)}var on={created(e,{value:t},n){e.checked=E(t,n.props.value),e[G]=W(n),H(e,`change`,()=>{e[G](J(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[G]=W(r),t!==n&&(e.checked=E(t,r.props.value))}},sn={deep:!0,created(t,{value:n,modifiers:{number:r}},i){t._modelValue=n,H(t,`change`,()=>{let n=Array.prototype.filter.call(t.options,e=>e.selected).map(t=>r?e(J(t)):J(t)),i=t.multiple,a=i?k(t._modelValue)?new Set(n):n:n[0],o=t._pendingValue=[i,i?w(a)?n.slice():n:a];try{t[G](a)}finally{xe(()=>{t._pendingValue===o&&(t._pendingValue=void 0)})}}),t[G]=W(i)},mounted(e,{value:t}){ln(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[G]=W(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!cn(t,n[1],n[0]))&&ln(e,t)}};function cn(e,t,n){if(!n||w(e))return E(e,t);if(k(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function ln(e,t){let n=e.multiple,r=w(t);if(!n||r||k(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=J(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):b(t,o)>-1}else a.selected=t.has(o)}else if(E(J(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function J(e){return`_value`in e?e._value:e.value}function un(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var dn={created(e,t,n){Y(e,t,n,null,`created`)},mounted(e,t,n){Y(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){Y(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){Y(e,t,n,r,`updated`)}};function fn(e,t){switch(e){case`SELECT`:return sn;case`TEXTAREA`:return q;default:switch(t){case`checkbox`:return rn;case`radio`:return on;default:return q}}}function Y(e,t,n,r,i){let a=fn(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function pn(){q.getSSRProps=({value:e})=>({value:e}),on.getSSRProps=({value:e},t)=>{if(t.props&&E(t.props.value,e))return{checked:!0}},rn.getSSRProps=({value:e},t)=>{if(w(e)){if(t.props&&b(e,t.props.value)>-1)return{checked:!0}}else if(k(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},dn.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=fn(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var mn=[`ctrl`,`shift`,`alt`,`meta`],hn={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)=>mn.some(n=>e[`${n}Key`]&&!t.includes(n))},gn=(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=hn[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},_n={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},vn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=x(n.key);if(t.some(e=>e===r||_n[e]===r))return e(n)}))},yn=p({patchProp:Pt},Ke),X,bn=!1;function xn(){return X||=a(yn)}function Sn(){return X=bn?X:Me(yn),bn=!0,X}var Cn=((...e)=>{xn().render(...e)}),wn=((...e)=>{Sn().hydrate(...e)}),Tn=((...e)=>{let t=xn().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=On(e);if(!r)return;let i=t._component;!d(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Dn(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),En=((...e)=>{let t=Sn().createApp(...e),{mount:n}=t;return t.mount=e=>
Line truncated
|
||||
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var cr;function lr(e){cr=e}var ur=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function dr(e){let t=e instanceof ur?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 fr(e,t){let n=await fetch(e,t);if(cr?.(n.status===401),!n.ok)throw new ur(await sr(n),n.status);return n}async function $(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=or,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 fr(e,s);return a?await c.json():void 0}var pr={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 fr(`/api/tasks`+Q(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(or)});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
|
||||
Vendored
+3
-1
@@ -1 +1,3 @@
|
||||
import{U as e,Z as t}from"./PageHeader.js";var n={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},r=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim();function i(e){return e!=null}function a(e,t={}){let a=t.attributeNames??{},o=e=>a[e]??e,s=e.size??e.width??n.width,c=e.size??e.height??n.height,l=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],u=[...e.name?[`lucide-${e.name}`]:[],...l],d=t.className?.split(` `).filter(Boolean)??[],f=t.includeDefaultClasses===!1?r(...d):r(`lucide`,...u,...d),p=t.absoluteStrokeWidth?Number(t.strokeWidth??n[`stroke-width`])*Number(e.size??e.width??n.width)/Number(t.size??t.width??n.width):t.strokeWidth??n[`stroke-width`];return[`svg`,{...Object.entries(n).reduce((e,[t,n])=>(e[o(t)]=n,e),{}),...`color`in t&&t.color&&{[o(`stroke`)]:t.color},...`size`in t&&i(t.size)&&{[o(`width`)]:t.size,[o(`height`)]:t.size},...`width`in t&&i(t.width)&&{[o(`width`)]:t.width},...`height`in t&&i(t.height)&&{[o(`height`)]:t.height},[o(`stroke-width`)]:p,...f&&{[o(`class`)]:f},[o(`viewBox`)]:`0 0 ${s} ${c}`,...t.hasA11yProp===!1?{[o(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,r,i]=e,a=t.nonScalingStroke?{[o(`vector-effect`)]:`non-scaling-stroke`,...r}:r;return i?[n,a,i]:[n,a]})]}var o=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},s=e=>e===``,c=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),l=Symbol(`lucide-icons`);function u(){return t(l,{})}var d=({name:t,iconNode:n,"icon-node":r,icon:i={name:t&&c(t),node:n??r??[],size:24,aliases:[]},absoluteStrokeWidth:l,"absolute-stroke-width":d,nonScalingStroke:f,"non-scaling-stroke":p,strokeWidth:m,"stroke-width":h,size:g,width:_=g,height:v=g,color:y,...b},{slots:x})=>{let{size:S,color:C,strokeWidth:w=2,absoluteStrokeWidth:T=!1,nonScalingStroke:E=!1,class:D=``}=u(),O=s(l)||s(d)||l===!0||d===!0||T===!0,k=s(f)||s(p)||f===!0||p===!0||E===!0;delete b.class;let A=x.default?.(),[,j,M=[]]=a(i,{color:y??C,width:_??g??S,height:v??g??S,strokeWidth:m??h??w,absoluteStrokeWidth:O,nonScalingStroke:k,className:D,hasA11yProp:A!=null&&A.length>0||o(b),attributes:b});return e(`svg`,j,[...M.map(([t,n])=>e(t,n)),...A??[]])};function f(t,n=[]){let r=typeof t==`string`?{name:t,node:n}:t;return(t,{slots:n})=>e(d,{...t,icon:r},n.default?{default:n.default}:void 0)}export{f as t};
|
||||
import{$n as e,A as t,B as n,Bn as r,Cn as i,E as a,En as o,Fn as s,G as c,Gn as l,Gt as u,Hn as d,Ht as f,In as p,Jn as m,Kn as h,Ln as g,M as _,Mn as v,Nn as ee,On as y,Ot as b,Pn as x,Qn as S,Rn as C,U as w,Un as T,V as E,Vn as D,Wn as te,Xn as ne,Xt as re,Yn as O,Z as ie,Zn as k,_t as ae,a as oe,an as se,cn as ce,ct as le,d as ue,dt as de,er as fe,g as pe,gn as me,gt as he,ht as ge,i as _e,it as ve,jn as A,jt as ye,kn as be,l as xe,n as Se,o as Ce,or as we,pn as j,qn as M,r as Te,rt as Ee,tr as De,v as Oe,w as ke,wn as Ae,wt as je,x as Me,xt as Ne,y as Pe,yn as Fe,zn as Ie}from"./PageHeader.js";var Le=void 0,Re=typeof window<`u`&&window.trustedTypes;if(Re)try{Le=Re.createPolicy(`vue`,{createHTML:e=>e})}catch{}var ze=Le?e=>Le.createHTML(e):e=>e,Be=`http://www.w3.org/2000/svg`,Ve=`http://www.w3.org/1998/Math/MathML`,N=typeof document<`u`?document:null,He=N&&N.createElement(`template`),Ue={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`?N.createElementNS(Be,e):t===`mathml`?N.createElementNS(Ve,e):n?N.createElement(e,{is:n}):N.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>N.createTextNode(e),createComment:e=>N.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>N.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{He.innerHTML=ze(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=He.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]}},P=`transition`,F=`animation`,I=Symbol(`_vtc`),We={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},Ge=p({},oe,We),Ke=(e=>(e.displayName=`Transition`,e.props=Ge,e))((e,{slots:t})=>w(_e,Je(e),t)),L=(e,t=[])=>{D(e)?e.forEach(e=>e(...t)):e&&e(...t)},qe=e=>e?D(e)?e.some(e=>e.length>1):e.length>1:!1;function Je(e){let t={};for(let n in e)n in We||(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:m=`${n}-leave-to`}=e,h=Ye(i),g=h&&h[0],_=h&&h[1],{onBeforeEnter:v,onEnter:ee,onEnterCancelled:y,onLeave:b,onLeaveCancelled:x,onBeforeAppear:S=v,onAppear:C=ee,onAppearCancelled:w=y}=t,T=(e,t,n,r)=>{e._enterCancelled=r,z(e,t?u:s),z(e,t?l:o),n&&n()},E=(e,t)=>{e._isLeaving=!1,z(e,d),z(e,m),z(e,f),t&&t()},D=e=>(t,n)=>{let i=e?C:ee,o=()=>T(t,e,n);L(i,[t,o]),Ze(()=>{z(t,e?c:a),R(t,e?u:s),qe(i)||$e(t,r,g,o)})};return p(t,{onBeforeEnter(e){L(v,[e]),R(e,a),R(e,o)},onBeforeAppear(e){L(S,[e]),R(e,c),R(e,l)},onEnter:D(!1),onAppear:D(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>E(e,t);R(e,d),e._enterCancelled?(R(e,f),rt(e)):(rt(e),R(e,f)),Ze(()=>{e._isLeaving&&(z(e,d),R(e,m),qe(b)||$e(e,r,_,n))}),L(b,[e,n])},onEnterCancelled(e){T(e,!1,void 0,!0),L(y,[e])},onAppearCancelled(e){T(e,!0,void 0,!0),L(w,[e])},onLeaveCancelled(e){E(e),L(x,[e])}})}function Ye(e){if(e==null)return null;if(te(e))return[Xe(e.enter),Xe(e.leave)];{let t=Xe(e);return[t,t]}}function Xe(e){return we(e)}function R(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[I]||(e[I]=new Set)).add(t)}function z(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[I];n&&(n.delete(t),n.size||(e[I]=void 0))}function Ze(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Qe=0;function $e(e,t,n,r){let i=e._endId=++Qe,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=et(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 et(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${P}Delay`),a=r(`${P}Duration`),o=tt(i,a),s=r(`${F}Delay`),c=r(`${F}Duration`),l=tt(s,c),u=null,d=0,f=0;t===P?o>0&&(u=P,d=o,f=a.length):t===F?l>0&&(u=F,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?P:F:null,f=u?u===P?a.length:c.length:0);let p=u===P&&/\b(?:transform|all)(?:,|$)/.test(r(`${P}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function tt(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>nt(t)+nt(e[n])))}functionLine truncated
|
||||
`))),e[J]=q(i);let a=r||i.props&&i.props.type===`number`;G(e,t?`change`:`input`,t=>{t.target.composing||e[J](en(e.value,n,a))}),(n||a)&&G(e,`change`,()=>{e.value=en(e.value,n,a)}),t||(G(e,`compositionstart`,Zt),G(e,`compositionend`,Qt),G(e,`change`,Qt))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[$t];delete e[$t],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[J](en(e.value,n,r)):e.value=i},beforeUpdate(t,{value:n,oldValue:r,modifiers:{lazy:i,trim:a,number:o}},s){if(t[J]=q(s),t.composing)return;let c=(o||t.type===`number`)&&!/^0\d/.test(t.value)?e(t.value):t.value,l=n??``;if(c===l)return;let u=t.getRootNode();(u instanceof Document||u instanceof ShadowRoot)&&u.activeElement===t&&t.type!==`range`&&(i&&n===r||a&&t.value.trim()===l)||(t.value=l)}},nn={deep:!0,created(e,t,n){e[J]=q(n),G(e,`change`,()=>{let t=e._modelValue,n=Y(e),r=e.checked,i=e[J];if(D(t)){let e=S(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(M(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(ln(e,r))})},mounted:rn,beforeUpdate(e,t,n){e[J]=q(n),rn(e,t,n)}};function rn(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(D(t))i=S(t,r.props.value)>-1;else if(M(t))i=t.has(r.props.value);else{if(t===n)return;i=k(t,ln(e,!0))}e.checked!==i&&(e.checked=i)}var an={created(e,{value:t},n){e.checked=k(t,n.props.value),e[J]=q(n),G(e,`change`,()=>{e[J](Y(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[J]=q(r),t!==n&&(e.checked=k(t,r.props.value))}},on={deep:!0,created(t,{value:n,modifiers:{number:r}},i){t._modelValue=n,G(t,`change`,()=>{let n=Array.prototype.filter.call(t.options,e=>e.selected).map(t=>r?e(Y(t)):Y(t)),i=t.multiple,a=i?M(t._modelValue)?new Set(n):n:n[0],o=t._pendingValue=[i,i?D(a)?n.slice():n:a];try{t[J](a)}finally{ve(()=>{t._pendingValue===o&&(t._pendingValue=void 0)})}}),t[J]=q(i)},mounted(e,{value:t}){cn(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[J]=q(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!sn(t,n[1],n[0]))&&cn(e,t)}};function sn(e,t,n){if(!n||D(e))return k(e,t);if(M(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function cn(e,t){let n=e.multiple,r=D(t);if(!n||r||M(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=Y(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):S(t,o)>-1}else a.selected=t.has(o)}else if(k(Y(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Y(e){return`_value`in e?e._value:e.value}function ln(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var un={created(e,t,n){fn(e,t,n,null,`created`)},mounted(e,t,n){fn(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){fn(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){fn(e,t,n,r,`updated`)}};function dn(e,t){switch(e){case`SELECT`:return on;case`TEXTAREA`:return tn;default:switch(t){case`checkbox`:return nn;case`radio`:return an;default:return tn}}}function fn(e,t,n,r,i){let a=dn(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function pn(){tn.getSSRProps=({value:e})=>({value:e}),an.getSSRProps=({value:e},t)=>{if(t.props&&k(t.props.value,e))return{checked:!0}},nn.getSSRProps=({value:e},t)=>{if(D(e)){if(t.props&&S(e,t.props.value)>-1)return{checked:!0}}else if(M(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},un.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=dn(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var mn=[`ctrl`,`shift`,`alt`,`meta`],hn={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)=>mn.some(n=>e[`${n}Key`]&&!t.includes(n))},gn=(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=hn[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},_n={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},vn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=C(n.key);if(t.some(e=>e===r||_n[e]===r))return e(n)}))},yn=p({patchProp:jt},Ue),bn,xn=!1;function Sn(){return bn||=a(yn)}function Cn(){return bn=xn?bn:ke(yn),xn=!0,bn}var wn=((...e)=>{Sn().render(...e)}),Tn=((...e)=>{Cn().hydrate(...e)}),En=((...e)=>{let t=Sn().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=kn(e);if(!r)return;let i=t._component;!d(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,On(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),Dn=((...e)=>{let t=Cn().createApp(...e),{mount:n}=t;ret
Line truncated
|
||||
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var ur;function dr(e){ur=e}var fr=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function pr(e){let t=e instanceof fr?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 mr(e,t){let n=await fetch(e,t);if(ur?.(n.status===401),!n.ok)throw new fr(await lr(n),n.status);return n}async function Z(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=cr,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 mr(e,s);return a?await c.json():void 0}var hr={recoveryCode:()=>Z(`/api/account/recovery`,{method:`POST`,body:{}}),recoverAccount:(e,t,n)=>Z(`/api/auth/recover`,{method:`POST`,body:{email:e,code:t,password:n},parse:!1}),authStatus:()=>Z(`/api/auth/status`),setupAccount:e=>Z(`/api/auth/setup`,{method:`POST`,body:e}),signIn:(e,t)=>Z(`/api/auth/login`,{method:`POST`,body:{email:e,password:t}}),signOut:()=>Z(`/api/auth/logout`,{method:`POST`,body:{},parse:!1}),createAccount:e=>Z(`/api/accounts`,{method:`POST`,body:e}),changePassword:(e,t)=>Z(`/api/account/password`,{method:`POST`,body:{current_password:e,new_password:t},parse:!1}),authentication:()=>Z(`/api/authentication`),saveAuthentication:e=>Z(`/api/authentication`,{method:`PUT`,body:e,parse:!1}),tokens:()=>Z(`/api/tokens`),createToken:()=>Z(`/api/tokens`,{method:`POST`,body:{}}),revokeToken:e=>Z(`/api/tokens/${encodeURIComponent(e)}`,{method:`DELETE`,body:{},parse:!1}),passkeys:()=>Z(`/api/account/passkeys`),deletePasskey:e=>Z(`/api/account/passkeys/${encodeURIComponent(e)}`,{method:`DELETE`,body:{},parse:!1}),beginPasskey:e=>Z(e?`/api/account/passkeys/begin`:`/api/auth/passkey/begin`,{method:`POST`,body:{}}),finishPasskey:(e,t,n)=>Z(e?`/api/account/passkeys/finish`:`/api/auth/passkey/finish`,{method:`POST`,body:{credential:t,name:n}}),secretEngines:()=>Z(`/api/secret-engines`),checkSecret:e=>Z(`/api/secret-references/check`,{method:`POST`,body:e}),health:()=>Z(`/health/detailed`),services:()=>Z(`/api/services`),policies:()=>Z(`/api/access/policies`),putPolicy:e=>Z(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>Z(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),orgs:()=>Z(`/api/orgs`),orgCreate:e=>Z(`/api/orgs`,{method:`POST`,body:e}),org:e=>Z(`/api/orgs/${encodeURIComponent(e)}`),orgWorkspaces:e=>Z(`/api/orgs/${encodeURIComponent(e)}/workspaces`),createOrgWorkspace:(e,t)=>Z(`/api/orgs/${encodeURIComponent(e)}/workspaces`,{method:`POST`,body:t}),orgAgents:e=>Z(`/api/orgs/${encodeURIComponent(e)}/agents`),orgMembers:e=>Z(`/api/orgs/${encodeURIComponent(e)}/members`),addOrgMember:(e,t)=>Z(`/api/orgs/${encodeURIComponent(e)}/members`,{method:`POST`,body:t}),setOrgMember:(e,t,n)=>Z(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PUT`,body:n}),removeOrgMember:(e,t,n)=>Z(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`+X({workspace:n}),{method:`DELETE`,parse:!1}),assignOrgAgent:(e,t)=>Z(`/api/orgs/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:`PUT`}),alerts:()=>Z(`/api/alerts`),dismissAlert:e=>Z(`/api/alerts/${e}/dismiss`,{method:`POST`,parse:!1}),identities:()=>Z(`/api/identities`),identityCreate:e=>Z(`/api/identities`,{method:`POST`,body:e}),identityCommand:(e,t,n)=>Z(`/api/identities/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`POST`,body:n}),summary:()=>Z(`/api/summary`),tasks:()=>Z(`/api/tasks`),taskPage:async e=>{let t=await mr(`/api/tasks`+X(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(cr)});return{tasks:await t.json(),next:t.headers.get(`X-Next-Cursor`)}},taskMeta:()=>Z(`/api/task-meta`),task:e=>Z(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>Z(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>Z(`/api/tasks/${encodeURIComponent(e)}/changes`+X(t)),taskDebug:(e,t)=>Z(`/api/tasks/${encodeURIComponent(e)}/debug`+X(t)),taskAction:(e,t,n)=>Z(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>Z(`/api/setup`),capabilities:()=>Z(`/api/capabilities`),workflows:()=>Z(`/api/workflows`),workflowEnabled:(e,t)=>Z(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),checkRepository:e=>Z(`/api/control-plane/resources/repository-policies/check`,{method:`POST`,body:e,timeoutMs:35e3}),repositories:()=>Z(`/api/repositories`),workRequest:e=>Z(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>Z(`/api/skills`),channels:()=>Z(`/api/channels`),curators:()=>Z(`/api/curators`),channelReload:e=>Z(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>Z(`/api/config`),logs:e=>Z(`/api/logs`+X(e)),
Line truncated
|
||||
Vendored
+1
-1
@@ -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
|
||||
Vendored
+81
-81
@@ -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/Input.js","assets/AuthenticationPage.js","assets/CredentialBindingsPage.js","assets/PlaybooksPage.js","assets/AgentProfilesPage.js","assets/HarnessPage.js","assets/alert.js","assets/createLucideIcon.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,H as o,I as s,L as c,M as l,N as u,O as d,P as f,R as p,S as m,T as h,U as g,V as _,W as v,_ as y,a as b,b as x,c as S,d as C,f as w,g as T,h as ee,i as E,j as D,k as te,l as O,m as ne,n as re,o as ie,p as ae,r as oe,s as se,t as ce,u as le,v as ue,w as de,x as fe,y as pe,z as me}from"./alert.js";import{$t as he,A as k,B as ge,Bt as _e,C as A,Ct as j,Dn as ve,Dt as ye,En as be,G as xe,Gt as M,H as Se,It as Ce,Jt as we,Kt as Te,Lt as Ee,M as N,On as De,Pt as Oe,Q as ke,Qt as Ae,Rt as je,S as P,Sn as Me,T as Ne,Tt as Pe,U as Fe,Vt as Ie,Xt as F,Z as Le,_t as I,an as Re,b as L,bn as ze,cn as Be,dn as Ve,dt as He,er as R,gn as Ue,hn as We,ht as Ge,ir as z,it as Ke,jn as B,k as V,kn as qe,l as H,n as U,nr as Je,nt as Ye,ot as Xe,p as Ze,pn as Qe,r as $e,rr as et,rt as W,sn as tt,st as nt,t as rt,tt as it,wn as at,wt as G,x as K,xn as q,y as J,yn as ot,yt as st}from"./PageHeader.js";import{C as ct,E as lt,J as ut,O as eee,T as dt,X as ft,Y as pt,Z as mt,_ as ht,a as gt,i as _t,j as tee,n as Y,o as vt,q as yt,r as bt,s as xt,t as St,w as X,x as Ct}from"./api.js";import{a as wt,i as Tt,n as Et,o as Dt,r as Ot,s as kt,t as Z}from"./Input.js";import{t as At}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)}})();var jt=typeof window<`u`,Mt,Nt=e=>Mt=e,Pt=Symbol();function Ft(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var It=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null};function Lt(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function Rt(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){Ut(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function zt(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Bt(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(t)}}var Vt=typeof navigator==`object`?navigator:{userAgent:``},Ht=/Macintosh/.test(Vt.userAgent)&&/AppleWebKit/.test(Vt.userAgent)&&!/Safari/.test(Vt.userAgent),Ut=jt?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!Ht?Wt:`msSaveOrOpenBlob`in Vt?Gt:Kt:()=>{};function Wt(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?Bt(r):zt(r.href)?Rt(e,t,n):(r.target=`_blank`,Bt(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){Bt(r)},0))}function Gt(e,t=`download`,n){if(typeof e==`string`){if(zt(e))Rt(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){Bt(t)})}}else navigator.msSaveOrOpenBlob(Lt(e,n),t)}function Kt(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return Rt(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(It.HTMLElement))||`safari`in It,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||Ht)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:nee}=Object;function qt(){let e=tt(!0),t=e.run(()=>q({})),n=[],r=[],i=We({install(e){Nt(i),i._a=e,e.provide(Pt,i),e.config.globalProperties.$pinia=i,r.forEach(e=>n.push(e)),r=[]},use(e){return this._a?n.push(e):r.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}var Jt=()=>{};function Yt(e,t,n,r=Jt){e.add(t);let i=()=>{e.delete(t)&&r()};return!n&&Be()&&Ue(i),i}function XtLine truncated
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AccountPage.js","assets/PageHeader.js","assets/createLucideIcon.js","assets/Input.js","assets/AuthenticationPage.js","assets/CredentialBindingsPage.js","assets/PlaybooksPage.js","assets/AgentProfilesPage.js","assets/HarnessPage.js","assets/alert.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,H as o,I as s,L as c,M as l,N as u,O as d,P as f,R as p,S as m,T as h,U as g,V as _,W as v,_ as y,a as b,b as x,c as S,d as C,f as w,g as T,h as ee,i as E,j as D,k as te,l as ne,m as re,n as ie,o as ae,p as oe,r as se,s as ce,t as le,u as ue,v as de,w as fe,x as pe,y as me,z as he}from"./alert.js";import{$t as ge,A as O,B as _e,Bt as ve,C as k,Ct as A,D as ye,Dn as be,Dt as xe,En as Se,G as Ce,Gt as j,H as we,It as Te,Jt as Ee,Kt as De,Lt as Oe,M,On as ke,Pt as Ae,Q as je,Qt as Me,Rt as Ne,S as N,Sn as Pe,T as Fe,Tt as Ie,U as Le,Vt as Re,Xt as P,Z as ze,_t as F,an as Be,b as I,bn as Ve,cn as He,dn as Ue,dt as L,er as R,gn as We,hn as Ge,ht as Ke,ir as z,it as qe,jn as B,k as V,kn as Je,l as H,n as U,nr as Ye,nt as Xe,ot as Ze,p as Qe,pn as $e,r as et,rr as tt,rt as W,sn as nt,st as rt,t as it,tt as at,wn as ot,wt as G,x as K,xn as q,y as J,yn as st,yt as ct}from"./PageHeader.js";import{D as lt,E as ut,J as dt,M as ft,Q as pt,S as mt,T as Y,X as ht,Y as gt,Z as _t,a as vt,c as yt,i as bt,k as xt,n as St,o as Ct,r as X,s as wt,t as Tt,v as Et,w as Dt}from"./createLucideIcon.js";import{a as Ot,i as eee,n as kt,o as At,r as jt,s as Mt,t as Z}from"./Input.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)}})();var Nt=typeof window<`u`,Pt,Ft=e=>Pt=e,It=Symbol();function Lt(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var Rt=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null};function zt(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function Bt(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){Gt(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function Vt(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Ht(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(t)}}var Ut=typeof navigator==`object`?navigator:{userAgent:``},Wt=/Macintosh/.test(Ut.userAgent)&&/AppleWebKit/.test(Ut.userAgent)&&!/Safari/.test(Ut.userAgent),Gt=Nt?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!Wt?Kt:`msSaveOrOpenBlob`in Ut?qt:Jt:()=>{};function Kt(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?Ht(r):Vt(r.href)?Bt(e,t,n):(r.target=`_blank`,Ht(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){Ht(r)},0))}function qt(e,t=`download`,n){if(typeof e==`string`){if(Vt(e))Bt(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){Ht(t)})}}else navigator.msSaveOrOpenBlob(zt(e,n),t)}function Jt(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return Bt(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(Rt.HTMLElement))||`safari`in Rt,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||Wt)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:tee}=Object;function Yt(){let e=nt(!0),t=e.run(()=>q({})),n=[],r=[],i=Ge({install(e){Ft(i),i._a=e,e.provide(It,i),e.config.globalProperties.$pinia=i,r.forEach(e=>n.push(e)),r=[]},use(e){return this._a?n.push(e):r.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}var Xt=()=>{};function Zt(e,t,n,r=Xt){e.add(t);let i=()=>{e.delete(t)&&r()};return!n&&He()&&We(i),i}function Qt(e,...t){e.forEach(eLine 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&&(wl.value=n.session_id),n.type===`delta`&&(o+=n.text,kl.value=kl.value?{...kl.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],kl.value=kl.value?{...kl.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),kl.value=kl.value?{...kl.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`);Tl.value=[...Tl.value,{from:`assistant`,text:o,tool_calls:a}],kl.value=null,Dl.value=`Ready`,await Ul()}catch(e){let t=e;t.name===`AbortError`&&!c?(kl.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},Dl.value=`Stopped`):(kl.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?_l(r):void 0,isRetry:i},Dl.value=`Error. Retry available.`)}finally{clearTimeout(l),xl=null,Vl=null,Ol.value=!1}}function xee(){Dl.value=`Stopping…`,wl.value&&Y.chatCancel(wl.value).catch(()=>{}),Hl()}function See(){He(()=>{Ul().catch(e=>{Dl.value=e.message||`Chat unavailable`})}),Ge(()=>{Hl()})}async function Cee(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 Yl({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var wee=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],Tee=N({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return U(`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)=>(I(),A(`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":B(yl),onClick:i[0]||=e=>n(`toggle`)},[L(`span`,{"aria-hidden":`true`,class:R(r(!e.open))},[k(B(kc),{size:22})],2),L(`span`,{"aria-hidden":`true`,class:R(r(e.open))},[k(B(sl),{size:22})],2)],8,wee))}}),Xl=N({__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=ue(e,t);return(e,t)=>(I(),K(B(_o),W({"data-slot":`select`},B(n)),{default:F(t=>[G(e.$slots,`default`,Je(Se(t)))]),_:3},16))}}),Zl=N({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=ht(n,`class`),a=ue(i,r);return(t,r)=>(I(),K(B(Ro),null,{default:F(()=>[k(B(ko),W({"data-slot":`select-content`,"data-align-trigger":e.position===`item-aligned`},{...t.$attrs,...B(a)},{class:B(U)(`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:F(()=>[k(B(eu)),k(B(Wo),{"data-position":e.position,class:R(B(U)(`data-[position=popper]:h-(--reka-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--reka-select-trigger-width)`))},{default:F(()=>[G(t.$slots,`defaultLine truncated
|
||||
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:Xd(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>Xd(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=Qd(c),u=e+1<n.length?Qd(n[e+1]):null;if(l&&u&&$d(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=Qd(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>Xd(e)),rows:r.map(e=>e.map(e=>Xd(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:Xd(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:Xd(c.replace(/^>\s?/,``))})):r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
|
||||
`)}),t}function Qd(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 $d(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var ef={class:`[overflow-wrap:anywhere]`},tf={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},nf={class:`font-mono text-[0.85em]`},rf={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},af={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},of={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},sf={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},cf={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},lf={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},uf={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},df={key:8,class:`mb-2.5 last:mb-0`},ff=N({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=J(()=>Zd(t.text));return(e,t)=>(I(),A(`div`,ef,[(I(!0),A(H,null,j(n.value,(e,t)=>(I(),A(H,{key:t},[e.kind===`pre`?(I(),A(`pre`,tf,[L(`code`,nf,z(e.code),1)])):e.kind===`table`?(I(),A(`table`,rf,[L(`thead`,null,[L(`tr`,null,[(I(!0),A(H,null,j(e.head,(e,t)=>(I(),A(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[k(Jd,{inline:e},null,8,[`inline`])]))),128))])]),L(`tbody`,null,[(I(!0),A(H,null,j(e.rows,(e,t)=>(I(),A(`tr`,{key:t},[(I(!0),A(H,null,j(e,(e,t)=>(I(),A(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[k(Jd,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(I(),A(`blockquote`,af,[k(Jd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(I(),A(`h1`,of,[k(Jd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(I(),A(`h2`,sf,[k(Jd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(I(),A(`h3`,cf,[k(Jd,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(I(),A(`ul`,lf,[(I(!0),A(H,null,j(e.items,(e,t)=>(I(),A(`li`,{key:t},[k(Jd,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(I(),A(`ol`,uf,[(I(!0),A(H,null,j(e.items,(e,t)=>(I(),A(`li`,{key:t},[k(Jd,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(I(),A(`p`,df,[k(Jd,{inline:e.inline},null,8,[`inline`])])):P(``,!0)],64))),128))]))}}),pf={class:`truncate`},mf=N({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Pe(`RouterLink`);return I(),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:F(()=>[k(B(ec),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),L(`span`,pf,z(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),hf={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},gf={class:`font-semibold text-foreground`},_f={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},vf=N({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=J(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=J(()=>t.tool.parameters||t.tool.Parameters||``),i=J(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=J(()=>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?(I(),K(mf,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(I(),A(`div`,hf,[k(B(ol),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),L(`span`,gf,z(n.value),1),r.value?(I(),A(`code`,_f,z(r.value),1)):P(``,!0),L(`span`,{class:R(B(U)(`text-fg-muted`,i.value&&`text-danger`))},z(a.value),3)]))}}),yf={key:0,class:`mb-2 grid gap-0.5 text-xs`},bf={key:1,class:`mb-2 flex flex-wrap gap-1.5`},xf={key:3,class:`whitespace-pre-wrap`},Sf=N({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(I(),A(`div`,{class:R([`flex`,e.assistant?`justify-start`:`justify-end`])},[L(`div`,{class:R(B(U)(`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?(I(),A(`div`,yf,[(I(!0),A(H,null,j(e.tools,(t,n)=>(I(),K(vf,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):P(``,!0),e.media.length?(I(),A(`div`,bf,[(I(!0),A(H,null,j(e.media,(e,t)=>(I(),K(Vd,{key:t,attachment:e},null,8,[`attachment`]))),128))])):P(``,!0),e.assistant?(I(),K(ff,{key:2,text:e.text},null,8,[`text`])):(I(),A(`div`,xf,z(e.text),1)),G(t.$slots,`default`)],2)],2))}}),Cf={class:`text-sm`},wf={key:0,class:`mt-1 text-fg-muted`},Tf={key:1,class:`mt-2 flex flex-wrap gap-2`},Ef=N({__name:`ChatChooseCard`,props:{choose:{}}
Line truncated
|
||||
`).map(e=>e.trim()).find(Boolean)||``,i=r.length>xv?`${r.slice(0,xv).trimEnd()}…`:r;return{text:i,full:n,truncated:i!==n}}function Cv(e){return String(e||`event`).replaceAll(`_`,` `).replace(/\b\w/g,e=>e.toUpperCase())}function wv(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 Tv(e){let t=Number(e);return!Number.isFinite(t)||t<=0?``:t.toLocaleString(`en-US`)}function Ev(e){return typeof e==`string`?e:``}function Dv(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=wv(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,Ev(t.error),Ev(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:[Ev(t.previous_stage)&&`after ${Ev(t.previous_stage)}`,Ev(t.previous_reason)].filter(Boolean).join(`: `)||e.detail||``}}if(e.kind===`agent_finish`){let r=Tv(t.iterations),i=Tv(t.tokens),a=Number(t.cached_tokens)||0,o=Tv((Number(t.prompt_tokens)||0)-a),s=Tv(t.completion_tokens),c=Tv(t.cached_tokens),l=[r&&`${r} iterations`,i&&`${i} tokens`,o&&`${o} fresh prompt`,s&&`${s} completion`,c&&`${c} cached`,Ev(t.model)].filter(Boolean);return{title:`Agent ${Ev(t.status)||`finished`}: ${n}`,detail:l.join(` · `)||e.detail||``}}if(e.kind===`remediation_round`){let e=Number(t.of),n=Ev(t.author);return{title:`Remediation ${Ev(t.round)}${e>0?` of ${e}`:``}`,detail:[n&&`answers ${n}'s review`,t.review_id?`#${Ev(t.review_id)}`:``].filter(Boolean).join(` `)}}if(e.kind===`review_approved`){let e=Ev(t.pr_number);return{title:`Pull request approved`,detail:[Ev(t.author),e&&`#${e}`].filter(Boolean).join(` · `)}}if(e.kind===`step_retried`)return{title:`Attempt ${Ev(t.attempt)} of ${Ev(t.of)} failed: ${e.stage||`step`}`,detail:Ev(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=Ev(t.source),n=Ev(t.capture_id),r=[{label:`binding ${Ev(t.binding_name)||Ev(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 ${Ev(t.captured_after)}`:``].filter(Boolean).join(` · `)}}return{title:Cv(e.kind||e.type),detail:e.detail||``}}var Ov=[`title`],kv=N({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=bv();n.watchIdentities();let r=e,i=t,a=lv(),o=J(()=>a.taskIDFor(r.event)),s=J(()=>Sv(r.event,n.identityName));function c(){o.value>0&&i(`open`,o.value)}let l=J(()=>r.event.at?U_(r.event.at):`–`);return(e,t)=>(I(),K(B(gv),{class:R(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:[ft(mt(c,[`prevent`]),[`enter`]),ft(mt(c,[`prevent`]),[`space`])]},{default:F(()=>[k(B(Q),{class:`font-medium`},{default:F(()=>[V(z(B(Dv)({...r.event,at:void 0,detail:void 0}).title),1)]),_:1}),k(B(Q),{class:`font-mono`},{default:F(()=>[V(z(o.value>0?`#${o.value}`:`–`),1)]),_:1}),k(B(Q),{class:`w-[55%] max-w-0`},{default:F(()=>[L(`span`,{class:`block truncate`,title:s.value.truncated?s.value.full:void 0},z(s.value.text),9,Ov)]),_:1}),k(B(Q),null,{default:F(()=>[V(z(l.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),Av=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function jv(e){return(Number(e?.task_id)||0)>0}function Mv(e,t){return t===`tasks`?jv(e):t!==`system`||!jv(e)}function Nv(e,t){return e.filter(e=>Mv(e,t))}function Pv(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function Fv(e,t){return`${e}:${t??0}`}function Iv(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=Fv(Sv(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 Lv={key:0,class:`font-normal text-fg-subtle`},Rv={role:`region`,"aria-label":`Activity`,"ari
Line truncated
|
||||
`,1)[0]??``;return t.length>80?`${t.slice(0,79)}…`:t}function tb(e){return(e?.merged||0)+(e?.completed||0)}function nb(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 rb(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function ib(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 ab(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=ib(e,r.type))}return n}var ob=[`onKeydown`],sb={key:0,class:`text-sm text-danger`,role:`alert`},cb={key:1,class:`grid gap-1.5`},lb=[`for`],ub={key:0,class:`font-normal text-fg-subtle`},db=[`id`],fb=[`value`],pb={key:0,class:`text-xs text-fg-subtle`},mb={key:2,class:`grid gap-1.5`},hb=[`id`],gb={class:`block truncate font-mono text-[13px] font-medium`},_b={class:`block text-xs text-fg-subtle`},vb={key:0,class:`text-xs text-fg-subtle`},yb={key:3,class:`grid gap-3`},bb=[`for`],xb={class:`font-mono`},Sb={key:0,class:`text-fg-subtle`},Cb={class:`grid gap-1.5`},wb=[`for`],Tb={class:`grid gap-1.5`},Eb=[`for`],Db={key:4,class:`text-sm text-danger`,role:`alert`},Ob={class:`flex items-center gap-2 border-t border-border pt-4`},kb={class:`mr-auto text-xs text-fg-subtle`},Ab=N({__name:`NewTaskForm`,props:{workflow:{},draft:{},initialWorkflow:{},initialInstructions:{}},emits:[`started`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=Ee(),a=q([]),o=q([]),s=q([]),c=q(``);He(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(eb(d.value)),p=q({});Te(()=>{!u.value&&a.value[0]&&(u.value=a.value[0].id)});let m=J(()=>a.value.find(e=>e.id===u.value)),h=J(()=>nb(m.value)),g=J(()=>rb(h.value,p.value)),_=J(()=>m.value?.repository??`required`),v=J(()=>_.value!==`optional`&&_.value!==`none`),y=e=>o.value.find(t=>t.workflow===e),b=q(!1),x=q(``),S=J(()=>!(!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:ab(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)=>(I(),A(`form`,{class:`grid gap-5`,onSubmit:mt(C,[`prevent`]),onKeydown:[ft(mt(C,[`meta`,`prevent`]),[`enter`]),ft(mt(C,[`ctrl`,`prevent`]),[`enter`])]},[c.value?(I(),A(`p`,sb,z(c.value),1)):P(``,!0),_.value===`none`?P(``,!0):(I(),A(`div`,cb,[L(`label`,{for:`${B(i)}-repo`,class:`text-[13px] font-medium`},[t[5]||=V(`Repository`,-1),v.value?P(``,!0):(I(),A(`span`,ub,` (optional)`))],8,lb),k(B(Z),{id:`${B(i)}-repo`,modelValue:l.value,"onUpdate:modelValue":t[0]||=e=>l.value=e,class:`font-mono`,placeholder:`owner/repository`,list:`${B(i)}-repos`,required:v.value},null,8,[`id`,`modelValue`,`list`,`required`]),L(`datalist`,{id:`${B(i)}-repos`},[(I(!0),A(H,null,j(s.value,e=>(I(),A(`option`,{key:e,value:e},null,8,fb))),128))],8,db),s.value.length?(I(),A(`p`,pb,[t[6]||=V(`Configured: `,-1),(I(!0),A(H,null,j(s.value,e=>(I(),K(B(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:F(()=>[V(z(e),1)]),_:2},1032,[`onClick`]))),128))])):P(``,!0)])),n.workflow?P(``,!0):(I(),A(`div`,mb,[L(`span`,{id:`${B(i)}-wf`,class:`text-[13px] font-medium`},`Workflow`,8,hb),k(B(ao),{modelValue:u.value,"onUpdate:modelValue":t[1]||=e=>u.value=e,"aria-labelledby":`${B(i)}-wf`,class:`grid grid-cols-1 gap-2 sm:grid-cols-3`,loop:``},{default:F(()=>[(I(!0),A(H,null,j(a.value,e=>(I(),K(B(so),{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:F(()=>[L(`span`,gb,z(e.name||e.id),1),L(`span`,_b,[V(z(y(e.id)?.runs||0)+` runs`,1),y(e.id)?.runs?(I(),A(H,{key:0},[V(` · `+z(Math.round(B(tb)(y(e.id))/(y(e.id)?.runs||1)*100))+`% delivered`,1)],64)):P(``,!0)])]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`,`aria-labelledby`]),!a.value.length&&!c.value?(I(),A(`p`,vb,`No enabled workflows.`)):P(``,!0)])),h.value.length?(I(),A(`div`,yb,[(I(!0),A(H,null,j(h.value,e=>(I(),A(`div`,{key:e.name,class:`grid gap-1.5`},[L(`label`,{for:`${B(i)}-input-${e.name}`,class:`text-[13px] font-medium`},[L(`span`,xb,z(e.name),1),e.required?(I(),A(`span`,Sb,` · required`)):P(``,!0)],8,bb),k(B(Z),{id:`${B(i)}-input-${e.name}`,"model-value":
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 Kb(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 qb(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 Jb(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 Yb(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 Xb=q([]),Zb=q([]),Qb=q(!0),$b=q(null),ex=q(!0),tx=q(null),nx=q(!1),rx=q(null);async function ix(){try{let e=await Y.eventTypes(Wb().workspace);Qb.value=e.enabled!==!1,Xb.value=e.event_types||[],Zb.value=e.proposals||[],$b.value=null}catch(e){$b.value=e.message||String(e)}finally{ex.value=!1}}function ax(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function ox(e){rx.value=null,tx.value=e}function sx(e){let t=hx.value.find(t=>String(t.id)===e.sample_id);ox({mode:`proposal`,id:null,source:e.source,name:``,rule:ax(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function cx(e=``){ox({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function lx(e){ox({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:ax(e.rule),headersText:``,body:``,exampleHeaders:{}})}function ux(){tx.value=null}async function dx(){let e=tx.value;if(e){nx.value=!0;try{if(e.mode===`edit`&&e.id)await Y.eventTypeUpdate(e.id,{name:e.name,rule:Yb(e.rule)});else{let t=e.mode===`paste`?Gb(e.headersText):e.exampleHeaders;await Y.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:Yb(e.rule),example:{headers:t,body:e.body}})}tx.value=null,await ix()}catch(e){rx.value=e.message||String(e)}finally{nx.value=!1}}}var fx=q(null);async function px(){let e=fx.value;if(fx.value=null,e)try{await Y.eventTypeDelete(e.id),await ix()}catch(e){$b.value=e.message||String(e)}}var mx=100,hx=q([]),gx=q(!0),_x=q(null),vx=q(!0),yx=q(null);async function bx(){try{let e=await Y.captures(mx);gx.value=e.enabled!==!1,hx.value=e.captures||[],_x.value=null}catch(e){_x.value=e.message||String(e)}finally{vx.value=!1}}function xx(e){let t=hx.value.find(t=>t.id===e);return t&&(yx.value=t),!!t}function Sx(){hx.value.length&&(yx.value=hx.value[0])}function Cx(){ep(`captures`,()=>{bx(),ix()})}var wx=N({__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=ht(n,`class`),a=ue(i,r);return(e,t)=>(I(),K(B(Zo),W({"data-slot":`tabs`,"data-orientation":B(a).orientation||`horizontal`},B(a),{class:B(U)(`gap-2 group/tabs flex data-horizontal:flex-col`,n.class)}),{default:F(t=>[G(e.$slots,`default`,Je(Se(t)))]),_:3},16,[`data-orientation`,`class`]))}}),Tx=N({__name:`TabsContent`,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=ht(t,`class`);return(e,r)=>(I(),K(B(es),W({"data-slot":`tabs-content`,class:B(U)(`text-sm flex-1 outline-none`,t.class)},B(n)),{default:F(()=>[G(e.$slots,`default`)]),_:3},16,[`class`]))}}),Ex=N({__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=ht(t,`class`,`variant`);return(r,i)=>(I(),K(B(ts),W({"data-slot":`tabs-list`,"data-variant":e.variant},B(n),{class:B(U)(B(Ox)({variant:e.variant}),t.class)}),{default:F(()=>[G(r.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),Dx=N({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=ht(t,`class`),r=pe(n);return(e,n)=>(I(),K(B(ns),W({"data-slot":`tabs-trigger`,class:B(U)(`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-visibleLine truncated
|
||||
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(bd.value=n.session_id),n.type===`delta`&&(o+=n.text,Td.value=Td.value?{...Td.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],Td.value=Td.value?{...Td.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),Td.value=Td.value?{...Td.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`);xd.value=[...xd.value,{from:`assistant`,text:o,tool_calls:a}],Td.value=null,Cd.value=`Ready`,await zd()}catch(e){let t=e;t.name===`AbortError`&&!c?(Td.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},Cd.value=`Stopped`):(Td.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?pd(r):void 0,isRetry:i},Cd.value=`Error. Retry available.`)}finally{clearTimeout(l),_d=null,Ld=null,wd.value=!1}}function Zd(){Cd.value=`Stopping…`,bd.value&&X.chatCancel(bd.value).catch(()=>{}),Rd()}function Qd(){L(()=>{zd().catch(e=>{Cd.value=e.message||`Chat unavailable`})}),Ke(()=>{Rd()})}async function $d(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 Xd({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var ef=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],tf=M({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return U(`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)=>(F(),k(`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":B(hd),onClick:i[0]||=e=>n(`toggle`)},[I(`span`,{"aria-hidden":`true`,class:R(r(!e.open))},[O(B(wu),{size:22})],2),I(`span`,{"aria-hidden":`true`,class:R(r(e.open))},[O(B(nd),{size:22})],2)],8,ef))}}),nf=M({__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=de(e,t);return(e,t)=>(F(),K(B(_o),W({"data-slot":`select`},B(n)),{default:P(t=>[G(e.$slots,`default`,Ye(we(t)))]),_:3},16))}}),rf=M({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=Et(n,`class`),a=de(i,r);return(t,r)=>(F(),K(B(Ro),null,{default:P(()=>[O(B(ko),W({"data-slot":`select-content`,"data-align-trigger":e.position===`item-aligned`},{...t.$attrs,...B(a)},{class:B(U)(`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:P(()=>[O(B(lf)),O(B(Wo),{"data-position":e.position,class:R(B(U)(`data-[position=popper]:h-(--reka-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--reka-select-trigger-width)`))},{default:P(()=>[G(t.$slots,`default`)]),_:
Line truncated
|
||||
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:am(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>am(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=sm(c),u=e+1<n.length?sm(n[e+1]):null;if(l&&u&&cm(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=sm(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>am(e)),rows:r.map(e=>e.map(e=>am(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:am(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:am(c.replace(/^>\s?/,``))})):r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
|
||||
`)}),t}function sm(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 cm(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var lm={class:`[overflow-wrap:anywhere]`},um={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},dm={class:`font-mono text-[0.85em]`},fm={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},pm={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},mm={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},hm={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},gm={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},_m={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},vm={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},ym={key:8,class:`mb-2.5 last:mb-0`},bm=M({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=J(()=>om(t.text));return(e,t)=>(F(),k(`div`,lm,[(F(!0),k(H,null,A(n.value,(e,t)=>(F(),k(H,{key:t},[e.kind===`pre`?(F(),k(`pre`,um,[I(`code`,dm,z(e.code),1)])):e.kind===`table`?(F(),k(`table`,fm,[I(`thead`,null,[I(`tr`,null,[(F(!0),k(H,null,A(e.head,(e,t)=>(F(),k(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[O(rm,{inline:e},null,8,[`inline`])]))),128))])]),I(`tbody`,null,[(F(!0),k(H,null,A(e.rows,(e,t)=>(F(),k(`tr`,{key:t},[(F(!0),k(H,null,A(e,(e,t)=>(F(),k(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[O(rm,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(F(),k(`blockquote`,pm,[O(rm,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(F(),k(`h1`,mm,[O(rm,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(F(),k(`h2`,hm,[O(rm,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(F(),k(`h3`,gm,[O(rm,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(F(),k(`ul`,_m,[(F(!0),k(H,null,A(e.items,(e,t)=>(F(),k(`li`,{key:t},[O(rm,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(F(),k(`ol`,vm,[(F(!0),k(H,null,A(e.items,(e,t)=>(F(),k(`li`,{key:t},[O(rm,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(F(),k(`p`,ym,[O(rm,{inline:e.inline},null,8,[`inline`])])):N(``,!0)],64))),128))]))}}),xm={class:`truncate`},Sm=M({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Ie(`RouterLink`);return F(),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:P(()=>[O(B(Ql),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),I(`span`,xm,z(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Cm={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},wm={class:`font-semibold text-foreground`},Tm={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},Em=M({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=J(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=J(()=>t.tool.parameters||t.tool.Parameters||``),i=J(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=J(()=>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?(F(),K(Sm,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(F(),k(`div`,Cm,[O(B(td),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),I(`span`,wm,z(n.value),1),r.value?(F(),k(`code`,Tm,z(r.value),1)):N(``,!0),I(`span`,{class:R(B(U)(`text-fg-muted`,i.value&&`text-danger`))},z(a.value),3)]))}}),Dm={key:0,class:`mb-2 grid gap-0.5 text-xs`},Om={key:1,class:`mb-2 flex flex-wrap gap-1.5`},km={key:3,class:`whitespace-pre-wrap`},Am=M({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(F(),k(`div`,{class:R([`flex`,e.assistant?`justify-start`:`justify-end`])},[I(`div`,{class:R(B(U)(`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?(F(),k(`div`,Dm,[(F(!0),k(H,null,A(e.tools,(t,n)=>(F(),K(Em,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):N(``,!0),e.media.length?(F(),k(`div`,Om,[(F(!0),k(H,null,A(e.media,(e,t)=>(F(),K(Xp,{key:t,attachment:e},null,8,[`attachment`]))),128))])):N(``,!0),e.assistant?(F(),K(bm,{key:2,text:e.text},null,8,[`text`])):(F(),k(`div`,km,z(e.text),1)),G(t.$slots,`default`)],2)],2))}}),jm={class:`text-sm`},Mm={key:0,class:`mt-1 text-fg-muted`},Nm={key:1,class:`mt-2 flex flex-wrap gap-2`},Pm=M({__name:`ChatChooseCard`,props:{choose:{}}
Line truncated
|
||||
`).map(e=>e.trim()).find(Boolean)||``,i=r.length>Tv?`${r.slice(0,Tv).trimEnd()}…`:r;return{text:i,full:n,truncated:i!==n}}function Dv(e){return String(e||`event`).replaceAll(`_`,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Ov(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 kv(e){let t=Number(e);return!Number.isFinite(t)||t<=0?``:t.toLocaleString(`en-US`)}function Av(e){return typeof e==`string`?e:``}function jv(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=Ov(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,Av(t.error),Av(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:[Av(t.previous_stage)&&`after ${Av(t.previous_stage)}`,Av(t.previous_reason)].filter(Boolean).join(`: `)||e.detail||``}}if(e.kind===`agent_finish`){let r=kv(t.iterations),i=kv(t.tokens),a=Number(t.cached_tokens)||0,o=kv((Number(t.prompt_tokens)||0)-a),s=kv(t.completion_tokens),c=kv(t.cached_tokens),l=[r&&`${r} iterations`,i&&`${i} tokens`,o&&`${o} fresh prompt`,s&&`${s} completion`,c&&`${c} cached`,Av(t.model)].filter(Boolean);return{title:`Agent ${Av(t.status)||`finished`}: ${n}`,detail:l.join(` · `)||e.detail||``}}if(e.kind===`remediation_round`){let e=Number(t.of),n=Av(t.author);return{title:`Remediation ${Av(t.round)}${e>0?` of ${e}`:``}`,detail:[n&&`answers ${n}'s review`,t.review_id?`#${Av(t.review_id)}`:``].filter(Boolean).join(` `)}}if(e.kind===`review_approved`){let e=Av(t.pr_number);return{title:`Pull request approved`,detail:[Av(t.author),e&&`#${e}`].filter(Boolean).join(` · `)}}if(e.kind===`step_retried`)return{title:`Attempt ${Av(t.attempt)} of ${Av(t.of)} failed: ${e.stage||`step`}`,detail:Av(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=Av(t.source),n=Av(t.capture_id),r=[{label:`binding ${Av(t.binding_name)||Av(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 ${Av(t.captured_after)}`:``].filter(Boolean).join(` · `)}}return{title:Dv(e.kind||e.type),detail:e.detail||``}}var Mv=[`title`],Nv=M({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=wv();n.watchIdentities();let r=e,i=t,a=pv(),o=J(()=>a.taskIDFor(r.event)),s=J(()=>Ev(r.event,n.identityName));function c(){o.value>0&&i(`open`,o.value)}let l=J(()=>r.event.at?q_(r.event.at):`–`);return(e,t)=>(F(),K(B(bv),{class:R(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:[_t(pt(c,[`prevent`]),[`enter`]),_t(pt(c,[`prevent`]),[`space`])]},{default:P(()=>[O(B(Q),{class:`font-medium`},{default:P(()=>[V(z(B(jv)({...r.event,at:void 0,detail:void 0}).title),1)]),_:1}),O(B(Q),{class:`font-mono`},{default:P(()=>[V(z(o.value>0?`#${o.value}`:`–`),1)]),_:1}),O(B(Q),{class:`w-[55%] max-w-0`},{default:P(()=>[I(`span`,{class:`block truncate`,title:s.value.truncated?s.value.full:void 0},z(s.value.text),9,Mv)]),_:1}),O(B(Q),null,{default:P(()=>[V(z(l.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),Pv=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function Fv(e){return(Number(e?.task_id)||0)>0}function Iv(e,t){return t===`tasks`?Fv(e):t!==`system`||!Fv(e)}function Lv(e,t){return e.filter(e=>Iv(e,t))}function Rv(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function zv(e,t){return`${e}:${t??0}`}function Bv(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=zv(Ev(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 Vv={key:0,class:`font-normal text-fg-subtle`},Hv={role:`region`,"aria-label":`Activity`,"ari
Line truncated
|
||||
`,1)[0]??``;return t.length>80?`${t.slice(0,79)}…`:t}function ab(e){return(e?.merged||0)+(e?.completed||0)}function ob(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 sb(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function cb(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 lb(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=cb(e,r.type))}return n}var ub=[`onKeydown`],db={key:0,class:`text-sm text-danger`,role:`alert`},fb={key:1,class:`grid gap-1.5`},pb=[`for`],mb={key:0,class:`font-normal text-fg-subtle`},hb=[`id`],gb=[`value`],_b={key:0,class:`text-xs text-fg-subtle`},vb={key:2,class:`grid gap-1.5`},yb=[`id`],bb={class:`block truncate text-[13px] font-medium`},xb={class:`block text-xs text-fg-subtle`},Sb={key:0,class:`text-xs text-fg-subtle`},Cb={key:3,class:`grid gap-3`},wb=[`for`],Tb={class:`font-mono`},Eb={key:0,class:`text-fg-subtle`},Db={class:`grid gap-1.5`},Ob=[`for`],kb={class:`grid gap-1.5`},Ab=[`for`],jb={key:4,class:`text-sm text-danger`,role:`alert`},Mb={class:`flex items-center gap-2 border-t border-border pt-4`},Nb={class:`mr-auto text-xs text-fg-subtle`},Pb=M({__name:`NewTaskForm`,props:{workflow:{},draft:{},initialWorkflow:{},initialInstructions:{}},emits:[`started`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=Oe(),a=q([]),o=q([]),s=q([]),c=q(``);L(async()=>{try{let[e,t]=await Promise.all([X.workflows(),X.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(ib(d.value)),p=q({});De(()=>{!u.value&&a.value[0]&&(u.value=a.value[0].id)});let m=J(()=>a.value.find(e=>e.id===u.value)),h=J(()=>ob(m.value)),g=J(()=>sb(h.value,p.value)),_=J(()=>m.value?.repository??`required`),v=J(()=>_.value!==`optional`&&_.value!==`none`),y=e=>o.value.find(t=>t.workflow===e),b=q(!1),x=q(``),S=J(()=>!(!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 X.workRequest({repository:_.value===`none`?``:l.value.trim(),workflow:u.value,title:f.value.trim(),instructions:d.value,inputs:lb(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)=>(F(),k(`form`,{class:`grid gap-5`,onSubmit:pt(C,[`prevent`]),onKeydown:[_t(pt(C,[`meta`,`prevent`]),[`enter`]),_t(pt(C,[`ctrl`,`prevent`]),[`enter`])]},[c.value?(F(),k(`p`,db,z(c.value),1)):N(``,!0),_.value===`none`?N(``,!0):(F(),k(`div`,fb,[I(`label`,{for:`${B(i)}-repo`,class:`text-[13px] font-medium`},[t[5]||=V(`Repository`,-1),v.value?N(``,!0):(F(),k(`span`,mb,` (optional)`))],8,pb),O(B(Z),{id:`${B(i)}-repo`,modelValue:l.value,"onUpdate:modelValue":t[0]||=e=>l.value=e,class:`font-mono`,placeholder:`owner/repository`,list:`${B(i)}-repos`,required:v.value},null,8,[`id`,`modelValue`,`list`,`required`]),I(`datalist`,{id:`${B(i)}-repos`},[(F(!0),k(H,null,A(s.value,e=>(F(),k(`option`,{key:e,value:e},null,8,gb))),128))],8,hb),s.value.length?(F(),k(`p`,_b,[t[6]||=V(`Configured: `,-1),(F(!0),k(H,null,A(s.value,e=>(F(),K(B(Y),{key:e,type:`button`,variant:`link`,size:`xs`,class:`h-auto px-1 font-mono text-fg-subtle`,onClick:t=>l.value=e},{default:P(()=>[V(z(e),1)]),_:2},1032,[`onClick`]))),128))])):N(``,!0)])),n.workflow?N(``,!0):(F(),k(`div`,vb,[I(`span`,{id:`${B(i)}-wf`,class:`text-[13px] font-medium`},`Workflow`,8,yb),O(B(ao),{modelValue:u.value,"onUpdate:modelValue":t[1]||=e=>u.value=e,"aria-labelledby":`${B(i)}-wf`,class:`grid grid-cols-1 gap-2 sm:grid-cols-3`,loop:``},{default:P(()=>[(F(!0),k(H,null,A(a.value,e=>(F(),K(B(so),{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:P(()=>[I(`span`,bb,z(e.name||e.id),1),I(`span`,xb,[V(z(y(e.id)?.runs||0)+` runs`,1),y(e.id)?.runs?(F(),k(H,{key:0},[V(` · `+z(Math.round(B(ab)(y(e.id))/(y(e.id)?.runs||1)*100))+`% delivered`,1)],64)):N(``,!0)])]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`,`aria-labelledby`]),!a.value.length&&!c.value?(F(),k(`p`,Sb,`No enabled workflows.`)):N(``,!0)])),h.value.length?(F(),k(`div`,Cb,[(F(!0),k(H,null,A(h.value,e=>(F(),k(`div`,{key:e.name,class:`grid gap-1.5`},[I(`label`,{for:`${B(i)}-input-${e.name}`,class:`text-[13px] font-medium`},[I(`span`,Tb,z(e.name),1),e.required?(F(),k(`span`,Eb,` · required`)):N(``,!0)],8,wb),O(B(Z),{id:`${B(i)}-input-${e.name}`,"model-value":p.value[e.n
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 Xb(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 Zb(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 Qb(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 $b(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 ex=q([]),tx=q([]),nx=q(!0),rx=q(null),ix=q(!0),ax=q(null),ox=q(!1),sx=q(null);async function cx(){try{let e=await X.eventTypes(Jb().workspace);nx.value=e.enabled!==!1,ex.value=e.event_types||[],tx.value=e.proposals||[],rx.value=null}catch(e){rx.value=e.message||String(e)}finally{ix.value=!1}}function lx(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function ux(e){sx.value=null,ax.value=e}function dx(e){let t=yx.value.find(t=>String(t.id)===e.sample_id);ux({mode:`proposal`,id:null,source:e.source,name:``,rule:lx(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function fx(e=``){ux({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function px(e){ux({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:lx(e.rule),headersText:``,body:``,exampleHeaders:{}})}function mx(){ax.value=null}async function hx(){let e=ax.value;if(e){ox.value=!0;try{if(e.mode===`edit`&&e.id)await X.eventTypeUpdate(e.id,{name:e.name,rule:$b(e.rule)});else{let t=e.mode===`paste`?Yb(e.headersText):e.exampleHeaders;await X.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:$b(e.rule),example:{headers:t,body:e.body}})}ax.value=null,await cx()}catch(e){sx.value=e.message||String(e)}finally{ox.value=!1}}}var gx=q(null);async function _x(){let e=gx.value;if(gx.value=null,e)try{await X.eventTypeDelete(e.id),await cx()}catch(e){rx.value=e.message||String(e)}}var vx=100,yx=q([]),bx=q(!0),xx=q(null),Sx=q(!0),Cx=q(null);async function wx(){try{let e=await X.captures(vx);bx.value=e.enabled!==!1,yx.value=e.captures||[],xx.value=null}catch(e){xx.value=e.message||String(e)}finally{Sx.value=!1}}function Tx(e){let t=yx.value.find(t=>t.id===e);return t&&(Cx.value=t),!!t}function Ex(){yx.value.length&&(Cx.value=yx.value[0])}function Dx(){ch(`captures`,()=>{wx(),cx()})}var Ox=M({__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=Et(n,`class`),a=de(i,r);return(e,t)=>(F(),K(B(Zo),W({"data-slot":`tabs`,"data-orientation":B(a).orientation||`horizontal`},B(a),{class:B(U)(`gap-2 group/tabs flex data-horizontal:flex-col`,n.class)}),{default:P(t=>[G(e.$slots,`default`,Ye(we(t)))]),_:3},16,[`data-orientation`,`class`]))}}),kx=M({__name:`TabsContent`,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Et(t,`class`);return(e,r)=>(F(),K(B(es),W({"data-slot":`tabs-content`,class:B(U)(`text-sm flex-1 outline-none`,t.class)},B(n)),{default:P(()=>[G(e.$slots,`default`)]),_:3},16,[`class`]))}}),Ax=M({__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=Et(t,`class`,`variant`);return(r,i)=>(F(),K(B(ts),W({"data-slot":`tabs-list`,"data-variant":e.variant},B(n),{class:B(U)(B(Mx)({variant:e.variant}),t.class)}),{default:P(()=>[G(r.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),jx=M({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Et(t,`class`),r=me(n);return(e,n)=>(F(),K(B(ns),W({"data-slot":`tabs-trigger`,class:B(U)(`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-visibleLine 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 PN=bN(`CharSizeService`),FN=bN(`CoreBrowserService`),IN=bN(`MouseService`),LN=bN(`RenderService`),RN=bN(`SelectionService`),zN=bN(`CharacterJoinerService`),BN=bN(`ThemeService`),VN=bN(`LinkProviderService`),HN=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?JN.isErrorNoTelemetry(e)?new JN(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 LN=CN(`CharSizeService`),RN=CN(`CoreBrowserService`),zN=CN(`MouseService`),BN=CN(`RenderService`),VN=CN(`SelectionService`),HN=CN(`CharacterJoinerService`),UN=CN(`ThemeService`),WN=CN(`LinkProviderService`),GN=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ZN.isErrorNoTelemetry(e)?new ZN(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 UN(e){GN(e)||HN.onUnexpectedError(e)}var WN=`Canceled`;function GN(e){return e instanceof KN||e instanceof Error&&e.name===WN&&e.message===WN}var KN=class extends Error{constructor(){super(WN),this.name=this.message}};function qN(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var JN=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`}},YN=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function XN(e,t=0){return e[e.length-(1+t)]}var ZN;(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})(ZN||={});var QN=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||ZN.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};QN.empty=new QN(e=>{});function $N(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 eP;(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})(eP||={});var tP=null;function nP(e){return tP?.trackDisposable(e),e}function rP(e){tP?.markAsDisposed(e)}function iP(e,t){tP?.setParent(e,t)}function aP(e){return tP?.markAsSingleton(e),e}function oP(e){if(eP.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 sP(...e){return cP(()=>oP(e))}function cP(e){let t=nP({dispose:$N(()=>{rP(t),e()})});return t}var lP=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,nP(this)}dispose(){this._isDisposed||(rP(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{oP(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return iP(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),iP(e,null))}};lP.DISABLE_DISPOSED_WARNING=!1;var uP=lP,dP=class{constructor(){this._store=new uP,nP(this),iP(this._store,this)}dispose(){rP(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 KN(e){JN(e)||GN.onUnexpectedError(e)}var qN=`Canceled`;function JN(e){return e instanceof YN||e instanceof Error&&e.name===qN&&e.message===qN}var YN=class extends Error{constructor(){super(qN),this.name=this.message}};function XN(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var ZN=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`}},QN=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function $N(e,t=0){return e[e.length-(1+t)]}var eP;(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})(eP||={});var tP=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||eP.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};tP.empty=new tP(e=>{});function nP(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 rP;(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})(rP||={});var iP=null;function aP(e){return iP?.trackDisposable(e),e}function oP(e){iP?.markAsDisposed(e)}function sP(e,t){iP?.setParent(e,t)}function cP(e){return iP?.markAsSingleton(e),e}function lP(e){if(rP.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 uP(...e){return dP(()=>lP(e))}function dP(e){let t=aP({dispose:nP(()=>{oP(t),e()})});return t}var fP=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,aP(this)}dispose(){this._isDisposed||(oP(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{lP(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return sP(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),sP(e,null))}};fP.DISABLE_DISPOSED_WARNING=!1;var pP=fP,mP=class{constructor(){this._store=new pP,aP(this),sP(this._store,this)}dispose(){oP(thi
Line truncated
|
||||
`).slice(2).join(`
|
||||
`))}},EP=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},DP=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},OP=0,kP=class{constructor(e){this.value=e,this.id=OP++}},AP=2,jP=class{constructor(e){this._size=0,this._options=e,this._leakageMon=SP>0||this._options?.leakWarningThreshold?new wP(e?.onListenerError??UN,this._options?.leakWarningThreshold??SP):void 0,this._perfMon=this._options?._profName?new xP(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 DP(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||UN)(n),dP.None}if(this._disposed)return dP.None;t&&(e=e.bind(t));let r=new kP(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=TP.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof kP?(this._deliveryQueue??=new MP,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=cP(()=>{i?.(),this._removeListener(r)});return n instanceof uP?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*AP<=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||UN;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 kP)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}},MP=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}},NP=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new jP,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new jP,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}};NP.INSTANCE=new NP;var PP=NP;function FP(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}PP.INSTANCE.onDidChangeZoomLevel;function IP(e){return PP.INSTANCE.getZoomFactor(e)}PP.INSTANCE.onDidChangeFullscreen;var LP=typeof navigator==`object`?navigator.userAgent:``,RP=LP.indexOf(`Firefox`)>=0,zP=LP.indexOf(`AppleWebKit`)>=0,BP=LP.indexOf(`Chrome`)>=0,VP=!BP&&LP.indexOf(`Safari`)>=0;LP.indexOf(`Electron/`),LP.indexOf(`Android`);var HP=!1;if(typeof pP.matchMedia==`function`){let e=pP.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=pP.matchMedia(`(display-mode: fullscreen)`);HP=e.matches,FP(pP,e,({matches:e})=>{HP&&t.matches||(HP=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}};RI=JM([YM(2,SN),YM(3,FN),YM(4,CN),YM(5,BN),YM(6,ON),YM(7,LN)],RI);var zI=class extends dP{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(cP(()=>{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 GI;(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=``))(GI||={});var KI;(e=>e.ST=`${$.ESC}\\`)(KI||={});var qI=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)}}};qI=JM([YM(2,SN),YM(3,ON),YM(4,wN),YM(5,LN)],qI);var JI=0,YI=0,XI=0,ZI=0,QI={css:`#00000000`,rgba:0},$I;(e=>{function t(e,t,n,r){return r===void 0?`#${iL(e)}${iL(t)}${iL(n)}`:`#${iL(e)}${iL(t)}${iL(n)}${iL(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})($I||={});var eL;(e=>{function t(e,t){if(ZI=(t.rgba&255)/255,ZI===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 JI=a+Math.round((n-a)*ZI),YI=o+Math.round((r-o)*ZI),XI=s+Math.round((i-s)*ZI),{css:$I.toCss(JI,YI,XI),rgba:$I.toRgba(JI,YI,XI)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=rL.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return $I.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[JI,YI,XI]=rL.toChannels(t),{css:$I.toCss(JI,YI,XI),rgba:t}}e.opaque=i;function a(e,t){return ZI=Math.round(t*255),[JI,YI,XI]=rL.toChannels(e.rgba),{css:$I.toCss(JI,YI,XI,ZI),rgba:$I.toRgba(JI,YI,XI,ZI)}}e.opacity=a;function o(e,t){return ZI=e.rgba&255,a(e,ZI*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.r
Line truncated
|
||||
`))}},kP=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},AP=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},jP=0,MP=class{constructor(e){this.value=e,this.id=jP++}},NP=2,PP=class{constructor(e){this._size=0,this._options=e,this._leakageMon=TP>0||this._options?.leakWarningThreshold?new DP(e?.onListenerError??KN,this._options?.leakWarningThreshold??TP):void 0,this._perfMon=this._options?._profName?new wP(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 AP(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||KN)(n),mP.None}if(this._disposed)return mP.None;t&&(e=e.bind(t));let r=new MP(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=OP.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof MP?(this._deliveryQueue??=new FP,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=dP(()=>{i?.(),this._removeListener(r)});return n instanceof pP?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*NP<=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||KN;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 MP)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}},FP=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}},IP=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new PP,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new PP,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}};IP.INSTANCE=new IP;var LP=IP;function RP(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}LP.INSTANCE.onDidChangeZoomLevel;function zP(e){return LP.INSTANCE.getZoomFactor(e)}LP.INSTANCE.onDidChangeFullscreen;var BP=typeof navigator==`object`?navigator.userAgent:``,VP=BP.indexOf(`Firefox`)>=0,HP=BP.indexOf(`AppleWebKit`)>=0,UP=BP.indexOf(`Chrome`)>=0,WP=!UP&&BP.indexOf(`Safari`)>=0;BP.indexOf(`Electron/`),BP.indexOf(`Android`);var GP=!1;if(typeof gP.matchMedia==`function`){let e=gP.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=gP.matchMedia(`(display-mode: fullscreen)`);GP=e.matches,RP(gP,e,({matches:e})=>{GP&&t.matches||(GP=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}};VI=ZM([QM(2,TN),QM(3,RN),QM(4,EN),QM(5,UN),QM(6,jN),QM(7,BN)],VI);var HI=class extends mP{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(dP(()=>{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 JI;(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=``))(JI||={});var YI;(e=>e.ST=`${$.ESC}\\`)(YI||={});var XI=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)}}};XI=ZM([QM(2,TN),QM(3,jN),QM(4,DN),QM(5,BN)],XI);var ZI=0,QI=0,$I=0,eL=0,tL={css:`#00000000`,rgba:0},nL;(e=>{function t(e,t,n,r){return r===void 0?`#${sL(e)}${sL(t)}${sL(n)}`:`#${sL(e)}${sL(t)}${sL(n)}${sL(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})(nL||={});var rL;(e=>{function t(e,t){if(eL=(t.rgba&255)/255,eL===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 ZI=a+Math.round((n-a)*eL),QI=o+Math.round((r-o)*eL),$I=s+Math.round((i-s)*eL),{css:nL.toCss(ZI,QI,$I),rgba:nL.toRgba(ZI,QI,$I)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=oL.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return nL.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[ZI,QI,$I]=oL.toChannels(t),{css:nL.toCss(ZI,QI,$I),rgba:t}}e.opaque=i;function a(e,t){return eL=Math.round(t*255),[ZI,QI,$I]=oL.toChannels(e.rgba),{css:nL.toCss(ZI,QI,$I,eL),rgba:nL.toRgba(ZI,QI,$I,eL)}}e.opacity=a;function o(e,t){return eL=e.rgba&255,a(e,eL*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()),YL&&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=vR(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=NL(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,-yR),yR),t/=yR,t/Math.abs(t)+Math.round(t*(bR-1)))}shouldForceSelection(e){return GL?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(),xR)}_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&&!(GL&&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(JF(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(cP(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<xB+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
||||
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===xB+1&&(this._liveRegion.textContent+=$M.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 ZM.get()},set promptLabel(e){ZM.set(e)},get tooMuchOutput(){return $M.get()},set tooMuchOutput(e){$M.set(e)}}}_verifyIntegers(...e){for(PB of e)if(PB===1/0||isNaN(PB)||PB%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(PB of e)if(PB&&(PB===1/0||isNaN(PB)||PB%1!=0||PB<0))throw Error(`This API only accepts positive integers`)}},IB=2,LB=1,RB=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(IB,Math.floor(u/e.css.cell.width)),rows:Math.max(LB,Math.floor(l/e.css.cell.height))}}},zB={class:`flex h-[32rem] min-h-0 flex-col gap-2`},BB={key:0,class:`text-sm text-fg-muted`,role:`status`},VB=N({__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 He(()=>{let e=n.value;if(!e)return;i=new FB({convertEol:!0,disableStdin:!0,cursorBlink:!1,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`}}),o=new RB,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)}),nt(()=>{s?.disconnect(),s=null,a?.close(),a=null,i?.dispose(),i=null,o=null}),(e,t)=>(I(),A(`div`,zB,[r.value===`open`?P(``,!0):(I(),A(`p`,BB,[r.value===`connecting`?(I(),A(H,{key:0},[V(`Connecting…`)],64)):r.value===`closed`?(I(),A(H,{key:1},[V(`The sandbox ended.`)],64)):(I(),A(H,{key:2},[V(`Sandbox unavailable.`)],64))])),L(`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)]))}}),HB={class:`flex flex-wrap items-center gap-3 border-b border-border pb-3`},UB={class:`inline-flex items-center gap-2`},WB={class:`inline-flex items-center gap-2`},GB=`__all__`,KB=N({__name:`TaskLogFilters`,props:{filters:{},stages:{}},emits:[`filter`],setup(e,{emit:t}){let n=e,r=t,i=J(()=>dT.map(e=>({value:e.value||GB,label:e.label}))),a=J(()=>n.filters.level||GB),o=J(()=>n.filters.stage||GB);function s(e){r(`filter`,{...n.filters,...e})}function c(e){s({level:String(e)===GB?``:String(e)})}function l(e){s({stage:String(e)===GB?``:String(e)})}return(t,n)=>(I(),A(`div`,HB,[L(`div`,UB,[k(B(Xl),{"model-value":a.value,"onUpdate:modelValue":c},{default:F(()=>[k(B(tu),{size:`sm`,"aria-label":`Filter log entries by level`},{default:F(()=>[k(B(nu))]),_:1}),k(B(Zl),null,{default:F(()=>[k(B(Ql),null,{default:F(()=>[(I(!0),A(H,null,j(i.value,e=>(I(),K(B($l),{key:e.value,value:e.value},{default:F(()=>[V(z(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])]),L(`div`,WB,[k(B(Xl),{"model-value":o.value,"onUpdate:modelValue":l},{default:F(()=>[k(B(tu),{size:`sm`,"aria-label":`Filter log entries by stage`},{default:F(()=>[k(B(nu))]),_:1}),k(B(Zl),null,{default:F(()=>[k(B(Ql),null,{default:F(()=>[k(B($l),{value:GB},{default:F(()=>[...n[0]||=[V(`All stages`,-1)]]),_:1}),(I(!0),A(H,null,j(e.stages,e=>(I(),K(B($l),{key:e,value:e},{default:F(()=>[V(z(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])])]))}}),qB={class:`sr-only`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`},JB={key:2,class:`flex flex-col items-start gap-2 py-3`},YB={key:0,class:`mt-2 flex flex-wrap items-cent
Line truncated
|
||||
`)}};sK.defaultYaml={explicit:!1,version:`1.2`},sK.defaultTags={"!!":`tag:yaml.org,2002:`};function cK(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 lK(e){let t=new Set;return eK(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function uK(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function dK(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=lK(e);let a=uK(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(KG(t.node)||JG(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 fK(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=fK(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=fK(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=fK(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=fK(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function pK(e,t,n){if(Array.isArray(e))return e.map((e,t)=>pK(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!XG(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 mK=class{constructor(e){Object.defineProperty(this,VG,{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(!UG(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=pK(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?fK(i,{"":o},``,o):o}},hK=class extends mK{constructor(e){super(FG),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=[],eK(e,{Node:(e,t)=>{(HG(t)||XG(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||=(pK(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=gK(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(cK(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 gK(e,t,n){if(HG(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(JG(t)){let r=0;for(let i of t.items){let t=gK(e,i,n);t>r&&(r=t)}return r}if(GG(t)){let r=gK(e,t.key,n),i=gK(e,t.value,n);return Math.max(r,i)}return 1}var _K=e=>!e||typeof e!=`function`&&typeof e!=`object`,vK=class extends mK{constructor(e){super(zG),this.value=e}toJSON(e,t){return t?.keep?this.value:pK(this.value,e,t)}toString(){return String(this.value)}};vK.BLOCK_FOLDED=`BLOCK_FOLDED`,vK.BLOCK_LITERAL=`BLOCK_LITERAL`,vK.PLAIN=`PLAIN`,vK.QUOTE_DOUBLE=`QUOTE_DOUBLE`,vK.QUOTE_SINGLE=`QUOTE_SINGLE`;var yK=`tag:yaml.org,2002:`;function bK(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 xK(e,t,n){if(UG(e)&&(e=e.contents),YG(e))return e;if(GG(e)){let t=n.schema[LG].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 hK(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=yK+t.slice(2));let l=bK(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new vK(e);return c&&(c.node=t),t
Line truncated
|
||||
`)?EK(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()),QL&&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=xR(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=IL(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,-SR),SR),t/=SR,t/Math.abs(t)+Math.round(t*(CR-1)))}shouldForceSelection(e){return JL?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(),wR)}_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&&!(JL&&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(ZF(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(dP(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<wB+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
||||
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===wB+1&&(this._liveRegion.textContent+=nN.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 eN.get()},set promptLabel(e){eN.set(e)},get tooMuchOutput(){return nN.get()},set tooMuchOutput(e){nN.set(e)}}}_verifyIntegers(...e){for(LB of e)if(LB===1/0||isNaN(LB)||LB%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(LB of e)if(LB&&(LB===1/0||isNaN(LB)||LB%1!=0||LB<0))throw Error(`This API only accepts positive integers`)}},zB=2,BB=1,VB=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(zB,Math.floor(u/e.css.cell.width)),rows:Math.max(BB,Math.floor(l/e.css.cell.height))}}},HB={class:`flex h-[32rem] min-h-0 flex-col gap-2`},UB={key:0,class:`text-sm text-fg-muted`,role:`status`},WB=M({__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 L(()=>{let e=n.value;if(!e)return;i=new RB({convertEol:!0,disableStdin:!0,cursorBlink:!1,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`}}),o=new VB,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)}),rt(()=>{s?.disconnect(),s=null,a?.close(),a=null,i?.dispose(),i=null,o=null}),(e,t)=>(F(),k(`div`,HB,[r.value===`open`?N(``,!0):(F(),k(`p`,UB,[r.value===`connecting`?(F(),k(H,{key:0},[V(`Connecting…`)],64)):r.value===`closed`?(F(),k(H,{key:1},[V(`The sandbox ended.`)],64)):(F(),k(H,{key:2},[V(`Sandbox unavailable.`)],64))])),I(`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)]))}}),GB={class:`flex flex-wrap items-center gap-3 border-b border-border pb-3`},KB={class:`inline-flex items-center gap-2`},qB={class:`inline-flex items-center gap-2`},JB=`__all__`,YB=M({__name:`TaskLogFilters`,props:{filters:{},stages:{}},emits:[`filter`],setup(e,{emit:t}){let n=e,r=t,i=J(()=>mT.map(e=>({value:e.value||JB,label:e.label}))),a=J(()=>n.filters.level||JB),o=J(()=>n.filters.stage||JB);function s(e){r(`filter`,{...n.filters,...e})}function c(e){s({level:String(e)===JB?``:String(e)})}function l(e){s({stage:String(e)===JB?``:String(e)})}return(t,n)=>(F(),k(`div`,GB,[I(`div`,KB,[O(B(nf),{"model-value":a.value,"onUpdate:modelValue":c},{default:P(()=>[O(B(uf),{size:`sm`,"aria-label":`Filter log entries by level`},{default:P(()=>[O(B(df))]),_:1}),O(B(rf),null,{default:P(()=>[O(B(af),null,{default:P(()=>[(F(!0),k(H,null,A(i.value,e=>(F(),K(B(sf),{key:e.value,value:e.value},{default:P(()=>[V(z(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])]),I(`div`,qB,[O(B(nf),{"model-value":o.value,"onUpdate:modelValue":l},{default:P(()=>[O(B(uf),{size:`sm`,"aria-label":`Filter log entries by stage`},{default:P(()=>[O(B(df))]),_:1}),O(B(rf),null,{default:P(()=>[O(B(af),null,{default:P(()=>[O(B(sf),{value:JB},{default:P(()=>[...n[0]||=[V(`All stages`,-1)]]),_:1}),(F(!0),k(H,null,A(e.stages,e=>(F(),K(B(sf),{key:e,value:e},{default:P(()=>[V(z(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])])]))}}),XB={class:`sr-only`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`},ZB={key:2,class:`flex flex-col items-start gap-2 py-3`},QB={key:0,class:`mt-2 flex flex-wrap items-cente
Line truncated
|
||||
`)}};uK.defaultYaml={explicit:!1,version:`1.2`},uK.defaultTags={"!!":`tag:yaml.org,2002:`};function dK(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 fK(e){let t=new Set;return rK(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function pK(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function mK(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=fK(e);let a=pK(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(YG(t.node)||ZG(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 hK(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=hK(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=hK(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=hK(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=hK(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function gK(e,t,n){if(Array.isArray(e))return e.map((e,t)=>gK(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!$G(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 _K=class{constructor(e){Object.defineProperty(this,WG,{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(!KG(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=gK(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?hK(i,{"":o},``,o):o}},vK=class extends _K{constructor(e){super(RG),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=[],rK(e,{Node:(e,t)=>{(GG(t)||$G(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||=(gK(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=yK(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(dK(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 yK(e,t,n){if(GG(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(ZG(t)){let r=0;for(let i of t.items){let t=yK(e,i,n);t>r&&(r=t)}return r}if(JG(t)){let r=yK(e,t.key,n),i=yK(e,t.value,n);return Math.max(r,i)}return 1}var bK=e=>!e||typeof e!=`function`&&typeof e!=`object`,xK=class extends _K{constructor(e){super(HG),this.value=e}toJSON(e,t){return t?.keep?this.value:gK(this.value,e,t)}toString(){return String(this.value)}};xK.BLOCK_FOLDED=`BLOCK_FOLDED`,xK.BLOCK_LITERAL=`BLOCK_LITERAL`,xK.PLAIN=`PLAIN`,xK.QUOTE_DOUBLE=`QUOTE_DOUBLE`,xK.QUOTE_SINGLE=`QUOTE_SINGLE`;var SK=`tag:yaml.org,2002:`;function CK(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 wK(e,t,n){if(KG(e)&&(e=e.contents),QG(e))return e;if(JG(e)){let t=n.schema[BG].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 vK(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=SK+t.slice(2));let l=CK(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new xK(e);return c&&(c.node=t),t
Line truncated
|
||||
`)?kK(n,t):n.includes(`
|
||||
`)?`
|
||||
`+EK(n,t):(e.endsWith(` `)?``:` `)+n,OK=`flow`,kK=`block`,AK=`quoted`;function jK(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=MK(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=MK(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
||||
`+kK(n,t):(e.endsWith(` `)?``:` `)+n,jK=`flow`,MK=`block`,NK=`quoted`;function PK(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=FK(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=FK(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 MK(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 NK=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),PK=e=>/^(%|---|\.\.\.)/m.test(e);function FK(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 IK(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(PK(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 FK(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 IK=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),LK=e=>/^(%|---|\.\.\.)/m.test(e);function RK(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 zK(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(LK(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:jK(o,a,AK,NK(t,!1))}function LK(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
||||
`)||/[ \t]\n|\n[ \t]/.test(e))return IK(e,t);let n=t.indent||(PK(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:jK(r,n,OK,NK(t,!1))}function RK(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=IK;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?LK:i&&!t?IK:n?LK:IK}return r(e,t)}var zK;try{zK=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:PK(o,a,NK,IK(t,!1))}function BK(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
||||
`)||/[ \t]\n|\n[ \t]/.test(e))return zK(e,t);let n=t.indent||(LK(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:PK(r,n,jK,IK(t,!1))}function VK(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=zK;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?BK:i&&!t?zK:n?BK:zK}return r(e,t)}var HK;try{HK=RegExp(`(^|(?<!
|
||||
))
|
||||
+(?!
|
||||
|$)`,`g`)}catch{zK=/\n+(?!\n|$)/g}function BK({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 RK(n,r);let l=r.indent||(r.forceBlockIndent||PK(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===vK.BLOCK_FOLDED?!1:t===vK.BLOCK_LITERAL||!FK(n,c,l.length);if(!n)return u?`|
|
||||
|$)`,`g`)}catch{HK=/\n+(?!\n|$)/g}function UK({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 VK(n,r);let l=r.indent||(r.forceBlockIndent||LK(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===xK.BLOCK_FOLDED?!1:t===xK.BLOCK_LITERAL||!RK(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(zK,`$&${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(HK,`$&${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=NK(r,!0);o!==`folded`&&t!==vK.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=jK(`${v}${e}${p}`,l,kK,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function VK(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 RK(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
||||
`)?RK(a,t):BK(e,t,n,r);if(!s&&!u&&i!==vK.PLAIN&&a.includes(`
|
||||
`))return BK(e,t,n,r);if(PK(a)){if(c===``)return t.forceBlockIndent=!0,BK(e,t,n,r);if(s&&c===l)return RK(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 RK(a,t)}return s?d:jK(d,c,OK,NK(t,!1))}function HK(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!==vK.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=vK.QUOTE_DOUBLE);let c=e=>{switch(e){case vK.BLOCK_FOLDED:case vK.BLOCK_LITERAL:return i||a?RK(o.value,t):BK(o,t,n,r);case vK.QUOTE_DOUBLE:return IK(o.value,t);case vK.QUOTE_SINGLE:return LK(o.value,t);case vK.PLAIN:return VK(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 UK(e,t){let n=Object.assign({blockQuote:!0,commentString:TK,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 WK(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(KG(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 GK(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(KG(e)||JG(e))&&e.anchor;a&&cK(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 KK(e,t,n,r){if(GG(e))return e.toString(t,n,r);if(HG(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=YG(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=WK(t.doc.schema.tags,a);let o=GK(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):KG(a)?HK(a,t,n,r):a.toString(t,n,r);return o?KG(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function qK({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=YG(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(JG(e)||!YG(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||JG(e)||(KG(e)?e.type===vK.BLOCK_FOLDED||e.type===vK.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=KK(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+=DK(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=DK(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=DK(g,n.indent,l(f))));let _,v,y;YG(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&&KG(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&qG(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=KK(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
||||
`:``,v){let e=l(v);S+=`\n${EK(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=IK(r,!0);o!==`folded`&&t!==xK.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=PK(`${v}${e}${p}`,l,MK,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function WK(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 VK(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
||||
`)?VK(a,t):UK(e,t,n,r);if(!s&&!u&&i!==xK.PLAIN&&a.includes(`
|
||||
`))return UK(e,t,n,r);if(LK(a)){if(c===``)return t.forceBlockIndent=!0,UK(e,t,n,r);if(s&&c===l)return VK(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 VK(a,t)}return s?d:PK(d,c,jK,IK(t,!1))}function GK(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!==xK.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=xK.QUOTE_DOUBLE);let c=e=>{switch(e){case xK.BLOCK_FOLDED:case xK.BLOCK_LITERAL:return i||a?VK(o.value,t):UK(o,t,n,r);case xK.QUOTE_DOUBLE:return zK(o.value,t);case xK.QUOTE_SINGLE:return BK(o.value,t);case xK.PLAIN:return WK(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 KK(e,t){let n=Object.assign({blockQuote:!0,commentString:OK,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 qK(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(YG(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 JK(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(YG(e)||ZG(e))&&e.anchor;a&&dK(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 YK(e,t,n,r){if(JG(e))return e.toString(t,n,r);if(GG(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=QG(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=qK(t.doc.schema.tags,a);let o=JK(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):YG(a)?GK(a,t,n,r):a.toString(t,n,r);return o?YG(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function XK({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=QG(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(ZG(e)||!QG(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||ZG(e)||(YG(e)?e.type===xK.BLOCK_FOLDED||e.type===xK.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=YK(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+=AK(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=AK(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=AK(g,n.indent,l(f))));let _,v,y;QG(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&&YG(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&XG(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=YK(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
||||
`:``,v){let e=l(v);S+=`\n${kK(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
||||
`&&y&&(S=`
|
||||
|
||||
`):S+=`\n${n.indent}`}else if(!p&&JG(t)){let e=x[0],r=x.indexOf(`
|
||||
`):S+=`\n${n.indent}`}else if(!p&&ZG(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+=DK(g,n.indent,l(y)):h&&i&&i(),g}function JK(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var YK=`<<`,XK={identify:e=>e===YK||typeof e==`symbol`&&e.description===YK,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new vK(Symbol(YK)),{addToJSMap:QK}),stringify:()=>YK},ZK=(e,t)=>(XK.identify(t)||KG(t)&&(!t.type||t.type===vK.PLAIN)&&XK.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===XK.tag&&e.default);function QK(e,t,n){let r=eq(e,n);if(qG(r))for(let n of r.items)$K(e,t,n);else if(Array.isArray(r))for(let n of r)$K(e,t,n);else $K(e,t,r)}function $K(e,t,n){let r=eq(e,n);if(!WG(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 eq(e,t){return e&&HG(t)?t.resolve(e.doc,e):t}function tq(e,t,{key:n,value:r}){if(YG(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(ZK(e,n))QK(e,t,r);else{let i=pK(n,``,e);if(t instanceof Map)t.set(i,pK(r,i,e));else if(t instanceof Set)t.add(i);else{let a=nq(n,i,e),o=pK(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function nq(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(YG(e)&&n?.doc){let t=UK(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)+`..."`),JK(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 rq(e,t,n){return new iq(xK(e,void 0,n),xK(t,void 0,n))}var iq=class e{constructor(e,t=null){Object.defineProperty(this,VG,{value:RG}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return YG(n)&&(n=n.clone(t)),YG(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return tq(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?qK(this,e,t,n):JSON.stringify(this)}};function aq(e,t,n){return(t.inFlow??e.flow?sq:oq)(e,t,n)}function oq({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(YG(i))!d&&i.spaceBefore&&f.push(``),cq(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(GG(i)){let e=YG(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),cq(n,f,e.commentBefore,d))}d=!1;let s=KK(i,u,()=>o=null,()=>d=!0);o&&(s+=DK(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+=AK(g,n.indent,l(y)):h&&i&&i(),g}function ZK(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var QK=`<<`,$K={identify:e=>e===QK||typeof e==`symbol`&&e.description===QK,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new xK(Symbol(QK)),{addToJSMap:tq}),stringify:()=>QK},eq=(e,t)=>($K.identify(t)||YG(t)&&(!t.type||t.type===xK.PLAIN)&&$K.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===$K.tag&&e.default);function tq(e,t,n){let r=rq(e,n);if(XG(r))for(let n of r.items)nq(e,t,n);else if(Array.isArray(r))for(let n of r)nq(e,t,n);else nq(e,t,r)}function nq(e,t,n){let r=rq(e,n);if(!qG(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 rq(e,t){return e&&GG(t)?t.resolve(e.doc,e):t}function iq(e,t,{key:n,value:r}){if(QG(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(eq(e,n))tq(e,t,r);else{let i=gK(n,``,e);if(t instanceof Map)t.set(i,gK(r,i,e));else if(t instanceof Set)t.add(i);else{let a=aq(n,i,e),o=gK(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function aq(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(QG(e)&&n?.doc){let t=KK(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)+`..."`),ZK(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 oq(e,t,n){return new sq(wK(e,void 0,n),wK(t,void 0,n))}var sq=class e{constructor(e,t=null){Object.defineProperty(this,WG,{value:VG}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return QG(n)&&(n=n.clone(t)),QG(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return iq(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?XK(this,e,t,n):JSON.stringify(this)}};function cq(e,t,n){return(t.inFlow??e.flow?uq:lq)(e,t,n)}function lq({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(QG(i))!d&&i.spaceBefore&&f.push(``),dq(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(JG(i)){let e=QG(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),dq(n,f,e.commentBefore,d))}d=!1;let s=YK(i,u,()=>o=null,()=>d=!0);o&&(s+=AK(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+=`
|
||||
`+EK(l(e),c),s&&s()):d&&o&&o(),p}function sq({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(YG(i))i.spaceBefore&&d.push(``),cq(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(GG(i)){let e=YG(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),cq(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=YG(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=KK(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+=DK(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 cq({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=EK(t(r),e);n.push(i.trimStart())}}function lq(e,t){let n=KG(t)?t.value:t;for(let r of e)if(GG(r)&&(r.key===t||r.key===n||KG(r.key)&&r.key.value===n))return r}var uq=class extends wK{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(LG,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(rq(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=GG(e)?e:!e||typeof e!=`object`||!(`key`in e)?new iq(e,e?.value):new iq(e.key,e.value);let r=lq(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);KG(r.value)&&_K(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=lq(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=lq(this.items,e)?.value;return(!t&&KG(n)?n.value:n)??void 0}has(e){return!!lq(this.items,e)}set(e,t){this.add(new iq(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)tq(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!GG(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})),aq(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},dq={collection:`map`,default:!0,nodeClass:uq,tag:`tag:yaml.org,2002:map`,resolve(e,t){return WG(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>uq.from(e,t,n)},fq=class extends wK{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(BG,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=pq(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=pq(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&KG(r)?r.value:r}has(e){let t=pq(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=pq(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];KG(r)&&_K(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(pK(e,String(r++),t));return n}toString(e,t,n){return e?aq(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(xK(a,void 0,n))}}return i}};function pq(e){let t=KG(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var mq={collection:`seq`,default:!0,nodeClass:fq,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return qG(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>fq.from(e,t,n)},hq={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),HK(e,t,n,r)}},gq={identify:e=>e==null,createNode:()=>new vK(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new vK(null),stringify:({source:e},t)=>typeof e==`string`&&gq.test.test(e)?e:t.options.nullStr},_q={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new vK(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&_q.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function vq({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 yq={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:vq},bq={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 HK({comment:e,type:t,value:s},r,i,a)}};function Pq(e,t){if(qG(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!GG(r)){if(WG(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new iq(new vK(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]=GG(r)?r:new iq(r)}}else t(`Expected a sequence for this tag`);return e}function Fq(e,t,n){let{replacer:r}=n,i=new fq(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(rq(o,s,n))}return i}var Iq={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:Pq,createNode:Fq},Lq=class e extends fq{constructor(){super(),this.add=uq.prototype.add.bind(this),this.delete=uq.prototype.delete.bind(this),this.get=uq.prototype.get.bind(this),this.has=uq.prototype.has.bind(this),this.set=uq.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(GG(e)?(r=pK(e.key,``,t),i=pK(e.value,r,t)):r=pK(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=Fq(e,t,n),i=new this;return i.items=r.items,i}};Lq.tag=`tag:yaml.org,2002:omap`;var Rq={collection:`seq`,identify:e=>e instanceof Map,nodeClass:Lq,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=Pq(e,t),r=[];for(let{key:e}of n.items)KG(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new Lq,n)},createNode:(e,t,n)=>Lq.from(e,t,n)};function zq({value:e,source:t},n){return t&&(e?Bq:Vq).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Bq={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 vK(!0),stringify:zq},Vq={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 vK(!1),stringify:zq},Hq={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:vq},Uq={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():vq(e)}},Wq={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 vK(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:vq},Gq=e=>typeof e==`bigint`||Number.isInteger(e);function Kq(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 qq(e,t,n){let{value:r}=e;if(Gq(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return vq(e)}var Jq={identify:Gq,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Kq(e,2,2,n),stringify:e=>qq(e,2,`0b`)},Yq={identify:Gq,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Kq(e,1,8,n),stringify:e=>qq(e,8,`0`)},Xq={identify:Gq,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Kq(e,0,10,n),stringify:vq},Zq={identify:Gq,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Kq(e,2,16,n),stringify:e=>qq(e,16,`0x`)},Qq=class e extends uq{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=GG(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new iq(e.key,null):new iq(e,null),lq(this.items,t.key)||this.items.push(t)}get(e,t){let n=lq(this.items,e);return!t&&GG(n)?KG(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=lq(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new iq(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(EK(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(EK(a(t),``)))}return n.join(`
|
||||
`+kK(l(e),c),s&&s()):d&&o&&o(),p}function uq({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(QG(i))i.spaceBefore&&d.push(``),dq(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(JG(i)){let e=QG(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),dq(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=QG(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=YK(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+=AK(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 dq({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=kK(t(r),e);n.push(i.trimStart())}}function fq(e,t){let n=YG(t)?t.value:t;for(let r of e)if(JG(r)&&(r.key===t||r.key===n||YG(r.key)&&r.key.value===n))return r}var pq=class extends DK{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(BG,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(oq(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=JG(e)?e:!e||typeof e!=`object`||!(`key`in e)?new sq(e,e?.value):new sq(e.key,e.value);let r=fq(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);YG(r.value)&&bK(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=fq(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=fq(this.items,e)?.value;return(!t&&YG(n)?n.value:n)??void 0}has(e){return!!fq(this.items,e)}set(e,t){this.add(new sq(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)iq(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!JG(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})),cq(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},mq={collection:`map`,default:!0,nodeClass:pq,tag:`tag:yaml.org,2002:map`,resolve(e,t){return qG(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>pq.from(e,t,n)},hq=class extends DK{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(UG,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=gq(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=gq(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&YG(r)?r.value:r}has(e){let t=gq(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=gq(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];YG(r)&&bK(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(gK(e,String(r++),t));return n}toString(e,t,n){return e?cq(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(wK(a,void 0,n))}}return i}};function gq(e){let t=YG(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var _q={collection:`seq`,default:!0,nodeClass:hq,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return XG(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>hq.from(e,t,n)},vq={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),GK(e,t,n,r)}},yq={identify:e=>e==null,createNode:()=>new xK(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new xK(null),stringify:({source:e},t)=>typeof e==`string`&&yq.test.test(e)?e:t.options.nullStr},bq={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new xK(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&bq.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function xq({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 Sq={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:xq},Cq={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 GK({comment:e,type:t,value:s},r,i,a)}};function Lq(e,t){if(XG(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!JG(r)){if(qG(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new sq(new xK(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]=JG(r)?r:new sq(r)}}else t(`Expected a sequence for this tag`);return e}function Rq(e,t,n){let{replacer:r}=n,i=new hq(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(oq(o,s,n))}return i}var zq={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:Lq,createNode:Rq},Bq=class e extends hq{constructor(){super(),this.add=pq.prototype.add.bind(this),this.delete=pq.prototype.delete.bind(this),this.get=pq.prototype.get.bind(this),this.has=pq.prototype.has.bind(this),this.set=pq.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(JG(e)?(r=gK(e.key,``,t),i=gK(e.value,r,t)):r=gK(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=Rq(e,t,n),i=new this;return i.items=r.items,i}};Bq.tag=`tag:yaml.org,2002:omap`;var Vq={collection:`seq`,identify:e=>e instanceof Map,nodeClass:Bq,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=Lq(e,t),r=[];for(let{key:e}of n.items)YG(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new Bq,n)},createNode:(e,t,n)=>Bq.from(e,t,n)};function Hq({value:e,source:t},n){return t&&(e?Uq:Wq).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Uq={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 xK(!0),stringify:Hq},Wq={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 xK(!1),stringify:Hq},Gq={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:xq},Kq={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():xq(e)}},qq={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 xK(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:xq},Jq=e=>typeof e==`bigint`||Number.isInteger(e);function Yq(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 Xq(e,t,n){let{value:r}=e;if(Jq(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return xq(e)}var Zq={identify:Jq,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Yq(e,2,2,n),stringify:e=>Xq(e,2,`0b`)},Qq={identify:Jq,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Yq(e,1,8,n),stringify:e=>Xq(e,8,`0`)},$q={identify:Jq,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Yq(e,0,10,n),stringify:xq},eJ={identify:Jq,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Yq(e,2,16,n),stringify:e=>Xq(e,16,`0x`)},tJ=class e extends pq{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=JG(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new sq(e.key,null):new sq(e,null),fq(this.items,t.key)||this.items.push(t)}get(e,t){let n=fq(this.items,e);return!t&&JG(n)?YG(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=fq(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new sq(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(kK(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(kK(a(t),``)))}return n.join(`
|
||||
`)+`
|
||||
`}var pJ=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,VG,{value:IG});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 sK({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[VG]:{value:IG}});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=YG(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){mJ(this.contents)&&this.contents.add(e)}addIn(e,t){mJ(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=lK(this);e.anchor=!t||n.has(t)?uK(t||`a`,n):t}return new hK(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}=dK(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=xK(e,l,p);return o&&JG(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new iq(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return mJ(this.contents)?this.contents.delete(e):!1}deleteIn(e){return CK(e)?this.contents!=null&&(this.contents=null,!0):mJ(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return JG(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return CK(e)?!t&&KG(this.contents)?this.contents.value:this.contents:JG(this.contents)?this.contents.getIn(e,t):void 0}has(e){return JG(this.contents)?this.contents.has(e):!1}hasIn(e){return CK(e)?this.contents!==void 0:JG(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=SK(this.schema,[e],t):mJ(this.contents)&&this.contents.set(e,t)}setIn(e,t){CK(e)?this.contents=t:this.contents==null?this.contents=SK(this.schema,Array.from(e),t):mJ(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 sK({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 sK({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 dJ(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=pK(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`?fK(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 fJ(this,e)}};function mJ(e){if(JG(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var hJ=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},gJ=class extends hJ{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},_J=class extends hJ{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},vJ=(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 yJ(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 bJ(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(bJ(t.key)||bJ(t.value))return!0}return!1;default:return!0}}function xJ(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&bJ(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function SJ(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||KG(e)&&KG(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var CJ=`All mapping items must start at the same column`;function wJ({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??uq)(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=yJ(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`,CJ)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
||||
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||bJ(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`,CJ);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&xJ(r.indent,u,i),n.atKey=!1,SJ(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=yJ(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&&xJ(r.indent,f,i),s=c.range[2];let l=new iq(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 iq(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 TJ({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??fq)(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=yJ(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&&xJ(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function EJ(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 DJ=`Block collections are not allowed within flow collections`,OJ=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function kJ({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?uq:fq))(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=yJ(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&&bJ(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];GG(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],OJ(m)&&i(r.range,`BLOCK_IN_FLOW`,DJ)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);OJ(f)&&i(g.range,`BLOCK_IN_FLOW`,DJ),n.atKey=!1;let _=yJ(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?OJ(m)&&i(v.range,`BLOCK_IN_FLOW`,DJ):_.comment&&(g.comment?g.comment+=`
|
||||
`+_.comment:g.comment=_.comment);let y=new iq(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;SJ(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new uq(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=EJ(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 AJ(e,t,n,r,i,a){let o=n.type===`block-map`?wJ(e,t,n,r,a):n.type===`block-seq`?TJ(e,t,n,r,a):kJ(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function jJ(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===uq.tagName&&s===`map`||o===fq.tagName&&s===`seq`)return AJ(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),AJ(e,t,n,i,o)}let l=AJ(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=YG(u)?u:new vK(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function MJ(e,t,n){let r=t.offset,i=NJ(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?vK.BLOCK_FOLDED:vK.BLOCK_LITERAL,o=t.source?PJ(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 gJ=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,WG,{value:zG});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 uK({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[WG]:{value:zG}});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=QG(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){_J(this.contents)&&this.contents.add(e)}addIn(e,t){_J(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=fK(this);e.anchor=!t||n.has(t)?pK(t||`a`,n):t}return new vK(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}=mK(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=wK(e,l,p);return o&&ZG(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new sq(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return _J(this.contents)?this.contents.delete(e):!1}deleteIn(e){return EK(e)?this.contents!=null&&(this.contents=null,!0):_J(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return ZG(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return EK(e)?!t&&YG(this.contents)?this.contents.value:this.contents:ZG(this.contents)?this.contents.getIn(e,t):void 0}has(e){return ZG(this.contents)?this.contents.has(e):!1}hasIn(e){return EK(e)?this.contents!==void 0:ZG(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=TK(this.schema,[e],t):_J(this.contents)&&this.contents.set(e,t)}setIn(e,t){EK(e)?this.contents=t:this.contents==null?this.contents=TK(this.schema,Array.from(e),t):_J(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 uK({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 uK({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 mJ(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=gK(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`?hK(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 hJ(this,e)}};function _J(e){if(ZG(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var vJ=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},yJ=class extends vJ{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},bJ=class extends vJ{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},xJ=(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 SJ(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 CJ(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(CJ(t.key)||CJ(t.value))return!0}return!1;default:return!0}}function wJ(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&CJ(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function TJ(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||YG(e)&&YG(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var EJ=`All mapping items must start at the same column`;function DJ({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??pq)(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=SJ(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`,EJ)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
||||
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||CJ(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`,EJ);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&wJ(r.indent,u,i),n.atKey=!1,TJ(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=SJ(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&&wJ(r.indent,f,i),s=c.range[2];let l=new sq(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 sq(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 OJ({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??hq)(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=SJ(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&&wJ(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function kJ(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 AJ=`Block collections are not allowed within flow collections`,jJ=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function MJ({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?pq:hq))(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=SJ(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&&CJ(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];JG(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],jJ(m)&&i(r.range,`BLOCK_IN_FLOW`,AJ)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);jJ(f)&&i(g.range,`BLOCK_IN_FLOW`,AJ),n.atKey=!1;let _=SJ(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?jJ(m)&&i(v.range,`BLOCK_IN_FLOW`,AJ):_.comment&&(g.comment?g.comment+=`
|
||||
`+_.comment:g.comment=_.comment);let y=new sq(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;TJ(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new pq(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=kJ(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 NJ(e,t,n,r,i,a){let o=n.type===`block-map`?DJ(e,t,n,r,a):n.type===`block-seq`?OJ(e,t,n,r,a):MJ(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function PJ(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===pq.tagName&&s===`map`||o===hq.tagName&&s===`seq`)return NJ(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),NJ(e,t,n,i,o)}let l=NJ(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=QG(u)?u:new xK(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function FJ(e,t,n){let r=t.offset,i=IJ(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?xK.BLOCK_FOLDED:xK.BLOCK_LITERAL,o=t.source?LJ(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===vK.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===xK.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 NJ({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 PJ(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 FJ(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=vK.PLAIN,c=IJ(a,l);break;case`single-quoted-scalar`:s=vK.QUOTE_SINGLE,c=LJ(a,l);break;case`double-quoted-scalar`:s=vK.QUOTE_DOUBLE,c=zJ(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=EJ(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function IJ(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}`),RJ(e)}function LJ(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),RJ(e.slice(1,-1)).replace(/''/g,`'`)}function RJ(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 IJ({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 LJ(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 RJ(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=xK.PLAIN,c=zJ(a,l);break;case`single-quoted-scalar`:s=xK.QUOTE_SINGLE,c=BJ(a,l);break;case`double-quoted-scalar`:s=xK.QUOTE_DOUBLE,c=HJ(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=kJ(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function zJ(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}`),VJ(e)}function BJ(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),VJ(e.slice(1,-1)).replace(/''/g,`'`)}function VJ(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 zJ(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 HJ(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}=BJ(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=VJ[i];if(a)n+=a;else if(i===`
|
||||
`){let{fold:t,offset:i}=UJ(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=WJ[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+=HJ(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+=GJ(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 BJ(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 UJ(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 VJ={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
||||
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function HJ(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 UJ(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?MJ(e,t,r):FJ(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[zG]:c?WJ(e.schema,i,c,n,r):t.type===`scalar`?GJ(e,i,t,r):e.schema[zG];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=KG(a)?a:new vK(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new vK(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 WJ(e,t,n,r,i){if(n===`!`)return e[zG];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[zG])}function GJ({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[zG];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[zG];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 KJ(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 qJ={composeNode:JJ,composeEmptyNode:YJ};function JJ(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=XJ(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=UJ(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=jJ(qJ,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??=YJ(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&&(!KG(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 YJ(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=UJ(e,{type:`scalar`,offset:KJ(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 XJ({options:e},{offset:t,source:n,end:r},i){let a=new hK(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=EJ(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function ZJ(e,t,{offset:n,start:r,value:i,end:a},o){let s=new pJ(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=yJ(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?JJ(c,i,l,o):YJ(c,l.end,r,null,l,o);let u=s.contents.range[2],d=EJ(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function QJ(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 $J(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 WJ={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
||||
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function GJ(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 KJ(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?FJ(e,t,r):RJ(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[HG]:c?qJ(e.schema,i,c,n,r):t.type===`scalar`?JJ(e,i,t,r):e.schema[HG];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=YG(a)?a:new xK(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new xK(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 qJ(e,t,n,r,i){if(n===`!`)return e[HG];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[HG])}function JJ({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[HG];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[HG];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 YJ(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 XJ={composeNode:ZJ,composeEmptyNode:QJ};function ZJ(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=$J(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=KJ(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=PJ(XJ,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??=QJ(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&&(!YG(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 QJ(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=KJ(e,{type:`scalar`,offset:YJ(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 $J({options:e},{offset:t,source:n,end:r},i){let a=new vK(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=kJ(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function eY(e,t,{offset:n,start:r,value:i,end:a},o){let s=new gJ(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=SJ(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?ZJ(c,i,l,o):QJ(c,l.end,r,null,l,o);let u=s.contents.range[2],d=kJ(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function tY(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 nY(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 eY=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=QJ(e);r?this.warnings.push(new _J(i,t,n)):this.errors.push(new gJ(i,t,n))},this.directives=new sK({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=$J(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(JG(i)&&!i.flow&&i.items.length>0){let e=i.items[0];GG(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:$J(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=QJ(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=ZJ(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 gJ(QJ(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 gJ(QJ(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=EJ(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 gJ(QJ(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 pJ(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}}},tY=Symbol(`break visit`),nY=Symbol(`skip children`),rY=Symbol(`remove item`);function iY(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),aY(Object.freeze([]),e,t)}iY.BREAK=tY,iY.SKIP=nY,iY.REMOVE=rY,iY.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},iY.parentCollection=(e,t)=>{let n=iY.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 aY(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=aY(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===tY)return tY;else r===rY&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function oY(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 rY=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=tY(e);r?this.warnings.push(new bJ(i,t,n)):this.errors.push(new yJ(i,t,n))},this.directives=new uK({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=nY(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(ZG(i)&&!i.flow&&i.items.length>0){let e=i.items[0];JG(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:nY(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=tY(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=eY(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 yJ(tY(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 yJ(tY(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=kJ(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 yJ(tY(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 gJ(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}}},iY=Symbol(`break visit`),aY=Symbol(`skip children`),oY=Symbol(`remove item`);function sY(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),cY(Object.freeze([]),e,t)}sY.BREAK=iY,sY.SKIP=aY,sY.REMOVE=oY,sY.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},sY.parentCollection=(e,t)=>{let n=sY.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 cY(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=cY(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===iY)return iY;else r===oY&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function lY(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 sY(e){switch(e){case void 0:case` `:case`
|
||||
`:case`\r`:case` `:return!0;default:return!1}}var cY=new Set(`0123456789ABCDEFabcdef`),lY=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),uY=new Set(`,[]{}`),dY=new Set(` ,[]{}
|
||||
\r `),fY=e=>!e||dY.has(e),pY=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 uY(e){switch(e){case void 0:case` `:case`
|
||||
`:case`\r`:case` `:return!0;default:return!1}}var dY=new Set(`0123456789ABCDEFabcdef`),fY=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),pY=new Set(`,[]{}`),mY=new Set(` ,[]{}
|
||||
\r `),hY=e=>!e||mY.has(e),gY=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===`...`)&&sY(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===`...`)&&sY(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&&!sY(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===`:`)&&sY(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(fY),`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(`...`))&&sY(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(fY),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||sY(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===`...`)&&uY(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===`...`)&&uY(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&&!uY(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===`:`)&&uY(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(hY),`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(`...`))&&uY(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(hY),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||uY(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=>sY(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=>uY(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(sY(r)||e&&uY.has(r))break;t=n}else if(sY(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(uY(r)||e&&pY.has(r))break;t=n}else if(uY(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
|
||||
`?(n+=1,r=`
|
||||
`,i=this.buffer[n+1]):t=n),i===`#`||e&&uY.has(i))break;if(r===`
|
||||
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&uY.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(fY),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(sY(n)||t&&uY.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(;!sY(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(lY.has(t))t=this.buffer[++e];else if(t===`%`&&cY.has(this.buffer[e+1])&&cY.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&&pY.has(i))break;if(r===`
|
||||
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&pY.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(hY),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(uY(n)||t&&pY.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(;!uY(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(fY.has(t))t=this.buffer[++e];else if(t===`%`&&dY.has(this.buffer[e+1])&&dY.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)}},mY=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 hY(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function gY(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 _Y(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 vY(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 yY(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 bY(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 xY(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!hY(t.start,`explicit-key-ind`)&&!hY(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,_Y(t.value)?t.value.end?bY(t.value.end,t.sep):t.value.end=t.sep:bY(t.start,t.sep),delete t.sep)}var SY=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 pY,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=oY(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`&&xY(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&&gY(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)}},_Y=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 vY(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function yY(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 bY(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 xY(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 SY(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 CY(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 wY(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!vY(t.start,`explicit-key-ind`)&&!vY(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,bY(t.value)?t.value.end?CY(t.value.end,t.sep):t.value.end=t.sep:CY(t.start,t.sep),delete t.sep)}var TY=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 gY,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=lY(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`&&wY(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&&yY(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)){bY(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(hY(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=yY(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(hY(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(_Y(t.key)&&!hY(t.sep,`newline`)){let e=yY(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]}):hY(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&&!hY(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)){bY(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||hY(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)){CY(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(vY(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=SY(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(vY(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(bY(t.key)&&!vY(t.sep,`newline`)){let e=SY(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]}):vY(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&&!vY(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)){CY(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||vY(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=yY(vY(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=yY(vY(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 CY(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new mY||null,prettyErrors:t}}function wY(e,t={}){let{lineCounter:n,prettyErrors:r}=CY(t),i=new SY(n?.addNewLine),a=new eY(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 gJ(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(vJ(e,n)),o.warnings.forEach(vJ(e,n))),o}function TY(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=wY(e,n);if(!i)return null;if(i.warnings.forEach(e=>JK(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 EY(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 UG(e)&&!r?e.toString(n):new pJ(e,r,n).toString(n)}var DY=e=>typeof e==`object`&&!!e&&!Array.isArray(e),OY=e=>DY(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function kY(e){if(DY(e)){if(DY(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:OY(e.parallel)};if(DY(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:OY(e.switch.cases)}}}function AY(e){return e.slice(2).includes(`parallel`)}function jY(e,t){let n=wY(e).getIn(t,!0);if(WG(n))return n.toJSON()}function MY(e,t,n){let r=wY(e);return r.setIn(t,r.createNode(UY(n))),r.toString()}function NY(e,t,n){let r=wY(e),i=t.slice(0,-1),a=AY(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(qG(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!qG(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 PY(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 FY(e,t){let n=e.getIn(t,!0),r=kY(WG(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!WG(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function IY(e,t,n){let r=wY(e),{kind:i,branches:a}=FY(r,t);if(PY(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function LY(e,t,n,r){let i=wY(e),{kind:a,branches:o}=FY(i,t);if(PY(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>KG(e.key)&&e.key.value===n);if(!s||!KG(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function RY(e,t,n){let r=wY(e),{kind:i,branches:a}=FY(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 iX(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(eX)].map(e=>e[1]))]}function aX(e){let t=wY(e).toJS(),n=tX(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=tX(e)?e:{},p=kY(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=tX(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||$Y(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\./,``)}`:nX(m,h),summary:rX(h),when:typeof d.when==`string`?d.when:void 0,retry:tX(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 iX([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=kY(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*XY,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=tX(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)*ZY,l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*XY,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)*XY},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)*XY-24;o.forEach(([t],n)=>{let a=(n-(h-1)/2)*ZY;r.push({id:`lane-${e}-${t}`,type:`lane`,position:{x:a-12,y:u*XY-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*XY,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*XY-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 oX=`\0`,sX=N({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)=>(I(),K(B(Xl),{"model-value":e.modelValue===``&&e.options.some(e=>e.value===``)?oX:e.modelValue||void 0,disabled:e.disabled,"onUpdate:modelValue":r[0]||=e=>n(`update:modelValue`,e===oX?``:String(e))},{default:F(()=>[k(B(tu),W({size:e.size??`sm`,class:t.$props.class},t.$attrs),{default:F(()=>[k(B(nu),{placeholder:e.placeholder},null,8,[`placeholder`])]),_:1},16,[`size`,`class`]),k(B(Zl),null,{default:F(()=>[(I(!0),A(H,null,j(e.options,e=>(I(),K(B($l),{key:e.value,value:e.value===``?oX:e.value,disabled:e.disabled},{default:F(()=>[V(z(e.label),1)]),_:2},1032,[`value`,`disabled`]))),128))]),_:1})]),_:1},8,[`model-value`,`disabled`]))}}),cX=N({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{},class:{}},emits:[`pick`],setup(e,{emit:t}){let n=t;return(t,r)=>(I(),K(B(Xl),{"model-value":e.value||void 0,"onUpdate:modelValue":r[0]||=e=>n(`pick`,String(e))},{default:F(()=>[k(B(tu),{"aria-label":e.label,class:R(t.$props.class)},{default:F(()=>[k(B(nu),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`,`class`]),k(B(Zl),null,{default:F(()=>[e.value&&!e.workflows.some(t=>t.id===e.value)?(I(),K(B($l),{key:0,value:e.value,disabled:``},{default:F(()=>[V(z(e.value)+` (unavailable)`,1)]),_:1},8,[`value`])):P(``,!0),(I(!0),A(H,null,j(e.workflows,e=>(I(),K(B($l),{key:e.id,value:e.id},{default:F(()=>[V(z(e.id),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`]))}});function lX(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function uX(e,t=[]){let n=wY(e),r=n.errors[0];if(r)return{ok:!1,message:TX(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!EX(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:`woLine truncated
|
||||
`).map((e,t)=>({number:t+1,text:e,tokens:xX(e)}))}var yX=/^(\s*)(-\s+)?/,bX=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function xX(e){let{code:t,comment:n}=SX(e),r=CX(t);return n&&r.push({text:n,kind:`comment`}),r}function SX(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 CX(e){if(!e)return[];let t=[],n=yX.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=bX.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,...wX(i[4]??``)]):[...t,...wX(r)]}function wX(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 TX(e){return e.split(`
|
||||
`)[0]?.trim()||`invalid YAML`}function EX(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function DX(e){return typeof e==`string`&&e.trim()!==``}var OX={class:`space-y-4 px-3 py-3`},kX={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},AX={key:1,class:`space-y-3`},jX={key:0,class:`block space-y-1.5`},MX=[`id`],NX=[`value`],PX={class:`text-xs font-medium text-fg-muted`},FX={class:`flex items-center gap-2`},IX={key:1,role:`alert`,class:`text-xs text-danger`},LX={key:2,class:`space-y-1.5`},RX=[`title`],zX={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},BX={key:0,class:`divide-y divide-border rounded-md border border-border`},VX=[`title`],HX={key:0,class:`space-y-3`},UX={class:`text-[13px]`},WX={key:0,class:`text-danger`},GX={class:`ml-2 text-xs text-fg-subtle`},KX={key:1,class:`space-y-3`},qX={class:`text-[13px]`},JX={class:`ml-2 text-xs text-fg-subtle`},YX=[`title`],XX={key:0,class:`text-xs text-danger`},ZX={class:`space-y-1.5`},QX={key:0,role:`alert`,class:`text-xs text-danger`},$X={class:`divide-y divide-border rounded-md border border-border`},eZ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},tZ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},nZ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},rZ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},iZ=[`for`],aZ=N({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=Ee(),r=e,i=t,a=J(()=>jY(r.yaml,r.path)??{}),o=J(()=>kY(a.value)),s=J(()=>o.value?.kind??(typeof a.value.type==`string`?a.value.type:``)),c=J(()=>o.value?.branches.map(([e])=>e)??[]),l=J(()=>s.value===`parallel`?2:1);function u(e){i(`update:yaml`,MY(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`?IY(r.yaml,r.path,t):e===`rename`?LY(r.yaml,r.path,t,n):RY(r.yaml,r.path,t);i(`update:yaml`,a),d.value=``,f.value=``}catch(e){f.value=String(e.message)}}let m=J(()=>r.vocabulary.find(e=>e.name===s.value)),h=J(()=>typeof a.value.settings==`object`&&a.value.settings!==null?a.value.settings:{}),g=J(()=>HY(r.yaml,r.path)),_=J(()=>mX(a.value)),v=J(()=>m.value?.settings&&a.value.settings?gX(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=J(()=>{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))}}),C=q(!S.value.lead&&!o.value),w=e=>[{value:``,label:`Default`},...e.map(e=>({value:e,label:e}))];function T(e){let{id:t,type:n,...a}=e;i(`update:yaml`,MY(r.yaml,r.path,{id:t,type:n,...a}))}function ee(e,t){T({...a.value,[e]:t})}function E(e){let t={...a.value.retry,...e};ee(`retry`,t.attempts===void 0&&!t.backoff?void 0:{...t,attempts:t.attempts??1})}function D(e,t){let n={...h.value,[e]:t};s.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,T({...a.value,settings:n})}function te(e,t){let n={...h.value,[e]:t};s.value===`workflow.call`&&t!==h.value[e]&&(delete n.inputs,delete n.outputs),T({...a.value,settings:n})}let O=J(()=>r.workflows.find(e=>e.id===h.value.workflow)),ne=J(()=>Object.entries(WY(O.value?.yaml??``,`inputs`)??{})),re=J(()=>Object.entries(WY(O.value?.yaml??``,`outputs`)??{})),ae=J(()=>Object.entries(WY(r.yaml,`inputs`)??{})),oe=J(()=>Object.entries(WY(r.yaml,`outputs`)??{})),se=J(()=>h.value.inputs??{}),ce=J(()=>h.value.outputs??{}),le=e=>typeof e==`string`&&e.startsWith(`inputs.`),ue=e=>[`object`,`array`].includes(e.type??``),de=e=>se.value[e]===void 0?``:String(se.value[e]);function fe(e,t,n){D(`inputs`,{...se.value,[e]:t===``?void 0:le(t)?t:ib(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??S.value.lead?.key;if(!n)return;let r=typeof h.value[n]==`string`?h.value[n]:``,i=`{{ steps.${e}.${t} }}`;D(n,r?`${r.trimEnd()} ${i}`:i)}let ge=q({});function _e(e,t){try{D(e,t.trim()?TY(t):void 0),ge.value={...ge.value,[e]:``}}catch(t){ge.value={...ge.value,[e]:String(t.mess
Line truncated
|
||||
`)[0]}}}let ve=e=>e===void 0?``:EY(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)=>(I(),A(`div`,OX,[v.value?(I(),A(`p`,kX,z(v.value),1)):P(``,!0),o.value?(I(),A(`section`,AX,[s.value===`switch`?(I(),A(`label`,jX,[r[15]||=L(`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),k(B(Z),{"model-value":o.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,list:`${B(n)}-switch-on`,onChange:r[0]||=e=>u(e.target.value.trim())},null,8,[`model-value`,`list`]),L(`datalist`,{id:`${B(n)}-switch-on`},[(I(!0),A(H,null,j(g.value,e=>(I(),A(`option`,{key:e,value:`steps.${e}.result.`},null,8,NX))),128))],8,MX)])):P(``,!0),L(`div`,PX,z(s.value===`switch`?`Cases`:`Branches`),1),(I(!0),A(H,null,j(c.value,e=>(I(),A(`div`,{key:e,class:`flex items-center gap-2`},[k(B(Z),{"model-value":e,class:R(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`]),k(B(X),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:c.value.length<=l.value,onClick:t=>p(`delete`,e)},{default:F(()=>[k(B($c))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),L(`div`,FX,[k(B(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]||=ft(mt(e=>p(`add`,d.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),k(B(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:F(()=>[k(B(Lc))]),_:1},8,[`aria-label`,`disabled`])]),f.value?(I(),A(`p`,IX,z(f.value),1)):P(``,!0)])):P(``,!0),S.value.lead?(I(),A(`section`,LX,[L(`div`,{class:`flex items-center gap-1 text-xs font-medium text-fg-muted`,title:S.value.lead.schema.description},[V(z(ye(S.value.lead.key,S.value.lead.schema))+` `,1),S.value.lead.schema.description?(I(),K(B(dc),{key:0,class:`size-3 text-fg-subtle`})):P(``,!0)],8,RX),S.value.lead.kind===`workflow`?(I(),K(cX,{key:0,value:be(S.value.lead.key),workflows:e.workflows,label:ye(S.value.lead.key,S.value.lead.schema),onPick:r[4]||=e=>te(S.value.lead.key,e)},null,8,[`value`,`workflows`,`label`])):S.value.lead.kind===`select`?(I(),K(sX,{key:1,class:`w-full`,"model-value":be(S.value.lead.key),options:w(S.value.lead.options),"aria-label":ye(S.value.lead.key,S.value.lead.schema),"onUpdate:modelValue":r[5]||=e=>D(S.value.lead.key,e||void 0)},null,8,[`model-value`,`options`,`aria-label`])):S.value.lead.kind===`text`?(I(),K(B(Su),{key:2,"model-value":be(S.value.lead.key),class:`min-h-32 text-[13px] leading-relaxed`,onFocus:r[6]||=e=>me.value=S.value.lead.key,"onUpdate:modelValue":r[7]||=e=>D(S.value.lead.key,String(e))},null,8,[`model-value`])):(I(),K(B(Z),{key:3,"model-value":be(S.value.lead.key),onFocus:r[8]||=e=>me.value=S.value.lead.key,"onUpdate:modelValue":r[9]||=e=>D(S.value.lead.key,String(e))},null,8,[`model-value`])),g.value.length&&S.value.lead.kind!==`select`?(I(),A(`div`,zX,[r[16]||=L(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(I(!0),A(H,null,j(g.value,e=>(I(),A(H,{key:e},[k(B(X),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>he(e,`summary`)},{default:F(()=>[V(z(e),1)]),_:2},1032,[`onClick`]),k(B(X),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>he(e,`result`)},{default:F(()=>[V(z(e)+`.result`,1)]),_:2},1032,[`onClick`])],64))),128))])):P(``,!0)])):P(``,!0),k(B(X),{type:`button`,variant:`ghost`,size:`xs`,class:`-ml-2 text-fg-muted aria-expanded:bg-transparent`,"aria-expanded":C.value,onClick:r[10]||=e=>C.value=!C.value},{default:F(()=>[k(B(ie),{"data-icon":`inline-start`,class:R([`transition-transform`,!C.value&&`-rotate-90`])},null,8,[`class`]),r[17]||=V(`More `,-1)]),_:1},8,[`aria-expanded`]),C.value?(I(),A(H,{key:3},[S.value.compact.length?(I(),A(`section`,BX,[(I(!0),A(H,null,j(S.value.compact,t=>(I(),A(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[L(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:t.schema.description},[V(z(ye(t.key,t.schema))+` `,1),t.schema.description?(I(),K(B(dc),{key:0,class:`size-3 text-fg-subtle`})):P(``,!0)],8,VX),t.kind===`workflow`?(I(),K(cX,{key:0,class:`max-w-48`,value:be(t.key),workflows:e.workflows,label:ye(t.key,t.schema),onPick:e=>te(t.key,e)},null,8,[`value`,`workflows`,`label`,`onPick`])):t.kind===`boolean`?(I(),K(B(Wg),{key:1,"model-value":h.value[t.key]===!0,"onUpdate:modelValue":e=>D(t.key,e||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):t.kind===`Line 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=SY(xY(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=SY(xY(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 EY(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new _Y||null,prettyErrors:t}}function DY(e,t={}){let{lineCounter:n,prettyErrors:r}=EY(t),i=new TY(n?.addNewLine),a=new rY(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 yJ(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(xJ(e,n)),o.warnings.forEach(xJ(e,n))),o}function OY(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=DY(e,n);if(!i)return null;if(i.warnings.forEach(e=>ZK(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 kY(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 KG(e)&&!r?e.toString(n):new gJ(e,r,n).toString(n)}var AY=e=>typeof e==`object`&&!!e&&!Array.isArray(e),jY=e=>AY(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function MY(e){if(AY(e)){if(AY(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:jY(e.parallel)};if(AY(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:jY(e.switch.cases)}}}function NY(e){return e.slice(2).includes(`parallel`)}function PY(e,t){let n=DY(e).getIn(t,!0);if(qG(n))return n.toJSON()}function FY(e,t,n){let r=DY(e);return r.setIn(t,r.createNode(KY(n))),r.toString()}function IY(e,t,n){let r=DY(e),i=t.slice(0,-1),a=NY(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(XG(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!XG(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 LY(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 RY(e,t){let n=e.getIn(t,!0),r=MY(qG(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!qG(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function zY(e,t,n){let r=DY(e),{kind:i,branches:a}=RY(r,t);if(LY(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function BY(e,t,n,r){let i=DY(e),{kind:a,branches:o}=RY(i,t);if(LY(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>YG(e.key)&&e.key.value===n);if(!s||!YG(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function VY(e,t,n){let r=DY(e),{kind:i,branches:a}=RY(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 sX(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(rX)].map(e=>e[1]))]}function cX(e){let t=DY(e).toJS(),n=iX(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=iX(e)?e:{},p=MY(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=iX(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||nX(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\./,``)}`:aX(m,h),summary:oX(h),when:typeof d.when==`string`?d.when:void 0,retry:iX(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 sX([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=MY(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*$Y,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=iX(t)&&typeof t.id==`string`?t.id:i,f=i===`switch`&&!o.some(([e])=>e==="default"),h=o.length+ +!!f,g=[],_=Math.max(1,...o.map(([,e])=>e.length)),v=e=>(e-(h-1)/2)*eX,y=(e,t,n)=>r.push({id:e,type:`lane`,position:{x:t-12,y:u*$Y-40},style:{width:`264px`,height:`${(_+1)*$Y-24}px`},zIndex:-1,data:{kind:`step`,key:n,title:n,type:``,detail:``,lane:i}}),b=(u+_)*$Y;if(o.forEach(([t,n],o)=>{let s=v(o),l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*$Y,t,d,[...f,r],i);m(l,a,[...f,r-1]),l=[a]});let h=`add-${e}-${t}`;r.push({id:h,type:`add`,position:{x:s+104,y:b},data:{kind:`step`,key:h,title:``,type:``,detail:``,branch:t,lane:i,insertAfter:[...f,n.length-1]}}),m(l,h),g.push(h),y(`lane-${e}-${t}`,s,t)}),f){let t=v(h-1),n=`pass-${e}`;r.push({id:n,type:`add`,position:{x:t+104,y:b},data:{kind:`step`,key:n,title:``,type:``,detail:``,lane:i}}),s.add(c),m([c],n),s.delete(c),g.push(n),y(`pass-lane-${e}`,t,`default`)}l=g,u+=_+1;continue}let i=p(t,String(e+1),0,u*$Y,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*$Y-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 lX={class:`truncate`},uX=`\0`,dX=M({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)=>(F(),K(B(nf),{"model-value":e.modelValue===``&&e.options.some(e=>e.value===``)?uX:e.modelValue||void 0,disabled:e.disabled,"onUpdate:modelValue":r[0]||=e=>n(`update:modelValue`,e===uX?``:String(e))},{default:P(()=>[O(B(uf),W({size:e.size??`sm`,class:t.$props.class},t.$attrs),{default:P(()=>[O(B(df),{placeholder:e.placeholder},null,8,[`placeholder`])]),_:1},16,[`size`,`class`]),O(B(rf),{position:`popper`,class:`max-w-[min(var(--reka-select-content-available-width),20rem)]`},{default:P(()=>[(F(!0),k(H,null,A(e.options,e=>(F(),K(B(sf),{key:e.value,value:e.value===``?uX:e.value,disabled:e.disabled,title:e.label,class:`*:[span]:last:min-w-0`},{default:P(()=>[I(`span`,lX,z(e.label),1)]),_:2},1032,[`value`,`disabled`,`title`]))),128))]),_:1})]),_:1},8,[`model-value`,`disabled`]))}}),fX=M({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{},class:{}},emits:[`pick`],setup(e,{emit:t}){let n=t;return(t,r)=>(F(),K(B(nf),{"model-value":e.value||void 0,"onUpdate:modelValue":r[0]||=e=>n(`pick`,String(e))},{default:P(()=>[O(B(uf),{"aria-label":e.label,class:R(t.$props.class)},{default:P(()=>[O(B(df),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`,`class`]),O(B(rf),null,{default:P(()=>[e.value&&!e.workflows.some(t=>t.id===e.value)?(F(),K(B(sf),{key:0,value:e.value,disabled:``},{default:P(()=>[V(z(e.value)+` (unavailable)`,1)]),_:1},8,[`value`])):N(``,!0),(F(!0),k(H,null,A(e.workflows,e=>(F(),K(B(sf),{key:e.id,value:e.id},{default:P(()=>[V(z(e.id),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`]))}});function pX(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function mX(e,t=[]){let n=DY(e),r=n.er
Line truncated
|
||||
`).map((e,t)=>({number:t+1,text:e,tokens:EX(e)}))}var wX=/^(\s*)(-\s+)?/,TX=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function EX(e){let{code:t,comment:n}=DX(e),r=OX(t);return n&&r.push({text:n,kind:`comment`}),r}function DX(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 OX(e){if(!e)return[];let t=[],n=wX.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=TX.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,...kX(i[4]??``)]):[...t,...kX(r)]}function kX(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 AX(e){return e.split(`
|
||||
`)[0]?.trim()||`invalid YAML`}function jX(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function MX(e){return typeof e==`string`&&e.trim()!==``}var NX={class:`space-y-4 px-3 py-3`},PX={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},FX={key:1,class:`space-y-3`},IX={key:0,class:`block space-y-1.5`},LX=[`id`],RX=[`value`],zX={class:`text-xs font-medium text-fg-muted`},BX={class:`flex items-center gap-2`},VX={key:1,role:`alert`,class:`text-xs text-danger`},HX={key:2,class:`space-y-1.5`},UX=[`title`],WX={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},GX={key:0,class:`divide-y divide-border rounded-md border border-border`},KX=[`title`],qX={key:0,class:`space-y-3`},JX={class:`text-[13px]`},YX={key:0,class:`text-danger`},XX={class:`ml-2 text-xs text-fg-subtle`},ZX={key:1,class:`space-y-3`},QX={class:`text-[13px]`},$X={class:`ml-2 text-xs text-fg-subtle`},eZ=[`title`],tZ={key:0,class:`text-xs text-danger`},nZ={class:`space-y-1.5`},rZ={key:0,role:`alert`,class:`text-xs text-danger`},iZ={class:`divide-y divide-border rounded-md border border-border`},aZ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},oZ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},sZ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},cZ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},lZ=[`for`],uZ=M({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=Oe(),r=e,i=t,a=J(()=>PY(r.yaml,r.path)??{}),o=J(()=>MY(a.value)),s=J(()=>o.value?.kind??(typeof a.value.type==`string`?a.value.type:``)),c=J(()=>o.value?.branches.map(([e])=>e)??[]),l=J(()=>s.value===`parallel`?2:1);function u(e){i(`update:yaml`,FY(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`?zY(r.yaml,r.path,t):e===`rename`?BY(r.yaml,r.path,t,n):VY(r.yaml,r.path,t);i(`update:yaml`,a),d.value=``,f.value=``}catch(e){f.value=String(e.message)}}let m=J(()=>r.vocabulary.find(e=>e.name===s.value)),h=J(()=>typeof a.value.settings==`object`&&a.value.settings!==null?a.value.settings:{}),g=J(()=>GY(r.yaml,r.path)),_=J(()=>yX(a.value)),v=J(()=>m.value?.settings&&a.value.settings?xX(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=J(()=>{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))}}),C=q(!S.value.lead&&!o.value),w=e=>[{value:``,label:`Default`},...e.map(e=>({value:e,label:e}))];function T(e){let{id:t,type:n,...a}=e;i(`update:yaml`,FY(r.yaml,r.path,{id:t,type:n,...a}))}function ee(e,t){T({...a.value,[e]:t})}function E(e){let t={...a.value.retry,...e};ee(`retry`,t.attempts===void 0&&!t.backoff?void 0:{...t,attempts:t.attempts??1})}function D(e,t){let n={...h.value,[e]:t};s.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,T({...a.value,settings:n})}function te(e,t){let n={...h.value,[e]:t};s.value===`workflow.call`&&t!==h.value[e]&&(delete n.inputs,delete n.outputs),T({...a.value,settings:n})}let ne=J(()=>r.workflows.find(e=>e.id===h.value.workflow)),re=J(()=>Object.entries(qY(ne.value?.yaml??``,`inputs`)??{})),ie=J(()=>Object.entries(qY(ne.value?.yaml??``,`outputs`)??{})),oe=J(()=>Object.entries(qY(r.yaml,`inputs`)??{})),se=J(()=>Object.entries(qY(r.yaml,`outputs`)??{})),ce=J(()=>h.value.inputs??{}),le=J(()=>h.value.outputs??{}),ue=e=>typeof e==`string`&&e.startsWith(`inputs.`),de=e=>[`object`,`array`].includes(e.type??``),fe=e=>ce.value[e]===void 0?``:String(ce.value[e]);function pe(e,t,n){D(`inputs`,{...ce.value,[e]:t===``?void 0:ue(t)?t:cb(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})),he=q(null);function ge(e){let t=he.value??S.value.lead?.key;if(!t)return;let n=typeof h.value[t]==`string`?h.value[t]:``,r=`{{ steps.${e}.summary }}`;D(t,n?`${n.trimEnd()} ${r}`:r)}let _e=q({});function ve(e,t){try{D(e,t.trim()?OY(t):void 0),_e.value={..._e.value,[e]:``}}catch(t){_e.value={..._e.value,[e]:String(t.
Line truncated
|
||||
`)[0]}}}let ye=e=>e===void 0?``:kY(e).trimEnd(),be=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),xe=e=>typeof h.value[e]==`string`?h.value[e]:``,Se=[{value:``,label:`Park the task`},{value:`continue`,label:`Continue`}];return(t,r)=>(F(),k(`div`,NX,[v.value?(F(),k(`p`,PX,z(v.value),1)):N(``,!0),o.value?(F(),k(`section`,FX,[s.value===`switch`?(F(),k(`label`,IX,[r[15]||=I(`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),O(B(Z),{"model-value":o.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,list:`${B(n)}-switch-on`,onChange:r[0]||=e=>u(e.target.value.trim())},null,8,[`model-value`,`list`]),I(`datalist`,{id:`${B(n)}-switch-on`},[(F(!0),k(H,null,A(g.value,e=>(F(),k(`option`,{key:e,value:`steps.${e}.result.`},null,8,RX))),128))],8,LX)])):N(``,!0),I(`div`,zX,z(s.value===`switch`?`Cases`:`Branches`),1),(F(!0),k(H,null,A(c.value,e=>(F(),k(`div`,{key:e,class:`flex items-center gap-2`},[O(B(Z),{"model-value":e,class:R(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`]),O(B(Y),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:c.value.length<=l.value,onClick:t=>p(`delete`,e)},{default:P(()=>[O(B(Ju))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),I(`div`,BX,[O(B(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]||=_t(pt(e=>p(`add`,d.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),O(B(Y),{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:P(()=>[O(B(Mu))]),_:1},8,[`aria-label`,`disabled`])]),f.value?(F(),k(`p`,VX,z(f.value),1)):N(``,!0)])):N(``,!0),S.value.lead?(F(),k(`section`,HX,[I(`div`,{class:`flex items-center gap-1 text-xs font-medium text-fg-muted`,title:S.value.lead.schema.description},[V(z(be(S.value.lead.key,S.value.lead.schema))+` `,1),S.value.lead.schema.description?(F(),K(B(au),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,UX),S.value.lead.kind===`workflow`?(F(),K(fX,{key:0,value:xe(S.value.lead.key),workflows:e.workflows,label:be(S.value.lead.key,S.value.lead.schema),onPick:r[4]||=e=>te(S.value.lead.key,e)},null,8,[`value`,`workflows`,`label`])):S.value.lead.kind===`select`?(F(),K(dX,{key:1,class:`w-full`,"model-value":xe(S.value.lead.key),options:w(S.value.lead.options),"aria-label":be(S.value.lead.key,S.value.lead.schema),"onUpdate:modelValue":r[5]||=e=>D(S.value.lead.key,e||void 0)},null,8,[`model-value`,`options`,`aria-label`])):S.value.lead.kind===`text`?(F(),K(B(jf),{key:2,"model-value":xe(S.value.lead.key),class:`min-h-32 text-[13px] leading-relaxed`,onFocus:r[6]||=e=>he.value=S.value.lead.key,"onUpdate:modelValue":r[7]||=e=>D(S.value.lead.key,String(e))},null,8,[`model-value`])):(F(),K(B(Z),{key:3,"model-value":xe(S.value.lead.key),onFocus:r[8]||=e=>he.value=S.value.lead.key,"onUpdate:modelValue":r[9]||=e=>D(S.value.lead.key,String(e))},null,8,[`model-value`])),g.value.length&&S.value.lead.kind!==`select`?(F(),k(`div`,WX,[r[16]||=I(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(F(!0),k(H,null,A(g.value,e=>(F(),K(B(Y),{key:e,type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,title:`{{ steps.${e}.summary }}`,onClick:t=>ge(e)},{default:P(()=>[V(z(e),1)]),_:2},1032,[`title`,`onClick`]))),128))])):N(``,!0)])):N(``,!0),O(B(Y),{type:`button`,variant:`ghost`,size:`xs`,class:`-ml-2 text-fg-muted aria-expanded:bg-transparent`,"aria-expanded":C.value,onClick:r[10]||=e=>C.value=!C.value},{default:P(()=>[O(B(ae),{"data-icon":`inline-start`,class:R([`transition-transform`,!C.value&&`-rotate-90`])},null,8,[`class`]),r[17]||=V(`More `,-1)]),_:1},8,[`aria-expanded`]),C.value?(F(),k(H,{key:3},[S.value.compact.length?(F(),k(`section`,GX,[(F(!0),k(H,null,A(S.value.compact,t=>(F(),k(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[I(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:t.schema.description},[V(z(be(t.key,t.schema))+` `,1),t.schema.description?(F(),K(B(au),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,KX),t.kind===`workflow`?(F(),K(fX,{key:0,class:`max-w-48`,value:xe(t.key),workflows:e.workflows,label:be(t.key,t.schema),onPick:e=>te(t.key,e)},null,8,[`value`,`workflows`,`label`,`onPick`])):t.kind===`boolean`?(F(),K(B(Jg),{key:1,"model-value":h.value[t.key]===!0,"onUpdate:modelValue":e=>D(t.key,e||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):t.kind===`select`?(F(),K(dX,{key:2,class:`w-40`,"model-value":xe(t.key),options:w(t.options),"aria-label":be(t.key,t.schema),"onUpdate:modelValue":
Line truncated
|
||||
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>D(e.key,String(t).split(`
|
||||
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(I(),A(H,{key:2},[k(B(Su),{"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]?(I(),A(`span`,XX,z(ge.value[e.key]),1)):P(``,!0)],64))]))),128)),L(`section`,ZX,[_.value?(I(),A(`p`,QX,z(_.value),1)):P(``,!0),L(`div`,$X,[L(`label`,eZ,[r[20]||=L(`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),k(B(Z),{class:`h-8 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=>ee(`when`,String(e))},null,8,[`aria-invalid`,`model-value`])]),L(`label`,tZ,[r[21]||=L(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),k(sX,{class:`w-36`,"aria-label":`If it fails`,"model-value":a.value.on_failure??``,options:xe,"onUpdate:modelValue":r[12]||=e=>ee(`on_failure`,e||void 0)},null,8,[`model-value`])]),L(`label`,nZ,[r[22]||=L(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),k(B(Z),{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-8 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`])]),L(`div`,rZ,[L(`label`,{for:`${B(n)}-backoff`,class:`flex-1 text-[13px]`},`Retry backoff`,8,iZ),k(B(Ng),{id:`${B(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)):P(``,!0)]))}}),oZ={class:`space-y-1.5`},sZ={class:`flex items-center text-xs font-medium text-fg-muted`},cZ={key:0,class:`divide-y divide-border rounded-md border border-border`},lZ=N({__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=J(()=>Object.entries(WY(n.yaml,n.field)??{}));function o(e){r(`update:yaml`,GY(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)=>(I(),A(`section`,oZ,[L(`div`,sZ,[V(z(e.field===`inputs`?`Inputs`:`Outputs`)+` `,1),k(B(X),{type:`button`,variant:`ghost`,size:`xs`,class:`ml-auto`,onClick:c},{default:F(()=>[k(B(Lc),{"data-icon":`inline-start`}),n[0]||=V(`Add`,-1)]),_:1})]),a.value.length?(I(),A(`div`,cZ,[(I(!0),A(H,null,j(a.value,([t,n],r)=>(I(),A(`div`,{key:r,class:`flex items-center gap-2 px-2 py-1.5`},[k(B(Z),{"model-value":t,class:`h-8 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`]),k(sX,{"model-value":n.type??`string`,options:B(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`]),k(B(Wg),{"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`]),k(B(X),{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Remove ${t}`,onClick:e=>o(a.value.filter((e,t)=>t!==r))},{default:F(()=>[k(B($c))]),_:1},8,[`aria-label`,`onClick`])]))),128))])):P(``,!0)]))}}),uZ={class:`space-y-4 px-3 py-3`},dZ={class:`divide-y divide-border rounded-md border border-border`},fZ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},pZ={key:0,role:`alert`,class:`px-3 py-2 text-xs text-danger`},mZ={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},hZ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},gZ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},_Z={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},vZ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},yZ={class:`space-y-1.5`},bZ=`6f129e29-0e26-5246-99bd-74cb4496203b`,xZ=N({__name:`WorkflowSettings`,props:{yaml:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=e,r=t,i=e=>{let t=WY(n.yaml,e);return typeof t==`string`?t:``};function a(e,t){r(`update:yaml`,GY(n.yaml,e,t))}let o=bv(),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===bZ)&&a(`identity`,bZ)}catch(e){l.value=String(e.message||e)}finally{c.value=!1}}He(u);let d=J(()=>{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=vg(),p=J(()=>{let e=Object.keys(f.stateFor(`agent-profiles`).r
Line truncated
|
||||
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(F(),k(H,{key:2},[O(B(jf),{"model-value":ye(h.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>ve(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),_e.value[e.key]?(F(),k(`span`,tZ,z(_e.value[e.key]),1)):N(``,!0)],64))]))),128)),I(`section`,nZ,[_.value?(F(),k(`p`,rZ,z(_.value),1)):N(``,!0),I(`div`,iZ,[I(`label`,aZ,[r[20]||=I(`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),O(B(Z),{class:`h-8 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=>ee(`when`,String(e))},null,8,[`aria-invalid`,`model-value`])]),I(`label`,oZ,[r[21]||=I(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),O(dX,{class:`w-36`,"aria-label":`If it fails`,"model-value":a.value.on_failure??``,options:Se,"onUpdate:modelValue":r[12]||=e=>ee(`on_failure`,e||void 0)},null,8,[`model-value`])]),I(`label`,sZ,[r[22]||=I(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),O(B(Z),{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-8 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`])]),I(`div`,cZ,[I(`label`,{for:`${B(n)}-backoff`,class:`flex-1 text-[13px]`},`Retry backoff`,8,lZ),O(B(Lg),{id:`${B(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)):N(``,!0)]))}}),dZ={class:`space-y-1.5`},fZ={class:`flex items-center text-xs font-medium text-fg-muted`},pZ={key:0,class:`divide-y divide-border rounded-md border border-border`},mZ=M({__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=J(()=>Object.entries(qY(n.yaml,n.field)??{}));function o(e){r(`update:yaml`,JY(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)=>(F(),k(`section`,dZ,[I(`div`,fZ,[V(z(e.field===`inputs`?`Inputs`:`Outputs`)+` `,1),O(B(Y),{type:`button`,variant:`ghost`,size:`xs`,class:`ml-auto`,onClick:c},{default:P(()=>[O(B(Mu),{"data-icon":`inline-start`}),n[0]||=V(`Add`,-1)]),_:1})]),a.value.length?(F(),k(`div`,pZ,[(F(!0),k(H,null,A(a.value,([t,n],r)=>(F(),k(`div`,{key:r,class:`flex items-center gap-2 px-2 py-1.5`},[O(B(Z),{"model-value":t,class:`h-8 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`]),O(dX,{"model-value":n.type??`string`,options:B(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`]),O(B(Jg),{"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`]),O(B(Y),{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Remove ${t}`,onClick:e=>o(a.value.filter((e,t)=>t!==r))},{default:P(()=>[O(B(Ju))]),_:1},8,[`aria-label`,`onClick`])]))),128))])):N(``,!0)]))}}),hZ={class:`space-y-4 px-3 py-3`},gZ={class:`divide-y divide-border rounded-md border border-border`},_Z={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},vZ={key:0,role:`alert`,class:`px-3 py-2 text-xs text-danger`},yZ={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},bZ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},xZ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},SZ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},CZ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},wZ={class:`space-y-1.5`},TZ=`6f129e29-0e26-5246-99bd-74cb4496203b`,EZ=M({__name:`WorkflowSettings`,props:{yaml:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=e,r=t,i=e=>{let t=qY(n.yaml,e);return typeof t==`string`?t:``};function a(e,t){r(`update:yaml`,JY(n.yaml,e,t))}let o=wv(),s=q([]),c=q(!0),l=q(``);async function u(){c.value=!0,l.value=``,s.value=[];try{await o.loadOrg();let e=await X.orgAgents(o.homeOrg);s.value=e.agents.filter(e=>e.lifecycle===`active`),!i(`identity`)&&s.value.some(e=>e.id===TZ)&&a(`identity`,TZ)}catch(e){l.value=String(e.message||e)}finally{c.value=!1}}L(u);let d=J(()=>{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=Sg(),p=J(()=>{let e=Object.keys(f.stateFor(`agent-profiles`).re
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 G3(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=K3(n.code,e);return Array.isArray(e)?e.some(e=>W3(n[r],e,t,n.type===`keyup`)):W3(n[r],e,t,n.type===`keyup`)}}function K3(e,t){return t.includes(e)?`code`:`key`}function q3(e,t){let n=J(()=>qe(t?.target)??V3),r=at(qe(e)===!0),i=!1,a=new Set,o=c(qe(e));M(()=>qe(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),zQ([`blur`,`contextmenu`],s),VQ((...e)=>o(...e),e=>{let n=qe(t?.actInsideInputWithModifier)??!0,a=qe(t?.preventDefault)??!1;if(i=U3(e),(!i||i&&!n)&&H3(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}),VQ((...e)=>o(...e),e=>{let n=qe(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&H3(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=qe(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?G3(e,a):e}return r}var J3=`vue-flow__node-desc`,Y3=`vue-flow__edge-desc`,X3=`vue-flow__aria-live`,Z3=[`Enter`,` `,`Escape`],Q3={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function $3(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function e6(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 t6(e){return{width:e.offsetWidth,height:e.offsetHeight}}function n6(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function r6(e,t){return{x:n6(e.x,t[0][0],t[1][0]),y:n6(e.y,t[0][1],t[1][1])}}function i6(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function a6(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function o6(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!a6(e)}function s6(e){return o6(e)&&`computedPosition`in e}function c6(e){return!Number.isNaN(e)&&Number.isFinite(e)}function l6(e){return c6(e.width)&&c6(e.height)&&c6(e.x)&&c6(e.y)}function u6(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:We({width:0,height:0}),computedPosition:We({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:D8(e.data)?e.data:{},events:We(D8(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function d6(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:D8(e.data)?e.data:{},events:We(D8(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function f6(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 p6(...e){if(e.length===3){let[t,n,r]=e;return f6(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>a6(e)&&e.source===r).map(e=>n.find(t=>o6(t)&&t.id===e.target))}function m6(...e){if(e.length===3){let[t,n,r]=e;return f6(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>a6(e)&&e.target===r).map(e=>n.find(t=>o6(t)&&t.id===e.source))}function h6({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function g6(e,t){return t.some(t=>a6(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 _6({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function v6({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?u8(s,o):s}function y6(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 b6({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function x6({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function S6(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=y6(t,b6({...r.computedPosition,...r.dimensions}))}return x6(t)}function C6(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...v6(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 X3(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=Z3(n.code,e);return Array.isArray(e)?e.some(e=>Y3(n[r],e,t,n.type===`keyup`)):Y3(n[r],e,t,n.type===`keyup`)}}function Z3(e,t){return t.includes(e)?`code`:`key`}function Q3(e,t){let n=J(()=>Je(t?.target)??K3),r=ot(Je(e)===!0),i=!1,a=new Set,o=c(Je(e));j(()=>Je(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),WQ([`blur`,`contextmenu`],s),KQ((...e)=>o(...e),e=>{let n=Je(t?.actInsideInputWithModifier)??!0,a=Je(t?.preventDefault)??!1;if(i=J3(e),(!i||i&&!n)&&q3(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}),KQ((...e)=>o(...e),e=>{let n=Je(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&q3(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=Je(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?X3(e,a):e}return r}var $3=`vue-flow__node-desc`,e6=`vue-flow__edge-desc`,t6=`vue-flow__aria-live`,n6=[`Enter`,` `,`Escape`],r6={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function i6(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function a6(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 o6(e){return{width:e.offsetWidth,height:e.offsetHeight}}function s6(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function c6(e,t){return{x:s6(e.x,t[0][0],t[1][0]),y:s6(e.y,t[0][1],t[1][1])}}function l6(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function u6(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function d6(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!u6(e)}function f6(e){return d6(e)&&`computedPosition`in e}function p6(e){return!Number.isNaN(e)&&Number.isFinite(e)}function m6(e){return p6(e.width)&&p6(e.height)&&p6(e.x)&&p6(e.y)}function h6(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:Ge({width:0,height:0}),computedPosition:Ge({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:M8(e.data)?e.data:{},events:Ge(M8(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function g6(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:M8(e.data)?e.data:{},events:Ge(M8(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function _6(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 v6(...e){if(e.length===3){let[t,n,r]=e;return _6(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>u6(e)&&e.source===r).map(e=>n.find(t=>d6(t)&&t.id===e.target))}function y6(...e){if(e.length===3){let[t,n,r]=e;return _6(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>u6(e)&&e.target===r).map(e=>n.find(t=>d6(t)&&t.id===e.source))}function b6({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function x6(e,t){return t.some(t=>u6(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 S6({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function C6({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?h8(s,o):s}function w6(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 T6({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function E6({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function D6(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=w6(t,T6({...r.computedPosition,...r.dimensions}))}return E6(t)}function O6(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...C6(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`},i8=class extends Error{constructor(e,...t){super(r8[e]?.call(r8,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function a8(e){return`clientX`in e}function o8(e){return`sourceEvent`in e}function s8(e,t){let n=a8(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 c8=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function l8(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function u8(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var d8=()=>!0;function f8(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function p8(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())e6(i,$3(e))>0&&r.push(e);return r}var m8=250;function h8(e,t,n,r){let i=[],a=1/0,o=p8(e,n,t+m8);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}=Q6(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 g8(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=d8},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:_}=s8(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=_8(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===I3.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=b8(t,e,a,p,n,!0)}return b}function _8(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function v8(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function y8(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function b8(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===I3.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,...Q6(o,c,c.position,!0)}:c}var x8={[N3.Left]:N3.Right,[N3.Right]:N3.Left,[N3.Top]:N3.Bottom,[N3.Bottom]:N3.Top},S8=[`production`,`prod`];function C8(e,...t){w8()&&console.warn(`[Vue Flow]: ${e}`,...t)}function w8(){return!S8.includes(`production`)}function T8(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,...t6(t)}}):null}function E8(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),Ke(()=>{o.blur()})):n([e])}function D8(e){return B(e)!==void 0}function O8(e,t,n,r){if(!e||!e.source||!e.target)return n(new i8(n8.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=a6(e)?e:{...e,id:h6(e)},i=d6(i,void 0,r),!g6(i,t)&&i}function k8(e,t,n,r,i){if(!t.source||!t.target)return i(new i8(n8.EDGE_INVALID,e.id)),!1;if(!n)return i(new i8(n8.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?h6(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function A8(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!o6(o)){n(new i8(n8.NODE_INVALID,o?.id));continue}let s=u6(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 i8(n8.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 j8(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 M8(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}`;j8(`source`,o,`${r}-${a}--Line truncated
|
||||
`)},z(e.data.summary||e.data.detail),9,tte)):P(``,!0),e.data.when||e.data.retry||e.data.continues?(I(),A(`div`,nte,[e.data.when?(I(),A(`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}`},[k(B(yc),{class:`size-3 shrink-0`,"aria-hidden":`true`}),L(`span`,ite,z(e.data.when),1)],8,rte)):P(``,!0),e.data.retry?(I(),A(`span`,{key:1,class:`flex items-center gap-0.5 rounded bg-secondary px-1`,title:`Up to ${e.data.retry} attempts`},[k(B(zc),{class:`size-3`,"aria-hidden":`true`}),V(`×`+z(e.data.retry),1)],8,ate)):P(``,!0),e.data.continues?(I(),A(`span`,ote,[k(B(qc),{class:`size-3`,"aria-hidden":`true`}),n[10]||=V(`continues`,-1)])):P(``,!0)])):P(``,!0),e.data.run?.error?(I(),A(`p`,{key:4,class:`mt-1 line-clamp-2 text-[11px] text-danger`,title:e.data.run.error},z(e.data.run.error),9,ste)):P(``,!0)],64))]),k(eee,{"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:F(()=>[e.data.expanded?(I(),A(`div`,{key:0,class:`nodrag nopan nowheel cursor-auto border-t border-border`,onClick:n[6]||=mt(()=>{},[`stop`])},[G(t.$slots,`default`)])):P(``,!0)]),_:3}),k(B(f5),{type:`source`,position:B(N3).Bottom},null,8,[`position`]),k(B(f5),{id:`data-out`,type:`source`,position:B(N3).Right,class:`!opacity-0`},null,8,[`position`]),e.data.type===`switch`?(I(),K(B(f5),{key:1,id:`otherwise`,type:`source`,position:B(N3).Right,class:`!opacity-0`},null,8,[`position`])):P(``,!0)],2))}}),lte={class:`pointer-events-none size-full rounded-xl border border-dashed border-border bg-muted/30`},ute={class:`flex items-center gap-1 px-2.5 pt-1.5 text-[11px] text-fg-subtle`},dte={key:0},fte={key:1,class:`font-mono`},pte=N({__name:`LaneNode`,props:{data:{}},setup(e){return(t,n)=>(I(),A(`div`,lte,[L(`div`,ute,[e.data.lane===`switch`?(I(),A(H,{key:0},[k(B(Yc),{class:`size-3`,"aria-hidden":`true`}),e.data.title==="default"?(I(),A(`span`,dte,`otherwise`)):(I(),A(`span`,fte,`= `+z(e.data.title),1))],64)):(I(),A(H,{key:1},[k(B(xc),{class:`size-3`,"aria-hidden":`true`}),V(z(e.data.title),1)],64))])]))}}),C9=240,mte=416,w9=-140,hte=72,gte=.9,T9=N({__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=J(()=>!!n.types?.length),a=J(()=>[...n.types??[],`parallel`,`switch`]),o=J(()=>a.value.filter(e=>[`agent.run`,`workflow.call`].includes(e))),s=e=>e&&AY(e)?o.value:a.value,c=e=>e.kind===`step`?JSON.stringify(e.path??null):e.kind,l=q(null),u=J(()=>{let e=JY(aX(n.yaml),n.stages??[]);return i.value?{nodes:[{id:`workflow`,type:`step`,position:{x:0,y:w9},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=J(()=>u.value.nodes.filter(e=>e.data.path?.length===2).length),f=q({}),p=q({}),m=J(()=>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=J(()=>{let e=m.value?.id;return e&&f.value[e]?Math.max(0,f.value[e]-(p.value[e]??f.value[e])):0}),_=wt(),v=Dt(g,{duration:J(()=>_.value===`reduce`?0:200)}),y=J(()=>{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-hte))}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=J(()=>{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}}})}),C=J(()=>new Map(u.value.nodes.map(e=>[e.id,e.data.run?.status]))),w=q(null),T=J(()=>w.value??m.value?.id),ee=J(()=>u.value.edges.filter(e=>e.kind===`flow`||e.source===T.value||e.target===T.value).map(({label:e,offset:t,insertAfter:n,otherwise:a,...o})=>o.kind===`flow`?{...o,type:`insert`,
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`},l8=class extends Error{constructor(e,...t){super(c8[e]?.call(c8,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function u8(e){return`clientX`in e}function d8(e){return`sourceEvent`in e}function f8(e,t){let n=u8(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 p8=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function m8(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function h8(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var g8=()=>!0;function _8(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function v8(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())a6(i,i6(e))>0&&r.push(e);return r}var y8=250;function b8(e,t,n,r){let i=[],a=1/0,o=v8(e,n,t+y8);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}=r8(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 x8(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=g8},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:_}=f8(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=S8(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===V3.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=T8(t,e,a,p,n,!0)}return b}function S8(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function C8(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function w8(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function T8(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===V3.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,...r8(o,c,c.position,!0)}:c}var E8={[R3.Left]:R3.Right,[R3.Right]:R3.Left,[R3.Top]:R3.Bottom,[R3.Bottom]:R3.Top},D8=[`production`,`prod`];function O8(e,...t){k8()&&console.warn(`[Vue Flow]: ${e}`,...t)}function k8(){return!D8.includes(`production`)}function A8(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,...o6(t)}}):null}function j8(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 M8(e){return B(e)!==void 0}function N8(e,t,n,r){if(!e||!e.source||!e.target)return n(new l8(s8.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=u6(e)?e:{...e,id:b6(e)},i=g6(i,void 0,r),!x6(i,t)&&i}function P8(e,t,n,r,i){if(!t.source||!t.target)return i(new l8(s8.EDGE_INVALID,e.id)),!1;if(!n)return i(new l8(s8.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?b6(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function F8(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!d6(o)){n(new l8(s8.NODE_INVALID,o?.id));continue}let s=h6(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 l8(s8.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 I8(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 L8(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}`;I8(`source`,o,`${r}-${a}--Line truncated
|
||||
`)},z(e.data.summary||e.data.detail),9,lte)):N(``,!0),e.data.when||e.data.retry||e.data.continues?(F(),k(`div`,ute,[e.data.when?(F(),k(`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}`},[O(B(pu),{class:`size-3 shrink-0`,"aria-hidden":`true`}),I(`span`,fte,z(e.data.when),1)],8,dte)):N(``,!0),e.data.retry?(F(),k(`span`,{key:1,class:`flex items-center gap-0.5 rounded bg-secondary px-1`,title:`Up to ${e.data.retry} attempts`},[O(B(Pu),{class:`size-3`,"aria-hidden":`true`}),V(`×`+z(e.data.retry),1)],8,pte)):N(``,!0),e.data.continues?(F(),k(`span`,mte,[O(B(Hu),{class:`size-3`,"aria-hidden":`true`}),r[10]||=V(`continues`,-1)])):N(``,!0)])):N(``,!0),e.data.run?.error?(F(),k(`p`,{key:4,class:`mt-1 line-clamp-2 text-[11px] text-danger`,title:e.data.run.error},z(e.data.run.error),9,hte)):N(``,!0)],64))]),O(xt,{"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:P(()=>[e.data.expanded?(F(),k(`div`,{key:0,class:`nodrag nopan nowheel cursor-auto border-t border-border`,onClick:r[6]||=pt(()=>{},[`stop`])},[G(t.$slots,`default`)])):N(``,!0)]),_:3}),O(B(_5),{type:`source`,position:B(R3).Bottom},null,8,[`position`]),O(B(_5),{id:`data-out`,type:`source`,position:B(R3).Right,class:`!opacity-0`},null,8,[`position`]),e.data.type===`switch`?(F(),K(B(_5),{key:1,id:`otherwise`,type:`source`,position:B(R3).Right,class:`!opacity-0`},null,8,[`position`])):N(``,!0)],2))}}),_te={class:`pointer-events-none size-full rounded-xl border border-dashed border-border bg-muted/30`},vte={class:`flex items-center gap-1 px-2.5 pt-1.5 text-[11px] text-fg-subtle`},yte={key:0},bte={key:1,class:`font-mono`},xte=M({__name:`LaneNode`,props:{data:{}},setup(e){return(t,n)=>(F(),k(`div`,_te,[I(`div`,vte,[e.data.lane===`switch`?(F(),k(H,{key:0},[O(B(Wu),{class:`size-3`,"aria-hidden":`true`}),e.data.title==="default"?(F(),k(`span`,yte,`otherwise`)):(F(),k(`span`,bte,`= `+z(e.data.title),1))],64)):(F(),k(H,{key:1},[O(B(hu),{class:`size-3`,"aria-hidden":`true`}),V(z(e.data.title),1)],64))])]))}}),S9=240,Ste=416,C9=-140,Cte=72,wte=.9,w9=M({__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=J(()=>!!n.types?.length),a=J(()=>[...n.types??[],`parallel`,`switch`]),o=J(()=>a.value.filter(e=>[`agent.run`,`workflow.call`].includes(e))),s=e=>e&&NY(e)?o.value:a.value,c=e=>e.kind===`step`?JSON.stringify(e.path??null):e.kind,l=q(null),u=J(()=>{let e=ZY(cX(n.yaml),n.stages??[]);return i.value?{nodes:[{id:`workflow`,type:`step`,position:{x:0,y:C9},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=J(()=>u.value.nodes.filter(e=>e.data.path?.length===2).length),f=q({}),p=q({}),m=J(()=>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=J(()=>{let e=m.value?.id;return e&&f.value[e]?Math.max(0,f.value[e]-(p.value[e]??f.value[e])):0}),_=Ot(),v=At(g,{duration:J(()=>_.value===`reduce`?0:200)}),y=J(()=>{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-Cte))}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=e=>{let t=m.value;return!t||!e.style?.width?!1:e.position.x<=t.position.x&&e.position.x+parseFloat(String(e.style.width))>=t.position.x+S9};function C(e){let t=m.value;if(!t)return 0;if(e.id===t.id||S(e))return-88;let n=t.position.x+S9/2,r=e.style?.width?parseFloat(String(e.style.width)):e.type===`step`?S9:32,i=e.position.x+r/2;return Math.abs(i-n)<S9/2?0:i<n?-88:88}let w=J(()=>{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 c=t.position.x+C(t),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,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,r=parseFloat(Stri
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 E9(e){let t=wY(e).toJS(),n=new Map;for(let r of aX(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 D9(e,t,n){let r=E9(e),i=E9(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 xte={class:`flex flex-col gap-3 md:grid md:h-[calc(100dvh-17rem)] md:min-h-[26rem] md:grid-cols-[18rem_1fr]`},Ste=[`aria-current`,`onClick`],Cte={class:`flex items-center gap-2 text-sm`},wte={class:`font-mono text-xs text-fg-subtle`},Tte=[`title`],Ete={key:0,class:`px-3 py-2 text-sm text-fg-muted`},Dte={key:1,class:`flex min-h-0 flex-col gap-2`},Ote={class:`flex items-center gap-2 max-md:flex-wrap`},kte={key:0,class:`rounded-lg border border-border p-4 text-sm text-fg-muted`},Ate={key:1,class:`min-h-0 flex-1 overflow-auto rounded-lg border border-border py-2 font-mono text-[13px] leading-6`},jte={class:`inline-block w-4 select-none text-fg-subtle`},Mte={key:2,class:`grid min-h-0 flex-1 gap-3 max-md:flex-none md:grid-cols-2`},Nte={class:`flex min-h-0 flex-col gap-1`},Pte={class:`text-xs font-medium text-fg-muted`},Fte={class:`min-h-0 flex-1 max-md:h-72 max-md:flex-none`},Ite={class:`flex min-h-0 flex-col gap-1`},Lte={class:`min-h-0 flex-1 max-md:h-72 max-md:flex-none`},Rte=N({__name:`WorkflowHistory`,props:Ye({revisions:{},current:{},error:{}},{selected:{default:0},selectedModifiers:{},mode:{default:`yaml`},modeModifiers:{}}),emits:Ye([`restore`],[`update:selected`,`update:mode`]),setup(e,{emit:t}){let n=e,r=t,i=je(e,`selected`),a=je(e,`mode`);M(()=>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=J(()=>n.revisions.find(e=>e.version===i.value)),s=J(()=>o.value?.yaml??null),c=J(()=>s.value===null?[]:bte(s.value,n.current)),l=J(()=>s.value!==null&&s.value===n.current),u=J(()=>s.value===null?{}:D9(s.value,n.current,`removed`)),d=J(()=>s.value===null?{}:D9(n.current,s.value,`added`)),f={added:`default`,edited:`secondary`,removed:`destructive`};return(t,n)=>(I(),A(`div`,xte,[L(`ol`,{class:R(B(U)(`min-h-0 divide-y divide-border overflow-y-auto rounded-lg border border-border`,e.revisions.length&&`max-md:hidden`)),"aria-label":`Revisions`},[(I(!0),A(H,null,j(e.revisions,e=>(I(),A(`li`,{key:e.version},[L(`button`,{type:`button`,class:R([`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},[L(`span`,Cte,[L(`span`,wte,`v`+z(e.version),1),k(B(E),{variant:f[e.change]},{default:F(()=>[V(z(e.change),1)]),_:2},1032,[`variant`])]),L(`span`,{class:`mt-0.5 block truncate text-xs text-fg-muted`,title:e.at},z(e.actor||`unknown`)+` · `+z(e.source||`unknown`)+` · `+z(B(U_)(e.at)),9,Tte)],10,Ste)]))),128)),e.revisions.length?P(``,!0):(I(),A(`li`,Ete,z(e.error||`No recorded changes`),1))],2),e.revisions.length?(I(),K(B(Xl),{key:0,"model-value":String(i.value),"onUpdate:modelValue":n[0]||=e=>i.value=Number(e)},{default:F(()=>[k(B(tu),{class:`w-full md:hidden`,"aria-label":`Revision`},{default:F(()=>[k(B(nu))]),_:1}),k(B(Zl),null,{default:F(()=>[(I(!0),A(H,null,j(e.revisions,e=>(I(),K(B($l),{key:e.version,value:String(e.version)},{default:F(()=>[V(`v`+z(e.version)+` · `+z(e.change)+` · `+z(e.actor||`unknown`)+` · `+z(B(U_)(e.at)),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`])):P(``,!0),o.value?(I(),A(`div`,Dte,[L(`div`,Ote,[k(B(wx),{modelValue:a.value,"onUpdate:modelValue":n[1]||=e=>a.value=e},{default:F(()=>[k(B(Ex),null,{default:F(()=>[k(B(Dx),{value:`yaml`},{default:F(()=>[...n[3]||=[V(`YAML`,-1)]]),_:1}),k(B(Dx),{value:`canvas`},{default:F(()=>[...n[4]||=[V(`Canvas`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),k(B(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:F(()=>[k(B(Vc),{"data-icon":`inline-start`}),n[5]||=V(` Restore this version`,-1)]),_:1},8,[`disabled`,`title`])]),s.value===null?(I(),A(`p`,kte,`Workflow removed in this revision.`)):a.value===`yaml`?(I(),A(`pre`,Ate,[L(`code`,null,[(I(!0),A(H,null,j(c.value,(e,t)=>(I(),A(`span`,{key:t,class:R([`block min-h-6 px-3 whitespace-pre-wrap`,{"bg-ok/10":e.kind===`add`,"bg-danger/10 text-danger":e.kind===`del`}])},[L(`span`,jte
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 T9(e){let t=DY(e).toJS(),n=new Map;for(let r of cX(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 E9(e,t,n){let r=T9(e),i=T9(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 kte={class:`flex flex-col gap-3 md:grid md:h-[calc(100dvh-17rem)] md:min-h-[26rem] md:grid-cols-[18rem_1fr]`},Ate=[`aria-current`,`onClick`],jte={class:`flex items-center gap-2 text-sm`},Mte={class:`font-mono text-xs text-fg-subtle`},Nte=[`title`],Pte={key:0,class:`px-3 py-2 text-sm text-fg-muted`},Fte={key:1,class:`flex min-h-0 flex-col gap-2`},Ite={class:`flex items-center gap-2 max-md:flex-wrap`},Lte={key:0,class:`rounded-lg border border-border p-4 text-sm text-fg-muted`},Rte={key:1,class:`min-h-0 flex-1 overflow-auto rounded-lg border border-border py-2 font-mono text-[13px] leading-6`},zte={class:`inline-block w-4 select-none text-fg-subtle`},Bte={key:2,class:`grid min-h-0 flex-1 gap-3 max-md:flex-none md:grid-cols-2`},Vte={class:`flex min-h-0 flex-col gap-1`},Hte={class:`text-xs font-medium text-fg-muted`},Ute={class:`min-h-0 flex-1 max-md:h-72 max-md:flex-none`},Wte={class:`flex min-h-0 flex-col gap-1`},Gte={class:`min-h-0 flex-1 max-md:h-72 max-md:flex-none`},Kte=M({__name:`WorkflowHistory`,props:Xe({revisions:{},current:{},error:{}},{selected:{default:0},selectedModifiers:{},mode:{default:`yaml`},modeModifiers:{}}),emits:Xe([`restore`],[`update:selected`,`update:mode`]),setup(e,{emit:t}){let n=e,r=t,i=Ne(e,`selected`),a=Ne(e,`mode`);j(()=>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=J(()=>n.revisions.find(e=>e.version===i.value)),s=J(()=>o.value?.yaml??null),c=J(()=>s.value===null?[]:Ote(s.value,n.current)),l=J(()=>s.value!==null&&s.value===n.current),u=J(()=>s.value===null?{}:E9(s.value,n.current,`removed`)),d=J(()=>s.value===null?{}:E9(n.current,s.value,`added`)),f={added:`default`,edited:`secondary`,removed:`destructive`};return(t,n)=>(F(),k(`div`,kte,[I(`ol`,{class:R(B(U)(`min-h-0 divide-y divide-border overflow-y-auto rounded-lg border border-border`,e.revisions.length&&`max-md:hidden`)),"aria-label":`Revisions`},[(F(!0),k(H,null,A(e.revisions,e=>(F(),k(`li`,{key:e.version},[I(`button`,{type:`button`,class:R([`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},[I(`span`,jte,[I(`span`,Mte,`v`+z(e.version),1),O(B(E),{variant:f[e.change]},{default:P(()=>[V(z(e.change),1)]),_:2},1032,[`variant`])]),I(`span`,{class:`mt-0.5 block truncate text-xs text-fg-muted`,title:e.at},z(e.actor||`unknown`)+` · `+z(e.source||`unknown`)+` · `+z(B(q_)(e.at)),9,Nte)],10,Ate)]))),128)),e.revisions.length?N(``,!0):(F(),k(`li`,Pte,z(e.error||`No recorded changes`),1))],2),e.revisions.length?(F(),K(B(nf),{key:0,"model-value":String(i.value),"onUpdate:modelValue":n[0]||=e=>i.value=Number(e)},{default:P(()=>[O(B(uf),{class:`w-full md:hidden`,"aria-label":`Revision`},{default:P(()=>[O(B(df))]),_:1}),O(B(rf),null,{default:P(()=>[(F(!0),k(H,null,A(e.revisions,e=>(F(),K(B(sf),{key:e.version,value:String(e.version)},{default:P(()=>[V(`v`+z(e.version)+` · `+z(e.change)+` · `+z(e.actor||`unknown`)+` · `+z(B(q_)(e.at)),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`])):N(``,!0),o.value?(F(),k(`div`,Fte,[I(`div`,Ite,[O(B(Ox),{modelValue:a.value,"onUpdate:modelValue":n[1]||=e=>a.value=e},{default:P(()=>[O(B(Ax),null,{default:P(()=>[O(B(jx),{value:`yaml`},{default:P(()=>[...n[3]||=[V(`YAML`,-1)]]),_:1}),O(B(jx),{value:`canvas`},{default:P(()=>[...n[4]||=[V(`Canvas`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),O(B(Y),{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:P(()=>[O(B(Iu),{"data-icon":`inline-start`}),n[5]||=V(` Restore this version`,-1)]),_:1},8,[`disabled`,`title`])]),s.value===null?(F(),k(`p`,Lte,`Workflow removed in this revision.`)):a.value===`yaml`?(F(),k(`pre`,Rte,[I(`code`,null,[(F(!0),k(H,null,A(c.value,(e,t)=>(F(),k(`span`,{key:t,class:R([`block min-h-6 px-3 whitespace-pre-wrap`,{"bg-ok/10":e.kind===`add`,"bg-danger/10 text-danger":e.kind===`del`}])},[I(`span`,zte
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)=>(I(),A(`div`,Gte,[a.value?(I(),A(`p`,{key:0,class:R([`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`},z(a.value),11,Kte)):P(``,!0),L(`form`,{class:`flex items-center gap-2 px-3 py-2`,onSubmit:mt(u,[`prevent`])},[k(B(Jc),{class:`size-4 shrink-0 text-primary`,"aria-hidden":`true`}),Ae(L(`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,qte),[[ut,i.value]]),c.value?(I(),A(`span`,Jte,[k(B($y)),V(z(o.value),1)])):P(``,!0),c.value?(I(),K(B(X),{key:1,type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Stop`,onClick:n[1]||=e=>B(l)?.abort()},{default:F(()=>[k(B(Xc))]),_:1})):(I(),K(B(X),{key:2,type:`submit`,size:`icon-sm`,"aria-label":`Send`,disabled:!i.value.trim()},{default:F(()=>[k(B(tc))]),_:1},8,[`disabled`]))],32)]))}}),Xte=20;function Zte(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:Xte}):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()}M(e,()=>{a=!1,t.value=[],n.value=``,o.value=``,f()},{immediate:!0}),M(n,()=>{r.value=[],i.value=0,u()}),ep(`tasks`,()=>void f(),300);let p=J(()=>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 A9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function j9(e){try{return TY(e)}catch{return null}}function Qte(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=j9(r.yaml);if(!A9(t)||!Array.isArray(t.actions)||!t.actions.some(t=>A9(t)&&t.workflow===e))continue;let i=A9(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=$te(j9(r.yaml),e);t&&n.push({kind:`workflow`,label:r.id,detail:t})}return n}function $te(e,t){let n=(A9(e)&&Array.isArray(e.steps)?e.steps:[]).flatMap(e=>kY(e)?.branches.flatMap(([,e])=>e)??[e]);for(let e of n){if(!A9(e)||!A9(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||ene(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 ene(e,t){let n=typeof t==`string`?/\{\{\s*steps\.([\w-]+)\.result\.([\w-]+)\s*\}\}/.exec(t):null;if(!n)return[];let r=e.find(e=>A9(e)&&e.id===n[1]),i=A9(r)&&A9(r.settings)?r.settings.result:void 0,a=A9(i)&&A9(i.properties)?i.properties[n[2]]:void 0;return A9(a)&&Array.isArray(a.enum)?a.enum.map(String):[]}function tne(e){let t=vg(),n=BA(),r=q([]);async function i(){let e=await Y.bindings().catch(()=>null);r.value=e?.bindings??[]}return He(i),{triggers:J(()=>Qte(e.value,{routes:n.intakeRoutes,bindings:r.value,playbooks:t.stateFor(`eda-playbooks`).resource?.value?.playbooks??[],definitions:n.collection.definitions})),reload:i}}var nne={class:`flex items-center gap-2`},rne={class:`ml-1 font-mono text-xs text-fg-subtle`},ine={key:0,class:`shrink-0 text-xs font-medium text-fg-muted xl:hidden`},ane={class:`ml-auto flex min-w-0 items-center gap-1`},one={key:0,class:`flex min-w-0 items-center gap-1`},sne=[`title`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(e,t)=>(F(),k(`div`,$te,[a.value?(F(),k(`p`,{key:0,class:R([`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`},z(a.value),11,ene)):N(``,!0),I(`form`,{class:`flex items-center gap-2 px-3 py-2`,onSubmit:pt(u,[`prevent`])},[O(B(Uu),{class:`size-4 shrink-0 text-primary`,"aria-hidden":`true`}),Me(I(`input`,{"onUpdate:modelValue":t[0]||=e=>i.value=e,class:`min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-fg-subtle`,placeholder:`Build with Archie`,"aria-label":`Build with Archie`,disabled:c.value},null,8,tne),[[gt,i.value]]),c.value?(F(),k(`span`,nne,[O(B(rb)),V(z(o.value),1)])):N(``,!0),c.value?(F(),K(B(Y),{key:1,type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Stop`,onClick:t[1]||=e=>B(l)?.abort()},{default:P(()=>[O(B(Gu))]),_:1})):(F(),K(B(Y),{key:2,type:`submit`,size:`icon-sm`,"aria-label":`Send`,disabled:!i.value.trim()},{default:P(()=>[O(B($l))]),_:1},8,[`disabled`]))],32)]))}}),ine=20;function ane(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 X.taskPage({workflow:r,limit:ine}):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 X.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()}j(e,()=>{a=!1,t.value=[],n.value=``,o.value=``,f()},{immediate:!0}),j(n,()=>{r.value=[],i.value=0,u()}),ch(`tasks`,()=>void f(),300);let p=J(()=>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 k9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function A9(e){try{return OY(e)}catch{return null}}function one(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=A9(r.yaml);if(!k9(t)||!Array.isArray(t.actions)||!t.actions.some(t=>k9(t)&&t.workflow===e))continue;let i=k9(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=sne(A9(r.yaml),e);t&&n.push({kind:`workflow`,label:r.id,detail:t})}return n}function sne(e,t){let n=(k9(e)&&Array.isArray(e.steps)?e.steps:[]).flatMap(e=>MY(e)?.branches.flatMap(([,e])=>e)??[e]);for(let e of n){if(!k9(e)||!k9(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||cne(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 cne(e,t){let n=typeof t==`string`?/\{\{\s*steps\.([\w-]+)\.result\.([\w-]+)\s*\}\}/.exec(t):null;if(!n)return[];let r=e.find(e=>k9(e)&&e.id===n[1]),i=k9(r)&&k9(r.settings)?r.settings.result:void 0,a=k9(i)&&k9(i.properties)?i.properties[n[2]]:void 0;return k9(a)&&Array.isArray(a.enum)?a.enum.map(String):[]}function lne(e){let t=Sg(),n=UA(),r=q([]);async function i(){let e=await X.bindings().catch(()=>null);r.value=e?.bindings??[]}return L(i),{triggers:J(()=>one(e.value,{routes:n.intakeRoutes,bindings:r.value,playbooks:t.stateFor(`eda-playbooks`).resource?.value?.playbooks??[],definitions:n.collection.definitions})),reload:i}}var une={class:`flex items-center gap-2`},dne={class:`ml-1 font-mono text-xs text-fg-subtle`},fne={key:0,class:`shrink-0 text-xs font-medium text-fg-muted xl:hidden`},pne={role:`group`,"aria-label":`Runs`,class:`ml-auto flex min-w-0 items-center gap-1`},mne={key:0,class:`max-sm:hidden`},hne={key:1,class:`flex min-w-0 items-center gap-1`},gne={r
Line truncated
|
||||
Vendored
-1
@@ -34,7 +34,6 @@
|
||||
</script>
|
||||
<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/createLucideIcon.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/alert.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/Input.js">
|
||||
|
||||
Reference in new issue
Block a user