litepaseo 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/server/cli.mjs +650 -91
- package/dist/web/assets/CodeBlockNode-CehKIzSk.js +3 -0
- package/dist/web/assets/CodeBlockNode-CehKIzSk.js.br +0 -0
- package/dist/web/assets/CodeBlockNode-CehKIzSk.js.gz +0 -0
- package/dist/web/assets/FileViewer-01t53KTX.js +2 -0
- package/dist/web/assets/FileViewer-01t53KTX.js.br +0 -0
- package/dist/web/assets/FileViewer-01t53KTX.js.gz +0 -0
- package/dist/web/assets/FileViewer-CljYTF8J.css +1 -0
- package/dist/web/assets/FileViewer-CljYTF8J.css.br +0 -0
- package/dist/web/assets/FileViewer-CljYTF8J.css.gz +0 -0
- package/dist/web/assets/FilesPanel-B7NknFvl.js +1 -0
- package/dist/web/assets/FilesPanel-B7NknFvl.js.br +0 -0
- package/dist/web/assets/FilesPanel-B7NknFvl.js.gz +0 -0
- package/dist/web/assets/FilesPanel-CY9yMixJ.css +1 -0
- package/dist/web/assets/FilesPanel-CY9yMixJ.css.br +0 -0
- package/dist/web/assets/FilesPanel-CY9yMixJ.css.gz +0 -0
- package/dist/web/assets/MarkdownMessage-UlvozPc5.js +199 -0
- package/dist/web/assets/MarkdownMessage-UlvozPc5.js.br +0 -0
- package/dist/web/assets/MarkdownMessage-UlvozPc5.js.gz +0 -0
- package/dist/web/assets/{PreCodeBlock-B2Mi6ata.js → PreCodeBlock-DPQTlYty.js} +1 -1
- package/dist/web/assets/{PreCodeBlock.vue_vue_type_style_index_0_lang-Twzt_rFe.js → PreCodeBlock.vue_vue_type_style_index_0_lang-Cdy-YZRP.js} +1 -1
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-Cdy-YZRP.js.br +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-Cdy-YZRP.js.gz +0 -0
- package/dist/web/assets/TerminalPanel-BdmAonFr.js +3 -0
- package/dist/web/assets/TerminalPanel-BdmAonFr.js.br +0 -0
- package/dist/web/assets/TerminalPanel-BdmAonFr.js.gz +0 -0
- package/dist/web/assets/TerminalPanel-DvfBWyiQ.css +1 -0
- package/dist/web/assets/TerminalPanel-DvfBWyiQ.css.br +0 -0
- package/dist/web/assets/TerminalPanel-DvfBWyiQ.css.gz +0 -0
- package/dist/web/assets/Tooltip-BJ2o2M_0.js +1 -0
- package/dist/web/assets/Tooltip-BJ2o2M_0.js.br +0 -0
- package/dist/web/assets/Tooltip-BJ2o2M_0.js.gz +0 -0
- package/dist/web/assets/addon-fit-DIOBYJe3.js +1 -0
- package/dist/web/assets/addon-fit-DIOBYJe3.js.br +0 -0
- package/dist/web/assets/addon-fit-DIOBYJe3.js.gz +0 -0
- package/dist/web/assets/index-D_YTh7Zw.css +1 -0
- package/dist/web/assets/index-D_YTh7Zw.css.br +0 -0
- package/dist/web/assets/index-D_YTh7Zw.css.gz +0 -0
- package/dist/web/assets/index-civcSERr.js +27 -0
- package/dist/web/assets/index-civcSERr.js.br +0 -0
- package/dist/web/assets/index-civcSERr.js.gz +0 -0
- package/dist/web/assets/index10-WpTfisco.js +6 -0
- package/dist/web/assets/index10-WpTfisco.js.br +0 -0
- package/dist/web/assets/index10-WpTfisco.js.gz +0 -0
- package/dist/web/assets/index3-C4yf5W5o.js +1 -0
- package/dist/web/assets/index4-Cwl0ij4U.js +1 -0
- package/dist/web/assets/index5-BCbIyN1t.js +1 -0
- package/dist/web/assets/index5-BCbIyN1t.js.br +0 -0
- package/dist/web/assets/index5-BCbIyN1t.js.gz +0 -0
- package/dist/web/assets/{index6-DczfWbCr.js → index6-CbdnTDhy.js} +1 -1
- package/dist/web/assets/index6-CbdnTDhy.js.br +0 -0
- package/dist/web/assets/index6-CbdnTDhy.js.gz +0 -0
- package/dist/web/assets/index7-BzNzdNxO.js +2 -0
- package/dist/web/assets/index7-BzNzdNxO.js.br +0 -0
- package/dist/web/assets/index7-BzNzdNxO.js.gz +0 -0
- package/dist/web/assets/index8-CD8jmACo.js +2 -0
- package/dist/web/assets/index8-CD8jmACo.js.br +0 -0
- package/dist/web/assets/index8-CD8jmACo.js.gz +0 -0
- package/dist/web/assets/index9-9FYLmtt9.js +1 -0
- package/dist/web/assets/index9-9FYLmtt9.js.br +0 -0
- package/dist/web/assets/index9-9FYLmtt9.js.gz +0 -0
- package/dist/web/assets/{vue.runtime.esm-bundler-HH4C0BYQ.js → vue.runtime.esm-bundler-D6xZ1zFq.js} +1 -1
- package/dist/web/assets/vue.runtime.esm-bundler-D6xZ1zFq.js.br +0 -0
- package/dist/web/assets/{vue.runtime.esm-bundler-HH4C0BYQ.js.gz → vue.runtime.esm-bundler-D6xZ1zFq.js.gz} +0 -0
- package/dist/web/assets/xterm-BMsy1fDS.js +16 -0
- package/dist/web/assets/xterm-BMsy1fDS.js.br +0 -0
- package/dist/web/assets/xterm-BMsy1fDS.js.gz +0 -0
- package/dist/web/icons/apple-touch-icon.png +0 -0
- package/dist/web/icons/badge-96.png +0 -0
- package/dist/web/icons/badge.svg +1 -0
- package/dist/web/icons/badge.svg.br +0 -0
- package/dist/web/icons/badge.svg.gz +0 -0
- package/dist/web/icons/favicon-64.png +0 -0
- package/dist/web/icons/favicon-attention-64.png +0 -0
- package/dist/web/icons/favicon-running-64.png +0 -0
- package/dist/web/icons/favicon-unread-64.png +0 -0
- package/dist/web/icons/icon-192.png +0 -0
- package/dist/web/icons/icon-512.png +0 -0
- package/dist/web/icons/mark.svg +9 -0
- package/dist/web/icons/mark.svg.br +0 -0
- package/dist/web/icons/mark.svg.gz +0 -0
- package/dist/web/icons/maskable-512.png +0 -0
- package/dist/web/index.html +5 -4
- package/dist/web/index.html.br +0 -0
- package/dist/web/index.html.gz +0 -0
- package/dist/web/manifest.webmanifest +2 -2
- package/docs/operations.md +2 -2
- package/package.json +3 -1
- package/dist/web/assets/CodeBlockNode-CHQVlCcV.js +0 -3
- package/dist/web/assets/CodeBlockNode-CHQVlCcV.js.br +0 -0
- package/dist/web/assets/CodeBlockNode-CHQVlCcV.js.gz +0 -0
- package/dist/web/assets/MarkdownMessage-IYvqW4k2.js +0 -199
- package/dist/web/assets/MarkdownMessage-IYvqW4k2.js.br +0 -0
- package/dist/web/assets/MarkdownMessage-IYvqW4k2.js.gz +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-Twzt_rFe.js.br +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-Twzt_rFe.js.gz +0 -0
- package/dist/web/assets/Tooltip-CKXNC_qW.js +0 -1
- package/dist/web/assets/Tooltip-CKXNC_qW.js.br +0 -0
- package/dist/web/assets/Tooltip-CKXNC_qW.js.gz +0 -0
- package/dist/web/assets/index-DKzFEex_.js +0 -11
- package/dist/web/assets/index-DKzFEex_.js.br +0 -0
- package/dist/web/assets/index-DKzFEex_.js.gz +0 -0
- package/dist/web/assets/index-D_IXICNJ.css +0 -1
- package/dist/web/assets/index-D_IXICNJ.css.br +0 -0
- package/dist/web/assets/index-D_IXICNJ.css.gz +0 -0
- package/dist/web/assets/index10-tc5-49RH.js +0 -6
- package/dist/web/assets/index10-tc5-49RH.js.br +0 -0
- package/dist/web/assets/index10-tc5-49RH.js.gz +0 -0
- package/dist/web/assets/index3-C0ZPykQc.js +0 -1
- package/dist/web/assets/index4-D1FQ6lkb.js +0 -1
- package/dist/web/assets/index5-SOHOEHRz.js +0 -1
- package/dist/web/assets/index5-SOHOEHRz.js.br +0 -0
- package/dist/web/assets/index5-SOHOEHRz.js.gz +0 -0
- package/dist/web/assets/index6-DczfWbCr.js.br +0 -0
- package/dist/web/assets/index6-DczfWbCr.js.gz +0 -0
- package/dist/web/assets/index7-CzZrkyqI.js +0 -2
- package/dist/web/assets/index7-CzZrkyqI.js.br +0 -0
- package/dist/web/assets/index7-CzZrkyqI.js.gz +0 -0
- package/dist/web/assets/index8-g00UcLGR.js +0 -2
- package/dist/web/assets/index8-g00UcLGR.js.br +0 -0
- package/dist/web/assets/index8-g00UcLGR.js.gz +0 -0
- package/dist/web/assets/index9-EOMgiANd.js +0 -1
- package/dist/web/assets/index9-EOMgiANd.js.br +0 -0
- package/dist/web/assets/index9-EOMgiANd.js.gz +0 -0
- package/dist/web/assets/vue.runtime.esm-bundler-HH4C0BYQ.js.br +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,C as t,G as n,K as r,P as i,U as a,Z as o,b as s,c,f as l,h as u,it as d,k as f,m as p,n as m,rt as h,tt as g,x as _}from"./vue.runtime.esm-bundler-HH4C0BYQ.js";import{v}from"./MarkdownMessage-IYvqW4k2.js";import{n as y}from"./index-DKzFEex_.js";var b=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),x=[`id`],S=[`data-placement`],C=v(t({__name:`Tooltip`,props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(t){let v=t,C=o(null),w=o(null),T=o({transform:`translate3d(0px, 0px, 0px)`,left:`0px`,top:`0px`}),E=o({}),D=o(v.placement??`top`),O=o(!1),k=null,A=null,j=null,M=null,N=null,P=0;function F(){return M?Promise.resolve(M):(N||=y(()=>import(`./floating-ui.dom-WZBoikmf.js`).then(e=>(M=e,e)),[]).catch(e=>{throw N=null,e}),N)}function I(){k&&=(k(),null),A=null,j=null}function L(e){return b(this,null,function*(){let t=v.anchorEl,n=C.value;if(!v.visible||!t||!n||A===t&&j===n)return;let{autoUpdate:r}=yield F();e()&&v.visible&&v.anchorEl===t&&C.value===n&&(I(),A=t,j=n,k=r(t,n,()=>{R().catch(()=>{z()})}))})}function R(){return b(this,null,function*(){let e=v.anchorEl,t=C.value;if(!v.visible||!e||!t)return!1;let{arrow:n,computePosition:r,flip:i,offset:a,shift:o}=yield F();if(!v.visible||v.anchorEl!==e||C.value!==t)return!1;let s=[a(v.offset??6),i(),o({padding:6}),...w.value?[n({element:w.value,padding:4})]:[]],{x:c,y:l,placement:u,middlewareData:d}=yield r(e,t,{placement:v.placement??`top`,middleware:s,strategy:`fixed`});if(!v.visible||v.anchorEl!==e||C.value!==t)return!1;if(T.value.transform=`translate3d(${Math.round(c)}px, ${Math.round(l)}px, 0)`,T.value.left=`0px`,T.value.top=`0px`,D.value=u,d.arrow&&w.value){let{x:e,y:t}=d.arrow,n={top:`bottom`,bottom:`top`,left:`right`,right:`left`}[u.split(`-`)[0]];E.value={left:e==null?``:`${e}px`,top:t==null?``:`${t}px`,[n]:`-3px`}}return!0})}function z(){let e=v.anchorEl,t=C.value;if(!e||!t)return!1;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=v.offset??6,a=v.placement??`top`,o=n.left,s=n.top;return a===`bottom`?s=n.bottom+i:a===`left`?o=n.left-r.width-i:a===`right`?o=n.right+i:s=n.top-r.height-i,T.value.transform=`translate3d(${Math.round(Math.max(0,o))}px, ${Math.round(Math.max(0,s))}px, 0)`,T.value.left=`0px`,T.value.top=`0px`,D.value=a,E.value={},!0}a(()=>v.visible,e=>b(null,null,function*(){let t=++P;if(e){if(O.value=!1,yield f(),t!==P||!v.visible)return;if(v.anchorEl&&C.value)try{let e=v.anchorEl,n=C.value,r=e.getBoundingClientRect();if(!(yield R())||t!==P||!v.visible||v.anchorEl!==e||C.value!==n)return;let i=T.value.transform;if(v.originX!=null&&v.originY!=null){let e=Math.abs(Number(v.originX)-r.left),n=Math.abs(Number(v.originY)-r.top);if(Math.hypot(e,n)>120){if(T.value.transform=`translate3d(${Math.round(v.originX)}px, ${Math.round(v.originY)}px, 0)`,yield f(),t!==P||!v.visible||(O.value=!0,yield f(),t!==P||!v.visible))return;T.value.transform=i}else O.value=!0}else O.value=!0;yield L(()=>t===P)}catch{if(t!==P||!v.visible)return;if(O.value=z(),v.anchorEl&&C.value)try{yield L(()=>t===P)}catch{}}else O.value=!0}else O.value=!1,I()}));let B=0;return a([()=>v.anchorEl,()=>v.placement,()=>v.content],()=>b(null,null,function*(){let e=++B;if(v.visible&&v.anchorEl&&C.value){if(yield f(),e!==B||!v.visible||!v.anchorEl||!C.value)return;try{let t=yield R();if(e!==B||!v.visible||!v.anchorEl||!C.value)return;t||z()}catch{z()}yield L(()=>e===B)}})),e(()=>{P+=1,I()}),(e,a)=>(i(),u(l,{to:`body`},[p(`div`,{class:g([`markstream-vue`,{dark:t.isDark}])},[_(m,{name:`tooltip`,appear:``},{default:n(()=>[r(p(`div`,{id:v.id,ref_key:`tooltip`,ref:C,style:h({position:`fixed`,left:T.value.left,top:T.value.top,transform:T.value.transform,visibility:O.value?`visible`:`hidden`,pointerEvents:O.value?void 0:`none`}),class:`tooltip-element`,role:`tooltip`},[s(d(t.content)+` `,1),p(`div`,{ref_key:`arrowEl`,ref:w,class:`tooltip-arrow`,"data-placement":D.value,style:h(E.value)},null,12,S)],12,x),[[c,t.visible]])]),_:1})],2)]))}}),[[`__scopeId`,`data-v-c606ee4c`]]);export{C as default};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownMessage-IYvqW4k2.js","assets/vue.runtime.esm-bundler-HH4C0BYQ.js","assets/MarkdownMessage-bqphU8I9.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{B as e,C as t,D as n,F as r,J as i,K as a,L as o,M as s,P as c,Q as l,U as u,X as d,Z as f,_ as p,a as m,b as h,d as g,et as _,g as v,h as y,i as b,it as x,j as S,k as C,l as w,m as T,o as E,p as D,r as O,rt as k,s as A,tt as j,u as M,x as N}from"./vue.runtime.esm-bundler-HH4C0BYQ.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var P=e=>e?e.size:0,F=e=>(e.size=1+P(e.left)+P(e.right),e),I=class{root=null;compare;constructor(e){this.compare=e}get size(){return P(this.root)}clear(){this.root=null}insert(e){let[t,n]=this.split(this.root,e,!1),r={item:e,priority:Math.random(),size:1,left:null,right:null};this.root=this.merge(this.merge(t,r),n)}remove(e){let[t,n]=this.split(this.root,e,!1),[r,i]=this.split(n,e,!0);return this.root=this.merge(t,i),r!==null}at(e){let t=this.root;for(;t;){let n=P(t.left);if(e<n)t=t.left;else if(e===n)return t.item;else e-=n+1,t=t.right}}rank(e){let t=this.root,n=0;for(;t;){let r=this.compare(e,t.item);if(r<0)t=t.left;else if(r>0)n+=P(t.left)+1,t=t.right;else return n+P(t.left)}return-1}range(e,t){let n=[],r=Math.min(this.size,e+t);if(e=Math.max(0,e),e>=r)return n;let i=[],a=this.root,o=e;for(;a;){let e=P(a.left);if(o<e)i.push(a),a=a.left;else if(o===e){i.push(a);break}else o-=e+1,a=a.right}for(;n.length<r-e&&i.length;){let e=i.pop();n.push(e.item);let t=e.right;for(;t;)i.push(t),t=t.left}return n}split(e,t,n){if(!e)return[null,null];let r=this.compare(e.item,t);if(r<0||n&&r===0){let[r,i]=this.split(e.right,t,n);return e.right=r,[F(e),i]}let[i,a]=this.split(e.left,t,n);return e.left=a,[i,F(e)]}merge(e,t){return e?t?e.priority>t.priority?(e.right=this.merge(e.right,t),F(e)):(t.left=this.merge(e,t.left),F(t)):e:t}},L=e=>e?e.size:0,R=e=>e?e.sum:0,z=e=>(e.size=1+L(e.left)+L(e.right),e.sum=e.weight+R(e.left)+R(e.right),e),B=class{root=null;compare;constructor(e){this.compare=e}get size(){return L(this.root)}get total(){return R(this.root)}clear(){this.root=null}insert(e,t){let[n,r]=this.split(this.root,e,!1),i={item:e,weight:t,priority:Math.random(),size:1,sum:t,left:null,right:null};this.root=this.merge(this.merge(n,i),r)}remove(e){let[t,n]=this.split(this.root,e,!1),[r,i]=this.split(n,e,!0);return this.root=this.merge(t,i),r!==null}reweigh(e,t){this.remove(e)&&this.insert(e,t)}at(e){let t=this.root;for(;t;){let n=L(t.left);if(e<n)t=t.left;else if(e===n)return t.item;else e-=n+1,t=t.right}}locate(e){let t=this.root,n=0,r=0;if(!t)return null;for(e=Math.max(0,Math.min(e,this.total-1e-9));t;){let i=R(t.left);if(e<i)t=t.left;else if(e<i+t.weight||!t.right)return{item:t.item,rank:n+L(t.left),start:r+i};else e-=i+t.weight,r+=i+t.weight,n+=L(t.left)+1,t=t.right}return null}offsetOf(e){let t=this.root,n=0;for(;t;){let r=this.compare(e,t.item);if(r<0)t=t.left;else if(r>0)n+=R(t.left)+t.weight,t=t.right;else return n+R(t.left)}return-1}split(e,t,n){if(!e)return[null,null];let r=this.compare(e.item,t);if(r<0||n&&r===0){let[r,i]=this.split(e.right,t,n);return e.right=r,[z(e),i]}let[i,a]=this.split(e.left,t,n);return e.left=a,[i,z(e)]}merge(e,t){return e?t?e.priority>t.priority?(e.right=this.merge(e.right,t),z(e)):(t.left=this.merge(e,t.left),z(t)):e:t}},ee=[`needs_input`,`running`,`review`,`done`],V=e=>e===`failed`||e===`unread`?`review`:e,te=e=>/^[A-Z][a-z]/.test(e)?e[0].toLowerCase()+e.slice(1):e,H=(e,t)=>e.key<t.key?-1:+(e.key>t.key);function U(e,t){return t.activityAt-e.activityAt||H(e,t)}function ne(e,t){let n=e.pinnedAt??0,r=t.pinnedAt??0;return n||r?n?r?n-r||H(e,t):-1:1:U(e,t)}function re(e){return e.attention?`needs_input`:e.failed?`failed`:e.running?`running`:e.unread?`unread`:`done`}var W=e=>e.project.toLowerCase(),G=new Intl.Collator(void 0,{sensitivity:`base`,numeric:!0}),ie=(e,t)=>t.recent-e.recent||G.compare(e.name,t.name)||(e.key<t.key?-1:+(e.key>t.key)),ae=e=>e.state??(e.status===`running`?`running`:`done`),oe=class{flat;groups=new Map;index=new B(ie);lanes;waiting=0;compare;isCollapsed;constructor(e,t){this.compare=e,this.isCollapsed=t,this.flat=new I(e),this.lanes=new Map(ee.map(e=>[e,new I(U)]))}get size(){return this.flat.size}weight(e){return 36+(this.isCollapsed(e.key)?0:e.items.size*52)}add(e){this.flat.insert(e),this.lanes.get(V(ae(e))).insert(e);let t=W(e),n=this.groups.get(t);n?this.index.remove(n):(n={key:t,name:e.project,items:new I(this.compare),byRecency:this.compare===U?null:new I(U),recent:0,attention:0,failed:0,running:0,unread:0},this.groups.set(t,n)),n.items.insert(e),n.byRecency?.insert(e),this.count(n,e,1),this.reinsert(n)}remove(e){if(!this.flat.remove(e))return;this.lanes.get(V(ae(e))).remove(e);let t=this.groups.get(W(e));t&&(this.index.remove(t),t.items.remove(e),t.byRecency?.remove(e),this.count(t,e,-1),t.items.size?this.reinsert(t):this.groups.delete(t.key))}refresh(e){let t=this.groups.get(e);t&&this.index.reweigh(t,this.weight(t))}clear(){this.flat.clear(),this.groups.clear(),this.index.clear();for(let e of this.lanes.values())e.clear();this.waiting=0}rows(e,t){let n=[],r=e+t,i=this.index.locate(Math.max(0,e));if(!i)return n;let a=i.rank,o=i.start;for(;o<r;){let t=this.index.at(a++);if(!t)break;let i=this.isCollapsed(t.key);if(o+36>e&&n.push({kind:`group`,key:`g:`+t.key,top:o,group:t,collapsed:i}),!i){let i=o+36,a=Math.max(0,Math.floor((e-i)/52)),s=Math.min(t.items.size,Math.ceil((r-i)/52));s>a&&t.items.range(a,s-a).forEach((e,t)=>n.push({kind:`item`,key:e.key,top:i+(a+t)*52,item:e}))}o+=this.weight(t)}return n}reinsert(e){e.recent=(e.byRecency??e.items).at(0).activityAt,this.index.insert(e,this.weight(e))}count(e,t,n){t.attention&&(e.attention+=n,this.waiting+=n);let r=ae(t);r===`failed`?e.failed+=n:r===`running`?e.running+=n:r===`unread`&&(e.unread+=n)}},se=class{generation=``;seq=-1;byKey=new Map;collapsed;compare;all;byHost=new Map;host=null;filtered=null;predicate=null;persist;indexOf;buckets=new Map;version=l(0);constructor(e={}){this.collapsed=new Set(e.collapsed),this.persist=e.persist??(()=>{}),this.compare=e.compare??U,this.indexOf=e.indexBy??null,this.all=new oe(this.compare,this.collapsedFn)}collapsedFn=e=>this.collapsed.has(e);get base(){return this.host===null?this.all:this.hostView(this.host)}get view(){return this.filtered??this.base}hostView(e){let t=this.byHost.get(e);return t||this.byHost.set(e,t=new oe(this.compare,this.collapsedFn)),t}get size(){return this.view.size}get total(){return this.byKey.size}get waiting(){return this.all.waiting}get projectCount(){return this.view.groups.size}get hostFilter(){return this.host}hostSize(e){return this.byHost.get(e)?.size??0}get(e){return e?this.byKey.get(e):void 0}indexed(e,t=1){return e?this.buckets.get(e)?.range(0,t)??[]:[]}indexedSize(e){return e?this.buckets.get(e)?.size??0:0}range(e,t){return this.view.flat.range(e,t)}laneSize(e){return this.view.lanes.get(e).size}laneRange(e,t,n){return this.view.lanes.get(e).range(t,n)}get groupedHeight(){return this.view.index.total}groupedRows(e,t){return this.view.rows(e,t)}isCollapsed(e){return!this.filtered&&this.collapsed.has(e)}toggleGroup(e){if(!this.filtered){this.collapsed.has(e)?this.collapsed.delete(e):this.collapsed.add(e),this.all.refresh(e);for(let t of this.byHost.values())t.refresh(e);this.persist([...this.collapsed]),this.version.value++}}setHost(e){e!==this.host&&(this.host=e,this.predicate&&this.rebuildFiltered(),this.version.value++)}setFilter(e){this.predicate=e,e?this.rebuildFiltered():this.filtered=null,this.version.value++}applyCollection(e){if(e.type===`snapshot`){this.byKey.clear(),this.all.clear();for(let e of this.byHost.values())e.clear();this.filtered?.clear(),this.buckets.clear();for(let t of e.items)this.put(t)}else{if(e.generation!==this.generation)return;for(let t of e.changes){let e=this.byKey.get(t.key);e&&(this.all.remove(e),this.byHost.get(e.hostId)?.remove(e),this.filtered?.remove(e),this.unbucket(e)),t.value?this.put(t.value):this.byKey.delete(t.key)}}this.generation=e.generation,this.seq=e.seq,this.version.value++}apply(e){e.type===`snapshot`?this.applyCollection({type:`snapshot`,generation:e.generation,seq:e.seq,items:e.agents}):e.type===`changes`&&this.applyCollection({type:`changes`,generation:e.generation,seq:e.seq,changes:e.changes})}matches(e){return(this.host===null||e.hostId===this.host)&&this.predicate(e)}rebuildFiltered(){let e=new oe(this.compare,()=>!1),t=this.base;for(let n of t.flat.range(0,t.size))this.predicate(n)&&e.add(n);this.filtered=e}bucketOf(e){return this.indexOf?this.indexOf(e):null}unbucket(e){let t=this.bucketOf(e);if(!t)return;let n=this.buckets.get(t);n&&(n.remove(e),n.size||this.buckets.delete(t))}put(e){this.byKey.set(e.key,e),this.all.add(e),this.hostView(e.hostId).add(e),this.filtered&&this.matches(e)&&this.filtered.add(e);let t=this.bucketOf(e);if(t){let n=this.buckets.get(t);n||this.buckets.set(t,n=new I(U)),n.insert(e)}}},K=[`width`,`height`],ce=[`d`],q=t({__name:`Icon`,props:{name:{},size:{}},setup(e){let t={chat:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,board:`M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zM9 3v18M15 3v12`,server:`M4 3h16a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zM4 13h16a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1zM7 7h.01M7 17h.01`,search:`M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM21 21l-4.35-4.35`,back:`M15 18l-6-6 6-6`,send:`M12 19V5M5 12l7-7 7 7`,stop:`M7 7h10v10H7z`,plus:`M12 5v14M5 12h14`,close:`M18 6 6 18M6 6l12 12`,check:`M20 6 9 17l-5-5`,terminal:`M4 17l6-6-6-6M12 19h8`,file:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zM14 2v6h6`,edit:`M12 20h9M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z`,globe:`M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z`,bot:`M12 8V4H8M4 8h16a0 0 0 0 1 0 0v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8zM2 14h2M20 14h2M9 13v2M15 13v2`,tool:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,brain:`M9 3a3 3 0 0 0-3 3 3 3 0 0 0-2 5 3 3 0 0 0 2 5 3 3 0 0 0 3 3 3 3 0 0 0 3-3V6a3 3 0 0 0-3-3zM15 3a3 3 0 0 1 3 3 3 3 0 0 1 2 5 3 3 0 0 1-2 5 3 3 0 0 1-3 3 3 3 0 0 1-3-3`,alert:`M12 9v4M12 17h.01M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z`,shield:`M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z`,trash:`M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6`,chevron:`M9 18l6-6-6-6`,folder:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.7-.9l-.8-1.2A2 2 0 0 0 7.9 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2z`,list:`M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01`,sun:`M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41`,moon:`M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z`,monitor:`M4 4h16a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zM8 21h8M12 17v4`,bell:`M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9M10.3 21a1.94 1.94 0 0 0 3.4 0`,phone:`M7 2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM11 18h2`,gear:`M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z`,bolt:`M13 2 3 14h9l-1 8 10-12h-9l1-8z`,refresh:`M21 12a9 9 0 1 1-3-6.7L21 8M21 3v5h-5`,pin:`M12 17v5M9 10.76V6a3 3 0 0 1 6 0v4.76a2 2 0 0 0 1.11 1.79l1.78.9A2 2 0 0 1 19 15.24V16a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-.76a2 2 0 0 1 1.11-1.79l1.78-.9A2 2 0 0 0 9 10.76z`,more:`M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2zM19 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2zM5 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2z`,archive:`M21 8v13H3V8M1 3h22v5H1zM10 12h4`,dot:`M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`,branch:`M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 9a9 9 0 0 1-9 9`,sparkle:`M12 3l1.9 5.8L20 11l-6.1 2.2L12 19l-1.9-5.8L4 11l6.1-2.2z`};return(n,r)=>(c(),p(`svg`,{class:`icon`,width:e.size??16,height:e.size??16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.75`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[T(`path`,{d:t[e.name]??t.tool},null,8,ce)],8,K))}}),le=[`aria-label`],J={class:`menu-title`},ue=t({__name:`ThreadMenu`,props:{thread:{},x:{},y:{}},emits:[`close`,`rename`,`pin`,`unread`,`read`,`archive`],setup(e,{emit:t}){let n=e,r=t,i=f(null),a=f({left:n.x,top:n.y});function o(e){e(),r(`close`)}function l(e){e.key===`Escape`&&r(`close`)}function u(e){i.value&&!i.value.contains(e.target)&&r(`close`)}return S(()=>{C(()=>{let e=i.value;if(!e)return;let{width:t,height:r}=e.getBoundingClientRect();a.value={left:Math.max(8,Math.min(n.x,innerWidth-t-8)),top:Math.max(8,Math.min(n.y,innerHeight-r-8))},e.querySelector(`button`)?.focus()}),window.addEventListener(`keydown`,l),setTimeout(()=>window.addEventListener(`pointerdown`,u),0)}),s(()=>{window.removeEventListener(`keydown`,l),window.removeEventListener(`pointerdown`,u)}),(t,n)=>(c(),p(`div`,{ref_key:`element`,ref:i,class:`menu`,role:`menu`,"aria-label":`Actions for `+e.thread.name,style:k({left:a.value.left+`px`,top:a.value.top+`px`})},[T(`div`,J,x(e.thread.name),1),T(`button`,{role:`menuitem`,onClick:n[0]||=t=>o(()=>r(`rename`,e.thread))},[N(q,{name:`edit`,size:14}),n[5]||=h(`Rename…`,-1)]),T(`button`,{role:`menuitem`,onClick:n[1]||=t=>o(()=>r(`pin`,e.thread,!e.thread.pinnedAt))},[N(q,{name:`pin`,size:14}),h(x(e.thread.pinnedAt?`Unpin`:`Pin to top`),1)]),e.thread.unread?(c(),p(`button`,{key:0,role:`menuitem`,onClick:n[2]||=t=>o(()=>r(`read`,e.thread))},[N(q,{name:`check`,size:14}),n[6]||=h(`Mark as read `,-1)])):(c(),p(`button`,{key:1,role:`menuitem`,onClick:n[3]||=t=>o(()=>r(`unread`,e.thread))},[N(q,{name:`dot`,size:14}),n[7]||=h(`Mark as unread `,-1)])),n[9]||=T(`div`,{class:`menu-sep`},null,-1),T(`button`,{role:`menuitem`,class:`menu-danger`,onClick:n[4]||=t=>o(()=>r(`archive`,e.thread))},[N(q,{name:`archive`,size:14}),n[8]||=h(`Archive… `,-1)])],12,le))}}),de={class:`sheet-head`},fe={class:`sheet-body`},pe={class:`field`},me=[`placeholder`],he={class:`row-sub`},ge={class:`sheet-foot`},_e=[`disabled`],ve=[`disabled`],ye=[`disabled`],be=t({__name:`RenameThread`,props:{thread:{},busy:{type:Boolean}},emits:[`close`,`save`],setup(e,{emit:t}){let n=e,r=t,i=f(n.thread.title??n.thread.name),o=f(null);S(()=>C(()=>{o.value?.focus(),o.value?.select()}));function s(){let e=i.value.trim();r(`save`,e||null)}return(t,n)=>(c(),p(`div`,{class:`overlay`,onMousedown:n[4]||=M(t=>!e.busy&&r(`close`),[`self`]),onKeydown:n[5]||=w(e=>r(`close`),[`esc`])},[T(`form`,{class:`sheet sheet-small`,role:`dialog`,"aria-modal":`true`,"aria-label":`Rename thread`,onSubmit:M(s,[`prevent`])},[T(`header`,de,[n[6]||=T(`h2`,null,`Rename thread`,-1),T(`button`,{type:`button`,class:`icon-btn`,"aria-label":`Close`,onClick:n[0]||=e=>r(`close`)},[N(q,{name:`close`,size:16})])]),T(`div`,fe,[T(`label`,pe,[n[7]||=T(`span`,null,`Name`,-1),a(T(`input`,{ref_key:`input`,ref:o,"onUpdate:modelValue":n[1]||=e=>i.value=e,maxlength:`200`,placeholder:e.thread.name},null,8,me),[[A,i.value]])]),T(`p`,he,x(e.thread.project)+x(e.thread.branch?` · `+e.thread.branch:``),1)]),T(`footer`,ge,[e.thread.title?(c(),p(`button`,{key:0,type:`button`,class:`btn btn-ghost sheet-reset`,disabled:e.busy,onClick:n[2]||=e=>r(`save`,null)},` Reset to default `,8,_e)):v(``,!0),T(`button`,{type:`button`,class:`btn btn-ghost`,disabled:e.busy,onClick:n[3]||=e=>r(`close`)},`Cancel`,8,ve),T(`button`,{class:`btn btn-primary`,disabled:e.busy||!i.value.trim()},`Save`,8,ye)])],32)],32))}}),xe=`litepaseo-composer-v1:`,Se=xe+`draft:`,Ce=xe+`message:`,we=class{warning=f(``);revision=f(0);generation=0;drafts=d(new Map);pending=d(new Map);owner=crypto.randomUUID();storage;savedIndex=new Map;messageIndex=new Map;slotKey=new Map;constructor(e,t=Date.now()){try{this.storage=e()}catch{this.storage=null,this.unavailable()}this.rescan(t)}unavailable(){this.warning.value=`Draft storage is unavailable. Keep this tab open to retain your text.`}attempt(e,t){if(!this.storage)return t;try{return e(this.storage)}catch{return this.unavailable(),t}}decode(e){try{return JSON.parse(e)}catch{return null}}slot(e){return`${Se}${this.owner}:${encodeURIComponent(e)}`}rescan(e=Date.now()){this.savedIndex.clear(),this.messageIndex.clear(),this.slotKey.clear();let t=this.attempt(e=>{let t=[];for(let n=0;n<e.length;n++){let r=e.key(n);r?.startsWith(xe)&&t.push([r,e.getItem(r)])}return t},[]),n=[];for(let[r,i]of t){let t=r.startsWith(Se)?this.decode(i):null;t&&Number.isFinite(t.updated)&&e-t.updated>2592e6?n.push(r):this.apply(r,i)}for(let[e]of this.savedIndex)n.push(...this.excess(e));for(let e of n)this.remove(e);this.revision.value++}excess(e){let t=this.savedIndex.get(e);return!t||t.size<=8?[]:[...t].sort((e,t)=>t[1].updated-e[1].updated).slice(8).map(([e])=>e).filter(t=>t!==this.slot(e))}apply(e,t){let n=this.slotKey.get(e);if(n!==void 0){this.slotKey.delete(e);let t=this.savedIndex.get(n);t?.delete(e),t&&!t.size&&this.savedIndex.delete(n);let r=this.messageIndex.get(n);r?.delete(e),r&&!r.size&&this.messageIndex.delete(n)}if(t===null)return;let r=this.decode(t);if(typeof r?.key==`string`&&typeof r.text==`string`){if(e.startsWith(Se)){if(!r.text||!Number.isFinite(r.updated))return;let n=this.savedIndex.get(r.key);n||this.savedIndex.set(r.key,n=new Map),n.set(e,{key:r.key,text:r.text,updated:r.updated,restoredFrom:r.restoredFrom,raw:t})}else if(e.startsWith(Ce)){if(typeof r.messageId!=`string`)return;let t=this.messageIndex.get(r.key);t||this.messageIndex.set(r.key,t=new Map),t.set(e,r)}else return;this.slotKey.set(e,r.key)}}write(e,t){this.storage.setItem(e,t),this.apply(e,t)}remove(e){this.attempt(t=>(t.removeItem(e),!0),!1),this.apply(e,null)}onStorage(e,t){if(e===null)return this.rescan();e.startsWith(xe)&&(this.apply(e,t),this.revision.value++)}saved(e){this.revision.value;let t=this.savedIndex.get(e);return t?[...t].map(([e,{raw:t,...n}])=>({...n,slot:e})).sort((e,t)=>t.updated-e.updated):[]}state(e){let t=this.drafts.get(e);if(!t){let n=this.saved(e)[0];this.drafts.set(e,{text:n?.text??``,restoredFrom:n?.restoredFrom,source:n?.slot,sourceValue:n?this.savedIndex.get(e)?.get(n.slot)?.raw:void 0}),t=this.drafts.get(e)}return t}setText(e,t,n){let r=this.state(e);r.text=t,r.restoredFrom=n,this.attempt(i=>(t&&this.write(this.slot(e),JSON.stringify({key:e,text:t,restoredFrom:n,updated:Date.now()})),r.source&&i.getItem(r.source)===r.sourceValue&&this.remove(r.source),r.source=r.sourceValue=void 0,t||this.remove(this.slot(e)),!0),!1),this.revision.value++}restore(e,t){let n=this.saved(e).find(e=>e.slot===t);if(!n)return;let r=this.state(e).text;r&&r!==n.text&&this.attempt(()=>{this.write(`${Se}${crypto.randomUUID()}:${encodeURIComponent(e)}`,JSON.stringify({key:e,text:r,updated:Date.now()}));for(let t of this.excess(e))this.remove(t);return!0},!1),this.setText(e,n.text)}unresolved(e){this.revision.value;let t=new Map((this.pending.get(e)??[]).map(e=>[e.messageId,e]));for(let n of this.messageIndex.get(e)?.values()??[])t.set(n.messageId,n);return[...t.values()]}begin(e,t){this.attempt(()=>(this.write(Ce+t.messageId,JSON.stringify({key:e,...t})),!0),!1)||this.pending.set(e,[...this.unresolved(e),t]),this.revision.value++}resolve(e,t){this.pending.set(e,(this.pending.get(e)??[]).filter(e=>e.messageId!==t)),this.remove(Ce+t),this.revision.value++}restoreFailed(e,t){this.state(e).text||this.setText(e,t.text,t.messageId)}confirm(e,t){this.state(e).restoredFrom===t&&this.setText(e,``),this.resolve(e,t)}refresh(){this.rescan()}clear(){this.generation++;for(let e of[...this.slotKey.keys()])this.remove(e);this.attempt(e=>{let t=[];for(let n=0;n<e.length;n++){let r=e.key(n);r?.startsWith(xe)&&t.push(r)}for(let n of t)e.removeItem(n);return!0},!1),this.drafts.clear(),this.pending.clear(),this.revision.value++}},Te=3e3,Ee=2500,De=class{rows=[];epoch=``;hasOlder=!1;startCursor=null;ready=!1;membership=l(0);apply(e){let t=!1;for(let n of e)if(n.type===`reset`)this.rows=n.rows.map(e=>({seqStart:e.seqStart,row:l(e)})),this.epoch=n.epoch,this.hasOlder=n.hasOlder,this.startCursor=n.startCursor,this.ready=!0,t=!0;else if(n.type===`upsert`){let e=this.find(n.row.seqStart);e>=0?this.rows[e].row.value=n.row:(this.insert({seqStart:n.row.seqStart,row:l(n.row)}),t=!0)}else if(n.type===`append`){let e=this.find(n.seqStart);if(e<0)continue;let t=this.rows[e].row,r=t.value;t.value={...r,seqEnd:n.seqEnd,timestamp:n.timestamp,item:{...r.item,text:(r.item.text??``)+n.text}}}this.rows.length>Te&&(this.rows=this.rows.slice(this.rows.length-Ee),this.hasOlder=!0,this.startCursor={epoch:this.epoch,seq:this.rows[0].seqStart},t=!0),t&&this.membership.value++}find(e){let t=0,n=this.rows.length;if(n&&this.rows[n-1].seqStart===e)return n-1;for(;t<n;){let r=t+n>>>1;this.rows[r].seqStart<e?t=r+1:n=r}return this.rows[t]?.seqStart===e?t:-1}insert(e){let t=this.rows.at(-1);if(!t||t.seqStart<e.seqStart)return void this.rows.push(e);let n=0,r=this.rows.length;for(;n<r;){let t=n+r>>>1;this.rows[t].seqStart<e.seqStart?n=t+1:r=t}this.rows.splice(n,0,e)}},Oe=100;function ke(e,t,n){let r=n===`before`,i=r?e[0]?.seqStart:e.at(-1)?.seqStart,a=t.rows.filter(e=>i===void 0||(r?e.seqStart<i:e.seqStart>i)),o=(r?a.slice(-100):a.slice(0,Oe)).map(e=>({seqStart:e.seqStart,row:l(e)})),s=r?[...o,...e]:[...e,...o];return{rows:r?s.slice(0,150):s.slice(-150),hasOlder:!r||t.hasOlder||a.length>Oe,added:o.length}}var Ae=1e3,je=3e4;function Me(e){let t=!1,n=null,r,i=Ae,a=t=>e.onState?.(t),o=async()=>{if(t||document.hidden||n)return;clearTimeout(r),r=void 0;let s=n=new AbortController;a(`connecting`);try{let n=await fetch(e.url(),{headers:{accept:`text/event-stream`},signal:s.signal});if(n.status===401){t=!0,a(`unauthorized`);return}if(!n.ok||!n.body)throw Error(`Stream unavailable`);a(`live`);let r=n.body.pipeThrough(new TextDecoderStream).getReader(),o=``;for(;;){let{value:t,done:n}=await r.read();if(n)break;o+=t;let a;for(;(a=o.indexOf(`
|
|
3
|
-
|
|
4
|
-
`))>=0;){let t=o.slice(0,a);o=o.slice(a+2);let n=``;for(let e of t.split(`
|
|
5
|
-
`))e.startsWith(`data: `)&&(n+=(n?`
|
|
6
|
-
`:``)+e.slice(6));n&&(i=Ae,e.onMessage(JSON.parse(n)))}}}catch{}finally{n===s&&(n=null)}if(t)return a(`closed`);if(document.hidden)return a(`paused`);a(`connecting`),r=setTimeout(()=>void o(),i),i=Math.min(i*2,je)},s=()=>{document.hidden?(n?.abort(),clearTimeout(r),a(`paused`)):(i=Ae,o())};return document.addEventListener(`visibilitychange`,s),o(),{close(){t=!0,clearTimeout(r),document.removeEventListener(`visibilitychange`,s),n?.abort()}}}var Y=[`aria-expanded`,`onClick`],Ne={class:`group-name`},Pe=[`title`],Fe={key:0,class:`group-flag is-attention`},Ie={key:1,class:`status-dot is-error`},Le={key:2,class:`status-dot is-running`},X={key:3,class:`status-dot is-unread`},Re={class:`group-count`},ze=[`aria-label`,`title`,`onClick`],Be=[`onClick`,`onContextmenu`,`onPointerdown`],Ve={class:`session-text`},He={class:`session-title`},Ue={class:`session-meta`},We={class:`session-project`},Ge={class:`session-branch`},Ke={key:0,class:`pill pill-attention`},qe={key:1,class:`unread-mark`,title:`Finished, not viewed yet`},Je=[`aria-label`,`onClick`],Ye={key:0,class:`list-empty`},Z=320,Q=500,Xe=t({__name:`SessionList`,props:{store:{},mode:{},hostLabels:{},hostStates:{},selectedKey:{},searching:{type:Boolean}},emits:[`select`,`new`,`menu`],setup(e,{emit:t}){let n=e,r=t,i=f(null),a=f(0),l=f(600),u=0,d,m=D(()=>(n.store.version.value,n.store.size)),b=D(()=>(n.store.version.value,n.mode===`projects`?n.store.groupedHeight:n.store.size*52)),C=D(()=>{n.store.version.value;let e=Math.max(0,a.value-Z),t=l.value+Z*2;if(n.mode===`projects`)return n.store.groupedRows(e,t);let r=Math.floor(e/52);return n.store.range(r,Math.ceil(t/52)+1).map((e,t)=>({kind:`item`,key:e.key,top:(r+t)*52,item:e}))}),w=e=>[e.attention&&`${e.attention} need you`,e.failed&&`${e.failed} failed`,e.running&&`${e.running} running`,e.unread&&`${e.unread} finished, not viewed`].filter(Boolean).join(` · `),E=e=>`is-`+(e.attention?`attention`:e.state===`failed`?`error`:e.state===`running`?`running`:e.state===`unread`?`unread`:`idle`),O,A=!1;function P(e,t){if(e.pointerType===`mouse`)return;A=!1,clearTimeout(O);let{clientX:n,clientY:i}=e;O=setTimeout(()=>{A=!0,navigator.vibrate?.(10),r(`menu`,t,n,i)},Q)}function F(){clearTimeout(O)}function I(e){A?A=!1:r(`select`,e.key)}function L(e,t){let n=e.currentTarget.getBoundingClientRect();r(`menu`,t,n.left,n.bottom+4)}function R(){F(),u||=requestAnimationFrame(()=>{u=0,i.value&&(a.value=i.value.scrollTop)})}return S(()=>{let e=i.value;l.value=e.clientHeight||l.value,d=new ResizeObserver(()=>l.value=e.clientHeight||l.value),d.observe(e)}),s(()=>{d?.disconnect(),cancelAnimationFrame(u),clearTimeout(O)}),(t,n)=>(c(),p(`div`,{ref_key:`element`,ref:i,class:`session-list`,onScrollPassive:R},[T(`div`,{class:`session-spacer`,style:k({height:b.value+`px`})},[(c(!0),p(g,null,o(C.value,t=>(c(),p(g,{key:t.key},[t.kind===`group`?(c(),p(`div`,{key:0,class:j([`group-row`,{collapsed:t.collapsed}]),style:k({transform:`translateY(${t.top}px)`,height:_(36)-4+`px`})},[T(`button`,{class:`group-toggle`,"aria-expanded":!t.collapsed,onClick:n=>e.store.toggleGroup(t.group.key)},[N(q,{name:`chevron`,size:13,class:`group-chevron`}),N(q,{name:`folder`,size:14,class:`group-folder`}),T(`span`,Ne,x(t.group.name),1),_(re)(t.group)===`done`?v(``,!0):(c(),p(`span`,{key:0,class:`group-marks`,title:w(t.group)},[t.group.attention?(c(),p(`span`,Fe,x(t.group.attention),1)):v(``,!0),t.group.failed?(c(),p(`span`,Ie)):v(``,!0),t.group.running?(c(),p(`span`,Le)):v(``,!0),t.group.unread?(c(),p(`span`,X)):v(``,!0)],8,Pe)),T(`span`,Re,x(t.group.items.size),1)],8,Y),T(`button`,{class:`group-add`,"aria-label":`New session in `+t.group.name,title:`New session in `+t.group.name,onClick:e=>r(`new`,t.group)},[N(q,{name:`plus`,size:14})],8,ze)],6)):(c(),p(`div`,{key:1,class:j([`session-row`,{chosen:e.selectedKey===t.item.key}]),style:k({transform:`translateY(${t.top}px)`})},[T(`button`,{class:j([`session`,{unread:t.item.unread,chosen:e.selectedKey===t.item.key,offline:e.hostStates.get(t.item.hostId)!==`connected`,nested:e.mode===`projects`}]),onClick:e=>I(t.item),onContextmenu:M(e=>r(`menu`,t.item,e.clientX,e.clientY),[`prevent`]),onPointerdown:e=>P(e,t.item),onPointerup:F,onPointercancel:F,onPointerleave:F},[T(`span`,{class:j([`status-dot`,E(t.item)])},null,2),T(`span`,Ve,[T(`span`,He,[t.item.pinnedAt?(c(),y(q,{key:0,name:`pin`,size:11,class:`pin-mark`})):v(``,!0),h(x(t.item.name),1)]),T(`span`,Ue,[e.mode===`recent`?(c(),p(g,{key:0},[T(`span`,We,x(t.item.project),1),n[0]||=T(`span`,{class:`sep`},`·`,-1)],64)):v(``,!0),T(`span`,null,x(e.hostLabels.get(t.item.hostId)??`Unknown host`),1),t.item.branch?(c(),p(g,{key:1},[n[1]||=T(`span`,{class:`sep`},`·`,-1),T(`span`,Ge,x(t.item.branch),1)],64)):v(``,!0)])]),t.item.attention?(c(),p(`span`,Ke,`Needs you`)):t.item.unread?(c(),p(`span`,qe)):v(``,!0)],42,Be),T(`button`,{class:`row-more`,"aria-label":`Actions for `+t.item.name,title:`Rename, pin, mark unread, archive`,onClick:M(e=>L(e,t.item),[`stop`])},[N(q,{name:`more`,size:16})],8,Je)],6))],64))),128))],4),m.value?v(``,!0):(c(),p(`div`,Ye,x(e.searching?`No threads match.`:`No threads yet. Add a host to get started.`),1))],544))}}),$={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Ze=e=>e.replace(/[&<>"']/g,e=>$[e]);function Qe(e){let t=e.trim();return/^(https?:|mailto:)/i.test(t)?t:null}function $e(e){let t=e.split(/(`+)([\s\S]*?[^`])\1(?!`)/),n=``;for(let e=0;e<t.length;e++){if(e%3==2){n+=`<code>${Ze(t[e].replace(/^ (.*) $/,`$1`))}</code>`;continue}if(e%3==1)continue;let r=Ze(t[e]);r=r.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,(e,t,n)=>{let r=Qe(n.replace(/&/g,`&`));return r?`<a href="${Ze(r)}" target="_blank" rel="noopener noreferrer">${t}</a>`:e}),r=r.replace(/(^|[\s(])(https?:\/\/[^\s<)]+[^\s<).,;:!?'"])/g,(e,t,n)=>`${t}<a href="${n}" target="_blank" rel="noopener noreferrer">${n}</a>`),r=r.replace(/\*\*([^*\n]+)\*\*/g,`<strong>$1</strong>`).replace(/__([^_\n]+)__/g,`<strong>$1</strong>`).replace(/(^|[^*\w])\*([^*\s][^*\n]*?)\*(?!\w)/g,`$1<em>$2</em>`).replace(/(^|[^_\w])_([^_\s][^_\n]*?)_(?!\w)/g,`$1<em>$2</em>`).replace(/~~([^~\n]+)~~/g,`<del>$1</del>`),n+=r}return n}var et=e=>/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/.test(e)&&e.includes(`|`),tt=e=>e.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>$e(e.trim()));function nt(e){let t=e.replace(/\r\n?/g,`
|
|
7
|
-
`).split(`
|
|
8
|
-
`),n=[],r=[],i=()=>{r.length&&n.push(`<p>${r.map($e).join(`<br>`)}</p>`),r=[]};for(let e=0;e<t.length;e++){let a=t[e],o=/^(\s*)(```+|~~~+)\s*([\w+#.-]*)/.exec(a);if(o){i();let r=o[2],a=[];for(;++e<t.length&&!t[e].trimStart().startsWith(r);)a.push(t[e]);let s=o[3]?`<span class="code-lang">${Ze(o[3])}</span>`:``;n.push(`<pre class="code">${s}<code>${Ze(a.join(`
|
|
9
|
-
`))}</code></pre>`);continue}if(!a.trim()){i();continue}let s=/^(#{1,6})\s+(.*)$/.exec(a);if(s){i();let e=Math.min(s[1].length+2,6);n.push(`<h${e}>${$e(s[2])}</h${e}>`);continue}if(/^\s*([-*_])(\s*\1){2,}\s*$/.test(a)){i(),n.push(`<hr>`);continue}if(/^\s*>/.test(a)){i();let r=[];for(;e<t.length&&/^\s*>/.test(t[e]);e++)r.push(t[e].replace(/^\s*>\s?/,``));e--,n.push(`<blockquote>${nt(r.join(`
|
|
10
|
-
`))}</blockquote>`);continue}if(a.includes(`|`)&&e+1<t.length&&et(t[e+1])){i();let r=tt(a),o=[];for(e+=2;e<t.length&&t[e].includes(`|`)&&t[e].trim();e++)o.push(tt(t[e]));e--,n.push(`<div class="table"><table><thead><tr>${r.map(e=>`<th>${e}</th>`).join(``)}</tr></thead><tbody>${o.map(e=>`<tr>${e.map(e=>`<td>${e}</td>`).join(``)}</tr>`).join(``)}</tbody></table></div>`);continue}let c=/^(\s*)([-*+]|\d+[.)])\s+(.*)$/.exec(a);if(c){i();let r=/\d/.test(c[2]),a=[];for(;e<t.length;e++){let n=/^(\s*)([-*+]|\d+[.)])\s+(.*)$/.exec(t[e]);if(n&&/\d/.test(n[2])===r){let e=/^\[([ xX])\]\s+(.*)$/.exec(n[3]),t=n[1].length>=2?` class="nested"`:``;a.push(e?`<li class="task${n[1].length>=2?` nested`:``}"><span class="check${e[1]===` `?``:` done`}"></span>${$e(e[2])}</li>`:`<li${t}>${$e(n[3])}</li>`)}else if(t[e].trim()&&/^\s{2,}/.test(t[e])&&a.length)a[a.length-1]=a[a.length-1].replace(/<\/li>$/,` ${$e(t[e].trim())}</li>`);else break}e--,n.push(r?`<ol>${a.join(``)}</ol>`:`<ul>${a.join(``)}</ul>`)}else r.push(a)}return i(),n.join(``)}var rt=`modulepreload`,it=function(e){return`/`+e},at={},ot=function(e){return e.pathname.endsWith(`.css`)},st=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},ct=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=it(t,n);let r=s(t),i=ot(r);return st(at,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:rt,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},lt=l(null),ut=null;function dt(){return ut??=ct(()=>import(`./MarkdownMessage-IYvqW4k2.js`).then(e=>{lt.value=i(e.default)}),__vite__mapDeps([0,1,2])).catch(()=>{ut=null}),ut}function ft(){let e=window.requestIdleCallback;e?e(()=>void dt(),{timeout:3e3}):setTimeout(()=>void dt(),1500)}var pt=Symbol(`litepaseo-suggestions`),mt={key:0,class:`row row-plugin row-speed`,title:`Turn speed (turn-speed plugin)`},ht={class:`suggestion-actions`},gt={key:2,class:`suggestion-wait`},_t={class:`tool-icon`},vt={class:`tool-name`},yt={class:`tool-subject`},bt={key:0,class:`tool-detail`},xt=t({__name:`PluginRow`,props:{item:{},seqStart:{}},setup(e){let t=e,r=n(pt,null),i=D(()=>`${t.item.pluginId}/${t.item.kind}`),a=D(()=>t.item.data??{}),o=D(()=>{let e=a.value;if(i.value!==`turn-speed/turn-speed`||typeof e.tokensPerSecond!=`number`)return null;let t=e.outputTokens>=1e3?`${(e.outputTokens/1e3).toFixed(1)}k`:String(e.outputTokens),n=e.generationMs>=6e4?`${Math.floor(e.generationMs/6e4)}m ${Math.round(e.generationMs%6e4/1e3)}s`:`${(e.generationMs/1e3).toFixed(1)}s`;return`${e.tokensPerSecond.toFixed(1)} tok/s · ${t} tokens · ${n} · ${e.requests} ${e.requests===1?`request`:`requests`}`}),s=D(()=>i.value===`next-input/next-input`&&typeof a.value.token==`string`),l=f(`idle`),d=f(``),m=D(()=>/[`$|<>]|(^|\s)[.~]?\/[\w.-]|https?:|www\.|\b(rm|sudo|delete|drop|remove|reset|force|push|deploy|publish|release|merge|token|password|passwd|secret|credential|api[ _-]?key|ssh)\b|删除|推送|部署|发布|密码|密钥|令牌/i.test(d.value));async function h(){if(r&&s.value){if(a.value.status===`ready`&&a.value.text)l.value=`ready`,d.value=a.value.text;else{l.value=`loading`;try{let e=await r.predict(a.value.token);e.status===`ready`&&e.text?(l.value=`ready`,d.value=e.text):l.value=e.status===`error`?`error`:`hidden`}catch{l.value=`error`}}l.value===`ready`&&r.offer(t.seqStart,d.value)}}S(()=>void h()),u(()=>a.value.token,()=>void h());let y=f(!1),b=D(()=>y.value?JSON.stringify(t.item.data??t.item,null,2):``);return(t,n)=>o.value?(c(),p(`div`,mt,[N(q,{name:`bolt`,size:12}),T(`span`,null,x(o.value),1)])):s.value?(c(),p(`div`,{key:1,class:j([`row row-suggestion`,`is-`+l.value])},[l.value===`loading`?(c(),p(g,{key:0},[n[4]||=T(`span`,{class:`spinner spinner-sm`},null,-1),n[5]||=T(`span`,{class:`suggestion-wait`},`Thinking of a next message…`,-1)],64)):l.value===`ready`?(c(),p(g,{key:1},[T(`button`,{class:`suggestion-text`,title:`Put in the message box to edit`,onClick:n[0]||=e=>_(r)?.use(d.value)},x(d.value),1),T(`span`,ht,[T(`button`,{class:`icon-btn`,title:`Edit in the message box`,"aria-label":`Edit suggestion`,onClick:n[1]||=e=>_(r)?.use(d.value)},[N(q,{name:`edit`,size:14})]),m.value?v(``,!0):(c(),p(`button`,{key:0,class:`icon-btn`,title:`Send this message`,"aria-label":`Send suggestion`,onClick:n[2]||=e=>_(r)?.send(d.value)},[N(q,{name:`send`,size:14})]))])],64)):l.value===`error`?(c(),p(`span`,gt,`Suggestion unavailable`)):v(``,!0)],2)):(c(),p(`details`,{key:2,class:`row row-tool row-plugin`,onToggle:n[3]||=e=>y.value=e.target.open},[T(`summary`,null,[T(`span`,_t,[N(q,{name:`sparkle`,size:13})]),T(`span`,vt,x(e.item.pluginId),1),T(`span`,yt,x(e.item.kind),1)]),y.value?(c(),p(`pre`,bt,x(b.value),1)):v(``,!0)],32))}}),St={key:0,class:`row row-user`},Ct={class:`bubble`},wt={key:1,class:`row row-assistant`},Tt=[`innerHTML`],Et={key:0,class:`reasoning-text`},Dt={class:`tool-icon`},Ot={class:`tool-name`},kt={class:`tool-subject`},At=[`title`],jt={key:0,class:`spinner`},Mt={key:3,class:`muted-text`},Nt={key:0,class:`tool-detail`},Pt={key:1,class:`tool-detail tool-error`},Ft={key:4,class:`row row-todo`},It={class:`todo-title`},Lt={key:5,class:`row row-callout is-error`},Rt={key:7,class:`row row-divider`},zt={class:`tool-icon`},Bt={class:`tool-name`},Vt={key:0,class:`tool-detail`},Ht=t({__name:`TimelineRowView`,props:{entry:{},final:{type:Boolean}},setup(t){let n=t,r=D(()=>n.entry.value),i=D(()=>r.value.item),a=f(!1),s=D(()=>!lt.value&&i.value.type===`assistant_message`?nt(String(i.value.text??``)):``);!lt.value&&i.value.type===`assistant_message`&&dt();let l={shell:`terminal`,read:`file`,edit:`edit`,write:`edit`,search:`search`,fetch:`globe`,web_search:`globe`,sub_agent:`bot`},u=D(()=>{let e=i.value;if(e.type!==`tool_call`)return null;let t=e.detail??{},n=t.command??t.filePath??t.query??t.url??t.description??t.prompt??t.filePaths?.[0]??``;return{icon:l[t.type]??`tool`,name:String(e.name??t.type??`tool`),subject:String(n).split(`
|
|
11
|
-
`)[0],status:String(e.status??`running`)}}),d=D(()=>i.value.type===`todo`?i.value.items:[]),m=D(()=>a.value?JSON.stringify(i.value.detail??i.value,null,2):``),b=D(()=>String(i.value.type).replaceAll(`_`,` `));return(n,l)=>i.value.type===`user_message`?(c(),p(`div`,St,[T(`div`,Ct,x(i.value.text),1)])):i.value.type===`assistant_message`?(c(),p(`div`,wt,[_(lt)?(c(),y(e(_(lt)),{key:0,content:String(i.value.text??``),final:t.final},null,8,[`content`,`final`])):(c(),p(`div`,{key:1,class:`prose`,innerHTML:s.value},null,8,Tt))])):i.value.type===`reasoning`?(c(),p(`details`,{key:2,class:`row row-reasoning`,onToggle:l[0]||=e=>a.value=e.target.open},[T(`summary`,null,[N(q,{name:`sparkle`,size:14}),l[3]||=h(` Thinking`,-1)]),a.value?(c(),p(`div`,Et,x(i.value.text),1)):v(``,!0)],32)):u.value?(c(),p(`details`,{key:3,class:j([`row row-tool`,`is-`+u.value.status]),onToggle:l[1]||=e=>a.value=e.target.open},[T(`summary`,null,[T(`span`,Dt,[N(q,{name:u.value.icon,size:14},null,8,[`name`])]),T(`span`,Ot,x(u.value.name),1),T(`span`,kt,x(u.value.subject),1),T(`span`,{class:`tool-status`,title:u.value.status},[u.value.status===`running`?(c(),p(`span`,jt)):u.value.status===`completed`?(c(),y(q,{key:1,name:`check`,size:14})):u.value.status===`failed`?(c(),y(q,{key:2,name:`close`,size:14})):(c(),p(`span`,Mt,x(u.value.status),1))],8,At)]),a.value?(c(),p(`pre`,Nt,x(m.value),1)):v(``,!0),a.value&&i.value.error?(c(),p(`pre`,Pt,x(typeof i.value.error==`string`?i.value.error:JSON.stringify(i.value.error,null,2)),1)):v(``,!0)],34)):i.value.type===`todo`?(c(),p(`div`,Ft,[T(`div`,It,[N(q,{name:`list`,size:14}),l[4]||=h(` Plan`,-1)]),T(`ul`,null,[(c(!0),p(g,null,o(d.value,(e,t)=>(c(),p(`li`,{key:e.id??t,class:j({done:e.completed,active:e.status===`in_progress`})},[T(`span`,{class:j([`check`,{done:e.completed}])},null,2),h(x(e.text),1)],2))),128))])])):i.value.type===`error`?(c(),p(`div`,Lt,[N(q,{name:`alert`,size:15}),l[5]||=h(),T(`span`,null,x(i.value.message),1)])):i.value.type===`notification`?(c(),p(`div`,{key:6,class:j([`row row-callout`,`is-`+i.value.level])},[N(q,{name:`alert`,size:15}),l[6]||=h(),T(`span`,null,x(i.value.message),1)],2)):i.value.type===`compaction`?(c(),p(`div`,Rt,[T(`span`,null,x(i.value.status===`loading`?`Compacting context…`:`Context compacted`),1)])):i.value.type===`plugin`?(c(),y(xt,{key:8,item:i.value,"seq-start":r.value.seqStart},null,8,[`item`,`seq-start`])):(c(),p(`details`,{key:9,class:`row row-tool`,onToggle:l[2]||=e=>a.value=e.target.open},[T(`summary`,null,[T(`span`,zt,[N(q,{name:`tool`,size:14})]),T(`span`,Bt,x(b.value),1)]),a.value?(c(),p(`pre`,Vt,x(m.value),1)):v(``,!0)],32))}}),Ut={class:`sheet-head`},Wt=[`disabled`],Gt={class:`sheet-body`},Kt={key:0,class:`sheet-note`},qt={class:`field-grid`},Jt={class:`field`},Yt=[`disabled`],Xt=[`value`],Zt={class:`field`},Qt=[`disabled`],$t={key:0,value:``},en=[`value`],tn={key:0,class:`field`},nn=[`title`],rn={class:`field`},an=[`placeholder`,`disabled`],on={class:`field-grid three`},sn={class:`field field-agent`},cn=[`disabled`],ln={key:0,value:``},un=[`value`,`disabled`],dn={class:`field field-model`},fn=[`disabled`],pn={key:0,value:``},mn=[`value`],hn={class:`field field-thinking`},gn=[`disabled`],_n={key:0,value:``},vn=[`value`],yn={key:2,class:`field`},bn=[`disabled`],xn=[`value`],Sn={class:`toggle`},Cn=[`disabled`],wn={key:3,class:`field`},Tn={key:4,class:`sheet-error`},En={key:5,class:`sheet-error`},Dn={key:6,class:`sheet-error`,role:`alert`},On={class:`sheet-foot`},kn=[`disabled`],An=[`disabled`],jn={key:0,class:`spinner spinner-on-accent`},Mn=`\0custom`,Nn=`litepaseo-new-session`,Pn=t({__name:`NewSession`,props:{hosts:{},initialHostId:{},initialCwd:{},initialProject:{},request:{type:Function}},emits:[`close`,`created`],setup(e,{emit:t}){let n=e,r=t,i=(()=>{try{return JSON.parse(localStorage.getItem(Nn)??`{}`)}catch{return{}}})(),l=D(()=>n.hosts.filter(e=>e.state===`connected`)),d=f(l.value.find(e=>e.id===n.initialHostId)?.id??l.value[0]?.id??``),m=f(null),_=f(null),y=f(``),w=f(``),O=f(``),k=f(``),j=f(``),P=f(``),F=f(``),I=f(!1),L=f(``),R=f(``),z=f(!1),B=f(``),ee=f(null),V=crypto.randomUUID(),te=D(()=>m.value?.find(e=>e.id===k.value)),H=D(()=>te.value?.models??[]),U=D(()=>H.value.find(e=>e.id===j.value)),ne=D(()=>w.value===Mn?O.value.trim():w.value),re=D(()=>_.value?.find(e=>e.rootPath===w.value)?.name??ne.value.split(`/`).pop()??``),W=D(()=>!!d.value&&!!ne.value&&!!k.value&&!z.value&&(!I.value||!!L.value.trim()));async function G(e){if(m.value=_.value=null,y.value=``,e)try{let[t,r]=await Promise.all([n.request(`/hosts/${encodeURIComponent(e)}/providers`),n.request(`/hosts/${encodeURIComponent(e)}/projects`)]);if(e!==d.value)return;m.value=t,_.value=r.sort((e,t)=>e.name.localeCompare(t.name)),ie();let i=_.value,a=e===n.initialHostId?n.initialProject:null,o=a?i.find(e=>a.key&&e.key===a.key)??i.find(e=>e.name.toLowerCase()===a.name.toLowerCase()):void 0;if(o)w.value=o.rootPath;else if(e===n.initialHostId&&n.initialCwd){let e=i.find(e=>e.rootPath===n.initialCwd);e?w.value=e.rootPath:(w.value=Mn,O.value=n.initialCwd)}else w.value||=i[0]?.rootPath??Mn}catch(t){e===d.value&&(y.value=t.message)}}function ie(){let e=i[d.value]??{},t=m.value??[],n=t.find(t=>t.id===e.provider&&t.status!==`error`)??t.find(e=>e.status===`ready`)??t[0];k.value=n?.id??``,ae(e.model,e.thinking),F.value=n?.modes.some(t=>t.id===e.mode)?e.mode:n?.defaultModeId??``}function ae(e,t){let n=H.value,r=n.find(t=>t.id===e)??n.find(e=>e.isDefault)??n[0];j.value=r?.id??``,P.value=r?.thinking.some(e=>e.id===t)?t:r?.defaultThinkingId??``}u(d,e=>{w.value=``,G(e)}),u(k,()=>{let e=i[d.value];ae(e?.provider===k.value?e.model:void 0);let t=te.value;t&&!t.modes.some(e=>e.id===F.value)&&(F.value=t.defaultModeId??``)}),u(j,()=>{let e=U.value;e&&!e.thinking.some(e=>e.id===P.value)&&(P.value=e.defaultThinkingId??``)}),u([d,w,O,k,j,P,F,I,L,R],()=>{B.value&&(V=crypto.randomUUID()),B.value=``});async function oe(){if(W.value){z.value=!0,B.value=``;try{let e=await n.request(`/hosts/${encodeURIComponent(d.value)}/agents`,`POST`,{idempotencyKey:V,cwd:ne.value,provider:k.value,...j.value?{model:j.value}:{},...F.value?{modeId:F.value}:{},...P.value?{thinkingOptionId:P.value}:{},...R.value.trim()?{prompt:R.value}:{},...I.value?{worktreeBranch:L.value.trim()}:{}},12e4);i[d.value]={provider:k.value,model:j.value,thinking:P.value,mode:F.value},localStorage.setItem(Nn,JSON.stringify(i)),r(`created`,e.key)}catch(e){B.value=e.message}finally{z.value=!1}}}function se(e){e.key===`Escape`&&!z.value&&r(`close`),e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),oe())}return S(()=>{window.addEventListener(`keydown`,se),G(d.value),C(()=>ee.value?.focus())}),s(()=>window.removeEventListener(`keydown`,se)),(e,t)=>(c(),p(`div`,{class:`overlay`,onMousedown:t[12]||=M(e=>!z.value&&r(`close`),[`self`])},[T(`form`,{class:`sheet`,role:`dialog`,"aria-modal":`true`,"aria-label":`New session`,onSubmit:M(oe,[`prevent`])},[T(`header`,Ut,[t[13]||=T(`h2`,null,`New session`,-1),T(`button`,{type:`button`,class:`icon-btn`,"aria-label":`Close`,disabled:z.value,onClick:t[0]||=e=>r(`close`)},[N(q,{name:`close`,size:16})],8,Wt)]),T(`div`,Gt,[l.value.length?(c(),p(g,{key:1},[T(`div`,qt,[T(`label`,Jt,[t[14]||=T(`span`,null,`Host`,-1),a(T(`select`,{"onUpdate:modelValue":t[1]||=e=>d.value=e,disabled:z.value},[(c(!0),p(g,null,o(l.value,e=>(c(),p(`option`,{key:e.id,value:e.id},x(e.label),9,Xt))),128))],8,Yt),[[E,d.value]])]),T(`label`,Zt,[t[15]||=T(`span`,null,`Project`,-1),a(T(`select`,{"onUpdate:modelValue":t[2]||=e=>w.value=e,disabled:z.value||!_.value},[_.value?v(``,!0):(c(),p(`option`,$t,`Loading…`)),(c(!0),p(g,null,o(_.value??[],e=>(c(),p(`option`,{key:e.key,value:e.rootPath},x(e.name),9,en))),128)),T(`option`,{value:Mn},`Another folder…`)],8,Qt),[[E,w.value]])])]),w.value===Mn?(c(),p(`label`,tn,[T(`span`,null,`Folder on `+x(l.value.find(e=>e.id===d.value)?.label),1),a(T(`input`,{"onUpdate:modelValue":t[3]||=e=>O.value=e,placeholder:`/home/me/code/project`,autocomplete:`off`,spellcheck:`false`},null,512),[[A,O.value]])])):ne.value?(c(),p(`p`,{key:1,class:`path-hint`,title:ne.value},[N(q,{name:`folder`,size:13}),h(x(ne.value),1)],8,nn)):v(``,!0),T(`label`,rn,[t[16]||=T(`span`,null,`First message`,-1),a(T(`textarea`,{ref_key:`promptElement`,ref:ee,"onUpdate:modelValue":t[4]||=e=>R.value=e,rows:`5`,placeholder:re.value?`What should the agent do in ${re.value}?`:`What should the agent do?`,disabled:z.value},null,8,an),[[A,R.value]])]),T(`div`,on,[T(`label`,sn,[t[17]||=T(`span`,null,`Agent`,-1),a(T(`select`,{"onUpdate:modelValue":t[5]||=e=>k.value=e,disabled:z.value||!m.value},[m.value?v(``,!0):(c(),p(`option`,ln,`Loading…`)),(c(!0),p(g,null,o(m.value??[],e=>(c(),p(`option`,{key:e.id,value:e.id,disabled:e.status===`error`},x(e.label)+x(e.status===`loading`?` (starting)`:e.status===`error`?` (error)`:``),9,un))),128))],8,cn),[[E,k.value]])]),T(`label`,dn,[t[18]||=T(`span`,null,`Model`,-1),a(T(`select`,{"onUpdate:modelValue":t[6]||=e=>j.value=e,disabled:z.value||!H.value.length},[H.value.length?v(``,!0):(c(),p(`option`,pn,`Default`)),(c(!0),p(g,null,o(H.value,e=>(c(),p(`option`,{key:e.id,value:e.id},x(e.label),9,mn))),128))],8,fn),[[E,j.value]])]),T(`label`,hn,[t[19]||=T(`span`,null,`Thinking`,-1),a(T(`select`,{"onUpdate:modelValue":t[7]||=e=>P.value=e,disabled:z.value||!U.value?.thinking.length},[U.value?.thinking.length?v(``,!0):(c(),p(`option`,_n,`Default`)),(c(!0),p(g,null,o(U.value?.thinking??[],e=>(c(),p(`option`,{key:e.id,value:e.id},x(e.label),9,vn))),128))],8,gn),[[E,P.value]])])]),te.value?.modes.length?(c(),p(`label`,yn,[t[20]||=T(`span`,null,`Mode`,-1),a(T(`select`,{"onUpdate:modelValue":t[8]||=e=>F.value=e,disabled:z.value},[(c(!0),p(g,null,o(te.value.modes,e=>(c(),p(`option`,{key:e.id,value:e.id},x(e.label),9,xn))),128))],8,bn),[[E,F.value]])])):v(``,!0),T(`label`,Sn,[a(T(`input`,{"onUpdate:modelValue":t[9]||=e=>I.value=e,type:`checkbox`,disabled:z.value},null,8,Cn),[[b,I.value]]),t[21]||=T(`span`,null,`Work in a new git worktree`,-1)]),I.value?(c(),p(`label`,wn,[t[22]||=T(`span`,null,`New branch`,-1),a(T(`input`,{"onUpdate:modelValue":t[10]||=e=>L.value=e,placeholder:`feature/my-change`,autocomplete:`off`,spellcheck:`false`},null,512),[[A,L.value]])])):v(``,!0),y.value?(c(),p(`p`,Tn,[N(q,{name:`alert`,size:14}),h(x(y.value),1)])):v(``,!0),te.value?.error?(c(),p(`p`,En,[N(q,{name:`alert`,size:14}),h(x(te.value.error),1)])):v(``,!0),B.value?(c(),p(`p`,Dn,[N(q,{name:`alert`,size:14}),T(`span`,null,x(B.value),1)])):v(``,!0)],64)):(c(),p(`p`,Kt,`No connected hosts. Connect a host first.`))]),T(`footer`,On,[t[23]||=T(`span`,{class:`sheet-hint hide-sm`},`Ctrl/⌘ + Enter to start`,-1),T(`button`,{type:`button`,class:`btn btn-ghost`,disabled:z.value,onClick:t[11]||=e=>r(`close`)},`Cancel`,8,kn),T(`button`,{class:`btn btn-primary`,disabled:!W.value},[z.value?(c(),p(`span`,jn)):v(``,!0),h(` `+x(z.value?`Starting…`:B.value?`Retry`:`Start session`),1)],8,An)])],32)],32))}}),Fn={class:`attachment-panel`},In=[`disabled`],Ln={key:0,role:`status`},Rn={key:1},zn={key:2,role:`alert`},Bn=[`disabled`],Vn=[`src`,`alt`],Hn=[`disabled`,`onClick`],Un=[`disabled`,`onClick`],Wn=t({__name:`AttachmentPanel`,props:{store:{},agentKey:{},base:{},busy:{type:Boolean}},setup(e,{expose:t}){let n=e,r=f(null),i=f(``),a=f(0),s=f(null),l=D(()=>n.store.get(n.agentKey));u([()=>n.base,a],async([e],t,n)=>{let a=new AbortController;n(()=>a.abort()),r.value=null,i.value=``;try{let t=await fetch(e+`/attachments/capabilities`,{signal:a.signal});if(!t.ok)throw Error(`Attachment capabilities are unavailable while the host is disconnected.`);let n=await t.json();a.signal.aborted||(r.value=n)}catch(e){a.signal.aborted||(i.value=e.message)}},{immediate:!0});async function d(e){if(e?.length&&!n.busy){i.value=``;try{if(!r.value)throw Error(`Wait for attachment capabilities, then try again.`);await n.store.add(n.agentKey,n.base,Array.from(e),r.value)}catch(e){i.value=e.message}s.value&&(s.value.value=``)}}return t({addFiles:d}),(t,n)=>(c(),p(`div`,Fn,[T(`input`,{ref_key:`picker`,ref:s,type:`file`,multiple:``,hidden:``,"aria-label":`Choose attachments`,onChange:n[0]||=e=>d(s.value?.files)},null,544),T(`button`,{type:`button`,class:`btn btn-ghost`,disabled:e.busy||!r.value||!r.value.images&&!r.value.files,onClick:n[1]||=e=>s.value?.click()},`Attach files`,8,In),n[4]||=T(`span`,{class:`row-sub`},`Up to 4 files · 8 MiB each · 24 MiB total · kept in this tab until sent`,-1),r.value&&!r.value.images&&!r.value.files?(c(),p(`p`,Ln,`Attachments are unavailable for this agent.`)):r.value?.note?(c(),p(`details`,Rn,[n[3]||=T(`summary`,null,`Attachment support`,-1),h(x(r.value.note),1)])):v(``,!0),i.value?(c(),p(`p`,zn,x(i.value),1)):v(``,!0),i.value&&!r.value?(c(),p(`button`,{key:3,type:`button`,class:`btn btn-ghost`,disabled:e.busy,onClick:n[2]||=e=>a.value++},`Retry attachment support`,8,Bn)):v(``,!0),(c(!0),p(g,null,o(l.value,t=>(c(),p(`div`,{key:t.localId,class:`attachment-item`},[t.preview?(c(),p(`img`,{key:0,src:t.preview,alt:t.file.name,width:`64`,height:`64`},null,8,Vn)):v(``,!0),T(`span`,null,x(t.file.name)+` (`+x(Math.ceil(t.file.size/1024))+` KiB) · `+x(t.uploading?`Uploading…`:t.error||`Ready`),1),t.error?(c(),p(`button`,{key:1,type:`button`,class:`btn btn-ghost`,disabled:e.busy,onClick:n=>e.store.upload(t)},`Retry upload`,8,Hn)):v(``,!0),T(`button`,{type:`button`,class:`btn btn-ghost`,disabled:e.busy,onClick:n=>e.store.remove(e.agentKey,t)},x(t.uploading?`Cancel upload`:`Remove attachment`),9,Un)]))),128))]))}}),Gn=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},Kn=Gn(Wn,[[`__scopeId`,`data-v-9c24c459`]]),qn=class{entries=d(new Map);get(e){return this.entries.get(e)??[]}async add(e,t,n,r){for(let i of n){if(this.get(e).length>=4)throw Error(`Attach up to four files per message.`);if([...this.entries.values()].flat().reduce((e,t)=>e+t.file.size,0)+i.size>25165824)throw Error(`Attachments total more than 24 MiB. Remove files before adding more.`);if(!i.size||i.size>r.maxBytes)throw Error(`Files must be between 1 byte and 8 MiB.`);let n=[`image/png`,`image/jpeg`,`image/webp`,`image/gif`].includes(i.type);if(n?!r.images:!r.files)throw Error(n?`This provider does not support images.`:`This agent cannot read uploaded files.`);let a=d({localId:crypto.randomUUID(),file:i,preview:n?URL.createObjectURL(i):void 0,error:``,uploading:!1,cancelled:!1,base:t});this.entries.set(e,[...this.get(e),a]),this.upload(a)}}async upload(e){if(!(e.uploading||e.cancelled)){e.error=``,e.uploading=!0,e.controller=new AbortController;try{e.id&&await this.discardRemote(e);let t=await fetch(e.base+`/attachments`,{method:`POST`,body:e.file,headers:{"x-litepaseo":`1`,"x-file-name":encodeURIComponent(e.file.name),"content-type":e.file.type||`application/octet-stream`},signal:AbortSignal.any([e.controller.signal,AbortSignal.timeout(6e4)])}),n=await t.json();if(!t.ok)throw Error(n.error??`Upload failed`);e.id=n.id,e.cancelled&&await this.discardRemote(e)}catch(t){!e.cancelled&&!e.controller?.signal.aborted&&(e.error=t.message)}finally{e.uploading=!1}}}async discardRemote(e){let t=e.id;e.id=void 0,t&&await fetch(e.base+`/attachments/`+encodeURIComponent(t),{method:`DELETE`,headers:{"x-litepaseo":`1`},signal:AbortSignal.timeout(5e3)}).catch(()=>{})}remove(e,t,n=!1){t.cancelled=!0,t.controller?.abort(),t.preview&&URL.revokeObjectURL(t.preview),this.entries.set(e,this.get(e).filter(e=>e.localId!==t.localId)),n||this.discardRemote(t)}consume(e,t){for(let n of this.get(e))n.id&&t.includes(n.id)&&this.remove(e,n,!0)}forgetRemote(e){for(let t of this.entries.values())for(let n of t)n.controller?.abort(),n.id=void 0,n.uploading=!1,n.error=e}clear(){for(let[e,t]of this.entries)for(let n of t)this.remove(e,n);this.entries.clear()}};function Jn(e){let t=e.input;if(e.kind!==`question`||!Array.isArray(t?.questions)||!t.questions.length)return null;let n=[],r=new Set;for(let i of t.questions){if(!i||typeof i!=`object`||typeof i.header!=`string`||!i.header.trim()||typeof i.question!=`string`||!i.question.trim()||r.has(i.header)||i.options!==void 0&&!Array.isArray(i.options))return null;let t=i.options??[];if(t.some(e=>!e||typeof e.label!=`string`||!e.label.trim()||e.description!==void 0&&typeof e.description!=`string`)||new Set(t.map(e=>e.label)).size!==t.length)return null;r.add(i.header),n.push({header:i.header,question:i.question,options:t,multiple:i.multiSelect===!0,other:i.isOther===!0||e.name===`AskUserQuestion`||!t.length,secret:i.isSecret===!0,required:i.required!==!1})}return n}function Yn(e,t){let n=e.map((e,n)=>{let r=t[n]??{selected:[],text:``},i=r.selected.filter(t=>e.options.some(e=>e.label===t)),a=e.other?r.text.trim():``,o=e.multiple?[...i,...a?[a]:[]].join(`, `):a||i[0]||``;if(e.required&&!o)throw Error(`Answer ${e.header} before submitting.`);return[e.header,o]});return{answers:Object.fromEntries(n)}}var Xn={class:`permission-head`},Zn={class:`permission-icon`},Qn={class:`grow`},$n={class:`row-title`},er={class:`row-sub`},tr={class:`permission-details`},nr={key:0,class:`field`},rr=[`value`],ir=[`disabled`],ar=[`type`,`name`,`checked`,`onChange`],or={key:0,class:`row-sub`},sr={key:0,class:`field`},cr=[`onUpdate:modelValue`,`type`,`aria-label`],lr={key:2,class:`field`},ur={key:3,role:`alert`},dr={class:`permission-actions`},fr=[`disabled`],pr=[`disabled`],mr=Gn(t({__name:`PermissionForm`,props:{permission:{},busy:{type:Boolean}},emits:[`respond`],setup(e,{emit:t}){let n=e,r=t,i=D(()=>Jn(n.permission)),s=f([]),l=f(``),d=f(``),_=f(``);u(()=>JSON.stringify(n.permission.input),()=>{s.value=(i.value??[]).map(()=>({selected:[],text:``})),l.value=``,_.value=``},{immediate:!0});function y(e,t,n){let r=s.value[e];n?r.selected=r.selected.includes(t)?r.selected.filter(e=>e!==t):[...r.selected,t]:(r.selected=[t],r.text=``)}function b(e){_.value=``;try{let t={behavior:e?`allow`:`deny`};if(d.value&&(t.selectedActionId=d.value),e&&n.permission.kind===`question`){if(i.value)t.updatedInput=Yn(i.value,s.value);else{let e=JSON.parse(l.value);if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Enter a JSON object for the answer.`);t.updatedInput=e}}r(`respond`,t)}catch(e){_.value=e instanceof SyntaxError?`Enter a valid JSON object for the answer.`:e.message}}return(t,n)=>(c(),p(`form`,{class:`permission`,onSubmit:n[3]||=M(e=>b(!0),[`prevent`])},[T(`div`,Xn,[T(`span`,Zn,[N(q,{name:`shield`,size:16})]),T(`div`,Qn,[T(`div`,$n,x(e.permission.title||e.permission.name),1),T(`div`,er,x(e.permission.kind===`question`?`Question`:`Permission request`)+` · `+x(e.permission.name),1)])]),T(`details`,tr,[n[4]||=T(`summary`,null,`Request details`,-1),T(`pre`,null,x(JSON.stringify(e.permission.input,null,2)),1)]),e.permission.actions?.length?(c(),p(`label`,nr,[n[6]||=T(`span`,null,`Action`,-1),a(T(`select`,{"onUpdate:modelValue":n[0]||=e=>d.value=e},[n[5]||=T(`option`,{value:``},`Default`,-1),(c(!0),p(g,null,o(e.permission.actions,e=>(c(),p(`option`,{key:e.id,value:e.id},x(e.label||e.id),9,rr))),128))],512),[[E,d.value]])])):v(``,!0),i.value?(c(!0),p(g,{key:1},o(i.value,(t,n)=>(c(),p(`fieldset`,{key:t.header,class:`question-field`,disabled:e.busy},[T(`legend`,null,x(t.header)+x(t.required?` *`:``)+`: `+x(t.question),1),(c(!0),p(g,null,o(t.options,r=>(c(),p(`label`,{key:r.label,class:`question-option`},[T(`input`,{type:t.multiple?`checkbox`:`radio`,name:e.permission.id+`:`+n,checked:s.value[n]?.selected.includes(r.label)&&(t.multiple||!s.value[n]?.text),onChange:e=>y(n,r.label,t.multiple)},null,40,ar),T(`span`,null,[h(x(r.label),1),r.description?(c(),p(`small`,or,` — `+x(r.description),1)):v(``,!0)])]))),128)),t.other?(c(),p(`label`,sr,[T(`span`,null,x(t.options.length?`Other answer`:`Your answer`),1),a(T(`input`,{"onUpdate:modelValue":e=>s.value[n].text=e,type:t.secret?`password`:`text`,"aria-label":t.header+`: `+(t.options.length?`Other answer`:`Your answer`),autocomplete:`off`},null,8,cr),[[m,s.value[n].text]])])):v(``,!0)],8,ir))),128)):e.permission.kind===`question`?(c(),p(`label`,lr,[n[7]||=T(`span`,null,`This question format needs a JSON answer.`,-1),a(T(`textarea`,{"onUpdate:modelValue":n[1]||=e=>l.value=e,"aria-label":`Answer (JSON)`,rows:`3`,placeholder:`{"answers": {}}`},null,512),[[A,l.value]])])):v(``,!0),_.value?(c(),p(`p`,ur,x(_.value),1)):v(``,!0),T(`div`,dr,[T(`button`,{type:`button`,class:`btn btn-outline`,disabled:e.busy,onClick:n[2]||=e=>b(!1)},`Deny`,8,fr),T(`button`,{class:`btn btn-primary`,disabled:e.busy},`Allow / submit`,8,pr)])],32))}}),[[`__scopeId`,`data-v-f1db1c0a`]]),hr=`litepaseo-theme`,gr=f((()=>{let e=localStorage.getItem(hr);return e===`light`||e===`dark`?e:`system`})()),_r=matchMedia(`(prefers-color-scheme: dark)`),vr=f(_r.matches);_r.addEventListener(`change`,e=>{vr.value=e.matches});var yr=D(()=>gr.value===`dark`||gr.value===`system`&&vr.value);function br(e=gr.value){gr.value=e,e===`system`?(delete document.documentElement.dataset.theme,localStorage.removeItem(hr)):(document.documentElement.dataset.theme=e,localStorage.setItem(hr,e))}var xr=[`system`,`light`,`dark`];function Sr(){br(xr[(xr.indexOf(gr.value)+1)%xr.length])}var Cr=/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1,wr=()=>matchMedia(`(display-mode: standalone)`).matches||navigator.standalone===!0,Tr=l(null),Er=f(wr());window.addEventListener(`beforeinstallprompt`,e=>{e.preventDefault(),Tr.value=e}),window.addEventListener(`appinstalled`,()=>{Tr.value=null,Er.value=!0});async function Dr(){let e=Tr.value;if(!e)return!1;await e.prompt();let{outcome:t}=await e.userChoice;return Tr.value=null,t===`accepted`}var Or=null;function kr(){return`serviceWorker`in navigator?(Or??=navigator.serviceWorker.register(`/sw.js`,{scope:`/`}).catch(()=>null),Or):Promise.resolve(null)}function Ar(){return window.isSecureContext?`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window?`supported`:Cr&&!wr()?`needs-install`:`unsupported`:`insecure`}async function jr(){let e=await kr();return e?e.pushManager.getSubscription():null}function Mr(e){let t=(e+`===`.slice((e.length+3)%4)).replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t);return Uint8Array.from(n,e=>e.charCodeAt(0))}async function Nr(e,t){let n=await Notification.requestPermission();if(n!==`granted`)throw Error(n===`denied`?`Notifications are blocked for this site in your browser settings.`:`Permission was not granted.`);let r=await kr();if(!r)throw Error(`Service worker unavailable.`);let{publicKey:i}=await e(`/push/key`),a=await r.pushManager.getSubscription();return a||=await r.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Mr(i)}),await e(`/push/subscribe`,`POST`,{subscription:a.toJSON(),prefs:t}),a}async function Pr(e,t,n){await e(`/push/subscribe`,`POST`,{subscription:t.toJSON(),prefs:n})}async function Fr(e){let t=await jr();t&&(await e(`/push/unsubscribe`,`POST`,{endpoint:t.endpoint}).catch(()=>{}),await t.unsubscribe().catch(()=>{}))}function Ir(e){let t=navigator;t.setAppBadge&&(e>0?t.setAppBadge(e):t.clearAppBadge?.())?.catch(()=>{})}var Lr={class:`page`},Rr={class:`page-head`},zr={class:`page-body`},Br={class:`card`},Vr={class:`card-row`},Hr={class:`setting-icon`},Ur={class:`grow`},Wr={class:`row-sub`},Gr=[`disabled`],Kr=[`disabled`],qr={class:`card-row switch-row`},Jr=[`disabled`],Yr={class:`card-row switch-row`},Xr=[`disabled`],Zr={class:`card-row`},Qr=[`disabled`],$r={key:0,class:`setting-note`},ei={key:1,class:`setting-note is-error`},ti={class:`card`},ni={class:`card-row`},ri={class:`setting-icon`},ii={class:`grow`},ai={class:`row-sub`},oi=[`disabled`],si={class:`card`},ci={class:`card-row`},li={class:`setting-icon`},ui={class:`grow`},di={class:`row-sub`},fi=[`disabled`],pi={key:0,class:`card-row totp-setup`},mi=[`src`],hi={class:`grow`},gi={class:`secret`},_i=[`disabled`],vi={key:1,class:`card-row`},yi=[`disabled`],bi={key:2,class:`setting-note is-error`},xi={class:`card`},Si={class:`setting-icon`},Ci={class:`grow`},wi={class:`row-title`},Ti={key:0,class:`pill pill-current`},Ei={class:`row-sub`},Di=[`disabled`,`onClick`],Oi={key:0,class:`card-row row-sub`},ki={class:`form-actions spaced`},Ai=[`disabled`],ji=t({__name:`Settings`,props:{request:{type:Function},totpEnabled:{type:Boolean}},emits:[`back`,`signedOut`,`totpChanged`],setup(e,{emit:t}){let n=e,r=t,i=Ar(),s=f(null),l=f({attention:!0,turns:!0}),u=f(typeof Notification>`u`?`default`:Notification.permission),d=f(!1),m=f(``),y=f(``);async function C(){if(i!==`supported`||(s.value=await jr(),!s.value))return;let e=await n.request(`/push/status`,`POST`,{endpoint:s.value.endpoint});e.subscribed?l.value=e.prefs:s.value=null}async function w(e){d.value=!0,y.value=m.value=``;try{await e()}catch(e){y.value=e.message}finally{d.value=!1,u.value=typeof Notification>`u`?`default`:Notification.permission}}let E=()=>w(async()=>{s.value=await Nr(n.request,l.value),m.value=`Notifications are on for this device.`}),O=()=>w(async()=>{await Fr(n.request),s.value=null}),k=()=>w(async()=>{s.value&&await Pr(n.request,s.value,l.value)}),j=()=>w(async()=>{let{sent:e}=await n.request(`/push/test`,`POST`,{});m.value=e?`Test sent. It should arrive in a few seconds.`:`This device is not registered.`}),P=f(!1);async function F(){P.value=!0;try{await Dr()}finally{P.value=!1}}let I=f([]),L=f(null),R=f(``),z=f(``),B=f(!1);async function ee(){I.value=await n.request(`/sessions`)}async function V(e){B.value=!0,z.value=``;try{await e()}catch(e){z.value=e.message}finally{B.value=!1}}let te=()=>V(async()=>{L.value=await n.request(`/totp/setup`,`POST`,{}),R.value=``}),H=()=>V(async()=>{await n.request(`/totp/confirm`,`POST`,{code:R.value.trim()}),L.value=null,R.value=``,r(`totpChanged`,!0)}),U=()=>V(async()=>{await n.request(`/totp/disable`,`POST`,{code:R.value.trim()}),R.value=``,r(`totpChanged`,!1)}),ne=e=>V(async()=>{await n.request(`/sessions/`+e.id,`DELETE`),e.current?r(`signedOut`):await ee()}),re=()=>V(async()=>{confirm(`Sign out every device, including this one? Their notifications stop too.`)&&(await n.request(`/sessions/revoke-all`,`POST`,{}),r(`signedOut`))}),W=e=>{let t=Math.max(0,(Date.now()-e)/1e3);return t<90?`just now`:t<5400?`${Math.round(t/60)} min ago`:t<129600?`${Math.round(t/3600)} h ago`:`${Math.round(t/86400)} days ago`},G=D(()=>u.value===`denied`);return S(()=>{C().catch(()=>{}),ee().catch(()=>{})}),(t,n)=>(c(),p(`section`,Lr,[T(`header`,Rr,[T(`button`,{class:`icon-btn back`,"aria-label":`Back`,onClick:n[0]||=e=>r(`back`)},[N(q,{name:`back`,size:18})]),n[6]||=T(`div`,null,[T(`h1`,null,`Settings`),T(`p`,{class:`subtle`},`Notifications, the app on your phone, and who can sign in.`)],-1)]),T(`div`,zr,[n[14]||=T(`h2`,{class:`section-label`},`Notifications`,-1),T(`div`,Br,[T(`div`,Vr,[T(`span`,Hr,[N(q,{name:`bell`,size:16})]),T(`div`,Ur,[n[7]||=T(`div`,{class:`row-title`},`Push notifications`,-1),T(`div`,Wr,[_(i)===`insecure`?(c(),p(g,{key:0},[h(`Needs HTTPS. Open the console through your tunnel's https:// address.`)],64)):_(i)===`needs-install`?(c(),p(g,{key:1},[h(`On iPhone and iPad, add LitePaseo to your Home Screen first, then open it from there.`)],64)):_(i)===`unsupported`?(c(),p(g,{key:2},[h(`This browser cannot receive push notifications.`)],64)):G.value?(c(),p(g,{key:3},[h(`Blocked in this browser's site settings. Allow notifications there, then return.`)],64)):s.value?(c(),p(g,{key:4},[h(`On for this device. Arrives even when the app is closed.`)],64)):(c(),p(g,{key:5},[h(`Get told when an agent needs you or a turn finishes, even with the app closed.`)],64))])]),_(i)===`supported`&&!s.value&&!G.value?(c(),p(`button`,{key:0,class:`btn btn-primary`,disabled:d.value,onClick:E},` Turn on `,8,Gr)):s.value?(c(),p(`button`,{key:1,class:`btn btn-outline`,disabled:d.value,onClick:O},`Turn off`,8,Kr)):v(``,!0)]),s.value?(c(),p(g,{key:0},[T(`label`,qr,[n[8]||=T(`div`,{class:`grow`},[T(`div`,{class:`row-title`},`When an agent needs your input`),T(`div`,{class:`row-sub`},`Permission requests and questions`)],-1),a(T(`input`,{"onUpdate:modelValue":n[1]||=e=>l.value.attention=e,class:`switch`,type:`checkbox`,disabled:d.value,onChange:k},null,40,Jr),[[b,l.value.attention]])]),T(`label`,Yr,[n[9]||=T(`div`,{class:`grow`},[T(`div`,{class:`row-title`},`When a turn finishes`),T(`div`,{class:`row-sub`},`Including failed turns`)],-1),a(T(`input`,{"onUpdate:modelValue":n[2]||=e=>l.value.turns=e,class:`switch`,type:`checkbox`,disabled:d.value,onChange:k},null,40,Xr),[[b,l.value.turns]])]),T(`div`,Zr,[n[10]||=T(`div`,{class:`grow row-sub`},`Not sent while you are viewing that conversation.`,-1),T(`button`,{class:`btn btn-outline`,disabled:d.value,onClick:j},`Send a test`,8,Qr)])],64)):v(``,!0)]),m.value?(c(),p(`p`,$r,x(m.value),1)):v(``,!0),y.value?(c(),p(`p`,ei,x(y.value),1)):v(``,!0),n[15]||=T(`h2`,{class:`section-label`},`App`,-1),T(`div`,ti,[T(`div`,ni,[T(`span`,ri,[N(q,{name:`phone`,size:16})]),T(`div`,ii,[n[11]||=T(`div`,{class:`row-title`},`Install LitePaseo`,-1),T(`div`,ai,[_(Er)?(c(),p(g,{key:0},[h(`Installed. You are using the app.`)],64)):_(Tr)?(c(),p(g,{key:1},[h(`Full screen, its own icon, and notifications.`)],64)):_(Cr)?(c(),p(g,{key:2},[h(`In Safari, tap Share, then “Add to Home Screen”.`)],64)):(c(),p(g,{key:3},[h(`Use your browser's menu: “Install app” or “Add to Home screen”.`)],64))])]),_(Tr)&&!_(Er)?(c(),p(`button`,{key:0,class:`btn btn-primary`,disabled:P.value,onClick:F},`Install`,8,oi)):v(``,!0)])]),n[16]||=T(`h2`,{class:`section-label`},`Sign-in`,-1),T(`div`,si,[T(`div`,ci,[T(`span`,li,[N(q,{name:`shield`,size:16})]),T(`div`,ui,[n[12]||=T(`div`,{class:`row-title`},`Authenticator code`,-1),T(`div`,di,x(e.totpEnabled?`On. Sign in with a 6-digit code from your authenticator app.`:`Sign in with a 6-digit code instead of the long access token.`),1)]),!e.totpEnabled&&!L.value?(c(),p(`button`,{key:0,class:`btn btn-outline`,disabled:B.value,onClick:te},`Set up`,8,fi)):v(``,!0)]),L.value?(c(),p(`div`,pi,[T(`img`,{src:L.value.qr,alt:`Authenticator QR code`,width:`164`,height:`164`},null,8,mi),T(`div`,hi,[n[13]||=T(`p`,{class:`row-sub`},`Scan with Google Authenticator, 1Password, Authy or similar. Or enter this key:`,-1),T(`code`,gi,x(L.value.secret.match(/.{1,4}/g)?.join(` `)),1),T(`form`,{class:`code-form`,onSubmit:M(H,[`prevent`])},[a(T(`input`,{"onUpdate:modelValue":n[3]||=e=>R.value=e,inputmode:`numeric`,autocomplete:`one-time-code`,maxlength:`6`,placeholder:`123456`,"aria-label":`Code from your app`},null,512),[[A,R.value]]),T(`button`,{class:`btn btn-primary`,disabled:B.value||R.value.trim().length!==6},`Turn on`,8,_i),T(`button`,{type:`button`,class:`btn btn-ghost`,onClick:n[4]||=e=>L.value=null},`Cancel`)],32)])])):v(``,!0),e.totpEnabled?(c(),p(`div`,vi,[T(`form`,{class:`code-form grow`,onSubmit:M(U,[`prevent`])},[a(T(`input`,{"onUpdate:modelValue":n[5]||=e=>R.value=e,inputmode:`numeric`,autocomplete:`one-time-code`,maxlength:`6`,placeholder:`Current code`,"aria-label":`Current code`},null,512),[[A,R.value]]),T(`button`,{class:`btn btn-outline`,disabled:B.value||R.value.trim().length!==6},`Turn off`,8,yi)],32)])):v(``,!0)]),z.value?(c(),p(`p`,bi,x(z.value),1)):v(``,!0),n[17]||=T(`h2`,{class:`section-label`},`Signed-in devices`,-1),T(`div`,xi,[(c(!0),p(g,null,o(I.value,e=>(c(),p(`div`,{key:e.id,class:`card-row`},[T(`span`,Si,[N(q,{name:/iOS|Android/.test(e.label)?`phone`:`monitor`,size:16},null,8,[`name`])]),T(`div`,Ci,[T(`div`,wi,[h(x(e.label),1),e.current?(c(),p(`span`,Ti,`This device`)):v(``,!0)]),T(`div`,Ei,`Active `+x(W(e.lastSeen))+` · signed in `+x(new Date(e.created).toLocaleDateString()),1)]),T(`button`,{class:`btn btn-outline`,disabled:B.value,onClick:t=>ne(e)},x(e.current?`Sign out`:`Revoke`),9,Di)]))),128)),I.value.length?v(``,!0):(c(),p(`div`,Oi,`Signed in with the access token only.`))]),T(`div`,ki,[T(`button`,{class:`btn btn-ghost`,disabled:B.value,onClick:re},`Sign out everywhere`,8,Ai)])])]))}}),Mi={class:`agent-board`},Ni=[`title`],Pi={class:`count`},Fi=[`onClick`,`onKeydown`],Ii={class:`task-top`},Li={class:`task-title`},Ri={class:`task-meta`},zi=[`onClick`],Bi=[`disabled`,`onClick`],Vi=[`disabled`,`onClick`],Hi=[`disabled`,`onClick`],Ui=[`onClick`],Wi={key:1,class:`column-empty`},Gi=40,Ki=t({__name:`AgentBoard`,props:{store:{},hostLabels:{},busy:{type:Boolean}},emits:[`open`,`stop`,`read`,`archive`],setup(e,{emit:t}){let n=e,r=t,i={needs_input:`Needs you`,running:`Running`,review:`To review`,done:`Done`},a={needs_input:`Waiting on a permission or an answer`,running:`Working right now`,review:`Finished or failed, not looked at yet`,done:`Seen and settled`},s=d({needs_input:Gi,running:Gi,review:Gi,done:Gi}),l=D(()=>(n.store.version.value,ee.map(e=>({lane:e,size:n.store.laneSize(e),agents:n.store.laneRange(e,0,s[e])})))),u=e=>{if(!e||e<15778368e5)return``;let t=Math.max(0,(Date.now()-e)/1e3);return t<60?`just now`:t<3600?`${Math.round(t/60)} min ago`:t<86400?`${Math.round(t/3600)} h ago`:`${Math.round(t/86400)} d ago`},f=e=>{if(e.state===`needs_input`){let t=e.pendingPermissions[0];return t?`${t.kind===`question`?`Asks:`:`Wants to`} ${te(t.title||t.name)}`:`Waiting for you`}return e.state===`failed`?e.lastError||`Turn failed`:e.state===`running`?`Working…`:e.state===`unread`?`Finished ${u(e.activityAt)}`:u(e.activityAt)};return(t,n)=>(c(),p(`div`,Mi,[(c(!0),p(g,null,o(l.value,t=>(c(),p(`section`,{key:t.lane,class:j([`lane`,`lane-`+t.lane])},[T(`header`,{class:`lane-head`,title:a[t.lane]},[n[1]||=T(`span`,{class:`lane-dot`},null,-1),T(`h3`,null,x(i[t.lane]),1),T(`span`,Pi,x(t.size),1)],8,Ni),(c(!0),p(g,null,o(t.agents,t=>(c(),p(`article`,{key:t.key,class:j([`task-card`,`is-`+t.state]),tabindex:`0`,onClick:e=>r(`open`,t.key),onKeydown:w(e=>r(`open`,t.key),[`enter`])},[T(`div`,Ii,[T(`span`,{class:j([`status-dot`,`is-`+(t.state===`needs_input`?`attention`:t.state===`failed`?`error`:t.state)])},null,2),T(`span`,Li,x(t.title||`Untitled session`),1)]),T(`div`,Ri,x(t.project)+` · `+x(e.hostLabels.get(t.hostId)??`?`)+` · `+x(t.provider),1),T(`div`,{class:j([`task-detail`,{"is-error":t.state===`failed`}])},x(f(t)),3),T(`div`,{class:`task-actions`,onClick:n[0]||=M(()=>{},[`stop`])},[t.state===`needs_input`?(c(),p(`button`,{key:0,class:`btn btn-primary btn-sm`,onClick:e=>r(`open`,t.key)},`Respond`,8,zi)):v(``,!0),t.state===`running`?(c(),p(`button`,{key:1,class:`btn btn-outline btn-sm`,disabled:e.busy,onClick:e=>r(`stop`,t)},[N(q,{name:`stop`,size:11}),n[2]||=h(`Stop `,-1)],8,Bi)):v(``,!0),t.unread?(c(),p(`button`,{key:2,class:`btn btn-outline btn-sm`,disabled:e.busy,onClick:e=>r(`read`,t)},[N(q,{name:`check`,size:12}),n[3]||=h(`Mark read `,-1)],8,Vi)):v(``,!0),t.state!==`running`&&t.state!==`needs_input`?(c(),p(`button`,{key:3,class:`btn btn-ghost btn-sm`,disabled:e.busy,onClick:e=>r(`archive`,t)},` Archive `,8,Hi)):v(``,!0)])],42,Fi))),128)),t.size>s[t.lane]?(c(),p(`button`,{key:0,class:`btn btn-ghost lane-more`,onClick:e=>s[t.lane]+=Gi},` Show `+x(Math.min(Gi,t.size-s[t.lane]))+` more `,9,Ui)):v(``,!0),t.size?v(``,!0):(c(),p(`p`,Wi,`Nothing here`))],2))),128))]))}}),qi={key:0,class:`usage`},Ji=[`aria-expanded`],Yi={class:`usage-name`},Xi={key:0,class:`usage-card`,role:`dialog`,"aria-label":`Usage limits`},Zi=[`disabled`],Qi={key:0,class:`spinner spinner-sm`},$i={class:`usage-account-head`},ea={class:`row-title`},ta={class:`row-sub`},na={key:0,class:`row-sub is-error`},ra={class:`usage-window-head`},ia={class:`usage-bar`},aa={class:`usage-window-foot`},oa={class:`usage-foot`},sa=t({__name:`UsagePanel`,props:{report:{},loading:{type:Boolean}},emits:[`refresh`],setup(e,{emit:t}){let n=e,r=t,i=f(!1);function a(e){let t=`${e.shortLabel??``} ${e.label}`.toLowerCase();return/5\s*h|5-hour|five/.test(t)?18e6:/wk|week/.test(t)?6048e5:/month|mo\b/.test(t)?2592e6:null}function s(e){let t=a(e);if(e.remainingPct===null||!e.resetsAt||!t)return null;let n=Date.parse(e.resetsAt)-Date.now(),r=t<=18e6?36e5:864e5;if(n<=r)return null;let i=e.remainingPct/(n/r),o=i/(100/(t/r));return{text:`${i.toFixed(+(i<10))}% per ${r===36e5?`hour`:`day`}`,tone:o>=.85?`ok`:o>=.5?`warning`:`danger`}}function l(e){return e.remainingPct===null?`default`:e.remainingPct<10?`danger`:e.remainingPct<30?`warning`:`ok`}function u(e){if(!e.resetsAt)return``;let t=new Date(e.resetsAt),n=t.getTime()-Date.now();if(n<=0)return`resetting`;let r=new Date,i=new Date(r.getTime()+864e5),a=t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),o=t.toDateString()===r.toDateString()?`today`:t.toDateString()===i.toDateString()?`tomorrow`:t.toLocaleDateString([],{weekday:`short`,month:`numeric`,day:`numeric`}),s=Math.floor(n/36e5),c=Math.round(n%36e5/6e4);return`${o} ${a} · in ${s>=24?`${Math.floor(s/24)}d ${s%24}h`:s?`${s}h ${c}m`:`${c}m`}`}let d=D(()=>n.report?.accounts.filter(e=>e.windows.length||e.error)??[]),m=e=>e.shortLabel??e.label;return(t,n)=>d.value.length?(c(),p(`div`,qi,[T(`button`,{class:`usage-summary`,"aria-expanded":i.value,onClick:n[0]||=e=>i.value=!i.value},[(c(!0),p(g,null,o(d.value,e=>(c(),p(`span`,{key:e.key,class:`usage-line`},[T(`span`,Yi,x(e.name),1),(c(!0),p(g,null,o(e.windows.slice(0,3),e=>(c(),p(`span`,{key:e.id,class:j([`usage-pct`,`tone-`+l(e)])},[h(x(e.remainingPct===null?`—`:Math.round(e.remainingPct)+`%`),1),T(`small`,null,x(m(e)),1)],2))),128))]))),128))],8,Ji),i.value?(c(),p(`div`,Xi,[T(`header`,null,[n[3]||=T(`strong`,null,`Usage left`,-1),T(`button`,{class:`icon-btn`,disabled:e.loading,title:`Refresh`,"aria-label":`Refresh usage`,onClick:n[1]||=e=>r(`refresh`)},[e.loading?(c(),p(`span`,Qi)):(c(),y(q,{key:1,name:`refresh`,size:14}))],8,Zi),T(`button`,{class:`icon-btn`,"aria-label":`Close`,onClick:n[2]||=e=>i.value=!1},[N(q,{name:`close`,size:14})])]),(c(!0),p(g,null,o(d.value,e=>(c(),p(`section`,{key:e.key,class:`usage-account`},[T(`div`,$i,[T(`span`,ea,x(e.name),1),T(`span`,ta,x([e.plan,e.hosts.join(`, `)].filter(Boolean).join(` · `)),1)]),e.error?(c(),p(`p`,na,x(e.error),1)):v(``,!0),(c(!0),p(g,null,o(e.windows,e=>(c(),p(`div`,{key:e.id,class:`usage-window`},[T(`div`,ra,[T(`span`,null,x(e.label),1),T(`strong`,{class:j(`tone-`+l(e))},x(e.remainingPct===null?`—`:Math.round(e.remainingPct)+`% left`),3)]),T(`div`,ia,[T(`span`,{class:j(`tone-`+l(e)),style:k({width:Math.max(0,Math.min(100,e.remainingPct??0))+`%`})},null,6)]),T(`div`,aa,[T(`span`,null,x(u(e)),1),s(e)?(c(),p(`span`,{key:0,class:j(`tone-`+s(e).tone)},x(s(e).text),3)):v(``,!0)])]))),128))]))),128)),(c(!0),p(g,null,o(e.report?.unavailableHosts??[],e=>(c(),p(`p`,{key:e.hostId,class:`row-sub`},x(e.label)+`: `+x(e.error),1))),128)),T(`p`,oa,` Updated `+x(e.report?.fetchedAt?new Date(e.report.fetchedAt).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):`—`)+` · hosts cache usage for 5 min `,1)])):v(``,!0)])):v(``,!0)}}),ca={key:0,class:`login`},la={class:`field`},ua={class:`hint`},da={class:`field`},fa={class:`hint`},pa=[`disabled`],ma={key:2,class:`form-error`},ha={class:`sidebar`},ga={class:`sidebar-head`},_a={class:`head-actions`},va=[`title`],ya=[`title`,`aria-label`],ba={class:`tabs`},xa={class:`count`},Sa={class:`count`},Ca={class:`search`},wa={key:0,class:`host-filter`,role:`radiogroup`,"aria-label":`Filter by host`},Ta=[`aria-checked`],Ea={class:`chip-count`},Da=[`aria-checked`,`title`,`onClick`],Oa={class:`chip-count`},ka={class:`list-toolbar`},Aa={class:`segmented segmented-sm`,role:`radiogroup`,"aria-label":`Group sessions`},ja={class:`list-summary`},Ma={class:`main`},Na={key:0,class:`toast`,role:`alert`},Pa={key:2,class:`page`},Fa={class:`page-head`},Ia={class:`page-body`},La={class:`card`},Ra={class:`grow`},za={class:`row-title`},Ba={class:`row-sub`},Va={key:0,role:`status`},Ha={key:1,class:`row-sub`},Ua={key:2,class:`row-sub`},Wa={key:3,class:`row-sub`},Ga=[`disabled`,`onClick`],Ka={key:0,class:`card-row muted-text`},qa={class:`field`},Ja={class:`field`},Ya={class:`form-actions`},Xa=[`disabled`],Za={key:3,class:`page`},Qa={class:`page-head`},$a={class:`subtle`},eo={class:`segmented head-toggle`,role:`radiogroup`,"aria-label":`Board`},to={class:`page-body wide`},no=[`disabled`],ro={key:0,class:`subtle small`},io={class:`board`},ao={class:`column-head`},oo={class:`count`},so={class:`row-title`},co=[`onClick`],lo={class:`kanban-actions`},uo=[`value`,`onChange`],fo=[`onClick`],po={key:0,class:`column-empty`},mo={key:4,class:`chat`},ho={class:`chat-head`},go={class:`grow`},_o={class:`chat-title`},vo={class:`chat-meta`},yo={key:0,class:`hide-sm`},bo={class:`hide-sm`},xo={key:0,class:`agent-tabs`,"aria-label":`Agents in this thread`},So=[`onClick`],Co={class:`agent-tab-name`},wo={class:`timeline-inner`},To={key:0,class:`older`},Eo=[`disabled`],Do={key:1,class:`notice`},Oo={key:2,class:`older`},ko=[`disabled`],Ao=[`disabled`],jo={key:3,class:`timeline-empty`},Mo={key:0,class:`spinner`},No={class:`dock`},Po={class:`dock-inner`},Fo={key:0,role:`status`},Io={key:1,role:`status`},Lo={key:2},Ro={style:{"white-space":`pre-wrap`}},zo=[`onClick`],Bo={key:3,class:`uncertain`},Vo={class:`grow`},Ho=[`disabled`],Uo=[`placeholder`,`required`],Wo={class:`composer-bar`},Go={key:0,class:`segmented`,role:`radiogroup`,"aria-label":`While a turn is running`},Ko={key:1,class:`composer-hint hide-sm`},qo={class:`composer-actions`},Jo=[`disabled`],Yo=[`disabled`],Xo={key:5,class:`empty`},Zo={key:6,class:`empty`},Qo={class:`empty-mark`},$o=t({__name:`App`,setup(e){let t=[`Todo`,`Doing`,`Done`],n=matchMedia(`(pointer: coarse)`).matches;function i(e,t){try{return JSON.parse(localStorage.getItem(e)??`null`)??t}catch{return t}}let d=f(``),m=f(``),b=f(null),S=f(!1),w=f(!1),E=f(``),O=f(!1),k=l([]),P=new se({collapsed:i(`litepaseo-collapsed-projects`,[]),persist:e=>localStorage.setItem(`litepaseo-collapsed-projects`,JSON.stringify(e)),compare:ne}),F=new se({indexBy:e=>e.workspaceId?`${e.hostId}:${e.workspaceId}`:null}),I=f(null),L=f(localStorage.getItem(`litepaseo-list-mode`)===`recent`?`recent`:`projects`),R=f(`closed`),z=f(null),B=l(new De),ee=f(``),V=l(null),te=f(!1),H=f([]),U=f(null),re=f(null),W=f(``),G=f(!1),ie=f(``),ae=f(``),oe=f(`steer`),K=f(`chat`),ce=f(``),le=f({revision:0,cards:[]}),J=new we(()=>localStorage),de=new qn,fe=f(null),pe=D(()=>z.value?de.get(z.value):[]),me=D(()=>pe.value.every(e=>!!e.id&&!e.uploading&&!e.error));function he(e){e.clipboardData?.files.length&&(e.preventDefault(),fe.value?.addFiles(e.clipboardData.files))}let ge=D({get:()=>z.value?J.state(z.value).text:``,set:e=>{z.value&&J.setText(z.value,e)}}),_e=D(()=>z.value?J.unresolved(z.value)[0]??null:null),ve=D(()=>z.value?J.saved(z.value).filter(e=>e.text!==ge.value):[]),ye=f(!1),xe=f(``);async function Se(){let e=Y.value;if(!e||O.value||ye.value||document.hidden)return;let t=J.unresolved(e.key);if(!t.length)return;let n=J.generation;ye.value=!0;try{let r=await Z($(e)+`/messages/status`,`POST`,{messageIds:t.slice(0,20).map(e=>e.messageId)});if(n!==J.generation)return;for(let n of r.confirmed??[]){let r=t.find(e=>e.messageId===n);r&&(de.consume(e.key,r.attachmentIds??[]),J.confirm(e.key,n))}Y.value?.key===e.key&&(xe.value=r.confirmed?.length?`Delivery confirmed from conversation history.`:`Not confirmed yet. No message has been resent.`)}catch{Y.value?.key===e.key&&(xe.value=`Unable to check delivery. Your message remains saved.`)}finally{ye.value=!1}}let Ce=setInterval(()=>void Se(),15e3);u([z,O],()=>{xe.value=``,Se()});function Te(){z.value&&_e.value&&J.resolve(z.value,_e.value.messageId)}function Ee(e){e.storageArea===localStorage&&(e.key===`litepaseo-composer-signout`?J.clear():J.onStorage(e.key,e.newValue))}window.addEventListener(`storage`,Ee);let Oe=D(()=>new Map(k.value.map(e=>[e.id,e.label]))),Ae=D(()=>new Map(k.value.map(e=>[e.id,e.state]))),je=D(()=>k.value.filter(e=>e.state===`connected`).length),Y=D(()=>(F.version.value,F.get(z.value)??null)),Ne=D(()=>(P.version.value,P.get(I.value)??null)),Pe=D(()=>(F.version.value,F.indexed(I.value,12))),Fe=D(()=>(P.version.value,P.total)),Ie=D(()=>(P.version.value,P.size)),Le=D(()=>(P.version.value,P.projectCount));u(L,e=>localStorage.setItem(`litepaseo-list-mode`,e));let X=f(localStorage.getItem(`litepaseo-host-filter`));u(X,e=>{P.setHost(e),F.setHost(e),e?localStorage.setItem(`litepaseo-host-filter`,e):localStorage.removeItem(`litepaseo-host-filter`)},{immediate:!0}),u(k,e=>{X.value&&e.length&&!e.some(e=>e.id===X.value)&&(X.value=null)});let Re=D(()=>(P.version.value,new Map(k.value.map(e=>[e.id,P.hostSize(e.id)])))),ze=D(()=>{let e=Y.value?.cwd??``;return e.replace(/\/+$/,``).split(`/`).pop()||e}),Be=D(()=>Y.value?.status===`running`),Ve=D(()=>{if(V.value)return V.value;let e=B.value;return e.membership.value,e.rows.slice(-150)}),He=D(()=>R.value===`live`&&Ae.value.get(Y.value?.hostId??``)===`connected`&&Y.value?.turnActive===!1),Ue=D(()=>{let e=B.value;return e.membership.value,e.rows.at(-1)?.seqStart}),We=D(()=>{if(V.value)return te.value;let e=B.value;return e.membership.value,e.rows.length>150||e.hasOlder}),Ge=D(()=>{let e=new Map(t.map(e=>[e,[]]));for(let t of le.value.cards)e.get(t.column)?.push(t);return e}),Ke=D(()=>R.value===`live`?`Live`:R.value===`paused`?`Paused`:`Reconnecting`),qe=null,Je=null,Ye;async function Z(e,t=`GET`,n,r=2e4){let i=await fetch(`/api`+e,{method:t,headers:{"Content-Type":`application/json`,"x-litepaseo":`1`},body:n===void 0?void 0:JSON.stringify(n),signal:AbortSignal.timeout(r)}),a=await i.json().catch(()=>({}));if(i.status===401&&w.value&&e!==`/login`&&Ze(`ended`),!i.ok)throw Object.assign(Error((a.error??`Request failed`)+(a.requestId?` (reference ${a.requestId})`:``)),{delivery:a.delivery});return a}async function Q(e){O.value=!0,E.value=``;try{await e()}catch(e){E.value=String(e.message)}finally{O.value=!1}}function $(e){return`/hosts/${encodeURIComponent(e.hostId)}/agents/${encodeURIComponent(e.id)}`}function Ze(e){if(w.value=!1,e===`user`){J.clear(),de.clear();try{localStorage.setItem(`litepaseo-composer-signout`,crypto.randomUUID())}catch{}}else de.forgetRemote(`Sign in again, then retry the upload.`);qe?.close(),Je?.close(),qe=Je=null,d.value=m.value=``,Qe(),E.value=e===`ended`?`Your session ended. Sign in again; your drafts are kept.`:``}async function Qe(){try{b.value=await Z(`/auth`)}catch{b.value={authenticated:!1,totp:!1};return}b.value.authenticated&&await et()}async function $e(){await Q(async()=>{await Z(`/login`,`POST`,b.value?.totp&&!S.value?{code:m.value.trim()}:{token:d.value.trim()}),await et()})}async function et(){w.value=!0,E.value=``,le.value=await Z(`/board`),nt(),kr(),ft(),Vt(),clearInterval(Bt),Bt=setInterval(()=>void Vt(),3e5);let e=new URLSearchParams(location.search).get(`session`);e&&(history.replaceState(history.state,``,`/`),ot(e))}function tt(){m.value=m.value.replace(/\D/g,``).slice(0,6),m.value.length===6&&!O.value&&$e()}navigator.serviceWorker?.addEventListener(`message`,e=>{e.data?.type===`open-session`&&w.value&&ot(String(e.data.key))});function nt(){qe?.close(),qe=Me({url:()=>`/api/stream?generation=${encodeURIComponent(F.generation)}&since=${F.seq}&wgeneration=${encodeURIComponent(P.generation)}&wsince=${P.seq}`,onState:e=>{R.value=e,e===`unauthorized`&&Ze(`ended`)},onMessage:e=>{let t=e;t.type===`hosts`?k.value=t.hosts:t.type===`workspaces-snapshot`?P.applyCollection({type:`snapshot`,generation:t.generation,seq:t.seq,items:t.workspaces}):t.type===`workspaces-changes`?P.applyCollection({type:`changes`,generation:t.generation,seq:t.seq,changes:t.changes}):F.apply(t)}})}u(W,e=>{clearTimeout(Ye),Ye=setTimeout(()=>{let t=e.trim().toLowerCase();if(!t){P.setFilter(null),F.setFilter(null);return}let n=Oe.value;P.setFilter(e=>`${e.name}\n${e.project}\n${e.branch??``}\n${e.directory}\n${n.get(e.hostId)??``}`.toLowerCase().includes(t)),F.setFilter(e=>`${e.title??``}\n${e.project}\n${e.cwd}\n${n.get(e.hostId)??``}\n${e.provider}`.toLowerCase().includes(t))},120)});let rt=!0;u(U,(e,t,n)=>{let r=e?.querySelector(`.timeline-inner`);if(!e||!r)return;let i=()=>{rt=it()},a=new ResizeObserver(()=>{!V.value&&rt&&at()});e.addEventListener(`scroll`,i,{passive:!0}),a.observe(r),n(()=>{a.disconnect(),e.removeEventListener(`scroll`,i)})},{flush:`post`});function it(){let e=U.value;return!e||e.scrollHeight-e.scrollTop-e.clientHeight<120}function at(){rt=!0,C(()=>{let e=U.value;e&&(e.scrollTop=e.scrollHeight)})}function ot(e){K.value=`chat`,z.value=e;let t=F.get(e);I.value=t?.workspaceId?`${t.hostId}:${t.workspaceId}`:null,lt()}function st(e){K.value=`chat`,I.value=e,z.value=F.indexed(e,1)[0]?.key??null,lt()}u(Y,e=>{e?.workspaceId&&!I.value&&(I.value=`${e.hostId}:${e.workspaceId}`)}),u(Pe,e=>{I.value&&e.length&&!e.some(e=>e.key===z.value)&&(z.value=e[0].key)});let ct=matchMedia(`(max-width: 760px)`);function lt(){!G.value&&ct.matches&&history.pushState({litepaseoDetail:!0},``),G.value=!0}function ut(){history.state?.litepaseoDetail?history.back():G.value=!1}function dt(){G.value&&!history.state?.litepaseoDetail&&(G.value=!1)}window.addEventListener(`popstate`,dt);let mt=f(null);function ht(e){let t=e.target,n=!!t&&(t.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName));e.key===`k`&&(e.metaKey||e.ctrlKey)||e.key===`/`&&!n?(e.preventDefault(),G.value&&ct.matches&&ut(),mt.value?.focus(),mt.value?.select()):e.key===`n`&&!n&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&w.value&&!gt.value?(e.preventDefault(),_t()):e.key===`Escape`&&t===mt.value&&W.value&&(W.value=``)}window.addEventListener(`keydown`,ht);let gt=f(null);function _t(e){let t=e?e.items.at(0):P.range(0,1)[0];gt.value={hostId:X.value??t?.hostId??Y.value?.hostId??null,cwd:t?.rootPath??null,project:t?{key:t.projectKey,name:t.project}:null}}function vt(e){gt.value=null,W.value&&=``,ot(e)}let yt=D(()=>(!!z.value||!!I.value)&&!Y.value),bt=l(null),xt=l(null);function St(e){return`/hosts/${encodeURIComponent(e.hostId)}/workspaces/${encodeURIComponent(e.id)}`}function Ct(e,t,n){bt.value={thread:e,x:t,y:n}}function wt(e){let t=Ne.value;if(!t)return;let n=e.currentTarget.getBoundingClientRect();Ct(t,n.right-200,n.bottom+6)}async function Tt(e){let t=xt.value;t&&await Q(async()=>{await Z(St(t)+`/title`,`POST`,{title:e}),xt.value=null})}async function Et(e,t){await Q(async()=>void await Z(St(e)+`/pin`,`POST`,{pinned:t}))}async function Dt(e){await Q(async()=>{await Z(St(e)+`/unread`,`POST`,{}),I.value===e.key&&(I.value=z.value=null,ut())})}async function Ot(e){await Q(async()=>void await Z(St(e)+`/read`,`POST`,{}))}async function kt(e){confirm(`Archive “${e.name}”? It leaves the sidebar; the host keeps its history.`)&&await Q(async()=>{await Z(St(e)+`/archive`,`POST`,{}),I.value===e.key&&(I.value=z.value=null)})}let At=``;u(()=>Ne.value?.unread&&B.value.membership.value>=0&&B.value.ready?Ne.value:null,e=>{if(!e||document.hidden)return;let t=`${e.key}@${e.activityAt}`;At!==t&&(At=t,Z(St(e)+`/read`,`POST`,{}).catch(()=>At=``))});let jt=f(localStorage.getItem(`litepaseo-board-mode`)===`plan`?`plan`:`agents`);u(jt,e=>localStorage.setItem(`litepaseo-board-mode`,e));async function Mt(e){await Q(async()=>void await Z($(e)+`/stop`,`POST`))}async function Nt(e){await Q(async()=>void await Z($(e)+`/read`,`POST`,{}))}async function Pt(e){confirm(`Archive “${e.title||`this session`}”? It leaves the board and sidebar; the host keeps its history.`)&&await Q(async()=>void await Z($(e)+`/archive`,`POST`,{}))}let Ft=``;u(()=>Y.value&&Y.value.unread&&B.value.membership.value>=0&&B.value.ready?Y.value:null,e=>{if(!e||document.hidden)return;let t=`${e.key}@${e.activityAt}`;Ft!==t&&(Ft=t,Z($(e)+`/read`,`POST`,{}).catch(()=>Ft=``))});let It=f(null);r(pt,{predict:e=>{let t=Y.value;return t?Z($(t)+`/suggestion`,`POST`,{token:e},65e3):Promise.resolve({status:`expired`,text:``})},use:e=>{ge.value=e,C(()=>{Gt(),re.value?.focus()})},send:e=>void Jt(e),offer:(e,t)=>{let n=Y.value;n&&(!It.value||It.value.key!==n.key||e>=It.value.seqStart)&&(It.value={key:n.key,seqStart:e,text:t})}});let Lt=D(()=>It.value&&It.value.key===Y.value?.key&&!ge.value?It.value.text:``),Rt=l(null),zt=f(!1),Bt;async function Vt(e=!1){if(w.value&&!document.hidden){zt.value=!0;try{Rt.value=await Z(`/usage`+(e?`?refresh=1`:``))}catch{}finally{zt.value=!1}}}u(z,()=>{It.value=null}),u(()=>Y.value?.key??null,e=>{Je?.close(),Je=null;let t=new De;B.value=t,V.value=null,H.value=[],ee.value=``;let n=F.get(e);n&&(Je=Me({url:()=>`/api`+$(n)+`/timeline/stream`,onState:e=>{e===`unauthorized`&&Ze(`ended`)},onMessage:e=>{if(B.value!==t)return;let n=!V.value&&(it()||!t.ready),r=e.ops,i=r.find(e=>e.type===`error`);ee.value=i?.type===`error`?i.message:``;let a=t.epoch;t.apply(r),a&&a!==t.epoch&&(V.value=null,H.value=[],at()),n&&at()}}))});function Ut(){V.value=null,H.value=[],at()}async function Wt(e){let t=B.value,n=U.value,r=Ve.value.map(e=>({seqStart:e.seqStart,row:l(e.row.value)})),i=e===`before`?r[0]:r.at(-1),a=Y.value;if(!a||!i)return;let o=t.epoch,s=n?.getBoundingClientRect(),c=n?Array.from(n.querySelectorAll(`[data-seq-start]`)).filter(e=>e.getBoundingClientRect().bottom>s.top&&e.getBoundingClientRect().top<s.bottom):[],u=e===`before`?c[0]:c.at(-1),d=u?.dataset.seqStart,f=u?.getBoundingClientRect().top,p=e===`before`?i.seqStart:H.value.at(-1);if(p===void 0)return;let m={epoch:o,seq:p};await Q(async()=>{let i=await Z($(a)+`/timeline?cursor=`+encodeURIComponent(JSON.stringify(m)));if(B.value!==t||t.epoch!==o)return;if(i.epoch!==o){Ut();return}let s=ke(r,i,e);if(e===`after`&&!s.added){Ut();return}e===`before`&&s.added&&H.value.push(r.at(-1).seqStart+1),e===`after`&&H.value.pop(),V.value=s.rows,te.value=s.hasOlder,await C();let c=n?.querySelector(`[data-seq-start="${d}"]`);n&&c&&f!==void 0?n.scrollTop+=c.getBoundingClientRect().top-f:n&&(n.scrollTop=e===`before`?0:n.scrollHeight)})}function Gt(){let e=re.value;e&&(e.style.height=`auto`,e.style.height=Math.min(e.scrollHeight,Math.round(window.innerHeight*.4))+`px`)}function Kt(e){e.key===`Tab`&&!e.shiftKey&&Lt.value?(e.preventDefault(),ge.value=Lt.value,C(Gt)):e.key!==`Enter`||e.isComposing||(!n&&!e.shiftKey||e.metaKey||e.ctrlKey)&&(e.preventDefault(),qt())}async function qt(){await Jt(ge.value,!0)}async function Jt(e,t=!1){let n=Y.value;if(!n||!e.trim()&&(!t||!pe.value.length)||_e.value||O.value||t&&!me.value)return;let r=J.state(n.key),i=J.generation,a=t?[...pe.value]:[],o={text:e,messageId:crypto.randomUUID(),attachmentIds:a.map(e=>e.id),attachmentNames:a.map(e=>e.file.name)};J.begin(n.key,o),t&&J.setText(n.key,``),await Q(async()=>{try{if(await Z($(n)+`/messages`,`POST`,{...o,behavior:oe.value}),i!==J.generation)return;J.resolve(n.key,o.messageId),de.consume(n.key,o.attachmentIds),z.value===n.key&&(It.value=null),C(Gt),z.value===n.key&&Ut()}catch(e){if(i!==J.generation)return;if(t&&!r.text&&J.restoreFailed(n.key,o),e.delivery===`not-sent`){J.resolve(n.key,o.messageId);for(let e of a)e.error=`Not sent. Retry the upload or remove this attachment.`}throw e}})}async function Yt(){let e=Y.value;e&&await Q(async()=>void await Z($(e)+`/stop`,`POST`))}async function Xt(e,t){let n=Y.value;n&&await Q(async()=>{await Z($(n)+`/permissions/`+encodeURIComponent(e.id),`POST`,t)})}async function Zt(){await Q(async()=>{await Z(`/hosts`,`POST`,{label:ie.value,connection:ae.value}),ie.value=``,ae.value=``})}async function Qt(e){confirm(`Disconnect and remove ${e.label}? Its agents keep running on the host.`)&&await Q(async()=>void await Z(`/hosts/`+e.id,`DELETE`))}async function $t(e){try{le.value=await Z(`/board`,`PUT`,{revision:le.value.revision,cards:e})}catch(e){throw le.value=await Z(`/board`),e}}async function en(){await Q(async()=>{ce.value.trim()&&(await $t([...le.value.cards,{id:crypto.randomUUID(),title:ce.value,column:`Todo`,hostId:Y.value?.hostId??null,agentId:Y.value?.id??null}]),ce.value=``)})}async function tn(e,t){await Q(()=>$t(le.value.cards.map(n=>n.id===e.id?{...n,column:t}:n)))}function nn(e){e.hostId&&e.agentId&&ot(`${e.hostId}:${e.agentId}`)}function rn(e){K.value=e,e!==`chat`||z.value?lt():ut()}Qe();let an=D(()=>(P.version.value,F.waiting));return u(an,e=>{Ir(e),document.title=e?`(${e}) LitePaseo`:`LitePaseo`}),document.addEventListener(`visibilitychange`,()=>{document.hidden||Vt()}),s(()=>{clearInterval(Bt),clearInterval(Ce),de.clear(),window.removeEventListener(`storage`,Ee),window.removeEventListener(`popstate`,dt),window.removeEventListener(`keydown`,ht),qe?.close(),Je?.close(),clearTimeout(Ye)}),(e,r)=>w.value?(c(),p(`div`,{key:1,class:j([`shell`,{"detail-open":G.value}])},[T(`aside`,ha,[T(`div`,ga,[r[45]||=T(`div`,{class:`brand`},[T(`span`,{class:`brand-mark`}),h(`LitePaseo`)],-1),T(`div`,_a,[T(`span`,{class:j([`live`,`is-`+R.value]),title:`Directory stream: `+R.value},[r[44]||=T(`span`,{class:`live-dot`},null,-1),h(x(Ke.value),1)],10,va),T(`button`,{class:j([`icon-btn theme-btn`,{chosen:K.value===`settings`}]),title:`Settings`,"aria-label":`Settings`,onClick:r[4]||=e=>rn(`settings`)},[N(q,{name:`gear`,size:15})],2),T(`button`,{class:`icon-btn theme-btn`,title:`Theme: `+_(gr)+` (click to change)`,"aria-label":`Theme: `+_(gr),onClick:r[5]||=(...e)=>_(Sr)&&_(Sr)(...e)},[N(q,{name:_(gr)===`dark`?`moon`:_(gr)===`light`?`sun`:`monitor`,size:15},null,8,[`name`])],8,ya)])]),T(`nav`,ba,[T(`button`,{class:j({chosen:K.value===`chat`}),onClick:r[6]||=e=>rn(`chat`)},[N(q,{name:`chat`}),r[46]||=h(`Sessions`,-1),T(`span`,xa,x(Fe.value),1)],2),T(`button`,{class:j({chosen:K.value===`board`}),onClick:r[7]||=e=>rn(`board`)},[N(q,{name:`board`}),r[47]||=h(`Kanban `,-1)],2),T(`button`,{class:j({chosen:K.value===`hosts`}),onClick:r[8]||=e=>rn(`hosts`)},[N(q,{name:`server`}),r[48]||=h(`Hosts`,-1),T(`span`,Sa,x(je.value)+`/`+x(k.value.length),1)],2)]),T(`button`,{class:`new-session`,onClick:r[9]||=e=>_t()},[N(q,{name:`plus`,size:15}),r[49]||=h(`New session`,-1),r[50]||=T(`kbd`,{class:`hide-sm`},`N`,-1)]),T(`label`,Ca,[N(q,{name:`search`,size:15}),a(T(`input`,{ref_key:`searchInput`,ref:mt,"onUpdate:modelValue":r[10]||=e=>W.value=e,type:`search`,placeholder:`Search sessions, projects, hosts`,"aria-keyshortcuts":`/ Control+K Meta+K`},null,512),[[A,W.value]]),r[51]||=T(`kbd`,{class:`search-key hide-sm`},`/`,-1)]),k.value.length>1?(c(),p(`div`,wa,[T(`button`,{role:`radio`,"aria-checked":X.value===null,class:j({chosen:X.value===null}),onClick:r[11]||=e=>X.value=null},[r[52]||=h(` All`,-1),T(`span`,Ea,x(Fe.value),1)],10,Ta),(c(!0),p(g,null,o(k.value,e=>(c(),p(`button`,{key:e.id,role:`radio`,"aria-checked":X.value===e.id,class:j({chosen:X.value===e.id}),title:e.label+` · `+e.state,onClick:t=>X.value=e.id},[T(`span`,{class:j([`status-dot`,e.state===`connected`?`is-idle-ok`:`is-offline`])},null,2),h(x(e.label),1),T(`span`,Oa,x(Re.value.get(e.id)),1)],10,Da))),128))])):v(``,!0),T(`div`,ka,[T(`div`,Aa,[T(`button`,{class:j({chosen:L.value===`projects`}),onClick:r[12]||=e=>L.value=`projects`},` Projects `,2),T(`button`,{class:j({chosen:L.value===`recent`}),onClick:r[13]||=e=>L.value=`recent`},`Recent`,2)]),T(`span`,ja,x(L.value===`projects`?`${Le.value} projects`:`${Ie.value} threads`),1)]),N(Xe,{mode:L.value,store:_(P),"host-labels":Oe.value,"host-states":Ae.value,"selected-key":I.value,searching:!!W.value.trim(),onSelect:st,onNew:_t,onMenu:Ct},null,8,[`mode`,`store`,`host-labels`,`host-states`,`selected-key`,`searching`]),N(sa,{report:Rt.value,loading:zt.value,onRefresh:r[14]||=e=>Vt(!0)},null,8,[`report`,`loading`])]),T(`main`,Ma,[E.value?(c(),p(`div`,Na,[N(q,{name:`alert`,size:15}),T(`span`,null,x(E.value),1),T(`button`,{class:`icon-btn`,"aria-label":`Dismiss`,onClick:r[15]||=e=>E.value=``},[N(q,{name:`close`,size:14})])])):v(``,!0),K.value===`settings`?(c(),y(ji,{key:1,request:Z,"totp-enabled":!!b.value?.totp,onBack:ut,onSignedOut:r[16]||=e=>Ze(`user`),onTotpChanged:r[17]||=e=>b.value&&(b.value.totp=e)},null,8,[`totp-enabled`])):K.value===`hosts`?(c(),p(`section`,Pa,[T(`header`,Fa,[T(`button`,{class:`icon-btn back`,"aria-label":`Back`,onClick:ut},[N(q,{name:`back`,size:18})]),r[53]||=T(`div`,null,[T(`h1`,null,`Hosts`),T(`p`,{class:`subtle`},`Paseo daemons this console connects to. Secrets stay on this server.`)],-1)]),T(`div`,Ia,[T(`div`,La,[(c(!0),p(g,null,o(k.value,e=>(c(),p(`div`,{key:e.id,class:`card-row`},[T(`span`,{class:j([`status-dot`,e.state===`connected`?`is-idle-ok`:`is-offline`])},null,2),T(`div`,Ra,[T(`div`,za,x(e.label),1),T(`div`,Ba,x(e.state),1),e.diagnostic?.error?(c(),p(`p`,Va,x(e.diagnostic.error.message),1)):v(``,!0),e.diagnostic?.lastConnectedAt?(c(),p(`div`,Ha,`Last connected: `+x(new Date(e.diagnostic.lastConnectedAt).toLocaleString()),1)):v(``,!0),e.diagnostic?.attempt?(c(),p(`div`,Ua,`Connection attempt `+x(e.diagnostic.attempt),1)):v(``,!0),e.diagnostic?.nextRetryAt?(c(),p(`div`,Wa,`Next retry: `+x(new Date(e.diagnostic.nextRetryAt).toLocaleString()),1)):v(``,!0)]),T(`button`,{class:`btn btn-outline`,disabled:O.value,onClick:t=>Qt(e)},`Remove`,8,Ga)]))),128)),k.value.length?v(``,!0):(c(),p(`div`,Ka,`No hosts yet.`))]),r[56]||=T(`h2`,{class:`section-label`},`Add a host`,-1),T(`form`,{class:`card form-card`,onSubmit:M(Zt,[`prevent`])},[T(`label`,qa,[r[54]||=T(`span`,null,`Name`,-1),a(T(`input`,{"onUpdate:modelValue":r[18]||=e=>ie.value=e,placeholder:`Build server`,required:``},null,512),[[A,ie.value]])]),T(`label`,Ja,[r[55]||=T(`span`,null,`Connection`,-1),a(T(`input`,{"onUpdate:modelValue":r[19]||=e=>ae.value=e,type:`password`,placeholder:`ws://host:port/ws, pairing offer or SSH target`,required:``,autocomplete:`off`},null,512),[[A,ae.value]])]),T(`div`,Ya,[T(`button`,{class:`btn btn-primary`,disabled:O.value},`Add host`,8,Xa)])],32)])])):K.value===`board`?(c(),p(`section`,Za,[T(`header`,Qa,[T(`button`,{class:`icon-btn back`,"aria-label":`Back`,onClick:ut},[N(q,{name:`back`,size:18})]),T(`div`,null,[r[57]||=T(`h1`,null,`Kanban`,-1),T(`p`,$a,x(jt.value===`agents`?`Every agent by state, live. Follows the host filter and search.`:`Your own plan. Moving a card never changes an agent.`),1)]),T(`div`,eo,[T(`button`,{class:j({chosen:jt.value===`agents`}),onClick:r[20]||=e=>jt.value=`agents`},`Agents`,2),T(`button`,{class:j({chosen:jt.value===`plan`}),onClick:r[21]||=e=>jt.value=`plan`},`Plan`,2)])]),T(`div`,to,[jt.value===`agents`?(c(),y(Ki,{key:0,store:_(F),"host-labels":Oe.value,busy:O.value,onOpen:ot,onStop:Mt,onRead:Nt,onArchive:Pt},null,8,[`store`,`host-labels`,`busy`])):(c(),p(g,{key:1},[T(`form`,{class:`add-card`,onSubmit:M(en,[`prevent`])},[a(T(`input`,{"onUpdate:modelValue":r[22]||=e=>ce.value=e,placeholder:`New task`,required:``},null,512),[[A,ce.value]]),T(`button`,{class:`btn btn-primary`,disabled:O.value},[N(q,{name:`plus`,size:15}),r[58]||=h(`Add task`,-1)],8,no)],32),Y.value?(c(),p(`p`,ro,`New tasks link to “`+x(Y.value.title||Y.value.id)+`”.`,1)):v(``,!0),T(`div`,io,[(c(),p(g,null,o(t,e=>T(`div`,{key:e,class:`column`},[T(`div`,ao,[T(`h3`,null,x(e),1),T(`span`,oo,x(Ge.value.get(e).length),1)]),(c(!0),p(g,null,o(Ge.value.get(e),e=>(c(),p(`article`,{key:e.id,class:`card kanban-card`},[T(`div`,so,x(e.title),1),e.agentId?(c(),p(`button`,{key:0,class:`link-btn`,onClick:t=>nn(e)},[N(q,{name:`chat`,size:13}),r[59]||=h(`Open conversation `,-1)],8,co)):v(``,!0),T(`div`,lo,[T(`select`,{value:e.column,onChange:t=>tn(e,t.target.value)},[(c(),p(g,null,o(t,e=>T(`option`,{key:e},x(e),1)),64))],40,uo),T(`button`,{class:`icon-btn`,"aria-label":`Remove`,onClick:t=>Q(()=>$t(le.value.cards.filter(t=>t.id!==e.id)))},[N(q,{name:`trash`,size:15})],8,fo)])]))),128)),Ge.value.get(e).length?v(``,!0):(c(),p(`p`,po,`Nothing here`))])),64))])],64))])])):Y.value?(c(),p(`section`,mo,[T(`header`,ho,[T(`button`,{class:`icon-btn back`,"aria-label":`Back to sessions`,onClick:ut},[N(q,{name:`back`,size:18})]),T(`div`,go,[T(`h1`,_o,[Ne.value?.pinnedAt?(c(),y(q,{key:0,name:`pin`,size:13,class:`title-pin`})):v(``,!0),h(x(Ne.value?.name||Y.value.title||`Untitled session`),1)]),T(`div`,vo,[T(`span`,{class:j([`badge`,`is-`+Y.value.status])},[T(`span`,{class:j([`status-dot`,`is-`+Y.value.status])},null,2),h(x(Y.value.status),1)],2),T(`span`,null,[N(q,{name:`folder`,size:13}),h(x(ze.value),1)]),T(`span`,null,[N(q,{name:`server`,size:13}),h(x(Oe.value.get(Y.value.hostId)),1)]),Ne.value?.branch?(c(),p(`span`,yo,[N(q,{name:`branch`,size:13}),h(x(Ne.value.branch),1)])):v(``,!0),T(`span`,bo,x(Y.value.provider),1)])]),Ne.value?(c(),p(`button`,{key:0,class:`icon-btn`,"aria-label":`Thread actions`,title:`Rename, pin, mark unread, archive`,onClick:wt},[N(q,{name:`more`,size:18})])):v(``,!0)]),Pe.value.length>1?(c(),p(`nav`,xo,[(c(!0),p(g,null,o(Pe.value,e=>(c(),p(`button`,{key:e.key,class:j({chosen:e.key===z.value}),onClick:t=>z.value=e.key},[T(`span`,{class:j([`status-dot`,`is-`+(e.attention?`attention`:e.state===`failed`?`error`:e.state===`running`?`running`:e.unread?`unread`:`idle`)])},null,2),T(`span`,Co,x(e.title||e.provider),1)],10,So))),128))])):v(``,!0),T(`div`,{ref_key:`timelineElement`,ref:U,class:`timeline`},[T(`div`,wo,[We.value?(c(),p(`div`,To,[T(`button`,{class:`btn btn-ghost`,disabled:O.value,onClick:r[23]||=e=>Wt(`before`)},`Show earlier messages`,8,Eo)])):v(``,!0),ee.value?(c(),p(`p`,Do,[N(q,{name:`alert`,size:14}),h(x(ee.value),1)])):v(``,!0),(c(!0),p(g,null,o(Ve.value,e=>(c(),y(Ht,{key:`${Y.value?.key}:${B.value.epoch}:${e.seqStart}`,entry:e.row,final:e.seqStart!==Ue.value||He.value,"data-seq-start":e.seqStart},null,8,[`entry`,`final`,`data-seq-start`]))),128)),V.value?(c(),p(`div`,Oo,[H.value.length?(c(),p(`button`,{key:0,class:`btn btn-ghost`,disabled:O.value,onClick:r[24]||=e=>Wt(`after`)},`Show newer messages`,8,ko)):v(``,!0),T(`button`,{class:`btn btn-ghost`,disabled:O.value,onClick:Ut},`Back to latest`,8,Ao)])):v(``,!0),Ve.value.length?v(``,!0):(c(),p(`div`,jo,[B.value.ready?v(``,!0):(c(),p(`span`,Mo)),h(` `+x(B.value.ready?`No messages yet.`:`Loading conversation…`),1)]))])],512),T(`div`,No,[T(`div`,Po,[(c(!0),p(g,null,o(Y.value.pendingPermissions,e=>(c(),y(mr,{key:Y.value.key+`:`+e.id,permission:e,busy:O.value,onRespond:t=>Xt(e,t)},null,8,[`permission`,`busy`,`onRespond`]))),128)),xe.value?(c(),p(`p`,Fo,x(xe.value),1)):v(``,!0),_(J).warning.value?(c(),p(`p`,Io,x(_(J).warning.value),1)):v(``,!0),ve.value.length?(c(),p(`details`,Lo,[T(`summary`,null,`Other saved drafts (`+x(ve.value.length)+`)`,1),(c(!0),p(g,null,o(ve.value,e=>(c(),p(`div`,{key:e.slot},[T(`p`,Ro,x(e.text),1),T(`button`,{class:`btn btn-ghost`,onClick:t=>z.value&&_(J).restore(z.value,e.slot)},`Restore draft`,8,zo)]))),128))])):v(``,!0),_e.value&&!O.value?(c(),p(`div`,Bo,[N(q,{name:`alert`,size:15}),T(`span`,Vo,`Delivery unknown. Check the conversation before sending again. Message: `+x(_e.value.text)+` `+x(_e.value.attachmentNames?.join(`, `)),1),T(`button`,{class:`btn btn-ghost`,disabled:ye.value,onClick:Se},x(ye.value?`Checking…`:`Check delivery`),9,Ho),T(`button`,{class:`btn btn-ghost`,onClick:Te},`I checked`)])):v(``,!0),N(Kn,{ref_key:`attachmentPanel`,ref:fe,store:_(de),"agent-key":Y.value.key,base:`/api`+$(Y.value),busy:O.value||!!_e.value},null,8,[`store`,`agent-key`,`base`,`busy`]),T(`form`,{class:`composer`,onSubmit:M(qt,[`prevent`]),onDragover:r[28]||=M(()=>{},[`prevent`]),onDrop:r[29]||=M(e=>fe.value?.addFiles(e.dataTransfer?.files),[`prevent`]),onPaste:he},[a(T(`textarea`,{ref_key:`composerElement`,ref:re,"onUpdate:modelValue":r[25]||=e=>ge.value=e,rows:`1`,placeholder:Lt.value&&!_(n)?Lt.value:`Message this agent…`,required:!pe.value.length,onInput:Gt,onKeydown:Kt},null,40,Uo),[[A,ge.value]]),T(`div`,Wo,[Be.value?(c(),p(`div`,Go,[T(`button`,{type:`button`,class:j({chosen:oe.value===`steer`}),onClick:r[26]||=e=>oe.value=`steer`},`Steer`,2),T(`button`,{type:`button`,class:j({chosen:oe.value===`interrupt`}),onClick:r[27]||=e=>oe.value=`interrupt`},` Interrupt `,2)])):(c(),p(`span`,Ko,x(Lt.value&&!_(n)?`Tab to use the suggestion`:_(n)?``:`Enter to send · Shift+Enter for a new line`),1)),T(`div`,qo,[Be.value?(c(),p(`button`,{key:0,type:`button`,class:`disc disc-stop`,"aria-label":`Stop turn`,title:`Stop turn`,disabled:O.value,onClick:Yt},[N(q,{name:`stop`,size:14})],8,Jo)):v(``,!0),T(`button`,{class:`disc disc-send`,"aria-label":`Send`,title:`Send`,disabled:O.value||!!_e.value||!me.value||!ge.value.trim()&&!pe.value.length},[N(q,{name:`send`,size:17})],8,Yo)])])],32)])])])):K.value===`chat`&&yt.value?(c(),p(`section`,Xo,[...r[60]||=[T(`span`,{class:`spinner`},null,-1),T(`p`,null,`Starting session…`,-1)]])):(c(),p(`section`,Zo,[T(`div`,Qo,[N(q,{name:`chat`,size:26})]),T(`h2`,null,x(Fe.value?`Pick a session`:`Connect your first host`),1),T(`p`,null,x(Fe.value?X.value?`${Ie.value} sessions in ${Le.value} projects on ${Oe.value.get(X.value)??`this host`}.`:`${Fe.value} sessions in ${Le.value} projects across ${k.value.length} hosts.`:`Add a Paseo daemon and its agents show up here, live.`),1),k.value.length?(c(),p(`button`,{key:1,class:`btn btn-primary`,onClick:r[31]||=e=>_t()},[N(q,{name:`plus`,size:15}),r[61]||=h(`New session`,-1)])):(c(),p(`button`,{key:0,class:`btn btn-primary`,onClick:r[30]||=e=>rn(`hosts`)},`Add a host`))]))]),bt.value?(c(),y(ue,{key:0,thread:bt.value.thread,x:bt.value.x,y:bt.value.y,onClose:r[32]||=e=>bt.value=null,onRename:r[33]||=e=>xt.value=e,onPin:Et,onUnread:Dt,onRead:Ot,onArchive:kt},null,8,[`thread`,`x`,`y`])):v(``,!0),xt.value?(c(),y(be,{key:1,thread:xt.value,busy:O.value,onClose:r[34]||=e=>xt.value=null,onSave:Tt},null,8,[`thread`,`busy`])):v(``,!0),gt.value?(c(),y(Pn,{key:2,hosts:k.value,"initial-host-id":gt.value.hostId,"initial-cwd":gt.value.cwd,"initial-project":gt.value.project,request:Z,onClose:r[35]||=e=>gt.value=null,onCreated:vt},null,8,[`hosts`,`initial-host-id`,`initial-cwd`,`initial-project`])):v(``,!0)],2)):(c(),p(`div`,ca,[b.value?(c(),p(`form`,{key:0,class:`login-card`,onSubmit:M($e,[`prevent`])},[r[42]||=T(`div`,{class:`brand brand-large`},[T(`span`,{class:`brand-mark`}),h(`LitePaseo`)],-1),r[43]||=T(`p`,{class:`login-lede`},`All your Paseo hosts, one fast console.`,-1),b.value.totp&&!S.value?(c(),p(g,{key:0},[T(`label`,la,[r[36]||=T(`span`,null,`Authenticator code`,-1),a(T(`input`,{"onUpdate:modelValue":r[0]||=e=>m.value=e,class:`code-input`,inputmode:`numeric`,autocomplete:`one-time-code`,maxlength:`6`,placeholder:`••••••`,required:``,autofocus:``,onInput:tt},null,544),[[A,m.value]])]),T(`p`,ua,[r[37]||=h(`Open your authenticator app. `,-1),T(`button`,{type:`button`,class:`link-btn`,onClick:r[1]||=e=>S.value=!0},`Use the access token instead`)])],64)):(c(),p(g,{key:1},[T(`label`,da,[r[38]||=T(`span`,null,`Server access token`,-1),a(T(`input`,{"onUpdate:modelValue":r[2]||=e=>d.value=e,type:`password`,autocomplete:`off`,required:``,autofocus:``},null,512),[[A,d.value]])]),T(`p`,fa,[r[39]||=h(` Run `,-1),r[40]||=T(`code`,null,`litepaseo token`,-1),r[41]||=h(` on the server to print it. `,-1),b.value.totp?(c(),p(`button`,{key:0,type:`button`,class:`link-btn`,onClick:r[3]||=e=>S.value=!1},`Use a code`)):v(``,!0)])],64)),T(`button`,{class:`btn btn-primary btn-block`,disabled:O.value},x(O.value?`Signing in…`:`Connect`),9,pa),E.value?(c(),p(`p`,ma,x(E.value),1)):v(``,!0)],32)):v(``,!0)]))}});function es(){let e=matchMedia(`(prefers-reduced-motion: reduce)`),t,n=!1,r=()=>Math.max(200,Number(getComputedStyle(document.documentElement).getPropertyValue(`--motion-step-ms`))||500),i=()=>{clearTimeout(t),t=void 0},a=()=>{if(t=void 0,n||document.hidden||e.matches)return;let i=document.getAnimations().filter(e=>e instanceof CSSAnimation&&[`pulse`,`spin`].includes(e.animationName));if(!i.length)return;let o=performance.now();for(let e of i)e.pause(),e.currentTime=o;t=setTimeout(a,r())},o=()=>{document.hidden||e.matches?i():!t&&!n&&(t=setTimeout(a,r()))},s=new MutationObserver(o);return s.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`class`,`style`,`hidden`,`open`]}),document.addEventListener(`visibilitychange`,o),window.addEventListener(`resize`,o),e.addEventListener(`change`,o),o(),()=>{n=!0,i(),s.disconnect(),document.removeEventListener(`visibilitychange`,o),window.removeEventListener(`resize`,o),e.removeEventListener(`change`,o)}}br();var ts=O($o);ts.mount(`#app`),ts.onUnmount(es());export{ct as n,yr as t};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.attachment-panel[data-v-9c24c459]{padding:6px 0}.attachment-item[data-v-9c24c459]{flex-wrap:wrap;align-items:center;gap:8px;padding:6px;display:flex}.attachment-item img[data-v-9c24c459]{object-fit:contain}.question-field[data-v-f1db1c0a]{border:0;min-width:0;margin:0;padding:12px 0}.question-field legend[data-v-f1db1c0a]{padding:0;font-weight:600}.question-option[data-v-f1db1c0a]{cursor:pointer;align-items:center;gap:10px;min-height:44px;display:flex}.question-option input[data-v-f1db1c0a]{flex:none;width:auto}:root{--motion-step-ms:500;--surface-0:#fff;--surface-1:#fafafa;--surface-2:#f4f4f5;--surface-3:#e9e9ec;--sidebar:#f6f6f7;--fg:#18181b;--fg-muted:#6b6b75;--fg-faint:#a1a1aa;--border:#e6e6ea;--border-strong:#d6d6dc;--hover:#18181b0b;--selected:#18181b13;--accent:#1f7a4d;--accent-hover:#1a6941;--accent-soft:#1f7a4d1a;--accent-fg:#fff;--accent-2:#5cc48f;--pulse:#2f6fde66;--link:#1f7a4d;--running:#2f6fde;--running-soft:#2f6fde1f;--unread:#1f9a57;--seg-track:#e9e9ec;--seg-thumb:#fff;--warn:#b26b00;--warn-soft:#c984121f;--danger:#b4413a;--danger-soft:#b4413a1a;--user-bubble:#f0f0f2;--code-bg:#f6f6f8;--shadow-lg:0 12px 40px -12px #0f0f142e, 0 2px 6px #0f0f140a;--shadow-sm:0 1px 2px #0f0f140d;--radius:12px;--radius-sm:8px;--font:ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;--mono:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}:root[data-theme=dark]{--surface-0:#282c34;--surface-1:#2c313a;--surface-2:#323842;--surface-3:#3b4150;--sidebar:#21252b;--fg:#d0d4dc;--fg-muted:#8f96a3;--fg-faint:#636a78;--border:#353b45;--border-strong:#454c59;--hover:#ffffff0b;--selected:#ffffff13;--accent:#98c379;--accent-hover:#a9d18c;--accent-soft:#98c37924;--accent-fg:#1f2329;--accent-2:#61afef;--pulse:#61afef73;--link:#61afef;--running:#61afef;--running-soft:#61afef24;--unread:#98c379;--seg-track:#1f2329;--seg-thumb:#3b4150;--warn:#e5c07b;--warn-soft:#e5c07b21;--danger:#e06c75;--danger-soft:#e06c7521;--user-bubble:#353b46;--code-bg:#21252b;--shadow-lg:0 16px 48px -12px #0000008c, 0 0 0 1px #0003;--shadow-sm:0 1px 2px #00000040;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--surface-0:#282c34;--surface-1:#2c313a;--surface-2:#323842;--surface-3:#3b4150;--sidebar:#21252b;--fg:#d0d4dc;--fg-muted:#8f96a3;--fg-faint:#636a78;--border:#353b45;--border-strong:#454c59;--hover:#ffffff0b;--selected:#ffffff13;--accent:#98c379;--accent-hover:#a9d18c;--accent-soft:#98c37924;--accent-fg:#1f2329;--accent-2:#61afef;--pulse:#61afef73;--link:#61afef;--running:#61afef;--running-soft:#61afef24;--unread:#98c379;--seg-track:#1f2329;--seg-thumb:#3b4150;--warn:#e5c07b;--warn-soft:#e5c07b21;--danger:#e06c75;--danger-soft:#e06c7521;--user-bubble:#353b46;--code-bg:#21252b;--shadow-lg:0 16px 48px -12px #0000008c, 0 0 0 1px #0003;--shadow-sm:0 1px 2px #00000040;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}}*{box-sizing:border-box}html,body{background:var(--surface-0);height:100%;color:var(--fg);font:14px/1.5 var(--font);-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;margin:0}#app{height:100%}button,input,textarea,select{font:inherit;color:inherit}button{cursor:pointer;background:0 0;border:0;padding:0}button:disabled{cursor:default;opacity:.45}input,textarea,select{background:var(--surface-0);border:1px solid var(--border-strong);border-radius:var(--radius-sm);outline:none;width:100%;padding:8px 11px;transition:border-color .12s,box-shadow .12s}input:focus,textarea:focus,select:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}::placeholder{color:var(--fg-faint)}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}input:focus-visible,textarea:focus-visible,select:focus-visible{outline:none}code{font-family:var(--mono);background:var(--code-bg);border:1px solid var(--border);border-radius:5px;padding:.08em .35em;font-size:.88em}h1,h2,h3{letter-spacing:-.01em;margin:0;font-weight:600}.icon{flex:none;display:block}.grow{flex:1;min-width:0}.subtle,.muted-text{color:var(--fg-muted)}.small{font-size:12.5px}.btn{white-space:nowrap;border-radius:999px;justify-content:center;align-items:center;gap:6px;height:34px;padding:0 14px;font-weight:500;transition:background .12s,border-color .12s,color .12s;display:inline-flex}.btn-primary{background:var(--accent);color:var(--accent-fg)}.btn-primary:not(:disabled):hover{background:var(--accent-hover)}.btn-outline{border:1px solid var(--border-strong);background:var(--surface-0)}.btn-outline:not(:disabled):hover,.btn-ghost:not(:disabled):hover{background:var(--hover)}.btn-ghost{color:var(--fg-muted)}.btn-block{width:100%;height:40px}.icon-btn{width:32px;height:32px;color:var(--fg-muted);border-radius:999px;place-items:center;display:inline-grid}@media (hover:hover){.icon-btn:hover{background:var(--hover);color:var(--fg)}}.link-btn{color:var(--accent);align-items:center;gap:5px;font-size:12.5px;font-weight:500;display:inline-flex}.field{display:block}.field>span{margin-bottom:6px;font-size:12.5px;font-weight:500;display:block}.count{font-variant-numeric:tabular-nums;color:var(--fg-faint);margin-left:auto;font-size:11.5px;font-weight:500}.pill{white-space:nowrap;border-radius:999px;flex:none;padding:2px 8px;font-size:11px;font-weight:600;display:inline-block}.pill-attention{color:var(--warn);background:var(--warn-soft)}.status-dot{background:var(--fg-faint);border-radius:50%;flex:none;width:8px;height:8px}.status-dot.is-running{background:var(--running);box-shadow:0 0 0 0 var(--running-soft);animation:2s steps(4,end) infinite paused pulse}.status-dot.is-attention{background:var(--warn)}.status-dot.is-error{background:var(--danger)}.status-dot.is-idle-ok{background:var(--accent)}.status-dot.is-offline{background:var(--fg-faint)}@keyframes pulse{0%{box-shadow:0 0 0 0 var(--pulse)}to{box-shadow:0 0 0 6px #0000}}.spinner{border:2px solid var(--surface-3);border-top-color:var(--accent);border-radius:50%;width:13px;height:13px;animation:2s steps(4,end) infinite paused spin;display:inline-block}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.status-dot.is-running,.spinner{animation:none}}.login{background:radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 60%), var(--surface-1);place-items:center;min-height:100%;padding:24px;display:grid}.login-card{background:var(--surface-0);border:1px solid var(--border);width:min(380px,100%);box-shadow:var(--shadow-lg);border-radius:18px;padding:32px 28px 26px}.login-lede{color:var(--fg-muted);margin:6px 0 24px}.hint{color:var(--fg-muted);margin:8px 0 18px;font-size:12.5px}.form-error{color:var(--danger);margin:12px 0 0;font-size:13px}.brand{letter-spacing:-.01em;align-items:center;gap:9px;font-size:15px;font-weight:650;display:flex}.brand-large{font-size:22px}.brand-mark{background:conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--accent));border-radius:7px;width:22px;height:22px;position:relative;box-shadow:inset 0 0 0 1px #ffffff40}.brand-mark:after{content:"";background:var(--surface-0);opacity:.9;border-radius:3px;position:absolute;inset:6px}.brand-large .brand-mark{border-radius:9px;width:28px;height:28px}.brand-large .brand-mark:after{inset:8px}.shell{grid-template-columns:300px minmax(0,1fr);height:100dvh;display:grid}.sidebar{background:var(--sidebar);border-right:1px solid var(--border);flex-direction:column;min-height:0;padding:14px 10px 0;display:flex}.sidebar-head{justify-content:space-between;align-items:center;padding:4px 8px 14px;display:flex}.head-actions{align-items:center;gap:4px;display:flex}.theme-btn{width:28px;height:28px}.live{color:var(--fg-muted);align-items:center;gap:6px;font-size:11.5px;display:inline-flex}.live-dot{background:var(--fg-faint);border-radius:50%;width:6px;height:6px}.live.is-live .live-dot{background:var(--accent)}.live.is-connecting .live-dot{background:var(--warn)}.tabs{gap:1px;margin-bottom:10px;display:grid}.tabs button{border-radius:var(--radius-sm);height:34px;color:var(--fg-muted);align-items:center;gap:10px;padding:0 10px;font-weight:500;display:flex}@media (hover:hover){.tabs button:hover{background:var(--hover);color:var(--fg)}}.tabs button.chosen{background:var(--selected);color:var(--fg)}.search{border-radius:var(--radius-sm);background:var(--surface-0);border:1px solid var(--border);height:36px;color:var(--fg-faint);align-items:center;gap:8px;margin:0 2px 8px;padding:0 10px;display:flex}.search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}.search input{height:100%;color:var(--fg);background:0 0;border:0;padding:0;box-shadow:none!important}.search-key{font:11px var(--mono);color:var(--fg-faint);border:1px solid var(--border);border-radius:5px;flex:none;padding:0 5px;line-height:17px}.search:focus-within .search-key{display:none}.search input::-webkit-search-cancel-button{filter:grayscale()}.host-filter{flex-wrap:wrap;gap:6px;margin:0 2px 10px;display:flex}.host-filter button{border:1px solid var(--border);background:var(--surface-0);height:28px;color:var(--fg-muted);white-space:nowrap;border-radius:999px;flex:none;align-items:center;gap:6px;padding:0 10px;font-size:12.5px;font-weight:500;transition:background .12s,color .12s,border-color .12s;display:inline-flex}.host-filter button .status-dot{width:6px;height:6px}.host-filter button.chosen{background:var(--fg);border-color:var(--fg);color:var(--surface-0)}.chip-count{font-variant-numeric:tabular-nums;opacity:.6;font-size:11px}@media (hover:hover){.host-filter button:not(.chosen):hover{color:var(--fg);border-color:var(--border-strong)}}.list-toolbar{justify-content:space-between;align-items:center;padding:0 2px 8px;display:flex}.list-summary{color:var(--fg-faint);font-size:11.5px}.segmented-sm button{height:24px;padding:0 10px;font-size:12px}.group-row{contain:layout paint;border-radius:8px;align-items:center;margin-top:4px;display:flex;position:absolute;top:0;left:0;right:0}.group-toggle{text-align:left;min-width:0;height:100%;color:var(--fg);border-radius:8px;flex:1;align-items:center;gap:7px;padding:0 6px;font-size:12.5px;font-weight:600;display:flex}.group-add{width:26px;height:26px;color:var(--fg-muted);border-radius:7px;flex:none;place-items:center;margin-right:4px;display:grid}@media (hover:hover){.group-add{opacity:0}.group-row:hover .group-add,.group-add:focus-visible{opacity:1}.group-add:hover{background:var(--selected);color:var(--fg)}}.new-session{border-radius:var(--radius-sm);background:var(--accent);height:36px;color:var(--accent-fg);align-items:center;gap:8px;margin:0 2px 8px;padding:0 12px;font-weight:550;display:flex}.new-session kbd{font:11px var(--mono);opacity:.7;border:1px solid;border-radius:5px;margin-left:auto;padding:0 5px;line-height:16px}@media (hover:hover){.new-session:hover{background:var(--accent-hover)}}.overlay{z-index:50;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#0a0c1073;place-items:center;padding:24px;animation:.12s ease-out fade;display:grid;position:fixed;inset:0}@keyframes fade{0%{opacity:0}}.sheet{background:var(--surface-0);border:1px solid var(--border);width:min(600px,100%);max-height:calc(100dvh - 48px);box-shadow:var(--shadow-lg);border-radius:18px;flex-direction:column;animation:.16s cubic-bezier(.2,.8,.2,1) rise;display:flex}@keyframes rise{0%{opacity:0;transform:translateY(8px)}}.sheet-head{justify-content:space-between;align-items:center;padding:16px 16px 8px 22px;display:flex}.sheet-head h2{font-size:16px}.sheet-body{flex:1;gap:14px;min-height:0;padding:8px 22px 14px;display:grid;overflow-y:auto}.field-grid{grid-template-columns:1fr 1fr;gap:12px;display:grid}.field-grid.three{grid-template-columns:1fr 1.4fr 1fr}.path-hint{min-height:16px;font:11.5px/16px var(--mono);color:var(--fg-faint);white-space:nowrap;text-overflow:ellipsis;align-items:center;gap:6px;margin:-4px 0 0;display:flex;overflow:hidden}.toggle{cursor:pointer;align-items:center;gap:9px;font-size:13px;display:flex}.toggle input{width:16px;height:16px;accent-color:var(--accent);margin:0}.sheet-body textarea{resize:vertical;min-height:110px;line-height:1.5}.sheet-note{color:var(--fg-muted)}.sheet-error{color:var(--danger);align-items:flex-start;gap:7px;margin:0;font-size:13px;display:flex}.sheet-error .icon{margin-top:2px}.sheet-foot{border-top:1px solid var(--border);justify-content:flex-end;align-items:center;gap:8px;padding:12px 16px 16px 22px;display:flex}.sheet-hint{color:var(--fg-faint);margin-right:auto;font-size:11.5px}.spinner-on-accent{border-color:#ffffff59;border-top-color:var(--accent-fg)}.group-chevron{color:var(--fg-faint);transition:transform .15s;transform:rotate(90deg)}.group-row.collapsed .group-chevron{transform:none}.group-folder{color:var(--fg-muted)}.group-name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.group-count{text-align:right;font-variant-numeric:tabular-nums;min-width:18px;color:var(--fg-faint);font-size:11.5px;font-weight:500}.group-flag{border-radius:999px;place-items:center;min-width:18px;height:18px;padding:0 5px;font-size:11px;display:grid}.group-marks{align-items:center;gap:5px;display:inline-flex}.group-marks .status-dot{width:7px;height:7px}.group-flag.is-attention{background:var(--warn-soft);color:var(--warn)}.session.nested{padding-left:30px}.session-list{overscroll-behavior:contain;flex:1;min-height:0;margin:0 -10px;padding:0 10px 12px;overflow-y:auto}.session-spacer{position:relative}.session{text-align:left;contain:layout paint;border-radius:10px;align-items:center;gap:11px;height:48px;padding:0 10px 0 12px;display:flex;position:absolute;top:0;left:0;right:0}@media (hover:hover){.group-row:hover{background:var(--hover)}}@media (width<=760px){.overlay{place-items:end stretch;padding:0}.sheet{width:100%;max-height:92dvh;padding-bottom:env(safe-area-inset-bottom);border-radius:18px 18px 0 0}.field-grid{grid-template-columns:1fr;gap:14px}.field-grid.three{grid-template-columns:1fr 1fr;grid-template-areas:"agent thinking""model model";gap:14px 12px}.field-agent{grid-area:agent}.field-model{grid-area:model}.field-thinking{grid-area:thinking}.sheet-body textarea{min-height:96px}.new-session{height:42px;margin:0 0 8px}}@media (hover:hover){.session:hover{background:var(--hover)}}.session.chosen{background:var(--selected)}.session.offline{opacity:.55}.session-text{flex:1;gap:1px;min-width:0;display:grid}.session-title{white-space:nowrap;text-overflow:ellipsis;font-size:13.5px;overflow:hidden}.session.chosen .session-title{font-weight:550}.session-meta{color:var(--fg-muted);white-space:nowrap;gap:5px;font-size:12px;display:flex;overflow:hidden}.session-project{text-overflow:ellipsis;max-width:60%;overflow:hidden}.sep{color:var(--fg-faint)}.list-empty{color:var(--fg-muted);text-align:center;padding:28px 12px;font-size:13px}.main{background:var(--surface-0);flex-direction:column;min-width:0;min-height:0;display:flex;position:relative}.back{display:none}.toast{z-index:10;background:var(--surface-0);border:1px solid var(--border);max-width:min(560px,100% - 28px);box-shadow:var(--shadow-lg);color:var(--danger);border-radius:12px;align-items:center;gap:10px;padding:8px 8px 8px 14px;font-size:13px;display:flex;position:absolute;top:14px;left:50%;transform:translate(-50%)}.toast span{color:var(--fg)}.chat{flex-direction:column;flex:1;min-height:0;display:flex}.chat-head{border-bottom:1px solid var(--border);align-items:center;gap:8px;padding:14px 24px 12px;display:flex}.chat-title{white-space:nowrap;text-overflow:ellipsis;font-size:15px;font-weight:600;overflow:hidden}.chat-meta{color:var(--fg-muted);flex-wrap:wrap;align-items:center;gap:4px 14px;margin-top:4px;font-size:12.5px;display:flex}.chat-meta>span{align-items:center;gap:5px;display:inline-flex}.badge{background:var(--surface-2);color:var(--fg);text-transform:capitalize;border-radius:999px;padding:1px 8px 1px 7px;font-size:11.5px;font-weight:500}.badge.is-running{background:var(--running-soft);color:var(--running)}.badge.is-error{background:var(--danger-soft);color:var(--danger)}.timeline{overscroll-behavior:contain;contain:content;flex:1;min-height:0;overflow-y:auto}.timeline-inner{flex-direction:column;gap:6px;max-width:780px;margin:0 auto;padding:20px 24px 28px;display:flex}.older{justify-content:center;margin-bottom:8px;display:flex}.notice{color:var(--warn);align-items:center;gap:7px;margin:0 0 8px;font-size:12.5px;display:flex}.timeline-empty{color:var(--fg-muted);justify-content:center;align-items:center;gap:10px;padding:60px 0;display:flex}.row-user{justify-content:flex-end;margin:14px 0 6px;display:flex}.bubble{background:var(--user-bubble);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:18px 18px 6px;max-width:min(82%,620px);padding:9px 14px;font-size:14.5px;line-height:1.55}.row-assistant{margin:4px 0}.prose{overflow-wrap:anywhere;font-size:14.5px;line-height:1.65}.prose>:first-child{margin-top:0}.prose>:last-child{margin-bottom:0}.prose p,.prose ul,.prose ol,.prose blockquote,.prose pre,.prose .table{margin:0 0 .75em}.prose h3,.prose h4,.prose h5,.prose h6{margin:1.1em 0 .45em;font-size:1.02em;font-weight:650}.prose h3{font-size:1.12em}.prose ul,.prose ol{padding-left:1.4em}.prose li{margin:.18em 0}.prose li.nested{margin-left:1.2em}.prose li.task{align-items:baseline;gap:8px;margin-left:-1.2em;list-style:none;display:flex}.prose a{color:var(--link);text-underline-offset:2px;text-decoration:underline}.prose blockquote{border-left:3px solid var(--border-strong);color:var(--fg-muted);padding:0 0 0 12px}.prose hr{border:0;border-top:1px solid var(--border);margin:1.2em 0}.prose pre.code,.prose.markstream-vue pre{background:var(--code-bg);border:1px solid var(--border);font:12.5px/1.6 var(--mono);border-radius:10px;padding:12px 14px;position:relative;overflow-x:auto}.prose pre.code code,.prose.markstream-vue pre code{font-size:inherit;white-space:pre;background:0 0;border:0;padding:0}.code-lang{font:11px var(--font);color:var(--fg-faint);position:absolute;top:6px;right:10px}.prose .table{overflow-x:auto}.prose table{border-collapse:collapse;font-size:13px}.prose th,.prose td{border:1px solid var(--border);text-align:left;padding:5px 10px}.prose th{background:var(--surface-1);font-weight:600}.check{border:1.5px solid var(--border-strong);border-radius:4px;flex:none;width:13px;height:13px;display:inline-block;position:relative;top:2px}.check.done{background:var(--accent);border-color:var(--accent)}.check.done:after{content:"";border:solid var(--accent-fg);border-width:0 1.5px 1.5px 0;width:3px;height:7px;position:absolute;top:.5px;left:3.5px;transform:rotate(45deg)}.row-reasoning summary,.row-tool summary{cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:8px;list-style:none;display:flex}.row-reasoning summary::-webkit-details-marker{display:none}.row-tool summary::-webkit-details-marker{display:none}.permission-details summary::-webkit-details-marker{display:none}.row-reasoning summary{width:fit-content;color:var(--fg-muted);border-radius:8px;margin-left:-6px;padding:4px 8px 4px 6px;font-size:13px}@media (hover:hover){.row-reasoning summary:hover{background:var(--hover)}}.reasoning-text{border-left:2px solid var(--border);color:var(--fg-muted);white-space:pre-wrap;margin:4px 0 8px;padding-left:12px;font-size:13px}.row-tool{border-radius:10px}.row-tool summary{border-radius:9px;min-height:32px;margin-left:-6px;padding:5px 10px 5px 6px;font-size:13px}@media (hover:hover){.row-tool summary:hover{background:var(--hover)}}.row-tool[open]{background:var(--surface-1);box-shadow:inset 0 0 0 1px var(--border);margin-left:-6px}.row-tool[open] summary{margin-left:0}.tool-icon{background:var(--surface-2);width:22px;height:22px;color:var(--fg-muted);border-radius:6px;place-items:center;display:grid}.tool-name{flex:none;font-weight:500}.tool-subject{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--mono);color:var(--fg-muted);flex:1;font-size:12px;overflow:hidden}.tool-status{color:var(--fg-faint);flex:none;place-items:center;font-size:11.5px;display:grid}.row-tool.is-completed .tool-status{color:var(--accent)}.row-tool.is-failed .tool-status,.row-tool.is-failed .tool-icon{color:var(--danger)}.tool-detail{max-height:340px;font:12px/1.55 var(--mono);color:var(--fg-muted);white-space:pre-wrap;overflow-wrap:anywhere;margin:0;padding:4px 12px 12px 38px;overflow:auto}.tool-error{color:var(--danger)}.row-todo{border:1px solid var(--border);border-radius:var(--radius);margin:6px 0;padding:10px 14px}.todo-title{color:var(--fg-muted);align-items:center;gap:7px;margin-bottom:6px;font-size:12.5px;font-weight:600;display:flex}.row-todo ul{gap:4px;margin:0;padding:0;font-size:13.5px;list-style:none;display:grid}.row-todo li{align-items:baseline;gap:9px;display:flex}.row-todo li.done{color:var(--fg-muted);text-decoration:line-through}.row-todo li.active{font-weight:550}.row-callout{background:var(--surface-2);color:var(--fg-muted);border-radius:10px;align-items:flex-start;gap:9px;margin:6px 0;padding:9px 12px;font-size:13.5px;display:flex}.row-callout .icon{margin-top:2px}.row-callout.is-error{background:var(--danger-soft);color:var(--danger)}.row-callout.is-warning{background:var(--warn-soft);color:var(--warn)}.row-callout span{color:var(--fg)}.row-divider{color:var(--fg-faint);align-items:center;gap:12px;margin:12px 0;font-size:12px;display:flex}.row-divider:before,.row-divider:after{content:"";border-top:1px solid var(--border);flex:1}.dock{padding:0 24px max(16px, env(safe-area-inset-bottom));background:linear-gradient(to bottom, transparent, var(--surface-0) 18px)}.dock-inner{gap:10px;max-width:732px;margin:0 auto;display:grid}.permission{border:1px solid color-mix(in srgb, var(--warn) 35%, var(--border));background:color-mix(in srgb, var(--warn-soft) 55%, var(--surface-0));border-radius:14px;gap:10px;padding:12px 14px;display:grid}.permission-head{align-items:center;gap:11px;display:flex}.permission-icon{background:var(--warn-soft);width:30px;height:30px;color:var(--warn);border-radius:9px;place-items:center;display:grid}.row-title{overflow-wrap:anywhere;font-weight:550}.row-sub{color:var(--fg-muted);font-size:12.5px}.permission-details summary{cursor:pointer;color:var(--fg-muted);font-size:12.5px;list-style:none}.permission-details summary:before{content:"›";margin-right:6px;transition:transform .12s;display:inline-block}.permission-details[open] summary:before{transform:rotate(90deg)}.permission-details pre{background:var(--surface-0);border:1px solid var(--border);max-height:220px;font:12px/1.5 var(--mono);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:8px;margin:8px 0 0;padding:10px 12px;overflow:auto}.permission-actions{justify-content:flex-end;gap:8px;display:flex}.uncertain{background:var(--danger-soft);color:var(--danger);border-radius:12px;align-items:center;gap:9px;padding:8px 8px 8px 12px;font-size:13px;display:flex}.uncertain span{color:var(--fg)}.composer{border:1px solid var(--border-strong);background:var(--surface-0);box-shadow:var(--shadow-sm);border-radius:20px;padding:10px 10px 8px 16px;transition:border-color .12s,box-shadow .12s}.composer:focus-within{border-color:var(--fg-faint);box-shadow:0 0 0 4px var(--hover)}.composer textarea{resize:none;background:0 0;border:0;min-height:26px;max-height:40vh;padding:4px 0;font-size:14.5px;line-height:1.5;display:block;box-shadow:none!important}.composer-bar{align-items:center;gap:8px;min-height:34px;margin-top:4px;display:flex}.composer-hint{color:var(--fg-faint);font-size:11.5px}.composer-actions{gap:6px;margin-left:auto;display:flex}.disc{border-radius:50%;place-items:center;width:34px;height:34px;transition:background .12s,opacity .12s;display:grid}.disc-send{background:var(--fg);color:var(--surface-0)}.disc-send:disabled{opacity:.18}.disc-stop{background:var(--surface-2);color:var(--fg)}@media (hover:hover){.disc-stop:hover{background:var(--surface-3)}}.segmented{background:var(--seg-track);border-radius:999px;padding:2px;display:inline-flex}.segmented button{height:28px;color:var(--fg-muted);border-radius:999px;padding:0 12px;font-size:12.5px;font-weight:500}.segmented button.chosen{background:var(--seg-thumb);color:var(--fg);box-shadow:var(--shadow-sm), 0 0 0 1px var(--border)}.page{flex:1;min-height:0;overflow-y:auto}.page-head{align-items:flex-start;gap:8px;max-width:760px;margin:0 auto;padding:36px 28px 18px;display:flex}.page-head h1{font-size:22px}.page-head p{margin:4px 0 0}.page-body{max-width:760px;margin:0 auto;padding:0 28px 48px}.page-body.wide{max-width:1100px}.page-head:has(+.wide){max-width:1100px}.section-label{color:var(--fg-muted);margin:28px 0 10px;font-size:13px;font-weight:600}.card{background:var(--surface-0);border:1px solid var(--border);border-radius:var(--radius)}.card-row{align-items:center;gap:12px;padding:13px 16px;display:flex}.card-row+.card-row{border-top:1px solid var(--border)}.form-card{gap:14px;padding:18px 16px;display:grid}.form-actions{justify-content:flex-end;display:flex}.add-card{gap:8px;max-width:520px;display:flex}.add-card input{border-radius:999px;height:34px;padding:0 14px}.board{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:18px;display:grid}.column{background:var(--surface-1);border:1px solid var(--border);border-radius:14px;flex-direction:column;gap:8px;min-height:160px;padding:10px;display:flex}.column-head{align-items:center;padding:2px 4px 4px;display:flex}.column-head h3{font-size:13px}.column-empty{color:var(--fg-faint);margin:8px 4px;font-size:12.5px}.kanban-card{box-shadow:var(--shadow-sm);gap:8px;padding:11px 12px;display:grid}.kanban-actions{align-items:center;gap:6px;display:flex}.kanban-actions select{border-radius:7px;width:auto;height:28px;padding:0 8px;font-size:12.5px}.kanban-actions .icon-btn{width:28px;height:28px;margin-left:auto}.empty{text-align:center;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:10px;padding:32px;display:flex}.empty h2{font-size:18px}.empty p{max-width:360px;color:var(--fg-muted);margin:0 0 8px}.empty-mark{background:var(--accent-soft);width:56px;height:56px;color:var(--accent);border-radius:18px;place-items:center;margin-bottom:6px;display:grid}@media (width<=1000px){.shell{grid-template-columns:270px minmax(0,1fr)}.board{grid-template-columns:1fr}}@media (width<=760px){html,body{font-size:15px}.shell{display:block;position:relative;overflow:hidden}.sidebar,.main{transition:transform .24s cubic-bezier(.2,.8,.2,1);position:absolute;inset:0}.sidebar{padding:max(12px, env(safe-area-inset-top)) 14px 0;border-right:0}.main{visibility:hidden;transition:transform .24s cubic-bezier(.2,.8,.2,1),visibility 0s linear .24s;transform:translate(100%)}.shell.detail-open .main{visibility:visible;transition:transform .24s cubic-bezier(.2,.8,.2,1);transform:none;box-shadow:-10px 0 30px -18px #0000004d}.shell.detail-open .sidebar{visibility:hidden;transition:transform .24s cubic-bezier(.2,.8,.2,1),visibility 0s linear .24s;transform:translate(-28%)}.tabs{background:var(--seg-track);border-radius:11px;grid-template-columns:repeat(3,1fr);gap:4px;padding:3px}.tabs button{justify-content:center;gap:6px;height:34px;font-size:13px}.tabs button.chosen{background:var(--seg-thumb);box-shadow:var(--shadow-sm)}.tabs .count,.tabs .icon{display:none}.search{height:40px;margin:0 0 8px}.session-list{padding:0 8px max(16px, env(safe-area-inset-bottom));margin:0 -14px}.back{flex:none;margin-left:-8px;display:inline-grid}.chat-head{padding:max(10px, env(safe-area-inset-top)) 14px 10px}.timeline-inner{padding:16px 16px 20px}.dock{padding:0 10px max(10px, env(safe-area-inset-bottom))}.composer{border-radius:22px}.composer textarea,.bubble,.prose{font-size:15px}.disc{width:36px;height:36px}.hide-sm{display:none!important}.page-head{padding:max(14px, env(safe-area-inset-top)) 16px 14px;align-items:center}.page-head p{display:none}.page-head h1{font-size:17px}.page-body{padding:0 16px 40px}.btn{height:40px}input,select,textarea,.search input,.composer textarea{font-size:16px}}.setting-icon{background:var(--surface-2);width:32px;height:32px;color:var(--fg-muted);border-radius:9px;flex:none;place-items:center;display:grid}.switch-row{cursor:pointer}.switch{appearance:none;background:var(--surface-3);cursor:pointer;border:0;border-radius:999px;flex:none;width:38px;height:22px;padding:0;transition:background .15s;position:relative}.switch:after{content:"";background:#fff;border-radius:50%;width:18px;height:18px;transition:transform .15s;position:absolute;top:2px;left:2px;box-shadow:0 1px 2px #00000040}.switch:checked{background:var(--accent)}.switch:checked:after{transform:translate(16px)}.switch:focus{box-shadow:0 0 0 3px var(--accent-soft)}.totp-setup{align-items:flex-start;gap:18px}.totp-setup img{border:1px solid var(--border);background:#fff;border-radius:10px;flex:none;padding:6px}.totp-setup p{margin:0 0 8px}.secret{letter-spacing:.04em;word-break:break-all;margin-bottom:12px;font-size:12.5px;display:inline-block}.code-form{align-items:center;gap:8px;display:flex}.code-form input{width:130px;height:34px;font-family:var(--mono);letter-spacing:.2em;text-align:center}.code-input{letter-spacing:.45em;text-align:center;height:52px;font:600 24px var(--mono)!important}.setting-note{color:var(--accent);margin:8px 2px 0;font-size:13px}.setting-note.is-error{color:var(--danger)}.pill-current{color:var(--accent);background:var(--accent-soft);margin-left:8px}.form-actions.spaced{margin-top:10px}.icon-btn.chosen{background:var(--selected);color:var(--fg)}.login .hint .link-btn{font-size:inherit;margin-left:4px}@media (width<=760px){.totp-setup{flex-direction:column;align-items:stretch}.totp-setup img{align-self:center}.code-form input{flex:1}}.row-speed{font-variant-numeric:tabular-nums;color:var(--fg-faint);align-items:center;gap:6px;margin:2px 0 6px;font-size:11.5px;display:flex}.row-suggestion{align-items:flex-start;gap:6px;margin:4px 0 8px;padding-left:2px;display:flex}.suggestion-text{text-align:left;color:var(--fg-muted);border-radius:6px;flex:1;padding:2px 0;font-size:13.5px;line-height:1.5}.suggestion-text:before{content:"↳ ";color:var(--fg-faint)}.suggestion-actions{gap:2px;margin-top:-4px;display:flex}.suggestion-actions .icon-btn{width:28px;height:28px}.suggestion-wait{color:var(--fg-faint);font-size:12.5px}.spinner-sm{border-width:1.5px;width:11px;height:11px;margin-top:3px}@media (hover:hover){.suggestion-text:hover{color:var(--fg)}}.unread-mark{background:var(--unread);border-radius:50%;flex:none;width:8px;height:8px}.session.unread .session-title{font-weight:600}.status-dot.is-unread{background:var(--unread)}.head-toggle{align-self:center;margin-left:auto}.agent-board{grid-template-columns:repeat(4,minmax(0,1fr));align-items:start;gap:12px;display:grid}.lane{background:var(--surface-1);border:1px solid var(--border);border-radius:14px;flex-direction:column;gap:8px;min-width:0;min-height:160px;padding:10px;display:flex}.lane-head{align-items:center;gap:8px;padding:2px 4px 4px;display:flex}.lane-head h3{font-size:13px}.lane-dot{background:var(--fg-faint);border-radius:50%;width:8px;height:8px}.lane-needs_input .lane-dot{background:var(--warn)}.lane-running .lane-dot{background:var(--running)}.lane-review .lane-dot{background:var(--unread)}.task-card{background:var(--surface-0);border:1px solid var(--border);min-width:0;box-shadow:var(--shadow-sm);cursor:pointer;border-radius:11px;outline:none;grid-template-columns:minmax(0,1fr);gap:4px;padding:10px 12px;transition:border-color .12s;display:grid}.task-card:focus-visible{border-color:var(--accent)}.task-card.is-needs_input{border-color:color-mix(in srgb, var(--warn) 40%, var(--border))}.task-card.is-failed{border-color:color-mix(in srgb, var(--danger) 35%, var(--border))}.task-top{align-items:center;gap:8px;display:flex}.task-title{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:13.5px;font-weight:550;overflow:hidden}.task-meta{color:var(--fg-faint);white-space:nowrap;text-overflow:ellipsis;font-size:11.5px;overflow:hidden}.task-detail{color:var(--fg-muted);-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:12.5px;display:-webkit-box;overflow:hidden}.task-detail.is-error{color:var(--danger)}.task-actions{flex-wrap:wrap;gap:6px;margin-top:4px;display:flex}.task-actions:empty{display:none}.btn-sm{gap:4px;height:26px;padding:0 10px;font-size:12px}.lane-more{align-self:center;height:28px;font-size:12.5px}@media (hover:hover){.task-card:hover{border-color:var(--border-strong)}}@media (width<=1000px){.agent-board{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width<=760px){.agent-board{scroll-snap-type:x mandatory;scrollbar-width:none;gap:10px;margin:0 -16px;padding:0 16px 4px;display:flex;overflow-x:auto}.agent-board::-webkit-scrollbar{display:none}.lane{scroll-snap-align:center;flex:0 0 86%}.btn-sm{height:32px;padding:0 12px}.page-head .head-toggle{margin-left:auto}}.usage{padding:8px 10px max(10px, env(safe-area-inset-bottom));border-top:1px solid var(--border);margin:0 -10px;position:relative}.usage-summary{text-align:left;border-radius:8px;gap:3px;width:100%;padding:6px 8px;display:grid}.usage-line{white-space:nowrap;align-items:baseline;gap:8px;font-size:12px;display:flex;overflow:hidden}.usage-name{text-overflow:ellipsis;min-width:0;color:var(--fg-muted);flex:1;font-weight:500;overflow:hidden}.usage-pct{font-variant-numeric:tabular-nums;font-weight:600}.usage-pct small{color:var(--fg-faint);margin-left:2px;font-weight:400}.tone-ok{color:var(--fg)}.tone-warning{color:var(--warn)}.tone-danger{color:var(--danger)}.usage-card{z-index:20;background:var(--surface-0);border:1px solid var(--border);max-height:70dvh;box-shadow:var(--shadow-lg);border-radius:14px;gap:12px;padding:12px 14px;display:grid;position:absolute;bottom:calc(100% + 6px);left:8px;right:8px;overflow-y:auto}.usage-card header{align-items:center;gap:2px;display:flex}.usage-card header strong{flex:1;font-size:13px}.usage-account{gap:8px;display:grid}.usage-account+.usage-account{border-top:1px solid var(--border);padding-top:12px}.usage-account-head{display:grid}.usage-window{gap:4px;display:grid}.usage-window-head,.usage-window-foot{justify-content:space-between;gap:8px;font-size:12px;display:flex}.usage-window-foot{color:var(--fg-faint);font-size:11.5px}.usage-bar{background:var(--surface-3);border-radius:999px;height:5px;overflow:hidden}.usage-bar span{border-radius:inherit;background:var(--accent);height:100%;display:block}.usage-bar span.tone-warning{background:var(--warn)}.usage-bar span.tone-danger{background:var(--danger)}.usage-foot{color:var(--fg-faint);margin:0;font-size:11px}.row-sub.is-error{color:var(--danger)}@media (hover:hover){.usage-summary:hover{background:var(--hover)}}.session-row{contain:layout paint;height:48px;position:absolute;top:0;left:0;right:0}.session-row .session{height:100%;padding-right:34px;position:static}.row-more{width:26px;height:26px;color:var(--fg-muted);border-radius:7px;place-items:center;display:grid;position:absolute;top:50%;right:6px;transform:translateY(-50%)}@media (hover:hover){.row-more{opacity:0}.session-row:hover .row-more,.session-row.chosen .row-more,.row-more:focus-visible{opacity:1}.row-more:hover{background:var(--selected);color:var(--fg)}.session-row:not(:hover):not(.chosen) .session{padding-right:10px}}@media (hover:none){.row-more{display:none}.session-row .session{padding-right:10px}}.pin-mark{vertical-align:-1px;color:var(--fg-muted);margin-right:4px;display:inline-block}.session-branch{text-overflow:ellipsis;font-family:var(--mono);font-size:11px;overflow:hidden}.title-pin{vertical-align:-1px;color:var(--fg-muted);margin-right:6px;display:inline-block}.menu{z-index:60;background:var(--surface-0);border:1px solid var(--border);min-width:200px;box-shadow:var(--shadow-lg);border-radius:12px;padding:6px;animation:.1s ease-out fade;display:grid;position:fixed}.menu-title{color:var(--fg-muted);text-overflow:ellipsis;white-space:nowrap;max-width:260px;padding:6px 10px;font-size:12px;font-weight:600;overflow:hidden}.menu button{text-align:left;border-radius:8px;align-items:center;gap:10px;height:34px;padding:0 10px;font-size:13.5px;display:flex}.menu button:hover,.menu button:focus-visible{background:var(--hover);outline:none}.menu-sep{background:var(--border);height:1px;margin:4px 6px}.menu-danger{color:var(--danger)}@media (width<=760px){.menu button{height:44px;font-size:15px}}.agent-tabs{border-bottom:1px solid var(--border);scrollbar-width:none;gap:4px;padding:6px 24px;display:flex;overflow-x:auto}.agent-tabs button{height:28px;color:var(--fg-muted);text-overflow:ellipsis;white-space:nowrap;border-radius:8px;flex:none;align-items:center;gap:7px;max-width:220px;padding:0 10px;font-size:12.5px;display:inline-flex;overflow:hidden}.agent-tabs button.chosen{background:var(--selected);color:var(--fg)}.sheet-small{width:min(440px,100%)}.sheet-reset{margin-right:auto}@media (width<=760px){.agent-tabs{padding:6px 14px}}.agent-tab-name{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.prose.markstream-vue{color:var(--fg);--code-fg:var(--fg);--markstream-code-fallback-bg:var(--code-bg);--markstream-code-fallback-fg:var(--fg)}.prose.markstream-vue h1{font-size:1.35em}.prose.markstream-vue h2{font-size:1.2em}.prose.markstream-vue h1,.prose.markstream-vue h2{margin:1em 0 .5em;line-height:1.4}.prose.markstream-vue *,.prose.markstream-vue :before,.prose.markstream-vue :after{transition:none!important;animation:none!important}
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{A as e,C as t,D as n,G as r,H as i,K as a,M as o,O as s,P as c,R as l,U as u,V as ee,Z as d,_ as f,c as te,et as p,f as ne,g as m,h as re,it as ie,j as ae,k as h,m as g,n as oe,p as _,rt as se,tt as v,u as ce,x as le}from"./vue.runtime.esm-bundler-HH4C0BYQ.js";import{$ as ue,A as de,D as fe,E as pe,F as me,N as he,O as ge,P as _e,Q as ve,T as ye,X as be,c as xe,d as Se,j as Ce,k as we,n as Te,tt as Ee,v as De,w as Oe,x as ke}from"./MarkdownMessage-IYvqW4k2.js";import{t as Ae}from"./safeRaf-BDp3SJMs.js";function y(e,t){return/(?:&#\d+|#\d+|&[a-z]+)$/i.test(e.slice(Math.max(0,t-12),t))}function je(e){return e.includes(`->`)||e.includes(`-->`)||e.includes(`->>`)||e.includes(`-->>`)||e.includes(`-x`)||e.includes(`--x`)||e.includes(`-)`)||e.includes(`--)`)||e.includes(`-+`)||e.includes(`--+`)}function Me(e){let t=e.trimStart();return/^(?:accDescr|accTitle|activate|actor|and|alt|autonumber|box|break|critical|create\s+(?:actor|participant)|deactivate|destroy|else|end|link|links|loop|Note|opt|option|par|participant|properties|rect)\b/i.test(t)||function(e){let t=e.split(`;`,1)[0],n=t.indexOf(`:`);return n>0&&je(t.slice(0,n))}(t)}function b(e){if(!e.includes(`;`))return e;let t=e.indexOf(`:`);if(t===-1||!function(e,t){let n=e.slice(0,t);return/^\s*Note\b/i.test(n)||je(n)}(e,t))return e;let n=e.slice(0,t+1),r=e.slice(t+1),i=function(e){let t=``,n=!1;for(let r=0;r<e.length;r++){let i=e[r];i!==`;`||y(e,r)||Me(e.slice(r+1))?t+=i:(t+=`#59;`,n=!0)}return n?t:e}(r);return i===r?e:`${n}${i}`}function Ne(e){if(de(e)!==`sequencediagram`)return e;let t=e.split(/(\r\n|\n|\r)/),n=!1;for(let e=0;e<t.length;e+=2){let r=t[e],i=b(r);i!==r&&(t[e]=i,n=!0)}return n?t.join(``):e}var Pe=Object.defineProperty,Fe=Object.defineProperties,Ie=Object.getOwnPropertyDescriptors,Le=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,ze=Object.prototype.propertyIsEnumerable,Be=Math.pow,Ve=(e,t,n)=>t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,He=(e,t)=>{for(var n in t||={})Re.call(t,n)&&Ve(e,n,t[n]);if(Le)for(var n of Le(t))ze.call(t,n)&&Ve(e,n,t[n]);return e},x=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),Ue=[`data-markstream-mode`,`data-markstream-pending`],We={key:0,class:`mermaid-block-header flex items-center justify-between border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]`},Ge={key:0},Ke={key:1,class:`flex items-center gap-x-2 overflow-hidden`},qe=[`innerHTML`],Je={key:2},Ye={key:3,class:`mermaid-mode-toggle-group flex items-center gap-0.5`},Xe={class:`flex items-center gap-x-1`},Ze={class:`flex items-center gap-x-1`},Qe={key:4},$e={key:5,class:`mermaid-header-actions flex items-center`},et=[`aria-pressed`],tt={key:0,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},nt={key:1,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},rt=[`aria-label`,`disabled`],it=[`aria-label`,`disabled`],at={key:0,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},ot={key:1,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},st={class:`mermaid-source-code text-sm font-mono whitespace-pre-wrap`},ct={key:1,class:`relative`},lt={key:0,class:`absolute top-2 right-2 z-10 rounded-lg`},ut={class:`flex items-center gap-2 backdrop-blur rounded-lg`},dt={class:`dialog-panel mermaid-modal-panel relative w-full h-full max-w-full max-h-full rounded overflow-hidden`},ft={class:`absolute top-6 right-6 z-50 flex items-center gap-2`},pt=`mermaid-action-btn p-[var(--ms-action-btn-padding)] rounded`,S=De(t({__name:`MermaidBlockNode`,props:{node:{},maxHeight:{default:void 0},estimatedPreviewHeightPx:{},loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},renderDebounceMs:{default:300},contentStableDelayMs:{default:500},previewPollDelayMs:{default:800},previewPollMaxDelayMs:{default:4e3},previewPollMaxAttempts:{default:12},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0},enableWheelZoom:{type:Boolean,default:!1},isStrict:{type:Boolean,default:!0},enableMermaidInteractions:{type:Boolean,default:!1},showTooltips:{type:Boolean,default:!0},fitPreviewHeight:{type:Boolean,default:!1},onRenderError:{}},emits:[`copy`,`export`,`openModal`,`toggleMode`],setup(t,{emit:De}){let y=t,je=De,Me={USE_PROFILES:{svg:!0},FORBID_TAGS:[`script`],FORBID_ATTR:[/^on/i],ADD_TAGS:[`style`,`br`],ADD_ATTR:[`style`],SAFE_FOR_TEMPLATES:!0},b=d(!1),Pe=d(typeof window>`u`),Le=Se(),Re=pe(),ze=_(()=>y.isStrict?`strict`:`loose`),Ve=_(()=>({startOnLoad:!1,securityLevel:ze.value,dompurifyConfig:ze.value===`strict`?Me:void 0,htmlLabels:ze.value!==`strict`&&void 0,flowchart:ze.value===`strict`?{htmlLabels:!1}:void 0}));function S(e){if(e)try{e.replaceChildren()}catch{e.innerHTML=``}}function mt(e,t,n={}){if(!e)return null;let r=function(e,t){if(!e)return null;let n=ve(t);if(!n)return null;let r=function(e,t){let n=Array.from(e.childNodes),r=document.createElement(`div`);return r.dataset.mermaidSvgLayer=`1`,r.style.zIndex=`1`,r.appendChild(t),e.insertBefore(r,e.firstChild),n.length>0&&function(e){let t=()=>{var t;for(let n of e)(t=n.parentNode)==null||t.removeChild(n)};typeof requestAnimationFrame==`function`?requestAnimationFrame(()=>{requestAnimationFrame(t)}):setTimeout(t,32)}(n),r}(e,n);return{svg:n.outerHTML,bindTarget:r}}(e,t);return r||n.keepPreviousOnFailure||S(e),r}let ht=null;function gt(e){if(y.enableMermaidInteractions&&e?.querySelector(`svg`))try{ht?.(e)}catch{}}let{t:C}=ke(),w=!1,_t=0;function vt(){return x(this,null,function*(){try{let e=yield we();return w?null:(b.value=!!e,e)}catch(e){throw w||(b.value=!1),e}finally{w||(Pe.value=!0)}})}let yt=d(!1),T=d(!1),bt=d(),E=d(),D=d(),O=d(),xt=d(null),St=Te(),Ct=d(null),k=d(typeof window>`u`||!Le.value),wt=i(),Tt=n(be,null),A=``,Et=0,Dt=0,Ot=_(()=>xe(y,wt));function kt(){let e=Ot.value;e&&(A&&A!==e&&(Tt?.markSettled(A),Et=0),A=e,Et+=1,Dt+=1,Et===1&&Tt?.markPending(e))}function At(){return x(this,null,function*(){let e=A;if(!e||(Et=Math.max(0,Et-1),Et>0))return;A=``;let t=++Dt;yield h(),t===Dt&&(function(e=Ot.value){e&&bt.value&&Tt?.reportHeight(e,bt.value.offsetHeight)}(e),Tt?.markSettled(e))})}function jt(){let e=A;e&&(A=``,Et=0,Dt+=1,Tt?.markSettled(e))}let Mt=d(),j=_(()=>y.node.code.replace(/\]::([^:])/g,`]:::$1`).replace(/:::subgraphNode$/gm,`::subgraphNode`));function Nt(e,t=j.value){return In(t,e)}let Pt=_(()=>_e(y.estimatedPreviewHeightPx)??me(j.value));function Ft(){return function(e){let t=function(){let e=E.value?getComputedStyle(E.value).getPropertyValue(`--ms-size-diagram-min-height`).trim():``;return _e(e)??360}(),n=Wn();return he(e,t,n)}(Pt.value)}function It(){return`${Ft()}px`}let Lt=d(null);function Rt(){return!!D.value?.querySelector(`svg`)}function zt(){return!1!==y.loading&&(Rt()||!!Lt.value)}let M=d(1),N=d(0),P=d(0),Bt=d(!1),F=d(!0),Vt=d(!1),I=d(!1),L=d(null),Ht=d(!1),Ut=null;function Wt(){Ut!=null&&(clearTimeout(Ut),Ut=null)}u([k,Pe],([e,t])=>{Wt(),Ht.value=!1,e&&!t&&(Ut=setTimeout(()=>{Ut=null,Ht.value=!0},15e3))},{immediate:!0});let Gt=_(()=>{if((!Pe.value||b.value)&&F.value&&!Vt.value&&!Ht.value)return It()}),Kt=``,qt=!1,R=``,Jt=d(0),Yt=d(!1),Xt=_(()=>Math.max(0,y.renderDebounceMs??300)),Zt=_(()=>Math.max(0,y.contentStableDelayMs??500)),Qt=_(()=>Math.max(120,y.previewPollDelayMs??800)),$t=_(()=>Math.max(Qt.value,y.previewPollMaxDelayMs??4e3)),en=_(()=>Math.max(1,Math.trunc(y.previewPollMaxAttempts??12))),z=_(()=>!1!==y.loading),tn=null,nn=null,rn=null,an=null,on=0,sn=globalThis.requestIdleCallback??((e,t)=>setTimeout(()=>e({didTimeout:!0}),16)),cn=globalThis.cancelIdleCallback??(e=>clearTimeout(e));function B(e=_t){return!w&&e===_t}function V(){return B()&&k.value&&!T.value}function ln(){rn!=null&&(globalThis.clearTimeout(rn),rn=null),an!=null&&(cn(an),an=null)}function un(){w||rn==null&&an==null&&(rn=globalThis.setTimeout(()=>{rn=null,V()&&(an=sn(()=>{an=null,V()&&mr()},{timeout:500}))},Xt.value))}function dn(){nn!=null&&(globalThis.clearTimeout(nn),nn=null)}function fn(e=600){if(typeof globalThis>`u`||w)return;let t=Math.max(0,e);dn(),nn=globalThis.setTimeout(()=>{if(nn=null,!w){if(y.loading||I.value||!V())return void fn(Math.min(1200,Math.max(300,1.2*t)));un()}},t)}let H=d(It()),pn=d(H.value),mn=_(()=>y.fitPreviewHeight?`120px`:void 0),hn=null,U=d(!1),gn=d(!1),W=d({}),G=d(0),K=null,_n=null,q=d(!1),vn=_(()=>!(T.value||F.value||Pe.value&&!I.value&&!L.value&&(U.value||q.value&&(D.value?.textContent)?.trim()))),yn=d({zoom:1,translateX:0,translateY:0,containerHeight:H.value}),bn=_(()=>y.enableWheelZoom?{wheel:rr}:{}),J=_(()=>({worker:y.workerTimeoutMs??1400,parse:y.parseTimeoutMs??1800,render:y.renderTimeoutMs??2500,fullRender:y.fullRenderTimeoutMs??4e3})),xn=null,Sn=null,Cn=!1,wn=Qt.value,Y=null,Tn=0,En=!0,Dn=0;function On(e,t){let n=t?.timeoutMs,r=t?.signal;if(r?.aborted)return Promise.reject(new DOMException(`Aborted`,`AbortError`));let i=null,a=!1,o=null;return new Promise((t,s)=>{let c=()=>{i!=null&&clearTimeout(i),o&&r&&r.removeEventListener(`abort`,o)};n&&n>0&&(i=globalThis.setTimeout(()=>{a||(a=!0,c(),s(Error(`Operation timed out`)))},n)),r&&(o=()=>{a||(a=!0,c(),s(new DOMException(`Aborted`,`AbortError`)))},r.addEventListener(`abort`,o)),e().then(e=>{a||(a=!0,c(),t(e))}).catch(e=>{a||(a=!0,c(),s(e))})})}function kn(e){if(typeof document>`u`||!D.value)return;if(typeof y.onRenderError==`function`&&!0===y.onRenderError(e,j.value,D.value))return q.value=!0,void $();let t=document.createElement(`div`);t.style.padding=`var(--ms-inset-panel-body)`,t.style.color=`hsl(var(--ms-destructive))`,t.textContent=`Failed to render diagram: `;let n=document.createElement(`span`);n.textContent=e instanceof Error?e.message:`Unknown error`,t.appendChild(n),S(D.value),D.value.appendChild(t);let r=D.value?getComputedStyle(D.value).getPropertyValue(`--ms-size-diagram-min-height`).trim():``;H.value=r||`360px`,pn.value=H.value,q.value=!0,$()}function An(e){let t=typeof e==`string`?e:typeof e?.message==`string`?e.message:``;return typeof t==`string`&&/timed out/i.test(t)}function jn(e){return e?.name===`AbortError`}function Mn(e){return!An(e)&&!jn(e)}typeof window<`u`&&u([()=>bt.value,Le],([e,t])=>{var n;if((n=Ct.value)==null||n.destroy(),Ct.value=null,!t||k.value)return void(k.value=!0);if(!e)return void(k.value=!1);let r=St(e,{rootMargin:Re?.value.heavyBlockMargin,allowIdle:!1});Ct.value=r,k.value=r.isVisible.value,r.whenVisible.then(()=>{k.value=!0})},{immediate:!0}),e(()=>{var e;w=!0,_t+=1,G.value+=1,(e=Ct.value)==null||e.destroy(),Ct.value=null,jt(),ln()});let Nn=_(()=>!1!==y.showTooltips);function Pn(e){return!e||e.disabled}function X(e,t,n=`top`){if(!Nn.value||Pn(e.currentTarget))return;let r=e,i=r?.clientX!=null&&r?.clientY!=null?{x:r.clientX,y:r.clientY}:void 0;ye(e.currentTarget,t,n,!1,i,y.isDark)}function Z(){Nn.value&&Oe()}function Fn(e){if(!Nn.value||Pn(e.currentTarget))return;let t=yt.value?C(`common.copied`)||`Copied`:C(`common.copy`)||`Copy`,n=e,r=n?.clientX!=null&&n?.clientY!=null?{x:n.clientX,y:n.clientY}:void 0;ye(e.currentTarget,t,`top`,!1,r,y.isDark)}function In(e,t){let n={theme:t===`dark`?`dark`:`default`};ze.value===`strict`&&(n.htmlLabels=!1,n.flowchart={htmlLabels:!1});let r=`%%{init: ${JSON.stringify(n)}}%%\n`;return ue(e,r)}function Ln(){return En&&!F.value&&!U.value&&!q.value}function Rn(e){let t=e.trim();return!(!t||t.startsWith(`%%`))&&!/^(?:gantt|title|dateformat|axisformat|tickinterval|excludes|section|todaymarker|topaxis|weekday|weekend|acctitle|accdescr|accdescrmultiline)\b/i.test(t)&&t.includes(`:`)}function zn(e){if(de(e)===`gantt`)return function(e){let t=e.split(/\r?\n/);for(!/\r?\n$/.test(e)&&t.length>0&&t.pop();t.length>0;){let e=t[t.length-1]?.trim();if(e&&!e.startsWith(`%%`)){if(Rn(e))break;t.pop()}else t.pop()}return t.some(Rn)?t.join(`
|
|
2
|
-
`):``}(e);let t=e.split(/\r?\n/);for(;t.length>0;){let e=t[t.length-1].trimEnd();if(e!==``){if(!(/^[-=~>|<\s]+$/.test(e.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(e)||/[-|><]$/.test(e)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(e)))break;t.pop()}else t.pop()}return t.join(`
|
|
3
|
-
`)}function Bn(e,t,n,r){return x(this,null,function*(){try{return yield On(()=>e.render(t,n),{timeoutMs:r})}catch(i){if(!Mn(i))throw i;let a=Ne(n);if(a===n)throw i;try{return yield On(()=>e.render(`${t}-retry`,a),{timeoutMs:r})}catch{throw i}}})}function Vn(e,t,n){return x(this,null,function*(){try{return yield fe(e,t,n?.timeoutMs??J.value.worker,n?.signal)}catch(r){if(r?.name===`AbortError`)throw r;let i=r?.code||r?.name;if(i!==`WORKER_BUSY`&&i!==`WORKER_TIMEOUT`&&i!==`WORKER_INIT_ERROR`&&i!==`MERMAID_DISABLED`&&i!==`WORKER_REPLACED`||r?.fallbackToRenderer||i===`WORKER_TIMEOUT`)return yield function(e,t,n){return x(this,null,function*(){let r=yield vt();if(!r)return;let i=r,a=In(e,t);if(typeof i.parse==`function`){try{yield On(()=>i.parse(a),{timeoutMs:n?.timeoutMs??J.value.parse,signal:n?.signal})}catch(e){if(!Mn(e))throw e;let t=Ne(a);if(t===a)throw e;try{yield On(()=>i.parse(t),{timeoutMs:n?.timeoutMs??J.value.parse,signal:n?.signal})}catch{throw e}}return!0}let o=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;try{yield On(()=>r.render(o,a),{timeoutMs:n?.timeoutMs??J.value.render,signal:n?.signal})}catch(e){if(!Mn(e))throw e;let t=Ne(a);if(t===a)throw e;try{yield On(()=>r.render(`${o}-retry`,t),{timeoutMs:n?.timeoutMs??J.value.render,signal:n?.signal})}catch{throw e}}return!0})}(e,t,n);throw r}})}function Hn(e,t,n){return x(this,null,function*(){if(de(e)===`gantt`){let r=zn(e);if(!r.trim())return{fullOk:!1,prefixOk:!1};try{if(yield Vn(r,t,n))return r===e?{fullOk:!0,prefixOk:!1}:{fullOk:!1,prefixOk:!0,prefix:r}}catch(e){if(e?.name===`AbortError`)throw e}return{fullOk:!1,prefixOk:!1}}try{if(yield Vn(e,t,n))return{fullOk:!0,prefixOk:!1}}catch(e){if(e?.name===`AbortError`)throw e}let r=zn(e);if(r&&r.trim()&&r!==e)try{try{let i=yield ge(e,t,n?.timeoutMs??J.value.worker,n?.signal);i&&i.trim()&&(r=i)}catch{}if(yield Vn(r,t,n))return{fullOk:!1,prefixOk:!0,prefix:r}}catch(e){if(e?.name===`AbortError`)throw e}return{fullOk:!1,prefixOk:!1}})}let Un=_(()=>F.value||I.value||T.value);function Wn(){if(y.maxHeight===`none`)return null;if(y.maxHeight!=null){let e=Number.parseFloat(String(y.maxHeight));if(Number.isFinite(e))return e}let e=E.value;if(e){let t=getComputedStyle(e).getPropertyValue(`--ms-size-code-max-height`).trim(),n=Number.parseFloat(t);if(Number.isFinite(n))return n}return 500}function Gn(e,t){if(!E.value||!D.value)return;let n=!t?.force&&!1!==y.loading&&Rt(),r=D.value.querySelector(`svg`);if(!r)return;let i=0,a=0,o=r.getAttribute(`viewBox`),s=r.getAttribute(`width`),c=r.getAttribute(`height`);if(o){let e=o.split(` `);e.length===4&&(i=Number.parseFloat(e[2]),a=Number.parseFloat(e[3]))}if(i&&a||s&&c&&(i=Number.parseFloat(s),a=Number.parseFloat(c)),Number.isNaN(i)||Number.isNaN(a)||i<=0||a<=0)try{let e=r.getBBox();e&&e.width>0&&e.height>0&&(i=e.width,a=e.height)}catch(e){console.error(`Failed to get SVG BBox:`,e);return}if(i>0&&a>0){let t=a/i,o=e??E.value.clientWidth,s=r.getBoundingClientRect().width,c=s>0?s/Math.max(.01,M.value):o,l=Wn(),u=c*t,ee=l==null?u:Math.min(u,l),d=y.fitPreviewHeight?Ce(ee,120,l):Math.max(ee,Ft());n||!y.fitPreviewHeight&&_e(y.estimatedPreviewHeightPx)!=null||(H.value=`${d}px`),pn.value=H.value}}let Q=d(!1),Kn=_(()=>({transform:`translate(${N.value}px, ${P.value}px) scale(${M.value})`}));function qn(e){e.key===`Escape`&&Q.value&&Yn()}function Jn(){if(!E.value||!O.value)return!1;if(O.value.firstElementChild?.getAttribute(`data-mermaid-modal-clone`)===`1`)return!0;let e=E.value.cloneNode(!0);e.dataset.mermaidModalClone=`1`,e.classList.add(`fullscreen`),e.style.height=`100%`,e.style.maxHeight=`100%`;let t=e.querySelector(`._mermaid`);t&&(t.style.contain=`none`,t.style.contentVisibility=`visible`);let n=e.querySelector(`[data-mermaid-wrapper]`);return n&&(xt.value=n,n.style.transform=Kn.value.transform),S(O.value),O.value.appendChild(e),gt(e),!0}function Yn(){if(Q.value=!1,O.value&&S(O.value),xt.value=null,typeof document<`u`)try{document.body.style.overflow=``}catch{}if(typeof window<`u`)try{window.removeEventListener(`keydown`,qn)}catch{}}function Xn(){M.value<3&&(M.value+=.1)}function Zn(){M.value>.5&&(M.value-=.1)}function Qn(){M.value=1,N.value=0,P.value=0}u(O,e=>{Q.value&&e&&Jn()}),u(Kn,e=>{Q.value&&xt.value&&(xt.value.style.transform=e.transform)},{immediate:!0});let $n=_(()=>Q.value||M.value>1),er=Ee({getTranslate:()=>({x:N.value,y:P.value}),setTranslate:e=>{N.value=e.x,P.value=e.y},canStart:e=>!!Rt()&&(e.pointerType!==`touch`||$n.value),onActiveChange:e=>Bt.value=e}),tr=er.start,nr=er.stop;function rr(e){if(y.enableWheelZoom&&(e.ctrlKey||e.metaKey)){if(e.preventDefault(),!E.value)return;let t=E.value.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=n-t.width/2,a=r-t.height/2,o=(i-N.value)/M.value,s=(a-P.value)/M.value,c=-e.deltaY*.01,l=Math.min(Math.max(M.value+c,.5),3);l!==M.value&&(N.value=i-o*l,P.value=a-s*l,M.value=l)}}function ir(){return x(this,null,function*(){try{let e=j.value,t={payload:{type:`copy`,text:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};if(je(`copy`,t),t.defaultPrevented)return;typeof navigator<`u`&&navigator.clipboard&&typeof navigator.clipboard.writeText==`function`&&(yield navigator.clipboard.writeText(e)),yt.value=!0,setTimeout(()=>{yt.value=!1},1e3)}catch(e){console.error(`Failed to copy:`,e)}})}function ar(){let e=D.value?.querySelector(`svg`);if(!e)return void console.error(`SVG element not found`);let t=new XMLSerializer().serializeToString(e),n={payload:{type:`export`},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:e,svgString:t};je(`export`,n),n.defaultPrevented||function(e,t=null){x(this,null,function*(){try{let n=t??new XMLSerializer().serializeToString(e),r=new Blob([n],{type:`image/svg+xml;charset=utf-8`}),i=URL.createObjectURL(r);if(typeof document<`u`){let e=document.createElement(`a`);e.href=i,e.download=`mermaid-diagram-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch{}URL.revokeObjectURL(i)}}catch(e){console.error(`Failed to export SVG:`,e)}})}(e,t)}function or(){let e=D.value?.querySelector(`svg`)??null,t={payload:{type:`open-modal`},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:e,svgString:e?new XMLSerializer().serializeToString(e):null};je(`openModal`,t),t.defaultPrevented||function(){if(Q.value=!0,typeof document<`u`)try{document.body.style.overflow=`hidden`}catch{}if(typeof window<`u`)try{window.addEventListener(`keydown`,qn)}catch{}h(()=>{Jn()||h(Jn)})}()}function sr(e){let t={payload:{type:`toggle-mode`,target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};je(`toggleMode`,e,t),t.defaultPrevented||cr(e)}function cr(e){return x(this,null,function*(){let t=Mt.value;if(!t)return Vt.value=!0,void(F.value=e===`source`);let n=t.getBoundingClientRect().height;t.style.height=`${n}px`,t.style.overflow=`hidden`,Vt.value=!0,F.value=e===`source`,yield h();let r=t.scrollHeight;t.style.transition=`height var(--ms-duration-standard) var(--ms-ease-standard)`,t.offsetHeight,t.style.height=`${r}px`;let i=()=>{t.style.transition=``,t.style.height=``,t.style.overflow=``,t.removeEventListener(`transitionend`,a)};function a(){i()}t.addEventListener(`transitionend`,a),setTimeout(()=>i(),220)})}function lr(e=j.value,t=y.isDark?`dark`:`light`,n=!1===y.loading){return{code:e,codeWithTheme:Nt(t,e),final:n,signature:`${t}\0${e}`,theme:t}}function ur(e){return e.signature===lr().signature}function dr(){return x(this,arguments,function*(e=lr()){let t=_t;if(!B(t)||!ur(e))return!1;if(I.value){let n=L.value,r=qt,i=Kt;if(!n)return!1;let a=yield n;return!(!B(t)||!ur(e))&&(i===e.signature?!(!a||R!==e.signature)||!(!e.final||!1!==y.loading||r)&&dr(e):dr(e))}if(!D.value){if(yield h(),!B(t))return!1;if(!D.value)return console.warn(`Mermaid container not ready`),!1}return!(!B(t)||!ur(e))&&(I.value=!0,qt=e.final,Kt=e.signature,kt(),L.value=x(null,null,function*(){var n,r,i;try{let a=yield vt();if(!B(t)||!a)return!1;let o=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;U.value||gn.value||(n=a.initialize)==null||n.call(a,(r=He({},Ve.value),i={dompurifyConfig:He({},Me)},Fe(r,Ie(i))));let s=yield Bn(a,o,e.codeWithTheme,J.value.fullRender);if(!B(t)||!function(e){return ur(e)||!e.final&&!1!==y.loading&&j.value.startsWith(e.code)}(e))return gn.value&&=!1,!1;if(!D.value)return!1;let c=mt(D.value,s?.svg,{keepPreviousOnFailure:!e.final||!1!==y.loading});if(!c)return gn.value&&=!1,!1;let l=s?.bindFunctions??null;return ht=l,gt(c.bindTarget),Ae(()=>Gn()),U.value||gn.value||(U.value=!0,yn.value={zoom:M.value,translateX:N.value,translateY:P.value,containerHeight:H.value}),W.value[e.theme]={svg:c.svg,bindFunctions:l},gn.value&&=!1,R=e.signature,Lt.value=D.value.innerHTML,q.value=!1,on=0,dn(),!0}catch(n){if(!B(t)||!ur(e))return gn.value&&=!1,!1;let r=An(n),i=on+1;return r&&i<=3?(on=i,fn(Math.min(1200,600*i))):(on=0,dn(),e.final&&!1===y.loading&&console.error(`Failed to render mermaid diagram:`,n),e.final&&!1===y.loading&&kn(n)),!1}finally{qt=!1,Kt=``,I.value=!1,L.value=null,B(t)&&At()}}),L.value)})}function fr(){return x(this,null,function*(){var e;let t=j.value;if(!t.trim()){if(zt())return;D.value&&S(D.value),Lt.value=null,R=``,q.value=!1;return}if(!b.value||!V())return;let n=lr(t);U.value&&n.signature===R&&(e=D.value)!=null&&e.querySelector(`svg`)||(yield dr(n))&&(q.value=!1)})}function pr(e,t,n,r){return x(this,null,function*(){let i=_t;if(!B(i)||!Ln()||!D.value&&(yield h(),!B(i)||!D.value)||I.value)return;I.value=!0,kt();let a=lr(t,n),o=x(null,null,function*(){try{let t=yield vt();if(!B(i)||!t)return!1;let o=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,s=zn(e),c=yield Bn(t,o,In(s&&s.trim()?s:e,n),J.value.render);if(!B(i)||G.value!==r||!1===y.loading||!Ln()||!ur(a))return!1;let l=c?.svg;if(!D.value||!l)return!1;let u=mt(D.value,l,{keepPreviousOnFailure:!0});return!!u&&(ht=c?.bindFunctions??null,gt(u.bindTarget),Ae(()=>Gn()),!1)}catch{return!1}finally{L.value===o&&(I.value=!1,L.value=null),B(i)&&At()}});return L.value=o,o})}function mr(){return x(this,null,function*(){if(!V())return;let e=_t,t=Date.now(),n=++G.value;kt();try{K&&K.abort(),K=new AbortController;let r=K.signal,i=y.isDark?`dark`:`light`,a=j.value;if(!a.trim()){if(zt())return;D.value&&S(D.value),Lt.value=null,R=``,q.value=!1;return}if(lr(a,i).signature===R)return;try{let o=yield Hn(a,i,{signal:r,timeoutMs:J.value.worker});if(!B(e))return;if(o.fullOk){if(r.aborted||G.value!==n||!(yield dr(lr(a,i))))return;B(e)&&G.value===n&&(q.value=!1);return}let s=Tn&&t<=Tn;if(o.prefixOk&&o.prefix&&!r.aborted&&G.value===n&&Ln()&&!s)return void(yield pr(o.prefix,a,i,n))}catch(e){if(e?.name===`AbortError`)return}if(!B(e)||G.value!==n||q.value)return;let o=W.value[i];if(o&&D.value){let e=mt(D.value,o.svg);e&&(ht=o.bindFunctions??null,gt(e.bindTarget))}}finally{B(e)&&At()}})}function $(){Cn&&(Cn=!1,wn=Qt.value,En=!1,Y&&=(Y.abort(),null),xn&&=(globalThis.clearTimeout(xn),null),Sn&&=(cn(Sn),null),Tn=Date.now())}function hr(){if($(),ln(),K){try{K.abort()}catch{}K=null}if(Y){try{Y.abort()}catch{}Y=null}dn(),on=0}function gr(){_n?.abort(),_n=null}function _r(e=Qt.value){Cn&&(Dn>=en.value?$():(xn&&globalThis.clearTimeout(xn),xn=globalThis.setTimeout(()=>{Sn=sn(()=>x(null,null,function*(){if(!Cn)return;if(!V()||F.value||U.value)return void $();let e=y.isDark?`dark`:`light`,t=j.value;if(!t.trim())return!1===y.loading?void $():void _r(wn);if(Dn++,Dn>en.value)$();else{Y&&Y.abort(),Y=new AbortController;try{let n=yield Hn(t,e,{signal:Y.signal,timeoutMs:J.value.worker});if(n.fullOk){if((yield dr(lr(t,e)))&&U.value)return void $()}else n.prefixOk&&n.prefix&&Ln()&&(yield pr(n.prefix,t,e,G.value))}catch{}wn=Math.min(Math.floor(1.5*wn),$t.value),_r(wn)}}),{timeout:500})},e)))}function vr(){Cn||z.value&&b.value&&V()&&(F.value||U.value||(Cn=!0,Tn=0,En=!0,Dn=0,wn=Qt.value,_r(wn)))}function yr(){return x(this,null,function*(){let e=_t;B(e)&&(yield vt().catch(t=>{B(e)&&(b.value=!1,console.warn(`[markstream-vue] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.`,t))}),B(e)&&(yield h(),B(e)&&(Vt.value||(F.value=!b.value),V()&&(z.value?(un(),Jt.value=j.value.length):F.value||fr()))))})}return e(nr),u(Nn,e=>{e||Oe()}),u(()=>j.value,e=>{if((e.trim()||!1===y.loading)&&(U.value=!1,W.value={}),!z.value)return $(),void(V()&&!F.value&&fr());V()&&un(),!F.value&&b.value&&V()?vr():$(),function(){if(!z.value||!F.value||!b.value)return;let e=j.value.length;e!==Jt.value&&(Yt.value=!0,Jt.value=e,tn&&clearTimeout(tn),tn=setTimeout(()=>{Yt.value&&F.value&&j.value.trim()&&(Yt.value=!1,cr(`preview`))},Zt.value))}()}),u(()=>y.isDark,()=>x(null,null,function*(){if(q.value)return;let e=y.isDark?`dark`:`light`,t=W.value[e];if(t){if(D.value){let e=mt(D.value,t.svg);e&&(ht=t.bindFunctions??null,gt(e.bindTarget))}return}let n={zoom:M.value,translateX:N.value,translateY:P.value,containerHeight:H.value},r=M.value!==1||N.value!==0||P.value!==0;gn.value=!0,r&&(M.value=1,N.value=0,P.value=0,yield h()),yield dr(),r&&(yield h(),M.value=n.zoom,N.value=n.translateX,P.value=n.translateY,H.value=n.containerHeight,yn.value=n)})),u(()=>F.value,e=>x(null,null,function*(){if(e)$(),U.value&&(yn.value={zoom:M.value,translateX:N.value,translateY:P.value,containerHeight:H.value});else{if(q.value)return;let e=y.isDark?`dark`:`light`;if(U.value&&W.value[e]){if(yield h(),D.value){let t=W.value[e],n=mt(D.value,t.svg);n&&(ht=t.bindFunctions??null,gt(n.bindTarget))}M.value=yn.value.zoom,N.value=yn.value.translateX,P.value=yn.value.translateY,H.value=yn.value.containerHeight;return}if(yield h(),!b.value||!V())return;if(!z.value)return $(),void(yield fr());vr(),yield mr()}})),u(()=>y.loading,(e,t)=>x(null,null,function*(){if(e)gr();else if(!0===t){gr();let e=j.value,t=e.trim();if(!t)return D.value&&S(D.value),Lt.value=null,R=``,q.value=!1,hr();if(!V())return void hr();let n=y.isDark?`dark`:`light`,r=lr(e,n);if(U.value&&r.signature===R){if(yield h(),D.value&&!D.value.querySelector(`svg`)&&W.value[n]){let e=W.value[n],t=mt(D.value,e.svg);t&&(ht=e.bindFunctions??null,gt(t.bindTarget))}Gn(void 0,{force:!0}),hr();return}let i=new AbortController;_n=i;try{let e=0;for(;;)try{yield Vn(t,n,{signal:i.signal,timeoutMs:J.value.worker});break}catch(t){let n=t?.code===`WORKER_BUSY`||t?.code===`WORKER_TIMEOUT`,r=t?.code===`WORKER_TIMEOUT`?2:8;if(!n||e>=r)throw t;let a=Math.min(50*Be(2,e),400);e++,yield On(()=>new Promise(e=>setTimeout(e,a)),{signal:i.signal})}if(!(yield dr(r)))return;q.value=!1,hr()}catch(e){if(jn(e))return;hr(),kn(e)}finally{_n===i&&(_n=null)}}})),u(E,e=>{hn&&hn.disconnect(),e&&(hn=new ResizeObserver(e=>{e&&e.length>0&&!F.value&&!T.value&&Ae(()=>{Gn(e[0].contentRect.width)})}),hn.observe(e))},{immediate:!0}),ae(()=>{Le.value&&!V()||yr()}),u(()=>b.value,e=>{Vt.value||(F.value=!e)}),u(()=>y.maxHeight,()=>{h(()=>{Gn()})}),u([()=>y.estimatedPreviewHeightPx,()=>j.value],()=>{U.value||Rt()||F.value||(H.value=It(),pn.value=H.value)}),u(()=>k.value,e=>x(null,null,function*(){e&&(Pe.value?(U.value||(z.value?(un(),Jt.value=j.value.length):fr()),y.loading||U.value||fr(),!F.value&&b.value&&z.value&&vr()):yield yr())}),{immediate:!1}),o(()=>{tn&&clearTimeout(tn),Wt(),ln(),hn&&hn.disconnect(),K&&=(K.abort(),null),gr(),$(),dn(),jt()}),u(()=>T.value,e=>x(null,null,function*(){e?($(),K&&K.abort()):V()&&!U.value&&(yield h(),z.value?(un(),vr()):F.value||fr())}),{immediate:!1}),(e,t)=>(c(),f(`div`,{ref_key:`blockContainer`,ref:bt,class:v([`mermaid-block-container rounded-lg border overflow-hidden`,[{"is-rendering":y.loading,dark:y.isDark}]]),"data-markstream-mermaid":`1`,"data-markstream-mode":F.value?`fallback`:U.value?`preview`:`pending`,"data-markstream-pending":vn.value?`true`:void 0},[y.showHeader?(c(),f(`div`,We,[e.$slots[`header-left`]?(c(),f(`div`,Ge,[l(e.$slots,`header-left`,{},void 0,!0)])):(c(),f(`div`,Ke,[g(`span`,{class:`icon-slot action-icon shrink-0`,innerHTML:p(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
|
|
4
|
-
<path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M1.5 2.5c0 6 2.25 5.75 4 7 .83.67 1.17 2 1 4h3c-.17-2 .17-3.33 1-4 1.75-1.25 4-1 4-7C12 2.5 10 3 8 7 6 3 4 2.5 1.5 2.5" />
|
|
5
|
-
</svg>
|
|
6
|
-
`)},null,8,qe),t[23]||=g(`span`,{class:`mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate`},`Mermaid`,-1)])),e.$slots[`header-center`]?(c(),f(`div`,Je,[l(e.$slots,`header-center`,{},void 0,!0)])):y.showModeToggle&&b.value?(c(),f(`div`,Ye,[g(`button`,{class:v([`mermaid-mode-btn px-2 py-0.5 rounded transition-colors`,[F.value?``:`is-active`]]),onClick:t[0]||=()=>sr(`preview`),onMouseenter:t[1]||=e=>X(e,p(C)(`common.preview`)||`Preview`),onFocus:t[2]||=e=>X(e,p(C)(`common.preview`)||`Preview`),onMouseleave:Z,onBlur:Z},[g(`div`,Xe,[t[24]||=g(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[g(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[g(`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0`}),g(`circle`,{cx:`12`,cy:`12`,r:`3`})])],-1),g(`span`,null,ie(p(C)(`common.preview`)||`Preview`),1)])],34),g(`button`,{class:v([`mermaid-mode-btn px-2 py-0.5 rounded transition-colors`,[F.value?`is-active`:``]]),onClick:t[3]||=()=>sr(`source`),onMouseenter:t[4]||=e=>X(e,p(C)(`common.source`)||`Source`),onFocus:t[5]||=e=>X(e,p(C)(`common.source`)||`Source`),onMouseleave:Z,onBlur:Z},[g(`div`,Ze,[t[25]||=g(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[g(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m16 18l6-6l-6-6M8 6l-6 6l6 6`})],-1),g(`span`,null,ie(p(C)(`common.source`)||`Source`),1)])],34)])):m(``,!0),e.$slots[`header-right`]?(c(),f(`div`,Qe,[l(e.$slots,`header-right`,{},void 0,!0)])):(c(),f(`div`,$e,[y.showCollapseButton?(c(),f(`button`,{key:0,class:v(pt),"aria-pressed":T.value,onClick:t[6]||=e=>T.value=!T.value,onMouseenter:t[7]||=e=>X(e,T.value?p(C)(`common.expand`)||`Expand`:p(C)(`common.collapse`)||`Collapse`),onFocus:t[8]||=e=>X(e,T.value?p(C)(`common.expand`)||`Expand`:p(C)(`common.collapse`)||`Collapse`),onMouseleave:Z,onBlur:Z},[(c(),f(`svg`,{style:se({rotate:T.value?`0deg`:`90deg`}),xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[...t[26]||=[g(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m9 18l6-6l-6-6`},null,-1)]],4))],40,et)):m(``,!0),y.showCopyButton?(c(),f(`button`,{key:1,class:v(pt),onClick:ir,onMouseenter:t[9]||=e=>Fn(e),onFocus:t[10]||=e=>Fn(e),onMouseleave:Z,onBlur:Z},[yt.value?(c(),f(`svg`,nt,[...t[28]||=[g(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M20 6L9 17l-5-5`},null,-1)]])):(c(),f(`svg`,tt,[...t[27]||=[g(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[g(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),g(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})],-1)]]))],32)):m(``,!0),y.showExportButton&&b.value?(c(),f(`button`,{key:2,class:v(`${pt} ${Un.value?`opacity-50 cursor-not-allowed`:``}`),"aria-label":p(C)(`common.export`)||`Export`,disabled:Un.value,onClick:ar,onMouseenter:t[11]||=e=>X(e,p(C)(`common.export`)||`Export`),onFocus:t[12]||=e=>X(e,p(C)(`common.export`)||`Export`),onMouseleave:Z,onBlur:Z},[...t[29]||=[g(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[g(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[g(`path`,{d:`M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),g(`path`,{d:`m7 10l5 5l5-5`})])],-1)]],42,rt)):m(``,!0),y.showFullscreenButton&&b.value?(c(),f(`button`,{key:3,class:v(`${pt} ${Un.value?`opacity-50 cursor-not-allowed`:``}`),"aria-label":Q.value?p(C)(`common.minimize`)||`Minimize`:p(C)(`common.open`)||`Open`,disabled:Un.value,onClick:or,onMouseenter:t[13]||=e=>X(e,Q.value?p(C)(`common.minimize`)||`Minimize`:p(C)(`common.open`)||`Open`),onFocus:t[14]||=e=>X(e,Q.value?p(C)(`common.minimize`)||`Minimize`:p(C)(`common.open`)||`Open`),onMouseleave:Z,onBlur:Z},[Q.value?(c(),f(`svg`,ot,[...t[31]||=[g(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6`},null,-1)]])):(c(),f(`svg`,at,[...t[30]||=[g(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6`},null,-1)]]))],42,it)):m(``,!0)]))])):m(``,!0),a(g(`div`,{ref_key:`modeContainerRef`,ref:Mt},[F.value?(c(),f(`div`,{key:0,class:`mermaid-source-panel`,style:se({minHeight:Gt.value})},[g(`pre`,st,ie(j.value),1)],4)):(c(),f(`div`,ct,[y.showZoomControls?(c(),f(`div`,lt,[g(`div`,ut,[g(`button`,{class:`mermaid-action-btn p-[var(--ms-action-btn-padding)] rounded transition-colors`,onClick:Xn,onMouseenter:t[15]||=e=>X(e,p(C)(`common.zoomIn`)||`Zoom in`),onFocus:t[16]||=e=>X(e,p(C)(`common.zoomIn`)||`Zoom in`),onMouseleave:Z,onBlur:Z},[...t[32]||=[g(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[g(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[g(`circle`,{cx:`11`,cy:`11`,r:`8`}),g(`path`,{d:`m21 21l-4.35-4.35M11 8v6m-3-3h6`})])],-1)]],32),g(`button`,{class:`mermaid-action-btn p-[var(--ms-action-btn-padding)] rounded transition-colors`,onClick:Zn,onMouseenter:t[17]||=e=>X(e,p(C)(`common.zoomOut`)||`Zoom out`),onFocus:t[18]||=e=>X(e,p(C)(`common.zoomOut`)||`Zoom out`),onMouseleave:Z,onBlur:Z},[...t[33]||=[g(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[g(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[g(`circle`,{cx:`11`,cy:`11`,r:`8`}),g(`path`,{d:`m21 21l-4.35-4.35M8 11h6`})])],-1)]],32),g(`button`,{class:`mermaid-action-btn p-[var(--ms-action-btn-padding)] text-[length:var(--ms-text-label)] rounded transition-colors`,onClick:Qn,onMouseenter:t[19]||=e=>X(e,p(C)(`common.resetZoom`)||`Reset zoom`),onFocus:t[20]||=e=>X(e,p(C)(`common.resetZoom`)||`Reset zoom`),onMouseleave:Z,onBlur:Z},ie(Math.round(100*M.value))+`% `,33)])])):m(``,!0),g(`div`,s({ref_key:`mermaidContainer`,ref:E,class:[`mermaid-preview-area relative overflow-hidden block transition-[height] ease-out`,{"mermaid-pan-touch":$n.value}],style:{height:H.value,minHeight:mn.value}},ee(bn.value,!0),{onPointerdown:t[21]||=(...e)=>p(tr)&&p(tr)(...e)}),[g(`div`,{"data-mermaid-wrapper":``,class:v([`absolute inset-0 cursor-grab`,{"cursor-grabbing":Bt.value}]),style:se(Kn.value)},[g(`div`,{ref_key:`mermaidContent`,ref:D,class:`_mermaid w-full text-center flex items-center justify-center min-h-full`,style:se({height:pn.value})},null,4)],6)],16),(c(),re(ne,{to:`body`},[g(`div`,{class:v([`markstream-vue`,{dark:y.isDark}])},[le(oe,{name:`mermaid-dialog`,appear:``},{default:r(()=>[Q.value?(c(),f(`div`,{key:0,class:`mermaid-modal-overlay fixed inset-0 z-50 flex items-center justify-center p-4`,onClick:ce(Yn,[`self`])},[g(`div`,dt,[g(`div`,ft,[g(`button`,{class:`mermaid-action-btn p-[var(--ms-action-btn-padding)] rounded transition-colors`,onClick:Xn},[...t[34]||=[g(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[g(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[g(`circle`,{cx:`11`,cy:`11`,r:`8`}),g(`path`,{d:`m21 21l-4.35-4.35M11 8v6m-3-3h6`})])],-1)]]),g(`button`,{class:`mermaid-action-btn p-[var(--ms-action-btn-padding)] rounded transition-colors`,onClick:Zn},[...t[35]||=[g(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[g(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[g(`circle`,{cx:`11`,cy:`11`,r:`8`}),g(`path`,{d:`m21 21l-4.35-4.35M8 11h6`})])],-1)]]),g(`button`,{class:`mermaid-action-btn p-[var(--ms-action-btn-padding)] text-[length:var(--ms-text-label)] rounded transition-colors`,onClick:Qn},ie(Math.round(100*M.value))+`% `,1),g(`button`,{class:`mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded transition-colors`,onClick:Yn},[...t[36]||=[g(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[g(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M18 6L6 18M6 6l12 12`})],-1)]])]),g(`div`,s({ref_key:`modalContent`,ref:O,class:[`w-full h-full flex items-center justify-center p-4 overflow-hidden`,{"mermaid-pan-touch":$n.value}]},ee(bn.value,!0),{onPointerdown:t[22]||=(...e)=>p(tr)&&p(tr)(...e)}),null,16)])])):m(``,!0)]),_:1})],2)]))]))],512),[[te,!T.value]])],10,Ue))}}),[[`__scopeId`,`data-v-2664a19d`]]);S.install=e=>{e.component(S.__name,S)};export{S as default};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./CodeBlockNode-CHQVlCcV.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./Tooltip-CKXNC_qW.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,C as t,D as n,G as r,P as i,U as a,Z as o,_ as s,g as ee,it as te,j as c,k as l,m as ne,n as re,p as u,rt as ie,tt as d,w as f,x as p}from"./vue.runtime.esm-bundler-HH4C0BYQ.js";import{B as m,C as h,H as g,R as _,V as v,X as y,c as b,v as x,z as ae}from"./MarkdownMessage-IYvqW4k2.js";var S=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),C=[`data-markstream-mode`,`data-markstream-pending`],w={key:0,class:`math-loading-overlay`},T=[`innerHTML`],oe={key:1,class:`math-block__fallback text-left`},E=x(t({__name:`MathBlockNode`,props:{node:{},indexKey:{},cacheScope:{}},setup(t){let x=t,E=o(null),D=n(y,null),O=u(()=>m(x.node.content)),k=f()?.vnode.el?.nodeType===1,se=u(()=>b(x,{})),A=function(){if(!x.node.content)return{html:``,text:x.node.raw,loading:!1};if(x.node.loading)return{html:``,text:``,loading:!0};let e=v();if(!e){let e=typeof window>`u`||k;return{html:``,text:e?x.node.raw:``,loading:!e}}try{let t=e.renderToString(O.value,{throwOnError:!1,displayMode:!0});return g(O.value,!0,t),{html:t,text:``,loading:!1}}catch{return{html:``,text:x.node.loading?``:x.node.raw,loading:x.node.loading}}}(),j=o(A.html),M=o(A.text),N=!1,P=0,F=!1,I=null,L=h(),R=null,z=``,B=o(A.loading),V=o(!1),H=o(G());function U(e){e!=null&&e!==P||(V.value=!1)}function W(){if(x.indexKey==null)return``;let e=x.cacheScope??L?.scope;return`${e!=null&&String(e).length>0?`${String(e)}:`:``}math-block:${String(x.indexKey)}`}function G(){var e;let t=W();return t&&(e=L?.cache.get(t))!=null?e:0}function K(){if(H.value===0)return;H.value=0;let e=W();e&&L?.cache.set(e,0)}function q(e){if(j.value)return void K();if(!Number.isFinite(e)||e<=0)return;let t=Math.max(H.value,e);if(t===H.value)return;H.value=t;let n=W();n&&L?.cache.set(n,t)}function J(){l(()=>{q(E.value?.offsetHeight??0)})}function Y(){let e=z;D&&e&&(z=``,D.markSettled(e))}function X(){return S(this,null,function*(){if(F)return Y(),void U();I&&=(I.abort(),null);let e=++P;if(!x.node.content)return Y(),U(),B.value=!1,j.value=``,M.value=x.node.raw,N=!1,void J();let t=new AbortController;I=t,V.value=!0,F||e!==P||t.signal.aborted?F||U(e):(function(){let e=se.value;D&&e&&z!==e&&(z&&D.markSettled(z),z=e,D.markPending(e))}(),ae(O.value,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:8,signal:t.signal}).then(t=>{F||e!==P||(j.value=t,M.value=``,N=!0,B.value=!1,K(),J())}).catch(t=>S(null,null,function*(){if(F||e!==P)return;let n=t?.code||t?.name,r=n===`KATEX_DISABLED`;if(n===`WORKER_INIT_ERROR`||t?.fallbackToRenderer||(n===`WORKER_BUSY`||n===`WORKER_TIMEOUT`)&&!x.node.loading){let t=yield _();if(F||e!==P)return;if(t){try{let e=t.renderToString(O.value,{throwOnError:x.node.loading,displayMode:!0});j.value=e,M.value=``,N=!0,B.value=!1,K(),J(),g(O.value,!0,e)}catch{}return}}if(r||!x.node.loading)return B.value=!1,j.value=``,M.value=x.node.raw,void J();N||(B.value=!0)})).finally(()=>{F||e!==P||(U(e),function(){let e=z;D&&e&&(z=``,l(()=>{if(!F){let t=E.value?.offsetHeight??0;t>0&&D.reportHeight(e,t)}D.markSettled(e)}))}())}))})}A.html&&(N=!0),A.html&&K();let ce=[{family:`$$`,open:`$$`,close:`$$`},{family:`\\[]`,open:`\\[`,close:`\\]`},{family:`\\[]`,open:`\\[`,close:`]`},{family:`[]`,open:`[`,close:`\\]`},{family:`[]`,open:`[`,close:`]`},{family:`\\()`,open:`\\(`,close:`\\)`},{family:`$`,open:`$`,close:`$`}];function Z(e,t){return function(e){let t=String(e??``);for(let{family:e,open:n,close:r}of ce)if((n!==`$`||!t.startsWith(`$$`)&&!t.endsWith(`$$`))&&t.length>=n.length+r.length&&t.startsWith(n)&&t.endsWith(r))return{family:e,inner:t.slice(n.length,t.length-r.length),trusted:!0};return null}(e)||{family:`content`,inner:String(t??``),trusted:!1}}let Q=null,$=`${O.value}\0${x.node.loading?`1`:`0`}`;return a(()=>[x.node.content,x.node.loading,x.node.raw],([e,,t],[n,,r])=>{var i,a;i=Z(r,n),a=Z(t,e),i.inner===``||i.family===a.family&&(i.trusted&&a.trusted?a.inner.startsWith(i.inner):a.inner===i.inner)||K(),function(){let e=O.value,t=!0===x.node.loading,n=`${e}\0${t?`1`:`0`}`;if(n!==$){if($=n,!t)return Q!=null&&(clearTimeout(Q),Q=null),void X();Q??=setTimeout(()=>{Q=null,X()},32)}}()},{flush:`post`}),a([()=>x.indexKey,()=>x.cacheScope],()=>{H.value=G(),J()}),c(()=>{typeof ResizeObserver<`u`&&E.value&&(R=new ResizeObserver(()=>{q(E.value?.offsetHeight??0)}),R.observe(E.value)),J(),j.value||X()}),e(()=>{F=!0,Q!=null&&(clearTimeout(Q),Q=null),Y(),I&&=(I.abort(),null),R?.disconnect(),R=null}),(e,t)=>(i(),s(`div`,{ref_key:`containerEl`,ref:E,class:`math-block text-center overflow-x-auto relative`,"data-markstream-math":`block`,"data-markstream-mode":j.value?`katex`:M.value?`fallback`:`loading`,"data-markstream-pending":V.value?`true`:void 0,style:ie(H.value?{minHeight:`${H.value}px`}:void 0)},[p(re,{name:`math-fade`},{default:r(()=>[!B.value||j.value||M.value?ee(``,!0):(i(),s(`div`,w,[...t[0]||=[ne(`div`,{class:`math-loading-spinner`},null,-1)]]))]),_:1}),j.value?(i(),s(`div`,{key:0,class:d([`math-block__content`,{"math-rendering":B.value}]),innerHTML:j.value},null,10,T)):M.value?(i(),s(`pre`,oe,te(M.value),1)):(i(),s(`div`,{key:2,class:d([`math-block__content`,{"math-rendering":B.value}])},null,2))],12,C))}}),[[`__scopeId`,`data-v-af54c877`]]);E.install=e=>{e.component(E.__name,E)};export{E as default};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|