fix(ui): render unknown routes and correct status description

This commit is contained in:
sam committed 2026-10-09 09:57:56 +11:00
1 parent 02ab747ca9
commit 0792f0ba84
12 files changed
+53 -33

No files matched your search

+1 -1
View File
@@ -1 +1 @@
import{Ct as e,Et as t,Tr as n,Wn as r,Z as i,_n as a,_t as o,an as s,dn as c,gt as l,hr as u,i as d,jr as f,mt as p,pt as m,rt as h,t as g,wt as _}from"./PageHeader.js";import{l as v,n as y,t as b,v as x}from"./HistoryLink.js";import{v as S}from"./index.js";var C={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},w={key:1,class:`text-sm text-fg-muted`},T={class:`flex items-center justify-between`},E={class:`font-mono text-sm`},D=`agent-profiles`,O=t({__name:`AgentProfilesPage`,setup(t){let O=v();s(O.load);let k=m(()=>O.drafts[D]?.value),A=u(``);function j(){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=``)}function M(e,t){e.tools=String(t).split(`,`).map(e=>e.trim()).filter(Boolean)}return(t,s)=>(c(),o(`div`,null,[_(g,{title:`Agent profiles`},{default:r(()=>[_(b,{kinds:[D]},null,8,[`kinds`])]),_:1}),_(y,{kind:D,class:`mb-4`}),n(O).catalogError||n(O).stateFor(D).error?(c(),o(`p`,C,f(n(O).catalogError||n(O).stateFor(D).error),1)):l(``,!0),p(`form`,{class:`mb-4 flex gap-2`,onSubmit:i(j,[`prevent`])},[_(n(x),{modelValue:A.value,"onUpdate:modelValue":s[0]||=e=>A.value=e,"aria-label":`Profile name`,placeholder:`Profile name`,class:`max-w-xs`},null,8,[`modelValue`]),_(n(d),{type:`submit`,disabled:!A.value.trim()||!!k.value?.[A.value.trim()]},{default:r(()=>[...s[1]||=[e(`Add profile`,-1)]]),_:1},8,[`disabled`])],32),Object.keys(k.value??{}).length?l(``,!0):(c(),o(`p`,w,`No agent profiles.`)),(c(!0),o(h,null,a(k.value,(t,i)=>(c(),o(`section`,{key:i,class:`mb-6 border-t pt-4`},[p(`div`,T,[p(`h2`,E,f(i),1),_(n(d),{variant:`ghost`,size:`sm`,onClick:e=>delete k.value[i]},{default:r(()=>[...s[2]||=[e(`Remove profile`,-1)]]),_:1},8,[`onClick`])]),_(n(S),{label:`Image`,for:`${i}-image`},{default:r(()=>[_(n(x),{id:`${i}-image`,modelValue:t.image,"onUpdate:modelValue":e=>t.image=e,placeholder:`Container image`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),_(n(S),{label:`Kit`,for:`${i}-kit`,hint:`Pinned digest; leave Image empty when using a Kit.`},{default:r(()=>[_(n(x),{id:`${i}-kit`,modelValue:t.kit,"onUpdate:modelValue":e=>t.kit=e,placeholder:`registry/kit@sha256:…`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),_(n(S),{label:`Adapter`,for:`${i}-adapter`},{default:r(()=>[_(n(x),{id:`${i}-adapter`,modelValue:t.adapter,"onUpdate:modelValue":e=>t.adapter=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),_(n(S),{label:`Tools`,for:`${i}-tools`,hint:`Comma-separated tool names.`},{default:r(()=>[_(n(x),{id:`${i}-tools`,"model-value":(t.tools??[]).join(`, `),"onUpdate:modelValue":e=>M(t,e)},null,8,[`id`,`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`for`])]))),128))]))}});export{O as default};
import{A as e,D as t,Jt as n,O as r,_ as i,b as a,ht as o,kn as s,lt as c,nr as l,s as u,t as d,v as f,x as p,xt as m,yn as h}from"./PageHeader.js";import{X as g,r as _}from"./badge.js";import{l as v,n as y,t as b,v as x}from"./HistoryLink.js";import{v as S}from"./index.js";var C={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},w={key:1,class:`text-sm text-fg-muted`},T={class:`flex items-center justify-between`},E={class:`font-mono text-sm`},D=`agent-profiles`,O=e({__name:`AgentProfilesPage`,setup(e){let O=v();c(O.load);let k=i(()=>O.drafts[D]?.value),A=h(``);function j(){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=``)}function M(e,t){e.tools=String(t).split(`,`).map(e=>e.trim()).filter(Boolean)}return(e,i)=>(o(),p(`div`,null,[r(d,{title:`Agent profiles`},{default:n(()=>[r(b,{kinds:[D]},null,8,[`kinds`])]),_:1}),r(y,{kind:D,class:`mb-4`}),s(O).catalogError||s(O).stateFor(D).error?(o(),p(`p`,C,l(s(O).catalogError||s(O).stateFor(D).error),1)):a(``,!0),f(`form`,{class:`mb-4 flex gap-2`,onSubmit:g(j,[`prevent`])},[r(s(x),{modelValue:A.value,"onUpdate:modelValue":i[0]||=e=>A.value=e,"aria-label":`Profile name`,placeholder:`Profile name`,class:`max-w-xs`},null,8,[`modelValue`]),r(s(_),{type:`submit`,disabled:!A.value.trim()||!!k.value?.[A.value.trim()]},{default:n(()=>[...i[1]||=[t(`Add profile`,-1)]]),_:1},8,[`disabled`])],32),Object.keys(k.value??{}).length?a(``,!0):(o(),p(`p`,w,`No agent profiles.`)),(o(!0),p(u,null,m(k.value,(e,a)=>(o(),p(`section`,{key:a,class:`mb-6 border-t pt-4`},[f(`div`,T,[f(`h2`,E,l(a),1),r(s(_),{variant:`ghost`,size:`sm`,onClick:e=>delete k.value[a]},{default:n(()=>[...i[2]||=[t(`Remove profile`,-1)]]),_:1},8,[`onClick`])]),r(s(S),{label:`Image`,for:`${a}-image`},{default:n(()=>[r(s(x),{id:`${a}-image`,modelValue:e.image,"onUpdate:modelValue":t=>e.image=t,placeholder:`Container image`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),r(s(S),{label:`Kit`,for:`${a}-kit`,hint:`Pinned digest; leave Image empty when using a Kit.`},{default:n(()=>[r(s(x),{id:`${a}-kit`,modelValue:e.kit,"onUpdate:modelValue":t=>e.kit=t,placeholder:`registry/kit@sha256:…`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),r(s(S),{label:`Adapter`,for:`${a}-adapter`},{default:n(()=>[r(s(x),{id:`${a}-adapter`,modelValue:e.adapter,"onUpdate:modelValue":t=>e.adapter=t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),r(s(S),{label:`Tools`,for:`${a}-tools`,hint:`Comma-separated tool names.`},{default:n(()=>[r(s(x),{id:`${a}-tools`,"model-value":(e.tools??[]).join(`, `),"onUpdate:modelValue":t=>M(e,t)},null,8,[`id`,`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`for`])]))),128))]))}});export{O as default};
+1 -1
View File
@@ -1 +1 @@
import{Ct as e,Et as t,Tr as n,Wn as r,_n as i,_t as a,an as o,dn as s,gt as c,i as l,jr as u,mt as d,pt as f,rt as p,t as m,wt as h}from"./PageHeader.js";import{l as g,n as _,t as v,v as y}from"./HistoryLink.js";import{_ as b,v as x}from"./index.js";var S={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},C={key:1,class:`text-sm text-fg-muted`},w={class:`flex justify-end`},T=`credential-bindings`,E=t({__name:`CredentialBindingsPage`,setup(t){let E=g();o(E.load);let D=f(()=>E.drafts[T]?.value);function O(){let e=E.drafts[T];e&&(e.value||=[],e.value.push({service:``,org:``,secret:{engine:``,key:``}}))}return(t,o)=>(s(),a(`div`,null,[h(m,{title:`Credential bindings`},{default:r(()=>[h(v,{kinds:[T]},null,8,[`kinds`]),h(n(l),{onClick:O},{default:r(()=>[...o[0]||=[e(`Add binding`,-1)]]),_:1})]),_:1}),h(_,{kind:T,class:`mb-4`}),n(E).catalogError||n(E).stateFor(T).error?(s(),a(`p`,S,u(n(E).catalogError||n(E).stateFor(T).error),1)):c(``,!0),D.value?.length?c(``,!0):(s(),a(`p`,C,`No credential bindings.`)),(s(!0),a(p,null,i(D.value,(t,i)=>(s(),a(`section`,{key:i,class:`mb-6 border-t pt-4`},[d(`div`,w,[h(n(l),{variant:`ghost`,size:`sm`,onClick:e=>D.value.splice(i,1)},{default:r(()=>[...o[1]||=[e(`Remove binding`,-1)]]),_:1},8,[`onClick`])]),h(n(x),{label:`Service`,for:`binding-${i}-service`},{default:r(()=>[h(n(y),{id:`binding-${i}-service`,modelValue:t.service,"onUpdate:modelValue":e=>t.service=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),h(n(x),{label:`Organisation`,for:`binding-${i}-org`,hint:`Empty uses the default organisation.`},{default:r(()=>[h(n(y),{id:`binding-${i}-org`,modelValue:t.org,"onUpdate:modelValue":e=>t.org=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),h(n(x),{label:`Secret`},{default:r(()=>[h(b,{modelValue:t.secret,"onUpdate:modelValue":e=>t.secret=e,"id-prefix":`binding-${i}-secret`},null,8,[`modelValue`,`onUpdate:modelValue`,`id-prefix`])]),_:2},1024)]))),128))]))}});export{E as default};
import{A as e,D as t,Jt as n,O as r,_ as i,b as a,ht as o,kn as s,lt as c,nr as l,s as u,t as d,v as f,x as p,xt as m}from"./PageHeader.js";import{r as h}from"./badge.js";import{l as g,n as _,t as v,v as y}from"./HistoryLink.js";import{_ as b,v as x}from"./index.js";var S={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},C={key:1,class:`text-sm text-fg-muted`},w={class:`flex justify-end`},T=`credential-bindings`,E=e({__name:`CredentialBindingsPage`,setup(e){let E=g();c(E.load);let D=i(()=>E.drafts[T]?.value);function O(){let e=E.drafts[T];e&&(e.value||=[],e.value.push({service:``,org:``,secret:{engine:``,key:``}}))}return(e,i)=>(o(),p(`div`,null,[r(d,{title:`Credential bindings`},{default:n(()=>[r(v,{kinds:[T]},null,8,[`kinds`]),r(s(h),{onClick:O},{default:n(()=>[...i[0]||=[t(`Add binding`,-1)]]),_:1})]),_:1}),r(_,{kind:T,class:`mb-4`}),s(E).catalogError||s(E).stateFor(T).error?(o(),p(`p`,S,l(s(E).catalogError||s(E).stateFor(T).error),1)):a(``,!0),D.value?.length?a(``,!0):(o(),p(`p`,C,`No credential bindings.`)),(o(!0),p(u,null,m(D.value,(e,a)=>(o(),p(`section`,{key:a,class:`mb-6 border-t pt-4`},[f(`div`,w,[r(s(h),{variant:`ghost`,size:`sm`,onClick:e=>D.value.splice(a,1)},{default:n(()=>[...i[1]||=[t(`Remove binding`,-1)]]),_:1},8,[`onClick`])]),r(s(x),{label:`Service`,for:`binding-${a}-service`},{default:n(()=>[r(s(y),{id:`binding-${a}-service`,modelValue:e.service,"onUpdate:modelValue":t=>e.service=t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),r(s(x),{label:`Organisation`,for:`binding-${a}-org`,hint:`Empty uses the default organisation.`},{default:n(()=>[r(s(y),{id:`binding-${a}-org`,modelValue:e.org,"onUpdate:modelValue":t=>e.org=t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),r(s(x),{label:`Secret`},{default:n(()=>[r(b,{modelValue:e.secret,"onUpdate:modelValue":t=>e.secret=t,"id-prefix":`binding-${a}-secret`},null,8,[`modelValue`,`onUpdate:modelValue`,`id-prefix`])]),_:2},1024)]))),128))]))}});export{E as default};
+10 -10
View File
@@ -1,16 +1,16 @@
import{Ct as e,Et as t,Kn as n,Tr as r,Wn as i,_n as a,_t as o,an as s,b as c,dn as l,gt as u,hr as d,ht as f,i as p,jr as m,mt as h,n as g,q as _,rt as ee,t as te,tn as v,wt as y,x as ne}from"./PageHeader.js";import{a as re,c as ie,d as ae,f as oe,g as b,h as se,i as x,l as ce,m as le,n as ue,o as S,p as de,r as fe,s as pe,t as me,u as he}from"./index.js";var C=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,w=(e,t)=>{for(var n in t)C(e,n,{get:t[n],enumerable:!0})},T=(e,t,n,r)=>{for(var i=r>1?void 0:r?ge(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&C(t,n,i),i},E=(e,t)=>(n,r)=>t(n,r,e),_e=`Terminal input`,ve={get:()=>_e,set:e=>_e=e},ye=`Too much output to announce, navigate to rows manually to read`,be={get:()=>ye,set:e=>ye=e};function xe(e){return e.replace(/\r?\n/g,`\r`)}function Se(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function Ce(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function we(e,t,n,r){e.stopPropagation(),e.clipboardData&&Te(e.clipboardData.getData(`text/plain`),t,n,r)}function Te(e,t,n,r){e=xe(e),e=Se(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function Ee(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function De(e,t,n,r,i){Ee(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function Oe(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function ke(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var Ae=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},je=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},Me=``,Ne=` `,Pe=class e{constructor(){this.fg=0,this.bg=0,this.extended=new Fe}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&503316Line truncated
import{A as e,D as t,Jt as n,O as r,Xt as i,at as a,b as o,ht as s,kn as c,lt as l,nr as u,s as d,t as f,v as p,x as m,xt as h,y as g,yn as _}from"./PageHeader.js";import{K as ee,b as te,r as ne,t as re,y as ie}from"./badge.js";import{a as ae,c as oe,d as se,f as ce,g as v,h as le,i as y,l as ue,m as de,n as fe,o as b,p as pe,r as me,s as he,t as ge,u as _e}from"./index.js";var x=Object.defineProperty,ve=Object.getOwnPropertyDescriptor,S=(e,t)=>{for(var n in t)x(e,n,{get:t[n],enumerable:!0})},C=(e,t,n,r)=>{for(var i=r>1?void 0:r?ve(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&x(t,n,i),i},w=(e,t)=>(n,r)=>t(n,r,e),ye=`Terminal input`,be={get:()=>ye,set:e=>ye=e},xe=`Too much output to announce, navigate to rows manually to read`,T={get:()=>xe,set:e=>xe=e};function Se(e){return e.replace(/\r?\n/g,`\r`)}function Ce(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function we(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function Te(e,t,n,r){e.stopPropagation(),e.clipboardData&&Ee(e.clipboardData.getData(`text/plain`),t,n,r)}function Ee(e,t,n,r){e=Se(e),e=Ce(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function De(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function Oe(e,t,n,r,i){De(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function ke(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Ae(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var je=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},Me=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},Ne=``,Pe=` `,Fe=class e{constructor(){this.fg=0,this.bg=0,this.extended=new Ie}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){retuLine 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 Qe=D(`CharSizeService`),$e=D(`CoreBrowserService`),et=D(`MouseService`),tt=D(`RenderService`),nt=D(`SelectionService`),rt=D(`CharacterJoinerService`),it=D(`ThemeService`),at=D(`LinkProviderService`),ot=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ft.isErrorNoTelemetry(e)?new ft(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 $e=E(`CharSizeService`),et=E(`CoreBrowserService`),tt=E(`MouseService`),nt=E(`RenderService`),rt=E(`SelectionService`),it=E(`CharacterJoinerService`),at=E(`ThemeService`),ot=E(`LinkProviderService`),st=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?pt.isErrorNoTelemetry(e)?new pt(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 st(e){lt(e)||ot.onUnexpectedError(e)}var ct=`Canceled`;function lt(e){return e instanceof ut||e instanceof Error&&e.name===ct&&e.message===ct}var ut=class extends Error{constructor(){super(ct),this.name=this.message}};function dt(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var ft=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`}},pt=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function mt(e,t=0){return e[e.length-(1+t)]}var ht;(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})(ht||={});var gt=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||ht.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};gt.empty=new gt(e=>{});function _t(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 vt;(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 ee(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=ee;async function te(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=te})(vt||={});var yt=null;function bt(e){return yt?.trackDisposable(e),e}function xt(e){yt?.markAsDisposed(e)}function St(e,t){yt?.setParent(e,t)}function Ct(e){return yt?.markAsSingleton(e),e}function wt(e){if(vt.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 Tt(...e){return A(()=>wt(e))}function A(e){let t=bt({dispose:_t(()=>{xt(t),e()})});return t}var Et=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,bt(this)}dispose(){this._isDisposed||(xt(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{wt(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return St(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),St(e,null))}};Et.DISABLE_DISPOSED_WARNING=!1;var Dt=Et,j=class{constructor(){this._store=new Dt,bt(this),St(this._store,this)}dispose(){xt(th 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 ct(e){ut(e)||st.onUnexpectedError(e)}var lt=`Canceled`;function ut(e){return e instanceof dt||e instanceof Error&&e.name===lt&&e.message===lt}var dt=class extends Error{constructor(){super(lt),this.name=this.message}};function ft(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var pt=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`}},mt=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function ht(e,t=0){return e[e.length-(1+t)]}var gt;(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})(gt||={});var _t=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||gt.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};_t.empty=new _t(e=>{});function vt(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 yt;(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 ee(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=ee;async function te(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=te})(yt||={});var bt=null;function xt(e){return bt?.trackDisposable(e),e}function St(e){bt?.markAsDisposed(e)}function Ct(e,t){bt?.setParent(e,t)}function wt(e){return bt?.markAsSingleton(e),e}function Tt(e){if(yt.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 Et(...e){return k(()=>Tt(e))}function k(e){let t=xt({dispose:vt(()=>{St(t),e()})});return t}var Dt=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,xt(this)}dispose(){this._isDisposed||(St(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Tt(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return Ct(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),Ct(e,null))}};Dt.DISABLE_DISPOSED_WARNING=!1;var Ot=Dt,A=class{constructor(){this._store=new Ot,xt(this),Ct(this._store,this)}dispose(){St(th Line truncated
`).slice(2).join(`
`))}},Bt=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},Vt=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},Ht=0,Ut=class{constructor(e){this.value=e,this.id=Ht++}},Wt=2,P=class{constructor(e){this._size=0,this._options=e,this._leakageMon=It>0||this._options?.leakWarningThreshold?new Rt(e?.onListenerError??st,this._options?.leakWarningThreshold??It):void 0,this._perfMon=this._options?._profName?new Ft(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 Vt(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||st)(n),j.None}if(this._disposed)return j.None;t&&(e=e.bind(t));let r=new Ut(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=zt.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Ut?(this._deliveryQueue??=new Gt,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=A(()=>{i?.(),this._removeListener(r)});return n instanceof Dt?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*Wt<=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||st;if(!n){e.value(t);return}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 Ut)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}},Gt=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}},Kt=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new P,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new P,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}};Kt.INSTANCE=new Kt;var qt=Kt;function Jt(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}qt.INSTANCE.onDidChangeZoomLevel;function Yt(e){return qt.INSTANCE.getZoomFactor(e)}qt.INSTANCE.onDidChangeFullscreen;var Xt=typeof navigator==`object`?navigator.userAgent:``,Zt=Xt.indexOf(`Firefox`)>=0,Qt=Xt.indexOf(`AppleWebKit`)>=0,$t=Xt.indexOf(`Chrome`)>=0,en=!$t&&Xt.indexOf(`Safari`)>=0;Xt.indexOf(`Electron/`),Xt.indexOf(`Android`);var tn=!1;if(typeof kt.matchMedia==`function`){let e=kt.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=kt.matchMedia(`(display-mode: fullscreen)`);tn=e.matches,Jt(kt,e,({matches:e})=>{tn&&t.matches||(tn=e)})}f 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=T([E(2,O),E(3,$e),E(4,He),E(5,it),E(6,k),E(7,tt)],ri);var ii=class extends j{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(A(()=>{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._renderService.dimLine 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=``))(R||={});var ui;(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=`Ÿ`))(ui||={});var di;(e=>e.ST=`${R.ESC}\\`)(di||={});var fi=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(`${R.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)}}};fi=T([E(2,O),E(3,k),E(4,Ue),E(5,tt)],fi);var z=0,B=0,V=0,H=0,pi={css:`#00000000`,rgba:0},U;(e=>{function t(e,t,n,r){return r===void 0?`#${hi(e)}${hi(t)}${hi(n)}`:`#${hi(e)}${hi(t)}${hi(n)}${hi(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})(U||={});var W;(e=>{function t(e,t){if(H=(t.rgba&255)/255,H===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 z=a+Math.round((n-a)*H),B=o+Math.round((r-o)*H),V=s+Math.round((i-s)*H),{css:U.toCss(z,B,V),rgba:U.toRgba(z,B,V)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=mi.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return U.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[z,B,V]=mi.toChannels(t),{css:U.toCss(z,B,V),rgba:t}}e.opaque=i;function a(e,t){return H=Math.round(t*255),[z,B,V]=mi.toChannels(e.rgba),{css:U.toCss(z,B,V,H),rgba:U.toRgba(z,B,V,H)}}e.opacity=a;function o(e,t){return H=e.rgba&255,a(e,H*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(W||={});va Line truncated
`))}},Vt=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},Ht=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},Ut=0,Wt=class{constructor(e){this.value=e,this.id=Ut++}},Gt=2,N=class{constructor(e){this._size=0,this._options=e,this._leakageMon=Lt>0||this._options?.leakWarningThreshold?new zt(e?.onListenerError??ct,this._options?.leakWarningThreshold??Lt):void 0,this._perfMon=this._options?._profName?new It(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 Ht(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||ct)(n),A.None}if(this._disposed)return A.None;t&&(e=e.bind(t));let r=new Wt(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=Bt.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Wt?(this._deliveryQueue??=new Kt,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=k(()=>{i?.(),this._removeListener(r)});return n instanceof Ot?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*Gt<=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||ct;if(!n){e.value(t);return}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 Wt)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}},Kt=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}},qt=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new N,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new N,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}};qt.INSTANCE=new qt;var Jt=qt;function Yt(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}Jt.INSTANCE.onDidChangeZoomLevel;function Xt(e){return Jt.INSTANCE.getZoomFactor(e)}Jt.INSTANCE.onDidChangeFullscreen;var Zt=typeof navigator==`object`?navigator.userAgent:``,Qt=Zt.indexOf(`Firefox`)>=0,$t=Zt.indexOf(`AppleWebKit`)>=0,en=Zt.indexOf(`Chrome`)>=0,tn=!en&&Zt.indexOf(`Safari`)>=0;Zt.indexOf(`Electron/`),Zt.indexOf(`Android`);var nn=!1;if(typeof At.matchMedia==`function`){let e=At.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=At.matchMedia(`(display-mode: fullscreen)`);nn=e.matches,Yt(At,e,({matches:e})=>{nn&&t.matches||(nn=e)})}f 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=C([w(2,D),w(3,et),w(4,Ue),w(5,at),w(6,O),w(7,nt)],ri);var ii=class extends A{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(k(()=>{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._renderService.dimLine 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=``))(R||={});var ui;(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=`Ÿ`))(ui||={});var di;(e=>e.ST=`${R.ESC}\\`)(di||={});var fi=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(`${R.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)}}};fi=C([w(2,D),w(3,O),w(4,We),w(5,nt)],fi);var z=0,B=0,V=0,H=0,pi={css:`#00000000`,rgba:0},U;(e=>{function t(e,t,n,r){return r===void 0?`#${hi(e)}${hi(t)}${hi(n)}`:`#${hi(e)}${hi(t)}${hi(n)}${hi(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})(U||={});var W;(e=>{function t(e,t){if(H=(t.rgba&255)/255,H===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 z=a+Math.round((n-a)*H),B=o+Math.round((r-o)*H),V=s+Math.round((i-s)*H),{css:U.toCss(z,B,V),rgba:U.toRgba(z,B,V)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=mi.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return U.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[z,B,V]=mi.toChannels(t),{css:U.toCss(z,B,V),rgba:t}}e.opaque=i;function a(e,t){return H=Math.round(t*255),[z,B,V]=mi.toChannels(e.rgba),{css:U.toCss(z,B,V,H),rgba:U.toRgba(z,B,V,H)}}e.opacity=a;function o(e,t){return H=e.rgba&255,a(e,H*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(W||={});va Line truncated
`:`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),oa&&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=ka(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=Wi(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,-Aa),Aa),t/=Aa,t/Math.abs(t)+Math.round(t*(ja-1)))}shouldForceSelection(e){return na?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(),Ma)}_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&&!(na&&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(F(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(A(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<Es+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Es+1&&(this._liveRegion.textContent+=be.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 ve.get()},set promptLabel(e){ve.set(e)},get tooMuchOutput(){return be.get()},set tooMuchOutput(e){be.set(e)}}}_verifyIntegers(...e){for(zs of e)if(zs===1/0||isNaN(zs)||zs%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(zs of e)if(zs&&(zs===1/0||isNaN(zs)||zs%1!=0||zs<0))throw Error(`This API only accepts positive integers`)}},Vs=2,Hs=1,Us=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(Vs,Math.floor(u/e.css.cell.width)),rows:Math.max(Hs,Math.floor(l/e.css.cell.height))}}};function Ws(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 Gs(e,t){let n=t.protocol===`https:`?`wss:`:`ws:`,r=new URLSearchParams({profile:e}).toString();return`${n}//${t.host}/api/harness/terminal?${r}`}var Ks={class:`flex h-full min-h-0 flex-col gap-2`},qs={key:0,class:`text-sm text-muted-foreground`,role:`status`},Js=t({__name:`SetupTerminal`,props:{profile:{}},setup(t){let n=t,r=d(null),i=d(`connecting`),a=null,c=null,f=null,p=null;function m(){try{f?.fit()}catch{}}return s(()=>{let e=r.value;if(!e)return;a=new Bs({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),f=new Us,a.loadAddon(f),a.open(e),m(),a.focus();let t=new WebSocket(Gs(n.profile,window.location));c=t,t.binaryType=`arraybuffer`,t.onopen=()=>{i.value=`open`},t.onmessage=e=>{a&&(typeof e.data==`string`?a.write(e.data):a.write(new Uint8Array(e.data)))},t.onerror=()=>{i.value=`failed`},t.onclose=()=>{i.value=`closed`},a.onData(e=>{t.readyState===WebSocket.OPEN&&t.send(e)}),p=new ResizeObserver(m),p.observe(e)}),v(()=>{p?.disconnect(),p=null,c?.close(),c=null,a?.dispose(),a=null,f=null}),(t,n)=>(l(),o(`div`,Ks,[i.value===`open`?u(``,!0):(l(),o(`p`,qs,[i.value===`connecting`?(l(),o(ee,{key:0},[e(`Connecting…`)],64)):i.value===`closed`?(l(),o(ee,{key:1},[e(`The terminal session ended.`)],64)):(l(),o(ee,{key:2},[e(`Could not open the setup terminal.`)],64))])),h(`div`,{ref_key:`host`,ref:r,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),Ys={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},Xs={key:1,class:`space-y-2`},Zs={class:`flex flex-col gap-1 text-sm`},Qs=[`disabled`],$s={key:0,value:``},ec=[`value`],tc=t({__name:`HarnessPage`,setup(t){let v=d(null),C=d(!0),ge=d(null),w=d(!1),T=d(``),E=d(!1),_e={ready:{label:`Ready`,variant:`ok`},expiring:{label:`Expiring soon`,variant:`warn`},expired:{label:`Expired`,variant:`danger`},unconfigured:{label:`Not set up`,variant:`idle`}};s(ve);async function ve(){C.value=!0,ge.value=null,w.value=!1;try{let e=await ne.harnessBindings();v.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},T.value=v.value.profiles[0]??``}catch(e){let t=e instanceof c?e.status:void 0;t===501||t===503?w.value=!0:ge.value=e instanceof Error?e.message:String(e),v.value=null}finally{C.value=!1}}function ye(){v.value?.terminal&&T.value&&(E.value=!0)}function be(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function xe(e){return e.scopes?.length?e.scopes.join(`, `):`—`}return(t,s)=>(l(),o(`div`,null,[y(te,{title:`Harness`}),ge.value?(l(),o(`p`,Ys,m(ge.value),1)):u(``,!0),C.value?(l(),o(`div`,Xs,[y(r(me),{class:`h-24 w-full`}),y(r(me),{class:`h-40 w-full`})])):w.value?(l(),f(r(b),{key:2},{default:i(()=>[y(r(le),null,{default:i(()=>[y(r(de),null,{default:i(()=>[...s[1]||=[e(`Harness bindings are not configured`,-1)]] Line truncated
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),oa&&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=ka(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=Wi(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,-Aa),Aa),t/=Aa,t/Math.abs(t)+Math.round(t*(ja-1)))}shouldForceSelection(e){return na?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(),Ma)}_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&&!(na&&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(F(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(k(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<Es+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Es+1&&(this._liveRegion.textContent+=T.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 r 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 be.get()},set promptLabel(e){be.set(e)},get tooMuchOutput(){return T.get()},set tooMuchOutput(e){T.set(e)}}}_verifyIntegers(...e){for(zs of e)if(zs===1/0||isNaN(zs)||zs%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(zs of e)if(zs&&(zs===1/0||isNaN(zs)||zs%1!=0||zs<0))throw Error(`This API only accepts positive integers`)}},Vs=2,Hs=1,Us=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(Vs,Math.floor(u/e.css.cell.width)),rows:Math.max(Hs,Math.floor(l/e.css.cell.height))}}};function Ws(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 Gs(e,t){let n=t.protocol===`https:`?`wss:`:`ws:`,r=new URLSearchParams({profile:e}).toString();return`${n}//${t.host}/api/harness/terminal?${r}`}var Ks={class:`flex h-full min-h-0 flex-col gap-2`},qs={key:0,class:`text-sm text-muted-foreground`,role:`status`},Js=e({__name:`SetupTerminal`,props:{profile:{}},setup(e){let n=e,r=_(null),i=_(`connecting`),c=null,u=null,f=null,h=null;function g(){try{f?.fit()}catch{}}return l(()=>{let e=r.value;if(!e)return;c=new Bs({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),f=new Us,c.loadAddon(f),c.open(e),g(),c.focus();let t=new WebSocket(Gs(n.profile,window.location));u=t,t.binaryType=`arraybuffer`,t.onopen=()=>{i.value=`open`},t.onmessage=e=>{c&&(typeof e.data==`string`?c.write(e.data):c.write(new Uint8Array(e.data)))},t.onerror=()=>{i.value=`failed`},t.onclose=()=>{i.value=`closed`},c.onData(e=>{t.readyState===WebSocket.OPEN&&t.send(e)}),h=new ResizeObserver(g),h.observe(e)}),a(()=>{h?.disconnect(),h=null,u?.close(),u=null,c?.dispose(),c=null,f=null}),(e,n)=>(s(),m(`div`,Ks,[i.value===`open`?o(``,!0):(s(),m(`p`,qs,[i.value===`connecting`?(s(),m(d,{key:0},[t(`Connecting…`)],64)):i.value===`closed`?(s(),m(d,{key:1},[t(`The terminal session ended.`)],64)):(s(),m(d,{key:2},[t(`Could not open the setup terminal.`)],64))])),p(`div`,{ref_key:`host`,ref:r,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),Ys={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},Xs={key:1,class:`space-y-2`},Zs={class:`flex flex-col gap-1 text-sm`},Qs=[`disabled`],$s={key:0,value:``},ec=[`value`],tc=e({__name:`HarnessPage`,setup(e){let a=_(null),x=_(!0),ve=_(null),S=_(!1),C=_(``),w=_(!1),ye={ready:{label:`Ready`,variant:`ok`},expiring:{label:`Expiring soon`,variant:`warn`},expired:{label:`Expired`,variant:`danger`},unconfigured:{label:`Not set up`,variant:`idle`}};l(be);async function be(){x.value=!0,ve.value=null,S.value=!1;try{let e=await te.harnessBindings();a.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},C.value=a.value.profiles[0]??``}catch(e){let t=e instanceof ie?e.status:void 0;t===501||t===503?S.value=!0:ve.value=e instanceof Error?e.message:String(e),a.value=null}finally{x.value=!1}}function xe(){a.value?.terminal&&C.value&&(w.value=!0)}function T(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Se(e){return e.scopes?.length?e.scopes.join(`, `):`—`}return(e,l)=>(s(),m(`div`,null,[r(f,{title:`Harness`}),ve.value?(s(),m(`p`,Ys,u(ve.value),1)):o(``,!0),x.value?(s(),m(`div`,Xs,[r(c(ge),{class:`h-24 w-full`}),r(c(ge),{class:`h-40 w-full`})])):S.value?(s(),g(c(v),{key:2},{default:n(()=>[r(c(de),null,{default:n(()=>[r(c(pe),null,{default:n(()=>[...l[1]||=[t(`Harness bindings are not configured`,-1)]]),_:1} Line truncated
+1 -1
View File
@@ -1 +1 @@
import{Bn as e,C as t,Cr as n,Ct as r,D as i,E as a,Et as o,Gt as s,J as c,Kn as l,Lt as u,Or as d,Pt as f,Qt as p,Sr as m,Tr as h,Wn as g,_n as _,_t as v,an as y,ar as b,br as x,c as S,d as C,dn as w,g as T,gt as E,hr as D,ht as ee,i as te,jr as O,l as ne,ln as re,lr as ie,m as ae,mt as k,n as oe,nr as se,o as ce,p as A,pr as j,pt as M,rt as le,s as ue,sr as N,tr as de,u as fe,ur as pe,vr as P,w as me,wt as he,xr as ge,yn as _e,zn as F,zt as ve}from"./PageHeader.js";var ye=typeof window<`u`,be,I=e=>be=e,xe=Symbol();function Se(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var Ce=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 we(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 L(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){De(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function Te(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function R(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 z=typeof navigator==`object`?navigator:{userAgent:``},Ee=/Macintosh/.test(z.userAgent)&&/AppleWebKit/.test(z.userAgent)&&!/Safari/.test(z.userAgent),De=ye?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!Ee?Oe:`msSaveOrOpenBlob`in z?ke:Ae:()=>{};function Oe(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?R(r):Te(r.href)?L(e,t,n):(r.target=`_blank`,R(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){R(r)},0))}function ke(e,t=`download`,n){if(typeof e==`string`){if(Te(e))L(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){R(t)})}}else navigator.msSaveOrOpenBlob(we(e,n),t)}function Ae(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return L(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(Ce.HTMLElement))||`safari`in Ce,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||Ee)&&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:je}=Object;function Me(){let e=de(!0),t=e.run(()=>D({})),n=[],r=[],i=ie({install(e){I(i),i._a=e,e.provide(xe,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 B=()=>{};function Ne(e,t,n,r=B){e.add(t);let i=()=>{e.delete(t)&&r()};return!n&&se()&&pe(i),i}function V(e,...t){e.forEach(e=>{e(...t)})}var Pe=e=>e(),Fe=Symbol(),H=Symbol();function U(e,t){e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(let n in t){if(!Object.hasOwn(t,n))continue;let r=t[n],i=e[n];e[n]=Se(i)&&Se(r)&&Object.hasOwn(e,n)&&!N(r)&&!b(r)?U(i,r):r}return e}var Ie=Symbol();function Le(e){return!e||typeof e!=`object`||!Object.hasOwn(e,Ie)}var{assign:W}=Object;function Re(e){return!!(N(e)&&e.effect)}function ze(e,t,n,r){let{state:i,actions:a,getters:o}=t,s=n.state.value[e],c;function l(){return s||(n.state.value[e]=i?i():{}),W(m(n.state.value[e]),a,Object.keys(o||{}).reduce((t,r)=>(t[r]=ie(M(()=>{I(n);let t=n._s.get(e);return o[r].call(t,t)})),t),{}))}return c=Be(e,l,t,n,r,!0),c}function Be(e,t,n={},r,i,a){let o,s=W({actions:{}},n),c={deep:!0},l,u,d=new Set,f=new Set,m,h=r.state.value[e];!a&&!h&&(r.state.value[e]={});let g;function _(t){let n;l=u=!1,typeof t==`function`?(t(r.state.value[e]),n={type:`patch function`,storeId:e,events:m}):(U(r.state.value[e],t),n={type:`patch object`,payload:t,storeId:e,events:m});let i=g=Symbol();p().then(()=>{g===i&&(l=!0)}),u=!0,V(d,n,r.state.value[e])}let v=a?function(){let{state:e}=n,t=e?e():{};this.$patch(e=>{W(e,t)})}:B;function y(){o.stop(),d.clear(),f.clear(),r._s.delete(e)}let S=(t,n=``)=>{if(Fe in t)return t[H]=n,t;let i=function(){I(r);let n=Array.from(arguments),a=new Set,o=new Set;function s(e){a.add(e)}function cLine truncated
import{A as e,Ct as t,D as n,Dn as r,En as i,Jt as a,O as o,Qn as s,R as c,Sn as l,Tn as u,U as d,Ut as f,V as p,Wt as m,Xt as h,Y as g,_,_n as v,an as y,b,dn as x,ht as S,kn as C,ln as w,lt as T,mn as E,nr as D,nt as O,on as ee,pn as te,pt as k,s as ne,v as A,wn as j,x as M,xt as re,y as ie,yn as N}from"./PageHeader.js";import{C as ae,E as oe,S as se,T as ce,a as le,c as ue,f as de,h as fe,l as pe,o as me,p as he,q as ge,r as _e,s as P,t as ve,u as F}from"./badge.js";var ye=typeof window<`u`,be,I=e=>be=e,xe=Symbol();function Se(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var Ce=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 we(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 L(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){De(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function Te(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function R(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 z=typeof navigator==`object`?navigator:{userAgent:``},Ee=/Macintosh/.test(z.userAgent)&&/AppleWebKit/.test(z.userAgent)&&!/Safari/.test(z.userAgent),De=ye?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!Ee?Oe:`msSaveOrOpenBlob`in z?ke:Ae:()=>{};function Oe(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?R(r):Te(r.href)?L(e,t,n):(r.target=`_blank`,R(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){R(r)},0))}function ke(e,t=`download`,n){if(typeof e==`string`){if(Te(e))L(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){R(t)})}}else navigator.msSaveOrOpenBlob(we(e,n),t)}function Ae(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return L(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(Ce.HTMLElement))||`safari`in Ce,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||Ee)&&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:je}=Object;function Me(){let e=y(!0),t=e.run(()=>N({})),n=[],r=[],i=te({install(e){I(i),i._a=e,e.provide(xe,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 B=()=>{};function Ne(e,t,n,r=B){e.add(t);let i=()=>{e.delete(t)&&r()};return!n&&ee()&&E(i),i}function V(e,...t){e.forEach(e=>{e(...t)})}var Pe=e=>e(),Fe=Symbol(),H=Symbol();function U(e,t){e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(let n in t){if(!Object.hasOwn(t,n))continue;let r=t[n],i=e[n];e[n]=Se(i)&&Se(r)&&Object.hasOwn(e,n)&&!x(r)&&!w(r)?U(i,r):r}return e}var Ie=Symbol();function Le(e){return!e||typeof e!=`object`||!Object.hasOwn(e,Ie)}var{assign:W}=Object;function Re(e){return!!(x(e)&&e.effect)}function ze(e,t,n,r){let{state:a,actions:o,getters:s}=t,c=n.state.value[e],l;function u(){return c||(n.state.value[e]=a?a():{}),W(i(n.state.value[e]),o,Object.keys(s||{}).reduce((t,r)=>(t[r]=te(_(()=>{I(n);let t=n._s.get(e);return s[r].call(t,t)})),t),{}))}return l=Be(e,u,t,n,r,!0),l}function Be(e,t,n={},r,i,a){let o,s=W({actions:{}},n),c={deep:!0},l,u,d=new Set,p=new Set,m,h=r.state.value[e];!a&&!h&&(r.state.value[e]={});let g;function _(t){let n;l=u=!1,typeof t==`function`?(t(r.state.value[e]),n={type:`patch function`,storeId:e,events:m}):(U(r.state.value[e],t),n={type:`patch object`,payload:t,storeId:e,events:m});let i=g=Symbol();O().then(()=>{g===i&&(l=!0)}),u=!0,V(d,n,r.state.value[e])}let b=a?function(){let{state:e}=n,t=e?e():{};this.$patch(e=>{W(e,t)})}:B;function S(){o.stop(),d.clear(),p.clear(),r._s.delete(e)}let C=(t,n=``)=>{if(Fe in t)return t[H]=n,t;let i=function(){I(r);let n=Array.from(arguments),a=new Set,o=new Set;function s(e){a.add(e)}function c(Line truncated
+1
View File
@@ -0,0 +1 @@
import{A as e,Ct as t,D as n,Jt as r,O as i,ht as a,t as o,v as s,x as c}from"./PageHeader.js";var l=e({__name:`NotFoundPage`,setup(e){return(e,l)=>{let u=t(`RouterLink`);return a(),c(`div`,null,[i(o,{title:`Page not found`}),l[1]||=s(`p`,{class:`mb-4 text-sm text-fg-muted`},`This address does not match a page.`,-1),i(u,{to:`/`,class:`text-sm underline`},{default:r(()=>[...l[0]||=[n(`Return to dashboard`,-1)]]),_:1})])}}});export{l as default};
+2 -4
View File
@@ -1,5 +1,3 @@
function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>S(e)===`[object Map]`,p=e=>S(e)===`[object Set]`,m=e=>S(e)===`[object Date]`,h=e=>S(e)===`[object RegExp]`,g=e=>typeof e==`function`,_=e=>typeof e==`string`,v=e=>typeof e==`symbol`,y=e=>typeof e==`object`&&!!e,b=e=>(y(e)||g(e))&&g(e.then)&&g(e.catch),x=Object.prototype.toString,S=e=>x.call(e),C=e=>S(e).slice(8,-1),w=e=>S(e)===`[object Object]`,T=e=>_(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,E=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),D=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ee=/-\w/g,O=D(e=>e.replace(ee,e=>e.slice(1).toUpperCase())),te=/\B([A-Z])/g,k=D(e=>e.replace(te,`-$1`).toLowerCase()),A=D(e=>e.charAt(0).toUpperCase()+e.slice(1)),ne=D(e=>e?`on${A(e)}`:``),j=(e,t)=>!Object.is(e,t),M=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},N=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},re=e=>{let t=parseFloat(e);return isNaN(t)?e:t},ie=e=>{let t=_(e)?Number(e):NaN;return isNaN(t)?e:t},ae,oe=()=>ae||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},P=e(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function F(e){if(d(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=_(r)?le(r):F(r);if(i)for(let e in i)t[e]=i[e]}return t}if(_(e)||y(e))return e}var se=/;(?![^(]*\))/g,ce=/:([^]+)/,I=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function le(e){let t={};return e.replace(I,e=>e.startsWith(`/*`)?``:e).split(se).forEach(e=>{if(e){let n=e.split(ce);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ue(e){let t=``;if(_(e))t=e;else if(d(e))for(let n=0;n<e.length;n++){let r=ue(e[n]);r&&(t+=r+` `)}else if(y(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function de(e){if(!e)return null;let{class:t,style:n}=e;return t&&!_(t)&&(e.class=ue(t)),n&&(e.style=F(n)),e}var fe=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,pe=e(fe);fe+``;function me(e){return!!e||e===``}function he(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=ye(e[i],t[i],n);return r}function ge(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&ye(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function _e(e,t,n){let r=f(e),i=f(t);if(r||i||(r=p(e),i=p(t),r||i))return r&&i?ge(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!ye(e[r],t[r],n))return!1}return String(e)===String(t)}function ve(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function ye(e,t,n){if(e===t)return!0;let r=m(e),i=m(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=v(e),i=v(t),r||i?e===t:(r=d(e),i=d(t),r||i?r&&i?ve(e,t,n,he):!1:(r=y(e),i=y(t),r||i?!r||!i?!1:ve(e,t,n,_e):String(e)===String(t))))}function be(e,t){return e.findIndex(e=>ye(e,t))}var xe=e=>!!(e&&e.__v_isRef===!0),Se=e=>_(e)?e:e==null?``:d(e)||y(e)&&(e.toString===x||!g(e.toString))?xe(e)?Se(e.value):JSON.stringify(e,Ce,2):String(e),Ce=(e,t)=>xe(t)?Ce(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[we(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>we(e))}:v(t)?we(t):y(t)&&!d(t)&&!w(t)?String(t):t,we=(e,t=``)=>v(e)?`Symbol(${e.description??t})`:e;function Te(e){return e==null?`initial`:typeof e==`string`?e===``?` `:e:String(e)}var L,Ee=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&L&&(L.active?(this.parent=L,this.index=(L.scopes||(L.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=L;try{return L=this,e()}finally{Line truncated
function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>S(e)===`[object Map]`,p=e=>S(e)===`[object Set]`,m=e=>S(e)===`[object Date]`,h=e=>S(e)===`[object RegExp]`,g=e=>typeof e==`function`,_=e=>typeof e==`string`,v=e=>typeof e==`symbol`,y=e=>typeof e==`object`&&!!e,b=e=>(y(e)||g(e))&&g(e.then)&&g(e.catch),x=Object.prototype.toString,S=e=>x.call(e),C=e=>S(e).slice(8,-1),w=e=>S(e)===`[object Object]`,ee=e=>_(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,T=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),E=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},te=/-\w/g,D=E(e=>e.replace(te,e=>e.slice(1).toUpperCase())),ne=/\B([A-Z])/g,O=E(e=>e.replace(ne,`-$1`).toLowerCase()),re=E(e=>e.charAt(0).toUpperCase()+e.slice(1)),ie=E(e=>e?`on${re(e)}`:``),k=(e,t)=>!Object.is(e,t),A=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ae=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},oe=e=>{let t=parseFloat(e);return isNaN(t)?e:t},se=e=>{let t=_(e)?Number(e):NaN;return isNaN(t)?e:t},ce,le=()=>ce||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},ue=e(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function de(e){if(d(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=_(r)?he(r):de(r);if(i)for(let e in i)t[e]=i[e]}return t}if(_(e)||y(e))return e}var fe=/;(?![^(]*\))/g,pe=/:([^]+)/,me=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function he(e){let t={};return e.replace(me,e=>e.startsWith(`/*`)?``:e).split(fe).forEach(e=>{if(e){let n=e.split(pe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ge(e){let t=``;if(_(e))t=e;else if(d(e))for(let n=0;n<e.length;n++){let r=ge(e[n]);r&&(t+=r+` `)}else if(y(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function _e(e){if(!e)return null;let{class:t,style:n}=e;return t&&!_(t)&&(e.class=ge(t)),n&&(e.style=de(n)),e}var ve=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,ye=e(ve);ve+``;function be(e){return!!e||e===``}function xe(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Te(e[i],t[i],n);return r}function Se(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Te(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Ce(e,t,n){let r=f(e),i=f(t);if(r||i||(r=p(e),i=p(t),r||i))return r&&i?Se(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Te(e[r],t[r],n))return!1}return String(e)===String(t)}function we(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Te(e,t,n){if(e===t)return!0;let r=m(e),i=m(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=v(e),i=v(t),r||i?e===t:(r=d(e),i=d(t),r||i?r&&i?we(e,t,n,xe):!1:(r=y(e),i=y(t),r||i?!r||!i?!1:we(e,t,n,Ce):String(e)===String(t))))}function Ee(e,t){return e.findIndex(e=>Te(e,t))}var De=e=>!!(e&&e.__v_isRef===!0),Oe=e=>_(e)?e:e==null?``:d(e)||y(e)&&(e.toString===x||!g(e.toString))?De(e)?Oe(e.value):JSON.stringify(e,ke,2):String(e),ke=(e,t)=>De(t)?ke(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ae(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ae(e))}:v(t)?Ae(t):y(t)&&!d(t)&&!w(t)?String(t):t,Ae=(e,t=``)=>v(e)?`Symbol(${e.description??t})`:e;function je(e){return e==null?`initial`:typeof e==`string`?e===``?` `:e:String(e)}var j,Me=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&j&&(j.active?(this.parent=j,this.index=(j.scopes||(j.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=j;try{return j=this,e(Line truncated
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
`)&&(_i(e,0)||si(),e.textContent=t.children)}if(d){if(_||b||!s||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let o in d)if(_&&(o.endsWith(`value`)||o===`indeterminate`)||a(o)&&!E(o)||o[0]===`.`||t&&!E(o)||u&&u.includes(o)){if(mi(e,o,d[o]))continue;r(e,o,null,d[o],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&qt(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Os(x,n,t),h&&ur(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&Qo(()=>{x&&Os(x,n,t),l&&g.enter(e),h&&ur(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,a,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=ws(d[t]),g=h.type===ts;e?(g&&!u&&t+1<p&&ws(d[t+1]).type===ts&&(l(i(e.data.slice(h.children.length)),r,o(e)),e.data=h.children),e=f(e,h,a,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,_i(r,1)||si()),n(null,h,r,null,a,s,ui(r),c))}return e},h=(e,t,n,r,i,a)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=s(e),f=m(o(e),t,d,n,r,i,a);return f&&di(f)&&f.data===`]`?o(t.anchor=f):(si(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,a,l)=>{if(yi(e,t)||si(),t.el=null,l){let t=_(e);for(;;){let n=o(e);if(n&&n!==t)c(n);else break}}let u=o(e),d=s(e);return c(e),n(null,t,d,u,r,i,ui(d),a),r&&(r.vnode.el=t.el,fo(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=o(e),e&&di(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return o(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var pi=new Set([`src`,`srcset`,`href`,`poster`]);function mi(e,t,n){return pi.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var hi=`data-allow-mismatch`,gi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function _i(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(hi);)e=e.parentElement;return vi(e&&e.getAttribute(hi),t)}function vi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(gi[t])}}function yi(e,t){return _i(e.parentElement,1)||bi(e)||xi(t)}function bi(e){return e.nodeType===1&&vi(e.getAttribute(hi),1)}function xi({props:e}){let t=e&&e[hi];return typeof t==`string`&&vi(t,1)}var Si=oe().requestIdleCallback||(e=>setTimeout(e,1)),Ci=oe().cancelIdleCallback||(e=>clearTimeout(e)),wi=(e=1e4)=>t=>{let n=Si(t,{timeout:e});return()=>Ci(n)};function Ti(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var Ei=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Ti(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Di=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Oi=(e=[])=>(t,n)=>{_(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function ki(e,t){if(di(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(di(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Ai=e=>!!e.type.__asyncLoader;function ji(e){g(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return Qr({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>ki(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=q;if(ei(e),u)return()=>Mi(u,e);let t=t=>{l=null,In(t,e,13,!r)};if(s&&e.suspense||Ls)return p().then(t=>()=>Mi(t,e)).catch(e=>(t(e),()=>r?K(r,{error:e}):null));let a=en(!1),c=en(),d=en(!!i),f,m;return Yi(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Ni(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Mi(u,e);if(c.value&&r)return K(r,{error:c.value});if(n& Line truncated
`))),e[zl]=Il(i);let a=r||i.props&&i.props.type===`number`;rl(e,t?`change`:`input`,t=>{t.target.composing||e[zl](Vl(e.value,n,a))}),(n||a)&&rl(e,`change`,()=>{e.value=Vl(e.value,n,a)}),t||(rl(e,`compositionstart`,Ll),rl(e,`compositionend`,Rl),rl(e,`change`,Rl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Bl];delete e[Bl],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[zl](Vl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[zl]=Il(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?re(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Ul={deep:!0,created(e,t,n){e[zl]=Il(n),rl(e,`change`,()=>{let t=e._modelValue,n=Yl(e),r=e.checked,i=e[zl];if(d(t)){let e=be(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(p(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(Xl(e,r))})},mounted:Wl,beforeUpdate(e,t,n){e[zl]=Il(n),Wl(e,t,n)}};function Wl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(d(t))i=be(t,r.props.value)>-1;else if(p(t))i=t.has(r.props.value);else{if(t===n)return;i=ye(t,Xl(e,!0))}e.checked!==i&&(e.checked=i)}var Gl={created(e,{value:t},n){e.checked=ye(t,n.props.value),e[zl]=Il(n),rl(e,`change`,()=>{e[zl](Yl(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[zl]=Il(r),t!==n&&(e.checked=ye(t,r.props.value))}},Kl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,rl(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?re(Yl(e)):Yl(e)),r=e.multiple,i=r?p(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?d(i)?t.slice():t:i];try{e[zl](i)}finally{Gn(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[zl]=Il(r)},mounted(e,{value:t}){Jl(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[zl]=Il(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!ql(t,n[1],n[0]))&&Jl(e,t)}};function ql(e,t,n){if(!n||d(e))return ye(e,t);if(p(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function Jl(e,t){let n=e.multiple,r=d(t);if(!n||r||p(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=Yl(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):be(t,o)>-1}else a.selected=t.has(o)}else if(ye(Yl(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Yl(e){return`_value`in e?e._value:e.value}function Xl(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var Zl={created(e,t,n){$l(e,t,n,null,`created`)},mounted(e,t,n){$l(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){$l(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){$l(e,t,n,r,`updated`)}};function Ql(e,t){switch(e){case`SELECT`:return Kl;case`TEXTAREA`:return Hl;default:switch(t){case`checkbox`:return Ul;case`radio`:return Gl;default:return Hl}}}function $l(e,t,n,r,i){let a=Ql(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function eu(){Hl.getSSRProps=({value:e})=>({value:e}),Gl.getSSRProps=({value:e},t)=>{if(t.props&&ye(t.props.value,e))return{checked:!0}},Ul.getSSRProps=({value:e},t)=>{if(d(e)){if(t.props&&be(e,t.props.value)>-1)return{checked:!0}}else if(p(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},Zl.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=Ql(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var tu=[`ctrl`,`shift`,`alt`,`meta`],nu={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)=>tu.some(n=>e[`${n}Key`]&&!t.includes(n))},ru=(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=nu[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},iu={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},au=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=k(n.key);if(t.some(e=>e===r||iu[e]===r))return e(n)}))},ou=s({patchProp:hl},hc),su,cu=!1;function lu(){return su||=jo(ou)}function uu(){return su=cu?su:Mo(ou),cu=!0,su}var du=((...e)=>{lu().render(...e)}),fu=((...e)=>{uu().hydrate(...e)}),pu=((...e)=>{let t=lu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=gu(e);if(!r)return;let i=t._component;!g(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,hu(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),mu=((. Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var $d;function ef(e){$d=e}var tf=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function nf(e){let t=e instanceof tf?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 rf(e,t){let n=await fetch(e,t);if($d?.(n.status===401),!n.ok)throw new tf(await Qd(n),n.status);return n}async function $(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Xd,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 rf(e,s);return a?await c.json():void 0}var af={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}),orgMembers:e=>$(`/api/orgs/${encodeURIComponent(e)}/members`),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)}`+Zd({workspace:n}),{method:`DELETE`,parse:!1}),assignOrgAgent:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:`PUT`}),summary:()=>$(`/api/summary`),tasks:()=>$(`/api/tasks`),taskPage:async e=>{let t=await rf(`/api/tasks`+Zd(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(Xd)});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`+Zd(t)),taskDebug:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/debug`+Zd(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}),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`+Zd(e)),taskLogs:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/logs`+Zd(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>$(`/api/version`),updateSnapshot:()=>$(`/api/chat/update`),updateDefer:e=>$(`/api/chat/update/defer`,{method:`POST`,body:{snapshot:e}}),updateInstall:e=>$(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>$(`/api/captures`+Zd({limit:e})),eventTypes:()=>$(`/api/event-types`),eventTypeCreate:e=>$(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:()=>$(`/api/mappings`),mappingCreate:e=>$(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>$(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>$(`/api/bindings`),dispatches:(e,t)=>$(`/api/${e}/${encodeURIComponent(t)}/dispatches`),bindingCreate:e=>$(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>$(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),bindingPause:e=>$(`/api/bindings/${encodeURIComponent(e)}/pause`,{method:`POST`}),bindingResume:e=>$(`/api/bindings/${encodeURIComponent(e)}/resume`,{method:`POST`}),harnessBindings:()=>$(`/api/harness/bindings`),sources:()=>$(`/api/sources`),sourceCreate:e=>$(`/api/sources`,{method:`POST`,body:{path:e}}),sourceSigning:(e,t)=>$(`/api/sources/${encodeURIComponent(e)}/signing`,{method:`POST`,body:{signed:t}}),sourceApproveUnsigned:e=>$(`/api/sources/${encodeULine truncated
`)&&(hi(e,0)||ai(),e.textContent=t.children)}if(d){if(_||b||!s||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let o in d)if(_&&(o.endsWith(`value`)||o===`indeterminate`)||a(o)&&!T(o)||o[0]===`.`||t&&!T(o)||u&&u.includes(o)){if(fi(e,o,d[o]))continue;r(e,o,null,d[o],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&Qt(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Q(x,n,t),h&&ur(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&Yo(()=>{x&&Q(x,n,t),l&&g.enter(e),h&&ur(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,a,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=Z(d[t]),g=h.type===Qo;e?(g&&!u&&t+1<p&&Z(d[t+1]).type===Qo&&(l(i(e.data.slice(h.children.length)),r,o(e)),e.data=h.children),e=f(e,h,a,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,hi(r,1)||ai()),n(null,h,r,null,a,s,ci(r),c))}return e},h=(e,t,n,r,i,a)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=s(e),f=m(o(e),t,d,n,r,i,a);return f&&li(f)&&f.data===`]`?o(t.anchor=f):(ai(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,a,l)=>{if(_i(e,t)||ai(),t.el=null,l){let t=_(e);for(;;){let n=o(e);if(n&&n!==t)c(n);else break}}let u=o(e),d=s(e);return c(e),n(null,t,d,u,r,i,ci(d),a),r&&(r.vnode.el=t.el,co(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=o(e),e&&li(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return o(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var di=new Set([`src`,`srcset`,`href`,`poster`]);function fi(e,t,n){return di.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var pi=`data-allow-mismatch`,mi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function hi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(pi);)e=e.parentElement;return gi(e&&e.getAttribute(pi),t)}function gi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(mi[t])}}function _i(e,t){return hi(e.parentElement,1)||vi(e)||yi(t)}function vi(e){return e.nodeType===1&&gi(e.getAttribute(pi),1)}function yi({props:e}){let t=e&&e[pi];return typeof t==`string`&&gi(t,1)}var bi=le().requestIdleCallback||(e=>setTimeout(e,1)),xi=le().cancelIdleCallback||(e=>clearTimeout(e)),Si=(e=1e4)=>t=>{let n=bi(t,{timeout:e});return()=>xi(n)};function Ci(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var wi=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Ci(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Ti=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Ei=(e=[])=>(t,n)=>{_(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Di(e,t){if(li(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(li(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Oi=e=>!!e.type.__asyncLoader;function ki(e){g(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return Xr({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Di(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=$;if(Qr(e),u)return()=>Ai(u,e);let t=t=>{l=null,Ln(t,e,13,!r)};if(s&&e.suspense||Ms)return p().then(t=>()=>Ai(t,e)).catch(e=>(t(e),()=>r?X(r,{error:e}):null));let a=nn(!1),c=nn(),d=nn(!!i),f,m;return qi(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&ji(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Ai(u,e);if(c.value&&r)return X(r,{error:c.value});if(n&&!d. Line truncated
+1 -1
View File
@@ -1 +1 @@
import{Ct as e,Et as t,Tr as n,Wn as r,Z as i,_n as a,_t as o,an as s,dn as c,gt as l,hr as u,i as d,jr as f,mt as p,pt as m,rt as h,t as g,wt as _}from"./PageHeader.js";import{l as v,n as y,t as b,v as x}from"./HistoryLink.js";import{y as S}from"./index.js";var C={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},w={key:1,class:`text-sm text-fg-muted`},T={class:`mb-3 flex items-center justify-between`},E=[`for`],D=`eda-playbooks`,O=t({__name:`PlaybooksPage`,setup(t){let O=v();s(O.load);let k=m(()=>O.drafts[D]?.value),A=u(``);function j(){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=``)}return(t,s)=>(c(),o(`div`,null,[_(g,{title:`Playbooks`},{default:r(()=>[_(b,{kinds:[D]},null,8,[`kinds`])]),_:1}),_(y,{kind:D,class:`mb-4`}),n(O).catalogError||n(O).stateFor(D).error?(c(),o(`p`,C,f(n(O).catalogError||n(O).stateFor(D).error),1)):l(``,!0),p(`form`,{class:`mb-4 flex gap-2`,onSubmit:i(j,[`prevent`])},[_(n(x),{modelValue:A.value,"onUpdate:modelValue":s[0]||=e=>A.value=e,"aria-label":`Playbook ID`,placeholder:`Playbook ID`,class:`max-w-xs`},null,8,[`modelValue`]),_(n(d),{type:`submit`,disabled:!A.value.trim()||k.value?.playbooks.some(e=>e.id===A.value.trim())},{default:r(()=>[...s[1]||=[e(`Add playbook`,-1)]]),_:1},8,[`disabled`])],32),k.value?.playbooks.length?l(``,!0):(c(),o(`p`,w,`No playbooks installed.`)),(c(!0),o(h,null,a(k.value?.playbooks,(t,i)=>(c(),o(`section`,{key:i,class:`mb-6 border-t pt-4`},[p(`div`,T,[p(`label`,{for:`playbook-${i}`,class:`font-mono text-sm`},f(t.id),9,E),_(n(d),{variant:`ghost`,size:`sm`,onClick:e=>k.value.playbooks.splice(i,1)},{default:r(()=>[...s[2]||=[e(`Remove playbook`,-1)]]),_:1},8,[`onClick`])]),_(n(S),{id:`playbook-${i}`,modelValue:t.yaml,"onUpdate:modelValue":e=>t.yaml=e,"aria-label":`${t.id} YAML`,class:`min-h-64 font-mono`,spellcheck:`false`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`aria-label`])]))),128))]))}});export{O as default};
import{A as e,D as t,Jt as n,O as r,_ as i,b as a,ht as o,kn as s,lt as c,nr as l,s as u,t as d,v as f,x as p,xt as m,yn as h}from"./PageHeader.js";import{X as g,r as _}from"./badge.js";import{l as v,n as y,t as b,v as x}from"./HistoryLink.js";import{y as S}from"./index.js";var C={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},w={key:1,class:`text-sm text-fg-muted`},T={class:`mb-3 flex items-center justify-between`},E=[`for`],D=`eda-playbooks`,O=e({__name:`PlaybooksPage`,setup(e){let O=v();c(O.load);let k=i(()=>O.drafts[D]?.value),A=h(``);function j(){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=``)}return(e,i)=>(o(),p(`div`,null,[r(d,{title:`Playbooks`},{default:n(()=>[r(b,{kinds:[D]},null,8,[`kinds`])]),_:1}),r(y,{kind:D,class:`mb-4`}),s(O).catalogError||s(O).stateFor(D).error?(o(),p(`p`,C,l(s(O).catalogError||s(O).stateFor(D).error),1)):a(``,!0),f(`form`,{class:`mb-4 flex gap-2`,onSubmit:g(j,[`prevent`])},[r(s(x),{modelValue:A.value,"onUpdate:modelValue":i[0]||=e=>A.value=e,"aria-label":`Playbook ID`,placeholder:`Playbook ID`,class:`max-w-xs`},null,8,[`modelValue`]),r(s(_),{type:`submit`,disabled:!A.value.trim()||k.value?.playbooks.some(e=>e.id===A.value.trim())},{default:n(()=>[...i[1]||=[t(`Add playbook`,-1)]]),_:1},8,[`disabled`])],32),k.value?.playbooks.length?a(``,!0):(o(),p(`p`,w,`No playbooks installed.`)),(o(!0),p(u,null,m(k.value?.playbooks,(e,a)=>(o(),p(`section`,{key:a,class:`mb-6 border-t pt-4`},[f(`div`,T,[f(`label`,{for:`playbook-${a}`,class:`font-mono text-sm`},l(e.id),9,E),r(s(_),{variant:`ghost`,size:`sm`,onClick:e=>k.value.playbooks.splice(a,1)},{default:n(()=>[...i[2]||=[t(`Remove playbook`,-1)]]),_:1},8,[`onClick`])]),r(s(S),{id:`playbook-${a}`,modelValue:e.yaml,"onUpdate:modelValue":t=>e.yaml=t,"aria-label":`${e.id} YAML`,class:`min-h-64 font-mono`,spellcheck:`false`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`aria-label`])]))),128))]))}});export{O as default};
+3
View File
@@ -0,0 +1,3 @@
import{$n as e,A as t,An as n,Bn as r,Bt as i,Dn as a,En as o,Et as s,Fn as c,Gn as l,Hn as u,In as d,Jn as f,Jt as p,Kn as m,Ln as h,Mn as g,Nn as ee,O as _,Pn as v,Qn as y,R as b,Rn as te,S as ne,Sn as x,St as S,U as re,Un as ie,Ut as C,V as ae,Vn as oe,Wn as w,Xn as T,Y as E,Yn as D,Zn as se,_ as O,_n as ce,dn as le,g as ue,ht as de,i as k,ir as A,jn as fe,kn as j,kt as M,l as pe,lt as me,m as he,mn as ge,mt as _e,n as ve,nt as ye,on as be,ot as xe,pt as Se,qn as N,r as Ce,s as we,tt as Te,w as Ee,wn as De,xn as Oe,y as ke,yt as Ae,z as je,zn as P}from"./PageHeader.js";var Me=void 0,Ne=typeof window<`u`&&window.trustedTypes;if(Ne)try{Me=Ne.createPolicy(`vue`,{createHTML:e=>e})}catch{}var Pe=Me?e=>Me.createHTML(e):e=>e,Fe=`http://www.w3.org/2000/svg`,Ie=`http://www.w3.org/1998/Math/MathML`,F=typeof document<`u`?document:null,Le=F&&F.createElement(`template`),Re={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?F.createElementNS(Fe,e):t===`mathml`?F.createElementNS(Ie,e):n?F.createElement(e,{is:n}):F.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>F.createTextNode(e),createComment:e=>F.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>F.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{Le.innerHTML=Pe(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Le.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},I=`transition`,ze=`animation`,Be=Symbol(`_vtc`),Ve={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},He=v({},Ce,Ve),Ue=(e=>(e.displayName=`Transition`,e.props=He,e))((e,{slots:t})=>ae(ve,Ge(e),t)),L=(e,t=[])=>{P(e)?e.forEach(e=>e(...t)):e&&e(...t)},We=e=>e?P(e)?e.some(e=>e.length>1):e.length>1:!1;function Ge(e){let t={};for(let n in e)n in Ve||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=Ke(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:ee,onEnter:_,onEnterCancelled:y,onLeave:b,onLeaveCancelled:te,onBeforeAppear:ne=ee,onAppear:x=_,onAppearCancelled:S=y}=t,re=(e,t,n,r)=>{e._enterCancelled=r,z(e,t?u:s),z(e,t?l:o),n&&n()},ie=(e,t)=>{e._isLeaving=!1,z(e,d),z(e,p),z(e,f),t&&t()},C=e=>(t,n)=>{let i=e?x:_,o=()=>re(t,e,n);L(i,[t,o]),Je(()=>{z(t,e?c:a),R(t,e?u:s),We(i)||Xe(t,r,h,o)})};return v(t,{onBeforeEnter(e){L(ee,[e]),R(e,a),R(e,o)},onBeforeAppear(e){L(ne,[e]),R(e,c),R(e,l)},onEnter:C(!1),onAppear:C(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>ie(e,t);R(e,d),e._enterCancelled?(R(e,f),et(e)):(et(e),R(e,f)),Je(()=>{e._isLeaving&&(z(e,d),R(e,p),We(b)||Xe(e,r,g,n))}),L(b,[e,n])},onEnterCancelled(e){re(e,!1,void 0,!0),L(y,[e])},onAppearCancelled(e){re(e,!0,void 0,!0),L(S,[e])},onLeaveCancelled(e){ie(e),L(te,[e])}})}function Ke(e){if(e==null)return null;if(u(e))return[qe(e.enter),qe(e.leave)];{let t=qe(e);return[t,t]}}function qe(e){return A(e)}function R(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Be]||(e[Be]=new Set)).add(t)}function z(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[Be];n&&(n.delete(t),n.size||(e[Be]=void 0))}function Je(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Ye=0;function Xe(e,t,n,r){let i=e._endId=++Ye,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Ze(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 Ze(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${I}Delay`),a=r(`${I}Duration`),o=Qe(i,a),s=r(`${ze}Delay`),c=r(`${ze}Duration`),l=Qe(s,c),u=null,d=0,f=0;t===I?o>0&&(u=I,d=o,f=a.length):t===ze?l>0&&(u=ze,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?I:ze:null,f=u?u===I?a.length:c.length:0);let p=u===I&&/\b(?:transform|all)(?:,|$)/.test(r(`${I}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Qe(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>$e(t)+$e(e[n])))}function $e(e)Line truncated
`))),e[H]=V(i);let a=r||i.props&&i.props.type===`number`;B(e,t?`change`:`input`,t=>{t.target.composing||e[H](rn(e.value,n,a))}),(n||a)&&B(e,`change`,()=>{e.value=rn(e.value,n,a)}),t||(B(e,`compositionstart`,en),B(e,`compositionend`,tn),B(e,`change`,tn))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[nn];delete e[nn],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[H](rn(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[H]=V(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?se(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},on={deep:!0,created(e,t,n){e[H]=V(n),B(e,`change`,()=>{let t=e._modelValue,n=fn(e),r=e.checked,i=e[H];if(P(t)){let e=T(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(l(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(pn(e,r))})},mounted:sn,beforeUpdate(e,t,n){e[H]=V(n),sn(e,t,n)}};function sn(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(P(t))i=T(t,r.props.value)>-1;else if(l(t))i=t.has(r.props.value);else{if(t===n)return;i=D(t,pn(e,!0))}e.checked!==i&&(e.checked=i)}var cn={created(e,{value:t},n){e.checked=D(t,n.props.value),e[H]=V(n),B(e,`change`,()=>{e[H](fn(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[H]=V(r),t!==n&&(e.checked=D(t,r.props.value))}},ln={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,B(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?se(fn(e)):fn(e)),r=e.multiple,i=r?l(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?P(i)?t.slice():t:i];try{e[H](i)}finally{ye(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[H]=V(r)},mounted(e,{value:t}){dn(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[H]=V(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!un(t,n[1],n[0]))&&dn(e,t)}};function un(e,t,n){if(!n||P(e))return D(e,t);if(l(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function dn(e,t){let n=e.multiple,r=P(t);if(!n||r||l(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=fn(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):T(t,o)>-1}else a.selected=t.has(o)}else if(D(fn(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function fn(e){return`_value`in e?e._value:e.value}function pn(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var mn={created(e,t,n){gn(e,t,n,null,`created`)},mounted(e,t,n){gn(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){gn(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){gn(e,t,n,r,`updated`)}};function hn(e,t){switch(e){case`SELECT`:return ln;case`TEXTAREA`:return an;default:switch(t){case`checkbox`:return on;case`radio`:return cn;default:return an}}}function gn(e,t,n,r,i){let a=hn(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function _n(){an.getSSRProps=({value:e})=>({value:e}),cn.getSSRProps=({value:e},t)=>{if(t.props&&D(t.props.value,e))return{checked:!0}},on.getSSRProps=({value:e},t)=>{if(P(e)){if(t.props&&T(e,t.props.value)>-1)return{checked:!0}}else if(l(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},mn.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=hn(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var vn=[`ctrl`,`shift`,`alt`,`meta`],yn={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)=>vn.some(n=>e[`${n}Key`]&&!t.includes(n))},bn=(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=yn[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},xn={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Sn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=d(n.key);if(t.some(e=>e===r||xn[e]===r))return e(n)}))},Cn=v({patchProp:Nt},Re),wn,Tn=!1;function En(){return wn||=Ee(Cn)}function Dn(){return wn=Tn?wn:ne(Cn),Tn=!0,wn}var On=((...e)=>{En().render(...e)}),kn=((...e)=>{Dn().hydrate(...e)}),An=((...e)=>{let t=En().createApp(...e),{mount:n}=t;return t.mount=e=>{let i=Nn(e);if(!i)return;let a=t._component;!r(a)&&!a.render&&!a.template&&(a.template=i.innerHTML),i.nodeType===1&&(i.textContent=``);let o=n(i,!1,Mn(i));return i instanceof Element&&(i.removeAttribute(`v-cloak`),i.setAttribute(`data-v-app`,``)),o},t}),jn=((...e)=>{let t=Dn().createApp(...e),{moun Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var ui;function di(e){ui=e}var fi=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function pi(e){let t=e instanceof fi?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 mi(e,t){let n=await fetch(e,t);if(ui?.(n.status===401),!n.ok)throw new fi(await li(n),n.status);return n}async function $(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=ci,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 mi(e,s);return a?await c.json():void 0}var hi={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}),orgMembers:e=>$(`/api/orgs/${encodeURIComponent(e)}/members`),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`}),summary:()=>$(`/api/summary`),tasks:()=>$(`/api/tasks`),taskPage:async e=>{let t=await mi(`/api/tasks`+Q(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(ci)});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}),workRequest:e=>$(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>$(`/api/skills`),channels:()=>$(`/api/channels`),curators:()=>$(`/api/curators`),channelReload:e=>$(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>$(`/api/config`),logs:e=>$(`/api/logs`+Q(e)),taskLogs:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/logs`+Q(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>$(`/api/version`),updateSnapshot:()=>$(`/api/chat/update`),updateDefer:e=>$(`/api/chat/update/defer`,{method:`POST`,body:{snapshot:e}}),updateInstall:e=>$(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>$(`/api/captures`+Q({limit:e})),eventTypes:()=>$(`/api/event-types`),eventTypeCreate:e=>$(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:()=>$(`/api/mappings`),mappingCreate:e=>$(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>$(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>$(`/api/bindings`),dispatches:(e,t)=>$(`/api/${e}/${encodeURIComponent(t)}/dispatches`),bindingCreate:e=>$(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>$(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),bindingPause:e=>$(`/api/bindings/${encodeURIComponent(e)}/pause`,{method:`POST`}),bindingResume:e=>$(`/api/bindings/${encodeURIComponent(e)}/resume`,{method:`POST`}),harnessBindings:()=>$(`/api/harness/bindings`),sources:()=>$(`/api/sources`),sourceCreate:e=>$(`/api/sources`,{method:`POST`,body:{path:e}}),sourceSigning:(e,t)=>$(`/api/sources/${encodeURIComponent(e)}/signing`,{method:`POST`,body:{signed:t}}),sourceApproveUnsigned:e=>$(`/api/sources/${encodeURICompoLine truncated
+14 -14
View File
@@ -1,20 +1,20 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AgentProfilesPage.js","assets/PageHeader.js","assets/HistoryLink.js","assets/CredentialBindingsPage.js","assets/PlaybooksPage.js","assets/HarnessPage.js","assets/HarnessPage.css"])))=>i.map(i=>d[i]);
import{$ as e,$n as t,$t as n,A as r,An as i,Ar as a,At as o,B as s,Bn as c,Bt as l,Cn as u,Cr as d,Ct as f,D as p,Dn as m,Dr as h,Dt as g,En as _,Er as v,Et as y,F as b,Fn as x,Ft as S,G as C,Gn as w,Gt as T,H as ee,Hn as te,Ht as ne,I as E,In as re,It as D,J as ie,Jn as ae,Jt as oe,K as se,Kn as ce,Kt as le,L as ue,Ln as de,Lt as fe,M as pe,Mn as me,Mr as he,Mt as ge,N as _e,Nn as ve,Nt as ye,O as be,On as xe,Or as O,Ot as Se,P as Ce,Pn as we,Pt as Te,Q as Ee,Qn as De,Qt as Oe,R as ke,Rn as Ae,Rt as je,S as Me,Sn as Ne,Sr as Pe,St as Fe,T as Ie,Tn as Le,Tr as k,Tt as Re,U as ze,Un as Be,Ut as Ve,V as He,Vn as Ue,Vt as We,W as Ge,Wn as A,Wt as Ke,X as qe,Xn as Je,Xt as Ye,Y as Xe,Yn as Ze,Yt as Qe,Z as $e,Zn as et,Zt as j,_ as tt,_n as M,_r as nt,_t as N,a as rt,an as P,ar as it,at,b as ot,bn as st,br as ct,bt as lt,cn as ut,cr as dt,ct as ft,dn as F,dr as pt,dt as mt,en as ht,er as gt,et as _t,f as vt,fn as yt,fr as bt,ft as xt,gn as St,gr as Ct,gt as I,h as wt,hn as Tt,hr as L,ht as R,i as z,in as Et,ir as Dt,it as Ot,j as kt,jn as At,jr as B,jt,k as Mt,kn as Nt,kr as Pt,kt as Ft,ln as It,lr as Lt,lt as Rt,mn as zt,mr as Bt,mt as V,n as Vt,nn as Ht,nr as Ut,nt as Wt,on as Gt,or as Kt,ot as qt,pn as Jt,pr as Yt,pt as H,q as Xt,qn as Zt,qt as Qt,r as $t,rn as en,rr as tn,rt as U,sn as nn,sr as rn,st as an,t as on,tn as sn,tr as cn,tt as ln,un,ur as dn,ut as fn,v as pn,vn as W,vr as mn,vt as hn,wn as gn,wr as _n,wt as G,x as K,xn as vn,xr as yn,xt as bn,y as xn,yn as Sn,yr as Cn,yt as wn,z as Tn,zn as q,zt as En}from"./PageHeader.js";import{C as Dn,S as On,T as kn,_ as An,a as jn,b as Mn,c as Nn,d as Pn,f as Fn,g as In,h as Ln,i as Rn,l as zn,m as Bn,n as Vn,o as Hn,p as Un,r as Wn,s as Gn,t as Kn,u as qn,v as J,w as Jn,x as Yn,y as Xn}from"./HistoryLink.js";var Zn=Object.defineProperty,Qn=(e,t)=>{let n={};for(var r in e)Zn(n,r,{get:e[r],enumerable:!0});return t||Zn(n,Symbol.toStringTag,{value:`Module`}),n};(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 $n=Qn({BaseTransition:()=>Ee,BaseTransitionPropsValidators:()=>e,Comment:()=>_t,DeprecationTypes:()=>null,EffectScope:()=>Ze,ErrorCodes:()=>ln,ErrorTypeStrings:()=>Wt,Fragment:()=>U,KeepAlive:()=>Ot,ReactiveEffect:()=>Je,Static:()=>at,Suspense:()=>qt,Teleport:()=>an,Text:()=>ft,TrackOpTypes:()=>et,Transition:()=>be,TransitionGroup:()=>Mt,TriggerOpTypes:()=>De,VueElement:()=>r,assertNumber:()=>Rt,callWithAsyncErrorHandling:()=>fn,callWithErrorHandling:()=>mt,camelize:()=>v,capitalize:()=>h,cloneVNode:()=>xt,compatUtils:()=>null,compile:()=>er,computed:()=>H,createApp:()=>kt,createBlock:()=>R,createCommentVNode:()=>I,createElementBlock:()=>N,createElementVNode:()=>V,createHydrationRenderer:()=>hn,createPropsRestProxy:()=>wn,createRenderer:()=>lt,createSSRApp:()=>pe,createSlots:()=>bn,createStaticVNode:()=>Fe,createTextVNode:()=>f,createVNode:()=>G,customRef:()=>t,defineAsyncComponent:()=>Re,defineComponent:()=>y,defineCustomElement:()=>_e,defineEmits:()=>g,defineExpose:()=>Se,defineModel:()=>Ft,defineOptions:()=>o,defineProps:()=>jt,defineSSRCustomElement:()=>Ce,defineSlots:()=>ge,devtools:()=>ye,effect:()=>gt,effectScope:()=>cn,getCurrentInstance:()=>Te,getCurrentScope:()=>Ut,getCurrentWatcher:()=>tn,getTransitionRawChildren:()=>S,guardReactiveProps:()=>D,h:()=>fe,handleError:()=>je,hasInjectionContext:()=>En,hydrate:()=>b,hydrateOnIdle:()=>l,hydrateOnInteraction:()=>We,hydrateOnMediaQuery:()=>ne,hydrateOnVisible:()=>Ve,initCustomFormatter:()=>Ke,initDirectivesForSSR:()=>E,inject:()=>T,isMemoSame:()=>le,isProxy:()=>Dt,isReactive:()=>it,isReadonly:()=>Kt,isRef:()=>rn,isRuntimeOnly:()=>Qt,isShallow:()=>dt,isVNode:()=>oe,markRaw:()=>Lt,mergeDefaults:()=>Qe,mergeModels:()=>Ye,mergeProps:()=>j,nextTick:()=>Oe,nodeOps:()=>ue,normalizeClass:()=>O,normalizeProps:()=>Pt,normalizeStyle:()=>a,onActivated:()=>n,onBeforeMount:()=>ht,onBeforeUnmount:()=>sn,onBeforeUpdate:()=>Ht,onDeactivated:()=>en,onErrorCaptured:()=>Et,onMounted:()=>P,onRenderTracked:()=>Gt,onRenderTriggered:()=>nn,onScopeDispose:()=>dn,onServerPrefetch:()=>ut,onUnmounted:()=>It,onUpdated:()=>un,onWatcherCleanup:()=>pt,openBlock:()=>F,patchProp:()=>ke,popScopeId:()=>yt,provide:()=>Jt,proxyRefs:()=>bt,pushScopeId:()=>zt,queuePostFlushCb:()=>Tt,reactive:()=>Yt,readonly:()=>Bt,ref:()=>L,registerRuntimeCompiler:()=>St,render:()=>Tn,renderList:()=>M,renderSlot:()=>W,resolveComponent:()=>Sn,resLine truncated
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AgentProfilesPage.js","assets/PageHeader.js","assets/badge.js","assets/HistoryLink.js","assets/CredentialBindingsPage.js","assets/PlaybooksPage.js","assets/HarnessPage.js","assets/HarnessPage.css","assets/NotFoundPage.js"])))=>i.map(i=>d[i]);
import{$ as e,$t as t,A as n,At as r,B as i,Bt as a,C as o,Cn as s,Ct as c,D as l,Dn as u,Dt as d,E as f,En as p,Et as m,F as h,Ft as g,G as _,Gt as v,H as y,Ht as b,I as x,It as S,J as ee,Jt as C,K as w,Kt as T,L as te,Lt as E,M as D,Mn as ne,Mt as re,N as ie,Nn as ae,Nt as oe,O,On as se,Ot as ce,P as le,Pt as ue,Q as de,Qn as k,Qt as fe,R as pe,Rt as me,S as he,Sn as ge,St as A,T as _e,Tn as ve,Tt as ye,U as be,Ut as j,V as xe,Vt as Se,W as Ce,Wt as we,X as Te,Xt as Ee,Y as De,Yt as Oe,Z as ke,Zt as Ae,_ as M,_n as je,_t as Me,a as Ne,an as Pe,at as Fe,b as N,bn as Ie,bt as Le,c as Re,cn as ze,ct as Be,d as Ve,dn as He,dt as Ue,en as We,er as Ge,et as Ke,f as qe,fn as Je,ft as Ye,g as Xe,gn as Ze,gt as Qe,h as $e,hn as et,ht as P,i as tt,in as nt,it as rt,j as it,jt as at,k as ot,kn as F,kt as st,l as ct,ln as lt,lt as I,m as ut,mn as dt,mt as ft,n as pt,nn as mt,nr as L,nt as ht,o as gt,on as _t,ot as vt,p as yt,pn as bt,pt as xt,q as St,qt as Ct,r as wt,rn as Tt,rr as Et,rt as Dt,s as R,sn as Ot,st as kt,t as At,tn as jt,tr as Mt,tt as z,u as Nt,un as Pt,ut as Ft,v as B,vn as It,vt as Lt,w as Rt,wn as zt,wt as Bt,x as V,xn as Vt,xt as H,y as U,yn as W,yt as Ht,z as Ut,zt as Wt}from"./PageHeader.js";import{A as Gt,B as Kt,D as qt,E as G,F as Jt,G as Yt,H as Xt,I as Zt,J as Qt,K as $t,L as en,M as tn,N as nn,O as rn,P as an,R as on,U as sn,V as cn,W as ln,X as un,Y as dn,_ as fn,b as K,d as pn,g as mn,i as hn,j as gn,k as _n,m as vn,n as yn,q as bn,r as q,t as xn,v as Sn,w as Cn,x as wn,y as Tn,z as En}from"./badge.js";import{C as Dn,S as On,T as kn,_ as An,a as jn,b as Mn,c as Nn,d as Pn,f as Fn,g as In,h as Ln,i as Rn,l as zn,m as Bn,n as Vn,o as Hn,p as Un,r as Wn,s as Gn,t as Kn,u as qn,v as J,w as Jn,x as Yn,y as Xn}from"./HistoryLink.js";var Zn=Object.defineProperty,Qn=(e,t)=>{let n={};for(var r in e)Zn(n,r,{get:e[r],enumerable:!0});return t||Zn(n,Symbol.toStringTag,{value:`Module`}),n};(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 $n=Qn({BaseTransition:()=>pt,BaseTransitionPropsValidators:()=>wt,Comment:()=>tt,DeprecationTypes:()=>null,EffectScope:()=>t,ErrorCodes:()=>Ne,ErrorTypeStrings:()=>gt,Fragment:()=>R,KeepAlive:()=>Re,ReactiveEffect:()=>We,Static:()=>ct,Suspense:()=>Nt,Teleport:()=>Ve,Text:()=>qe,TrackOpTypes:()=>jt,Transition:()=>qt,TransitionGroup:()=>rn,TriggerOpTypes:()=>mt,VueElement:()=>_n,assertNumber:()=>yt,callWithAsyncErrorHandling:()=>ut,callWithErrorHandling:()=>$e,camelize:()=>ne,capitalize:()=>ae,cloneVNode:()=>Xe,compatUtils:()=>null,compile:()=>er,computed:()=>M,createApp:()=>Gt,createBlock:()=>U,createCommentVNode:()=>N,createElementBlock:()=>V,createElementVNode:()=>B,createHydrationRenderer:()=>he,createPropsRestProxy:()=>o,createRenderer:()=>Rt,createSSRApp:()=>gn,createSlots:()=>_e,createStaticVNode:()=>f,createTextVNode:()=>l,createVNode:()=>O,customRef:()=>Tt,defineAsyncComponent:()=>ot,defineComponent:()=>n,defineCustomElement:()=>tn,defineEmits:()=>it,defineExpose:()=>D,defineModel:()=>ie,defineOptions:()=>le,defineProps:()=>h,defineSSRCustomElement:()=>nn,defineSlots:()=>x,devtools:()=>te,effect:()=>nt,effectScope:()=>Pe,getCurrentInstance:()=>pe,getCurrentScope:()=>_t,getCurrentWatcher:()=>Ot,getTransitionRawChildren:()=>Ut,guardReactiveProps:()=>i,h:()=>xe,handleError:()=>y,hasInjectionContext:()=>be,hydrate:()=>an,hydrateOnIdle:()=>Ce,hydrateOnInteraction:()=>_,hydrateOnMediaQuery:()=>w,hydrateOnVisible:()=>St,initCustomFormatter:()=>ee,initDirectivesForSSR:()=>Jt,inject:()=>De,isMemoSame:()=>Te,isProxy:()=>ze,isReactive:()=>lt,isReadonly:()=>Pt,isRef:()=>He,isRuntimeOnly:()=>ke,isShallow:()=>Je,isVNode:()=>de,markRaw:()=>bt,mergeDefaults:()=>e,mergeModels:()=>Ke,mergeProps:()=>z,nextTick:()=>ht,nodeOps:()=>Zt,normalizeClass:()=>k,normalizeProps:()=>Ge,normalizeStyle:()=>Mt,onActivated:()=>Dt,onBeforeMount:()=>rt,onBeforeUnmount:()=>Fe,onBeforeUpdate:()=>vt,onDeactivated:()=>kt,onErrorCaptured:()=>Be,onMounted:()=>I,onRenderTracked:()=>Ft,onRenderTriggered:()=>Ue,onScopeDispose:()=>dt,onServerPrefetch:()=>Ye,onUnmounted:()=>xt,onUpdated:()=>ft,onWatcherCleanup:()=>et,openBlock:()=>P,patchProp:()=>en,popScopeId:()=>Qe,provide:()=>Me,proxyRefs:()=>Ze,pushScopeId:()=>Lt,queuePostFlushCb:()=>Ht,reactive:()=>je,readonly:()=>It,ref:()=>W,registerRuntimeCompiler:()=>Le,render:()=>on,renderList:()=>H,renderSlot:()=>A,resolveComponent:()=>c,resolveDirectLine 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&&(Ci.value=n.session_id),n.type===`delta`&&(o+=n.text,Oi.value=Oi.value?{...Oi.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],Oi.value=Oi.value?{...Oi.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),Oi.value=Oi.value?{...Oi.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`);wi.value=[...wi.value,{from:`assistant`,text:o,tool_calls:a}],Oi.value=null,Ei.value=`Ready`,await Ui()}catch(e){let t=e;t.name===`AbortError`&&!c?(Oi.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},Ei.value=`Stopped`):(Oi.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?gi(r):void 0,isRetry:i},Ei.value=`Error — retry available`)}finally{clearTimeout(l),bi=null,Vi=null,Di.value=!1}}function na(){Ei.value=`Stopping…`,Ci.value&&K.chatCancel(Ci.value).catch(()=>{}),Hi()}function ra(){P(()=>{Ui().catch(e=>{Ei.value=e.message||`Chat unavailable`})}),It(()=>{Hi()})}async function ia(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 ta({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var aa=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],oa=y({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return p(`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(),N(`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":k(vi),onClick:i[0]||=e=>n(`toggle`)},[V(`span`,{"aria-hidden":`true`,class:O(r(!e.open))},[G(k(Ar),{size:22})],2),V(`span`,{"aria-hidden":`true`,class:O(r(e.open))},[G(k(oi),{size:22})],2)],8,aa))}});function sa(e){return typeof e==`string`?`'${e}'`:new da().serialize(e)}var ca=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,la=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[ca.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function ua(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&la[n]?la[n]:n+128,s=a<128&&la[a]?la[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var da=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?ua(e,t):n===`number`&&r===`number`?e-t:ua(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(ua),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$ArrLine truncated
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(Ci.value=n.session_id),n.type===`delta`&&(o+=n.text,Oi.value=Oi.value?{...Oi.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],Oi.value=Oi.value?{...Oi.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),Oi.value=Oi.value?{...Oi.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`);wi.value=[...wi.value,{from:`assistant`,text:o,tool_calls:a}],Oi.value=null,Ei.value=`Ready`,await Ui()}catch(e){let t=e;t.name===`AbortError`&&!c?(Oi.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},Ei.value=`Stopped`):(Oi.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?gi(r):void 0,isRetry:i},Ei.value=`Error — retry available`)}finally{clearTimeout(l),bi=null,Vi=null,Di.value=!1}}function na(){Ei.value=`Stopping…`,Ci.value&&K.chatCancel(Ci.value).catch(()=>{}),Hi()}function ra(){I(()=>{Ui().catch(e=>{Ei.value=e.message||`Chat unavailable`})}),xt(()=>{Hi()})}async function ia(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 ta({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var aa=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],oa=n({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return G(`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)=>(P(),V(`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":F(vi),onClick:i[0]||=e=>n(`toggle`)},[B(`span`,{"aria-hidden":`true`,class:k(r(!e.open))},[O(F(Ar),{size:22})],2),B(`span`,{"aria-hidden":`true`,class:k(r(e.open))},[O(F(oi),{size:22})],2)],8,aa))}});function sa(e){return typeof e==`string`?`'${e}'`:new da().serialize(e)}var ca=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,la=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[ca.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function ua(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&la[n]?la[n]:n+128,s=a<128&&la[a]?la[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var da=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?ua(e,t):n===`number`&&r===`number`?e-t:ua(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(ua),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$ArrLine truncated
`)].join(`
`))}return()=>i.value||r.value||o.value?fe(t.default({present:o.value})[0],{ref:e=>{let t=Ua(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}});function cs(){let e=L();return{primitiveElement:e,currentElement:H(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:Ua(e))}}var[ls,us]=ga(`CollapsibleRoot`),ds=y({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=io(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:a,unmountOnHide:o}=Pe(r);return us({contentId:``,disabled:a,open:i,unmountOnHide:o,onOpenToggle:()=>{a.value||(i.value=!i.value)}}),t({open:i}),Y(),(e,t)=>(F(),R(k(tt),{as:e.as,"as-child":r.asChild,"data-state":k(i)?`open`:`closed`,"data-disabled":k(a)?``:void 0},{default:A(()=>[W(e.$slots,`default`,{open:k(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),fs=y({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`contentFound`],setup(e,{emit:t}){let n=e,r=t,i=ls();i.contentId||=Zo(void 0,`reka-collapsible-content`);let a=L(),{forwardRef:o,currentElement:s}=Y(),c=L(0),l=L(0),u=H(()=>i.open.value),d=L(u.value),f=L();q(()=>[u.value,a.value?.present],async()=>{await Oe();let e=s.value;if(!e)return;f.value=f.value||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();l.value=t.height,c.value=t.width,d.value||(e.style.transitionDuration=f.value.transitionDuration,e.style.animationName=f.value.animationName)},{immediate:!0});let p=H(()=>d.value&&i.open.value);return P(()=>{requestAnimationFrame(()=>{d.value=!1})}),Wa(s,`beforematch`,e=>{requestAnimationFrame(()=>{i.onOpenToggle(),r(`contentFound`)})}),(e,t)=>(F(),R(k(ss),{ref_key:`presentRef`,ref:a,present:e.forceMount||k(i).open.value,"force-mount":!0},{default:A(({present:t})=>[G(k(tt),j(e.$attrs,{id:k(i).contentId,ref:k(o),"as-child":n.asChild,as:e.as,hidden:t?void 0:k(i).unmountOnHide.value?``:`until-found`,"data-state":p.value?void 0:k(i).open.value?`open`:`closed`,"data-disabled":k(i).disabled?.value?``:void 0,style:{"--reka-collapsible-content-height":`${l.value}px`,"--reka-collapsible-content-width":`${c.value}px`}}),{default:A(()=>[!k(i).unmountOnHide.value||t?W(e.$slots,`default`,{key:0}):I(`v-if`,!0)]),_:2},1040,[`id`,`as-child`,`as`,`hidden`,`data-state`,`data-disabled`,`style`])]),_:3},8,[`present`]))}}),ps=y({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;Y();let n=ls();return(e,r)=>(F(),R(k(tt),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":k(n).contentId,"aria-expanded":k(n).open.value,"data-state":k(n).open.value?`open`:`closed`,"data-disabled":k(n).disabled?.value?``:void 0,disabled:k(n).disabled?.value,onClick:k(n).onOpenToggle},{default:A(()=>[W(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`]))}});function ms({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function hs({type:e,defaultValue:t,modelValue:n}){return e||ms({type:e,defaultValue:t,modelValue:n})}function gs({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function _s(e,t){let n=H(()=>hs(e)),r=io(e,`modelValue`,t,{defaultValue:gs(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=fa(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(ba(t,e)){let n=t.findIndex(t=>fa(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:H(()=>n.value===`single`)}}var[vs,ys]=ga(`AccordionRoot`),bs=y({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},orientation:{type:String,required:!1,default:`vertical`},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},type:{type:String,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{dir:i,disabled:a,unmountOnHide:o}=Pe(n),s=wo(i),{modelValue:c,changeModelValue:l,isSingle:u}=_s(n,r),{forwardRef:d,currentElement:f}=Y();return ys({disabled:a,direction:s,orientation:n.orientation,parentElement:f,isSingle Line truncated
`))}return()=>i.value||r.value||o.value?xe(t.default({present:o.value})[0],{ref:e=>{let t=Ua(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}});function cs(){let e=W();return{primitiveElement:e,currentElement:M(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:Ua(e))}}var[ls,us]=ga(`CollapsibleRoot`),ds=n({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=io(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:a,unmountOnHide:o}=p(r);return us({contentId:``,disabled:a,open:i,unmountOnHide:o,onOpenToggle:()=>{a.value||(i.value=!i.value)}}),t({open:i}),Y(),(e,t)=>(P(),U(F(mn),{as:e.as,"as-child":r.asChild,"data-state":F(i)?`open`:`closed`,"data-disabled":F(a)?``:void 0},{default:C(()=>[A(e.$slots,`default`,{open:F(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),fs=n({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`contentFound`],setup(e,{emit:t}){let n=e,r=t,i=ls();i.contentId||=Zo(void 0,`reka-collapsible-content`);let a=W(),{forwardRef:o,currentElement:s}=Y(),c=W(0),l=W(0),u=M(()=>i.open.value),d=W(u.value),f=W();j(()=>[u.value,a.value?.present],async()=>{await ht();let e=s.value;if(!e)return;f.value=f.value||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();l.value=t.height,c.value=t.width,d.value||(e.style.transitionDuration=f.value.transitionDuration,e.style.animationName=f.value.animationName)},{immediate:!0});let p=M(()=>d.value&&i.open.value);return I(()=>{requestAnimationFrame(()=>{d.value=!1})}),Wa(s,`beforematch`,e=>{requestAnimationFrame(()=>{i.onOpenToggle(),r(`contentFound`)})}),(e,t)=>(P(),U(F(ss),{ref_key:`presentRef`,ref:a,present:e.forceMount||F(i).open.value,"force-mount":!0},{default:C(({present:t})=>[O(F(mn),z(e.$attrs,{id:F(i).contentId,ref:F(o),"as-child":n.asChild,as:e.as,hidden:t?void 0:F(i).unmountOnHide.value?``:`until-found`,"data-state":p.value?void 0:F(i).open.value?`open`:`closed`,"data-disabled":F(i).disabled?.value?``:void 0,style:{"--reka-collapsible-content-height":`${l.value}px`,"--reka-collapsible-content-width":`${c.value}px`}}),{default:C(()=>[!F(i).unmountOnHide.value||t?A(e.$slots,`default`,{key:0}):N(`v-if`,!0)]),_:2},1040,[`id`,`as-child`,`as`,`hidden`,`data-state`,`data-disabled`,`style`])]),_:3},8,[`present`]))}}),ps=n({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;Y();let n=ls();return(e,r)=>(P(),U(F(mn),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":F(n).contentId,"aria-expanded":F(n).open.value,"data-state":F(n).open.value?`open`:`closed`,"data-disabled":F(n).disabled?.value?``:void 0,disabled:F(n).disabled?.value,onClick:F(n).onOpenToggle},{default:C(()=>[A(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`]))}});function ms({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function hs({type:e,defaultValue:t,modelValue:n}){return e||ms({type:e,defaultValue:t,modelValue:n})}function gs({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function _s(e,t){let n=M(()=>hs(e)),r=io(e,`modelValue`,t,{defaultValue:gs(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=fa(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(ba(t,e)){let n=t.findIndex(t=>fa(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:M(()=>n.value===`single`)}}var[vs,ys]=ga(`AccordionRoot`),bs=n({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},orientation:{type:String,required:!1,default:`vertical`},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},type:{type:String,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{dir:i,disabled:a,unmountOnHide:o}=p(n),s=wo(i),{modelValue:c,changeModelValue:l,isSingle:u}=_s(n,r),{forwardRef:d,currentElement:f}=Y();return ys({disabled:a,direction:s,orientation:n.orientation,parentElement:f,isSingle:u Line truncated
- a positive number
- less than the value passed to \`max\` (or ${tp} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`),null)}function op(e){return ip(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${tp}\`.`),tp)}var sp=y({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:tp},getValueLabel:{type:Function,required:!1,default:(e,t)=>ip(e)?`${Math.round(e/t*tp)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;Y();let i=io(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=io(n,`max`,r,{passive:n.max===void 0});q(()=>i.value,async e=>{let t=ap(e,n.max);t!==e&&(await Oe(),i.value=t)},{immediate:!0}),q(()=>n.max,e=>{let t=op(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=H(()=>ya(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return rp({modelValue:i,max:a,progressState:o}),(e,t)=>(F(),R(k(tt),{"as-child":e.asChild,as:e.as,"aria-valuemax":k(a),"aria-valuemin":0,"aria-valuenow":ip(k(i))?k(i):void 0,"aria-valuetext":e.getValueText?.(k(i),k(a)),"aria-label":e.getValueLabel(k(i),k(a)),role:`progressbar`,"data-state":o.value,"data-value":k(i)??void 0,"data-max":k(a)},{default:A(()=>[W(e.$slots,`default`,{modelValue:k(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),cp=y({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=np();return Y(),(e,r)=>(F(),R(k(tt),j(t,{"data-state":k(n).progressState.value,"data-value":k(n).modelValue?.value??void 0,"data-max":k(n).max.value}),{default:A(()=>[W(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),lp=`radio.select`;function up(e,t,n){va(lp,n,{originalEvent:e,value:t})}var dp=y({inheritAttrs:!1,__name:`Radio`,props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:checked`,`select`],setup(e,{emit:t}){let n=e,r=t,i=io(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=Pe(n),{forwardRef:o,currentElement:s}=Y(),c=ko(s),l=Mo(),u=H(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||up(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(e,t)=>(F(),N(U,null,[G(k(tt),j({id:e.id,ref:k(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":k(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":k(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:k(a),required:e.required,name:e.name},{...k(l),...e.$attrs},{onClick:$e(d,[`stop`])}),{default:A(()=>[W(e.$slots,`default`,{checked:k(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),k(c)&&e.name?(F(),R(k(Ic),j({key:0,type:`radio`,tabindex:`-1`,value:k(a),checked:!!k(i),name:e.name,disabled:e.disabled,required:e.required},k(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):I(`v-if`,!0)],64))}}),[fp,pp]=ga(`RadioGroupRoot`),mp=y({__name:`RadioGroupRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Y(),o=io(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:c,orientation:l,name:u,required:d,dir:f}=Pe(n),p=wo(f),m=ko(a);return pp({modelValue:o,changeModelValue:e=>{o.value=e},disabled:s,loop:c,orientation:l,name:u?.value,required:d}),(e,t)=>(F(),R(k(vd),{"as-child":``,orientation:k(l),dir:k(p),loop:k(c)},{default:A(()=>[G(k(tt),{ref:k(i),role:`radiogroup`,"data-disabled":k(s)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":k(l),"aria-required":k(d),dir:k(p)},{default:A(()=>[W(e.$slots,`default`,{modelValue:k(o)}),k(m)&&k(u)?(F(),R(k(Ic),{key:0,required:k(d),disabled:k(s),value:k(o),name:k(u)},null,8,[`required`,`disabled`,`value`,`name`])):I(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[hp,gp]=ga(`RadioGroupItem`),_p=y({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:nulLine truncated
Defaulting to \`null\`.`),null)}function op(e){return ip(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${tp}\`.`),tp)}var sp=n({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:tp},getValueLabel:{type:Function,required:!1,default:(e,t)=>ip(e)?`${Math.round(e/t*tp)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;Y();let i=io(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=io(n,`max`,r,{passive:n.max===void 0});j(()=>i.value,async e=>{let t=ap(e,n.max);t!==e&&(await ht(),i.value=t)},{immediate:!0}),j(()=>n.max,e=>{let t=op(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=M(()=>ya(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return rp({modelValue:i,max:a,progressState:o}),(e,t)=>(P(),U(F(mn),{"as-child":e.asChild,as:e.as,"aria-valuemax":F(a),"aria-valuemin":0,"aria-valuenow":ip(F(i))?F(i):void 0,"aria-valuetext":e.getValueText?.(F(i),F(a)),"aria-label":e.getValueLabel(F(i),F(a)),role:`progressbar`,"data-state":o.value,"data-value":F(i)??void 0,"data-max":F(a)},{default:C(()=>[A(e.$slots,`default`,{modelValue:F(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),cp=n({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=np();return Y(),(e,r)=>(P(),U(F(mn),z(t,{"data-state":F(n).progressState.value,"data-value":F(n).modelValue?.value??void 0,"data-max":F(n).max.value}),{default:C(()=>[A(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),lp=`radio.select`;function up(e,t,n){va(lp,n,{originalEvent:e,value:t})}var dp=n({inheritAttrs:!1,__name:`Radio`,props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:checked`,`select`],setup(e,{emit:t}){let n=e,r=t,i=io(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=p(n),{forwardRef:o,currentElement:s}=Y(),c=ko(s),l=Mo(),u=M(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||up(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(e,t)=>(P(),V(R,null,[O(F(mn),z({id:e.id,ref:F(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":F(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":F(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:F(a),required:e.required,name:e.name},{...F(l),...e.$attrs},{onClick:un(d,[`stop`])}),{default:C(()=>[A(e.$slots,`default`,{checked:F(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),F(c)&&e.name?(P(),U(F(Ic),z({key:0,type:`radio`,tabindex:`-1`,value:F(a),checked:!!F(i),name:e.name,disabled:e.disabled,required:e.required},F(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):N(`v-if`,!0)],64))}}),[fp,pp]=ga(`RadioGroupRoot`),mp=n({__name:`RadioGroupRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Y(),o=io(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:c,orientation:l,name:u,required:d,dir:f}=p(n),m=wo(f),h=ko(a);return pp({modelValue:o,changeModelValue:e=>{o.value=e},disabled:s,loop:c,orientation:l,name:u?.value,required:d}),(e,t)=>(P(),U(F(vd),{"as-child":``,orientation:F(l),dir:F(m),loop:F(c)},{default:C(()=>[O(F(mn),{ref:F(i),role:`radiogroup`,"data-disabled":F(s)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":F(l),"aria-required":F(d),dir:F(m)},{default:C(()=>[A(e.$slots,`default`,{modelValue:F(o)}),F(h)&&F(u)?(P(),U(F(Ic),{key:0,required:F(d),disabled:F(s),value:F(o),name:F(u)},null,8,[`required`,`disabled`,`value`,`name`])):N(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[hp,gp]=ga(`RadioGroupItem`),_p=n({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:null,Line truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:Hg(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>Hg(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=Wg(c),u=e+1<n.length?Wg(n[e+1]):null;if(l&&u&&Gg(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=Wg(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>Hg(e)),rows:r.map(e=>e.map(e=>Hg(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:Hg(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]);continue}if(c.startsWith(`>`)){o(),s(),t.push({kind:`blockquote`,inline:Hg(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function Wg(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 Gg(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var Kg={class:`[overflow-wrap:anywhere]`},qg={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},Jg={class:`font-mono text-[0.85em]`},Yg={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},Xg={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Zg={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Qg={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},$g={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},e_={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},t_={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},n_={key:8,class:`mb-2.5 last:mb-0`},r_=y({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=H(()=>Ug(t.text));return(e,t)=>(F(),N(`div`,Kg,[(F(!0),N(U,null,M(n.value,(e,t)=>(F(),N(U,{key:t},[e.kind===`pre`?(F(),N(`pre`,qg,[V(`code`,Jg,B(e.code),1)])):e.kind===`table`?(F(),N(`table`,Yg,[V(`thead`,null,[V(`tr`,null,[(F(!0),N(U,null,M(e.head,(e,t)=>(F(),N(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[G(Bg,{inline:e},null,8,[`inline`])]))),128))])]),V(`tbody`,null,[(F(!0),N(U,null,M(e.rows,(e,t)=>(F(),N(`tr`,{key:t},[(F(!0),N(U,null,M(e,(e,t)=>(F(),N(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[G(Bg,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(F(),N(`blockquote`,Xg,[G(Bg,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(F(),N(`h1`,Zg,[G(Bg,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(F(),N(`h2`,Qg,[G(Bg,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(F(),N(`h3`,$g,[G(Bg,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(F(),N(`ul`,e_,[(F(!0),N(U,null,M(e.items,(e,t)=>(F(),N(`li`,{key:t},[G(Bg,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(F(),N(`ol`,t_,[(F(!0),N(U,null,M(e.items,(e,t)=>(F(),N(`li`,{key:t},[G(Bg,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(F(),N(`p`,n_,[G(Bg,{inline:e.inline},null,8,[`inline`])])):I(``,!0)],64))),128))]))}}),i_={class:`truncate`},a_=y({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Sn(`RouterLink`);return F(),R(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full 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:A(()=>[G(k(ir),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),V(`span`,i_,B(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),o_={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},s_={class:`font-semibold text-foreground`},c_={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},l_=y({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=H(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=H(()=>t.tool.parameters||t.tool.Parameters||``),i=H(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=H(()=>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(),R(a_,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(F(),N(`div`,o_,[G(k(ai),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),V(`span`,s_,B(n.value),1),r.value?(F(),N(`code`,c_,B(r.value),1)):I(``,!0),V(`span`,{class:O(k(p)(`text-fg-muted`,i.value&&`text-danger`))},B(a.value),3)]))}}),u_={key:0,class:`mb-2 grid gap-0.5 text-xs`},d_={key:1,class:`mb-2 flex flex-wrap gap-1.5`},f_={key:3,class:`whitespace-pre-wrap`},p_=y({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(F(),N(`div`,{class:O([`flex`,e.assistant?`justify-start`:`justify-end`])},[V(`div`,{class:O(k(p)(`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(),N(`div`,u_,[(F(!0),N(U,null,M(e.tools,(t,n)=>(F(),R(l_,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):I(``,!0),e.media.length?(F(),N(`div`,d_,[(F(!0),N(U,null,M(e.media,(e,t)=>(F(),R(Ng,{key:t,attachment:e},null,8,[`attachment`]))),128))])):I(``,!0),e.assistant?(F(),R(r_,{key:2,text:e.text},null,8,[`text`])):(F(),N(`div`,f_,B(e.text),1)),W(t.$slots,`default`)],2)],2))}}),m_={class:`text-sm`},h_={class:`font-medium`},g_={key:0,class:`mt-1 text-fg-muted`},__={key:1,class:`mt-2 flex flex-wrap gap-2`},v_=y({__name:`ChatChLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>CS?`${n.slice(0,CS).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var TS=[`title`],ES=y({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=H(()=>Zx(n.event)),a=H(()=>wS(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=H(()=>n.event.at?$b(n.event.at):`—`);return(e,t)=>(F(),R(k(xS),{class:O(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[qe($e(o,[`prevent`]),[`enter`]),qe($e(o,[`prevent`]),[`space`])]},{default:A(()=>[G(k(Z),{class:`font-medium`},{default:A(()=>[f(B(n.event.kind||n.event.type||`event`),1)]),_:1}),G(k(Z),{class:`font-mono`},{default:A(()=>[f(B(i.value>0?`#${i.value}`:`—`),1)]),_:1}),G(k(Z),{class:`w-[55%] max-w-0`},{default:A(()=>[V(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},B(a.value.text),9,TS)]),_:1}),G(k(Z),null,{default:A(()=>[f(B(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),DS=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function OS(e){return(Number(e?.task_id)||0)>0}function kS(e,t){return t===`tasks`?OS(e):t!==`system`||!OS(e)}function AS(e,t){return e.filter(e=>kS(e,t))}function jS(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function MS(e,t){return`${e}:${t??0}`}function NS(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=MS(wS(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var PS={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},FS={class:`max-h-[28rem] overflow-y-auto`},IS=[`aria-expanded`,`aria-label`,`onClick`],LS=[`title`],RS=y({__name:`LiveActivityCard`,setup(e){let t=rv(),{activity:n,streamKind:r,streamState:i}=kn(An()),a=L(`all`),o=H(()=>AS(n.value,a.value)),s=H(()=>jS(o.value.length,a.value)),c=Yt(new Set),l=H(()=>NS(o.value));function u(e){c.has(e)?c.delete(e):c.add(e)}function d(e){return c.has(e.key)}function p(e){return wS(e.representative)}function m(e){return e.representative.at?$b(e.representative.at):`—`}function h(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(F(),R(k(Kb),null,{default:A(()=>[G(k(Zb),null,{default:A(()=>[G(k(Qb),null,{default:A(()=>[...t[1]||=[f(`Live activity`,-1)]]),_:1}),G(k(qb),{class:`flex items-center gap-2`},{default:A(()=>[G(k(_S),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:k(DS)},null,8,[`modelValue`,`options`]),G(k(Vt),{variant:k(r)},{default:A(()=>[f(B(k(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),G(k(Jb),null,{default:A(()=>[V(`div`,PS,[V(`div`,FS,[G(k(yS),null,{default:A(()=>[G(k(SS),{class:`sticky top-0 z-10 bg-card`},{default:A(()=>[G(k(xS),null,{default:A(()=>[G(k(Q),null,{default:A(()=>[...t[2]||=[f(`Event`,-1)]]),_:1}),G(k(Q),null,{default:A(()=>[...t[3]||=[f(`Task`,-1)]]),_:1}),G(k(Q),null,{default:A(()=>[...t[4]||=[f(`Detail`,-1)]]),_:1}),G(k(Q),null,{default:A(()=>[...t[5]||=[f(`When`,-1)]]),_:1})]),_:1})]),_:1}),G(k(bS),null,{default:A(()=>[o.value.length?I(``,!0):(F(),R(k(xS),{key:0},{default:A(()=>[G(k(Z),{colspan:`4`},{default:A(()=>[G(k(Lb),null,{default:A(()=>[G(k(Bb),null,{default:A(()=>[G(k(Ub),null,{default:A(()=>[f(B(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(F(!0),N(U,{key:1},M(l.value,e=>(F(),N(U,{key:e.key},[e.count===1?(F(),R(ES,{key:0,event:e.representative,onOpen:h},null,8,[`event`])):(F(),N(U,{key:1},[G(k(xS),{class:O(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&h(e.taskID),onKeydown:[qe($e(t=>e.taskID>0&&h(e.taskID),[`prevent`]),[`enter`]),qe($e(t=>e.taskID>0&&h(e.taskID),[`prevent`]),[`space`])]},{default:A(()=>[G(k(Z),{class:`font-medium`},{default:A(()=>[V(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":d(e),"aria-label":`${d(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:$e(t=>u(e.key),[`stop`])},[d(e)?(F(),R(k(dr),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(F(),R(k(fr),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),f(` `+B(e.label)+` `,1),G(k(Vt),{variant:`idle`},{default:A(()=>[f(`×`+B(e.count),1)]),_:2},1024)],8,IS)]),_:2},1024),G(k(Z),{class:`font-mono`},{default:A(()=>[f(B(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),G(k(Z),{class:`w-[55%] max-w-0`},{default:A(()=>[V(`span`,{class:`block truncate`,title:p(e).truncated?p(e).full:void 0},B(p(e).text),9,LS)]),_:2},1024),G(k(Z),null,{default:A(()=>[f(B(m(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(F(!0),N(U,{key:0},M(e.events,(t,n)=>(F(),R(ES,{key:`${e.key}:${n}`,event:t,onOpen: 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 iw(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 aw(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 ow(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 sw(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 cw=L([]),lw=L([]),uw=L(!0),dw=L(null),fw=L(null),pw=L(!1),mw=L(null);async function hw(){try{let e=await K.eventTypes();uw.value=e.enabled!==!1,cw.value=e.event_types||[],lw.value=e.proposals||[],dw.value=null}catch(e){dw.value=e.message||String(e)}}function gw(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function _w(e){mw.value=null,fw.value=e}function vw(e){let t=Ew.value.find(t=>String(t.id)===e.sample_id);_w({mode:`proposal`,id:null,source:e.source,name:``,rule:gw(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function yw(e=``){_w({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function bw(e){_w({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:gw(e.rule),headersText:``,body:``,exampleHeaders:{}})}function xw(){fw.value=null}async function Sw(){let e=fw.value;if(e){pw.value=!0;try{if(e.mode===`edit`&&e.id)await K.eventTypeUpdate(e.id,{name:e.name,rule:sw(e.rule)});else{let t=e.mode===`paste`?rw(e.headersText):e.exampleHeaders;await K.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:sw(e.rule),example:{headers:t,body:e.body}})}fw.value=null,await hw()}catch(e){mw.value=e.message||String(e)}finally{pw.value=!1}}}var Cw=L(null);async function ww(){let e=Cw.value;if(Cw.value=null,e)try{await K.eventTypeDelete(e.id),await hw()}catch(e){dw.value=e.message||String(e)}}var Tw=100,Ew=L([]),Dw=L(!0),Ow=L(null),kw=L(!0),Aw=L(null);async function jw(){try{let e=await K.captures(Tw);Dw.value=e.enabled!==!1,Ew.value=e.captures||[],Ow.value=null}catch(e){Ow.value=e.message||String(e)}finally{kw.value=!1}}function Mw(e){let t=Ew.value.find(t=>t.id===e);return t&&(Aw.value=t),!!t}function Nw(){Ew.value.length&&(Aw.value=Ew.value[0])}function Pw(){In(`captures`,()=>{jw(),hw()})}var Fw={key:0,class:`text-xs text-fg-muted`},Iw={key:1,class:`flex flex-col gap-1 text-xs`},Lw={key:1},Rw={key:2,class:`text-xs text-fg-muted`},zw=y({__name:`DispatchLinks`,props:{kind:{},id:{}},setup(e){let t=e,n=L([]),r=L(!1);q(()=>[t.kind,t.id],async()=>{r.value=!1;try{n.value=await K.dispatches(t.kind,t.id)}catch{n.value=[],r.value=!0}},{immediate:!0});let i=e=>({path:`/events`,query:{tab:`inspector`,capture:e}});return(e,a)=>{let o=Sn(`RouterLink`);return r.value?(F(),N(`p`,Fw,`Dispatches unavailable.`)):n.value.length?(F(),N(`ul`,Iw,[(F(!0),N(U,null,M(n.value,e=>(F(),N(`li`,{key:e.binding_id+e.capture_id,class:`flex flex-wrap items-center gap-x-2 font-mono text-fg-muted`},[t.kind===`bindings`?I(``,!0):(F(),R(o,{key:0,to:{path:`/events`,query:{tab:`bindings`}},class:`hover:text-foreground`},{default:A(()=>[f(`binding `+B(e.binding_id.slice(0,8))+` v`+B(e.binding_version),1)]),_:2},1024)),t.kind===`captures`?I(``,!0):(F(),R(o,{key:1,to:i(e.capture_id),class:`hover:text-foreground`},{default:A(()=>[f(`capture `+B(e.capture_id.slice(0,8)),1)]),_:2},1032,[`to`])),t.kind===`tasks`?I(``,!0):(F(),N(U,{key:2},[e.task_id?(F(),R(o,{key:0,to:`/tasks/${e.task_id}`,class:`text-foreground hover:underline`},{default:A(()=>[f(`task #`+B(e.task_id),1)]),_:2},1032,[`to`])):(F(),N(`span`,Lw,B(e.reason||`claimed, no task recorded`),1))],64)),V(`span`,null,B(k($b)(e.dispatched_at)),1)]))),128))])):t.kind===`tasks`?I(``,!0):(F(),N(`p`,Rw,` No dispatches yet. `))}}}),Bw=y({__name:`Spinner`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(F(),R(k(Er),{role:`status`,"aria-label":`Loading`,class:O(k(p)(`size-4 animate-spin`,t.class))},null,8,[`class`]))}});function Vw(e,t){return t?e.filter(e=>e.event_type_id===t):[]}function Hw(e){return(e?.repository??`required`)!==`none`}function Uw(e,t){return e.filter(e=>t===`any`||e.type===`any`||e.type===t)}function Ww(e,t){switch(t){case`string`:return e;case`number`:return e.trim()!==``&&!Number.isNaN(Number(e))?Number(e):e;case`bool`:return e===`true`||e!==`false`&&e;default:try{return JSON.parse(e)}catch{return e}}}var Gw={pending_approval:`pending approval`,armed:`armed`,paused:`paused`},Kw={pending_approval:`warn`,armed:`ok`,paused:`idle`};function qw(e) Line truncated
`)}),t}function Wg(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 Gg(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var Kg={class:`[overflow-wrap:anywhere]`},qg={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},Jg={class:`font-mono text-[0.85em]`},Yg={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},Xg={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Zg={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Qg={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},$g={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},e_={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},t_={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},n_={key:8,class:`mb-2.5 last:mb-0`},r_=n({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=M(()=>Ug(t.text));return(e,t)=>(P(),V(`div`,Kg,[(P(!0),V(R,null,H(n.value,(e,t)=>(P(),V(R,{key:t},[e.kind===`pre`?(P(),V(`pre`,qg,[B(`code`,Jg,L(e.code),1)])):e.kind===`table`?(P(),V(`table`,Yg,[B(`thead`,null,[B(`tr`,null,[(P(!0),V(R,null,H(e.head,(e,t)=>(P(),V(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[O(Bg,{inline:e},null,8,[`inline`])]))),128))])]),B(`tbody`,null,[(P(!0),V(R,null,H(e.rows,(e,t)=>(P(),V(`tr`,{key:t},[(P(!0),V(R,null,H(e,(e,t)=>(P(),V(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[O(Bg,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(P(),V(`blockquote`,Xg,[O(Bg,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(P(),V(`h1`,Zg,[O(Bg,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(P(),V(`h2`,Qg,[O(Bg,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(P(),V(`h3`,$g,[O(Bg,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(P(),V(`ul`,e_,[(P(!0),V(R,null,H(e.items,(e,t)=>(P(),V(`li`,{key:t},[O(Bg,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(P(),V(`ol`,t_,[(P(!0),V(R,null,H(e.items,(e,t)=>(P(),V(`li`,{key:t},[O(Bg,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(P(),V(`p`,n_,[O(Bg,{inline:e.inline},null,8,[`inline`])])):N(``,!0)],64))),128))]))}}),i_={class:`truncate`},a_=n({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=c(`RouterLink`);return P(),U(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full 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:C(()=>[O(F(ir),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),B(`span`,i_,L(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),o_={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},s_={class:`font-semibold text-foreground`},c_={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},l_=n({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=M(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=M(()=>t.tool.parameters||t.tool.Parameters||``),i=M(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=M(()=>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?(P(),U(a_,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(P(),V(`div`,o_,[O(F(ai),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),B(`span`,s_,L(n.value),1),r.value?(P(),V(`code`,c_,L(r.value),1)):N(``,!0),B(`span`,{class:k(F(G)(`text-fg-muted`,i.value&&`text-danger`))},L(a.value),3)]))}}),u_={key:0,class:`mb-2 grid gap-0.5 text-xs`},d_={key:1,class:`mb-2 flex flex-wrap gap-1.5`},f_={key:3,class:`whitespace-pre-wrap`},p_=n({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(P(),V(`div`,{class:k([`flex`,e.assistant?`justify-start`:`justify-end`])},[B(`div`,{class:k(F(G)(`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?(P(),V(`div`,u_,[(P(!0),V(R,null,H(e.tools,(t,n)=>(P(),U(l_,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):N(``,!0),e.media.length?(P(),V(`div`,d_,[(P(!0),V(R,null,H(e.media,(e,t)=>(P(),U(Ng,{key:t,attachment:e},null,8,[`attachment`]))),128))])):N(``,!0),e.assistant?(P(),U(r_,{key:2,text:e.text},null,8,[`text`])):(P(),V(`div`,f_,L(e.text),1)),A(t.$slots,`default`)],2)],2))}}),m_={class:`text-sm`},h_={class:`font-medium`},g_={key:0,class:`mt-1 text-fg-muted`},__={key:1,class:`mt-2 flex flex-wrap gap-2`},v_=n({__name:`ChatChoLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>CS?`${n.slice(0,CS).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var TS=[`title`],ES=n({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=M(()=>Zx(n.event)),a=M(()=>wS(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=M(()=>n.event.at?$b(n.event.at):`—`);return(e,t)=>(P(),U(F(xS),{class:k(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[dn(un(o,[`prevent`]),[`enter`]),dn(un(o,[`prevent`]),[`space`])]},{default:C(()=>[O(F(Z),{class:`font-medium`},{default:C(()=>[l(L(n.event.kind||n.event.type||`event`),1)]),_:1}),O(F(Z),{class:`font-mono`},{default:C(()=>[l(L(i.value>0?`#${i.value}`:`—`),1)]),_:1}),O(F(Z),{class:`w-[55%] max-w-0`},{default:C(()=>[B(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},L(a.value.text),9,TS)]),_:1}),O(F(Z),null,{default:C(()=>[l(L(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),DS=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function OS(e){return(Number(e?.task_id)||0)>0}function kS(e,t){return t===`tasks`?OS(e):t!==`system`||!OS(e)}function AS(e,t){return e.filter(e=>kS(e,t))}function jS(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function MS(e,t){return`${e}:${t??0}`}function NS(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=MS(wS(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var PS={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},FS={class:`max-h-[28rem] overflow-y-auto`},IS=[`aria-expanded`,`aria-label`,`onClick`],LS=[`title`],RS=n({__name:`LiveActivityCard`,setup(e){let t=rv(),{activity:n,streamKind:r,streamState:i}=kn(An()),a=W(`all`),o=M(()=>AS(n.value,a.value)),s=M(()=>jS(o.value.length,a.value)),c=je(new Set),u=M(()=>NS(o.value));function d(e){c.has(e)?c.delete(e):c.add(e)}function f(e){return c.has(e.key)}function p(e){return wS(e.representative)}function m(e){return e.representative.at?$b(e.representative.at):`—`}function h(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(P(),U(F(Kb),null,{default:C(()=>[O(F(Zb),null,{default:C(()=>[O(F(Qb),null,{default:C(()=>[...t[1]||=[l(`Live activity`,-1)]]),_:1}),O(F(qb),{class:`flex items-center gap-2`},{default:C(()=>[O(F(_S),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:F(DS)},null,8,[`modelValue`,`options`]),O(F(xn),{variant:F(r)},{default:C(()=>[l(L(F(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),O(F(Jb),null,{default:C(()=>[B(`div`,PS,[B(`div`,FS,[O(F(yS),null,{default:C(()=>[O(F(SS),{class:`sticky top-0 z-10 bg-card`},{default:C(()=>[O(F(xS),null,{default:C(()=>[O(F(Q),null,{default:C(()=>[...t[2]||=[l(`Event`,-1)]]),_:1}),O(F(Q),null,{default:C(()=>[...t[3]||=[l(`Task`,-1)]]),_:1}),O(F(Q),null,{default:C(()=>[...t[4]||=[l(`Detail`,-1)]]),_:1}),O(F(Q),null,{default:C(()=>[...t[5]||=[l(`When`,-1)]]),_:1})]),_:1})]),_:1}),O(F(bS),null,{default:C(()=>[o.value.length?N(``,!0):(P(),U(F(xS),{key:0},{default:C(()=>[O(F(Z),{colspan:`4`},{default:C(()=>[O(F(Lb),null,{default:C(()=>[O(F(Bb),null,{default:C(()=>[O(F(Ub),null,{default:C(()=>[l(L(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(P(!0),V(R,{key:1},H(u.value,e=>(P(),V(R,{key:e.key},[e.count===1?(P(),U(ES,{key:0,event:e.representative,onOpen:h},null,8,[`event`])):(P(),V(R,{key:1},[O(F(xS),{class:k(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&h(e.taskID),onKeydown:[dn(un(t=>e.taskID>0&&h(e.taskID),[`prevent`]),[`enter`]),dn(un(t=>e.taskID>0&&h(e.taskID),[`prevent`]),[`space`])]},{default:C(()=>[O(F(Z),{class:`font-medium`},{default:C(()=>[B(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":f(e),"aria-label":`${f(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:un(t=>d(e.key),[`stop`])},[f(e)?(P(),U(F(dr),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(P(),U(F(fr),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),l(` `+L(e.label)+` `,1),O(F(xn),{variant:`idle`},{default:C(()=>[l(`×`+L(e.count),1)]),_:2},1024)],8,IS)]),_:2},1024),O(F(Z),{class:`font-mono`},{default:C(()=>[l(L(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),O(F(Z),{class:`w-[55%] max-w-0`},{default:C(()=>[B(`span`,{class:`block truncate`,title:p(e).truncated?p(e).full:void 0},L(p(e).text),9,LS)]),_:2},1024),O(F(Z),null,{default:C(()=>[l(L(m(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),f(e)?(P(!0),V(R,{key:0},H(e.events,(t,n)=>(P(),U(ES,{key:`${e.key}:${n}`,event:t,onOpen: 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 iw(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 aw(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 ow(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 sw(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 cw=W([]),lw=W([]),uw=W(!0),dw=W(null),fw=W(null),pw=W(!1),mw=W(null);async function hw(){try{let e=await K.eventTypes();uw.value=e.enabled!==!1,cw.value=e.event_types||[],lw.value=e.proposals||[],dw.value=null}catch(e){dw.value=e.message||String(e)}}function gw(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function _w(e){mw.value=null,fw.value=e}function vw(e){let t=Ew.value.find(t=>String(t.id)===e.sample_id);_w({mode:`proposal`,id:null,source:e.source,name:``,rule:gw(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function yw(e=``){_w({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function bw(e){_w({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:gw(e.rule),headersText:``,body:``,exampleHeaders:{}})}function xw(){fw.value=null}async function Sw(){let e=fw.value;if(e){pw.value=!0;try{if(e.mode===`edit`&&e.id)await K.eventTypeUpdate(e.id,{name:e.name,rule:sw(e.rule)});else{let t=e.mode===`paste`?rw(e.headersText):e.exampleHeaders;await K.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:sw(e.rule),example:{headers:t,body:e.body}})}fw.value=null,await hw()}catch(e){mw.value=e.message||String(e)}finally{pw.value=!1}}}var Cw=W(null);async function ww(){let e=Cw.value;if(Cw.value=null,e)try{await K.eventTypeDelete(e.id),await hw()}catch(e){dw.value=e.message||String(e)}}var Tw=100,Ew=W([]),Dw=W(!0),Ow=W(null),kw=W(!0),Aw=W(null);async function jw(){try{let e=await K.captures(Tw);Dw.value=e.enabled!==!1,Ew.value=e.captures||[],Ow.value=null}catch(e){Ow.value=e.message||String(e)}finally{kw.value=!1}}function Mw(e){let t=Ew.value.find(t=>t.id===e);return t&&(Aw.value=t),!!t}function Nw(){Ew.value.length&&(Aw.value=Ew.value[0])}function Pw(){In(`captures`,()=>{jw(),hw()})}var Fw={key:0,class:`text-xs text-fg-muted`},Iw={key:1,class:`flex flex-col gap-1 text-xs`},Lw={key:1},Rw={key:2,class:`text-xs text-fg-muted`},zw=n({__name:`DispatchLinks`,props:{kind:{},id:{}},setup(e){let t=e,n=W([]),r=W(!1);j(()=>[t.kind,t.id],async()=>{r.value=!1;try{n.value=await K.dispatches(t.kind,t.id)}catch{n.value=[],r.value=!0}},{immediate:!0});let i=e=>({path:`/events`,query:{tab:`inspector`,capture:e}});return(e,a)=>{let o=c(`RouterLink`);return r.value?(P(),V(`p`,Fw,`Dispatches unavailable.`)):n.value.length?(P(),V(`ul`,Iw,[(P(!0),V(R,null,H(n.value,e=>(P(),V(`li`,{key:e.binding_id+e.capture_id,class:`flex flex-wrap items-center gap-x-2 font-mono text-fg-muted`},[t.kind===`bindings`?N(``,!0):(P(),U(o,{key:0,to:{path:`/events`,query:{tab:`bindings`}},class:`hover:text-foreground`},{default:C(()=>[l(`binding `+L(e.binding_id.slice(0,8))+` v`+L(e.binding_version),1)]),_:2},1024)),t.kind===`captures`?N(``,!0):(P(),U(o,{key:1,to:i(e.capture_id),class:`hover:text-foreground`},{default:C(()=>[l(`capture `+L(e.capture_id.slice(0,8)),1)]),_:2},1032,[`to`])),t.kind===`tasks`?N(``,!0):(P(),V(R,{key:2},[e.task_id?(P(),U(o,{key:0,to:`/tasks/${e.task_id}`,class:`text-foreground hover:underline`},{default:C(()=>[l(`task #`+L(e.task_id),1)]),_:2},1032,[`to`])):(P(),V(`span`,Lw,L(e.reason||`claimed, no task recorded`),1))],64)),B(`span`,null,L(F($b)(e.dispatched_at)),1)]))),128))])):t.kind===`tasks`?N(``,!0):(P(),V(`p`,Rw,` No dispatches yet. `))}}}),Bw=n({__name:`Spinner`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(P(),U(F(Er),{role:`status`,"aria-label":`Loading`,class:k(F(G)(`size-4 animate-spin`,t.class))},null,8,[`class`]))}});function Vw(e,t){return t?e.filter(e=>e.event_type_id===t):[]}function Hw(e){return(e?.repository??`required`)!==`none`}function Uw(e,t){return e.filter(e=>t===`any`||e.type===`any`||e.type===t)}function Ww(e,t){switch(t){case`string`:return e;case`number`:return e.trim()!==``&&!Number.isNaN(Number(e))?Number(e):e;case`bool`:return e===`true`||e!==`false`&&e;default:try{return JSON.parse(e)}catch{return e}}}var Gw={pending_approval:`pending approval`,armed:`armed`,paused:`paused`},Kw={pending_approval:`warn`,armed:`ok`,paused:`idle`};function qw(e){ Line truncated
`)}};iB.defaultYaml={explicit:!1,version:`1.2`},iB.defaultTags={"!!":`tag:yaml.org,2002:`};function aB(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 oB(e){let t=new Set;return Zz(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function sB(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function cB(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=oB(e);let a=sB(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(Uz(t.node)||Gz(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 lB(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=lB(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=lB(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=lB(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=lB(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function uB(e,t,n){if(Array.isArray(e))return e.map((e,t)=>uB(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!qz(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 dB=class{constructor(e){Object.defineProperty(this,Rz,{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(!Bz(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=uB(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?lB(i,{"":o},``,o):o}},fB=class extends dB{constructor(e){super(Mz),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=[],Zz(e,{Node:(e,t)=>{(zz(t)||qz(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||=(uB(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=pB(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(aB(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 pB(e,t,n){if(zz(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(Gz(t)){let r=0;for(let i of t.items){let t=pB(e,i,n);t>r&&(r=t)}return r}if(Hz(t)){let r=pB(e,t.key,n),i=pB(e,t.value,n);return Math.max(r,i)}return 1}var mB=e=>!e||typeof e!=`function`&&typeof e!=`object`,hB=class extends dB{constructor(e){super(Iz),this.value=e}toJSON(e,t){return t?.keep?this.value:uB(this.value,e,t)}toString(){return String(this.value)}};hB.BLOCK_FOLDED=`BLOCK_FOLDED`,hB.BLOCK_LITERAL=`BLOCK_LITERAL`,hB.PLAIN=`PLAIN`,hB.QUOTE_DOUBLE=`QUOTE_DOUBLE`,hB.QUOTE_SINGLE=`QUOTE_SINGLE`;var gB=`tag:yaml.org,2002:`;function _B(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 vB(e,t,n){if(Bz(e)&&(e=e.contents),Kz(e))return e;if(Hz(e)){let t=n.schema[Pz].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 fB(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=gB+t.slice(2));let l=_B(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new hB(e);return c&&(c.node=t),t Line truncated
`)?CB(n,t):n.includes(`
`)?`
@@ -55,7 +55,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
`)?(n.push(`...`),n.push(CB(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(CB(a(t),``)))}return n.join(`
`)+`
`}var uH=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Rz,{value:Nz});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 iB({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[Rz]:{value:Nz}});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=Kz(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){dH(this.contents)&&this.contents.add(e)}addIn(e,t){dH(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=oB(this);e.anchor=!t||n.has(t)?sB(t||`a`,n):t}return new fB(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}=cB(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=vB(e,l,p);return o&&Gz(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new tV(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return dH(this.contents)?this.contents.delete(e):!1}deleteIn(e){return bB(e)?this.contents!=null&&(this.contents=null,!0):dH(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Gz(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return bB(e)?!t&&Uz(this.contents)?this.contents.value:this.contents:Gz(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Gz(this.contents)?this.contents.has(e):!1}hasIn(e){return bB(e)?this.contents!==void 0:Gz(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=yB(this.schema,[e],t):dH(this.contents)&&this.contents.set(e,t)}setIn(e,t){bB(e)?this.contents=t:this.contents==null?this.contents=yB(this.schema,Array.from(e),t):dH(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 iB({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 iB({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 cH(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=uB(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`?lB(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 lH(this,e)}};function dH(e){if(Gz(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var fH=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},pH=class extends fH{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},mH=class extends fH{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},hH=(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 gH(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 _H(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
`),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 gH(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],ee=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:ee,start:x??ee}}function _H(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(_H(t.key)||_H(t.value))return!0}return!1;default:return!0}}function vH(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&_H(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function yH(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||Uz(e)&&Uz(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var bH=`All mapping items must start at the same column`;function xH({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??sV)(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=gH(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`,bH)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||_H(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`,bH);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&vH(r.indent,u,i),n.atKey=!1,yH(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=gH(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&&vH(r.indent,f,i),s=c.range[2];let l=new tV(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 tV(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 SH({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??lV)(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=gH(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&&vH(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function CH(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 wH=`Block collections are not allowed within flow collections`,TH=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function EH({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?sV:lV))(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=gH(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+=`
@@ -121,15 +121,15 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
`,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=gU(hU(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=gU(hU(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 bU(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new dU||null,prettyErrors:t}}function xU(e,t={}){let{lineCounter:n,prettyErrors:r}=bU(t),i=new yU(n?.addNewLine),a=new ZH(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 pH(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(hH(e,n)),o.warnings.forEach(hH(e,n))),o}function SU(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=xU(e,n);if(!i)return null;if(i.warnings.forEach(e=>GB(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 CU(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 Bz(e)&&!r?e.toString(n):new uH(e,r,n).toString(n)}function wU(e,t){let n=new Map;for(let e of t)n.set(e.name,[...n.get(e.name)??[],e]);return{edges:e.edges,nodes:e.nodes.map(e=>{let{stage:t,occurrence:r}=e.data,i=t===void 0?void 0:n.get(t)?.[r??0];return i?{...e,data:{...e.data,run:i}}:e})}}function TU(e,t){let n=e=>e.path&&e.path.length>=2?Number(e.path[1]):-1,r=e.nodes.find(e=>JSON.stringify(e.data.path)===JSON.stringify(t))?.data,i=r?.resume??r?.stage;if(!r||!i)return null;let a=Math.max(-1,...e.nodes.filter(e=>e.data.run).map(e=>n(e.data))),o=n(r);if(o<0||o>a)return null;let s=e.nodes.filter(e=>e.data.path?.length===2).sort((e,t)=>n(e.data)-n(t.data)).map(e=>e.data.resume??e.data.stage??``),c=e=>!!e&&s.filter(t=>t===e).length>1;return c(i)||o>0&&c(s[o-1])?{label:`Add an id to resume here`,from:i,blocked:!0}:{label:o===a?`Resume from here`:`Re-run from here`,from:i}}var EU=140,DU=280,OU={"agent.run":`Agent`,"command.run":`Run commands`,"repo.prepare":`Prepare worktree`,"repo.commit":`Commit`,"repo.open-pr":`Open pull request`,"gate.repository":`Repository gate`,"gate.diff-size":`Diff size gate`,"gate.diff-rules":`Diff rules gate`,"forge.comment":`Comment`,"forge.close-issue":`Close issue`,"human.approve":`Human approval`,"workflow.call":`Call workflow`,"workflow.handoff":`Hand off`,"workflow.finish":`Finish`,"review.pr":`Review pull request`,"review.start-round":`Start review round`,"review.reply":`Reply to review`};function kU(e){return OU[e]??e}var AU=/\{\{\s*steps\.([A-Za-z0-9_-]+)\.[^}]*\}\}/g;function jU(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function MU(e,t){let n=e=>typeof t[e]==`string`?t[e]:``;switch(e){case`agent.run`:return[n(`role`)||`builder`,t.read_only?`read-only`:n(`gate`)?`gated: ${n(`gate`)}`:``].filter(Boolean).join(` · `);case`repo.commit`:return[n(`message`),t.push?`push`:``].filter(Boolean).join(` · `);case`workflow.call`:case`workflow.handoff`:return n(`workflow`);case`workflow.finish`:return n(`status`)||`completed`;case`human.approve`:return n(`then`)?`then ${n(`then`)}`:``;case`gate.repository`:return n(`expect`)===`test-failure`?`tests must fail`:t.repair?`repair if red`:``}return``}function NU(e){for(let t of[`mission`,`message`,`body`,`plan`,`detail`]){let n=e[t];if(typeof n==`string`&&n.trim())return n.replace(/\{\{\s*([^}]+?)\s*\}\}/g,`‹$1›`).split(`
`).find(e=>e.trim())?.trim()}}function PU(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(AU)].map(e=>e[1]))]}function FU(e){let t=xU(e).toJS(),n=jU(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=`start`;r.push({id:s,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let c=[s],l=1,u=new Map,d=e=>{let t=u.get(e)??0;return u.set(e,t+1),t},f=(e,t,n,i,s,c,l)=>{let u=jU(e)?e:{},f=typeof u.type==`string`?u.type:``,p=jU(u.settings)?u.settings:{},m=typeof u.id==`string`?u.id:``,h=`step-${t}`,g=s?`${s}/${m||f}`:m||f;r.push({id:h,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:m||t,title:m||kU(f),type:f,detail:MU(f,p),summary:NU(p),when:typeof u.when==`string`?u.when:void 0,retry:jU(u.retry)&&typeof u.retry.attempts==`number`?u.retry.attempts:void 0,continues:u.on_failure===`continue`,branch:s,path:l,stage:g,occurrence:d(g),...c?{resume:c}:{}}}),m&&a.set(m,h);for(let e of PU(u.settings,u.when))o.push({from:e,to:h});return h},p=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){if(jU(t)&&jU(t.parallel)){let n=Object.entries(t.parallel),r=typeof t.id==`string`?t.id:`parallel`,i=[],a=0;n.forEach(([t,o],s)=>{let u=(s-(n.length-1)/2)*DU,d=c,m=c;(Array.isArray(o)?o:[]).forEach((i,o)=>{let c=f(i,`${e+1}-${t}-${o+1}`,u,(l+o)*EU,t,r,[`steps`,e,`parallel`,t,o]);p(d,c,d===m&&s===n.length-1?e-1:void 0),d=[c],a=Math.max(a,o+1)}),i.push(...d)}),c=i,l+=Math.max(a,1);continue}let n=f(t,String(e+1),0,l*EU,void 0,void 0,[`steps`,e]);p(c,n,e-1),c=[n],l++}r.push({id:`add-end`,type:`add`,position:{x:104,y:l*EU-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``}}),p(c,`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 IU={agent:sr,command:Jr,repo:Cr,gate:Gr,forge:jr,human:ti,review:xr,workflow:ii},LU={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function RU(e){return IU[e.split(`.`)[0]]??ii}function zU(e){return Object.keys(LU).map(t=>({title:LU[t],icon:IU[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function BU(e,t){let n=xU(e).getIn(t,!0);if(Vz(n))return n.toJSON()}function VU(e,t,n){let r=xU(e);return r.setIn(t,r.createNode(qU(n))),r.toString()}function HU(e,t,n){let r=xU(e),i=r.get(`steps`,!0);if(Wz(i)||(r.set(`steps`,r.createNode([])),i=r.get(`steps`,!0)),!Wz(i))return{source:e,path:[]};let a=Math.min(Math.max(t+1,0),i.items.length);return i.items.splice(a,0,r.createNode({type:n})),{source:r.toString(),path:[`steps`,a]}}function UU(e,t){let n=xU(e),r=n.getIn(t.slice(0,-1),!0),i=t.at(-1);if(!Wz(r)||typeof i!=`number`)return{source:e,path:t};let a=n.createNode(n.getIn(t));return Vz(a)&&a.delete(`id`),r.items.splice(i+1,0,a),{source:n.toString(),path:[...t.slice(0,-1),i+1]}}function WU(e,t){let n=xU(e);n.deleteIn(t);let r=t.slice(0,-1);if(r.length>2){let e=n.getIn(r,!0);Wz(e)&&e.items.length===0&&n.deleteIn(r)}return n.toString()}function GU(e,t,n){let r=xU(e),i=r.getIn(t.slice(0,-1),!0),a=t.at(-1);if(!Wz(i)||typeof a!=`number`)return{source:e,path:t};let o=a+n;if(o<0||o>=i.items.length)return{source:e,path:t};let[s]=i.items.splice(a,1);return i.items.splice(o,0,s),{source:r.toString(),path:[...t.slice(0,-1),o]}}function KU(e,t){let n=xU(e).toJS(),r=Array.isArray(n?.steps)?n.steps:[],i=typeof t[1]==`number`?t[1]:r.length,a=[],o=e=>{if(typeof e!=`object`||!e)return;let t=e;if(typeof t.id==`string`&&a.push(t.id),typeof t.parallel==`object`&&t.parallel!==null)for(let e of Object.values(t.parallel))Array.isArray(e)&&e.forEach(o)};if(r.slice(0,i).forEach(o),t.length===5){let e=r[i]?.parallel?.[t[3]];Array.isArray(e)&&e.slice(0,t[4]).forEach(o)}return a}function qU(e){if(Array.isArray(e))return e.map(qU);if(typeof e!=`object`||!e)return e;let t={};for(let[n,r]of Object.entries(e)){if(r===void 0||r===``||r===null)continue;let e=qU(r);(typeof e!=`object`||!e||Array.isArray(e)||Object.keys(e).length!==0)&&(t[n]=e)}return t}function JU(e,t){let n=xU(e).get(t,!0);return n&&typeof n==`object`&&`toJSON`in n?n.toJSON():xU(e).get(t)}function YU(e,t,n){let r=xU(e),i=qU({[t]:n})[t];return i===void 0?r.delete(t):r.set(t,r.createNode(i)),r.toString()}function XU(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function ZU(e,t=[]){let n=xU(e),r=n.errors[0];if(r)return{ok:!1,message:dW(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!fW(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`};le Line truncated
`).map((e,t)=>({number:t+1,text:e,tokens:sW(e)}))}var aW=/^(\s*)(-\s+)?/,oW=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function sW(e){let{code:t,comment:n}=cW(e),r=lW(t);return n&&r.push({text:n,kind:`comment`}),r}function cW(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t){r===t&&(t=``);continue}if(r===`"`||r===`'`){t=r;continue}if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function lW(e){if(!e)return[];let t=[],n=aW.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=oW.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,...uW(i[4]??``)]):[...t,...uW(r)]}function uW(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 dW(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function fW(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function pW(e){return typeof e==`string`&&e.trim()!==``}var mW={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},hW={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},gW={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},_W={class:`min-w-0 flex-1`},vW=[`value`,`placeholder`],yW={class:`truncate font-mono text-[11px] text-fg-subtle`},bW={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},xW={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},SW={key:1,class:`space-y-1.5`},CW=[`title`],wW=[`value`],TW=[`value`],EW={key:3,class:`flex flex-wrap items-center gap-1 pt-0.5`},DW=[`onClick`],OW=[`onClick`],kW={key:2,class:`divide-y divide-border rounded-md border border-border`},AW=[`title`],jW=[`value`,`onChange`],MW=[`value`],NW=[`value`,`onInput`],PW=[`value`,`onFocus`,`onInput`],FW=[`title`],IW={key:0,class:`text-xs text-danger`},LW={class:`space-y-2`},RW={class:`divide-y divide-border rounded-md border border-border`},zW={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},BW=[`value`],VW={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},HW=[`value`],UW={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},WW=[`value`],GW={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},KW={class:`flex items-center border-t border-border px-4 py-2.5`},qW=y({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=H(()=>BU(n.yaml,n.path)??{}),a=H(()=>typeof i.value.type==`string`?i.value.type:``),o=H(()=>n.vocabulary.find(e=>e.name===a.value)),s=H(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),c=H(()=>KU(n.yaml,n.path)),l=H(()=>o.value?.settings&&i.value.settings?nW(i.value.settings,o.value.settings,`settings`):``),u=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],d=/mission|body|detail|plan|rules/;function p(e,t){return t.type===`string`?t.enum?`select`:d.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 m=H(()=>{let e=Object.entries(o.value?.settings?.properties??{}).map(([e,t])=>({key:e,schema:t,kind:p(e,t)})),t=e.filter(e=>u.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>u.indexOf(e.key)-u.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function h(e){let{id:t,type:i,...a}=e;r(`update:yaml`,VU(n.yaml,n.path,{id:t,type:i,...a}))}function g(e,t){h({...i.value,[e]:t})}function _(e){g(`retry`,{...i.value.retry,...e})}function v(e,t){h({...i.value,settings:{...s.value,[e]:t}})}let y=L(null);function b(e,t){let n=y.value??m.value.lead?.key;if(!n)return;let r=typeof s.value[n]==`string`?s.value[n]:``,i=`{{ steps.${e}.${t} }}`;v(n,r?`${r.trimEnd()} ${i}`:i)}let x=L({});function S(e,t){try{v(e,t.trim()?SU(t):void 0),x.value={...x.value,[e]:``}}catch(t){x.value={...x.value,[e]:String(t.message).split(`
`)[0]}}}let C=e=>e===void 0?``:CU(e).trimEnd(),w=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),T=e=>typeof s.value[e]==`string`?s.value[e]:``;return(e,t)=>(F(),N(`aside`,mW,[V(`header`,hW,[V(`span`,gW,[(F(),R(vn(k(RU)(a.value)),{class:`size-4`}))]),V(`div`,_W,[V(`input`,{value:i.value.id??``,class:`w-full truncate bg-transparent text-sm font-medium outline-none placeholder:text-fg-subtle focus:underline`,placeholder:k(kU)(a.value),"aria-label":`Step id`,onInput:t[0]||=e=>g(`id`,e.target.value)},null,40,vW),V(`div`,yW,B(a.value),1)]),G(k(z),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:t[1]||=e=>r(`close`)},{default:A(()=>[G(k(oi))]),_:1})]),V(`div`,bW,[l.value?(F(),N(`p`,xW,B(l.value),1)):I(``,!0),m.value.lead?(F(),N(`section`,SW,[V(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:m.value.lead.schema.description},[f(B(w(m.value.lead.key,m.value.lead.schema))+` `,1),m.value.lead.schema.description?(F(),R(k(_r),{key:0,class:`size-3 text-fg-subtle`})):I(``,!0)],8,CW),m.value.lead.kind===`select`?(F(),N(`select`,{key:0,class:`h-9 w-full rounded-md border border-input bg-background px-2`,value:T(m.value.lead.key),onChange:t[2]||=e=>v(m.value.lead.key,e.target.value||void 0)},[t[13]||=V(`option`,{value:``},`Default`,-1),(F(!0),N(U,null,M(m.value.lead.schema.enum,e=>(F(),N(`option`,{key:e,value:e},B(e),9,TW))),128))],40,wW)):m.value.lead.kind===`text`?(F(),R(k(mh),{key:1,"model-value":T(m.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:t[3]||=e=>y.value=m.value.lead.key,"onUpdate:modelValue":t[4]||=e=>v(m.value.lead.key,String(e))},null,8,[`model-value`])):(F(),R(k(J),{key:2,"model-value":T(m.value.lead.key),onFocus:t[5]||=e=>y.value=m.value.lead.key,"onUpdate:modelValue":t[6]||=e=>v(m.value.lead.key,String(e))},null,8,[`model-value`])),c.value.length&&m.value.lead.kind!==`select`?(F(),N(`div`,EW,[t[14]||=V(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(F(!0),N(U,null,M(c.value,e=>(F(),N(U,{key:e},[V(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>b(e,`summary`)},B(e),9,DW),V(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>b(e,`result`)},B(e)+`.result`,9,OW)],64))),128))])):I(``,!0)])):I(``,!0),m.value.compact.length?(F(),N(`section`,kW,[(F(!0),N(U,null,M(m.value.compact,e=>(F(),N(`div`,{key:e.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[V(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:e.schema.description},[f(B(w(e.key,e.schema))+` `,1),e.schema.description?(F(),R(k(_r),{key:0,class:`size-3 text-fg-subtle`})):I(``,!0)],8,AW),e.kind===`boolean`?(F(),R(k(sb),{key:0,"model-value":s.value[e.key]===!0,"onUpdate:modelValue":t=>v(e.key,t||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`select`?(F(),N(`select`,{key:1,class:`h-7 max-w-40 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:T(e.key),onChange:t=>v(e.key,t.target.value||void 0)},[t[15]||=V(`option`,{value:``},`Default`,-1),(F(!0),N(U,null,M(e.schema.enum,e=>(F(),N(`option`,{key:e,value:e},B(e),9,MW))),128))],40,jW)):e.kind===`number`?(F(),N(`input`,{key:2,type:`number`,class:`h-7 w-24 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:s.value[e.key]??``,onInput:t=>v(e.key,t.target.value===``?void 0:Number(t.target.value))},null,40,NW)):(F(),N(`input`,{key:3,class:`h-7 w-40 rounded-md border border-input bg-background px-2 text-[13px]`,value:T(e.key),onFocus:t=>y.value=e.key,onInput:t=>v(e.key,t.target.value)},null,40,PW))]))),128))])):I(``,!0),(F(!0),N(U,null,M(m.value.long,e=>(F(),N(`section`,{key:e.key,class:`space-y-1.5`},[V(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:e.schema.description},[f(B(w(e.key,e.schema))+` `,1),e.schema.description?(F(),R(k(_r),{key:0,class:`size-3 text-fg-subtle`})):I(``,!0)],8,FW),e.kind===`text`?(F(),R(k(mh),{key:0,"model-value":T(e.key),class:`min-h-20 text-[13px]`,onFocus:t=>y.value=e.key,"onUpdate:modelValue":t=>v(e.key,String(t))},null,8,[`model-value`,`onFocus`,`onUpdate:modelValue`])):e.kind===`lines`?(F(),R(k(mh),{key:1,"model-value":Array.isArray(s.value[e.key])?s.value[e.key].join(`
`)[0]?.trim()||`invalid YAML`}function fW(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function pW(e){return typeof e==`string`&&e.trim()!==``}var mW={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},hW={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},gW={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},_W={class:`min-w-0 flex-1`},vW=[`value`,`placeholder`],yW={class:`truncate font-mono text-[11px] text-fg-subtle`},bW={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},xW={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},SW={key:1,class:`space-y-1.5`},CW=[`title`],wW=[`value`],TW=[`value`],EW={key:3,class:`flex flex-wrap items-center gap-1 pt-0.5`},DW=[`onClick`],OW=[`onClick`],kW={key:2,class:`divide-y divide-border rounded-md border border-border`},AW=[`title`],jW=[`value`,`onChange`],MW=[`value`],NW=[`value`,`onInput`],PW=[`value`,`onFocus`,`onInput`],FW=[`title`],IW={key:0,class:`text-xs text-danger`},LW={class:`space-y-2`},RW={class:`divide-y divide-border rounded-md border border-border`},zW={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},BW=[`value`],VW={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},HW=[`value`],UW={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},WW=[`value`],GW={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},KW={class:`flex items-center border-t border-border px-4 py-2.5`},qW=n({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=M(()=>BU(n.yaml,n.path)??{}),a=M(()=>typeof i.value.type==`string`?i.value.type:``),o=M(()=>n.vocabulary.find(e=>e.name===a.value)),s=M(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),c=M(()=>KU(n.yaml,n.path)),u=M(()=>o.value?.settings&&i.value.settings?nW(i.value.settings,o.value.settings,`settings`):``),d=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],f=/mission|body|detail|plan|rules/;function p(e,t){return t.type===`string`?t.enum?`select`:f.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 m=M(()=>{let e=Object.entries(o.value?.settings?.properties??{}).map(([e,t])=>({key:e,schema:t,kind:p(e,t)})),t=e.filter(e=>d.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>d.indexOf(e.key)-d.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function h(e){let{id:t,type:i,...a}=e;r(`update:yaml`,VU(n.yaml,n.path,{id:t,type:i,...a}))}function g(e,t){h({...i.value,[e]:t})}function _(e){g(`retry`,{...i.value.retry,...e})}function v(e,t){h({...i.value,settings:{...s.value,[e]:t}})}let y=W(null);function b(e,t){let n=y.value??m.value.lead?.key;if(!n)return;let r=typeof s.value[n]==`string`?s.value[n]:``,i=`{{ steps.${e}.${t} }}`;v(n,r?`${r.trimEnd()} ${i}`:i)}let x=W({});function S(e,t){try{v(e,t.trim()?SU(t):void 0),x.value={...x.value,[e]:``}}catch(t){x.value={...x.value,[e]:String(t.message).split(`
`)[0]}}}let ee=e=>e===void 0?``:CU(e).trimEnd(),w=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),T=e=>typeof s.value[e]==`string`?s.value[e]:``;return(e,t)=>(P(),V(`aside`,mW,[B(`header`,hW,[B(`span`,gW,[(P(),U(ye(F(RU)(a.value)),{class:`size-4`}))]),B(`div`,_W,[B(`input`,{value:i.value.id??``,class:`w-full truncate bg-transparent text-sm font-medium outline-none placeholder:text-fg-subtle focus:underline`,placeholder:F(kU)(a.value),"aria-label":`Step id`,onInput:t[0]||=e=>g(`id`,e.target.value)},null,40,vW),B(`div`,yW,L(a.value),1)]),O(F(q),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:t[1]||=e=>r(`close`)},{default:C(()=>[O(F(oi))]),_:1})]),B(`div`,bW,[u.value?(P(),V(`p`,xW,L(u.value),1)):N(``,!0),m.value.lead?(P(),V(`section`,SW,[B(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:m.value.lead.schema.description},[l(L(w(m.value.lead.key,m.value.lead.schema))+` `,1),m.value.lead.schema.description?(P(),U(F(_r),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,CW),m.value.lead.kind===`select`?(P(),V(`select`,{key:0,class:`h-9 w-full rounded-md border border-input bg-background px-2`,value:T(m.value.lead.key),onChange:t[2]||=e=>v(m.value.lead.key,e.target.value||void 0)},[t[13]||=B(`option`,{value:``},`Default`,-1),(P(!0),V(R,null,H(m.value.lead.schema.enum,e=>(P(),V(`option`,{key:e,value:e},L(e),9,TW))),128))],40,wW)):m.value.lead.kind===`text`?(P(),U(F(mh),{key:1,"model-value":T(m.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:t[3]||=e=>y.value=m.value.lead.key,"onUpdate:modelValue":t[4]||=e=>v(m.value.lead.key,String(e))},null,8,[`model-value`])):(P(),U(F(J),{key:2,"model-value":T(m.value.lead.key),onFocus:t[5]||=e=>y.value=m.value.lead.key,"onUpdate:modelValue":t[6]||=e=>v(m.value.lead.key,String(e))},null,8,[`model-value`])),c.value.length&&m.value.lead.kind!==`select`?(P(),V(`div`,EW,[t[14]||=B(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(P(!0),V(R,null,H(c.value,e=>(P(),V(R,{key:e},[B(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>b(e,`summary`)},L(e),9,DW),B(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>b(e,`result`)},L(e)+`.result`,9,OW)],64))),128))])):N(``,!0)])):N(``,!0),m.value.compact.length?(P(),V(`section`,kW,[(P(!0),V(R,null,H(m.value.compact,e=>(P(),V(`div`,{key:e.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[B(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:e.schema.description},[l(L(w(e.key,e.schema))+` `,1),e.schema.description?(P(),U(F(_r),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,AW),e.kind===`boolean`?(P(),U(F(sb),{key:0,"model-value":s.value[e.key]===!0,"onUpdate:modelValue":t=>v(e.key,t||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`select`?(P(),V(`select`,{key:1,class:`h-7 max-w-40 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:T(e.key),onChange:t=>v(e.key,t.target.value||void 0)},[t[15]||=B(`option`,{value:``},`Default`,-1),(P(!0),V(R,null,H(e.schema.enum,e=>(P(),V(`option`,{key:e,value:e},L(e),9,MW))),128))],40,jW)):e.kind===`number`?(P(),V(`input`,{key:2,type:`number`,class:`h-7 w-24 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:s.value[e.key]??``,onInput:t=>v(e.key,t.target.value===``?void 0:Number(t.target.value))},null,40,NW)):(P(),V(`input`,{key:3,class:`h-7 w-40 rounded-md border border-input bg-background px-2 text-[13px]`,value:T(e.key),onFocus:t=>y.value=e.key,onInput:t=>v(e.key,t.target.value)},null,40,PW))]))),128))])):N(``,!0),(P(!0),V(R,null,H(m.value.long,e=>(P(),V(`section`,{key:e.key,class:`space-y-1.5`},[B(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:e.schema.description},[l(L(w(e.key,e.schema))+` `,1),e.schema.description?(P(),U(F(_r),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,FW),e.kind===`text`?(P(),U(F(mh),{key:0,"model-value":T(e.key),class:`min-h-20 text-[13px]`,onFocus:t=>y.value=e.key,"onUpdate:modelValue":t=>v(e.key,String(t))},null,8,[`model-value`,`onFocus`,`onUpdate:modelValue`])):e.kind===`lines`?(P(),U(F(mh),{key:1,"model-value":Array.isArray(s.value[e.key])?s.value[e.key].join(`
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>v(e.key,String(t).split(`
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(F(),N(U,{key:2},[G(k(mh),{"model-value":C(s.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>S(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),x.value[e.key]?(F(),N(`span`,IW,B(x.value[e.key]),1)):I(``,!0)],64))]))),128)),V(`section`,LW,[t[21]||=V(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),V(`div`,RW,[V(`label`,zW,[t[16]||=V(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),V(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:t[7]||=e=>g(`when`,e.target.value)},null,40,BW)]),V(`label`,VW,[t[18]||=V(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),V(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:t[8]||=e=>g(`on_failure`,e.target.value||void 0)},[...t[17]||=[V(`option`,{value:``},`Park the task`,-1),V(`option`,{value:`continue`},`Continue`,-1)]],40,HW)]),V(`label`,UW,[t[19]||=V(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),V(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:t[9]||=e=>_({attempts:e.target.value===``?void 0:Number(e.target.value)})},null,40,WW)]),V(`label`,GW,[t[20]||=V(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),G(k(Xy),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":t[10]||=e=>_({backoff:e||void 0})},null,8,[`model-value`])])])])]),V(`footer`,KW,[G(k(z),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:t[11]||=e=>r(`remove`)},{default:A(()=>[G(k(Xr)),t[22]||=f(` Delete step`,-1)]),_:1}),G(k(z),{type:`button`,size:`sm`,class:`ml-auto`,onClick:t[12]||=e=>r(`close`)},{default:A(()=>[...t[23]||=[f(`Done`,-1)]]),_:1})])]))}}),JW=`repository_path`;function YW(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:JW,path:n.trim(),type:`string`,required:!0}),r}function XW(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function ZW(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=XW(Ww(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function QW(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:Ww(e.value,i.type??`string`)})}return n}function $W(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function eG(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...eG(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...eG(n,r)]}):[]}function tG(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function nG(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function rG(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var iG={class:`flex h-full flex-col`},aG={class:`flex items-center gap-2 border-b border-border px-4 py-3`},oG={class:`min-w-0 flex-1 truncate text-sm font-medium`},sG={key:0,class:`flex flex-1 items-center justify-center`},cG={class:`space-y-1.5`},lG=[`disabled`],uG=[`value`],dG={key:1,class:`space-y-1.5`},fG=[`value`],pG=[`title`],mG={class:`space-y-1.5`},hG={id:`bind-paths`},gG=[`value`],_G={class:`divide-y divide-border rounded-md border border-border`},vG={class:`flex items-center gap-1.5 text-xs`},yG={class:`font-mono`},bG={class:`text-fg-subtle`},xG={key:0,class:`text-danger`,title:`Required`},SG=[`title`,`aria-label`,`onClick`],CG=[`onUpdate:modelValue`,`aria-label`],wG=[`onUpdate:modelValue`,`aria-label`],TG={key:2,class:`text-xs text-danger`},EG=[`title`],DG={key:0,class:`space-y-1 px-3 py-2`},OG={key:0,class:`text-xs text-danger`},kG={key:1,class:`truncate font-mono text-xs text-success`},AG={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},jG={class:`space-y-2`},MG={key:0,role:`alert`,class:`text-xs text-danger`},NG={key:1,class:`texLine truncated
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(P(),V(R,{key:2},[O(F(mh),{"model-value":ee(s.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>S(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),x.value[e.key]?(P(),V(`span`,IW,L(x.value[e.key]),1)):N(``,!0)],64))]))),128)),B(`section`,LW,[t[21]||=B(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),B(`div`,RW,[B(`label`,zW,[t[16]||=B(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),B(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:t[7]||=e=>g(`when`,e.target.value)},null,40,BW)]),B(`label`,VW,[t[18]||=B(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),B(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:t[8]||=e=>g(`on_failure`,e.target.value||void 0)},[...t[17]||=[B(`option`,{value:``},`Park the task`,-1),B(`option`,{value:`continue`},`Continue`,-1)]],40,HW)]),B(`label`,UW,[t[19]||=B(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),B(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:t[9]||=e=>_({attempts:e.target.value===``?void 0:Number(e.target.value)})},null,40,WW)]),B(`label`,GW,[t[20]||=B(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),O(F(Xy),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":t[10]||=e=>_({backoff:e||void 0})},null,8,[`model-value`])])])])]),B(`footer`,KW,[O(F(q),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:t[11]||=e=>r(`remove`)},{default:C(()=>[O(F(Xr)),t[22]||=l(` Delete step`,-1)]),_:1}),O(F(q),{type:`button`,size:`sm`,class:`ml-auto`,onClick:t[12]||=e=>r(`close`)},{default:C(()=>[...t[23]||=[l(`Done`,-1)]]),_:1})])]))}}),JW=`repository_path`;function YW(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:JW,path:n.trim(),type:`string`,required:!0}),r}function XW(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function ZW(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=XW(Ww(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function QW(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:Ww(e.value,i.type??`string`)})}return n}function $W(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function eG(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...eG(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...eG(n,r)]}):[]}function tG(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function nG(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function rG(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var iG={class:`flex h-full flex-col`},aG={class:`flex items-center gap-2 border-b border-border px-4 py-3`},oG={class:`min-w-0 flex-1 truncate text-sm font-medium`},sG={key:0,class:`flex flex-1 items-center justify-center`},cG={class:`space-y-1.5`},lG=[`disabled`],uG=[`value`],dG={key:1,class:`space-y-1.5`},fG=[`value`],pG=[`title`],mG={class:`space-y-1.5`},hG={id:`bind-paths`},gG=[`value`],_G={class:`divide-y divide-border rounded-md border border-border`},vG={class:`flex items-center gap-1.5 text-xs`},yG={class:`font-mono`},bG={class:`text-fg-subtle`},xG={key:0,class:`text-danger`,title:`Required`},SG=[`title`,`aria-label`,`onClick`],CG=[`onUpdate:modelValue`,`aria-label`],wG=[`onUpdate:modelValue`,`aria-label`],TG={key:2,class:`text-xs text-danger`},EG=[`title`],DG={key:0,class:`space-y-1 px-3 py-2`},OG={key:0,class:`text-xs text-danger`},kG={key:1,class:`truncate font-mono text-xs text-success`},AG={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},jG={class:`space-y-2`},MG={key:0,role:`alert`,class:`text-xs text-danger`},NG={key:1,class:`teLine 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 E$(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=D$(n.code,e);return Array.isArray(e)?e.some(e=>T$(n[r],e,t,n.type===`keyup`)):T$(n[r],e,t,n.type===`keyup`)}}function D$(e,t){return t.includes(e)?`code`:`key`}function O$(e,t){let n=H(()=>d(t?.target)??S$),r=mn(d(e)===!0),i=!1,a=new Set,o=c(d(e));q(()=>d(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),bq([`blur`,`contextmenu`],s),Sq((...e)=>o(...e),e=>{let n=d(t?.actInsideInputWithModifier)??!0,a=d(t?.preventDefault)??!1;if(i=w$(e),(!i||i&&!n)&&C$(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}),Sq((...e)=>o(...e),e=>{let n=d(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&C$(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=d(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?E$(e,a):e}return r}var k$=`vue-flow__node-desc`,A$=`vue-flow__edge-desc`,j$=`vue-flow__aria-live`,M$=[`Enter`,` `,`Escape`],N$={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function P$(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function F$(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 I$(e){return{width:e.offsetWidth,height:e.offsetHeight}}function L$(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function R$(e,t){return{x:L$(e.x,t[0][0],t[1][0]),y:L$(e.y,t[0][1],t[1][1])}}function z$(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function B$(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function V$(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!B$(e)}function H$(e){return V$(e)&&`computedPosition`in e}function U$(e){return!Number.isNaN(e)&&Number.isFinite(e)}function W$(e){return U$(e.width)&&U$(e.height)&&U$(e.x)&&U$(e.y)}function G$(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:Lt({width:0,height:0}),computedPosition:Lt({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:s0(e.data)?e.data:{},events:Lt(s0(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function K$(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:s0(e.data)?e.data:{},events:Lt(s0(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function q$(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 J$(...e){if(e.length===3){let[t,n,r]=e;return q$(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>B$(e)&&e.source===r).map(e=>n.find(t=>V$(t)&&t.id===e.target))}function Y$(...e){if(e.length===3){let[t,n,r]=e;return q$(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>B$(e)&&e.target===r).map(e=>n.find(t=>V$(t)&&t.id===e.source))}function X$({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function Z$(e,t){return t.some(t=>B$(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 Q$({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function $$({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?W1(s,o):s}function e1(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 t1({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function n1({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function r1(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=e1(t,t1({...r.computedPosition,...r.dimensions}))}return n1(t)}function i1(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...$$(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=!1}=t,c= 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 E$(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=D$(n.code,e);return Array.isArray(e)?e.some(e=>T$(n[r],e,t,n.type===`keyup`)):T$(n[r],e,t,n.type===`keyup`)}}function D$(e,t){return t.includes(e)?`code`:`key`}function O$(e,t){let n=M(()=>u(t?.target)??S$),r=ge(u(e)===!0),i=!1,a=new Set,o=c(u(e));j(()=>u(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),bq([`blur`,`contextmenu`],s),Sq((...e)=>o(...e),e=>{let n=u(t?.actInsideInputWithModifier)??!0,a=u(t?.preventDefault)??!1;if(i=w$(e),(!i||i&&!n)&&C$(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}),Sq((...e)=>o(...e),e=>{let n=u(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&C$(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=u(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?E$(e,a):e}return r}var k$=`vue-flow__node-desc`,A$=`vue-flow__edge-desc`,j$=`vue-flow__aria-live`,M$=[`Enter`,` `,`Escape`],N$={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function P$(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function F$(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 I$(e){return{width:e.offsetWidth,height:e.offsetHeight}}function L$(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function R$(e,t){return{x:L$(e.x,t[0][0],t[1][0]),y:L$(e.y,t[0][1],t[1][1])}}function z$(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function B$(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function V$(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!B$(e)}function H$(e){return V$(e)&&`computedPosition`in e}function U$(e){return!Number.isNaN(e)&&Number.isFinite(e)}function W$(e){return U$(e.width)&&U$(e.height)&&U$(e.x)&&U$(e.y)}function G$(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:bt({width:0,height:0}),computedPosition:bt({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:s0(e.data)?e.data:{},events:bt(s0(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function K$(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:s0(e.data)?e.data:{},events:bt(s0(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function q$(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 J$(...e){if(e.length===3){let[t,n,r]=e;return q$(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>B$(e)&&e.source===r).map(e=>n.find(t=>V$(t)&&t.id===e.target))}function Y$(...e){if(e.length===3){let[t,n,r]=e;return q$(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>B$(e)&&e.target===r).map(e=>n.find(t=>V$(t)&&t.id===e.source))}function X$({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function Z$(e,t){return t.some(t=>B$(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 Q$({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function $$({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?W1(s,o):s}function e1(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 t1({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function n1({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function r1(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=e1(t,t1({...r.computedPosition,...r.dimensions}))}return n1(t)}function i1(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...$$(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=!1}=t,c= 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}
@@ -149,4 +149,4 @@ 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`},R1=class extends Error{constructor(e,...t){super(L1[e]?.call(L1,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function z1(e){return`clientX`in e}function B1(e){return`sourceEvent`in e}function V1(e,t){let n=z1(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 H1=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function U1(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function W1(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var G1=()=>!0;function K1(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function q1(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())F$(i,P$(e))>0&&r.push(e);return r}var J1=250;function Y1(e,t,n,r){let i=[],a=1/0,o=q1(e,n,t+J1);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}=M1(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 X1(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=G1},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:_}=V1(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=Z1(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===_$.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=e0(t,e,a,p,n,!0)}return b}function Z1(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Q1(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function $1(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function e0(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===_$.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,...M1(o,c,c.position,!0)}:c}var t0={[m$.Left]:m$.Right,[m$.Right]:m$.Left,[m$.Top]:m$.Bottom,[m$.Bottom]:m$.Top},n0=[`production`,`prod`];function r0(e,...t){i0()&&console.warn(`[Vue Flow]: ${e}`,...t)}function i0(){return!n0.includes(`production`)}function a0(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,...I$(t)}}):null}function o0(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),Oe(()=>{o.blur()})):n([e])}function s0(e){return k(e)!==void 0}function c0(e,t,n,r){if(!e||!e.source||!e.target)return n(new R1(I1.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=B$(e)?e:{...e,id:X$(e)},i=K$(i,void 0,r),!Z$(i,t)&&i}function l0(e,t,n,r,i){if(!t.source||!t.target)return i(new R1(I1.EDGE_INVALID,e.id)),!1;if(!n)return i(new R1(I1.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?X$(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function u0(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!V$(o)){n(new R1(I1.NODE_INVALID,o?.id));continue}let s=G$(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 R1(I1.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 d0(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 f0(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}`;d0(`source`,o,`${r}-${a}--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`},R1=class extends Error{constructor(e,...t){super(L1[e]?.call(L1,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function z1(e){return`clientX`in e}function B1(e){return`sourceEvent`in e}function V1(e,t){let n=z1(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 H1=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function U1(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function W1(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var G1=()=>!0;function K1(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function q1(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())F$(i,P$(e))>0&&r.push(e);return r}var J1=250;function Y1(e,t,n,r){let i=[],a=1/0,o=q1(e,n,t+J1);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}=M1(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 X1(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=G1},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:_}=V1(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=Z1(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===_$.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=e0(t,e,a,p,n,!0)}return b}function Z1(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Q1(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function $1(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function e0(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===_$.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,...M1(o,c,c.position,!0)}:c}var t0={[m$.Left]:m$.Right,[m$.Right]:m$.Left,[m$.Top]:m$.Bottom,[m$.Bottom]:m$.Top},n0=[`production`,`prod`];function r0(e,...t){i0()&&console.warn(`[Vue Flow]: ${e}`,...t)}function i0(){return!n0.includes(`production`)}function a0(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,...I$(t)}}):null}function o0(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),ht(()=>{o.blur()})):n([e])}function s0(e){return F(e)!==void 0}function c0(e,t,n,r){if(!e||!e.source||!e.target)return n(new R1(I1.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=B$(e)?e:{...e,id:X$(e)},i=K$(i,void 0,r),!Z$(i,t)&&i}function l0(e,t,n,r,i){if(!t.source||!t.target)return i(new R1(I1.EDGE_INVALID,e.id)),!1;if(!n)return i(new R1(I1.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?X$(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function u0(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!V$(o)){n(new R1(I1.NODE_INVALID,o?.id));continue}let s=G$(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 R1(I1.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 d0(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 f0(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}`;d0(`source`,o,`${r}-${a}--Line truncated
+1
View File
@@ -34,6 +34,7 @@
</script>
<script type="module" crossorigin src="/assets/index.js"></script>
<link rel="modulepreload" crossorigin href="/assets/PageHeader.js">
<link rel="modulepreload" crossorigin href="/assets/badge.js">
<link rel="modulepreload" crossorigin href="/assets/HistoryLink.js">
<link rel="stylesheet" crossorigin href="/assets/index.css">
</head>
+11
View File
@@ -0,0 +1,11 @@
<script setup lang="ts">
import PageHeader from "./PageHeader.vue";
</script>
<template>
<div>
<PageHeader title="Page not found" />
<p class="mb-4 text-sm text-fg-muted">This address does not match a page.</p>
<RouterLink to="/" class="text-sm underline">Return to dashboard</RouterLink>
</div>
</template>
+7 -1
View File
@@ -119,7 +119,7 @@ const routes = [
settings: true,
label: "Status",
description:
"Update state, configuration sources, and the listen address.",
"Service presence, dependency health, and build versions.",
section: "settings",
},
},
@@ -395,6 +395,12 @@ const routes = [
label: "Settings",
},
},
{
path: "/:pathMatch(.*)*",
name: "not-found",
component: () => import("@/base/NotFoundPage.vue"),
meta: { nav: false },
},
// Paths from before Settings existed, kept for bookmarks and chat history.
...Object.entries({
"/system/status": "/settings/status",