zettcode-gateway 0.3.4__py3-none-any.whl

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.
Files changed (40) hide show
  1. zettcode/gateway/__init__.py +22 -0
  2. zettcode/gateway/app.py +454 -0
  3. zettcode/gateway/backend.py +368 -0
  4. zettcode/gateway/chat.py +142 -0
  5. zettcode/gateway/cli.py +495 -0
  6. zettcode/gateway/py.typed +0 -0
  7. zettcode/gateway/runfile.py +145 -0
  8. zettcode/gateway/service.py +1219 -0
  9. zettcode/gateway/settings.py +62 -0
  10. zettcode/gateway/static/app.css +1434 -0
  11. zettcode/gateway/static/app.js +3 -0
  12. zettcode/gateway/static/assets/KaTeX_AMS-Regular-U6PRYMIZ.woff2 +0 -0
  13. zettcode/gateway/static/assets/KaTeX_Caligraphic-Bold-5QL5CMTE.woff2 +0 -0
  14. zettcode/gateway/static/assets/KaTeX_Caligraphic-Regular-KX5MEWCF.woff2 +0 -0
  15. zettcode/gateway/static/assets/KaTeX_Fraktur-Bold-2QVFK6NQ.woff2 +0 -0
  16. zettcode/gateway/static/assets/KaTeX_Fraktur-Regular-2PEIFJSJ.woff2 +0 -0
  17. zettcode/gateway/static/assets/KaTeX_Main-Bold-YP5VVQRP.woff2 +0 -0
  18. zettcode/gateway/static/assets/KaTeX_Main-BoldItalic-N4V3DX7S.woff2 +0 -0
  19. zettcode/gateway/static/assets/KaTeX_Main-Italic-RELBIK7M.woff2 +0 -0
  20. zettcode/gateway/static/assets/KaTeX_Main-Regular-ARRPAO67.woff2 +0 -0
  21. zettcode/gateway/static/assets/KaTeX_Math-BoldItalic-K4WTGH3J.woff2 +0 -0
  22. zettcode/gateway/static/assets/KaTeX_Math-Italic-6KGCHLFN.woff2 +0 -0
  23. zettcode/gateway/static/assets/KaTeX_SansSerif-Bold-RRNVJFFW.woff2 +0 -0
  24. zettcode/gateway/static/assets/KaTeX_SansSerif-Italic-HMPFTM52.woff2 +0 -0
  25. zettcode/gateway/static/assets/KaTeX_SansSerif-Regular-XIQ62X4E.woff2 +0 -0
  26. zettcode/gateway/static/assets/KaTeX_Script-Regular-APUWIHLP.woff2 +0 -0
  27. zettcode/gateway/static/assets/KaTeX_Size1-Regular-5LRUTBFT.woff2 +0 -0
  28. zettcode/gateway/static/assets/KaTeX_Size2-Regular-LELKET5D.woff2 +0 -0
  29. zettcode/gateway/static/assets/KaTeX_Size3-Regular-WQRQ47UD.woff2 +0 -0
  30. zettcode/gateway/static/assets/KaTeX_Size4-Regular-CDMV7U5C.woff2 +0 -0
  31. zettcode/gateway/static/assets/KaTeX_Typewriter-Regular-VBYJ4NRC.woff2 +0 -0
  32. zettcode/gateway/static/chunks/chunk-Y6SLVHK3.js +1 -0
  33. zettcode/gateway/static/chunks/render-G6G3TSB3.js +341 -0
  34. zettcode/gateway/static/icon.png +0 -0
  35. zettcode/gateway/static/index.html +23 -0
  36. zettcode/gateway/static/logo.svg +205 -0
  37. zettcode/gateway/static/manifest.webmanifest +11 -0
  38. zettcode_gateway-0.3.4.dist-info/METADATA +21 -0
  39. zettcode_gateway-0.3.4.dist-info/RECORD +40 -0
  40. zettcode_gateway-0.3.4.dist-info/WHEEL +4 -0
@@ -0,0 +1,3 @@
1
+ import"./chunks/chunk-Y6SLVHK3.js";function Hn(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return n=>n in t}var Te={},an=[],St=()=>{},hr=()=>!1,Kn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Gn=e=>e.startsWith("onUpdate:"),Xe=Object.assign,ns=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},Bd=Object.prototype.hasOwnProperty,Ve=(e,t)=>Bd.call(e,t),de=Array.isArray,Xt=e=>yo(e)==="[object Map]",Nt=e=>yo(e)==="[object Set]",ea=e=>yo(e)==="[object Date]";var Ce=e=>typeof e=="function",Ie=e=>typeof e=="string",it=e=>typeof e=="symbol",De=e=>e!==null&&typeof e=="object",gr=e=>(De(e)||Ce(e))&&Ce(e.then)&&Ce(e.catch),sa=Object.prototype.toString,yo=e=>sa.call(e),_r=e=>yo(e).slice(8,-1),os=e=>yo(e)==="[object Object]",ss=e=>Ie(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,jn=Hn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");var rs=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Ld=/-\w/g,He=rs(e=>e.replace(Ld,t=>t.slice(1).toUpperCase())),Fd=/\B([A-Z])/g,Ct=rs(e=>e.replace(Fd,"-$1").toLowerCase()),Sn=rs(e=>e.charAt(0).toUpperCase()+e.slice(1)),bo=rs(e=>e?`on${Sn(e)}`:""),Ke=(e,t)=>!Object.is(e,t),Wn=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},is=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},Xn=e=>{let t=parseFloat(e);return isNaN(t)?e:t};var ta,ko=()=>ta||(ta=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Me(e){if(de(e)){let t={};for(let n=0;n<e.length;n++){let o=e[n],s=Ie(o)?Gd(o):Me(o);if(s)for(let r in s)t[r]=s[r]}return t}else if(Ie(e)||De(e))return e}var Ud=/;(?![^(]*\))/g,Hd=/:([^]+)/,Kd=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function Gd(e){let t={};return e.replace(Kd,n=>n.startsWith("/*")?"":n).split(Ud).forEach(n=>{if(n){let o=n.split(Hd);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function ie(e){let t="";if(Ie(e))t=e;else if(de(e))for(let n=0;n<e.length;n++){let o=ie(e[n]);o&&(t+=o+" ")}else if(De(e))for(let n in e)e[n]&&(t+=n+" ");return t.trim()}function vr(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Ie(t)&&(e.class=ie(t)),n&&(e.style=Me(n)),e}var ra="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",ia=Hn(ra),jd=Hn(ra+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function as(e){return!!e||e===""}function Wd(e,t,n){if(e.length!==t.length)return!1;let o=!0;for(let s=0;o&&s<e.length;s++)o=ft(e[s],t[s],n);return o}function na(e,t,n){if(e.size!==t.size)return!1;let o=Array.from(t),s=new Uint8Array(o.length);for(let r of e){let l=-1;for(let u=0;u<o.length;u++)if(!s[u]&&ft(r,o[u],n)){l=u;break}if(l<0)return!1;s[l]=1}return!0}function Xd(e,t,n){let o=Xt(e),s=Xt(t);if(o||s||(o=Nt(e),s=Nt(t),o||s))return o&&s?na(e,t,n):!1;let r=Object.keys(e).length,l=Object.keys(t).length;if(r!==l)return!1;for(let u in e){let p=e.hasOwnProperty(u),h=t.hasOwnProperty(u);if(p&&!h||!p&&h||!ft(e[u],t[u],n))return!1}return String(e)===String(t)}function oa(e,t,n,o){n||(n=[new Map,new Map]);let[s,r]=n;if(s.has(e)||r.has(t))return s.get(e)===t&&r.get(t)===e;s.set(e,t),r.set(t,e);let l=o(e,t,n);return s.delete(e),r.delete(t),l}function ft(e,t,n){if(e===t)return!0;let o=ea(e),s=ea(t);return o||s?o&&s?e.getTime()===t.getTime():!1:(o=it(e),s=it(t),o||s?e===t:(o=de(e),s=de(t),o||s?o&&s?oa(e,t,n,Wd):!1:(o=De(e),s=De(t),o||s?!o||!s?!1:oa(e,t,n,Xd):String(e)===String(t))))}function ls(e,t){return e.findIndex(n=>ft(n,t))}var aa=e=>!!(e&&e.__v_isRef===!0),d=e=>Ie(e)?e:e==null?"":de(e)||De(e)&&(e.toString===sa||!Ce(e.toString))?aa(e)?d(e.value):JSON.stringify(e,la,2):String(e),la=(e,t)=>aa(t)?la(e,t.value):Xt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],r)=>(n[mr(o,r)+" =>"]=s,n),{})}:Nt(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>mr(n))}:it(t)?mr(t):De(t)&&!de(t)&&!os(t)?String(t):t,mr=(e,t="")=>{var n;return it(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function Yd(e,...t){console.warn(`[Vue warn] ${e}`,...t)}var Je,No=class{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Je&&(Je.active?(this.parent=Je,this.index=(Je.scopes||(Je.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){let o=this.scopes.slice();for(t=0,n=o.length;t<n;t++)o[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){let s=this.scopes.slice();for(t=0,n=s.length;t<n;t++)s[t].resume()}let o=this.effects.slice();for(t=0,n=o.length;t<n;t++)o[t].resume()}}run(t){if(this._active){let n=Je;try{return Je=this,t()}finally{Je=n}}}on(){++this._on===1&&(this.prevScope=Je,Je=this)}off(){if(this._on>0&&--this._on===0){if(Je===this)Je=this.prevScope;else{let t=Je;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){let s=this.scopes.slice();for(n=0,o=s.length;n<o;n++)s[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){let s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}};function fa(){return Je}var Pe;var yr=new WeakSet,qn=class{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Je&&(Je.active?Je.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,yr.has(this)&&(yr.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ma(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ca(this),ha(this);let t=Pe,n=Tt;Pe=this,Tt=!0;try{return this.fn()}finally{ga(this),Pe=t,Tt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Mr(t);this.deps=this.depsTail=void 0,ca(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?yr.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){xr(this)&&this.run()}get dirty(){return xr(this)}},pa=0,wo,Eo;function ma(e,t=!1){if(e.flags|=8,t){e.next=Eo,Eo=e;return}e.next=wo,wo=e}function Or(){pa++}function Dr(){if(--pa>0)return;if(Eo){let t=Eo;for(Eo=void 0;t;){let n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;wo;){let t=wo;for(wo=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function ha(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ga(e){let t,n=e.depsTail,o=n;for(;o;){let s=o.prevDep;o.version===-1?(o===n&&(n=s),Mr(o),qd(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function xr(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(_a(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function _a(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===So)||(e.globalVersion=So,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!xr(e))))return;e.flags|=2;let t=e.dep,n=Pe,o=Tt;Pe=e,Tt=!0;try{ha(e);let s=e.fn(e._value);(t.version===0||Ke(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Pe=n,Tt=o,ga(e),e.flags&=-3}}function Mr(e,t=!1){let{dep:n,prevSub:o,nextSub:s}=e;if(o&&(o.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)Mr(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function qd(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var Tt=!0,va=[];function Lt(){va.push(Tt),Tt=!1}function Ft(){let e=va.pop();Tt=e===void 0?!0:e}function ca(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let n=Pe;Pe=void 0;try{t()}finally{Pe=n}}}var So=0,wr=class{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Jn=class{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Pe||!Tt||Pe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Pe)n=this.activeLink=new wr(Pe,this),Pe.deps?(n.prevDep=Pe.depsTail,Pe.depsTail.nextDep=n,Pe.depsTail=n):Pe.deps=Pe.depsTail=n,ya(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){let o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=Pe.depsTail,n.nextDep=void 0,Pe.depsTail.nextDep=n,Pe.depsTail=n,Pe.deps===n&&(Pe.deps=o)}return n}trigger(t){this.version++,So++,this.notify(t)}notify(t){Or();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Dr()}}};function ya(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)ya(o)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var Er=new WeakMap,Tn=Symbol(""),Nr=Symbol(""),Co=Symbol("");function Ze(e,t,n){if(Tt&&Pe){let o=Er.get(e);o||Er.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new Jn),s.map=o,s.key=n),s.track()}}function It(e,t,n,o,s,r){let l=Er.get(e);if(!l){So++;return}let u=p=>{p&&p.trigger()};if(Or(),t==="clear")l.forEach(u);else{let p=de(e),h=p&&ss(n);if(p&&n==="length"){let g=Number(o);l.forEach((y,E)=>{(E==="length"||E===Co||!it(E)&&E>=g)&&u(y)})}else switch((n!==void 0||l.has(void 0))&&u(l.get(n)),h&&u(l.get(Co)),t){case"add":p?h&&u(l.get("length")):(u(l.get(Tn)),Xt(e)&&u(l.get(Nr)));break;case"delete":p||(u(l.get(Tn)),Xt(e)&&u(l.get(Nr)));break;case"set":Xt(e)&&u(l.get(Tn));break}}Dr()}function Yn(e){let t=Ne(e);return t===e||(Ze(t,"iterate",Co),at(e))?t:vt(e)?Bt(e)?t.map(n=>qt(pt(n))):t.map(qt):t.map(pt)}function To(e){return Ze(e=Ne(e),"iterate",Co),e}function Rt(e,t){return vt(e)?qt(Bt(e)?pt(t):t):pt(t)}var Jd={__proto__:null,[Symbol.iterator](){return br(this,Symbol.iterator,e=>Rt(this,e))},concat(...e){return Yn(this).concat(...e.map(t=>de(t)?Yn(t):t))},entries(){return br(this,"entries",e=>(e[1]=Rt(this,e[1]),e))},every(e,t){return Yt(this,"every",e,t,void 0,arguments)},filter(e,t){return Yt(this,"filter",e,t,n=>n.map(o=>Rt(this,o)),arguments)},find(e,t){return Yt(this,"find",e,t,n=>Rt(this,n),arguments)},findIndex(e,t){return Yt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Yt(this,"findLast",e,t,n=>Rt(this,n),arguments)},findLastIndex(e,t){return Yt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Yt(this,"forEach",e,t,void 0,arguments)},includes(...e){return kr(this,"includes",e)},indexOf(...e){return kr(this,"indexOf",e)},join(e){return Yn(this).join(e)},lastIndexOf(...e){return kr(this,"lastIndexOf",e)},map(e,t){return Yt(this,"map",e,t,void 0,arguments)},pop(){return xo(this,"pop")},push(...e){return xo(this,"push",e)},reduce(e,...t){return da(this,"reduce",e,t)},reduceRight(e,...t){return da(this,"reduceRight",e,t)},shift(){return xo(this,"shift")},some(e,t){return Yt(this,"some",e,t,void 0,arguments)},splice(...e){return xo(this,"splice",e)},toReversed(){return Yn(this).toReversed()},toSorted(e){return Yn(this).toSorted(e)},toSpliced(...e){return Yn(this).toSpliced(...e)},unshift(...e){return xo(this,"unshift",e)},values(){return br(this,"values",e=>Rt(this,e))}};function br(e,t,n){let o=To(e),s=o[t],r=s.call(o);if(o!==e&&!at(e)){if(r[Symbol.toStringTag]==="Array Iterator"){let l=Object.create(Object.getPrototypeOf(r));return l.next=()=>ua(r.next(),n),s!==ba[t]&&Object.defineProperties(l,{return:{get(){let u=r.return;return typeof u=="function"?u.bind(r):u}},throw:{get(){let u=r.throw;return typeof u=="function"?u.bind(r):u}}}),l}r._next=r.next,r.next=()=>ua(r._next(),n)}return r}function ua(e,t){return e.done||(e.value=t(e.value)),e}var ba=Array.prototype;function Yt(e,t,n,o,s,r){let l=To(e),u=l!==e&&!at(e),p=l[t];if(p!==ba[t]){let y=p.apply(e,r);return u?pt(y):y}let h=n;l!==e&&(u?h=function(y,E){return n.call(this,Rt(e,y),E,e)}:n.length>2&&(h=function(y,E){return n.call(this,y,E,e)}));let g=p.call(l,h,o);return u&&s?s(g):g}function da(e,t,n,o){let s=To(e),r=s!==e&&!at(e),l=n,u=!1;s!==e&&(r?(u=o.length===0,l=function(h,g,y){return u&&(u=!1,h=Rt(e,h)),n.call(this,h,Rt(e,g),y,e)}):n.length>3&&(l=function(h,g,y){return n.call(this,h,g,y,e)}));let p=s[t](l,...o);return u?Rt(e,p):p}function kr(e,t,n){let o=Ne(e);Ze(o,"iterate",Co);let s=o[t](...n);return(s===-1||s===!1)&&zo(n[0])?(n[0]=Ne(n[0]),o[t](...n)):s}function xo(e,t,n=[]){Lt(),Or();let o=Ne(e)[t].apply(e,n);return Dr(),Ft(),o}var Zd=Hn("__proto__,__v_isRef,__isVue"),ka=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(it));function Qd(e){it(e)||(e=String(e));let t=Ne(this);return Ze(t,"has",e),t.hasOwnProperty(e)}var fs=class{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;let s=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return r;if(n==="__v_raw")return o===(s?r?cf:Ea:r?wa:xa).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;let l=de(t);if(!s){let p;if(l&&(p=Jd[n]))return p;if(n==="hasOwnProperty")return Qd}let u=Reflect.get(t,n,Ge(t)?t:o);if((it(n)?ka.has(n):Zd(n))||(s||Ze(t,"get",n),r))return u;if(Ge(u)){let p=l&&ss(n)?u:u.value;return s&&De(p)?ms(p):p}return De(u)?s?ms(u):be(u):u}},ps=class extends fs{constructor(t=!1){super(!1,t)}set(t,n,o,s){let r=t[n],l=de(t)&&ss(n);if(!this._isShallow){let h=vt(r);if(!at(o)&&!vt(o)&&(r=Ne(r),o=Ne(o)),!l&&Ge(r)&&!Ge(o))return h||(r.value=o),!0}let u=l?Number(n)<t.length:Ve(t,n),p=Reflect.set(t,n,o,Ge(t)?t:s);return t===Ne(s)&&p&&(u?Ke(o,r)&&It(t,"set",n,o,r):It(t,"add",n,o)),p}deleteProperty(t,n){let o=Ve(t,n),s=t[n],r=Reflect.deleteProperty(t,n);return r&&o&&It(t,"delete",n,void 0,s),r}has(t,n){let o=Reflect.has(t,n);return(!it(n)||!ka.has(n))&&Ze(t,"has",n),o}ownKeys(t){return Ze(t,"iterate",de(t)?"length":Tn),Reflect.ownKeys(t)}},Sr=class extends fs{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}},ef=new ps,tf=new Sr,nf=new ps(!0);var Cr=e=>e,cs=e=>Reflect.getPrototypeOf(e);function of(e,t,n){return function(...o){let s=this.__v_raw,r=Ne(s),l=Xt(r),u=e==="entries"||e===Symbol.iterator&&l,p=e==="keys"&&l,h=s[e](...o),g=n?Cr:t?qt:pt;return!t&&Ze(r,"iterate",p?Nr:Tn),Xe(Object.create(h),{next(){let{value:y,done:E}=h.next();return E?{value:y,done:E}:{value:u?[g(y[0]),g(y[1])]:g(y),done:E}}})}}function us(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function sf(e,t){let n={get(s){let r=this.__v_raw,l=Ne(r),u=Ne(s);e||(Ke(s,u)&&Ze(l,"get",s),Ze(l,"get",u));let{has:p}=cs(l),h=t?Cr:e?qt:pt;if(p.call(l,s))return h(r.get(s));if(p.call(l,u))return h(r.get(u));r!==l&&r.get(s)},get size(){let s=this.__v_raw;return!e&&Ze(Ne(s),"iterate",Tn),s.size},has(s){let r=this.__v_raw,l=Ne(r),u=Ne(s);return e||(Ke(s,u)&&Ze(l,"has",s),Ze(l,"has",u)),s===u?r.has(s):r.has(s)||r.has(u)},forEach(s,r){let l=this,u=l.__v_raw,p=Ne(u),h=t?Cr:e?qt:pt;return!e&&Ze(p,"iterate",Tn),u.forEach((g,y)=>s.call(r,h(g),h(y),l))}};return Xe(n,e?{add:us("add"),set:us("set"),delete:us("delete"),clear:us("clear")}:{add(s){let r=Ne(this),l=cs(r),u=Ne(s),p=!t&&!at(s)&&!vt(s)?u:s;return l.has.call(r,p)||Ke(s,p)&&l.has.call(r,s)||Ke(u,p)&&l.has.call(r,u)||(r.add(p),It(r,"add",p,p)),this},set(s,r){!t&&!at(r)&&!vt(r)&&(r=Ne(r));let l=Ne(this),{has:u,get:p}=cs(l),h=u.call(l,s);h||(s=Ne(s),h=u.call(l,s));let g=p.call(l,s);return l.set(s,r),h?Ke(r,g)&&It(l,"set",s,r,g):It(l,"add",s,r),this},delete(s){let r=Ne(this),{has:l,get:u}=cs(r),p=l.call(r,s);p||(s=Ne(s),p=l.call(r,s));let h=u?u.call(r,s):void 0,g=r.delete(s);return p&&It(r,"delete",s,void 0,h),g},clear(){let s=Ne(this),r=s.size!==0,l=void 0,u=s.clear();return r&&It(s,"clear",void 0,void 0,l),u}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=of(s,e,t)}),n}function Ar(e,t){let n=sf(e,t);return(o,s,r)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_isShallow"?t:s==="__v_raw"?o:Reflect.get(Ve(n,s)&&s in o?n:o,s,r)}var rf={get:Ar(!1,!1)},af={get:Ar(!1,!0)},lf={get:Ar(!0,!1)};var xa=new WeakMap,wa=new WeakMap,Ea=new WeakMap,cf=new WeakMap;function uf(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function be(e){return vt(e)?e:Rr(e,!1,ef,rf,xa)}function Pr(e){return Rr(e,!1,nf,af,wa)}function ms(e){return Rr(e,!0,tf,lf,Ea)}function Rr(e,t,n,o,s){if(!De(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let r=s.get(e);if(r)return r;let l=uf(_r(e));if(l===0)return e;let u=new Proxy(e,l===2?o:n);return s.set(e,u),u}function Bt(e){return vt(e)?Bt(e.__v_raw):!!(e&&e.__v_isReactive)}function vt(e){return!!(e&&e.__v_isReadonly)}function at(e){return!!(e&&e.__v_isShallow)}function zo(e){return e?!!e.__v_raw:!1}function Ne(e){let t=e&&e.__v_raw;return t?Ne(t):e}function zn(e){return!Ve(e,"__v_skip")&&Object.isExtensible(e)&&is(e,"__v_skip",!0),e}var pt=e=>De(e)?be(e):e,qt=e=>De(e)?ms(e):e;function Ge(e){return e?e.__v_isRef===!0:!1}function X(e){return Na(e,!1)}function Vo(e){return Na(e,!0)}function Na(e,t){return Ge(e)?e:new Tr(e,t)}var Tr=class{constructor(t,n){this.dep=new Jn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ne(t),this._value=n?t:pt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){let n=this._rawValue,o=this.__v_isShallow||at(t)||vt(t);t=o?t:Ne(t),Ke(t,n)&&(this._rawValue=t,this._value=o?t:pt(t),this.dep.trigger())}};function i(e){return Ge(e)?e.value:e}var df={get:(e,t,n)=>t==="__v_raw"?e:i(Reflect.get(e,t,n)),set:(e,t,n,o)=>{let s=e[t];return Ge(s)&&!Ge(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function gs(e){return Bt(e)?e:new Proxy(e,df)}var zr=class{constructor(t){this.__v_isRef=!0,this._value=void 0;let n=this.dep=new Jn,{get:o,set:s}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=s}get value(){return this._value=this._get()}set value(t){this._set(t)}};function Ir(e){return new zr(e)}var Vr=class{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Jn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=So-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Pe!==this)return ma(this,!0),!0}get value(){let t=this.dep.track();return _a(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}};function Sa(e,t,n=!1){let o,s;return Ce(e)?o=e:(o=e.get,s=e.set),new Vr(o,s,n)}var ds={},hs=new WeakMap,Cn;function Ca(e,t=!1,n=Cn){if(n){let o=hs.get(n);o||hs.set(n,o=[]),o.push(e)}}function Ta(e,t,n=Te){let{immediate:o,deep:s,once:r,scheduler:l,augmentJob:u,call:p}=n,h=L=>{(n.onWarn||Yd)("Invalid watch source: ",L,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},g=L=>s?L:at(L)||s===!1||s===0?$t(L,1):$t(L),y,E,z,D,V=!1,W=!1;if(Ge(e)?(E=()=>e.value,V=at(e)):Bt(e)?(E=()=>g(e),V=!0):de(e)?(W=!0,V=e.some(L=>Bt(L)||at(L)),E=()=>e.map(L=>{if(Ge(L))return L.value;if(Bt(L))return g(L);if(Ce(L))return p?p(L,2):L()})):Ce(e)?t?E=p?()=>p(e,2):e:E=()=>{if(z){Lt();try{z()}finally{Ft()}}let L=Cn;Cn=y;try{return p?p(e,3,[D]):e(D)}finally{Cn=L}}:E=St,t&&s){let L=E,ze=s===!0?1/0:s;E=()=>$t(L(),ze)}let re=fa(),U=()=>{y.stop(),re&&re.active&&ns(re.effects,y)};if(r&&t){let L=t;t=(...ze)=>{try{return L(...ze)}finally{U()}}}let $=W?new Array(e.length).fill(ds):ds,H=L=>{if(!(!(y.flags&1)||!y.dirty&&!L))if(t){let ze=y.run();if(L||s||V||(W?ze.some((ue,we)=>Ke(ue,$[we])):Ke(ze,$))){let ue=Cn;Lt();try{z&&z(),Cn=y;let we=[ze,$===ds?void 0:W&&$[0]===ds?[]:$,D];$=ze,p?p(t,3,we):t(...we)}finally{Cn=ue,Ft()}}}else y.run()};return u&&u(H),y=new qn(E),y.scheduler=l?()=>l(H,!1):H,D=L=>Ca(L,!1,y),z=y.onStop=()=>{let L=hs.get(y);if(L){if(p)p(L,4);else for(let ze of L)ze();hs.delete(y)}},t?o?H(!0):$=y.run():l?l(H.bind(null,!0),!0):y.run(),U.pause=y.pause.bind(y),U.resume=y.resume.bind(y),U.stop=U,U}function $t(e,t=1/0,n){if(t<=0||!De(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ge(e))$t(e.value,t,n);else if(de(e))for(let o=0;o<e.length;o++)$t(e[o],t,n);else if(Nt(e)||Xt(e))e.forEach(o=>{$t(o,t,n)});else if(os(e)){for(let o in e)$t(e[o],t,n);for(let o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&$t(e[o],t,n)}return e}function Lo(e,t,n,o){try{return o?e(...o):e()}catch(s){Ns(s,t,n)}}function Vt(e,t,n,o){if(Ce(e)){let s=Lo(e,t,n,o);return s&&gr(s)&&s.catch(r=>{Ns(r,t,n)}),s}if(de(e)){let s=[];for(let r=0;r<e.length;r++)s.push(Vt(e[r],t,n,o));return s}}function Ns(e,t,n,o=!0){let s=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||Te;if(t){let u=t.parent,p=t.proxy,h=`https://vuejs.org/error-reference/#runtime-${n}`;for(;u;){let g=u.ec;if(g){for(let y=0;y<g.length;y++)if(g[y](e,p,h)===!1)return}u=u.parent}if(r){Lt(),Lo(r,null,10,[e,p,h]),Ft();return}}mf(e,n,s,o,l)}function mf(e,t,n,o=!0,s=!1){if(s)throw e;console.error(e)}var ot=[],zt=-1,Ht=[],cn=null,Zn=0,Ha=Promise.resolve(),bs=null;function Ue(e){let t=bs||Ha;return e?t.then(this?e.bind(this):e):t}function hf(e){let t=zt+1,n=ot.length;for(;t<n;){let o=t+n>>>1,s=ot[o],r=Po(s);r<e||r===e&&s.flags&2?t=o+1:n=o}return t}function Yr(e){if(!(e.flags&1)){let t=Po(e),n=ot[ot.length-1];!n||!(e.flags&2)&&t>=Po(n)?ot.push(e):ot.splice(hf(t),0,e),e.flags|=1,Ka()}}function Ka(){bs||(bs=Ha.then(Xa))}function Ga(e){if(!de(e))cn&&e.id===-1?cn.splice(Zn+1,0,e):e.flags&1||(Ht.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)Ht.push(e[t]);Ka()}function ja(e,t,n,o=zt+1){for(;o<ot.length;o++){let s=ot[o];if(s&&s.flags&2){if(e&&s.id!==e.uid||t!==void 0&&!(s.id>=t))continue;ot.splice(o,1),o=e?o-1:zt,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Wa(e,t,n=0){if(Ht.length){let o=Ht,s=0;if(t){o=[];for(let l=0;l<Ht.length;l++){let u=Ht[l];(u.i!==void 0?!u.i||u.i.uid<n:t.has(u))?Ht[s++]=u:o.push(u)}}let r=[...new Set(o)].sort((l,u)=>Po(l)-Po(u));if(Ht.length=s,cn){for(let l=0;l<r.length;l++)cn.push(r[l]);return}for(cn=r,Zn=0;Zn<cn.length;Zn++){let l=cn[Zn];l.flags&4&&(l.flags&=-2),l.flags&8||l(),l.flags&=-2}cn=null,Zn=0}}var $r=!1;function gf(e,t){if($r){e();return}let n=t===void 0?void 0:new Set(Ht);e(),$r=!0;try{ja(void 0,t),Wa(void 0,n,t)}finally{$r=!1}}var Po=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Xa(e){let t=St;try{for(zt=0;zt<ot.length;zt++){let n=ot[zt];n&&!(n.flags&8)&&(n.flags&4&&(n.flags&=-2),Lo(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2))}}finally{for(;zt<ot.length;zt++){let n=ot[zt];n&&(n.flags&=-2)}zt=-1,ot.length=0,Wa(e),bs=null,(ot.length||Ht.length)&&Xa(e)}}var Qe=null,Ya=null;function ks(e){let t=Qe;return Qe=e,Ya=e&&e.type.__scopeId||null,t}function en(e,t=Qe,n){if(!t||e._n)return e;let o=(...s)=>{o._d&&$a(-1);let r=ks(t),l=Zt.length,u;try{u=e(...s)}finally{for(let p=Zt.length;p>l;p--)Qr();ks(r),o._d&&$a(1)}return u};return o._n=!0,o._c=!0,o._d=!0,o}function Ee(e,t){if(Qe===null)return e;let n=Ms(Qe),o=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[r,l,u,p=Te]=t[s];r&&(Ce(r)&&(r={mounted:r,updated:r}),r.deep&&$t(l),o.push({dir:r,instance:n,value:l,oldValue:void 0,arg:u,modifiers:p}))}return e}function Vn(e,t,n,o){let s=e.dirs,r=t&&t.dirs;for(let l=0;l<s.length;l++){let u=s[l];r&&(u.oldValue=r[l].value);let p=u.dir[o];p&&(Lt(),Vt(p,n,8,[e.el,u,e,t]),Ft())}}function _f(e,t,n=!1){let o=ti();if(o||eo){let s=eo?eo._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&Ce(t)?t.call(o&&o.proxy):t}}var vf=Symbol.for("v-scx"),yf=()=>{{let e=_f(vf);return e}};function bf(e,t){return qa(e,null,{flush:"sync"})}function ve(e,t,n){return qa(e,t,n)}function qa(e,t,n=Te){let{immediate:o,deep:s,flush:r,once:l}=n,u=Xe({},n),p=t&&o||!t&&r!=="post",h;if(Bo){if(r==="sync"){let z=yf();h=z.__watcherHandles||(z.__watcherHandles=[])}else if(!p){let z=()=>{};return z.stop=St,z.resume=St,z.pause=St,z}}let g=Qt;u.call=(z,D,V)=>Vt(z,g,D,V);let y=!1;r==="post"?u.scheduler=z=>{z.i=g,nt(z,g&&g.suspense)}:r!=="sync"&&(y=!0,u.scheduler=(z,D)=>{D?z():Yr(z)}),u.augmentJob=z=>{t&&(z.flags|=4),y&&(z.flags|=2,g&&(z.id=g.uid,z.i=g))};let E=Ta(e,t,u);return Bo&&(h?h.push(E):p&&E()),E}var ln=new WeakMap,Ja=Symbol("_vte"),Ss=e=>e.__isTeleport,Dn=e=>e&&(e.disabled||e.disabled===""),kf=e=>e&&(e.defer||e.defer===""),za=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Va=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Hr=(e,t)=>{let n=e&&e.to;return Ie(n)?t?t(n):null:n},xf={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,r,l,u,p,h){let{mc:g,pc:y,pbc:E,o:{insert:z,querySelector:D,createText:V,createComment:W,parentNode:re}}=h,U=Dn(t.props),{dynamicChildren:$}=t,H=(ue,we,Q)=>{ue.shapeFlag&16&&g(ue.children,we,Q,s,r,l,u,p)},L=(ue=t)=>{let we=Dn(ue.props),Q=ue.target=Hr(ue.props,D),q=Kr(Q,ue,V,z);Q&&(l!=="svg"&&za(Q)?l="svg":l!=="mathml"&&Va(Q)&&(l="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(Q),we||(H(ue,Q,q),Do(ue,!1)))},ze=ue=>{let we=()=>{if(ln.get(ue)===we){if(ln.delete(ue),Dn(ue.props)){let Q=re(ue.el)||n;H(ue,Q,ue.anchor),Do(ue,!0)}L(ue)}};ln.set(ue,we),nt(we,r)};if(e==null){let ue=t.el=V(""),we=t.anchor=V("");if(z(ue,n,o),z(we,n,o),kf(t.props)||r&&r.pendingBranch){ze(t);return}U&&(H(t,n,we),Do(t,!0)),L()}else{t.el=e.el;let ue=t.anchor=e.anchor,we=ln.get(e);if(we){we.flags|=8,ln.delete(e),ze(t);return}t.targetStart=e.targetStart;let Q=t.target=e.target,q=t.targetAnchor=e.targetAnchor,te=Dn(e.props),fe=te?n:Q,Be=te?ue:q;if(l==="svg"||za(Q)?l="svg":(l==="mathml"||Va(Q))&&(l="mathml"),$?(E(e.dynamicChildren,$,fe,s,r,l,u),Zr(e,t,!0)):p||y(e,t,fe,Be,s,r,l,u,!1),U)te?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):_s(t,n,ue,h,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let Et=Hr(t.props,D);Et&&(t.target=Et,_s(t,Et,null,h,0))}else te&&_s(t,Q,q,h,1);Do(t,U)}},remove(e,t,n,{um:o,o:{remove:s}},r){let{shapeFlag:l,children:u,anchor:p,targetStart:h,targetAnchor:g,target:y,props:E}=e,z=Dn(E),D=r||!z,V=ln.get(e);if(V&&(V.flags|=8,ln.delete(e)),y&&(s(h),s(g)),r&&s(p),!V&&(z||y)&&l&16)for(let W=0;W<u.length;W++){let re=u[W];o(re,t,n,D,!!re.dynamicChildren)}},move:_s,hydrate:wf};function _s(e,t,n,{o:{insert:o},m:s},r=2){r===0&&(e.targetStart&&o(e.targetStart,t,n),o(e.targetAnchor,t,n),n=e.targetAnchor);let{el:l,anchor:u,shapeFlag:p,children:h,props:g}=e,y=r===2;if(y&&o(l,t,n),!ln.has(e)&&(!y||Dn(g))&&p&16)for(let E=0;E<h.length;E++)s(h[E],t,n,2);y&&o(u,t,n)}function wf(e,t,n,o,s,r,{o:{nextSibling:l,parentNode:u,querySelector:p,insert:h,createText:g}},y){function E(W,re){let U=re;for(;U;){if(U&&U.nodeType===8){if(U.data==="teleport start anchor")t.targetStart=U;else if(U.data==="teleport anchor"){t.targetAnchor=U,W._lpa=t.targetAnchor&&l(t.targetAnchor);break}}U=l(U)}}function z(W,re){re.anchor=y(l(W),re,u(W),n,o,s,r)}let D=t.target=Hr(t.props,p),V=Dn(t.props);if(D){let W=D._lpa||D.firstChild;t.shapeFlag&16&&(V?(z(e,t),E(D,W),t.targetAnchor||Kr(D,t,g,h,u(e)===D?e:null)):(t.anchor=l(e),E(D,W),t.targetAnchor||Kr(D,t,g,h),y(W&&l(W),t,D,n,o,s,r))),Do(t,V)}else V&&t.shapeFlag&16&&(z(e,t),t.targetStart=e,t.targetAnchor=l(e));return t.anchor&&l(t.anchor)}var Cs=xf;function Do(e,t){let n=e.ctx;if(n&&n.ut){let o,s;for(t?(o=e.el,s=e.anchor):(o=e.targetStart,s=e.targetAnchor);o&&o!==s;)o.nodeType===1&&o.setAttribute("data-v-owner",n.uid),o=o.nextSibling;n.ut()}}function Kr(e,t,n,o,s=null){let r=t.targetStart=n(""),l=t.targetAnchor=n("");return r[Ja]=l,e&&(o(r,e,s),o(l,e,s)),l}var Br=Symbol("_leaveCb");function Ef(e){let t=e[0];if(e.length>1){let n=!1;for(let o of e)if(o.type!==yt){t=o,n=!0;break}}return t}function Za(e){if(!Qa(e))return Ss(e.type)&&e.children?Ef(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Ce(n.default))return n.default()}}function Ro(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;Ro(Ss(n.type)&&Za(n)||n,t)}else if(e.shapeFlag&128)e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback);else if(e.transition=t,e.type===S&&de(e.children)){let n=rl(e.children,!1);n&&Ro(n,t)}}function Gr(e){if(e.component)return Gr(e.component.subTree);if(e.type===S){let t=de(e.children)&&rl(e.children,!1);return t?Gr(t):void 0}if(e.type!==yt)return e}function O(e,t){return Ce(e)?Xe({name:e.name},t,{setup:e}):e}function Nf(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Oa(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var xs=new WeakMap;function Mo(e,t,n,o,s=!1){if(de(e)){e.forEach((V,W)=>Mo(V,t&&(de(t)?t[W]:t),n,o,s));return}if(Qn(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&Mo(e,t,n,o.component.subTree);return}let r=o.shapeFlag&4?Ms(o.component):o.el,l=s?null:r,{i:u,r:p}=e,h=t&&t.r,g=u.refs===Te?u.refs={}:u.refs,y=u.setupState,E=Ne(y),z=y===Te?hr:V=>Oa(g,V)?!1:Ve(E,V),D=(V,W)=>!(W&&Oa(g,W));if(h!=null&&h!==p){if(Da(t),Ie(h))g[h]=null,z(h)&&(y[h]=null);else if(Ge(h)){let V=t;D(h,V.k)&&(h.value=null),V.k&&(g[V.k]=null)}}if(Ce(p))Lo(p,u,12,[l,g]);else{let V=Ie(p),W=Ge(p);if(V||W){let re=()=>{if(e.f){let U=V?z(p)?y[p]:g[p]:D(p)||!e.k?p.value:g[e.k];if(s)de(U)&&ns(U,r);else if(de(U))U.includes(r)||U.push(r);else if(V)g[p]=[r],z(p)&&(y[p]=g[p]);else{let $=[r];D(p,e.k)&&(p.value=$),e.k&&(g[e.k]=$)}}else V?(g[p]=l,z(p)&&(y[p]=l)):W&&(D(p,e.k)&&(p.value=l),e.k&&(g[e.k]=l))};if(l){let U=()=>{re(),xs.delete(e)};U.id=-1,xs.set(e,U),nt(U,n)}else Da(e),re()}}}function Da(e){let t=xs.get(e);t&&(t.flags|=8,xs.delete(e))}var T1=ko().requestIdleCallback||(e=>setTimeout(e,1)),z1=ko().cancelIdleCallback||(e=>clearTimeout(e));var Qn=e=>!!e.type.__asyncLoader;var Qa=e=>e.type.__isKeepAlive;function Sf(e,t,n=Qt,o=!1){if(n){let s=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...l)=>{Lt();let u=ni(n),p=Vt(t,n,e,l);return u(),Ft(),p});return o?s.unshift(r):s.push(r),r}}var tn=e=>(t,n=Qt)=>{(!Bo||e==="sp")&&Sf(e,(...o)=>t(...o),n)},V1=tn("bm"),Re=tn("m"),Cf=tn("bu"),Tf=tn("u"),bt=tn("bum"),Mn=tn("um"),O1=tn("sp"),D1=tn("rtg"),M1=tn("rtc");var el="components";var tl=Symbol.for("v-ndc");function ht(e){return Ie(e)?zf(el,e,!1)||e:e||tl}function zf(e,t,n=!0,o=!1){let s=Qe||Qt;if(s){let r=s.type;if(e===el){let u=sp(r,!1);if(u&&(u===t||u===He(t)||u===Sn(He(t))))return r}let l=Ma(s[e]||r[e],t)||Ma(s.appContext[e],t);return!l&&o?r:l}}function Ma(e,t){return e&&(e[t]||e[He(t)]||e[Sn(He(t))])}function J(e,t,n,o){let s,r=n&&n[o],l=de(e);if(l||Ie(e)){let u=l&&Bt(e),p=!1,h=!1;u&&(p=!at(e),h=vt(e),e=To(e)),s=new Array(e.length);for(let g=0,y=e.length;g<y;g++)s[g]=t(p?h?qt(pt(e[g])):pt(e[g]):e[g],g,void 0,r&&r[g])}else if(typeof e=="number")if(!Number.isInteger(e)||e<0)s=[];else{s=new Array(e);for(let u=0;u<e;u++)s[u]=t(u+1,u,void 0,r&&r[u])}else if(De(e))if(e[Symbol.iterator])s=Array.from(e,(u,p)=>t(u,p,void 0,r&&r[p]));else{let u=Object.keys(e);s=new Array(u.length);for(let p=0,h=u.length;p<h;p++){let g=u[p];s[p]=t(e[g],g,p,r&&r[p])}}else s=[];return n&&(n[o]=s),s}function Ts(e,t,n,o,s,r){if(n==null&&(n={}),Qe.ce||Qe.parent&&Qn(Qe.parent)&&Qe.parent.ce){let h=r!=null&&n.key==null?Xe({},n,{key:r}):n,g=Object.keys(h).length>0;return t!=="default"&&(h.name=t),f(),ae(S,null,[C("slot",h,o&&o())],g?-2:64)}let l=e[t];l&&l._c&&(l._d=!1);let u=Zt.length;f();let p;try{let h=l&&nl(l(n)),g=n.key||r||h&&h.key;p=ae(S,{key:(g&&!it(g)?g:`_${t}`)+(!h&&o?"_fb":"")},h||(o?o():[]),h&&e._===1?64:-2)}catch(h){for(let g=Zt.length;g>u;g--)Qr();throw h}finally{l&&l._c&&(l._d=!0)}return!s&&p.scopeId&&(p.slotScopeIds=[p.scopeId+"-s"]),p}function nl(e){return e.some(t=>Ds(t)?!(t.type===yt||t.type===S&&!nl(t.children)):!0)?e:null}var jr=e=>e?bl(e)?Ms(e):jr(e.parent):null;var Ao=Xe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>jr(e.parent),$root:e=>jr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>e.type,$forceUpdate:e=>e.f||(e.f=()=>{Yr(e.update)}),$nextTick:e=>e.n||(e.n=Ue.bind(e.proxy)),$watch:e=>St});var Lr=(e,t)=>e!==Te&&!e.__isScriptSetup&&Ve(e,t),Vf={get({_:e},t){if(t==="__v_skip")return!0;let{ctx:n,setupState:o,data:s,props:r,accessCache:l,type:u,appContext:p}=e;if(t[0]!=="$"){let E=l[t];if(E!==void 0)switch(E){case 1:return o[t];case 2:return s[t];case 4:return n[t];case 3:return r[t]}else{if(Lr(o,t))return l[t]=1,o[t];if(Ve(r,t))return l[t]=3,r[t];if(n!==Te&&Ve(n,t))return l[t]=4,n[t];l[t]=0}}let h=Ao[t],g,y;if(h)return t==="$attrs"&&Ze(e.attrs,"get",""),h(e);if((g=u.__cssModules)&&(g=g[t]))return g;if(n!==Te&&Ve(n,t))return l[t]=4,n[t];if(y=p.config.globalProperties,Ve(y,t))return y[t]},set({_:e},t,n){let{data:o,setupState:s,ctx:r}=e;return Lr(s,t)?(s[t]=n,!0):Ve(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:s,props:r,type:l}},u){let p;return!!(n[u]||Lr(t,u)||Ve(r,u)||Ve(o,u)||Ve(Ao,u)||Ve(s.config.globalProperties,u)||(p=l.__cssModules)&&p[u])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Ve(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Aa(e){return de(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function zs(e,t){return!e||!t?e||t:de(e)&&de(t)?e.concat(t):Xe({},Aa(e),Aa(t))}function ol(){return{app:null,config:{isNativeTag:hr,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var Of=0;function Df(e,t){return function(o,s=null){Ce(o)||(o=Xe({},o)),s!=null&&!De(s)&&(s=null);let r=ol(),l=new WeakSet,u=[],p=!1,h=r.app={_uid:Of++,_component:o,_props:s,_container:null,_context:r,_instance:null,version:ip,get config(){return r.config},set config(g){},use(g,...y){return l.has(g)||(g&&Ce(g.install)?(l.add(g),g.install(h,...y)):Ce(g)&&(l.add(g),g(h,...y))),h},mixin(g){return h},component(g,y){return y?(r.components[g]=y,h):r.components[g]},directive(g,y){return y?(r.directives[g]=y,h):r.directives[g]},mount(g,y,E){if(!p){let z=h._ceVNode||C(o,s);return z.appContext=r,E===!0?E="svg":E===!1&&(E=void 0),y&&t?t(z,g):e(z,g,E),p=!0,h._container=g,g.__vue_app__=h,Ms(z.component)}},onUnmount(g){u.push(g)},unmount(){p&&(Vt(u,h._instance,16),e(null,h._container),delete h._container.__vue_app__)},provide(g,y){return r.provides[g]=y,h},runWithContext(g){let y=eo;eo=h;try{return g()}finally{eo=y}}};return h}}var eo=null;function no(e,t,n=Te){let o=ti(),s=He(t),r=Ct(t),l=sl(e,s),u=Ir((p,h)=>{let g,y=Te,E;return bf(()=>{let z=e[s];Ke(g,z)&&(g=z,h())}),{get(){return p(),n.get?n.get(g):g},set(z){let D=n.set?n.set(z):z;if(!Ke(D,g)&&!(y!==Te&&Ke(z,y)))return;let V=o.vnode.props,W=!!(V&&(t in V||s in V||r in V)&&(`onUpdate:${t}`in V||`onUpdate:${s}`in V||`onUpdate:${r}`in V));W||(g=z,h()),o.emit(`update:${t}`,D),Ke(z,y)&&(Ke(z,D)&&!Ke(D,E)||W&&y!==Te&&!Ke(D,g))&&h(),y=z,E=D}}});return u[Symbol.iterator]=()=>{let p=0;return{next(){return p<2?{value:p++?l||Te:u,done:!1}:{done:!0}}}},u}var sl=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${He(t)}Modifiers`]||e[`${Ct(t)}Modifiers`];function Mf(e,t,...n){if(e.isUnmounted)return;let o=e.vnode.props||Te,s=n,r=t.startsWith("update:"),l=r&&sl(o,t.slice(7));l&&(l.trim&&(s=n.map(g=>Ie(g)?g.trim():g)),l.number&&(s=s.map(Xn)));let u,p=o[u=bo(t)]||o[u=bo(He(t))];!p&&r&&(p=o[u=bo(Ct(t))]),p&&Vt(p,e,6,s);let h=o[u+"Once"];if(h){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,Vt(h,e,6,s)}}function Af(e,t,n=!1){let o=t.emitsCache,s=o.get(e);if(s!==void 0)return s;let r=e.emits,l={};return!r&&!!1?(De(e)&&o.set(e,null),null):(de(r)?r.forEach(p=>l[p]=null):Xe(l,r),De(e)&&o.set(e,l),l)}function Vs(e,t){return!e||!Kn(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Ve(e,t[0].toLowerCase()+t.slice(1))||Ve(e,Ct(t))||Ve(e,t))}function Fr(e){let{type:t,vnode:n,proxy:o,withProxy:s,propsOptions:[r],slots:l,attrs:u,emit:p,render:h,renderCache:g,props:y,data:E,setupState:z,ctx:D,inheritAttrs:V}=e,W=ks(e),re,U;try{if(n.shapeFlag&4){let L=s||o,ze=L;re=Kt(h.call(ze,L,g,y,z,E,D)),U=u}else{let L=t;re=Kt(L.length>1?L(y,{attrs:u,slots:l,emit:p}):L(y,null)),U=t.props?u:Pf(u)}}catch(L){Zt.length=0,Ns(L,e,1),re=C(yt)}let $=re,H;if(U&&V!==!1){let L=Object.keys(U),{shapeFlag:ze}=$;L.length&&ze&7&&(r&&L.some(Gn)&&(U=Rf(U,r)),$=to($,U,!1,!0))}if(n.dirs&&($=to($,null,!1,!0),$.dirs=$.dirs?$.dirs.concat(n.dirs):n.dirs),n.transition){let L=Ss($.type)&&Za($)||$;Ro(L,n.transition)}return re=$,ks(W),re}function rl(e,t=!0){let n;for(let o=0;o<e.length;o++){let s=e[o];if(Ds(s)){if(s.type!==yt||s.children==="v-if"){if(n)return;n=s}}else return}return n}var Pf=e=>{let t;for(let n in e)(n==="class"||n==="style"||Kn(n))&&((t||(t={}))[n]=e[n]);return t},Rf=(e,t)=>{let n={};for(let o in e)(!Gn(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function If(e,t,n){let{props:o,children:s,component:r}=e,{props:l,children:u,patchFlag:p}=t,h=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&p>=0){if(p&1024)return!0;if(p&16)return o?Pa(o,l,h):!!l;if(p&8){let g=t.dynamicProps;for(let y=0;y<g.length;y++){let E=g[y];if(il(l,o,E)&&!Vs(h,E))return!0}}}else return(s||u)&&(!u||!u.$stable)?!0:o===l?!1:o?l?Pa(o,l,h):!0:!!l;return!1}function Pa(e,t,n){let o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let s=0;s<o.length;s++){let r=o[s];if(!Ve(e,r)||il(t,e,r)&&!Vs(n,r))return!0}return!1}function il(e,t,n){let o=e[n],s=t[n];return n==="style"&&De(o)&&De(s)?!ft(o,s):o!==s}function $f({vnode:e,parent:t,suspense:n},o){for(;t;){let s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.suspense.vnode.el=s.el=o,e=s),s===e)(e=t.vnode).el=o,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=o)}var al={},ll=()=>Object.create(al),cl=e=>Object.getPrototypeOf(e)===al;function Bf(e,t,n,o=!1){let s={},r=ll();e.propsDefaults=Object.create(null),ul(e,t,s,r);for(let l in e.propsOptions[0])l in s||(s[l]=void 0);n?e.props=o?s:Pr(s):e.type.props?e.props=s:e.props=r,e.attrs=r}function Lf(e,t,n,o){let{props:s,attrs:r,vnode:{patchFlag:l}}=e,u=Ne(s),[p]=e.propsOptions,h=!1;if((o||l>0)&&!(l&16)){if(l&8){let g=e.vnode.dynamicProps;for(let y=0;y<g.length;y++){let E=g[y];if(Vs(e.emitsOptions,E))continue;let z=t[E];if(p)if(Ve(r,E))z!==r[E]&&(r[E]=z,h=!0);else{let D=He(E);s[D]=Wr(p,u,D,z,e,!1)}else z!==r[E]&&(r[E]=z,h=!0)}}}else{ul(e,t,s,r)&&(h=!0);let g;for(let y in u)(!t||!Ve(t,y)&&((g=Ct(y))===y||!Ve(t,g)))&&(p?n&&(n[y]!==void 0||n[g]!==void 0)&&(s[y]=Wr(p,u,y,void 0,e,!0)):delete s[y]);if(r!==u)for(let y in r)(!t||!Ve(t,y))&&(delete r[y],h=!0)}h&&It(e.attrs,"set","")}function ul(e,t,n,o){let[s,r]=e.propsOptions,l=!1,u;if(t)for(let p in t){if(jn(p))continue;let h=t[p],g;s&&Ve(s,g=He(p))?!r||!r.includes(g)?n[g]=h:(u||(u={}))[g]=h:Vs(e.emitsOptions,p)||(!(p in o)||h!==o[p])&&(o[p]=h,l=!0)}if(r){let p=Ne(n),h=u||Te;for(let g=0;g<r.length;g++){let y=r[g];n[y]=Wr(s,p,y,h[y],e,!Ve(h,y))}}return l}function Wr(e,t,n,o,s,r){let l=e[n];if(l!=null){let u=Ve(l,"default");if(u&&o===void 0){let p=l.default;if(l.type!==Function&&!l.skipFactory&&Ce(p)){let{propsDefaults:h}=s;if(n in h)o=h[n];else{let g=ni(s);o=h[n]=p.call(null,t),g()}}else o=p;s.ce&&s.ce._setProp(n,o)}l[0]&&(r&&!u?o=!1:l[1]&&(o===""||o===Ct(n))&&(o=!0))}return o}function Ff(e,t,n=!1){let o=t.propsCache,s=o.get(e);if(s)return s;let r=e.props,l={},u=[];if(!r&&!!1)return De(e)&&o.set(e,an),an;if(de(r))for(let g=0;g<r.length;g++){let y=He(r[g]);Ra(y)&&(l[y]=Te)}else if(r)for(let g in r){let y=He(g);if(Ra(y)){let E=r[g],z=l[y]=de(E)||Ce(E)?{type:E}:Xe({},E),D=z.type,V=!1,W=!0;if(de(D))for(let re=0;re<D.length;++re){let U=D[re],$=Ce(U)&&U.name;if($==="Boolean"){V=!0;break}else $==="String"&&(W=!1)}else V=Ce(D)&&D.name==="Boolean";z[0]=V,z[1]=W,(V||Ve(z,"default"))&&u.push(y)}}let h=[l,u];return De(e)&&o.set(e,h),h}function Ra(e){return e[0]!=="$"&&!jn(e)}var qr=e=>e==="_"||e==="_ctx"||e==="$stable",Jr=e=>de(e)?e.map(Kt):[Kt(e)],Uf=(e,t,n)=>{if(t._n)return t;let o=en((...s)=>Jr(t(...s)),n);return o._c=!1,o},dl=(e,t,n)=>{let o=e._ctx;for(let s in e){if(qr(s))continue;let r=e[s];if(Ce(r))t[s]=Uf(s,r,o);else if(r!=null){let l=Jr(r);t[s]=()=>l}}},fl=(e,t)=>{let n=Jr(t);e.slots.default=()=>n},pl=(e,t,n)=>{for(let o in t)(n||!qr(o))&&(e[o]=t[o])},Hf=(e,t,n)=>{let o=e.slots=ll();if(e.vnode.shapeFlag&32){let s=t._;s?(pl(o,t,n),n&&is(o,"_",s,!0)):dl(t,o)}else t&&fl(e,t)},Kf=(e,t,n)=>{let{vnode:o,slots:s}=e,r=!0,l=Te;if(o.shapeFlag&32){let u=t._;u?n&&u===1?r=!1:pl(s,t,n):(r=!t.$stable,dl(t,s)),l=t}else t&&(fl(e,t),l={default:1});if(r)for(let u in s)!qr(u)&&l[u]==null&&delete s[u]};function Gf(){let e=[]}var nt=Yf;function ml(e){return jf(e)}function jf(e,t){Gf();let n=ko();n.__VUE__=!0;let{insert:o,remove:s,patchProp:r,createElement:l,createText:u,createComment:p,setText:h,setElementText:g,parentNode:y,nextSibling:E,setScopeId:z=St,insertStaticContent:D}=e,V=(_,v,T,I=null,A=null,R=null,Y=void 0,K=null,G=!!v.dynamicChildren)=>{if(_===v)return;_&&!Oo(_,v)&&(I=Nn(_),F(_,A,R,!0),_=null),v.patchFlag===-2&&(G=!1,v.dynamicChildren=null),v.dynamicChildren&&_&&_.dynamicChildren&&_.dynamicChildren.hasOnce&&(v.dynamicChildren===an&&(v.dynamicChildren=[]),v.dynamicChildren.hasOnce=!0);let{type:P,ref:k,shapeFlag:w}=v;switch(P){case Os:W(_,v,T,I);break;case yt:re(_,v,T,I);break;case vs:_==null&&U(v,T,I,Y);break;case S:Be(_,v,T,I,A,R,Y,K,G);break;default:w&1?ze(_,v,T,I,A,R,Y,K,G):w&6?Et(_,v,T,I,A,R,Y,K,G):(w&64||w&128)&&P.process(_,v,T,I,A,R,Y,K,G,ct)}k!=null&&A?Mo(k,_&&_.ref,R,v||_,!v):k==null&&_&&_.ref!=null&&Mo(_.ref,null,R,_,!0)},W=(_,v,T,I)=>{if(_==null)o(v.el=u(v.children),T,I);else{let A=v.el=_.el;v.children!==_.children&&h(A,v.children)}},re=(_,v,T,I)=>{_==null?o(v.el=p(v.children||""),T,I):v.el=_.el},U=(_,v,T,I)=>{[_.el,_.anchor]=D(_.children,v,T,I,_.el,_.anchor)},$=(_,v,T,I)=>{if(v.children!==_.children){let A=E(_.anchor);L(_),[v.el,v.anchor]=D(v.children,T,A,I)}else v.el=_.el,v.anchor=_.anchor},H=({el:_,anchor:v},T,I)=>{let A;for(;_&&_!==v;)A=E(_),o(_,T,I),_=A;o(v,T,I)},L=({el:_,anchor:v})=>{let T;for(;_&&_!==v;)T=E(_),s(_),_=T;s(v)},ze=(_,v,T,I,A,R,Y,K,G)=>{if(v.type==="svg"?Y="svg":v.type==="math"&&(Y="mathml"),_==null)ue(v,T,I,A,R,Y,K,G);else{let P=_.el&&_.el._isVueCE?_.el:null;try{P&&P._beginPatch(),q(_,v,A,R,Y,K,G)}finally{P&&P._endPatch()}}},ue=(_,v,T,I,A,R,Y,K)=>{let G,P,{props:k,shapeFlag:w,transition:b,dirs:B}=_;if(G=_.el=l(_.type,R,k&&k.is,k),w&8?g(G,_.children):w&16&&Q(_.children,G,null,I,A,Ur(_,R),Y,K),B&&Vn(_,null,I,"created"),we(G,_,_.scopeId,Y,I),k){for(let he in k)he!=="value"&&!jn(he)&&r(G,he,null,k[he],R,I);"value"in k&&r(G,"value",null,k.value,R),(P=k.onVnodeBeforeMount)&&Ut(P,I,_)}B&&Vn(_,null,I,"beforeMount");let ne=Wf(A,b);ne&&b.beforeEnter(G),o(G,v,T),((P=k&&k.onVnodeMounted)||ne||B)&&nt(()=>{let me;try{P&&Ut(P,I,_),ne&&b.enter(G),B&&Vn(_,null,I,"mounted")}finally{}},A)},we=(_,v,T,I,A)=>{if(T&&z(_,T),I)for(let R=0;R<I.length;R++)z(_,I[R]);if(A){let R=A.subTree;if(v===R||gl(R.type)&&(R.ssContent===v||R.ssFallback===v)){let Y=A.vnode;we(_,Y,Y.scopeId,Y.slotScopeIds,A.parent)}}},Q=(_,v,T,I,A,R,Y,K,G=0)=>{for(let P=G;P<_.length;P++){let k=_[P]=K?Jt(_[P]):Kt(_[P]);V(null,k,v,T,I,A,R,Y,K)}},q=(_,v,T,I,A,R,Y)=>{let K=v.el=_.el,{patchFlag:G,dynamicChildren:P,dirs:k}=v;G|=_.patchFlag&16;let w=_.props||Te,b=v.props||Te,B;if(T&&On(T,!1),(B=b.onVnodeBeforeUpdate)&&Ut(B,T,v,_),k&&Vn(v,_,T,"beforeUpdate"),T&&On(T,!0),P&&(!_.dynamicChildren||_.dynamicChildren.length!==P.length)&&(G=0,Y=!1,P=null),(w.innerHTML&&b.innerHTML==null||w.textContent&&b.textContent==null)&&g(K,""),P?te(_.dynamicChildren,P,K,T,I,Ur(v,A),R):Y||wn(_,v,K,null,T,I,Ur(v,A),R,!1),G>0){if(G&16)fe(K,w,b,T,A);else if(G&2&&w.class!==b.class&&r(K,"class",null,b.class,A),G&4&&r(K,"style",w.style,b.style,A),G&8){let ne=v.dynamicProps;for(let he=0;he<ne.length;he++){let me=ne[he],$e=w[me],Le=b[me];(Le!==$e||me==="value")&&r(K,me,$e,Le,A,T)}}G&1&&_.children!==v.children&&g(K,v.children)}else!Y&&P==null&&fe(K,w,b,T,A);((B=b.onVnodeUpdated)||k)&&nt(()=>{B&&Ut(B,T,v,_),k&&Vn(v,_,T,"updated")},I)},te=(_,v,T,I,A,R,Y)=>{for(let K=0;K<v.length;K++){let G=_[K],P=v[K],k=G.el||Xr(G),w=k&&(G.type===S||!Oo(G,P)||G.shapeFlag&198)?y(k):T;V(G,P,w,null,I,A,R,Y,!0)}},fe=(_,v,T,I,A)=>{if(v!==T){if(v!==Te)for(let R in v)!jn(R)&&!(R in T)&&r(_,R,v[R],null,A,I);for(let R in T){if(jn(R))continue;let Y=T[R],K=v[R];Y!==K&&R!=="value"&&r(_,R,K,Y,A,I)}"value"in T&&r(_,"value",v.value,T.value,A)}},Be=(_,v,T,I,A,R,Y,K,G)=>{let P=v.el=_?_.el:u(""),k=v.anchor=_?_.anchor:u(""),{patchFlag:w,dynamicChildren:b,slotScopeIds:B}=v;B&&(K=K?K.concat(B):B),_==null?(o(P,T,I),o(k,T,I),Q(v.children||[],T,k,A,R,Y,K,G)):w>0&&w&64&&b&&_.dynamicChildren&&_.dynamicChildren.length===b.length?(te(_.dynamicChildren,b,T,A,R,Y,K),(v.key!=null||A&&v===A.subTree)&&Zr(_,v,!0)):wn(_,v,T,k,A,R,Y,K,G)},Et=(_,v,T,I,A,R,Y,K,G)=>{v.slotScopeIds=K,_==null?v.shapeFlag&512?A.ctx.activate(v,T,I,Y,G):Mt(v,T,I,A,R,Y,G):Fn(_,v,G)},Mt=(_,v,T,I,A,R,Y)=>{let K=_.component=Qf(_,I,A);if(Qa(_)&&(K.ctx.renderer=ct),ep(K,!1,Y),K.asyncDep){if(A&&A.registerDep(K,kn,Y,R),!_.el){let G=K.subTree=C(yt);re(null,G,v,T),_.placeholder=G.el}}else kn(K,_,v,T,A,R,Y)},Fn=(_,v,T)=>{let I=v.component=_.component;if(If(_,v,T))if(I.asyncDep&&!I.asyncResolved){v.el=_.el,v.placeholder=_.placeholder,xn(I,v,T);return}else I.next=v,I.update();else v.el=_.el,v.placeholder=_.placeholder,I.vnode=v},kn=(_,v,T,I,A,R,Y)=>{let K=()=>{if(_.isMounted){let{next:w,bu:b,u:B,parent:ne,vnode:he}=_;{let ut=hl(_);if(ut){w&&(w.el=he.el,xn(_,w,Y)),ut.asyncDep.then(()=>{nt(()=>{_.isUnmounted||P()},A)});return}}let me=w,$e;On(_,!1),w?(w.el=he.el,xn(_,w,Y)):w=he,b&&Wn(b),($e=w.props&&w.props.onVnodeBeforeUpdate)&&Ut($e,ne,w,he),On(_,!0);let Le=Fr(_),rt=_.subTree;_.subTree=Le,V(rt,Le,y(rt.el),Nn(rt),_,A,R),w.el=Le.el,me===null&&$f(_,Le.el),B&&nt(B,A),($e=w.props&&w.props.onVnodeUpdated)&&nt(()=>Ut($e,ne,w,he),A)}else{let w,{el:b,props:B}=v,{bm:ne,m:he,parent:me,root:$e,type:Le}=_,rt=Qn(v);if(On(_,!1),ne&&Wn(ne),!rt&&(w=B&&B.onVnodeBeforeMount)&&Ut(w,me,v),On(_,!0),b&&_o){let ut=()=>{_.subTree=Fr(_),_o(b,_.subTree,_,A,null)};rt&&Le.__asyncHydrate?Le.__asyncHydrate(b,_,ut):ut()}else{$e.ce&&$e.ce._hasShadowRoot()&&$e.ce._injectChildStyle(Le,_.parent?_.parent.type:void 0);let ut=_.subTree=Fr(_);V(null,ut,T,I,_,A,R),v.el=ut.el}if(he&&nt(he,A),!rt&&(w=B&&B.onVnodeMounted)){let ut=v;nt(()=>Ut(w,me,ut),A)}(v.shapeFlag&256||me&&Qn(me.vnode)&&me.vnode.shapeFlag&256)&&_.a&&nt(_.a,A),_.isMounted=!0,v=T=I=null}};_.scope.on();let G=_.effect=new qn(K);_.scope.off();let P=_.update=G.run.bind(G),k=_.job=G.runIfDirty.bind(G);k.i=_,k.id=_.uid,G.scheduler=()=>Yr(k),On(_,!0),P()},xn=(_,v,T)=>{v.component=_;let I=_.vnode.props;_.vnode=v,_.next=null,Lf(_,v.props,I,T),Kf(_,v.children,T),Lt(),ja(_),Ft()},wn=(_,v,T,I,A,R,Y,K,G=!1)=>{let P=_&&_.children,k=_?_.shapeFlag:0,w=v.children,{patchFlag:b,shapeFlag:B}=v;if(b>0){if(b&128){We(P,w,T,I,A,R,Y,K,G);return}else if(b&256){En(P,w,T,I,A,R,Y,K,G);return}}B&8?(k&16&&At(P,A,R),w!==P&&g(T,w)):k&16?B&16?We(P,w,T,I,A,R,Y,K,G):At(P,A,R,!0):(k&8&&g(T,""),B&16&&Q(w,T,I,A,R,Y,K,G))},En=(_,v,T,I,A,R,Y,K,G)=>{_=_||an,v=v||an;let P=_.length,k=v.length,w=Math.min(P,k),b;for(b=0;b<w;b++){let B=v[b]=G?Jt(v[b]):Kt(v[b]);V(_[b],B,T,null,A,R,Y,K,G)}P>k?At(_,A,R,!0,!1,w):Q(v,T,I,A,R,Y,K,G,w)},We=(_,v,T,I,A,R,Y,K,G)=>{let P=0,k=v.length,w=_.length-1,b=k-1;for(;P<=w&&P<=b;){let B=_[P],ne=v[P]=G?Jt(v[P]):Kt(v[P]);if(Oo(B,ne))V(B,ne,T,null,A,R,Y,K,G);else break;P++}for(;P<=w&&P<=b;){let B=_[w],ne=v[b]=G?Jt(v[b]):Kt(v[b]);if(Oo(B,ne))V(B,ne,T,null,A,R,Y,K,G);else break;w--,b--}if(P>w){if(P<=b){let B=b+1,ne=B<k?v[B].el:I;for(;P<=b;)V(null,v[P]=G?Jt(v[P]):Kt(v[P]),T,ne,A,R,Y,K,G),P++}}else if(P>b)for(;P<=w;)F(_[P],A,R,!0),P++;else{let B=P,ne=P,he=new Map;for(P=ne;P<=b;P++){let dt=v[P]=G?Jt(v[P]):Kt(v[P]);dt.key!=null&&he.set(dt.key,P)}let me,$e=0,Le=b-ne+1,rt=!1,ut=0,vo=new Array(Le);for(P=0;P<Le;P++)vo[P]=0;for(P=B;P<=w;P++){let dt=_[P];if($e>=Le){F(dt,A,R,!0);continue}let Pt;if(dt.key!=null)Pt=he.get(dt.key);else for(me=ne;me<=b;me++)if(vo[me-ne]===0&&Oo(dt,v[me])){Pt=me;break}Pt===void 0?F(dt,A,R,!0):(vo[Pt-ne]=P+1,Pt>=ut?ut=Pt:rt=!0,V(dt,v[Pt],T,null,A,R,Y,K,G),$e++)}let Ji=rt?Xf(vo):an;for(me=Ji.length-1,P=Le-1;P>=0;P--){let dt=ne+P,Pt=v[dt],Zi=v[dt+1],Qi=dt+1<k?Zi.el||Xr(Zi):I;vo[P]===0?V(null,Pt,T,Qi,A,R,Y,K,G):rt&&(me<0||P!==Ji[me]?ee(Pt,T,Qi,2):me--)}}},ee=(_,v,T,I,A=null)=>{let{el:R,type:Y,transition:K,children:G,shapeFlag:P}=_;if(P&6){ee(_.component.subTree,v,T,I);return}if(P&128){_.suspense.move(v,T,I);return}if(P&64){Y.move(_,v,T,ct);return}if(Y===S){o(R,v,T);for(let w=0;w<G.length;w++)ee(G[w],v,T,I);o(_.anchor,v,T);return}if(Y===vs){H(_,v,T);return}if(I!==2&&P&1&&K)if(I===0)K.persisted&&!R[Br]?o(R,v,T):(K.beforeEnter(R),o(R,v,T),nt(()=>K.enter(R),A));else{let{leave:w,delayLeave:b,afterLeave:B}=K,ne=()=>{_.ctx.isUnmounted?s(R):o(R,v,T)},he=()=>{let me=R._isLeaving||!!R[Br];R._isLeaving&&R[Br](!0),K.persisted&&!me?ne():w(R,()=>{ne(),B&&B()})};b?b(R,ne,he):he()}else o(R,v,T)},F=(_,v,T,I=!1,A=!1)=>{let{type:R,props:Y,ref:K,children:G,dynamicChildren:P,shapeFlag:k,patchFlag:w,dirs:b,cacheIndex:B,memo:ne}=_;if((w===-2||P&&P.hasOnce)&&(A=!1),K!=null&&(Lt(),Mo(K,null,T,_,!0),Ft()),B!=null&&(!_.ctx||_.ctx===v)&&(v.renderCache[B]=void 0),k&256){v.ctx.deactivate(_);return}let he=k&1&&b,me=!Qn(_),$e;if(me&&($e=Y&&Y.onVnodeBeforeUnmount)&&Ut($e,v,_),k&6)Un(_.component,T,I);else{if(k&128){_.suspense.unmount(T,I);return}he&&Vn(_,null,v,"beforeUnmount"),k&64?_.type.remove(_,v,T,ct,I):P&&!P.hasOnce&&(R!==S||w>0&&w&64)?At(P,v,T,!1,!0):(R===S&&w&384||!A&&k&16)&&At(G,v,T),I&&ce(_)}let Le=ne!=null&&B==null;(me&&($e=Y&&Y.onVnodeUnmounted)||he||Le)&&nt(()=>{$e&&Ut($e,v,_),he&&Vn(_,null,v,"unmounted"),Le&&(_.el=null)},T)},ce=_=>{let{type:v,el:T,anchor:I,transition:A}=_,R=v===S;if(R&&!A){st(T,I);return}if(v===vs){L(_),A&&!A.persisted&&A.afterLeave&&A.afterLeave();return}let Y=R?Gr(_):_,K=()=>{R?y(T)&&st(T,I):s(T),A&&!A.persisted&&A.afterLeave&&A.afterLeave()};if(Y&&Y.shapeFlag&1&&A&&!A.persisted){let{leave:G,delayLeave:P}=A,k=Y.el,w=()=>G(k,K);P?P(k,K,w):w()}else K()},st=(_,v)=>{let T;for(;_!==v;)T=E(_),s(_),_=T;s(v)},Un=(_,v,T)=>{let{bum:I,scope:A,job:R,subTree:Y,um:K,m:G,a:P}=_;Ia(G),Ia(P),I&&Wn(I),A.stop(),R?(R.flags|=8,F(Y,_,v,T)):_.vnode.el&&Y&&(Y.transition=_.vnode.transition,F(Y,_,v,T)),K&&nt(K,v),nt(()=>{_.isUnmounted=!0},v)},At=(_,v,T,I=!1,A=!1,R=0)=>{for(let Y=R;Y<_.length;Y++)F(_[Y],v,T,I,A)},Nn=_=>{if(_.shapeFlag&6)return Nn(_.component.subTree);if(_.shapeFlag&128)return _.suspense.next();let v=E(_.anchor||_.el),T=v&&v[Ja];return T?E(T):v},Wt=(_,v,T)=>{let I=_&&v._vnode?void 0:_&&_.component?_.component.uid:Zf();gf(()=>{_==null?v._vnode&&F(v._vnode,null,null,!0):V(v._vnode||null,_,v,null,null,null,T),v._vnode=_},I)},ct={p:V,um:F,m:ee,r:ce,mt:Mt,mc:Q,pc:wn,pbc:te,n:Nn,o:e},go,_o;return t&&([go,_o]=t(ct)),{render:Wt,hydrate:go,createApp:Df(Wt,go)}}function Ur({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function On({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Wf(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Zr(e,t,n=!1){let o=e.children,s=t.children;if(de(o)&&de(s))for(let r=0;r<o.length;r++){let l=o[r],u=s[r];u.shapeFlag&1&&!u.dynamicChildren&&((u.patchFlag<=0||u.patchFlag===32)&&(u=s[r]=Jt(s[r]),u.el=l.el),!n&&u.patchFlag!==-2&&Zr(l,u)),u.type===Os&&(u.patchFlag===-1&&(u=s[r]=Jt(u)),u.el=l.el),u.type===yt&&!u.el&&(u.el=l.el)}}function Xf(e){let t=e.slice(),n=[0],o,s,r,l,u,p=e.length;for(o=0;o<p;o++){let h=e[o];if(h!==0){if(s=n[n.length-1],e[s]<h){t[o]=s,n.push(o);continue}for(r=0,l=n.length-1;r<l;)u=r+l>>1,e[n[u]]<h?r=u+1:l=u;h<e[n[r]]&&(r>0&&(t[o]=n[r-1]),n[r]=o)}}for(r=n.length,l=n[r-1];r-- >0;)n[r]=l,l=t[l];return n}function hl(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:hl(t)}function Ia(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Xr(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?Xr(t.subTree):null}var gl=e=>e.__isSuspense;function Yf(e,t){t&&t.pendingBranch?de(e)?t.effects.push(...e):t.effects.push(e):Ga(e)}var S=Symbol.for("v-fgt"),Os=Symbol.for("v-txt"),yt=Symbol.for("v-cmt"),vs=Symbol.for("v-stc"),Zt=[],mt=null;function f(e=!1){Zt.push(mt=e?null:[])}function Qr(){Zt.pop(),mt=Zt[Zt.length-1]||null}var Io=1;function $a(e,t=!1){Io+=e,e<0&&mt&&t&&(mt.hasOnce=!0)}function _l(e){return e.dynamicChildren=Io>0?mt||an:null,Qr(),Io>0&&mt&&mt.push(e),e}function m(e,t,n,o,s,r){return _l(a(e,t,n,o,s,r,!0))}function ae(e,t,n,o,s){return _l(C(e,t,n,o,s,!0))}function Ds(e){return e?e.__v_isVNode===!0:!1}function Oo(e,t){return e.type===t.type&&e.key===t.key}var vl=({key:e})=>e??null,ys=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ie(e)||Ge(e)||Ce(e)?{i:Qe,r:e,k:t,f:!!n}:e:null);function a(e,t=null,n=null,o=0,s=null,r=e===S?0:1,l=!1,u=!1){let p={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&vl(t),ref:t&&ys(t),scopeId:Ya,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Qe};return u?(ws(p,n),r&128&&e.normalize(p)):n&&(p.shapeFlag|=Ie(n)?8:16),Io>0&&!l&&mt&&(p.patchFlag>0||r&6)&&p.patchFlag!==32&&mt.push(p),p}var C=qf;function qf(e,t=null,n=null,o=0,s=null,r=!1){if((!e||e===tl)&&(e=yt),Ds(e)){let u=to(e,t,!0);return n&&ws(u,n),Io>0&&!r&&mt&&(u.shapeFlag&6?mt[mt.indexOf(e)]=u:mt.push(u)),u.patchFlag=-2,u}if(rp(e)&&(e=e.__vccOpts),t){t=ei(t);let{class:u,style:p}=t;u&&!Ie(u)&&(t.class=ie(u)),De(p)&&(zo(p)&&!de(p)&&(p=Xe({},p)),t.style=Me(p))}let l=Ie(e)?1:gl(e)?128:Ss(e)?64:De(e)?4:Ce(e)?2:0;return a(e,t,n,o,s,l,r,!0)}function ei(e){return e?zo(e)||cl(e)?Xe({},e):e:null}function to(e,t,n=!1,o=!1){let{props:s,ref:r,patchFlag:l,children:u,transition:p}=e,h=t?Fo(s||{},t):s,g={__v_isVNode:!0,__v_skip:!0,type:e.type,props:h,key:h&&vl(h),ref:t&&t.ref?n&&r?de(r)?r.concat(ys(t)):[r,ys(t)]:ys(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:u,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==S?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:p,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&to(e.ssContent),ssFallback:e.ssFallback&&to(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return p&&o&&Ro(g,p.clone(g)),g}function le(e=" ",t=0){return C(Os,null,e,t)}function N(e="",t=!1){return t?(f(),ae(yt,null,e)):C(yt,null,e)}function Kt(e){return e==null||typeof e=="boolean"?C(yt):de(e)?C(S,null,e.slice()):Ds(e)?Jt(e):C(Os,null,String(e))}function Jt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:to(e)}function ws(e,t){let n=0,{shapeFlag:o}=e;if(t==null)t=null;else if(de(t))n=16;else if(typeof t=="object")if(o&65){let s=t.default;s&&(s._c&&(s._d=!1),ws(e,s()),s._c&&(s._d=!0));return}else{n=32;let s=t._;!s&&!cl(t)?t._ctx=Qe:s===3&&Qe&&(Qe.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(Ce(t)){if(o&65){ws(e,{default:t});return}t={default:t,_ctx:Qe},n=32}else t=String(t),o&64?(n=16,t=[le(t)]):n=8;e.children=t,e.shapeFlag|=n}function Fo(...e){let t={};for(let n=0;n<e.length;n++){let o=e[n];for(let s in o)if(s==="class")t.class!==o.class&&(t.class=ie([t.class,o.class]));else if(s==="style")t.style=Me([t.style,o.style]);else if(Kn(s)){let r=t[s],l=o[s];l&&r!==l&&!(de(r)&&r.includes(l))?t[s]=r?[].concat(r,l):l:l==null&&r==null&&!Gn(s)&&(t[s]=l)}else s!==""&&(t[s]=o[s])}return t}function Ut(e,t,n,o=null){Vt(e,t,7,[n,o])}var Jf=ol(),yl=0;function Zf(){return yl}function Qf(e,t,n){let o=e.type,s=(t?t.appContext:e.appContext)||Jf,r={uid:yl++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new No(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Ff(o,s),emitsOptions:Af(o,s),emit:null,emitted:null,propsDefaults:Te,inheritAttrs:o.inheritAttrs,ctx:Te,data:Te,props:Te,attrs:Te,slots:Te,refs:Te,setupState:Te,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return r.ctx={_:r},r.root=t?t.root:r,r.emit=Mf.bind(null,r),e.ce&&e.ce(r),r}var Qt=null,ti=()=>Qt||Qe,Es,$o;{let e=ko(),t=(n,o)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(o),r=>{s.length>1?s.forEach(l=>l(r)):s[0](r)}};Es=t("__VUE_INSTANCE_SETTERS__",n=>Qt=n),$o=t("__VUE_SSR_SETTERS__",n=>Bo=n)}var ni=e=>{let t=Qt;return Es(e),e.scope.on(),()=>{e.scope.off(),Es(t)}},Ba=()=>{Qt&&Qt.scope.off(),Es(null)};function bl(e){return e.vnode.shapeFlag&4}var Bo=!1;function ep(e,t=!1,n=!1){t&&$o(t);let{props:o,children:s}=e.vnode,r=bl(e);Bf(e,o,r,t),Hf(e,s,n||t);let l=r?tp(e,t):void 0;return t&&$o(!1),l}function tp(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Vf);let{setup:o}=n;if(o){Lt();let s=e.setupContext=o.length>1?op(e):null,r=ni(e),l=Lo(o,e,0,[e.props,s]),u=gr(l);if(Ft(),r(),(u||e.sp)&&!Qn(e)&&Nf(e),u){if(l.then(Ba,Ba),t)return l.then(p=>{$o(!0);try{La(e,p,t)}finally{$o(!1)}}).catch(p=>{Ns(p,e,0)});e.asyncDep=l}else La(e,l,t)}else kl(e,t)}function La(e,t,n){Ce(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:De(t)&&(e.setupState=gs(t)),kl(e,n)}var Fa,Ua;function kl(e,t,n){let o=e.type;if(!e.render){if(!t&&Fa&&!o.render){let s=o.template||!1;if(s){let{isCustomElement:r,compilerOptions:l}=e.appContext.config,{delimiters:u,compilerOptions:p}=o,h=Xe(Xe({isCustomElement:r,delimiters:u},l),p);o.render=Fa(s,h)}}e.render=o.render||St,Ua&&Ua(e)}}var np={get(e,t){return Ze(e,"get",""),e[t]}};function op(e){let t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,np),slots:e.slots,emit:e.emit,expose:t}}function Ms(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(gs(zn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ao)return Ao[n](e)},has(t,n){return n in t||n in Ao}})):e.proxy}function sp(e,t=!0){return Ce(e)?e.displayName||e.name:e.name||t&&e.__name}function rp(e){return Ce(e)&&"__vccOpts"in e}var x=(e,t)=>Sa(e,t,Bo);var ip="3.5.44";var ii,xl=typeof window<"u"&&window.trustedTypes;if(xl)try{ii=xl.createPolicy("vue",{createHTML:e=>e})}catch{}var Al=ii?e=>ii.createHTML(e):e=>e,ap="http://www.w3.org/2000/svg",lp="http://www.w3.org/1998/Math/MathML",nn=typeof document<"u"?document:null,wl=nn&&nn.createElement("template"),cp={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{let s=t==="svg"?nn.createElementNS(ap,e):t==="mathml"?nn.createElementNS(lp,e):n?nn.createElement(e,{is:n}):nn.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>nn.createTextNode(e),createComment:e=>nn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>nn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,s,r){let l=n?n.previousSibling:t.lastChild;if(s&&(s===r||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===r||!(s=s.nextSibling)););else{wl.innerHTML=Al(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);let u=wl.content;if(o==="svg"||o==="mathml"){let p=u.firstChild;for(;p.firstChild;)u.appendChild(p.firstChild);u.removeChild(p)}t.insertBefore(u,n)}return[l?l.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};var up=Symbol("_vtc");function dp(e,t,n){let o=e[up];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}var Is=Symbol("_vod"),Pl=Symbol("_vsh"),$s={name:"show",beforeMount(e,{value:t},{transition:n}){e[Is]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Uo(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),Uo(e,!0),o.enter(e)):o.leave(e,()=>{Uo(e,!1)}):Uo(e,t))},beforeUnmount(e,{value:t}){Uo(e,t)}};function Uo(e,t){e.style.display=t?e[Is]:"none",e[Pl]=!t}var fp=Symbol("");var pp=/(?:^|;)\s*display\s*:/;function mp(e,t,n){let o=e.style,s=Ie(n),r=!1;if(n&&!s){if(t)if(Ie(t))for(let l of t.split(";")){let u=l.slice(0,l.indexOf(":")).trim();n[u]==null&&Ho(o,u,"")}else for(let l in t)n[l]==null&&Ho(o,l,"");for(let l in n){l==="display"&&(r=!0);let u=n[l];u!=null?gp(e,l,!Ie(t)&&t?t[l]:void 0,u)||Ho(o,l,u):Ho(o,l,"")}}else if(s){if(t!==n){let l=o[fp];l&&(n+=";"+l),o.cssText=n,r=pp.test(n)}}else t&&e.removeAttribute("style");Is in e&&((!s||t!==n)&&(e[Is]=r?o.display:""),e[Pl]&&(o.display="none"))}var As=/\s*!important$/;function Ho(e,t,n){if(de(n))n.forEach(o=>Ho(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))As.test(n)?e.setProperty(t,n.replace(As,""),"important"):e.setProperty(t,n);else{let o=hp(e,t);As.test(n)?e.setProperty(Ct(o),n.replace(As,""),"important"):e[o]=n}}var El=["Webkit","Moz","ms"],oi={};function hp(e,t){let n=oi[t];if(n)return n;let o=He(t);if(o!=="filter"&&o in e)return oi[t]=o;o=Sn(o);for(let s=0;s<El.length;s++){let r=El[s]+o;if(r in e)return oi[t]=r}return t}function gp(e,t,n,o){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Ie(o)&&n===o}var Nl="http://www.w3.org/1999/xlink";function Sl(e,t,n,o,s,r=ia(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Nl,t.slice(6,t.length)):e.setAttributeNS(Nl,t,n):n==null||r&&!as(n)?e.removeAttribute(t):e.setAttribute(t,r?"":it(n)?String(n):n)}function Cl(e,t,n,o,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Al(n):n);return}let r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){let u=r==="OPTION"?e.getAttribute("value")||"":e.value,p=n==null?e.type==="checkbox"?"on":"":String(n);(u!==p||!("_value"in e))&&(e.value=p),n==null&&e.removeAttribute(t),e._value=n;return}let l=!1;if(n===""||n==null){let u=typeof e[t];u==="boolean"?n=as(n):n==null&&u==="string"?(n="",l=!0):u==="number"&&(n=0,l=!0)}try{e[t]=n}catch{}l&&e.removeAttribute(s||t)}function on(e,t,n,o){e.addEventListener(t,n,o)}function _p(e,t,n,o){e.removeEventListener(t,n,o)}var Tl=Symbol("_vei");function vp(e,t,n,o,s=null){let r=e[Tl]||(e[Tl]={}),l=r[t];if(o&&l)l.value=o;else{let[u,p]=kp(t);if(o){let h=r[t]=Ep(o,s);on(e,u,h,p)}else l&&(_p(e,u,l,p),r[t]=void 0)}}var yp=/(Once|Passive|Capture)$/,bp=/^on:?(?:Once|Passive|Capture)$/;function kp(e){let t,n;for(;(n=e.match(yp))&&!bp.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):Ct(e.slice(2)),t]}var si=0,xp=Promise.resolve(),wp=()=>si||(xp.then(()=>si=0),si=Date.now());function Ep(e,t){let n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;let s=n.value;if(de(s)){let r=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{r.call(o),o._stopped=!0};let l=s.slice(),u=[o];for(let p=0;p<l.length&&!o._stopped;p++){let h=l[p];h&&Vt(h,t,5,u)}}else Vt(s,t,5,[o])};return n.value=e,n.attached=wp(),n}var zl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Np=(e,t,n,o,s,r)=>{let l=s==="svg";t==="class"?dp(e,o,l):t==="style"?mp(e,n,o):Kn(t)?Gn(t)||vp(e,t,n,o,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Sp(e,t,o,l))?(Cl(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Sl(e,t,o,l,r,t!=="value")):e._isVueCE&&(Cp(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Ie(o)))?Cl(e,He(t),o,r,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),Sl(e,t,o,l))};function Sp(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&zl(t)&&Ce(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){let s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return zl(t)&&Ie(n)?!1:t in e}function Cp(e,t){let n=e._def.props;if(!n)return!1;let o=He(t);return Array.isArray(n)?n.some(s=>He(s)===o):Object.keys(n).some(s=>He(s)===o)}var un=e=>{let t=e.props["onUpdate:modelValue"]||!1;return de(t)?n=>Wn(t,n):t};function Tp(e){e.target.composing=!0}function Vl(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}var gt=Symbol("_assign"),Ps=Symbol("_initialValue");function ri(e,t,n){return t&&(e=e.trim()),n&&(e=Xn(e)),e}var Ae={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e.parentNode&&(e.type==="text"?e[Ps]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Ps]=e.defaultValue.replace(/\r\n?/g,`
2
+ `))),e[gt]=un(s);let r=o||s.props&&s.props.type==="number";on(e,t?"change":"input",l=>{l.target.composing||e[gt](ri(e.value,n,r))}),(n||r)&&on(e,"change",()=>{e.value=ri(e.value,n,r)}),t||(on(e,"compositionstart",Tp),on(e,"compositionend",Vl),on(e,"change",Vl))},mounted(e,{value:t,modifiers:{trim:n,number:o}}){let s=t??"",r=e[Ps];delete e[Ps],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[gt](ri(e.value,n,o)):e.value=s},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:r}},l){if(e[gt]=un(l),e.composing)return;let u=(r||e.type==="number")&&!/^0\d/.test(e.value)?Xn(e.value):e.value,p=t??"";if(u===p)return;let h=e.getRootNode();(h instanceof Document||h instanceof ShadowRoot)&&h.activeElement===e&&e.type!=="range"&&(o&&t===n||s&&e.value.trim()===p)||(e.value=p)}},zp={deep:!0,created(e,t,n){e[gt]=un(n),on(e,"change",()=>{let o=e._modelValue,s=oo(e),r=e.checked,l=e[gt];if(de(o)){let u=ls(o,s),p=u!==-1;if(r&&!p)l(o.concat(s));else if(!r&&p){let h=[...o];h.splice(u,1),l(h)}}else if(Nt(o)){let u=new Set(o);r?u.add(s):u.delete(s),l(u)}else l(Rl(e,r))})},mounted:Ol,beforeUpdate(e,t,n){e[gt]=un(n),Ol(e,t,n)}};function Ol(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(de(t))s=ls(t,o.props.value)>-1;else if(Nt(t))s=t.has(o.props.value);else{if(t===n)return;s=ft(t,Rl(e,!0))}e.checked!==s&&(e.checked=s)}var Vp={created(e,{value:t},n){e.checked=ft(t,n.props.value),e[gt]=un(n),on(e,"change",()=>{e[gt](oo(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[gt]=un(o),t!==n&&(e.checked=ft(t,o.props.value))}},An={deep:!0,created(e,{value:t,modifiers:{number:n}},o){e._modelValue=t,on(e,"change",()=>{let s=Array.prototype.filter.call(e.options,p=>p.selected).map(p=>n?Xn(oo(p)):oo(p)),r=e.multiple,l=r?Nt(e._modelValue)?new Set(s):s:s[0],u=e._pendingValue=[r,r?de(l)?s.slice():s:l];try{e[gt](l)}finally{Ue(()=>{e._pendingValue===u&&(e._pendingValue=void 0)})}}),e[gt]=un(o)},mounted(e,{value:t}){Dl(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[gt]=un(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Op(t,n[1],n[0]))&&Dl(e,t)}};function Op(e,t,n){if(!n)return ft(e,t);if(de(e))return ft(e,t);if(Nt(e)){if(e.size!==t.length)return!1;for(let o of t)if(!e.has(o))return!1;return!0}return!1}function Dl(e,t){let n=e.multiple,o=de(t);if(!(n&&!o&&!Nt(t))){for(let s=0,r=e.options.length;s<r;s++){let l=e.options[s],u=oo(l);if(n)if(o){let p=typeof u;p==="string"||p==="number"?l.selected=t.some(h=>String(h)===String(u)):l.selected=ls(t,u)>-1}else l.selected=t.has(u);else if(ft(oo(l),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function oo(e){return"_value"in e?e._value:e.value}function Rl(e,t){let n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}var Il={created(e,t,n){Rs(e,t,n,null,"created")},mounted(e,t,n){Rs(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){Rs(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){Rs(e,t,n,o,"updated")}};function Dp(e,t){switch(e){case"SELECT":return An;case"TEXTAREA":return Ae;default:switch(t){case"checkbox":return zp;case"radio":return Vp;default:return Ae}}}function Rs(e,t,n,o,s){let l=Dp(e.tagName,n.props&&n.props.type)[s];l&&l(e,t,n,o)}var Mp=["ctrl","shift","alt","meta"],Ap={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Mp.some(n=>e[`${n}Key`]&&!t.includes(n))},Ye=(e,t)=>{if(!e)return e;let n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=((s,...r)=>{for(let l=0;l<t.length;l++){let u=Ap[t[l]];if(u&&u(s,t))return}return e(s,...r)}))},Pp={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},$l=(e,t)=>{let n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;let r=Ct(s.key);if(t.some(l=>l===r||Pp[l]===r))return e(s)}))},Rp=Xe({patchProp:Np},cp),Ml;function Ip(){return Ml||(Ml=ml(Rp))}var Bl=((...e)=>{let t=Ip().createApp(...e),{mount:n}=t;return t.mount=o=>{let s=Bp(o);if(!s)return;let r=t._component;!Ce(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");let l=n(s,!1,$p(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),l},t});function $p(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Bp(e){return Ie(e)?document.querySelector(e):e}var Ll={Graph:"\u5173\u7CFB\u56FE","Session graph":"\u4F1A\u8BDD\u5173\u7CFB\u56FE",Sessions:"\u4F1A\u8BDD",Groups:"\u7FA4\u7EC4",Group:"\u7FA4\u7EC4",Messages:"\u6D88\u606F",Legend:"\u56FE\u4F8B",User:"\u7528\u6237",Agent:"\u667A\u80FD\u4F53",External:"\u5916\u90E8",Idle:"\u7A7A\u95F2",Working:"\u5DE5\u4F5C\u4E2D",idle:"\u7A7A\u95F2",working:"\u5DE5\u4F5C\u4E2D",offline:"\u79BB\u7EBF",external:"\u5916\u90E8",user:"\u7528\u6237",agent:"\u667A\u80FD\u4F53",steer:"\u63D2\u8BDD",followup:"\u8DDF\u8FDB",delivered:"\u5DF2\u9001\u8FBE",partial:"\u90E8\u5206\u9001\u8FBE","Live messages":"\u5B9E\u65F6\u6D88\u606F","Replay the last message":"\u91CD\u64AD\u6700\u540E\u4E00\u6761\u6D88\u606F",Replay:"\u91CD\u64AD","just now":"\u521A\u521A","{time} ago":"{time}\u524D",Workspace:"\u5DE5\u4F5C\u533A","Sent / received":"\u5DF2\u53D1 / \u5DF2\u6536","1:1 messages":"\u4E00\u5BF9\u4E00\u6D88\u606F",Last:"\u6700\u8FD1","{n} members":"{n} \u4F4D\u6210\u5458",Via:"\u6765\u6E90",Time:"\u65F6\u95F4",Mode:"\u65B9\u5F0F",Hops:"\u8DF3\u6570","{sessions} sessions \xB7 {groups} groups":"{sessions} \u4E2A\u4F1A\u8BDD \xB7 {groups} \u4E2A\u7FA4\u7EC4","The broker is not reachable, so this may be out of date.":"\u65E0\u6CD5\u8FDE\u63A5\u6D88\u606F\u4EE3\u7406\uFF0C\u6240\u663E\u793A\u7684\u5185\u5BB9\u53EF\u80FD\u5DF2\u8FC7\u671F\u3002","Cannot load the graph.":"\u65E0\u6CD5\u52A0\u8F7D\u5173\u7CFB\u56FE\u3002",Retry:"\u91CD\u8BD5",Close:"\u5173\u95ED","No other sessions are running":"\u6CA1\u6709\u5176\u4ED6\u4F1A\u8BDD\u5728\u8FD0\u884C","Start another session and the messages between them will appear here as they happen.":"\u518D\u542F\u52A8\u4E00\u4E2A\u4F1A\u8BDD\uFF0C\u5B83\u4EEC\u4E4B\u95F4\u7684\u6D88\u606F\u4F1A\u5B9E\u65F6\u663E\u793A\u5728\u8FD9\u91CC\u3002","No messages yet. Traffic between sessions shows up here as it happens.":"\u8FD8\u6CA1\u6709\u6D88\u606F\u3002\u4F1A\u8BDD\u4E4B\u95F4\u7684\u901A\u4FE1\u4F1A\u5B9E\u65F6\u663E\u793A\u5728\u8FD9\u91CC\u3002",REPLAY:"\u56DE\u653E","REPLAY \u2014 {from} \u2192 {to}":"\u56DE\u653E \u2014 {from} \u2192 {to}","Back to live":"\u8FD4\u56DE\u5B9E\u65F6","Watch stored traffic again. Nothing is sent.":"\u91CD\u65B0\u89C2\u770B\u5DF2\u5B58\u50A8\u7684\u901A\u4FE1\uFF0C\u4E0D\u4F1A\u53D1\u9001\u4EFB\u4F55\u6D88\u606F\u3002",Period:"\u65F6\u95F4\u6BB5","15 min":"15 \u5206\u949F","1 h":"1 \u5C0F\u65F6","24 h":"24 \u5C0F\u65F6","7 d":"7 \u5929","All stored":"\u5168\u90E8\u5DF2\u5B58\u50A8",From:"\u4ECE",To:"\u5230",Load:"\u52A0\u8F7D","Choose a start before the end.":"\u8BF7\u9009\u62E9\u65E9\u4E8E\u7ED3\u675F\u65F6\u95F4\u7684\u5F00\u59CB\u65F6\u95F4\u3002","Loading\u2026":"\u52A0\u8F7D\u4E2D\u2026","Loading stored messages\u2026":"\u6B63\u5728\u52A0\u8F7D\u5DF2\u5B58\u50A8\u7684\u6D88\u606F\u2026","Cannot load the replay.":"\u65E0\u6CD5\u52A0\u8F7D\u56DE\u653E\u3002","No messages in this period":"\u6B64\u65F6\u95F4\u6BB5\u5185\u6CA1\u6709\u6D88\u606F",Restart:"\u4ECE\u5934\u5F00\u59CB","Previous message":"\u4E0A\u4E00\u6761\u6D88\u606F","Next message":"\u4E0B\u4E00\u6761\u6D88\u606F",Play:"\u64AD\u653E",Pause:"\u6682\u505C",Speed:"\u901F\u5EA6","Fit 30 s":"30 \u79D2\u64AD\u5B8C","Skip silence":"\u8DF3\u8FC7\u7A7A\u95F2","skipped {time}":"\u5DF2\u8DF3\u8FC7 {time}",Playhead:"\u64AD\u653E\u4F4D\u7F6E","Messages so far":"\u622A\u81F3\u76EE\u524D\u7684\u6D88\u606F","Go to this message":"\u8DF3\u5230\u8FD9\u6761\u6D88\u606F","Nothing has been sent yet at this point.":"\u6B64\u65F6\u8FD8\u6CA1\u6709\u53D1\u9001\u8FC7\u6D88\u606F\u3002","Taken as":"\u5904\u7406\u65B9\u5F0F",Reached:"\u9001\u8FBE",started:"\u5DF2\u5F00\u59CB\u5904\u7406",steered:"\u5DF2\u5E76\u5165\u8FDB\u884C\u4E2D\u7684\u8BF7\u6C42","Loading earlier messages\u2026":"\u6B63\u5728\u52A0\u8F7D\u66F4\u65E9\u7684\u6D88\u606F\u2026","Could not load earlier messages. Retry":"\u65E0\u6CD5\u52A0\u8F7D\u66F4\u65E9\u7684\u6D88\u606F,\u70B9\u6B64\u91CD\u8BD5","That is the start of the history.":"\u5DF2\u7ECF\u662F\u6700\u65E9\u7684\u8BB0\u5F55\u4E86\u3002",Chats:"\u4F1A\u8BDD",New:"\u65B0\u5EFA",Config:"\u914D\u7F6E",Logs:"\u65E5\u5FD7",Settings:"\u8BBE\u7F6E",Sections:"\u680F\u76EE",Models:"\u6A21\u578B",Defaults:"\u9ED8\u8BA4\u503C",Workspaces:"\u5DE5\u4F5C\u533A",Sending:"\u53D1\u9001",Limits:"\u9650\u5236",Connection:"\u8FDE\u63A5",Appearance:"\u5916\u89C2",Notifications:"\u901A\u77E5",Data:"\u6570\u636E",Search:"\u641C\u7D22",Back:"\u8FD4\u56DE",Cancel:"\u53D6\u6D88",Clear:"\u6E05\u9664",Copy:"\u590D\u5236",Copied:"\u5DF2\u590D\u5236",Delete:"\u5220\u9664",Refresh:"\u5237\u65B0",More:"\u66F4\u591A",Up:"\u4E0A\u4E00\u7EA7",Stop:"\u505C\u6B62",Stopped:"\u5DF2\u505C\u6B62",Send:"\u53D1\u9001",Info:"\u4FE1\u606F",Name:"\u540D\u79F0",Message:"\u6D88\u606F",Model:"\u6A21\u578B",Status:"\u72B6\u6001",Where:"\u4F4D\u7F6E",Kind:"\u7C7B\u578B",Handle:"\u540D\u79F0\u6807\u8BC6",Process:"\u8FDB\u7A0B",Protocol:"\u534F\u8BAE",Rate:"\u9891\u7387",Token:"\u4EE4\u724C",Images:"\u56FE\u7247",Context:"\u4E0A\u4E0B\u6587",Effort:"\u63A8\u7406\u5F3A\u5EA6",Permission:"\u6743\u9650",Default:"\u9ED8\u8BA4",default:"\u9ED8\u8BA4",Blank:"\u7A7A\u767D",Continues:"\u7EED\u63A5\u81EA",Direct:"\u76F4\u8FBE",Relayed:"\u8F6C\u8FF0",Gateway:"\u7F51\u5173","Session broker":"\u4F1A\u8BDD broker","Session id":"\u4F1A\u8BDD ID","Model id":"\u6A21\u578B ID","Model default":"\u6A21\u578B\u9ED8\u8BA4\u503C","Effort levels":"\u63A8\u7406\u5F3A\u5EA6\u7B49\u7EA7","Shell level":"Shell \u7EA7\u522B","Shell access":"Shell \u6743\u9650","Running for":"\u5DF2\u8FD0\u884C","Start from":"\u8D77\u70B9","First message":"\u9996\u6761\u6D88\u606F","Message length":"\u6D88\u606F\u957F\u5EA6","What it is for":"\u7528\u9014","About it":"\u5173\u4E8E\u5B83","Other sessions":"\u5176\u4ED6\u4F1A\u8BDD",Daemons:"\u5B88\u62A4\u8FDB\u7A0B","No daemons":"\u6CA1\u6709\u5B88\u62A4\u8FDB\u7A0B","No sessions yet":"\u8FD8\u6CA1\u6709\u4F1A\u8BDD","No models":"\u6CA1\u6709\u6A21\u578B","No broker":"\u6CA1\u6709 broker",Online:"\u5728\u7EBF",online:"\u5728\u7EBF",Connecting:"\u8FDE\u63A5\u4E2D","Connecting\u2026":"\u8FDE\u63A5\u4E2D\u2026",connected:"\u5DF2\u8FDE\u63A5","not connected":"\u672A\u8FDE\u63A5",reconnecting:"\u91CD\u8FDE\u4E2D","starting\u2026":"\u542F\u52A8\u4E2D\u2026","stopping\u2026":"\u505C\u6B62\u4E2D\u2026",stopped:"\u5DF2\u505C\u6B62",queued:"\u5DF2\u6392\u961F","typing\u2026":"\u6B63\u5728\u8F93\u5165\u2026",yes:"\u662F",no:"\u5426",characters:"\u4E2A\u5B57\u7B26",You:"\u4F60","Used now":"\u6B63\u5728\u4F7F\u7528","Recently used":"\u6700\u8FD1\u4F7F\u7528","Nothing matches":"\u6CA1\u6709\u5339\u914D\u9879","Open chat":"\u6253\u5F00\u4F1A\u8BDD","Pick a conversation":"\u9009\u62E9\u4E00\u4E2A\u4F1A\u8BDD","Choose a folder":"\u9009\u62E9\u6587\u4EF6\u5939","No folders here.":"\u8FD9\u91CC\u6CA1\u6709\u6587\u4EF6\u5939\u3002","Use this folder":"\u4F7F\u7528\u6B64\u6587\u4EF6\u5939","/path/to/project":"/path/to/project","Choose a session on the left, or start a new daemon.":"\u5728\u5DE6\u4FA7\u9009\u62E9\u4E00\u4E2A\u4F1A\u8BDD,\u6216\u65B0\u5EFA\u4E00\u4E2A\u5B88\u62A4\u8FDB\u7A0B\u3002","No messages yet. Say something.":"\u8FD8\u6CA1\u6709\u6D88\u606F,\u8BF4\u70B9\u4EC0\u4E48\u5427\u3002","Scroll to the newest message":"\u6EDA\u52A8\u5230\u6700\u65B0\u6D88\u606F","Show earlier messages":"\u663E\u793A\u66F4\u65E9\u7684\u6D88\u606F","Show message source":"\u663E\u793A\u6D88\u606F\u539F\u6587","Earlier conversation summarized":"\u66F4\u65E9\u7684\u5BF9\u8BDD\u5DF2\u88AB\u6458\u8981","{count} steps":"{count} \u4E2A\u6B65\u9AA4","{count} failed":"{count} \u4E2A\u5931\u8D25","Copy session id":"\u590D\u5236\u4F1A\u8BDD ID","Session id copied":"\u4F1A\u8BDD ID \u5DF2\u590D\u5236","Cannot copy here":"\u6B64\u5904\u65E0\u6CD5\u590D\u5236","Check again":"\u91CD\u65B0\u68C0\u67E5","Could not check.":"\u65E0\u6CD5\u68C0\u67E5\u3002","Busy elsewhere":"\u5728\u522B\u5904\u5360\u7528","Another window has this session open, so it is read-only here.":"\u53E6\u4E00\u4E2A\u7A97\u53E3\u5DF2\u6253\u5F00\u6B64\u4F1A\u8BDD,\u6240\u4EE5\u8FD9\u91CC\u53EA\u8BFB\u3002","Still open in another window.":"\u4ECD\u5728\u53E6\u4E00\u4E2A\u7A97\u53E3\u4E2D\u6253\u5F00\u3002","No other window has it open now.":"\u73B0\u5728\u6CA1\u6709\u5176\u4ED6\u7A97\u53E3\u6253\u5F00\u5B83\u3002","This session is open in another ZettCode window, so it is read-only here.":"\u6B64\u4F1A\u8BDD\u5728\u53E6\u4E00\u4E2A ZettCode \u7A97\u53E3\u4E2D\u6253\u5F00,\u6240\u4EE5\u8FD9\u91CC\u53EA\u8BFB\u3002","This session is not connected.":"\u6B64\u4F1A\u8BDD\u672A\u8FDE\u63A5\u3002","This session is not listed":"\u6B64\u4F1A\u8BDD\u4E0D\u5728\u5217\u8868\u4E2D","This daemon has stopped.":"\u6B64\u5B88\u62A4\u8FDB\u7A0B\u5DF2\u505C\u6B62\u3002","This daemon is not connected.":"\u6B64\u5B88\u62A4\u8FDB\u7A0B\u672A\u8FDE\u63A5\u3002","This daemon is starting.":"\u6B64\u5B88\u62A4\u8FDB\u7A0B\u6B63\u5728\u542F\u52A8\u3002","This daemon is stopping.":"\u6B64\u5B88\u62A4\u8FDB\u7A0B\u6B63\u5728\u505C\u6B62\u3002","Start it again":"\u91CD\u65B0\u542F\u52A8","Start an empty conversation instead":"\u6539\u4E3A\u5F00\u59CB\u4E00\u4E2A\u7A7A\u5BF9\u8BDD","A daemon's state and log appear here.":"\u5B88\u62A4\u8FDB\u7A0B\u7684\u72B6\u6001\u548C\u65E5\u5FD7\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002","The log is empty.":"\u65E5\u5FD7\u4E3A\u7A7A\u3002","This period holds more messages than can be shown, so its first part is missing. Choose a shorter period to see all of it.":"\u8FD9\u6BB5\u65F6\u95F4\u7684\u6D88\u606F\u592A\u591A,\u65E0\u6CD5\u5168\u90E8\u663E\u793A,\u5F00\u5934\u7684\u4E00\u90E8\u5206\u7F3A\u5931\u3002\u9009\u62E9\u66F4\u77ED\u7684\u65F6\u95F4\u6BB5\u53EF\u4EE5\u770B\u5230\u5168\u90E8\u3002","Attach a picture":"\u6DFB\u52A0\u56FE\u7247","Pictures to send":"\u5F85\u53D1\u9001\u7684\u56FE\u7247","Remove the picture":"\u79FB\u9664\u56FE\u7247","Enlarge the picture":"\u653E\u5927\u56FE\u7247","A picture in the message":"\u6D88\u606F\u4E2D\u7684\u56FE\u7247","That picture could not be read.":"\u65E0\u6CD5\u8BFB\u53D6\u8FD9\u5F20\u56FE\u7247\u3002","That picture is too large":"\u8FD9\u5F20\u56FE\u7247\u592A\u5927\u4E86","The pictures are too large together":"\u56FE\u7247\u52A0\u8D77\u6765\u592A\u5927\u4E86","At most {count} pictures go with one message":"\u4E00\u6761\u6D88\u606F\u6700\u591A\u9644\u5E26 {count} \u5F20\u56FE\u7247","This session cannot be sent a picture.":"\u65E0\u6CD5\u5411\u8FD9\u4E2A\u4F1A\u8BDD\u53D1\u9001\u56FE\u7247\u3002","{model} does not accept pictures.":"{model} \u4E0D\u652F\u6301\u56FE\u7247\u3002",All:"\u5168\u90E8",Tools:"\u5DE5\u5177",Problems:"\u95EE\u9898",turn:"\u56DE\u5408",done:"\u5B8C\u6210","Search the log":"\u641C\u7D22\u65E5\u5FD7","Nothing matches.":"\u6CA1\u6709\u5339\u914D\u7684\u884C\u3002","Jump to the newest line":"\u8DF3\u5230\u6700\u65B0\u4E00\u884C","Add a model":"\u6DFB\u52A0\u6A21\u578B","Add model":"\u6DFB\u52A0","Add one below.":"\u8BF7\u5728\u4E0B\u65B9\u6DFB\u52A0\u4E00\u4E2A\u3002","Edit {name}":"\u7F16\u8F91 {name}",Edit:"\u7F16\u8F91",Save:"\u4FDD\u5B58",Remove:"\u5220\u9664","Remove {name}?":"\u5220\u9664 {name}\uFF1F","It is taken out of the configuration file. A daemon already running keeps using it until it restarts.":"\u5B83\u4F1A\u4ECE\u914D\u7F6E\u6587\u4EF6\u4E2D\u79FB\u9664\u3002\u5DF2\u5728\u8FD0\u884C\u7684 daemon \u91CD\u542F\u524D\u4ECD\u4F1A\u7EE7\u7EED\u4F7F\u7528\u5B83\u3002","The last model cannot be removed":"\u4E0D\u80FD\u5220\u9664\u6700\u540E\u4E00\u4E2A\u6A21\u578B","Model added":"\u6A21\u578B\u5DF2\u6DFB\u52A0","Model saved":"\u6A21\u578B\u5DF2\u4FDD\u5B58","Model removed":"\u6A21\u578B\u5DF2\u5220\u9664","Shown as":"\u663E\u793A\u540D\u79F0","Same as the model id":"\u4E0E\u6A21\u578B ID \u76F8\u540C","Base URL":"\u63A5\u53E3\u5730\u5740","The protocol\u2019s own address":"\u4F7F\u7528\u534F\u8BAE\u81EA\u5E26\u7684\u5730\u5740","API key":"API \u5BC6\u94A5","Leave empty to keep the saved key":"\u7559\u7A7A\u5219\u4FDD\u7559\u5DF2\u4FDD\u5B58\u7684\u5BC6\u94A5","Or set it in the environment":"\u6216\u901A\u8FC7\u73AF\u5883\u53D8\u91CF\u8BBE\u7F6E",Show:"\u663E\u793A",Hide:"\u9690\u85CF","Compact at":"\u538B\u7F29\u9608\u503C",Temperature:"\u6E29\u5EA6","Provider default":"\u670D\u52A1\u5546\u9ED8\u8BA4","Accepts images":"\u652F\u6301\u56FE\u7247","Web search":"\u8054\u7F51\u641C\u7D22","The provider searches the web for the model.":"\u7531\u670D\u52A1\u5546\u66FF\u6A21\u578B\u641C\u7D22\u7F51\u9875\u3002","Choose none to allow every level.":"\u4E00\u4E2A\u90FD\u4E0D\u9009\u8868\u793A\u5141\u8BB8\u6240\u6709\u6863\u4F4D\u3002",Chat:"Chat",Responses:"Responses","The model id is required":"\u5FC5\u987B\u586B\u5199\u6A21\u578B ID","The context window is a whole number of tokens":"\u4E0A\u4E0B\u6587\u7A97\u53E3\u5FC5\u987B\u662F\u6574\u6570 token \u6570","Compact at is a percentage from 1 to 100":"\u538B\u7F29\u9608\u503C\u662F 1 \u5230 100 \u7684\u767E\u5206\u6BD4","The temperature is from 0 to 1 for this protocol":"\u8BE5\u534F\u8BAE\u7684\u6E29\u5EA6\u8303\u56F4\u662F 0 \u5230 1","The temperature is from 0 to 2":"\u6E29\u5EA6\u8303\u56F4\u662F 0 \u5230 2","Written to the ZettCode configuration file, with its comments kept. A new daemon uses the change; one that is running keeps what it started with.":"\u5199\u5165 ZettCode \u914D\u7F6E\u6587\u4EF6,\u5E76\u4FDD\u7559\u5176\u4E2D\u7684\u6CE8\u91CA\u3002\u65B0\u5EFA\u7684 daemon \u4F1A\u4F7F\u7528\u6539\u52A8;\u6B63\u5728\u8FD0\u884C\u7684\u4ECD\u7528\u542F\u52A8\u65F6\u7684\u914D\u7F6E\u3002","Start a daemon, or open a ZettCode session in a terminal, and it appears here.":"\u542F\u52A8\u4E00\u4E2A\u5B88\u62A4\u8FDB\u7A0B,\u6216\u5728\u7EC8\u7AEF\u91CC\u6253\u5F00 ZettCode \u4F1A\u8BDD,\u5B83\u5C31\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002","Your text runs as this session's own prompt, and its answer comes back here.":"\u4F60\u7684\u6587\u5B57\u4F1A\u4F5C\u4E3A\u8BE5\u4F1A\u8BDD\u81EA\u5DF1\u7684\u63D0\u793A\u8BCD\u8FD0\u884C,\u5B83\u7684\u56DE\u7B54\u4F1A\u56DE\u5230\u8FD9\u91CC\u3002","Delivered as a message from another session. An older window does not run it as its own prompt.":"\u5DF2\u4F5C\u4E3A\u6765\u81EA\u53E6\u4E00\u4E2A\u4F1A\u8BDD\u7684\u6D88\u606F\u9001\u8FBE\u3002\u8F83\u65E7\u7684\u7A97\u53E3\u4E0D\u4F1A\u628A\u5B83\u5F53\u4F5C\u81EA\u5DF1\u7684\u63D0\u793A\u8BCD\u8FD0\u884C\u3002","Delivered as a relayed message. The session did not run it as its own prompt.":"\u5DF2\u4F5C\u4E3A\u8F6C\u8FF0\u6D88\u606F\u9001\u8FBE\u3002\u8BE5\u4F1A\u8BDD\u6CA1\u6709\u628A\u5B83\u5F53\u4F5C\u81EA\u5DF1\u7684\u63D0\u793A\u8BCD\u8FD0\u884C\u3002","A session other than a daemon may have a person at it. Your message starts a turn there and spends that session's tokens.":"\u975E\u5B88\u62A4\u8FDB\u7A0B\u7684\u4F1A\u8BDD\u53EF\u80FD\u6709\u4EBA\u5728\u4F7F\u7528\u3002\u4F60\u7684\u6D88\u606F\u4F1A\u5728\u90A3\u91CC\u5F00\u59CB\u4E00\u8F6E\u5BF9\u8BDD,\u5E76\u6D88\u8017\u8BE5\u4F1A\u8BDD\u7684 token\u3002","This session may have a person at it. Your message starts a turn there and uses that session's tokens.":"\u6B64\u4F1A\u8BDD\u53EF\u80FD\u6709\u4EBA\u5728\u4F7F\u7528\u3002\u4F60\u7684\u6D88\u606F\u4F1A\u5728\u90A3\u91CC\u5F00\u59CB\u4E00\u8F6E\u5BF9\u8BDD,\u5E76\u6D88\u8017\u8BE5\u4F1A\u8BDD\u7684 token\u3002","Write to {name}?":"\u7ED9 {name} \u53D1\u6D88\u606F?","Confirm before writing to a session":"\u7ED9\u4F1A\u8BDD\u53D1\u6D88\u606F\u524D\u5148\u786E\u8BA4","Send again":"\u518D\u6B21\u53D1\u9001","It may or may not have arrived; sending again could duplicate it.":"\u5B83\u53EF\u80FD\u5DF2\u9001\u8FBE,\u4E5F\u53EF\u80FD\u6CA1\u6709;\u518D\u6B21\u53D1\u9001\u53EF\u80FD\u9020\u6210\u91CD\u590D\u3002","The request failed":"\u8BF7\u6C42\u5931\u8D25","The first message was not sent":"\u9996\u6761\u6D88\u606F\u672A\u53D1\u9001","Cannot reach the gateway":"\u65E0\u6CD5\u8FDE\u63A5\u7F51\u5173","The session broker is not connected, so nobody can be reached":"\u4F1A\u8BDD broker \u672A\u8FDE\u63A5,\u65E0\u6CD5\u8054\u7CFB\u4EFB\u4F55\u4F1A\u8BDD","The session broker is not connected.":"\u4F1A\u8BDD broker \u672A\u8FDE\u63A5\u3002","Rendered shows markdown with highlighted code and typeset math. Source shows the text exactly as it was written.":"\u300C\u6E32\u67D3\u300D\u4F1A\u663E\u793A Markdown\u3001\u9AD8\u4EAE\u4EE3\u7801\u548C\u6392\u7248\u540E\u7684\u516C\u5F0F;\u300C\u539F\u6587\u300D\u5219\u6309\u539F\u6837\u663E\u793A\u6587\u5B57\u3002",Rendered:"\u6E32\u67D3",Source:"\u539F\u6587","Render markdown":"\u6E32\u67D3 Markdown","New daemon":"\u65B0\u5EFA\u5B88\u62A4\u8FDB\u7A0B","Start daemon":"\u542F\u52A8\u5B88\u62A4\u8FDB\u7A0B","Daemon started":"\u5B88\u62A4\u8FDB\u7A0B\u5DF2\u542F\u52A8","Starting\u2026 this can take a few seconds":"\u542F\u52A8\u4E2D\u2026\u53EF\u80FD\u9700\u8981\u51E0\u79D2\u949F","It did not start.":"\u5B83\u6CA1\u6709\u542F\u52A8\u3002","Stop daemon":"\u505C\u6B62\u5B88\u62A4\u8FDB\u7A0B","Stop {name}?":"\u505C\u6B62 {name}?","The daemon stops, and stays in the list as offline with its conversation, so it can be started again.":"\u5B88\u62A4\u8FDB\u7A0B\u4F1A\u505C\u6B62,\u4F46\u4F1A\u4EE5\u79BB\u7EBF\u72B6\u6001\u7559\u5728\u5217\u8868\u4E2D\u5E76\u4FDD\u7559\u5BF9\u8BDD,\u4E4B\u540E\u53EF\u4EE5\u518D\u6B21\u542F\u52A8\u3002","{name} is working. Stop it anyway?":"{name} \u6B63\u5728\u5DE5\u4F5C\u3002\u4ECD\u8981\u505C\u6B62\u5417?","It is in the middle of a turn, and stopping it now throws that turn away. It stays in the list, offline.":"\u5B83\u6B63\u5904\u4E8E\u4E00\u8F6E\u5BF9\u8BDD\u4E2D,\u73B0\u5728\u505C\u6B62\u4F1A\u4E22\u5F03\u8FD9\u4E00\u8F6E\u3002\u5B83\u4F1A\u4EE5\u79BB\u7EBF\u72B6\u6001\u7559\u5728\u5217\u8868\u4E2D\u3002","Stop anyway":"\u4ECD\u7136\u505C\u6B62","The daemon and its whole conversation are removed for good. This cannot be undone.":"\u5B88\u62A4\u8FDB\u7A0B\u53CA\u5176\u5168\u90E8\u5BF9\u8BDD\u4F1A\u88AB\u6C38\u4E45\u5220\u9664,\u65E0\u6CD5\u6062\u590D\u3002",Deleted:"\u5DF2\u5220\u9664","Delete daemon":"\u5220\u9664\u5B88\u62A4\u8FDB\u7A0B",Offline:"\u79BB\u7EBF",Members:"\u6210\u5458",you:"\u4F60",held:"\u5F85\u6295\u9012","This group is not listed":"\u6B64\u7FA4\u7EC4\u4E0D\u5728\u5217\u8868\u4E2D","{count} members":"{count} \u4F4D\u6210\u5458","{count} online":"{count} \u4F4D\u5728\u7EBF","Nothing has been said in this group yet.":"\u8FD9\u4E2A\u7FA4\u91CC\u8FD8\u6CA1\u6709\u4EBA\u8BF4\u8BDD\u3002","You are not in this group. Writing here adds you to it.":"\u4F60\u4E0D\u5728\u8FD9\u4E2A\u7FA4\u91CC,\u5728\u8FD9\u91CC\u53D1\u8A00\u4F1A\u628A\u4F60\u52A0\u5165\u7FA4\u7EC4\u3002","Clear record":"\u6E05\u9664\u8BB0\u5F55","Restart with a new configuration":"\u7528\u65B0\u914D\u7F6E\u91CD\u65B0\u542F\u52A8","Filled in from {name}":"\u5DF2\u6309 {name} \u586B\u5165","Optional. Sent as soon as it is up.":"\u53EF\u9009\u3002\u542F\u52A8\u540E\u7ACB\u5373\u53D1\u9001\u3002","Ask daemons to answer":"\u8BA9\u5B88\u62A4\u8FDB\u7A0B\u56DE\u590D","Ask the agent to answer with send_message":"\u8BA9\u667A\u80FD\u4F53\u7528 send_message \u56DE\u590D","A daemon answers into its own conversation unless its model calls send_message. This adds a line asking it to. The line is not shown in the chat.":"\u5B88\u62A4\u8FDB\u7A0B\u9ED8\u8BA4\u53EA\u5728\u81EA\u5DF1\u7684\u5BF9\u8BDD\u91CC\u56DE\u7B54,\u9664\u975E\u5B83\u7684\u6A21\u578B\u8C03\u7528 send_message\u3002\u8FD9\u4F1A\u9644\u52A0\u4E00\u884C\u8BF7\u6C42\u5B83\u56DE\u590D,\u8BE5\u884C\u4E0D\u4F1A\u663E\u793A\u5728\u804A\u5929\u4E2D\u3002","A daemon never asks anyone: there is nobody to approve a command.":"\u5B88\u62A4\u8FDB\u7A0B\u4ECE\u4E0D\u8BE2\u95EE\u4EFB\u4F55\u4EBA:\u6CA1\u6709\u4EBA\u53EF\u4EE5\u6279\u51C6\u547D\u4EE4\u3002","It can read and edit files and talk, but never runs a command.":"\u5B83\u53EF\u4EE5\u8BFB\u5199\u6587\u4EF6\u548C\u5BF9\u8BDD,\u4F46\u4ECE\u4E0D\u8FD0\u884C\u547D\u4EE4\u3002","Every command runs in a sandbox: it writes only the workspace, credentials are hidden, the network is open.":"\u6BCF\u6761\u547D\u4EE4\u90FD\u5728\u6C99\u7BB1\u4E2D\u8FD0\u884C:\u53EA\u80FD\u5199\u5165\u5DE5\u4F5C\u533A,\u51ED\u636E\u88AB\u9690\u85CF,\u7F51\u7EDC\u662F\u5F00\u653E\u7684\u3002","Commands run with your account's full access: no sandbox, no approval, no network limit.":"\u547D\u4EE4\u4EE5\u4F60\u8D26\u6237\u7684\u5B8C\u5168\u6743\u9650\u8FD0\u884C:\u6CA1\u6709\u6C99\u7BB1\u3001\u6CA1\u6709\u5BA1\u6279\u3001\u6CA1\u6709\u7F51\u7EDC\u9650\u5236\u3002","Start with full access?":"\u4EE5\u5B8C\u5168\u6743\u9650\u542F\u52A8?","It will run commands as you in {folder}, with no sandbox and nobody to approve them. Model: {model}.":"\u5B83\u4F1A\u4EE5\u4F60\u7684\u8EAB\u4EFD\u5728 {folder} \u4E2D\u8FD0\u884C\u547D\u4EE4,\u6CA1\u6709\u6C99\u7BB1,\u4E5F\u6CA1\u6709\u4EBA\u5BA1\u6279\u3002\u6A21\u578B:{model}\u3002",Sandboxed:"\u6C99\u7BB1",Full:"\u5B8C\u5168","No shell":"\u65E0 Shell","Full access is turned off. It was started with --no-full.":"\u5B8C\u5168\u6743\u9650\u5DF2\u5173\u95ED\u3002\u7F51\u5173\u662F\u7528 --no-full \u542F\u52A8\u7684\u3002","Folders agents may work in":"\u667A\u80FD\u4F53\u53EF\u4EE5\u5DE5\u4F5C\u7684\u6587\u4EF6\u5939","Allowed roots":"\u5141\u8BB8\u7684\u6839\u76EE\u5F55","Agents can be started in these folders or below them. With no --root the gateway allows any folder; --root narrows it.":"\u667A\u80FD\u4F53\u53EF\u4EE5\u5728\u8FD9\u4E9B\u6587\u4EF6\u5939\u6216\u5176\u5B50\u6587\u4EF6\u5939\u4E2D\u542F\u52A8\u3002\u4E0D\u5E26 --root \u65F6\u7F51\u5173\u5141\u8BB8\u4EFB\u4F55\u6587\u4EF6\u5939;--root \u4F1A\u7F29\u5C0F\u8303\u56F4\u3002","The agent reads and changes files here. Any folder on the machine the gateway runs on can be chosen, unless it was started with --root.":"\u667A\u80FD\u4F53\u4F1A\u5728\u8FD9\u91CC\u8BFB\u5199\u6587\u4EF6\u3002\u9664\u975E\u7F51\u5173\u5E26 --root \u542F\u52A8,\u5426\u5219\u53EF\u4EE5\u9009\u62E9\u8FD0\u884C\u7F51\u5173\u7684\u673A\u5668\u4E0A\u7684\u4EFB\u4F55\u6587\u4EF6\u5939\u3002","No models are configured. Add one with /config in ZettCode, or in the config file.":"\u5C1A\u672A\u914D\u7F6E\u6A21\u578B\u3002\u53EF\u5728 ZettCode \u4E2D\u7528 /config \u6DFB\u52A0,\u6216\u76F4\u63A5\u7F16\u8F91\u914D\u7F6E\u6587\u4EF6\u3002","Add one in the config file.":"\u8BF7\u5728\u914D\u7F6E\u6587\u4EF6\u4E2D\u6DFB\u52A0\u3002","Models are read from the ZettCode config file. Edit it with /config in a terminal or by hand; a new daemon picks the change up.":"\u6A21\u578B\u4ECE ZettCode \u914D\u7F6E\u6587\u4EF6\u8BFB\u53D6\u3002\u53EF\u5728\u7EC8\u7AEF\u7528 /config \u7F16\u8F91,\u6216\u624B\u52A8\u4FEE\u6539;\u65B0\u7684\u5B88\u62A4\u8FDB\u7A0B\u4F1A\u4F7F\u7528\u66F4\u6539\u3002","Your defaults":"\u4F60\u7684\u9ED8\u8BA4\u503C","What the New page starts with. Kept in this browser.":"\u300C\u65B0\u5EFA\u300D\u9875\u9762\u7684\u521D\u59CB\u503C\u3002\u4FDD\u5B58\u5728\u6B64\u6D4F\u89C8\u5668\u4E2D\u3002","Use the default":"\u4F7F\u7528\u9ED8\u8BA4\u503C","Your templates":"\u4F60\u7684\u6A21\u677F","Save as template":"\u4FDD\u5B58\u4E3A\u6A21\u677F","Saved as a template":"\u5DF2\u4FDD\u5B58\u4E3A\u6A21\u677F","Template {number}":"\u6A21\u677F {number}","Delete {name}?":"\u5220\u9664 {name}?","The template is removed from this browser.":"\u8BE5\u6A21\u677F\u4F1A\u4ECE\u6B64\u6D4F\u89C8\u5668\u4E2D\u79FB\u9664\u3002","What the session broker accepts from one sender. These are fixed by the broker.":"\u4F1A\u8BDD broker \u63A5\u53D7\u5355\u4E2A\u53D1\u9001\u8005\u7684\u9650\u5236,\u7531 broker \u56FA\u5B9A\u3002","{used} of {limit} messages used this minute":"\u672C\u5206\u949F\u5DF2\u7528 {used}/{limit} \u6761\u6D88\u606F","A message is delivered at most once. If the gateway cannot tell whether one arrived, it says so and never sends it again by itself.":"\u4E00\u6761\u6D88\u606F\u6700\u591A\u9001\u8FBE\u4E00\u6B21\u3002\u5982\u679C\u7F51\u5173\u65E0\u6CD5\u786E\u5B9A\u662F\u5426\u5DF2\u9001\u8FBE,\u4F1A\u5982\u5B9E\u544A\u77E5,\u7EDD\u4E0D\u4F1A\u81EA\u884C\u91CD\u53D1\u3002","This gateway is":"\u6B64\u7F51\u5173","Live updates":"\u5B9E\u65F6\u66F4\u65B0","Type the token the gateway printed when it started.":"\u8BF7\u8F93\u5165\u7F51\u5173\u542F\u52A8\u65F6\u6253\u5370\u7684\u4EE4\u724C\u3002","Sign in":"\u767B\u5F55","Sign out":"\u9000\u51FA\u767B\u5F55","Anyone signed in here can start agents that run commands as you. Keep the token private.":"\u4EFB\u4F55\u5728\u6B64\u767B\u5F55\u7684\u4EBA\u90FD\u53EF\u4EE5\u542F\u52A8\u4EE5\u4F60\u8EAB\u4EFD\u8FD0\u884C\u547D\u4EE4\u7684\u667A\u80FD\u4F53\u3002\u8BF7\u4FDD\u7BA1\u597D\u4EE4\u724C\u3002","This gateway has no token: anyone on this machine can start agents that run commands as you.":"\u6B64\u7F51\u5173\u6CA1\u6709\u4EE4\u724C:\u8FD9\u53F0\u673A\u5668\u4E0A\u7684\u4EFB\u4F55\u4EBA\u90FD\u53EF\u4EE5\u542F\u52A8\u4EE5\u4F60\u8EAB\u4EFD\u8FD0\u884C\u547D\u4EE4\u7684\u667A\u80FD\u4F53\u3002",Theme:"\u4E3B\u9898",System:"\u8DDF\u968F\u7CFB\u7EDF",Light:"\u6D45\u8272",Dark:"\u6DF1\u8272","Text size":"\u6587\u5B57\u5927\u5C0F",Small:"\u5C0F",Medium:"\u4E2D",Large:"\u5927",Language:"\u8BED\u8A00","Your picture":"\u4F60\u7684\u5934\u50CF","Upload a picture":"\u4E0A\u4F20\u56FE\u7247","Shown beside your messages. It stays in this browser.":"\u663E\u793A\u5728\u4F60\u7684\u6D88\u606F\u65C1\u8FB9\u3002\u4EC5\u4FDD\u5B58\u5728\u6B64\u6D4F\u89C8\u5668\u4E2D\u3002","That file is not a picture this browser can read.":"\u8BE5\u6587\u4EF6\u4E0D\u662F\u6B64\u6D4F\u89C8\u5668\u80FD\u8BFB\u53D6\u7684\u56FE\u7247\u3002","Notify when a session replies":"\u4F1A\u8BDD\u56DE\u590D\u65F6\u901A\u77E5","Notifications are blocked in this browser.":"\u6B64\u6D4F\u89C8\u5668\u5DF2\u5C4F\u853D\u901A\u77E5\u3002","Not supported by this browser":"\u6B64\u6D4F\u89C8\u5668\u4E0D\u652F\u6301","Only while this page is open, and only for a chat you are not looking at.":"\u4EC5\u5728\u6B64\u9875\u9762\u6253\u5F00\u65F6,\u4E14\u4EC5\u9488\u5BF9\u4F60\u6CA1\u5728\u770B\u7684\u4F1A\u8BDD\u3002","Clear browser data":"\u6E05\u9664\u6D4F\u89C8\u5668\u6570\u636E","Clear what this browser remembers?":"\u6E05\u9664\u6B64\u6D4F\u89C8\u5668\u8BB0\u4F4F\u7684\u5185\u5BB9?",Cleared:"\u5DF2\u6E05\u9664","Drafts, templates, recent folders and preferences are removed from this browser. Sessions and daemons are not touched.":"\u8349\u7A3F\u3001\u6A21\u677F\u3001\u6700\u8FD1\u4F7F\u7528\u7684\u6587\u4EF6\u5939\u548C\u504F\u597D\u8BBE\u7F6E\u4F1A\u4ECE\u6B64\u6D4F\u89C8\u5668\u4E2D\u79FB\u9664\u3002\u4F1A\u8BDD\u548C\u5B88\u62A4\u8FDB\u7A0B\u4E0D\u53D7\u5F71\u54CD\u3002","The gateway itself keeps only which messages you have read. Everything else here lives in this browser.":"\u7F51\u5173\u672C\u8EAB\u53EA\u8BB0\u5F55\u4F60\u8BFB\u8FC7\u54EA\u4E9B\u6D88\u606F,\u8FD9\u91CC\u7684\u5176\u4ED6\u5185\u5BB9\u90FD\u4FDD\u5B58\u5728\u6B64\u6D4F\u89C8\u5668\u4E2D\u3002"};var ai=X("en");function Fl(e){ai.value=e,typeof document<"u"&&(document.documentElement.lang=ai.value==="zh"?"zh-CN":"en")}function c(e,t){let n=ai.value==="zh"?Ll[e]??e:e;return t?n.replace(/\{(\w+)\}/g,(o,s)=>String(t[s]??"")):n}var Lp=["chats","new","config","logs","graph","settings"],ye=be({nav:"chats",arg:""});function Fp(e){let[t="",n=""]=e.replace(/^#\/?/,"").split("/"),o=Lp.find(r=>r===t)??"chats",s=n;try{s=decodeURIComponent(n)}catch{s=""}return{nav:o,arg:s}}function je(e,t=""){return`#/${e}${t?`/${encodeURIComponent(t)}`:""}`}function lt(e,t=""){location.hash=je(e,t)}function Ul(){Object.assign(ye,Fp(location.hash))}function Hl(){Ul(),window.addEventListener("hashchange",Ul)}var Oe=class extends Error{status;code;body;constructor(t,n={}){super(n.message||c("The request failed")),this.status=t,this.code=n.code??"http",this.body={code:this.code,message:this.message,...n}}},Kl=()=>{};function Gl(e){Kl=e}async function Fe(e,t,n){let o;try{o=await fetch(t,{method:e,credentials:"same-origin",headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)})}catch{throw new Oe(0,{code:"offline",message:c("Cannot reach the gateway")})}let s=null;try{s=await o.json()}catch{}if(!o.ok){o.status===401&&t!=="/api/login"&&Kl();let r=s?.error;throw new Oe(o.status,r??{message:o.statusText})}return s}var dn=e=>encodeURIComponent(e),ke={session:()=>Fe("GET","/api/session"),login:e=>Fe("POST","/api/login",{token:e}),logout:()=>Fe("POST","/api/logout"),threads:()=>Fe("GET","/api/threads"),thread:(e,t=!1)=>Fe("GET",`/api/threads/${dn(e)}${t?"?all=1":""}`),recheck:e=>Fe("POST",`/api/threads/${dn(e)}/recheck`),read:e=>Fe("POST",`/api/threads/${dn(e)}/read`),send:(e,t,n,o=[])=>Fe("POST",`/api/threads/${dn(e)}/send`,{text:t,reply:n,...o.length?{images:o.map(({media_type:s,data:r})=>({media_type:s,data:r}))}:{}}),spawn:e=>Fe("POST","/api/daemons",e),stop:(e,t=!1)=>Fe("POST",`/api/daemons/${dn(e)}/stop`,{force:t}),remove:e=>Fe("DELETE",`/api/daemons/${dn(e)}`),log:e=>Fe("GET",`/api/daemons/${dn(e)}/log`),config:()=>Fe("GET","/api/config"),addModel:e=>Fe("POST","/api/models",e),changeModel:(e,t)=>Fe("PATCH",`/api/models/${encodeURIComponent(e)}`,t),removeModel:e=>Fe("DELETE",`/api/models/${encodeURIComponent(e)}`),graph:()=>Fe("GET","/api/graph"),older:(e,t=50,n="")=>Fe("GET",`/api/graph/older?before=${e}&limit=${t}${n?`&group=${encodeURIComponent(n)}`:""}`),sendGroup:(e,t)=>Fe("POST",`/api/groups/${dn(e)}/send`,{text:t}),timeline:(e,t,n=2e4)=>Fe("GET",`/api/graph/timeline?since=${e}&until=${t}&limit=${n}`),directories:e=>Fe("GET",`/api/dirs?path=${encodeURIComponent(e)}`)};function so(e){return!Number.isFinite(e)||e<=0?"":e>99?"99+":String(Math.floor(e))}function jl(e){return e.unread>0&&!e.hidden&&e.atBottom}function Wl(e){return e.reduce((t,n)=>t+(n.unread>0?1:0),0)}var pe=be({threads:[],status:null,live:!1,loaded:!1}),Up=x(()=>new Map(pe.threads.map(e=>[e.id,e]))),_w=x(()=>pe.threads.reduce((e,t)=>e+t.unread,0)),li=x(()=>Wl(pe.threads)),ci=x(()=>pe.threads.filter(e=>e.kind==="daemon"));function ui(e,t){pe.threads=e,t&&(pe.status=t),pe.loaded=!0}async function sn(){let e=await ke.threads();ui(e.threads,e.status)}function tt(e){return Up.value.get(e)}function Xl(e){return e.online&&pe.status?.broker.reachable!==!1}function Yl(e,t){let n=0;for(let o of e)(o.kind==="out"||o.kind==="user")&&o.text===t&&(n+=1);return n}function ql(e,t,n,o,s,r=[]){let l=o.filter(p=>p.text===t&&p.state!=="failed").length,u={key:e,text:t,target:Yl(n,t)+l+1,state:"sending",at:s};return r.length&&(u.pictures=[...r]),u}function Jl(e,t){let n=new Map;return e.filter(o=>{if(o.state==="failed")return!0;let s=n.get(o.text);return s===void 0&&(s=Yl(t,o.text),n.set(o.text,s)),s<o.target})}var rn={get(e,t){try{let n=localStorage.getItem(`zg.${e}`);return n===null?t:JSON.parse(n)}catch{return t}},set(e,t){try{localStorage.setItem(`zg.${e}`,JSON.stringify(t))}catch{}},remove(e){try{localStorage.removeItem(`zg.${e}`)}catch{}},clear(){try{for(let e of Object.keys(localStorage))e.startsWith("zg.")&&localStorage.removeItem(e)}catch{}}};function Zl(e,t){let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>e(...o),t)}}var di={theme:"auto",size:"m",language:"en",render:"markdown",avatar:"",notify:!1,askReply:!0,confirmSession:!0,defaults:{model:"",effort:"",permission:"safe"},templates:[],recent:[]},Ql=rn.get("prefs",{}),j=be({...di,...Ql,defaults:{...di.defaults,...Ql.defaults}});j.language!=="zh"&&(j.language="en");function ec(){let e=document.documentElement;j.theme==="light"||j.theme==="dark"?e.dataset.theme=j.theme:delete e.dataset.theme,j.size==="s"||j.size==="l"?e.dataset.size=j.size:delete e.dataset.size,Fl(j.language)}function tc(){ec(),ve(j,()=>{rn.set("prefs",j),ec()},{deep:!0})}function nc(e){j.recent=[e,...j.recent.filter(t=>t!==e)].slice(0,8)}function oc(){Object.assign(j,structuredClone(di))}var kt=be({}),sc=()=>({text:"",thinking:!1,tools:[]});function rc(e,t){if(t.kind==="end"){delete kt[e];return}let n=t.kind==="begin"?kt[e]=sc():kt[e]??=sc();if(t.kind==="text")n.thinking=!1,n.text+=t.text;else if(t.kind==="thinking")n.thinking=!0;else if(t.kind==="tool")n.thinking=!1,n.tools.push({id:t.id,name:t.name,brief:t.brief,ok:null});else if(t.kind==="tool_end"){let o=n.tools.find(s=>s.id===t.id);o&&(o.ok=t.ok)}}function ic(e,t){t&&!(e in kt)&&(kt[e]=t)}function ac(){for(let e of Object.keys(kt))delete kt[e]}var Ko=be([]),Pn=be([]),lc=0;function xe(e,t=""){let n=++lc;Ko.push({id:n,text:e,kind:t}),setTimeout(()=>{let o=Ko.findIndex(s=>s.id===n);o>=0&&Ko.splice(o,1)},t==="bad"?6e3:3200)}function Rn(e,t,n={}){return new Promise(o=>{Pn.push({id:++lc,title:e,component:zn(t),props:n,settle:s=>o(s)})})}function Go(e,t){let n=Pn.findIndex(s=>s.id===e);if(n<0)return;let[o]=Pn.splice(n,1);o?.settle(t)}function cc(){let e=Pn[Pn.length-1];return e?(Go(e.id),!0):!1}var Z=be({id:"",thread:null,items:[],total:0,truncated:!1,loading:!1,error:"",pending:[],revision:0,atBottom:!0}),uc=new Map,Hp=0,jo=0,fi=!1;function Wo(e){let t=uc.get(e);return t||(t=be([]),uc.set(e,t)),t}async function pi(e,t){let n=++jo;t&&(fi=!0);try{let o=await ke.thread(e,fi);if(n!==jo||Z.id!==e)return;let s=o.items.length!==Z.items.length;Z.thread=o.thread,ic(e,o.live),Z.items=o.items,Z.total=o.total,Z.truncated=o.truncated,Z.error="";let r=Wo(e),l=Jl(r,o.items),u=l.length!==r.length;u&&r.splice(0,r.length,...l),(s||u)&&(Z.revision+=1)}catch(o){if(n!==jo||Z.id!==e)return;Z.error=o instanceof Oe?o.message:String(o)}finally{n===jo&&(Z.loading=!1)}}async function dc(e){Z.id!==e&&(fi=!1,Z.id=e,Z.thread=tt(e)??null,Z.items=[],Z.total=0,Z.truncated=!1,Z.error="",Z.pending=Wo(e),Z.loading=!0),await pi(e,!1),Z.revision+=1}function fc(){jo+=1,Z.id="",Z.thread=null,Z.items=[],Z.pending=[]}async function mi(e){Z.id===e&&await pi(e,!1)}async function hi(){Z.id&&await pi(Z.id,!0)}async function gi(e,t,n=[]){let o=Z.id;if(!o)return;let s=Wo(o);s.push(ql(++Hp,e,Z.items,s,Date.now(),n));let r=s[s.length-1];Z.revision+=1,await Kp(o,r,t)}async function Kp(e,t,n){t.state="sending",delete t.error;try{let o=await ke.send(e,t.text,n,t.pictures);t.state=o.disposition==="queued"?"queued":"started",pe.status=o.status,tt(e)?.direct&&!o.direct&&xe(c("Delivered as a relayed message. The session did not run it as its own prompt."))}catch(o){t.state="failed";let s=o instanceof Oe?o:new Oe(0,{message:String(o)});t.error={code:s.code,message:s.message,uncertain:s.body.uncertain===!0}}Z.id===e&&(Z.revision+=1)}async function pc(e,t){let n=Z.id;if(!n)return;let o=Wo(n),s=o.indexOf(e);s<0||(o.splice(s,1),await gi(e.text,t,e.pictures??[]))}function mc(e){let t=Wo(Z.id),n=t.indexOf(e);n>=0&&t.splice(n,1)}var Gp=Zl(e=>{ke.read(e).catch(()=>{})},350);function fn(){let e=Z.id?tt(Z.id):void 0;!e||!jl({hidden:document.hidden,atBottom:Z.atBottom,unread:e.unread})||(e.unread=0,Gp(e.id))}var Bs=be({});function _i(e){return e in Bs||(Bs[e]=rn.get(`draft.${e}`,"")),Bs[e]??""}function hc(e,t){Bs[e]=t,t?rn.set(`draft.${e}`,t):rn.remove(`draft.${e}`)}var gc=be({});function Xo(e){return gc[e.id]??(e.kind==="daemon"&&j.askReply)}function _c(e,t){gc[e]=t}function vi(e,t){return e<t?-1:e>t?1:0}function Ot(e,t){return vi(e,t)<=0?`${e}\0${t}`:`${t}\0${e}`}function vc(e,t,n=88,o={top:0,bottom:0}){let s=[...new Set(e)].sort(vi),r=new Map,l=Math.max(0,t.height-o.top-o.bottom),u=t.width/2,p=o.top+l/2,h=Math.max(0,Math.min(t.width,l)/2-n);return s.forEach((g,y)=>{if(s.length===1){r.set(g,{x:u,y:p});return}let E=-Math.PI/2+y/s.length*Math.PI*2;r.set(g,{x:u+Math.cos(E)*h,y:p+Math.sin(E)*h})}),r}function yi(e,t,n,o,s=.16){let r=vi(e,n)<=0,l=r?t:o,u=r?o:t,p=u.x-l.x,h=u.y-l.y;return{a:t,b:o,c:{x:(l.x+u.x)/2-h*s,y:(l.y+u.y)/2+p*s}}}function bi(e,t){let n=1-t;return{x:n*n*e.a.x+2*n*t*e.c.x+t*t*e.b.x,y:n*n*e.a.y+2*n*t*e.c.y+t*t*e.b.y}}function ki(e){let t=n=>(Math.round(n*100)/100).toString();return`M${t(e.a.x)} ${t(e.a.y)}Q${t(e.c.x)} ${t(e.c.y)} ${t(e.b.x)} ${t(e.b.y)}`}function jp(e){let t=[...e].sort((l,u)=>l.x-u.x||l.y-u.y),n=t.filter((l,u)=>u===0||l.x!==t[u-1].x||l.y!==t[u-1].y);if(n.length<3)return n;let o=(l,u,p)=>(u.x-l.x)*(p.y-l.y)-(u.y-l.y)*(p.x-l.x),s=[];for(let l of n){for(;s.length>=2&&o(s[s.length-2],s[s.length-1],l)<=0;)s.pop();s.push(l)}let r=[];for(let l of[...n].reverse()){for(;r.length>=2&&o(r[r.length-2],r[r.length-1],l)<=0;)r.pop();r.push(l)}return s.pop(),r.pop(),[...s,...r]}function yc(e,t,n=24){let o=[];for(let s of e)for(let r=0;r<n;r+=1){let l=r/n*Math.PI*2;o.push({x:s.x+Math.cos(l)*t,y:s.y+Math.sin(l)*t})}return jp(o)}function bc(e){if(!e.length)return"";let t=n=>(Math.round(n*10)/10).toString();return`M${e.map(n=>`${t(n.x)} ${t(n.y)}`).join("L")}Z`}function Wp(e){return e.length?{x:e.reduce((t,n)=>t+n.x,0)/e.length,y:e.reduce((t,n)=>t+n.y,0)/e.length}:{x:0,y:0}}function Xp(e,t){let n=e[0]??{x:0,y:0},o=-1/0;for(let s of e){let r=s.x*t.x+s.y*t.y;r>o&&(o=r,n=s)}return n}function kc(e,t,n){let o=Wp(t),s=o.x-n.x,r=o.y-n.y,l=Math.hypot(s,r),u=l<1?{x:0,y:-1}:{x:s/l,y:r/l};return Xp(e,u)}function Ls(e,t,n,o=14,s=8){let r=e.x+o;r+t.width>n.width-s&&(r=e.x-o-t.width);let l=e.y+o;l+t.height>n.height-s&&(l=e.y-o-t.height);let u=(p,h,g)=>Math.max(s,Math.min(p,g-h-s));return{x:u(r,t.width,n.width),y:u(l,t.height,n.height)}}function Fs(e){let t=7;for(let n of e)t=t*33+(n.codePointAt(0)??0)>>>0;return t*137%360}var Yp=1200;function xc(e,t,n){let o=Math.min(4,1+Math.log2(1+Math.max(0,e))*.55),s=Math.max(0,n-t),r=Math.max(.22,.8*Math.pow(.5,s/Yp));return{width:o,opacity:r}}function xi(e){let t=Math.max(0,Math.min(1,e));return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}function wi(e,t,n,o=9){let s=e+(t-e)*(1-Math.exp(-o*n));return Math.abs(t-s)<.2?t:s}function Us(e,t){let n=e.replace(/\s+/g," ").trim();return n.length>t?`${n.slice(0,Math.max(0,t-1)).trimEnd()}\u2026`:n}var wc=50;function Nc(){return{sessions:[],groups:[],edges:[],recent:[]}}function Yo(e){return e.length>8?e.slice(0,8):e}function pn(e){return e.recipients.filter(t=>t!==e.from.session_id)}function Sc(e){let t=new Map;for(let o of e.sessions)t.set(o.session_id,{...o,ghost:!1});let n=(o,s,r)=>{!o||t.has(o)||t.set(o,{session_id:o,handle:s||Yo(o),title:r,workspace:"",status:"idle",kind:"external",ghost:!0})};for(let o of e.recent){n(o.from.session_id,o.from.handle,o.from.title);for(let s of o.recipients)n(s,s===o.to.session_id?o.to.handle??"":"",s===o.to.session_id?o.to.title??"":"")}return[...t.values()]}function Ei(e,t){if(e.recent.some(o=>o.id===t.id))return!1;e.recent.push(t),e.recent.length>wc&&e.recent.splice(0,e.recent.length-wc);let n=t.to.kind==="session"?pn(t)[0]:void 0;if(n){let o=Ot(t.from.session_id,n),s=e.edges.find(r=>Ot(r.a,r.b)===o);s?(s.count+=1,s.last=Math.max(s.last,t.ts)):e.edges.push({a:t.from.session_id,b:n,count:1,last:t.ts})}return!0}function Cc(e,t){let n=0,o=0,s=null;for(let u of e.recent){let p=u.from.session_id===t,h=u.recipients.includes(t);p&&(n+=1),h&&(o+=1),(p||h)&&(s=u)}let r=e.edges.reduce((u,p)=>u+(p.a===t||p.b===t?p.count:0),0),l=e.groups.filter(u=>u.members.includes(t)).map(u=>u.name);return{sent:n,received:o,exchanged:r,groups:l,last:s}}function Tc(e,t,n,o=3){let s=[];for(let r=e.recent.length-1;r>=0&&s.length<o;r-=1){let l=e.recent[r];if(l.to.kind!=="session")continue;let u=l.from.session_id,p=pn(l)[0]??l.to.session_id;(u===t&&p===n||u===n&&p===t)&&s.push(l)}return s}function zc(e){let t=e.edges.reduce((o,s)=>o+s.count,0),n=e.recent.filter(o=>o.to.kind==="group").length;return{sessions:e.sessions.length,groups:e.groups.length,messages:t+n}}function In(e){return e.to.kind==="group"?`#${e.to.name??""}`:e.to.handle||e.to.title||Yo(e.to.session_id??"")}function $n(e){return e.from.handle||e.from.title||Yo(e.from.session_id)}function qo(e,t=90){return Us(e.text,t)}var Ec=600;function Hs(e){let t=e.text.trim();return t.length>Ec?`${t.slice(0,Ec)}\u2026`:t}function Vc(e,t){return e.groups.find(n=>n.name===t)}function Oc(e,t,n){let o=Ot(t,n);return e.edges.find(s=>Ot(s.a,s.b)===o)}function Dc(e,t){let n=new Set;for(let o of e.edges)o.a===t?n.add(o.b):o.b===t&&n.add(o.a);return n}function Jo(e,t){return e.find(n=>n.session_id===t)}var Ks=[{id:"15m",label:"15m",seconds:900},{id:"1h",label:"1h",seconds:3600},{id:"24h",label:"24h",seconds:86400},{id:"7d",label:"7d",seconds:604800},{id:"all",label:"All",seconds:null}];function Mc(e,t,n){let o=Ks.find(s=>s.id===e)?.seconds??null;return o===null?{since:n?Math.min(n[0],t):t,until:t}:{since:t-o,until:t}}function Ac(e,t,n){let o=Math.max(t,n);return{messages:e.filter(r=>r.ts>=t&&r.ts<=o).sort((r,l)=>r.ts-l.ts||r.id-l.id),start:t,end:o,duration:o-t}}var qp=2;function Pc(e){return Math.max(e.duration/30,1e-6)}function Gs(e,t,n,o=qp){let s=t>0?t:1,r=[e.start,...e.messages.map(E=>E.ts),e.end],l=[],u=0;for(let E=1;E<r.length;E++){let z=r[E-1],D=r[E];if(D<=z)continue;let V=n&&D-z>o*s,W=V?o:(D-z)/s;l.push({r0:z,r1:D,p0:u,p1:u+W,skipped:V}),u+=W}let p=u;return{segments:l,playbackDuration:p,toReal:E=>{if(E<=0)return e.start;for(let z of l)if(E<=z.p1)return z.r0+(E-z.p0)/(z.p1-z.p0)*(z.r1-z.r0);return e.end},toPlayback:E=>{if(E<=e.start)return 0;for(let z of l)if(E<=z.r1)return z.p0+(E-z.r0)/(z.r1-z.r0)*(z.p1-z.p0);return p},skippedBefore:E=>{let z=0;for(let D of l){if(!D.skipped)continue;let V=Math.min(E,D.r1);if(V<=D.r0)break;let W=(D.r1-D.r0)/s-(D.p1-D.p0);z+=W*s*((V-D.r0)/(D.r1-D.r0))}return z}}}function Rc(e,t){let n=e.messages.filter(u=>u.ts<=t),o=new Map,s=new Set,r=new Set;for(let u of n){s.add(u.from.session_id);for(let y of u.recipients)s.add(y);u.to.kind==="group"&&u.to.name&&r.add(u.to.name);let p=u.to.kind==="session"?pn(u)[0]:void 0;if(!p)continue;let h=Ot(u.from.session_id,p),g=o.get(h);g?(g.count+=1,g.last=Math.max(g.last,u.ts)):o.set(h,{a:u.from.session_id,b:p,count:1,last:u.ts})}let l=new Set(s);for(let u of e.messages){l.add(u.from.session_id);for(let p of u.recipients)l.add(p)}return{shown:n,edges:[...o.values()],shownIds:s,sessionIds:l,groupsTouched:r}}function Ic(e,t,n){return e.messages.filter(o=>o.ts>t&&o.ts<=n)}function $c(e,t,n){return e.messages.filter(o=>o.ts<=t&&o.ts>t-n)}function Bc(e,t){let n=Math.max(1,Math.floor(t)),o=new Array(n).fill(0);for(let s of e.messages){let r=e.duration>0?Math.floor((s.ts-e.start)/e.duration*n):0,l=Math.min(n-1,Math.max(0,r));o[l]=(o[l]??0)+1}return o}var Ni=e=>String(e).padStart(2,"0");function mn(e){let t=new Date(e*1e3);return`${Ni(t.getHours())}:${Ni(t.getMinutes())}:${Ni(t.getSeconds())}`}function Lc(e){let t=Math.max(0,Math.round(e));if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let o=Math.floor(n/60);if(o<24)return n%60?`${o}h ${n%60}m`:`${o}h`;let s=Math.floor(o/24);return o%24?`${s}d ${o%24}h`:`${s}d`}var oe=be({...Nc(),loaded:!1,failed:!1,liveMuted:!1,feed:[],more:!1,loadingOlder:!1,olderFailed:!1}),Fc=2e3,Kc=50;function Gc(e){oe.feed.some(t=>t.id===e.id)||(oe.feed.push(e),oe.feed.sort((t,n)=>t.id-n.id),oe.feed.length>Fc&&oe.feed.splice(0,oe.feed.length-Fc))}async function zi(){let e=oe.feed[0];if(!(!e||!oe.more||oe.loadingOlder)){oe.loadingOlder=!0,oe.olderFailed=!1;try{let t=await ke.older(e.id,Kc),n=new Set(oe.feed.map(o=>o.id));oe.feed.unshift(...t.messages.filter(o=>!n.has(o.id))),oe.more=t.more}catch{oe.olderFailed=!0}finally{oe.loadingOlder=!1}}}var hn=x(()=>Sc(oe)),Si=new Set;function jc(e){return Si.add(e),()=>Si.delete(e)}var ro=be({replay:null,spotlight:null}),Uc=0,Hc;function Xs(e){Uc+=1,ro.replay={message:e,n:Uc},ro.spotlight=e,clearTimeout(Hc),Hc=setTimeout(()=>ro.spotlight=null,2600)}var js=0,Ci=[];function Jp(e){oe.sessions=e.sessions,oe.groups=e.groups,oe.edges=e.edges,oe.recent=e.recent.slice(-50),oe.feed=[...e.recent],oe.more=e.recent.length>=Kc,oe.olderFailed=!1,oe.loaded=!0,oe.failed=!1,Zp()}var Ti=new Set;function Zp(){for(let e of[...Ti])try{e()}catch{}}function Wc(e){return Ti.add(e),()=>Ti.delete(e)}function Xc(e){if(js&&Ci.push(e),!!Ei(oe,e)&&(Gc(e),!oe.liveMuted))for(let t of[...Si])t(e)}async function io(){js+=1;try{let e=await ke.graph(),t=e.recent.reduce((o,s)=>Math.max(o,s.id),0),n=Ci.filter(o=>o.id>t);Jp(e);for(let o of n)Ei(oe,o)&&Gc(o)}catch(e){throw oe.failed=!0,e}finally{js-=1,js||(Ci=[])}}var M=be({mode:"live",status:"idle",replay:null,playhead:0,playing:!1,speed:60,skipSilence:!0,error:"",truncated:!1}),Ws=0;async function Vi(e,t){let n=++Ws;M.mode="replay",oe.liveMuted=!0,M.status="loading",M.playing=!1,M.error="";try{let o=await ke.timeline(e,t);if(n!==Ws)return;let s=zn(Ac(o.messages,e,t));M.replay=s,M.truncated=o.truncated===!0,M.playhead=s.start,M.status="ready"}catch(o){if(n!==Ws)return;M.status="error",M.error=o instanceof Error?o.message:String(o)}}function xt(){Ws+=1,M.mode="live",M.status="idle",M.replay=null,M.truncated=!1,M.playhead=0,M.playing=!1,M.error="",oe.liveMuted=!1}function wt(e){let t=M.replay;t&&(M.playhead=Math.min(t.end,Math.max(t.start,e)))}function Oi(){let e=M.replay;e&&(M.playhead>=e.end&&(M.playhead=e.start),M.playing=!0)}function Di(){M.playing=!1}function Yc(e){e>0&&(M.speed=e)}function qc(){M.replay&&(M.speed=Pc(M.replay))}function Mi(){M.skipSilence=!M.skipSilence}function Jc(e){let t=M.replay;if(!t||!M.playing||e<=0)return[];let n=Gs(t,M.speed,M.skipSilence),o=M.playhead,s=n.toReal(n.toPlayback(o)+e);return M.playhead=s,s>=t.end&&(M.playing=!1),Ic(t,o,s)}var gn=x(()=>M.mode==="replay"&&M.replay?Rc(M.replay,M.playhead):null);var Ys=e=>`#${e}`,Ai=e=>e.startsWith("#"),Zc=e=>Ai(e)?e.slice(1):e,Qc=50,ge=be({name:"",messages:[],more:!1,loading:!1,loadingOlder:!1,error:"",sending:!1}),ao=be({}),eu=e=>ao[e]??0,Pi=()=>pe.status?.gateway.id??"";function Qp(e){let t=tt(e),n=oe.sessions.find(s=>s.session_id===e),o=n!==void 0;return{id:e,name:t?.name??(n?n.title||n.handle:"")??"",online:o,status:o?n.status==="working"?"working":"idle":"offline",me:e===Pi(),chat:t!==void 0}}function qs(e){return e.members.map(t=>{let n=Qp(t);return n.name?n:{...n,name:t.slice(0,8)}}).sort((t,n)=>Number(n.online)-Number(t.online)||t.name.localeCompare(n.name))}function Ri(e){return oe.groups.find(t=>t.name===e)}var Js=x(()=>[...oe.groups].sort((e,t)=>(t.last?.ts??t.created)-(e.last?.ts??e.created)));function em(){for(let e of Object.keys(ao))oe.groups.some(t=>t.name===e)||delete ao[e]}Wc(em);function Zs(e){return e.from.session_id===Pi()?"":tt(e.from.session_id)?.name||e.from.title||e.from.handle||e.from.session_id.slice(0,8)}async function tu(e){ge.name=e,ge.messages=[],ge.more=!1,ge.error="",ge.loading=!0,ao[e]=0;try{let t=await ke.older(0,Qc,e);if(ge.name!==e)return;ge.messages=t.messages,ge.more=t.more}catch(t){ge.name===e&&(ge.error=t instanceof Oe?t.message:String(t))}finally{ge.name===e&&(ge.loading=!1)}}function nu(){ge.name="",ge.messages=[]}async function Ii(){let e=ge.name,t=ge.messages[0];if(!(!e||!t||!ge.more||ge.loadingOlder)){ge.loadingOlder=!0;try{let n=await ke.older(t.id,Qc,e);if(ge.name!==e)return;let o=new Set(ge.messages.map(s=>s.id));ge.messages.unshift(...n.messages.filter(s=>!o.has(s.id))),ge.more=n.more}catch{}finally{ge.loadingOlder=!1}}}function ou(e){if(e.to.kind!=="group"||!e.to.name)return;let t=e.to.name,n=Ri(t);n&&(!n.last||n.last.id<e.id)&&(n.last=e),t===ge.name?ge.messages.some(o=>o.id===e.id)||ge.messages.push(e):n&&e.from.session_id!==Pi()&&(ao[t]=(ao[t]??0)+1)}async function su(e,t){ge.sending=!0;try{return await ke.sendGroup(e,t),""}catch(n){return n instanceof Oe?n.message:String(n)}finally{ge.sending=!1}}var tm={key:0,class:"spin"},ru=O({__name:"ConnectionBanner",setup(e){let t=x(()=>pe.live?pe.status?.broker.reachable===!1?{text:c("The session broker is not connected, so nobody can be reached"),bad:!0,spin:!1}:null:{text:c("Connecting\u2026"),bad:!1,spin:!0});return(n,o)=>t.value?(f(),m("div",{key:0,class:ie(["banner",{bad:t.value.bad}]),role:"status"},[t.value.spin?(f(),m("span",tm)):N("v-if",!0),a("span",null,d(t.value.text),1)],2)):N("v-if",!0)}});var nm={class:"pane-head"},Gt=O({__name:"PaneHeader",props:{title:{}},setup(e){return(t,n)=>(f(),m("header",nm,[a("h1",null,d(e.title),1),Ts(t.$slots,"default")]))}});var au=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}),om=new Intl.DateTimeFormat(void 0,{weekday:"short"}),sm=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"});function iu(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}function Qs(e,t=new Date){if(!e)return"";let n=new Date(e*1e3),o=Math.round((iu(t)-iu(n))/864e5);return o<=0?au.format(n):o<7?om.format(n):sm.format(n)}function lu(e){return au.format(new Date(e))}function _n(e){let t=Math.max(0,Math.floor(e));if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let o=Math.floor(n/60);return o<48?`${o}h ${String(n%60).padStart(2,"0")}m`:`${Math.floor(o/24)}d`}function vn(e){let t=e.split("/").filter(Boolean);return t[t.length-1]??""}function cu(e){return e>=1e6?`${(e/1e6).toFixed(e%1e6?1:0)}M`:e>=1e3?`${(e/1e3).toFixed(e%1e3?1:0)}K`:String(e)}function lo(e){let t=0;for(let n of e)t=t*31+(n.codePointAt(0)??0)>>>0;return t%8}var Zo=[["#ff885e","#ff516a"],["#ffcd6a","#ffa85c"],["#82b1ff","#665fff"],["#a0de7e","#54cb68"],["#53edd6","#28c9b7"],["#72d5fd","#2a9ef1"],["#e0a2f3","#d669ed"],["#f7a3b6","#ec5f87"]];function er(e){let t=e.trim().split(/[\s_-]+/).filter(Boolean),n=t[0]??"?";return(t.length>1?[...n][0]+[...t[1]][0]:[...n].slice(0,2).join("")).toUpperCase()}var et=O({__name:"Avatar",props:{thread:{},size:{}},setup(e){let t=e,n=x(()=>`av${lo(t.thread.id)}`),o=x(()=>["idle","working","dead"].includes(t.thread.status)?t.thread.status:"");return(s,r)=>(f(),m("div",{class:ie(["avatar",[n.value,e.size]]),"aria-hidden":"true"},[le(d(i(er)(e.thread.name))+" ",1),e.thread.kind!=="external"?(f(),m("span",{key:0,class:ie(["presence",o.value])},null,2)):N("v-if",!0)],2))}});var uu={chat:'<path d="M21 12a8 8 0 0 1-11.6 7.1L4 20l1.1-4.4A8 8 0 1 1 21 12Z"/>',plus:'<circle cx="12" cy="12" r="9"/><path d="M12 8v8M8 12h8"/>',config:'<path d="M4 7h9M17 7h3M4 17h3M11 17h9"/><circle cx="15" cy="7" r="2"/><circle cx="9" cy="17" r="2"/>',logs:'<rect x="3" y="4" width="18" height="16" rx="3"/><path d="m7.5 9.5 3 2.5-3 2.5M13 15h4"/>',settings:'<circle cx="12" cy="12" r="3"/><path d="M12 3v2.5M12 18.5V21M3 12h2.5M18.5 12H21M5.6 5.6l1.8 1.8M16.6 16.6l1.8 1.8M18.4 5.6l-1.8 1.8M7.4 16.6l-1.8 1.8"/>',graph:'<circle cx="6" cy="7" r="2.4"/><circle cx="18" cy="7" r="2.4"/><circle cx="12" cy="18" r="2.4"/><path d="M8.4 7h7.2M7.2 9.1l3.6 6.8M16.8 9.1l-3.6 6.8"/>',back:'<path d="m15 5-7 7 7 7"/>',chevron:'<path d="m9 5 7 7-7 7"/>',send:'<path d="M3.4 20.4 21 12 3.4 3.6l.1 6.5L15 12 3.5 13.9z"/>',more:'<circle cx="12" cy="5" r="1.6"/><circle cx="12" cy="12" r="1.6"/><circle cx="12" cy="19" r="1.6"/>',check:'<path d="m5 12.5 4.5 4.5L19 7.5"/>',checks:'<path d="m1.5 12.5 4.5 4.5L15 8M9.5 15.5l1.5 1.5L21 7.5"/>',clock:'<circle cx="12" cy="12" r="8.5"/><path d="M12 7.5V12l3 2"/>',bot:'<rect x="5" y="8" width="14" height="11" rx="3.5"/><path d="M12 4v4M9 13h.01M15 13h.01M9.5 16.5h5"/>',term:'<rect x="3" y="4" width="18" height="16" rx="3"/><path d="m7.5 9.5 3 2.5-3 2.5M13 15h4"/>',plug:'<path d="M9 3v5M15 3v5M7 8h10v3a5 5 0 0 1-10 0V8ZM12 16v5"/>',tool:'<path d="M14.7 6.3a4 4 0 0 0 4.9 4.9l-8.4 8.4a2.1 2.1 0 0 1-3-3l8.4-8.4a4 4 0 0 1-1.9-1.9Z"/>',copy:'<rect x="8" y="8" width="12" height="12" rx="2.5"/><path d="M16 8V6.5A2.5 2.5 0 0 0 13.5 4h-7A2.5 2.5 0 0 0 4 6.5v7A2.5 2.5 0 0 0 6.5 16H8"/>',folder:'<path d="M3 7.5A2.5 2.5 0 0 1 5.5 5H9l2 2.5h7.5A2.5 2.5 0 0 1 21 10v7.5A2.5 2.5 0 0 1 18.5 20h-13A2.5 2.5 0 0 1 3 17.5Z"/>',search:'<circle cx="11" cy="11" r="6.5"/><path d="m16 16 4.5 4.5"/>',close:'<path d="M6 6l12 12M18 6 6 18"/>',warn:'<path d="M12 4 2.8 19.5h18.4Z"/><path d="M12 10v4.5M12 17.2h.01"/>',refresh:'<path d="M20 11a8 8 0 1 0-2.3 5.7M20 4v7h-7"/>',stop:'<rect x="6" y="6" width="12" height="12" rx="2.5"/>',bell:'<path d="M6 16.5V11a6 6 0 0 1 12 0v5.5l1.5 2h-15ZM10 21h4"/>',info:'<circle cx="12" cy="12" r="9"/><path d="M12 11v5.5M12 7.8h.01"/>',reply:'<path d="M9 7 4 12l5 5M4 12h9a7 7 0 0 1 7 7"/>',image:'<rect x="3.5" y="5" width="17" height="14" rx="3"/><circle cx="9" cy="10" r="1.6"/><path d="m4 17 5-4.5 3.5 3 3-2.5L20 16"/>',down:'<path d="m6 9 6 6 6-6"/>',play:'<path d="M8 5.5v13l11-6.5z"/>',logout:'<path d="M10 4H6.5A2.5 2.5 0 0 0 4 6.5v11A2.5 2.5 0 0 0 6.5 20H10M15 8l4 4-4 4M19 12H9"/>',code:'<path d="m8 8-4 4 4 4M16 8l4 4-4 4M13.5 5l-3 14"/>',text:'<path d="M5 6h14M5 12h14M5 18h9"/>',user:'<circle cx="12" cy="8.5" r="3.8"/><path d="M4.5 20c.8-4 3.8-6 7.5-6s6.7 2 7.5 6"/>',users:'<circle cx="9" cy="8.5" r="3.3"/><path d="M2.8 19.5c.7-3.4 3.2-5 6.2-5s5.5 1.6 6.2 5"/><path d="M16 5.4a3.3 3.3 0 0 1 0 6.2M18 14.8c1.8.6 3 2.2 3.4 4.7"/>',trash:'<path d="M5 7h14M10 7V5h4v2M7 7l.8 12h8.4L17 7"/>'},du=new Set(["send","more"]);var rm=["innerHTML"],se=O({__name:"Icon",props:{name:{},size:{}},setup(e){let t=e,n=x(()=>uu[t.name]);return(o,s)=>(f(),m("svg",{class:ie(["i",[e.size,{fill:i(du).has(e.name)}]]),viewBox:"0 0 24 24","aria-hidden":"true",innerHTML:n.value},null,10,rm))}});var im=["href","aria-current"],am={class:"row-body"},lm={class:"row-top"},cm={class:"row-name"},um={class:"row-time"},dm={class:"row-bottom"},fm={class:"row-sub"},pm={key:0,class:"badge"},fu=O({__name:"GroupRow",props:{group:{},current:{type:Boolean}},setup(e){let t=e,n=x(()=>eu(t.group.name)),o=r=>r.replace(/```[\w+#.-]*/g," ").replace(/[`*_#>]+/g,"").replace(/\s+/g," ").trim(),s=x(()=>{let r=t.group.last;if(!r)return c("{count} members",{count:t.group.members.length});let l=Zs(r);return`${l?`${l}: `:`${c("You")}: `}${o(r.text)}`});return(r,l)=>(f(),m("a",{class:"row",href:i(je)("chats",i(Ys)(e.group.name)),"aria-current":e.current?"true":void 0},[C(et,{thread:{id:`#${e.group.name}`,name:e.group.name,kind:"external",status:"idle"}},null,8,["thread"]),a("div",am,[a("div",lm,[C(se,{class:"row-kind",name:"users",size:"xs"}),a("span",cm,d(e.group.name),1),a("span",um,d(i(Qs)(e.group.last?.ts??e.group.created)),1)]),a("div",dm,[a("span",fm,d(s.value),1),n.value?(f(),m("span",pm,d(i(so)(n.value)),1)):N("v-if",!0)])])],8,im))}});var mm=["href","aria-current"],hm={class:"row-body"},gm={class:"row-top"},_m={class:"row-name"},vm={class:"row-time"},ym={class:"row-bottom"},bm={class:"row-sub"},km={key:0,class:"row-typing"},xm={key:0,class:"row-you"},wm={key:0,class:"badge"},$i=O({__name:"ChatRow",props:{thread:{},current:{type:Boolean}},setup(e){let t=e,n=x(()=>t.thread.status==="working"),o=x(()=>t.thread.kind==="daemon"?"bot":t.thread.kind==="external"?"plug":"term"),s=x(()=>t.thread.preview.startsWith("You: ")),r=u=>u.replace(/```[\w+#.-]*/g," ").replace(/[`*_#>]+/g,"").replace(/\s+/g," ").trim(),l=x(()=>t.thread.status==="dead"?c("stopped"):t.thread.preview?r(s.value?t.thread.preview.slice(5):t.thread.preview):vn(t.thread.workspace)||t.thread.model||"");return(u,p)=>(f(),m("a",{class:"row",href:i(je)("chats",e.thread.id),"aria-current":e.current?"true":void 0},[C(et,{thread:e.thread},null,8,["thread"]),a("div",hm,[a("div",gm,[C(se,{class:"row-kind",name:o.value,size:"xs"},null,8,["name"]),a("span",_m,d(e.thread.name),1),a("span",vm,d(i(Qs)(e.thread.updated_at)),1)]),a("div",ym,[a("span",bm,[n.value?(f(),m("span",km,d(i(c)("typing\u2026")),1)):(f(),m(S,{key:1},[s.value?(f(),m("span",xm,d(i(c)("You"))+": ",1)):N("v-if",!0),le(d(l.value),1)],64))]),e.thread.unread?(f(),m("span",wm,d(i(so)(e.thread.unread)),1)):N("v-if",!0)])])],8,mm))}});var Em={class:"search"},Nm=["placeholder","aria-label"],pu=O({__name:"SearchBox",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(e){let t=no(e,"modelValue");return(n,o)=>(f(),m("label",Em,[C(se,{name:"search",size:"sm"}),Ee(a("input",{"onUpdate:modelValue":o[0]||(o[0]=s=>t.value=s),type:"search",placeholder:i(c)("Search"),"aria-label":i(c)("Search"),autocomplete:"off"},null,8,Nm),[[Ae,t.value]])]))}});var co=X("");var Sm={class:"pane-list"},Cm={key:0,class:"empty"},Tm={key:1,class:"empty"},zm={class:"pane-group"},Vm={class:"pane-group"},Om={key:0,class:"pane-subgroup"},Dm={class:"pane-group"},mu=O({__name:"ChatPane",setup(e){let t=(p,h)=>[p.name,p.title,p.workspace,p.id,p.handle,p.preview].some(g=>g.toLowerCase().includes(h)),n=x(()=>{let p=co.value.trim().toLowerCase();return p?pe.threads.filter(h=>t(h,p)):pe.threads}),o=x(()=>{let p=co.value.trim().toLowerCase();return p?Js.value.filter(h=>h.name.toLowerCase().includes(p)||h.last?.text.toLowerCase().includes(p)||qs(h).some(g=>g.name.toLowerCase().includes(p))):Js.value}),s=x(()=>n.value.filter(p=>p.kind==="daemon")),r=x(()=>s.value.find(p=>!p.online)?.id??""),l=x(()=>n.value.filter(p=>p.kind!=="daemon")),u=x(()=>ye.nav==="chats"?ye.arg:Z.id);return(p,h)=>(f(),m(S,null,[C(Gt,{title:i(c)("Chats")},null,8,["title"]),C(pu,{modelValue:i(co),"onUpdate:modelValue":h[0]||(h[0]=g=>Ge(co)?co.value=g:null)},null,8,["modelValue"]),C(ru),a("div",Sm,[i(pe).loaded&&!i(pe).threads.length&&!i(Js).length?(f(),m("div",Cm,[a("b",null,d(i(c)("No sessions yet")),1),le(" "+d(i(c)("Start a daemon, or open a ZettCode session in a terminal, and it appears here."))+" ",1),a("button",{class:"btn",onClick:h[1]||(h[1]=g=>i(lt)("new"))},d(i(c)("New daemon")),1)])):!n.value.length&&!o.value.length?(f(),m("div",Tm,d(i(c)("Nothing matches")),1)):N("v-if",!0),o.value.length?(f(),m(S,{key:2},[a("div",zm,d(i(c)("Groups")),1),(f(!0),m(S,null,J(o.value,g=>(f(),ae(fu,{key:g.name,group:g,current:i(Ys)(g.name)===u.value},null,8,["group","current"]))),128))],64)):N("v-if",!0),s.value.length?(f(),m(S,{key:3},[a("div",Vm,d(i(c)("Daemons")),1),(f(!0),m(S,null,J(s.value,g=>(f(),m(S,{key:g.id},[g.id===r.value&&r.value!==s.value[0]?.id?(f(),m("div",Om,d(i(c)("Offline")),1)):N("v-if",!0),C($i,{thread:g,current:g.id===u.value},null,8,["thread","current"])],64))),128))],64)):N("v-if",!0),l.value.length?(f(),m(S,{key:4},[a("div",Dm,d(i(c)("Other sessions")),1),(f(!0),m(S,null,J(l.value,g=>(f(),ae($i,{key:g.id,thread:g,current:g.id===u.value},null,8,["thread","current"]))),128))],64)):N("v-if",!0)])],64))}});async function tr(e){try{if(navigator.clipboard)return await navigator.clipboard.writeText(e),!0}catch{}let t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.cssText="position:fixed;top:0;left:0;opacity:0",document.body.appendChild(t),t.select();try{return document.execCommand("copy")}catch{return!1}finally{t.remove()}}var hu=()=>({workspace:"",model:j.defaults.model,effort:j.defaults.effort,permission:j.defaults.permission||"safe",name:"",resume:"",message:""}),_e=be(hu());function Bn(e={}){Object.assign(_e,hu(),e)}function nr(e){Object.assign(_e,{name:e.name,model:e.model,effort:e.effort,permission:e.permission,message:e.message})}function or(e){Bn({workspace:e.workspace,model:e.model??"",effort:e.effort??"",permission:e.permission??"safe",name:e.name===e.id.slice(0,8)?"":e.name,resume:e.id})}var sr=[{label:"Reviewer",name:"reviewer",model:"",effort:"",permission:"safe",message:"Review the current diff and list concrete problems."},{label:"Explorer",name:"explorer",model:"",effort:"",permission:"safe",message:"Find where this is implemented and summarize how it works."}];var Mm={class:"card-hint confirm-text"},Am={class:"actions"},gu=O({__name:"ConfirmSheet",props:{text:{},ok:{},danger:{type:Boolean}},emits:["close"],setup(e,{emit:t}){let n=t;return(o,s)=>(f(),m(S,null,[a("p",Mm,d(e.text),1),a("div",Am,[a("button",{class:ie(["btn",{danger:e.danger}]),onClick:s[0]||(s[0]=r=>n("close",!0))},d(e.ok),3),a("button",{class:"btn ghost",onClick:s[1]||(s[1]=r=>n("close",!1))},d(i(c)("Cancel")),1)])],64))}});var Pm=["onClick"],_u=O({__name:"MenuSheet",props:{items:{}},emits:["close"],setup(e,{emit:t}){let n=t;return(o,s)=>(f(!0),m(S,null,J(e.items,r=>(f(),m("button",{key:r.label,class:ie(["menu-item",{danger:r.danger}]),onClick:l=>{n("close"),r.run()}},[C(se,{name:r.icon},null,8,["name"]),a("span",null,d(r.label),1)],10,Pm))),128))}});async function _t(e){return await Rn(e.title,gu,{text:e.text,ok:e.ok,danger:e.danger??!1})===!0}function vu(e,t){Rn(e,_u,{items:t.filter(n=>!!n)})}var Rm={class:"card info-card"},Im={class:"mono"},yu=O({__name:"ThreadInfo",props:{thread:{}},setup(e){let t=e,n=x(()=>{let o=t.thread,s=[[c("Session id"),o.id],[c("Kind"),c(o.kind==="daemon"?"Daemon":o.kind==="external"?"External program":"Session")],[c("Status"),c(o.status)]];return o.handle&&s.push([c("Handle"),`@${o.handle}`]),o.workspace&&s.push([c("Workspace"),o.workspace]),o.model&&s.push([c("Model"),o.effort?`${o.model} \xB7 ${o.effort}`:o.model]),o.permission&&s.push([c("Shell level"),o.permission]),o.pid&&s.push([c("Process"),String(o.pid)]),o.kind==="daemon"&&o.started_at&&s.push([c("Running for"),_n(Date.now()/1e3-o.started_at)]),s});return(o,s)=>(f(),m("div",Rm,[(f(!0),m(S,null,J(n.value,([r,l])=>(f(),m("div",{key:r,class:"kv"},[a("span",null,d(r),1),a("span",Im,d(l),1)]))),128))]))}});async function $m(e){xe(await tr(e.id)?c("Session id copied"):e.id)}async function Bi(e){let t=e.status==="working";if(await _t({title:t?c("{name} is working. Stop it anyway?",{name:e.name}):c("Stop {name}?",{name:e.name}),text:t?c("It is in the middle of a turn, and stopping it now throws that turn away. It stays in the list, offline."):c("The daemon stops, and stays in the list as offline with its conversation, so it can be started again."),ok:t?c("Stop anyway"):c("Stop"),danger:!0}))try{await ke.stop(e.id,t),xe(c("Stopped")),await sn()}catch(o){xe(o instanceof Oe?o.message:String(o),"bad")}}async function Li(e){if(await _t({title:c("Delete {name}?",{name:e.name}),text:c("The daemon and its whole conversation are removed for good. This cannot be undone."),ok:c("Delete"),danger:!0}))try{await ke.remove(e.id),xe(c("Deleted")),ye.nav==="chats"&&ye.arg===e.id&&lt("chats"),await sn()}catch(n){xe(n instanceof Oe?n.message:String(n),"bad")}}function Fi(e){or(e),lt("new")}function Ui(e){Rn(e.name,yu,{thread:e})}function bu(e){let t=e.kind==="daemon",n=t&&e.online;vu(e.name,[{icon:"info",label:c("Info"),run:()=>Ui(e)},t&&{icon:"logs",label:c("Logs"),run:()=>lt("logs",e.id)},{icon:"copy",label:c("Copy session id"),run:()=>void $m(e)},t&&{icon:"refresh",label:c("Restart with a new configuration"),run:()=>Fi(e)},n&&{icon:"stop",label:c("Stop daemon"),run:()=>void Bi(e),danger:!0},t&&!n&&{icon:"trash",label:c("Delete daemon"),run:()=>void Li(e),danger:!0}])}var Bm={class:"bar chat-head"},Lm=["href","aria-label"],Fm={class:"chat-title"},Um=["title"],Hm=["aria-pressed","title","aria-label"],Km=["aria-label"],ku=O({__name:"ChatHeader",props:{thread:{}},setup(e){let t=e,n=x(()=>{let r=t.thread;return r.locked?{label:c("Busy elsewhere"),hint:c("Another window has this session open, so it is read-only here."),kind:"bad"}:r.online?r.direct?{label:c("Direct"),hint:c("Your text runs as this session's own prompt, and its answer comes back here."),kind:"ok"}:{label:c("Relayed"),hint:c("Delivered as a message from another session. An older window does not run it as its own prompt."),kind:"warn"}:null}),o=x(()=>t.thread.status==="working"),s=x(()=>{let r=t.thread;switch(r.status){case"working":return c("typing\u2026");case"dead":return c("stopped");case"starting":return c("starting\u2026");case"stopping":return c("stopping\u2026");case"offline":return c("offline");default:{let l=r.kind==="daemon"?[r.model,r.permission]:[vn(r.workspace)];return[c("online"),...l.filter(Boolean)].join(" \xB7 ")}}});return(r,l)=>(f(),m("header",Bm,[a("a",{class:"iconbtn back",href:i(je)("chats"),"aria-label":i(c)("Back")},[C(se,{name:"back"})],8,Lm),a("button",{class:"chat-who",onClick:l[0]||(l[0]=u=>i(Ui)(e.thread))},[C(et,{thread:e.thread,size:"sm"},null,8,["thread"]),a("span",Fm,[a("b",null,[le(d(e.thread.name),1),n.value?(f(),m("span",{key:0,class:ie(["mode",n.value.kind]),title:n.value.hint},d(n.value.label),11,Um)):N("v-if",!0)]),a("span",{class:ie({live:o.value})},d(s.value),3)])]),a("button",{class:"iconbtn","aria-pressed":i(j).render==="source",title:i(j).render==="markdown"?i(c)("Show message source"):i(c)("Render markdown"),"aria-label":i(j).render==="markdown"?i(c)("Show message source"):i(c)("Render markdown"),onClick:l[1]||(l[1]=u=>i(j).render=i(j).render==="markdown"?"source":"markdown")},[C(se,{name:i(j).render==="markdown"?"code":"text"},null,8,["name"])],8,Hm),a("button",{class:"iconbtn","aria-label":i(c)("More"),onClick:l[2]||(l[2]=u=>i(bu)(e.thread))},[C(se,{name:"more"})],8,Km)]))}});var Hi={images:4,image:4194304,total:8388608};var Eu=1568,Gm=1<<20;function Nu(e){return{images:e?.max_images??Hi.images,image:e?.max_image_bytes??Hi.image,total:e?.max_images_bytes??Hi.total}}function jm(e,t,n=Eu){let o=Math.max(e,t);if(o<=n||o<=0)return{width:e,height:t};let s=n/o;return{width:Math.max(1,Math.round(e*s)),height:Math.max(1,Math.round(t*s))}}var Wm=["image/png","image/gif","image/webp"];function Xm(e,t,n,o){return Wm.includes(e)&&t<=Gm&&Math.max(n,o)<=Eu}var Ln=(e,t)=>(e[t]??0)|(e[t+1]??0)<<8,xu=(e,t)=>Ln(e,t)|(e[t+2]??0)<<16,wu=(e,t)=>(e[t]??0)*2**24+((e[t+1]??0)<<16|(e[t+2]??0)<<8|(e[t+3]??0)),yn=(e,t,n)=>[...n].every((o,s)=>e[t+s]===o.charCodeAt(0));function Ym(e){if(yn(e,1,"PNG")&&e.length>=24)return{width:wu(e,16),height:wu(e,20)};if((yn(e,0,"GIF87a")||yn(e,0,"GIF89a"))&&e.length>=10)return{width:Ln(e,6),height:Ln(e,8)};if(yn(e,0,"RIFF")&&yn(e,8,"WEBP")&&e.length>=30){if(yn(e,12,"VP8X"))return{width:xu(e,24)+1,height:xu(e,27)+1};if(yn(e,12,"VP8L")&&e[20]===47){let t=Ln(e,21)|Ln(e,23)<<16;return{width:(t&16383)+1,height:(t>>>14&16383)+1}}if(yn(e,12,"VP8 ")&&e[23]===157&&e[24]===1&&e[25]===42)return{width:Ln(e,26)&16383,height:Ln(e,28)&16383}}return null}function qm(e){let t=e.endsWith("==")?2:e.endsWith("=")?1:0;return Math.floor(e.length*3/4)-t}function Su(e,t,n){return e.length>=n.images?"At most {count} pictures go with one message":t.bytes>n.image?"That picture is too large":e.reduce((o,s)=>o+s.bytes,0)+t.bytes>n.total?"The pictures are too large together":""}function rr(e){return e.type.startsWith("image/")}function Jm(e){return createImageBitmap(e)}function Zm(e){let t=new Uint8Array(e),n="";for(let o=0;o<t.length;o+=32768)n+=String.fromCharCode(...t.subarray(o,o+32768));return btoa(n)}async function Cu(e){if(!rr(e))throw new Error("That is not a picture");let t=Ym(new Uint8Array(await e.slice(0,64).arrayBuffer()));if(t&&Xm(e.type,e.size,t.width,t.height)){let o=Zm(await e.arrayBuffer());return{media_type:e.type,data:o,src:`data:${e.type};base64,${o}`,bytes:e.size,name:e.name}}let n=await Jm(e);try{let{width:o,height:s}=jm(n.width,n.height),r=document.createElement("canvas");r.width=o,r.height=s;let l=r.getContext("2d");if(!l)throw new Error("This browser cannot shrink a picture");l.fillStyle="#fff",l.fillRect(0,0,o,s),l.drawImage(n,0,0,o,s);let u=r.toDataURL("image/jpeg",.85),p=u.slice(u.indexOf(",")+1);return{media_type:"image/jpeg",data:p,src:u,bytes:qm(p),name:e.name}}finally{n.close()}}var Se=be({data:null,loading:!1,error:""});async function uo(e=!1){if(!(Se.loading||Se.data&&!e)){Se.loading=!0;try{Se.data=await ke.config(),Se.error=""}catch(t){Se.error=t instanceof Oe?t.message:String(t)}finally{Se.loading=!1}}}var Qm={key:0,class:"composer-note"},eh=["aria-label"],th=["src","alt"],nh=["aria-label","onClick"],oh=["disabled","title","aria-label"],sh={class:"composer-field"},rh=["placeholder","aria-label"],ih={key:0,class:"composer-count"},ah=["aria-pressed","title","aria-label"],lh=["disabled","aria-label"],Tu=O({__name:"Composer",props:{thread:{}},setup(e){let t=e,n=X(null),o=X(_i(t.thread.id)),s=new Set,r=!matchMedia("(pointer: coarse)").matches,l=x(()=>pe.status?.limits),u=x(()=>Xo(t.thread)),p=X([]),h=X(null),g=X(!1),y=x(()=>Nu(l.value)),E=x(()=>Se.data?.models.find(Q=>Q.name===t.thread.model)),z=x(()=>t.thread.direct&&(E.value?.multimodal??!0)),D=x(()=>t.thread.direct?c("{model} does not accept pictures.",{model:t.thread.model??""}):c("This session cannot be sent a picture.")),V=x(()=>o.value.trim()===""&&p.value.length===0),W=x(()=>l.value!==void 0&&o.value.length>l.value.max_text*.8),re=x(()=>{let Q=l.value;return Q&&Q.used>=Q.rate_limit*.7?c("{used} of {limit} messages used this minute",{used:Q.used,limit:Q.rate_limit}):""});function U(){let Q=n.value;Q&&(Q.style.height="auto",Q.style.height=`${Math.min(Q.scrollHeight,152)}px`)}ve(o,Q=>{hc(t.thread.id,Q),Ue(U)}),ve(()=>t.thread.id,Q=>{o.value=_i(Q),p.value=[],Ue(U)}),Re(()=>{U(),uo(),r&&n.value?.focus()});async function $(Q){let q=[...Q].filter(rr);if(q.length){if(!z.value){xe(D.value,"bad");return}for(let te of q)try{let fe=await Cu(te),Be=Su(p.value,fe,y.value);if(Be){xe(c(Be,{count:y.value.images}),"bad");break}p.value=[...p.value,fe]}catch{xe(c("That picture could not be read."),"bad")}}}function H(){let Q=h.value;Q&&($(Array.from(Q.files??[])),Q.value="")}function L(Q){let q=Array.from(Q.clipboardData?.files??[]).filter(rr);q.length&&(Q.preventDefault(),$(q))}function ze(Q){g.value=!1,$(Array.from(Q.dataTransfer?.files??[]))}async function ue(){let Q=o.value.trim();if(!Q&&!p.value.length)return;let q=t.thread;if(q.kind!=="daemon"&&j.confirmSession&&!s.has(q.id)){if(!await _t({title:c("Write to {name}?",{name:q.name}),text:c("This session may have a person at it. Your message starts a turn there and uses that session's tokens."),ok:c("Send")}))return;s.add(q.id)}let te=p.value;o.value="",p.value=[],n.value?.focus({preventScroll:!0}),await gi(Q,Xo(q),te)}function we(Q){Q.key==="Enter"&&!Q.shiftKey&&!Q.isComposing&&r&&(Q.preventDefault(),ue())}return(Q,q)=>(f(),m(S,null,[re.value?(f(),m("div",Qm,d(re.value),1)):N("v-if",!0),p.value.length?(f(),m("div",{key:1,class:"composer-pictures",role:"list","aria-label":i(c)("Pictures to send")},[(f(!0),m(S,null,J(p.value,(te,fe)=>(f(),m("div",{key:fe,class:"composer-picture",role:"listitem"},[a("img",{src:te.src,alt:te.name},null,8,th),a("button",{type:"button","aria-label":i(c)("Remove the picture"),onClick:Be=>p.value=p.value.filter((Et,Mt)=>Mt!==fe)},[C(se,{name:"close",size:"xs"})],8,nh)]))),128))],8,eh)):N("v-if",!0),a("form",{class:ie(["composer",{dragging:g.value}]),onSubmit:Ye(ue,["prevent"]),onDragover:q[6]||(q[6]=Ye(te=>g.value=!0,["prevent"])),onDragleave:q[7]||(q[7]=te=>g.value=!1),onDrop:Ye(ze,["prevent"])},[a("input",{ref_key:"picker",ref:h,class:"composer-file",type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",multiple:"",onChange:H},null,544),e.thread.direct?(f(),m("button",{key:0,type:"button",class:"composer-attach",disabled:!z.value,title:z.value?i(c)("Attach a picture"):D.value,"aria-label":i(c)("Attach a picture"),onPointerdown:q[0]||(q[0]=Ye(()=>{},["prevent"])),onClick:q[1]||(q[1]=te=>h.value?.click())},[C(se,{name:"image"})],40,oh)):N("v-if",!0),a("div",sh,[Ee(a("textarea",{ref_key:"field",ref:n,"onUpdate:modelValue":q[2]||(q[2]=te=>o.value=te),rows:"1",placeholder:i(c)("Message"),"aria-label":i(c)("Message"),enterkeyhint:"send",onKeydown:we,onPaste:L},null,40,rh),[[Ae,o.value]]),W.value?(f(),m("span",ih,d(o.value.length)+"/"+d(l.value?.max_text),1)):N("v-if",!0),a("button",{type:"button",class:"composer-reply","aria-pressed":u.value,title:i(c)("Ask the agent to answer with send_message"),"aria-label":i(c)("Ask the agent to answer with send_message"),onPointerdown:q[3]||(q[3]=Ye(()=>{},["prevent"])),onClick:q[4]||(q[4]=te=>i(_c)(i(Z).id,!u.value))},[C(se,{name:"reply",size:"sm"})],40,ah)]),a("button",{class:"sendbtn",type:"submit",disabled:V.value,"aria-label":i(c)("Send"),onPointerdown:q[5]||(q[5]=Ye(()=>{},["prevent"]))},[C(se,{name:"send"})],40,lh)],34)],64))}});var ch={class:"locked"},uh=["disabled"],zu=O({__name:"LockedBar",props:{thread:{}},setup(e){let t=e,n=X(!1),o=x(()=>pe.status?.broker.reachable===!1?c("The session broker is not connected."):t.thread.locked?c("This session is open in another ZettCode window, so it is read-only here."):t.thread.status==="dead"?c("This daemon has stopped."):t.thread.status==="starting"?c("This daemon is starting."):t.thread.status==="stopping"?c("This daemon is stopping."):t.thread.kind==="daemon"?c("This daemon is not connected."):c("This session is not connected.")),s=x(()=>t.thread.kind==="daemon"&&t.thread.status==="dead"&&!t.thread.locked);function r(){or(t.thread),lt("new")}async function l(){n.value=!0;try{let{thread:u}=await ke.recheck(t.thread.id);xe(u.locked?c("Still open in another window."):c("No other window has it open now.")),await sn()}catch{xe(c("Could not check."),"bad")}finally{n.value=!1}}return(u,p)=>(f(),m("div",ch,[a("span",null,d(o.value),1),e.thread.locked?(f(),m("button",{key:0,class:"btn sm",disabled:n.value,onClick:l},d(i(c)("Check again")),9,uh)):N("v-if",!0),s.value?(f(),m("button",{key:1,class:"btn sm",onClick:r},d(i(c)("Start it again")),1)):N("v-if",!0)]))}});var dh=e=>e.kind==="out"||e.kind==="user"||e.kind==="from";function Ki(e,t){if(!t)return{items:[...e],tools:[],text:""};let n=e.length;for(;n>0&&!dh(e[n-1]);)n-=1;let o=0,s=t.text,r=e.map((u,p)=>{if(p<n)return u;if(u.kind==="tool"){let h=t.tools[o++];return u.ok===void 0&&h&&h.ok!==null?{...u,ok:h.ok}:u}if(u.kind==="in"||u.kind==="reply"){let h=u.text.trim(),g=h?s.indexOf(h):-1;g>=0&&(s=s.slice(g+h.length))}return u}),l=t.tools.slice(o).map(u=>({kind:"tool",name:u.name,brief:u.brief,ok:u.ok??void 0}));return{items:r,tools:l,text:s.trim()}}function Vu(e,t,n){let o=[],s=Ki(e,n),r=null,l=[],u=0,p=()=>{l.length&&o.push({type:"steps",key:`s${u}`,tools:l}),l=[]};s.items.forEach((h,g)=>{if(h.kind==="tool"){l.length||(u=g),l.push(h),r=null;return}if(p(),h.kind==="note"){o.push({type:"note",key:`n${g}`,text:h.text}),r=null;return}let y=h.kind==="out"||h.kind==="user"||h.kind==="from"?"out":"in";o.push({type:"bubble",key:`m${g}`,side:y,item:h,cont:r===y,tail:!0}),r=y}),s.tools.length&&!l.length&&(u=e.length),l.push(...s.tools),p();for(let h of t)o.push({type:"bubble",key:`p${h.key}`,side:"out",item:{kind:"out",text:h.text,...h.pictures?.length?{images:h.pictures.map(g=>({id:"",media_type:g.media_type,bytes:g.bytes,src:g.src}))}:{}},cont:r==="out",tail:!0,pending:h}),r="out";return o.forEach((h,g)=>{let y=o[g+1];h.type==="bubble"&&(h.tail=!(y?.type==="bubble"&&y.side===h.side))}),o}var fh=["src"],fo=O({__name:"UserAvatar",props:{size:{}},setup(e){return(t,n)=>(f(),m("div",{class:ie(["avatar user-avatar",e.size]),"aria-hidden":"true"},[i(j).avatar?(f(),m("img",{key:0,src:i(j).avatar,alt:""},null,8,fh)):(f(),ae(se,{key:1,name:"user"}))],2))}});var ph=["innerHTML"],mh={key:1,class:"plain"},po=O({__name:"MessageText",props:{text:{},plain:{type:Boolean}},setup(e){let t=e,n=X("");ve(()=>[t.text,t.plain,j.render,c("Copy")],async([s,r,l,u])=>{if(r||l!=="markdown"){n.value="";return}let{renderMarkdown:p}=await import("./chunks/render-G6G3TSB3.js");n.value=p(s,{copy:u})},{immediate:!0});async function o(s){let r=s.target.closest("[data-copy]");if(!r)return;let l=r.closest(".code")?.querySelector("code")?.textContent??"";await tr(l)?xe(c("Copied")):xe(c("Cannot copy here"),"bad")}return(s,r)=>n.value?(f(),m("div",{key:0,class:"md",onClick:o,innerHTML:n.value},null,8,ph)):(f(),m("div",mh,d(e.text),1))}});var hh={key:1,class:"msg-avatar"},gh={key:0,class:"bubble-who"},_h=["aria-label","onClick"],vh=["src","alt"],yh={key:3,class:"meta"},bh={key:0},kh={key:4,class:"bubble-retry"},xh={class:"bubble-why"},wh={key:1,class:"msg-avatar"},Eh=["aria-label"],Nh=["src","alt"],Ou=O({__name:"MessageBubble",props:{row:{},thread:{}},setup(e){let t=e,n=x(()=>tt(t.thread)),o=x(()=>{let h=t.row.item;return h.kind==="from"?`${h.sender} \xB7 ${h.via}`:""}),s=x(()=>t.row.pending?.state??"stored"),r=x(()=>t.row.pending?.error),l=x(()=>(t.row.item.images??[]).map(h=>({...h,src:h.src??`/api/threads/${encodeURIComponent(t.thread)}/pictures/${encodeURIComponent(h.id)}`}))),u=X("");function p(){let h=t.row.pending,g=tt(t.thread);h&&g&&pc(h,Xo(g))}return(h,g)=>(f(),m("div",{class:ie(["msg",[e.row.side,{cont:e.row.cont}]])},[e.row.side==="in"?(f(),m(S,{key:0},[e.row.tail&&n.value?(f(),ae(et,{key:0,class:"msg-avatar",thread:n.value,size:"sm"},null,8,["thread"])):(f(),m("div",hh))],64)):N("v-if",!0),a("div",{class:ie(["bubble",{reply:e.row.item.kind==="reply",err:s.value==="failed"}])},[o.value?(f(),m("span",gh,d(o.value),1)):N("v-if",!0),l.value.length?(f(),m("div",{key:1,class:ie(["bubble-pictures",{many:l.value.length>1}])},[(f(!0),m(S,null,J(l.value,(y,E)=>(f(),m("button",{key:E,type:"button",class:"bubble-picture","aria-label":i(c)("Enlarge the picture"),onClick:z=>u.value=y.src},[a("img",{src:y.src,alt:i(c)("A picture in the message"),loading:"lazy",decoding:"async"},null,8,vh)],8,_h))),128))],2)):N("v-if",!0),e.row.item.text?(f(),ae(po,{key:2,text:e.row.item.text},null,8,["text"])):N("v-if",!0),s.value==="sending"||s.value==="queued"||s.value==="failed"?(f(),m("span",yh,[s.value==="queued"?(f(),m("span",bh,d(i(c)("queued")),1)):N("v-if",!0),s.value==="sending"?(f(),ae(se,{key:1,name:"clock",size:"xs"})):s.value==="failed"?(f(),ae(se,{key:2,class:"meta-bad",name:"warn",size:"xs"})):N("v-if",!0)])):N("v-if",!0),r.value?(f(),m("div",kh,[a("span",xh,[le(d(r.value.message)+" ",1),r.value.uncertain?(f(),m(S,{key:0},[le(d(i(c)("It may or may not have arrived; sending again could duplicate it.")),1)],64)):N("v-if",!0)]),a("button",{class:"btn sm",onClick:p},d(i(c)("Send again")),1),a("button",{class:"btn sm ghost",onClick:g[0]||(g[0]=y=>e.row.pending&&i(mc)(e.row.pending))},d(i(c)("Delete")),1)])):N("v-if",!0)],2),e.row.side==="out"?(f(),m(S,{key:1},[e.row.tail?(f(),ae(fo,{key:0,class:"msg-avatar",size:"sm"})):(f(),m("div",wh))],64)):N("v-if",!0),(f(),ae(Cs,{to:"body"},[u.value?(f(),m("button",{key:0,type:"button",class:"zoom","aria-label":i(c)("Close"),onClick:g[1]||(g[1]=y=>u.value=""),onKeydown:g[2]||(g[2]=$l(y=>u.value="",["esc"]))},[a("img",{src:u.value,alt:i(c)("A picture in the message")},null,8,Nh)],40,Eh)):N("v-if",!0)]))],2))}});var Sh={class:"note"},Du=O({__name:"NoteBubble",props:{text:{}},setup(e){return(t,n)=>(f(),m("details",Sh,[a("summary",null,d(i(c)("Earlier conversation summarized")),1),a("p",null,d(e.text),1)]))}});var Ch={class:"steps"},Th={key:0,class:"steps-brief"},zh={class:"steps-tool"},Vh={key:0},Mu=O({__name:"StepsGroup",props:{tools:{}},setup(e){let t=e,n=x(()=>t.tools[t.tools.length-1]),o=x(()=>t.tools.filter(r=>r.ok===!1).length),s=x(()=>{let r=t.tools.length,l=r===1?n.value?.name??"":c("{count} steps",{count:r});return o.value?`${l} \xB7 ${c("{count} failed",{count:o.value})}`:l});return(r,l)=>(f(),m("details",Ch,[a("summary",null,[C(se,{name:"tool",size:"xs"}),a("span",null,d(s.value),1),e.tools.length===1&&n.value?.brief?(f(),m("span",Th,d(n.value.brief),1)):N("v-if",!0)]),a("ol",null,[(f(!0),m(S,null,J(e.tools,(u,p)=>(f(),m("li",{key:p},[a("details",null,[a("summary",zh,[u.ok===!1?(f(),ae(se,{key:0,class:"steps-fail",name:"warn",size:"xs"})):u.ok?(f(),ae(se,{key:1,class:"steps-ok",name:"check",size:"xs"})):(f(),ae(se,{key:2,class:"steps-run",name:"clock",size:"xs"})),a("b",null,d(u.name),1),a("code",null,d(u.brief),1)]),u.output?(f(),m("pre",Vh,d(u.output),1)):N("v-if",!0)])]))),128))])]))}});var Oh={class:"msg in","aria-hidden":"true"};function Dh(e,t){return f(),m("div",Oh,[...t[0]||(t[0]=[a("div",{class:"bubble typing"},[a("i"),a("i"),a("i")],-1)])])}var ir={render:Dh};var Mh={key:0,class:"msg in live"},Ah={class:"bubble"},Ph=250,Au=O({__name:"LiveTurn",setup(e){let t=x(()=>kt[Z.id]),n=X(""),o=0,s;function r(){s=void 0,o=Date.now(),n.value=t.value?.text??""}ve(t,()=>{window.clearTimeout(s),s=void 0,n.value=""}),ve(()=>t.value?.text,()=>{s===void 0&&(s=window.setTimeout(r,Math.max(0,Ph-(Date.now()-o))))},{immediate:!0}),bt(()=>window.clearTimeout(s));let l=x(()=>tt(Z.id)),u=x(()=>t.value?Ki(Z.items,{...t.value,text:n.value}).text:"");return(p,h)=>t.value?(f(),m(S,{key:0},[u.value?(f(),m("div",Mh,[l.value?(f(),ae(et,{key:0,class:"msg-avatar",thread:l.value,size:"sm"},null,8,["thread"])):N("v-if",!0),a("div",Ah,[C(po,{text:u.value},null,8,["text"])])])):(f(),ae(ir,{key:1}))],64)):N("v-if",!0)}});var Rh={class:"chat-bg"},Ih={key:0,class:"messages-note"},$h={key:1,class:"errcard"},Bh={key:4,class:"messages-note"},Lh=["aria-label"],Fh={key:0,class:"badge"},Pu=O({__name:"MessageList",setup(e){let t=X(null),n=X(null),o=X(!0),s=X(0),r=x(()=>Vu(Z.items,Z.pending,kt[Z.id])),l=x(()=>kt[Z.id]),u=x(()=>Z.thread?.status==="working"&&!l.value),p=0,h=!0,g="";function y(){let W=t.value;return!W||W.scrollHeight-W.scrollTop-W.clientHeight<140}function E(W){Ue(()=>t.value?.scrollTo({top:t.value.scrollHeight,behavior:W?"smooth":"auto"}))}function z(){o.value=y(),Z.atBottom=o.value,o.value&&(s.value=0,document.hidden||fn())}ve(()=>Z.id,()=>{h=!0,p=0,s.value=0,o.value=!0,Z.atBottom=!0}),ve(()=>Z.revision,()=>{let W=r.value.length,re=r.value[W-1],U=re?.type==="bubble"&&re.pending&&re.key!==g;g=re?.key??"",h||o.value||U?(E(!h),o.value=!0,Z.atBottom=!0,h=h&&W===0):W>p&&(s.value+=W-p),p=W},{flush:"post"}),ve(u,W=>W&&o.value&&E(!0),{flush:"post"}),ve(()=>[l.value?.text.length,l.value?.tools.length],()=>o.value&&E(!1),{flush:"post"});function D(){o.value&&E(!1)}let V;return Re(()=>{E(!1),window.visualViewport?.addEventListener("resize",D),n.value&&typeof ResizeObserver<"u"&&(V=new ResizeObserver(()=>{o.value&&E(!1)}),V.observe(n.value))}),bt(()=>{window.visualViewport?.removeEventListener("resize",D),V?.disconnect()}),(W,re)=>(f(),m("div",Rh,[a("div",{ref_key:"scroller",ref:t,class:"messages",role:"log","aria-live":"polite",onScrollPassive:z},[a("div",{ref_key:"body",ref:n,class:"messages-body"},[i(Z).loading&&!i(Z).items.length?(f(),m("div",Ih,[...re[2]||(re[2]=[a("span",{class:"spin"},null,-1)])])):i(Z).error?(f(),m("div",$h,d(i(Z).error),1)):N("v-if",!0),i(Z).truncated?(f(),m("button",{key:2,class:"btn sm ghost messages-more",onClick:re[0]||(re[0]=(...U)=>i(hi)&&i(hi)(...U))},d(i(c)("Show earlier messages")),1)):N("v-if",!0),(f(!0),m(S,null,J(r.value,U=>(f(),m(S,{key:U.key},[U.type==="bubble"?(f(),ae(Ou,{key:0,row:U,thread:i(Z).id},null,8,["row","thread"])):U.type==="steps"?(f(),ae(Mu,{key:1,tools:U.tools},null,8,["tools"])):(f(),ae(Du,{key:2,text:U.text},null,8,["text"]))],64))),128)),C(Au),u.value?(f(),ae(ir,{key:3})):N("v-if",!0),!i(Z).loading&&!r.value.length&&!i(Z).error&&!l.value?(f(),m("div",Bh,d(i(c)("No messages yet. Say something.")),1)):N("v-if",!0)],512)],544),Ee(a("button",{class:"fab","aria-label":i(c)("Scroll to the newest message"),onClick:re[1]||(re[1]=U=>E(!0))},[C(se,{name:"down"}),s.value?(f(),m("span",Fh,d(s.value),1)):N("v-if",!0)],8,Lh),[[$s,!o.value]])]))}});var Uh={key:0,class:"empty"},Hh={key:1,class:"chat"},Kh={key:2,class:"empty"},Ru=O({__name:"ChatView",props:{id:{}},setup(e){let t=e,n=x(()=>tt(t.id)??(Z.id===t.id?Z.thread:null)),o=x(()=>!n.value&&!Z.loading&&Z.id===t.id&&Z.error!=="");ve(()=>t.id,r=>void dc(r),{immediate:!0}),ve(()=>n.value?.unread??0,r=>r>0&&!document.hidden&&fn()),ve(()=>Z.atBottom,r=>r&&!document.hidden&&fn());function s(){document.hidden||fn()}return Re(()=>document.addEventListener("visibilitychange",s)),bt(()=>{document.removeEventListener("visibilitychange",s),fc()}),(r,l)=>o.value?(f(),m("div",Uh,[a("b",null,d(i(c)("This session is not listed")),1),le(" "+d(i(Z).error),1)])):n.value?(f(),m("div",Hh,[C(ku,{thread:n.value},null,8,["thread"]),C(Pu),i(Xl)(n.value)?(f(),ae(Tu,{key:0,thread:n.value},null,8,["thread"])):(f(),ae(zu,{key:1,thread:n.value},null,8,["thread"]))])):(f(),m("div",Kh,[...l[0]||(l[0]=[a("span",{class:"spin"},null,-1)])]))}});var Gh=["aria-label"],jh={class:"members-head"},Wh={class:"members-count"},Xh=["aria-label"],Yh={class:"member-body"},qh={class:"member-name"},Iu=O({__name:"GroupMembers",props:{members:{}},emits:["close"],setup(e){let t=n=>n.me?c("you"):n.status==="working"?c("typing\u2026"):n.online?c("online"):c("offline");return(n,o)=>(f(),m("aside",{class:"members","aria-label":i(c)("Members")},[a("div",jh,[a("b",null,d(i(c)("Members")),1),a("span",Wh,d(e.members.length),1),a("button",{class:"iconbtn","aria-label":i(c)("Close"),onClick:o[0]||(o[0]=s=>n.$emit("close"))},[C(se,{name:"close",size:"sm"})],8,Xh)]),a("ul",null,[(f(!0),m(S,null,J(e.members,s=>(f(),m("li",{key:s.id},[(f(),ae(ht(s.chat?"a":"div"),{class:"member",href:s.chat?i(je)("chats",s.id):void 0},{default:en(()=>[C(et,{thread:{id:s.id,name:s.name,kind:"session",status:s.online?s.status:"dead"},size:"sm"},null,8,["thread"]),a("span",Yh,[a("span",qh,d(s.name),1),a("span",{class:ie(["member-state",{on:s.online}])},d(t(s)),3)])]),_:2},1032,["href"]))]))),128))])],8,Gh))}});var Jh={key:0,class:"empty"},Zh={key:1,class:"chat"},Qh={class:"bar chat-head"},eg=["href","aria-label"],tg=["aria-expanded"],ng={class:"chat-title"},og=["aria-pressed","aria-label","title"],sg={class:"group-body"},rg={class:"chat-bg group-main"},ig={class:"messages-body"},ag={key:0,class:"messages-note"},lg={key:1,class:"errcard"},cg=["disabled"],ug={key:1,class:"msg-avatar"},dg={class:"bubble"},fg={key:0,class:"group-who"},pg={class:"group-time"},mg={key:1,class:"msg-avatar"},hg={key:3,class:"messages-note"},gg={key:0,class:"composer-note"},_g={class:"composer-field"},vg=["placeholder","aria-label"],yg=["disabled","aria-label"],$u=O({__name:"GroupView",props:{name:{}},setup(e){let t=e,n=x(()=>Ri(t.name)),o=x(()=>n.value?qs(n.value):[]),s=x(()=>o.value.filter($=>$.online).length),r=x(()=>pe.status?.gateway.id??""),l=x(()=>n.value?.members.includes(r.value)??!1),u=X(!1),p=X(""),h=X(null),g=X(null),y=X(!0),E=!matchMedia("(pointer: coarse)").matches,z=x(()=>{let $=[];return ge.messages.forEach((H,L)=>{let ze=ge.messages[L-1],ue=ge.messages[L+1],we=(Q,q)=>Q!==void 0&&q!==void 0&&Q.from.session_id===q.from.session_id&&Math.abs(q.ts-Q.ts)<300;$.push({id:H.id,mine:H.from.session_id===r.value,who:Zs(H),senderId:H.from.session_id,text:H.text,time:lu(H.ts*1e3),cont:we(ze,H),tail:!we(H,ue)})}),$});function D(){let $=g.value;return!$||$.scrollHeight-$.scrollTop-$.clientHeight<140}function V($){Ue(()=>g.value?.scrollTo({top:g.value.scrollHeight,behavior:$?"smooth":"auto"}))}ve(()=>t.name,$=>void tu($),{immediate:!0}),ve(()=>ge.messages.length,($,H)=>{(H===0||y.value)&&V(H!==0)},{flush:"post"}),Re(()=>V(!1)),bt(nu);async function W(){let $=p.value.trim();if(!$||ge.sending)return;let H=await su(t.name,$);if(H){xe(H,"bad");return}p.value="",y.value=!0,V(!0),h.value?.focus({preventScroll:!0})}function re($){$.key==="Enter"&&!$.shiftKey&&!$.isComposing&&E&&($.preventDefault(),W())}function U(){let $=h.value;$&&($.style.height="auto",$.style.height=`${Math.min($.scrollHeight,152)}px`)}return ve(p,()=>void Ue(U)),($,H)=>!n.value&&!i(ge).loading?(f(),m("div",Jh,[a("b",null,d(i(c)("This group is not listed")),1),le(" "+d(i(ge).error),1)])):(f(),m("div",Zh,[a("header",Qh,[a("a",{class:"iconbtn back",href:i(je)("chats"),"aria-label":i(c)("Back")},[C(se,{name:"back"})],8,eg),a("button",{class:"chat-who","aria-expanded":u.value,onClick:H[0]||(H[0]=L=>u.value=!u.value)},[C(et,{thread:{id:`#${e.name}`,name:e.name,kind:"external",status:"idle"},size:"sm"},null,8,["thread"]),a("span",ng,[a("b",null,"#"+d(e.name),1),a("span",null,d(i(c)("{count} members",{count:o.value.length}))+" \xB7 "+d(i(c)("{count} online",{count:s.value})),1)])],8,tg),a("button",{class:"iconbtn","aria-pressed":u.value,"aria-label":i(c)("Members"),title:i(c)("Members"),onClick:H[1]||(H[1]=L=>u.value=!u.value)},[C(se,{name:"users"})],8,og)]),a("div",sg,[a("div",rg,[a("div",{ref_key:"scroller",ref:g,class:"messages",role:"log","aria-live":"polite",onScrollPassive:H[3]||(H[3]=L=>y.value=D())},[a("div",ig,[i(ge).loading?(f(),m("div",ag,[...H[7]||(H[7]=[a("span",{class:"spin"},null,-1)])])):i(ge).error?(f(),m("div",lg,d(i(ge).error),1)):N("v-if",!0),i(ge).more?(f(),m("button",{key:2,class:"btn sm ghost messages-more",disabled:i(ge).loadingOlder,onClick:H[2]||(H[2]=(...L)=>i(Ii)&&i(Ii)(...L))},d(i(c)("Show earlier messages")),9,cg)):N("v-if",!0),(f(!0),m(S,null,J(z.value,L=>(f(),m("div",{key:L.id,class:ie(["msg",[L.mine?"out":"in",{cont:L.cont}]])},[L.mine?N("v-if",!0):(f(),m(S,{key:0},[L.tail?(f(),ae(et,{key:0,class:"msg-avatar",thread:{id:L.senderId,name:L.who,kind:"external",status:"idle"},size:"sm"},null,8,["thread"])):(f(),m("div",ug))],64)),a("div",dg,[!L.mine&&!L.cont?(f(),m("span",fg,d(L.who),1)):N("v-if",!0),C(po,{text:L.text},null,8,["text"]),a("span",pg,d(L.time),1)]),L.mine?(f(),m(S,{key:1},[L.tail?(f(),ae(fo,{key:0,class:"msg-avatar",size:"sm"})):(f(),m("div",mg))],64)):N("v-if",!0)],2))),128)),!i(ge).loading&&!z.value.length&&!i(ge).error?(f(),m("div",hg,d(i(c)("Nothing has been said in this group yet.")),1)):N("v-if",!0)])],544)]),u.value?(f(),ae(Iu,{key:0,members:o.value,onClose:H[4]||(H[4]=L=>u.value=!1)},null,8,["members"])):N("v-if",!0)]),l.value?N("v-if",!0):(f(),m("div",gg,d(i(c)("You are not in this group. Writing here adds you to it.")),1)),a("form",{class:"composer",onSubmit:Ye(W,["prevent"])},[a("div",_g,[Ee(a("textarea",{ref_key:"field",ref:h,"onUpdate:modelValue":H[5]||(H[5]=L=>p.value=L),rows:"1",placeholder:i(c)("Message"),"aria-label":i(c)("Message"),enterkeyhint:"send",onKeydown:re},null,40,vg),[[Ae,p.value]])]),a("button",{class:"sendbtn",type:"submit",disabled:!p.value.trim()||i(ge).sending,"aria-label":i(c)("Send"),onPointerdown:H[6]||(H[6]=Ye(()=>{},["prevent"]))},[C(se,{name:"send"})],40,yg)],32)]))}});var bg={class:"gp"},kg={class:"gp-stats"},xg=["aria-label"],wg={class:"gp-key"},Eg={class:"gp-key"},Ng={class:"gp-key"},Sg={class:"gp-key"},Cg={class:"gp-key"},Tg={class:"gp-key"},zg={class:"gp-head"},Vg=["title","aria-label"],Og={key:0,class:"gp-none"},Dg=["title","onClick","onMouseenter","onFocus"],Mg={key:0,class:"gp-av gp-hash","aria-hidden":"true"},Ag={class:"gp-body"},Pg={class:"gp-line"},Rg={key:0,class:"gp-tag"},Ig={class:"gp-text"},$g={key:0,class:"gp-end",role:"status"},Bg={class:"gp-card-head"},Lg={key:0,class:"gp-tag"},Fg={class:"gp-card-row"},Ug={class:"gp-card-row"},Hg={class:"gp-card-row"},Kg={key:0,class:"gp-card-row"},Gg={key:1,class:"gp-card-row"},jg={key:2,class:"gp-card-row"},Wg={class:"gp-card-text"},ar=O({__name:"GraphPanel",emits:["pick"],setup(e,{emit:t}){let n=t,o=x(()=>M.mode==="replay"&&!!gn.value);function s(q){if(o.value){wt(q.ts),n("pick");return}Xs(q),n("pick")}let r=X(Date.now()/1e3),l;Re(()=>l=setInterval(()=>r.value=Date.now()/1e3,5e3)),Mn(()=>clearInterval(l));let u=x(()=>{let q=gn.value?.shown;return q?q.slice(-200).reverse():[...oe.feed].reverse()}),p=x(()=>zc(oe)),h=X(null);function g(){let q=h.value;return!!q&&q.scrollHeight-q.scrollTop-q.clientHeight<120}function y(){!o.value&&oe.more&&g()&&zi()}ve(()=>[oe.feed.length,oe.more,o.value],()=>Ue(y)),Re(()=>Ue(y));let E=X(null),z=X(null),D,V;function W(q,te){clearTimeout(V);let fe=te.currentTarget.getBoundingClientRect();D=setTimeout(()=>{E.value={message:q,x:fe.right+10,y:fe.top},Ue($)},E.value?0:280)}function re(){clearTimeout(V)}function U(){clearTimeout(D),V=setTimeout(()=>E.value=null,90)}function $(){let q=z.value,te=E.value;if(!q||!te)return;let fe=Ls({x:te.x,y:te.y},{width:q.offsetWidth,height:q.offsetHeight},{width:innerWidth,height:innerHeight},0,8);q.style.left=`${fe.x}px`,q.style.top=`${fe.y}px`}function H(q){return q.recipients.map(te=>Jo(hn.value,te)?.handle||te.slice(0,8)).join(", ")}function L(q){return new Date(q*1e3).toLocaleString()}function ze(q){return q.recipients.length}function ue(q){return`hsl(${Fs(q.to.name??"")} 70% 48%)`}function we(q){let te=r.value-q;return o.value?mn(q):te<5?c("just now"):c("{time} ago",{time:_n(te)})}function Q(q){let[te,fe]=Zo[lo(q)];return`linear-gradient(160deg, ${te}, ${fe})`}return(q,te)=>(f(),m("div",bg,[a("div",kg,[a("div",null,[a("b",null,d(p.value.sessions),1),a("span",null,d(i(c)("Sessions")),1)]),a("div",null,[a("b",null,d(p.value.groups),1),a("span",null,d(i(c)("Groups")),1)]),a("div",null,[a("b",null,d(p.value.messages),1),a("span",null,d(i(c)("Messages")),1)])]),a("div",{class:"gp-legend","aria-label":i(c)("Legend")},[a("span",wg,[te[2]||(te[2]=a("i",{class:"sw via-user"},null,-1)),le(d(i(c)("User")),1)]),a("span",Eg,[te[3]||(te[3]=a("i",{class:"sw via-agent"},null,-1)),le(d(i(c)("Agent")),1)]),a("span",Ng,[te[4]||(te[4]=a("i",{class:"sw via-external"},null,-1)),le(d(i(c)("External")),1)]),a("span",Sg,[te[5]||(te[5]=a("i",{class:"ring idle"},null,-1)),le(d(i(c)("Idle")),1)]),a("span",Cg,[te[6]||(te[6]=a("i",{class:"ring working"},null,-1)),le(d(i(c)("Working")),1)]),a("span",Tg,[te[7]||(te[7]=a("i",{class:"hull"},null,-1)),le(d(i(c)("Group")),1)])],8,xg),a("div",zg,[a("h3",null,d(o.value?i(c)("Messages so far"):i(c)("Live messages")),1),u.value.length&&!o.value?(f(),m("button",{key:0,class:"iconbtn gp-replay",title:i(c)("Replay the last message"),"aria-label":i(c)("Replay the last message"),onClick:te[0]||(te[0]=fe=>s(u.value[0]))},[C(se,{name:"refresh",size:"sm"})],8,Vg)):N("v-if",!0)]),u.value.length?(f(),m("ol",{key:1,ref_key:"list",ref:h,class:"gp-feed",onScrollPassive:y},[(f(!0),m(S,null,J(u.value,fe=>(f(),m("li",{key:fe.id},[a("button",{class:ie(["gp-item",{"is-group":fe.to.kind==="group"}]),style:Me(fe.to.kind==="group"?{"--grp":ue(fe)}:void 0),title:o.value?i(c)("Go to this message"):i(c)("Replay"),onClick:Be=>s(fe),onMouseenter:Be=>W(fe,Be),onMouseleave:U,onFocus:Be=>W(fe,Be),onBlur:U},[fe.to.kind==="group"?(f(),m("span",Mg,"#")):(f(),m("span",{key:1,class:"gp-av",style:Me({background:Q(fe.from.session_id)})},null,4)),a("span",Ag,[a("span",Pg,[a("b",null,d(i($n)(fe)),1),te[8]||(te[8]=a("span",{class:"gp-arrow"},"\u2192",-1)),a("b",{class:ie({grp:fe.to.kind==="group"})},d(i(In)(fe)),3),fe.to.kind==="group"?(f(),m("span",Rg,d(i(c)("Group"))+" \xB7 "+d(ze(fe)),1)):N("v-if",!0),a("span",{class:ie(["gp-via",`via-${fe.via}`])},d(i(c)(fe.via)),3),a("time",null,d(we(fe.ts)),1)]),a("span",Ig,d(i(qo)(fe,120)),1)])],46,Dg)]))),128)),o.value?N("v-if",!0):(f(),m("li",$g,[i(oe).loadingOlder?(f(),m(S,{key:0},[le(d(i(c)("Loading earlier messages\u2026")),1)],64)):i(oe).olderFailed?(f(),m("button",{key:1,class:"gp-retry",onClick:te[1]||(te[1]=fe=>i(zi)())},d(i(c)("Could not load earlier messages. Retry")),1)):i(oe).more?N("v-if",!0):(f(),m(S,{key:2},[le(d(i(c)("That is the start of the history.")),1)],64))]))],544)):(f(),m("div",Og,d(o.value?i(c)("Nothing has been sent yet at this point."):i(c)("No messages yet. Traffic between sessions shows up here as it happens.")),1)),(f(),ae(Cs,{to:"body"},[E.value?(f(),m("div",{key:0,ref_key:"cardEl",ref:z,class:ie(["gp-card",{"is-group":E.value.message.to.kind==="group"}]),style:Me({"--grp":ue(E.value.message)}),role:"tooltip",onMouseenter:re,onMouseleave:U},[a("div",Bg,[a("b",null,d(i($n)(E.value.message)),1),te[9]||(te[9]=a("span",{class:"gp-arrow"},"\u2192",-1)),a("b",null,d(i(In)(E.value.message)),1),E.value.message.to.kind==="group"?(f(),m("span",Lg,d(i(c)("Group")),1)):N("v-if",!0)]),a("div",Fg,[a("span",null,d(i(c)("Time")),1),a("span",null,d(L(E.value.message.ts)),1)]),a("div",Ug,[a("span",null,d(i(c)("Via")),1),a("span",null,d(i(c)(E.value.message.via)),1)]),a("div",Hg,[a("span",null,d(i(c)("Mode")),1),a("span",null,d(i(c)(E.value.message.mode))+" \xB7 "+d(i(c)(E.value.message.status)),1)]),E.value.message.hops?(f(),m("div",Kg,[a("span",null,d(i(c)("Hops")),1),a("span",null,d(E.value.message.hops),1)])):N("v-if",!0),E.value.message.disposition?(f(),m("div",Gg,[a("span",null,d(i(c)("Taken as")),1),a("span",null,d(i(c)(E.value.message.disposition)),1)])):N("v-if",!0),E.value.message.recipients.length?(f(),m("div",jg,[a("span",null,d(i(c)("Reached")),1),a("span",null,d(H(E.value.message)),1)])):N("v-if",!0),a("div",Wg,d(i(Hs)(E.value.message)),1)],38)):N("v-if",!0)]))]))}});var Bu=O({__name:"GraphPane",setup(e){return(t,n)=>(f(),m(S,null,[C(Gt,{title:i(c)("Graph")},null,8,["title"]),C(ar)],64))}});var lr=e=>String(e).padStart(2,"0");function Qo(e){let t=new Date(e*1e3);return`${t.getFullYear()}-${lr(t.getMonth()+1)}-${lr(t.getDate())}T${lr(t.getHours())}:${lr(t.getMinutes())}`}function Gi(e){if(!e)return null;let t=new Date(e).getTime();return Number.isFinite(t)?t/1e3:null}function Lu(e,t){return e.duration>0?Math.min(1,Math.max(0,(t-e.start)/e.duration)):0}function Fu(e,t){return e.start+Math.min(1,Math.max(0,t))*e.duration}function Uu(e,t,n){if(n===1)return e.messages.find(o=>o.ts>t)?.ts??e.end;for(let o=e.messages.length-1;o>=0;o-=1){let s=e.messages[o];if(s.ts<t-1e-6)return s.ts}return e.start}function Hu(e,t,n){let o=new Map(n.map(r=>[r.session_id,r])),s=new Map;for(let r of e.messages)s.set(r.from.session_id,{handle:r.from.handle,title:r.from.title}),r.to.session_id&&r.to.handle&&s.set(r.to.session_id,{handle:r.to.handle,title:r.to.title??""});return[...t.sessionIds].sort().map(r=>{let l=o.get(r);if(l)return{...l,ghost:!1};let u=s.get(r);return{session_id:r,handle:u?.handle||Yo(r),title:u?.title??"",workspace:"",status:"idle",kind:"external",ghost:!0}})}function Ku(e,t,n){let o=n.map(r=>({...r})),s=new Set(n.map(r=>r.name));for(let r of t){if(s.has(r))continue;let l=new Set;for(let u of e)if(!(u.to.kind!=="group"||u.to.name!==r)){l.add(u.from.session_id);for(let p of u.recipients)l.add(p)}o.push({name:r,members:[...l],created:0})}return o}var cr=class{packets=[];pulses=[];counter=0;duration;trail;maxPackets;constructor(t={}){this.duration=t.duration??900,this.trail=t.trail??6,this.maxPackets=t.maxPackets??60}get busy(){return this.packets.length>0||this.pulses.length>0}get inFlight(){return this.packets.length}clear(){this.packets=[],this.pulses=[]}spawn(t,n,o=!1){let s=t.from.session_id,r=pn(t),l=t.to.kind==="group"?t.to.name:void 0,u=(h,g,y,E,z)=>{this.counter+=1,this.pulses.push({key:`p${this.counter}`,kind:h,target:g,other:z,via:t.via,start:y,duration:E,grow:!o})};u("flash",s,n,520),l&&u("hull",l,n,this.duration);let p=0;for(let h of r)!o&&this.packets.length<this.maxPackets?(this.counter+=1,this.packets.push({key:`k${this.counter}`,message:t,from:s,to:h,start:n}),p+=1,u("ripple",h,n+this.duration,760)):u("ripple",h,n,760),l||u("edge",s,n,o?700:this.duration+200,h);return p}step(t,n){this.packets=this.packets.filter(r=>t<r.start+this.duration),this.pulses=this.pulses.filter(r=>t<r.start+r.duration);let o=[];for(let r of this.packets){let l=n(r.from,r.to);if(!l)continue;let u=(t-r.start)/this.duration,p=bi(l,xi(u)),h=[];for(let g=1;g<=this.trail;g+=1){let y=bi(l,xi(u-g*.04)),E=1-g/(this.trail+1);h.push({x:y.x,y:y.y,alpha:E*.5,scale:E})}o.push({key:r.key,message:r.message,from:r.from,to:r.to,via:r.message.via,x:p.x,y:p.y,trail:h})}let s=[];for(let r of this.pulses)t<r.start||s.push({key:r.key,kind:r.kind,target:r.target,other:r.other,via:r.via,progress:(t-r.start)/r.duration,grow:r.grow});return{packets:o,pulses:s}}};var Xg={class:"bar page-bar"},Yg=["href","aria-label"],jt=O({__name:"PageBar",props:{title:{},back:{type:Boolean}},setup(e){return(t,n)=>(f(),m("header",Xg,[e.back?(f(),m("a",{key:0,class:"iconbtn back",href:i(je)(i(ye).nav),"aria-label":i(c)("Back")},[C(se,{name:"back"})],8,Yg)):N("v-if",!0),a("h2",null,d(e.title),1),Ts(t.$slots,"default")]))}});var qg={key:0,class:"gt"},Jg={class:"gt-head"},Zg={key:0,class:"gt-chip"},Qg={key:0,class:"gt-sub"},e_={key:1,class:"gt-row"},t_={class:"gt-row"},n_={class:"gt-row"},o_={key:0,class:"gt-row"},s_={key:1,class:"gt-msg"},r_={class:"gt-meta"},i_={key:1,class:"gt"},a_={class:"gt-head"},l_={class:"gt-row"},c_={class:"gt-row"},u_={class:"gt-meta"},d_={key:2,class:"gt"},f_={class:"gt-head"},p_={class:"gt-chip"},m_={class:"gt-members"},h_={key:3,class:"gt"},g_={class:"gt-head"},__={class:"gt-row"},v_={class:"gt-row"},y_={class:"gt-row"},b_={key:0,class:"gt-row"},k_={class:"gt-msg gt-full"},Gu=O({__name:"GraphTip",props:{tip:{},now:{}},setup(e){let t=e;function n(h){let g=t.now-h;return g<5?c("just now"):c("{time} ago",{time:_n(g)})}function o(h){return Jo(hn.value,h)?.handle||h.slice(0,8)}let s=x(()=>t.tip.kind==="node"?Jo(hn.value,t.tip.id):void 0),r=x(()=>t.tip.kind==="node"?Cc(oe,t.tip.id):null),l=x(()=>t.tip.kind==="edge"?Oc(oe,t.tip.a,t.tip.b):void 0),u=x(()=>t.tip.kind==="edge"?Tc(oe,t.tip.a,t.tip.b,3):[]),p=x(()=>t.tip.kind==="group"?Vc(oe,t.tip.name):void 0);return(h,g)=>e.tip.kind==="node"&&s.value?(f(),m("div",qg,[a("div",Jg,[a("b",null,d(s.value.handle),1),a("span",{class:ie(["gt-chip",s.value.status])},d(s.value.ghost?i(c)("offline"):i(c)(s.value.status)),3),s.value.kind==="external"?(f(),m("span",Zg,d(i(c)("external")),1)):N("v-if",!0)]),s.value.title?(f(),m("div",Qg,d(s.value.title),1)):N("v-if",!0),s.value.workspace?(f(),m("div",e_,[a("span",null,d(i(c)("Workspace")),1),a("span",null,d(i(vn)(s.value.workspace)),1)])):N("v-if",!0),r.value?(f(),m(S,{key:2},[a("div",t_,[a("span",null,d(i(c)("Sent / received")),1),a("span",null,d(r.value.sent)+" / "+d(r.value.received),1)]),a("div",n_,[a("span",null,d(i(c)("1:1 messages")),1),a("span",null,d(r.value.exchanged),1)]),r.value.groups.length?(f(),m("div",o_,[a("span",null,d(i(c)("Groups")),1),a("span",null,d(r.value.groups.map(y=>`#${y}`).join(", ")),1)])):N("v-if",!0),r.value.last?(f(),m("div",s_,[a("span",r_,d(n(r.value.last.ts))+" \xB7 "+d(i($n)(r.value.last))+" \u2192 "+d(i(In)(r.value.last)),1),le(" "+d(i(qo)(r.value.last,140)),1)])):N("v-if",!0)],64)):N("v-if",!0)])):e.tip.kind==="edge"&&l.value?(f(),m("div",i_,[a("div",a_,[a("b",null,d(o(l.value.a)),1),g[0]||(g[0]=a("span",{class:"gt-arrow"},"\u2194",-1)),a("b",null,d(o(l.value.b)),1)]),a("div",l_,[a("span",null,d(i(c)("Messages")),1),a("span",null,d(l.value.count),1)]),a("div",c_,[a("span",null,d(i(c)("Last")),1),a("span",null,d(n(l.value.last)),1)]),(f(!0),m(S,null,J(u.value,y=>(f(),m("div",{key:y.id,class:"gt-msg"},[a("span",u_,d(n(y.ts))+" \xB7 "+d(i($n)(y))+" \u2192 "+d(i(In)(y)),1),le(" "+d(i(qo)(y,110)),1)]))),128))])):e.tip.kind==="group"&&p.value?(f(),m("div",d_,[a("div",f_,[a("b",null,"#"+d(p.value.name),1),a("span",p_,d(i(c)("{n} members",{n:p.value.members.length})),1)]),a("div",m_,[(f(!0),m(S,null,J(p.value.members,y=>(f(),m("span",{key:y,class:"gt-chip"},d(o(y)),1))),128))])])):e.tip.kind==="packet"?(f(),m("div",h_,[a("div",g_,[a("b",null,d(i($n)(e.tip.message)),1),g[1]||(g[1]=a("span",{class:"gt-arrow"},"\u2192",-1)),a("b",null,d(i(In)(e.tip.message)),1)]),a("div",__,[a("span",null,d(i(c)("Via")),1),a("span",null,d(i(c)(e.tip.message.via)),1)]),a("div",v_,[a("span",null,d(i(c)("Time")),1),a("span",null,d(new Date(e.tip.message.ts*1e3).toLocaleTimeString()),1)]),a("div",y_,[a("span",null,d(i(c)("Mode")),1),a("span",null,d(i(c)(e.tip.message.mode))+" \xB7 "+d(i(c)(e.tip.message.status)),1)]),e.tip.message.hops?(f(),m("div",b_,[a("span",null,d(i(c)("Hops")),1),a("span",null,d(e.tip.message.hops),1)])):N("v-if",!0),a("div",k_,d(i(Hs)(e.tip.message)),1)])):N("v-if",!0)}});var x_=["aria-label"],w_={class:"rb-row"},E_={class:"rb-title"},N_={class:"rb-hint"},S_=["aria-label"],C_=["aria-label"],T_=["disabled","onClick"],z_={class:"rb-custom"},V_=["disabled"],O_={key:0,class:"rb-err",role:"alert"},D_={class:"rb-card rb-panel"},M_=["aria-label"],A_={key:1,class:"rb-row rb-bad",role:"alert"},P_={class:"rb-errtext"},R_={key:2,class:"rb-row"},I_={class:"rb-emptytext"},$_={key:0,class:"rb-cut",role:"status"},B_={class:"rb-main"},L_={class:"rb-ctl"},F_=["aria-label","title"],U_=["aria-label","title"],H_=["aria-label","title"],K_={key:0,viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},G_={key:1,viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},j_=["aria-label","title"],W_={class:"rb-clock","aria-hidden":"true"},X_={class:"rb-opts"},Y_={class:"rb-speed"},q_=["value","aria-label"],J_=["value"],Z_={value:"fit"},Q_=["aria-checked"],ev={key:0,class:"rb-skipped"},tv={class:"rb-scrub"},nv={class:"rb-end"},ov=["aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext"],sv={class:"rb-hist","aria-hidden":"true"},rv={class:"rb-rail","aria-hidden":"true"},iv={class:"rb-end"},ju=O({__name:"ReplayBar",setup(e){let t=X(!1),n=X("1h"),o=X(""),s=X(""),r=X(!1),l="1h";function u(){let ee=Date.now()/1e3;o.value=Qo(ee-3600),s.value=Qo(ee)}u();let p={"15m":"15 min","1h":"1 h","24h":"24 h","7d":"7 d",all:"All stored"};function h(ee){n.value=ee;let F=Ks.find(ce=>ce.id===ee)?.seconds;if(F){let ce=Date.now()/1e3;o.value=Qo(ce-F),s.value=Qo(ce)}}async function g(ee){l=ee,r.value=!0;try{if(typeof ee=="string"){let F=Date.now()/1e3,ce=null;if(ee==="all")try{ce=(await ke.timeline(0,F,1)).span}catch{ce=null}let st=Mc(ee,F,ce);await Vi(st.since,st.until)}else await Vi(ee[0],ee[1])}finally{r.value=!1}}let y=X("");function E(){let ee=Gi(o.value),F=Gi(s.value);if(ee===null||F===null||F<=ee){y.value=c("Choose a start before the end.");return}y.value="",g([ee,F])}function z(ee){h(ee),g(ee)}function D(){g(l)}ve(()=>M.mode,ee=>{ee==="live"&&(t.value=!1)});let V=x(()=>M.mode==="replay"&&M.status==="ready"&&M.replay),W=x(()=>V.value&&M.replay.messages.length===0),re=x(()=>M.replay?Lu(M.replay,M.playhead):0),U=x(()=>M.playhead?mn(M.playhead):"--:--:--"),$=x(()=>M.playhead?new Date(M.playhead*1e3).toLocaleDateString():""),H=x(()=>{if(!M.replay)return[];let ee=Bc(M.replay,80),F=Math.max(1,...ee);return ee.map(ce=>ce?.14+.86*ce/F:0)}),L=x(()=>!M.replay||!M.skipSilence?0:Gs(M.replay,M.speed,!0).skippedBefore(M.playhead)),ze=[1,5,10,20,30,40,50,60,600],ue=x(()=>ze.includes(M.speed)?String(M.speed):"fit");function we(ee){let F=ee.target.value;F==="fit"?qc():Yc(Number(F))}function Q(){M.playing?Di():Oi()}function q(){M.replay&&wt(M.replay.start)}function te(ee){M.replay&&wt(Uu(M.replay,M.playhead,ee))}let fe=X(null),Be=be({on:!1,resume:!1});function Et(ee){let F=fe.value?.getBoundingClientRect();!F||!M.replay||F.width<=0||wt(Fu(M.replay,(ee.clientX-F.left)/F.width))}function Mt(ee){ee.button===0&&(Be.on=!0,Be.resume=M.playing,Di(),ee.currentTarget.setPointerCapture(ee.pointerId),Et(ee))}function Fn(ee){Be.on&&Et(ee)}function kn(){Be.on&&(Be.on=!1,Be.resume&&Oi())}function xn(ee){let F=M.replay;if(!F)return;let ce=ee.shiftKey?.1:.01,st=!0;ee.key==="ArrowLeft"||ee.key==="ArrowDown"?wt(M.playhead-F.duration*ce):ee.key==="ArrowRight"||ee.key==="ArrowUp"?wt(M.playhead+F.duration*ce):ee.key==="Home"?wt(F.start):ee.key==="End"?wt(F.end):ee.key==="PageUp"?wt(M.playhead-F.duration*.1):ee.key==="PageDown"?wt(M.playhead+F.duration*.1):st=!1,st&&(ee.preventDefault(),ee.stopPropagation())}let wn=x(()=>`${$.value} ${U.value}`);function En(ee){let F=ee;return!F||!F.tagName?!1:F.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(F.tagName)}function We(ee){if(!(M.mode!=="replay"||En(ee.target)||ee.ctrlKey||ee.metaKey||ee.altKey))if(ee.key==="Escape")xt();else if(V.value)if(ee.key===" "||ee.code==="Space"){if(ee.target?.tagName==="BUTTON")return;ee.preventDefault(),Q()}else ee.key==="ArrowLeft"?(ee.preventDefault(),te(-1)):ee.key==="ArrowRight"&&(ee.preventDefault(),te(1));else return}return Re(()=>window.addEventListener("keydown",We)),Mn(()=>window.removeEventListener("keydown",We)),(ee,F)=>(f(),m("div",{class:ie(["rb",{replay:i(M).mode==="replay"}])},[N(" live: a button that opens the range picker "),i(M).mode==="live"?(f(),m(S,{key:0},[t.value?(f(),m("div",{key:0,class:"rb-card rb-picker",role:"group","aria-label":i(c)("Replay")},[a("div",w_,[a("b",E_,d(i(c)("Replay")),1),a("span",N_,d(i(c)("Watch stored traffic again. Nothing is sent.")),1),a("button",{class:"iconbtn rb-x","aria-label":i(c)("Close"),onClick:F[0]||(F[0]=ce=>t.value=!1)},[...F[12]||(F[12]=[a("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[a("path",{d:"M6 6l12 12M18 6 6 18"})],-1)])],8,S_)]),a("div",{class:"rb-chips",role:"group","aria-label":i(c)("Period")},[(f(!0),m(S,null,J(i(Ks),ce=>(f(),m("button",{key:ce.id,class:ie(["rb-chip",{on:n.value===ce.id}]),disabled:r.value,onClick:st=>z(ce.id)},d(i(c)(p[ce.id])),11,T_))),128))],8,C_),a("div",z_,[a("label",null,[le(d(i(c)("From")),1),Ee(a("input",{"onUpdate:modelValue":F[1]||(F[1]=ce=>o.value=ce),type:"datetime-local",onInput:F[2]||(F[2]=ce=>n.value="")},null,544),[[Ae,o.value]])]),a("label",null,[le(d(i(c)("To")),1),Ee(a("input",{"onUpdate:modelValue":F[3]||(F[3]=ce=>s.value=ce),type:"datetime-local",onInput:F[4]||(F[4]=ce=>n.value="")},null,544),[[Ae,s.value]])]),a("button",{class:"btn ghost sm",disabled:r.value,onClick:E},d(i(c)("Load")),9,V_)]),y.value?(f(),m("div",O_,d(y.value),1)):N("v-if",!0)],8,x_)):(f(),m("button",{key:1,class:"rb-open",onClick:F[5]||(F[5]=ce=>t.value=!0)},[F[13]||(F[13]=a("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},[a("path",{d:"M8 5.5v13a1 1 0 0 0 1.5.86l10.5-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z"})],-1)),le(" "+d(i(c)("Replay")),1)]))],64)):(f(),m(S,{key:1},[N(" replay "),a("div",D_,[i(M).status==="loading"?(f(),m("div",{key:0,class:"rb-skel",role:"status","aria-label":i(c)("Loading\u2026")},[F[14]||(F[14]=a("i",{class:"sk a"},null,-1)),F[15]||(F[15]=a("i",{class:"sk b"},null,-1)),F[16]||(F[16]=a("i",{class:"sk c"},null,-1)),a("span",null,d(i(c)("Loading stored messages\u2026")),1)],8,M_)):i(M).status==="error"?(f(),m("div",A_,[a("span",P_,[le(d(i(c)("Cannot load the replay."))+" ",1),a("small",null,d(i(M).error),1)]),a("button",{class:"btn ghost sm",onClick:D},d(i(c)("Retry")),1),a("button",{class:"btn sm rb-plain",onClick:F[6]||(F[6]=(...ce)=>i(xt)&&i(xt)(...ce))},d(i(c)("Back to live")),1)])):W.value?(f(),m("div",R_,[a("span",I_,d(i(c)("No messages in this period")),1),a("button",{class:"btn ghost sm",onClick:F[7]||(F[7]=(...ce)=>i(xt)&&i(xt)(...ce))},d(i(c)("Back to live")),1)])):V.value&&i(M).replay?(f(),m(S,{key:3},[i(M).truncated?(f(),m("div",$_,d(i(c)("This period holds more messages than can be shown, so its first part is missing. Choose a shorter period to see all of it.")),1)):N("v-if",!0),a("div",B_,[a("div",L_,[a("button",{class:"rb-btn","aria-label":i(c)("Restart"),title:i(c)("Restart"),onClick:q},[...F[17]||(F[17]=[a("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"currentColor"},[a("path",{d:"M6 5h2v14H6zM19 5.7v12.6a.8.8 0 0 1-1.25.66l-8.6-6.3a.8.8 0 0 1 0-1.32l8.6-6.3A.8.8 0 0 1 19 5.7Z"})],-1)])],8,F_),a("button",{class:"rb-btn","aria-label":i(c)("Previous message"),title:i(c)("Previous message"),onClick:F[8]||(F[8]=ce=>te(-1))},[...F[18]||(F[18]=[a("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},[a("path",{d:"m15 6-6 6 6 6"})],-1)])],8,U_),a("button",{class:"rb-btn big","aria-label":i(M).playing?i(c)("Pause"):i(c)("Play"),title:i(M).playing?i(c)("Pause"):i(c)("Play"),onClick:Q},[i(M).playing?(f(),m("svg",K_,[...F[19]||(F[19]=[a("path",{d:"M7 5h3.5v14H7zM13.5 5H17v14h-3.5z"},null,-1)])])):(f(),m("svg",G_,[...F[20]||(F[20]=[a("path",{d:"M8 5.5v13a1 1 0 0 0 1.5.86l10.5-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z"},null,-1)])]))],8,H_),a("button",{class:"rb-btn","aria-label":i(c)("Next message"),title:i(c)("Next message"),onClick:F[9]||(F[9]=ce=>te(1))},[...F[21]||(F[21]=[a("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},[a("path",{d:"m9 6 6 6-6 6"})],-1)])],8,j_)]),a("div",W_,[a("b",null,d(U.value),1),a("small",null,d($.value),1)]),a("div",X_,[a("label",Y_,[a("span",null,d(i(c)("Speed")),1),a("select",{value:ue.value,"aria-label":i(c)("Speed"),onChange:we},[(f(),m(S,null,J(ze,ce=>a("option",{key:ce,value:String(ce)},d(ce)+"x",9,J_)),64)),a("option",Z_,d(i(c)("Fit 30 s")),1)],40,q_)]),a("button",{class:ie(["rb-toggle",{on:i(M).skipSilence}]),role:"switch","aria-checked":i(M).skipSilence,onClick:F[10]||(F[10]=(...ce)=>i(Mi)&&i(Mi)(...ce))},[F[22]||(F[22]=a("i",null,null,-1)),le(" "+d(i(c)("Skip silence")),1)],10,Q_),L.value>=1?(f(),m("span",ev,d(i(c)("skipped {time}",{time:i(Lc)(L.value)})),1)):N("v-if",!0)]),a("button",{class:"btn ghost sm rb-exit",onClick:F[11]||(F[11]=(...ce)=>i(xt)&&i(xt)(...ce))},d(i(c)("Back to live")),1)]),a("div",tv,[a("time",nv,d(i(mn)(i(M).replay.start)),1),a("div",{ref_key:"track",ref:fe,class:"rb-track",role:"slider",tabindex:"0","aria-label":i(c)("Playhead"),"aria-orientation":"horizontal","aria-valuemin":Math.round(i(M).replay.start),"aria-valuemax":Math.round(i(M).replay.end),"aria-valuenow":Math.round(i(M).playhead),"aria-valuetext":wn.value,onPointerdown:Mt,onPointermove:Fn,onPointerup:kn,onPointercancel:kn,onKeydown:xn},[a("div",sv,[(f(!0),m(S,null,J(H.value,(ce,st)=>(f(),m("i",{key:st,style:Me({height:`${ce*100}%`})},null,4))),128))]),a("div",rv,[a("i",{style:Me({width:`${re.value*100}%`})},null,4)]),a("div",{class:ie(["rb-knob",{drag:Be.on}]),style:Me({left:`${re.value*100}%`}),"aria-hidden":"true"},null,6)],40,ov),a("time",iv,d(i(mn)(i(M).replay.end)),1)])],64)):N("v-if",!0)])],2112))],2))}});var av={class:"gv-summary"},lv=["disabled","title","aria-label"],cv=["aria-label"],uv=["aria-label","viewBox","width","height"],dv=["id"],fv=["stop-color"],pv=["stop-color"],mv=["id"],hv={class:"gv-hulls"},gv=["d"],_v=["d","onMouseenter"],vv=["d"],yv={class:"gv-edges"},bv=["d"],kv=["d","onMouseenter"],xv={class:"gv-glows"},wv=["d"],Ev=["d"],Nv={class:"gv-nodes"},Sv=["transform","aria-label","onMouseenter","onFocus"],Cv=["r","fill"],Tv=["r"],zv=["r"],Vv=["r","fill"],Ov=["transform"],Dv=["y"],Mv={class:"gv-pills"},Av=["transform","onMouseenter"],Pv=["x","width"],Rv={dy:"0.35em"},Iv={class:"gv-fx"},$v=["cx","cy","r"],Bv=["cx","cy","r"],Lv=["transform"],Fv=["fill"],Uv=["onMouseenter"],Hv={key:2,class:"gv-badge",role:"status"},Kv={key:3,class:"gv-banner bad"},Gv={key:4,class:"gv-banner"},jv={key:5,class:"gv-empty"},Wv=["aria-label"],Xv=["aria-label"],Wu=8,Xu=O({__name:"GraphView",setup(e){let t=X(null),n=X(null),o=be({width:0,height:0}),s=X(Date.now()/1e3),r=X(!1),l=x(()=>{let k=M.mode==="replay";return{top:k?56:0,bottom:k?u.value?150:138:64}}),u=x(()=>Math.min(o.width,o.height)<520),p=x(()=>u.value?18:22),h=x(()=>M.mode==="replay"&&!!gn.value),g=x(()=>{let k=gn.value;return k&&M.replay?Hu(M.replay,k,oe.sessions):hn.value}),y=x(()=>gn.value?.edges??oe.edges),E=x(()=>{let k=gn.value;return k?Ku(k.shown,k.groupsTouched,oe.groups):oe.groups}),z=x(()=>vc(g.value.map(k=>k.session_id),o,u.value?66:100,l.value)),D=Vo(new Map),V=Vo({packets:[],pulses:[]}),W=new cr,re=0,U=0,$=!0,H=0,L=!1,ze=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function ue(k){return D.value.get(k)??z.value.get(k)}function we(k,w){let b=ue(k),B=ue(w);return b&&B?yi(k,b,w,B):null}function Q(){re||document.hidden||(U=performance.now(),re=requestAnimationFrame(q))}function q(k){re=0;let w=Math.min(.05,Math.max(0,(k-U)/1e3));U=k;let b=!1,B=new Map;for(let[he,me]of z.value){let $e=D.value.get(he);if(!$e){B.set(he,me);continue}let Le=wi($e.x,me.x,w),rt=wi($e.y,me.y,w);(Le!==me.x||rt!==me.y)&&(b=!0),B.set(he,{x:Le,y:rt})}D.value=B;let ne=!1;if(M.mode==="replay"&&M.playing&&!document.hidden){ne=!0,L=!0;let he=Jc(w);L=!1,H=M.playhead;for(let me of he.slice(-Wu))te(me)}W.busy?V.value=W.step(k,we):(V.value.packets.length||V.value.pulses.length)&&(V.value={packets:[],pulses:[]}),(b||W.busy||ne)&&(re=requestAnimationFrame(q))}ve(z,k=>{($||ze()||!D.value.size)&&(D.value=new Map(k),$=!1),Q()});function te(k){document.hidden||(W.spawn(k,performance.now(),ze()),Q())}let fe;ve(()=>ro.replay,k=>{k&&!h.value&&te(k.message)}),ve(()=>M.playhead,k=>{if(!(L||k===H)){if(H=k,W.clear(),V.value={packets:[],pulses:[]},M.mode==="replay"&&M.replay)for(let w of $c(M.replay,k,1).slice(-Wu))te(w);Q()}},{flush:"sync"}),ve(()=>M.playing,k=>{k&&Q()}),ve(()=>M.mode,()=>{W.clear(),V.value={packets:[],pulses:[]},$=!0,We.value=null,Q()});function Be(){if(document.hidden){W.clear(),V.value={packets:[],pulses:[]};return}D.value=new Map(z.value),s.value=Date.now()/1e3,Q()}let Et=x(()=>g.value.flatMap(k=>{let w=ue(k.session_id);if(!w)return[];let b=k.ghost?c("offline"):c(k.status);return[{id:k.session_id,x:w.x,y:w.y,handle:k.handle,label:Us(k.handle,18),initials:er((k.handle||k.title||"?").replace(/^[^\p{L}\p{N}]+/u,"")||"?"),hue:lo(k.session_id),working:!k.ghost&&k.status==="working",external:k.kind==="external",ghost:k.ghost,aria:`${k.handle}, ${b}${k.kind==="external"?`, ${c("external")}`:""}`}]})),Mt=x(()=>new Set(g.value.map(k=>k.session_id))),Fn=x(()=>h.value?M.playhead:s.value),kn=x(()=>y.value.flatMap(k=>{let w=ue(k.a),b=ue(k.b);if(!w||!b||!Mt.value.has(k.a)||!Mt.value.has(k.b))return[];let B=xc(k.count,k.last,Fn.value);return[{key:Ot(k.a,k.b),a:k.a,b:k.b,d:ki(yi(k.a,w,k.b,b)),...B}]})),xn=x(()=>({x:o.width/2,y:o.height/2}));function wn(k){let w=22;for(let b of k)w+=(b.codePointAt(0)??0)>11903?12.5:6.6;return w}let En=x(()=>E.value.flatMap(k=>{let w=k.members.map(me=>ue(me)).filter(me=>me!==void 0),b=k.members.filter(me=>Mt.value.has(me));if(!w.length||!b.length)return[];let B=yc(w,p.value+17),ne=kc(B,w,xn.value),he=wn(k.name);return[{name:k.name,hue:Fs(k.name),d:bc(B),x:ne.x,y:ne.y,width:he,count:b.length}]})),We=X(null),ee=X({x:0,y:0}),F=X({width:0,height:0}),ce=x(()=>{let k=We.value;if(k?.kind==="node"){let b=Dc({...oe,edges:y.value},k.id);return b.add(k.id),{nodes:b,edge:(B,ne)=>B===k.id||ne===k.id}}if(k?.kind==="edge")return{nodes:new Set([k.a,k.b]),edge:(b,B)=>Ot(b,B)===Ot(k.a,k.b)};if(k?.kind==="group"){let b=new Set(E.value.find(B=>B.name===k.name)?.members??[]);return{nodes:b,edge:(B,ne)=>b.has(B)&&b.has(ne)}}let w=ro.spotlight;if(w){let b=w.from.session_id,B=new Set(pn(w));return{nodes:new Set([b,...B]),edge:(ne,he)=>ne===b&&B.has(he)||he===b&&B.has(ne)}}return null}),st=k=>`var(--via-${k})`,Un=x(()=>{let k={packets:V.value.packets.map(w=>({...w,color:st(w.via)})),rings:[],glows:[],hulls:[]};for(let w of V.value.pulses){let b=Math.min(1,Math.max(0,w.progress)),B=st(w.via);if(w.kind==="flash"||w.kind==="ripple"){let ne=ue(w.target);if(!ne)continue;let he=p.value;if(w.kind==="flash")k.rings.push({key:w.key,x:ne.x,y:ne.y,r:he+4+(w.grow?b*12:0),opacity:1-b,color:B});else if(w.grow){k.rings.push({key:`${w.key}a`,x:ne.x,y:ne.y,r:he+3+b*36,opacity:(1-b)*.9,color:B});let me=Math.max(0,(b-.22)/.78);me>0&&k.rings.push({key:`${w.key}b`,x:ne.x,y:ne.y,r:he+3+me*36,opacity:(1-me)*.6,color:B})}else k.rings.push({key:w.key,x:ne.x,y:ne.y,r:he+6,opacity:1-b,color:B})}else if(w.kind==="edge"&&w.other){let ne=we(w.target,w.other);ne&&k.glows.push({key:w.key,d:ki(ne),opacity:Math.sin(Math.PI*b),color:B})}else if(w.kind==="hull"){let ne=En.value.find(he=>he.name===w.target);ne&&k.hulls.push({key:w.key,d:ne.d,opacity:Math.sin(Math.PI*b),color:B})}}return k});ve(V,k=>{let w=We.value;w?.kind==="packet"&&!k.packets.some(b=>b.key===w.key)&&(We.value=null)});let At;function Nn(k){let w=t.value?.getBoundingClientRect();return{x:k.clientX-(w?.left??0),y:k.clientY-(w?.top??0)}}function Wt(k,w){clearTimeout(At),We.value=k,w&&(ee.value=Nn(w))}function ct(){clearTimeout(At),At=setTimeout(()=>We.value=null,70)}function go(k){Wt({kind:"node",id:k.id}),ee.value={x:k.x+p.value*.6,y:k.y+p.value*.6}}function _o(k){We.value&&(ee.value=Nn(k))}ve(We,async()=>{await Ue(),n.value&&(F.value={width:n.value.offsetWidth,height:n.value.offsetHeight})},{flush:"post"});let _=x(()=>{let k=Ls(ee.value,F.value,o);return{transform:`translate(${Math.round(k.x)}px, ${Math.round(k.y)}px)`}}),v=x(()=>oe.recent[oe.recent.length-1]),T=x(()=>!h.value&&hn.value.length<2),I=x(()=>{let k=M.replay;return k?c("REPLAY \u2014 {from} \u2192 {to}",{from:A(k.start),to:A(k.end)}):c("REPLAY")});function A(k){return`${new Date(k*1e3).toLocaleDateString()} ${mn(k).slice(0,5)}`}let R=x(()=>pe.status?.broker.reachable===!1),Y=x(()=>c("{sessions} sessions \xB7 {groups} groups",{sessions:oe.sessions.length,groups:oe.groups.length})),K,G;Re(()=>{let k=t.value,w=()=>{if(!k)return;let b={width:Math.round(k.clientWidth),height:Math.round(k.clientHeight)};(b.width!==o.width||b.height!==o.height)&&($=!0,Object.assign(o,b))};w(),k&&typeof ResizeObserver<"u"&&(K=new ResizeObserver(w),K.observe(k)),document.addEventListener("visibilitychange",Be),G=setInterval(()=>s.value=Date.now()/1e3,1e4),fe=jc(te),D.value=new Map(z.value),oe.loaded||io().catch(()=>{})}),Mn(()=>{K?.disconnect(),fe?.(),xt(),document.removeEventListener("visibilitychange",Be),clearInterval(G),clearTimeout(At),cancelAnimationFrame(re),W.clear()});function P(){io().catch(()=>{})}return(k,w)=>(f(),m(S,null,[C(jt,{title:i(c)("Graph")},{default:en(()=>[a("span",av,d(Y.value),1),a("button",{class:"iconbtn",disabled:!v.value||h.value,title:i(c)("Replay the last message"),"aria-label":i(c)("Replay the last message"),onClick:w[0]||(w[0]=b=>v.value&&i(Xs)(v.value))},[C(se,{name:"refresh"})],8,lv),a("button",{class:"iconbtn gv-feedbtn","aria-label":i(c)("Live messages"),onClick:w[1]||(w[1]=b=>r.value=!r.value)},[C(se,{name:"text"})],8,cv)]),_:1},8,["title"]),a("div",{ref_key:"stage",ref:t,class:ie(["gv",{focus:!!ce.value}]),onMousemove:_o},[o.width?(f(),m("svg",{key:0,class:"gv-svg",role:"group","aria-label":i(c)("Session graph"),viewBox:`0 0 ${o.width} ${o.height}`,width:o.width,height:o.height},[a("defs",null,[(f(!0),m(S,null,J(i(Zo),(b,B)=>(f(),m("linearGradient",{id:`gv-av${B}`,key:B,x1:"0",y1:"0",x2:"1",y2:"1"},[a("stop",{offset:"0","stop-color":b[0]},null,8,fv),a("stop",{offset:"1","stop-color":b[1]},null,8,pv)],8,dv))),128)),(f(),m(S,null,J(["user","agent","external"],b=>a("radialGradient",{id:`gv-glow-${b}`,key:b},[a("stop",{offset:"0",style:Me({stopColor:`var(--via-${b})`,stopOpacity:.85})},null,4),a("stop",{offset:"1",style:Me({stopColor:`var(--via-${b})`,stopOpacity:0})},null,4)],8,mv)),64)),w[6]||(w[6]=a("filter",{id:"gv-blur",x:"-60%",y:"-60%",width:"220%",height:"220%"},[a("feGaussianBlur",{stdDeviation:"7"})],-1))]),a("g",hv,[(f(!0),m(S,null,J(En.value,b=>(f(),m("g",{key:b.name,style:Me({"--h":b.hue}),class:ie(["ghull",{dim:ce.value&&We.value?.kind!=="group"}])},[a("path",{class:"ghull-fill",d:b.d},null,8,gv),a("path",{class:"ghull-hit",d:b.d,onMouseenter:B=>Wt({kind:"group",name:b.name},B),onMouseleave:ct},null,40,_v)],6))),128)),(f(!0),m(S,null,J(Un.value.hulls,b=>(f(),m("path",{key:b.key,class:"gfx-hull",d:b.d,style:Me({stroke:b.color,fill:b.color,opacity:b.opacity})},null,12,vv))),128))]),a("g",yv,[(f(!0),m(S,null,J(kn.value,b=>(f(),m("g",{key:b.key,class:ie(["gedge",{hot:ce.value?.edge(b.a,b.b),dim:ce.value&&!ce.value.edge(b.a,b.b)}])},[a("path",{class:"gedge-line",d:b.d,style:Me({strokeWidth:b.width,opacity:b.opacity})},null,12,bv),a("path",{class:"gedge-hit",d:b.d,onMouseenter:B=>Wt({kind:"edge",a:b.a,b:b.b},B),onMouseleave:ct},null,40,kv)],2))),128)),a("g",xv,[(f(!0),m(S,null,J(Un.value.glows,b=>(f(),m("g",{key:b.key,style:Me({opacity:b.opacity,stroke:b.color})},[a("path",{class:"gfx-glow wide",d:b.d},null,8,wv),a("path",{class:"gfx-glow",d:b.d},null,8,Ev)],4))),128))])]),a("g",Nv,[(f(!0),m(S,null,J(Et.value,b=>(f(),m("g",{key:b.id,class:ie(["gnode",{dim:ce.value&&!ce.value.nodes.has(b.id),ghost:b.ghost,working:b.working}]),transform:`translate(${b.x} ${b.y})`,tabindex:"0",role:"img","aria-label":b.aria,onMouseenter:B=>Wt({kind:"node",id:b.id},B),onMouseleave:ct,onFocus:B=>go(b),onBlur:ct},[a("circle",{class:"gnode-halo",r:p.value+6,fill:i(Zo)[b.hue][1],filter:"url(#gv-blur)"},null,8,Cv),b.working?(f(),m("circle",{key:0,class:"gnode-aura",r:p.value+5},null,8,Tv)):N("v-if",!0),a("circle",{class:ie(["gnode-ring",b.ghost?"off":b.working?"working":"idle"]),r:p.value+5},null,10,zv),a("circle",{class:"gnode-face",r:p.value,fill:b.ghost?"var(--surface-2)":`url(#gv-av${b.hue})`},null,8,Vv),a("text",{class:"gnode-text",dy:"0.35em",style:Me({fontSize:`${p.value*.62}px`})},d(b.initials),5),b.external?(f(),m("g",{key:1,class:"gnode-badge",transform:`translate(${p.value*.78} ${-p.value*.78})`},[...w[7]||(w[7]=[a("circle",{r:"8"},null,-1),a("path",{d:"M-2.6 2.6 2.6 -2.6M-1 -2.6H2.6V1"},null,-1)])],8,Ov)):N("v-if",!0),a("text",{class:"gnode-label",y:p.value+19},d(b.label),9,Dv)],42,Sv))),128))]),a("g",Mv,[(f(!0),m(S,null,J(En.value,b=>(f(),m("g",{key:b.name,class:ie(["gpill",{dim:ce.value&&We.value?.kind!=="group"}]),style:Me({"--h":b.hue}),transform:`translate(${b.x} ${b.y})`,onMouseenter:B=>Wt({kind:"group",name:b.name},B),onMouseleave:ct},[a("rect",{x:-b.width/2,y:"-11",width:b.width,height:"22",rx:"11"},null,8,Pv),a("text",Rv,"#"+d(b.name),1)],46,Av))),128))]),a("g",Iv,[(f(!0),m(S,null,J(Un.value.rings,b=>(f(),m("circle",{key:b.key,class:"gfx-ring",cx:b.x,cy:b.y,r:b.r,style:Me({stroke:b.color,opacity:b.opacity})},null,12,$v))),128)),(f(!0),m(S,null,J(Un.value.packets,b=>(f(),m("g",{key:b.key,class:"gpacket"},[(f(!0),m(S,null,J(b.trail,(B,ne)=>(f(),m("circle",{key:ne,cx:B.x,cy:B.y,r:4.2*B.scale,style:Me({fill:b.color,opacity:B.alpha})},null,12,Bv))),128)),a("g",{transform:`translate(${b.x} ${b.y})`},[a("circle",{r:"15",fill:`url(#gv-glow-${b.via})`},null,8,Fv),a("circle",{class:"gpacket-core",r:"4.6",style:Me({stroke:b.color})},null,4),a("circle",{class:"gpacket-hit",r:"13",onMouseenter:B=>Wt({kind:"packet",key:b.key,message:b.message},B),onMouseleave:ct},null,40,Uv)],8,Lv)]))),128))])],8,uv)):N("v-if",!0),We.value?(f(),m("div",{key:1,ref_key:"tipEl",ref:n,class:"gv-tip",style:Me(_.value),role:"tooltip"},[C(Gu,{tip:We.value,now:Fn.value},null,8,["tip","now"])],4)):N("v-if",!0),i(M).mode==="replay"?(f(),m("div",Hv,[w[8]||(w[8]=a("i",{class:"gv-dot"},null,-1)),a("b",null,d(I.value),1),a("button",{class:"btn ghost sm",onClick:w[2]||(w[2]=(...b)=>i(xt)&&i(xt)(...b))},d(i(c)("Back to live")),1)])):N("v-if",!0),C(ju),R.value&&!h.value?(f(),m("div",Kv,[C(se,{name:"warn",size:"sm"}),le(d(i(c)("The broker is not reachable, so this may be out of date.")),1)])):i(oe).failed&&!h.value?(f(),m("div",Gv,[C(se,{name:"warn",size:"sm"}),le(d(i(c)("Cannot load the graph."))+" ",1),a("button",{class:"btn ghost sm",onClick:P},d(i(c)("Retry")),1)])):N("v-if",!0),i(oe).loaded&&T.value?(f(),m("div",jv,[a("b",null,d(i(c)("No other sessions are running")),1),a("span",null,d(i(c)("Start another session and the messages between them will appear here as they happen.")),1)])):N("v-if",!0),r.value?(f(),m("div",{key:6,class:"gv-scrim",onClick:w[3]||(w[3]=b=>r.value=!1)})):N("v-if",!0),r.value?(f(),m("aside",{key:7,class:"gv-sheet","aria-label":i(c)("Live messages")},[a("button",{class:"iconbtn gv-close","aria-label":i(c)("Close"),onClick:w[4]||(w[4]=b=>r.value=!1)},[C(se,{name:"close"})],8,Xv),C(ar,{onPick:w[5]||(w[5]=b=>r.value=!1)})],8,Wv)):N("v-if",!0)],34)],64))}});var ur=[{id:"models",label:"Models",icon:"bot"},{id:"defaults",label:"Defaults",icon:"config"},{id:"workspaces",label:"Workspaces",icon:"folder"},{id:"sending",label:"Sending",icon:"send"},{id:"limits",label:"Limits",icon:"clock"}],dr=[{id:"connection",label:"Connection",icon:"info"},{id:"appearance",label:"Appearance",icon:"settings"},{id:"notifications",label:"Notifications",icon:"bell"},{id:"data",label:"Data",icon:"trash"}];var Yv=["aria-label"],qv=["aria-checked","disabled","onClick"],Dt=O({__name:"Segmented",props:zs({options:{},label:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){let t=no(e,"modelValue");return(n,o)=>(f(),m("div",{class:"seg",role:"radiogroup","aria-label":e.label},[(f(!0),m(S,null,J(e.options,s=>(f(),m("button",{key:s.value,type:"button",role:"radio","aria-checked":t.value===s.value,disabled:s.disabled,onClick:r=>t.value=s.value},d(s.label),9,qv))),128))],8,Yv))}});var Jv={class:"card-hint"},Zv={class:"card"},Qv={class:"field-row"},ey={for:"def-model"},ty={value:""},ny=["value"],oy={class:"field-row"},sy={for:"def-effort"},ry=["disabled"],iy={value:""},ay=["value"],Yu=O({__name:"DefaultsSection",setup(e){let t=x(()=>Se.data?.models??[]),n=x(()=>t.value.find(r=>r.name===j.defaults.model)?.efforts??[]),o=x(()=>Se.data?.allow_full===!0),s=x(()=>[{value:"deny",label:c("No shell")},{value:"safe",label:c("Sandboxed")},{value:"full",label:c("Full"),disabled:!o.value}]);return(r,l)=>(f(),m(S,null,[a("p",Jv,d(i(c)("What the New page starts with. Kept in this browser.")),1),a("div",Zv,[a("div",Qv,[a("label",ey,d(i(c)("Model")),1),Ee(a("select",{id:"def-model","onUpdate:modelValue":l[0]||(l[0]=u=>i(j).defaults.model=u),onChange:l[1]||(l[1]=u=>i(j).defaults.effort="")},[a("option",ty,d(i(c)("Default")),1),(f(!0),m(S,null,J(t.value,u=>(f(),m("option",{key:u.name,value:u.name},d(u.name),9,ny))),128))],544),[[An,i(j).defaults.model]])]),a("div",oy,[a("label",sy,d(i(c)("Effort")),1),Ee(a("select",{id:"def-effort","onUpdate:modelValue":l[2]||(l[2]=u=>i(j).defaults.effort=u),disabled:!n.value.length},[a("option",iy,d(i(c)("Model default")),1),(f(!0),m(S,null,J(n.value,u=>(f(),m("option",{key:u,value:u},d(u),9,ay))),128))],8,ry),[[An,i(j).defaults.effort]])]),C(Dt,{modelValue:i(j).defaults.permission,"onUpdate:modelValue":l[3]||(l[3]=u=>i(j).defaults.permission=u),options:s.value,label:i(c)("Shell access")},null,8,["modelValue","options","label"])])],64))}});var ly={class:"card-hint"},cy={key:0,class:"card"},uy={class:"kv"},dy={class:"kv"},fy={class:"kv"},qu=O({__name:"LimitsSection",setup(e){return(t,n)=>(f(),m(S,null,[a("p",ly,d(i(c)("What the session broker accepts from one sender. These are fixed by the broker.")),1),i(pe).status?(f(),m("div",cy,[a("div",uy,[a("span",null,d(i(c)("Message length")),1),a("span",null,d(i(pe).status.limits.max_text.toLocaleString())+" "+d(i(c)("characters")),1)]),a("div",dy,[a("span",null,d(i(c)("Rate")),1),a("span",null,d(i(pe).status.limits.rate_limit)+" / "+d(i(pe).status.limits.rate_window)+"s",1)]),a("div",fy,[a("span",null,d(i(c)("Used now")),1),a("span",null,d(i(pe).status.limits.used),1)])])):N("v-if",!0)],64))}});var fr=["off","minimal","low","medium","high","xhigh","max","ultra"];function Ju(){return{model:"",display_model:"",api:"chat",base_url:"",token:"",context_window:"",compact_percent:"",temperature:"",multimodal:!1,web_search:!1,efforts:[]}}function py(e){return e==="anthropic"||e==="responses"?e:"chat"}function ji(e){return{model:e.model,display_model:e.display_model??"",api:py(e.api),base_url:e.base_url??"",token:"",context_window:String(e.context_window),compact_percent:e.compact_percent===void 0?"":String(e.compact_percent),temperature:e.temperature==null?"":String(e.temperature),multimodal:e.multimodal,web_search:e.web_search===!0,efforts:[...e.efforts]}}function mo(e){let t=e.trim();return t===""?void 0:Number(t)}function Zu(e){if(!e.model.trim())return"The model id is required";let t=mo(e.context_window);if(t!==void 0&&(!Number.isInteger(t)||t<1))return"The context window is a whole number of tokens";let n=mo(e.compact_percent);if(n!==void 0&&!(n>0&&n<=100))return"Compact at is a percentage from 1 to 100";let o=mo(e.temperature),s=e.api==="anthropic"?1:2;return o!==void 0&&!(o>=0&&o<=s)?s===1?"The temperature is from 0 to 1 for this protocol":"The temperature is from 0 to 2":""}function Qu(e,t){return t?{anthropic:e==="anthropic"?!0:null,responses_api:e==="responses"?!0:null,chat:null}:e==="anthropic"?{anthropic:!0}:e==="responses"?{responses_api:!0}:{}}function ed(e){let t={model:e.model.trim(),...Qu(e.api,!1)},n={display_model:e.display_model,base_url:e.base_url,token:e.token};for(let[s,r]of Object.entries(n))r.trim()&&(t[s]=r.trim());let o={context_window:e.context_window,compact_percent:e.compact_percent,temperature:e.temperature};for(let[s,r]of Object.entries(o))mo(r)!==void 0&&(t[s]=mo(r));return e.multimodal&&(t.multimodal=!0),e.web_search&&(t.web_search=!0),e.efforts.length&&(t.reasoning_efforts=e.efforts),t}function td(e,t){let n=ji(t),o={};e.model.trim()!==n.model&&(o.model=e.model.trim()),e.api!==n.api&&Object.assign(o,Qu(e.api,!0));for(let s of["display_model","base_url"])e[s].trim()!==n[s]&&(o[s]=e[s].trim()||null);e.token.trim()&&(o.token=e.token.trim());for(let s of["context_window","compact_percent","temperature"])e[s].trim()!==n[s]&&(o[s]=mo(e[s])??null);return e.multimodal!==n.multimodal&&(o.multimodal=e.multimodal||null),e.web_search!==n.web_search&&(o.web_search=e.web_search||null),e.efforts.join()!==n.efforts.join()&&(o.reasoning_efforts=e.efforts.length?e.efforts:null),o}function nd(e,t){return(e.includes(t)?e.filter(o=>o!==t):[...e,t]).sort((o,s)=>fr.indexOf(o)-fr.indexOf(s))}var my={class:"switch-row"},hy={class:"grow"},gy={key:0},_y=["aria-checked","aria-label"],bn=O({__name:"SwitchRow",props:zs({label:{},hint:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){let t=no(e,"modelValue");return(n,o)=>(f(),m("div",my,[a("div",hy,[le(d(e.label)+" ",1),e.hint?(f(),m("small",gy,d(e.hint),1)):N("v-if",!0)]),a("button",{class:"switch",type:"button",role:"switch","aria-checked":t.value,"aria-label":e.label,onClick:o[0]||(o[0]=s=>t.value=!t.value)},null,8,_y)]))}});var vy={class:"card-title"},yy={class:"field-row"},by={for:"mf-model"},ky={class:"field-row"},xy={for:"mf-name"},wy=["placeholder"],Ey={class:"card-title"},Ny={class:"field-row"},Sy={for:"mf-url"},Cy=["placeholder"],Ty={class:"field-row"},zy={for:"mf-token"},Vy=["type","placeholder"],Oy={class:"field-row"},Dy={for:"mf-window"},My={class:"field-row"},Ay={for:"mf-compact"},Py={class:"field-row"},Ry={for:"mf-temp"},Iy=["placeholder"],$y={class:"card-title"},By=["aria-label"],Ly=["aria-pressed","onClick"],Fy={class:"card-hint"},Uy={key:0,class:"errcard",role:"alert"},Hy={class:"actions"},Ky=["disabled"],Gy={key:0,class:"spin"},Wi=O({__name:"ModelForm",props:{model:{}},emits:["done"],setup(e,{emit:t}){let n=e,o=t,s=be(n.model?ji(n.model):Ju()),r=X(!1),l=X(""),u=X(!1),p=x(()=>[{value:"chat",label:c("Chat")},{value:"responses",label:c("Responses")},{value:"anthropic",label:"Anthropic"}]),h=x(()=>Zu(s)),g=x(()=>n.model?td(s,n.model):null),y=x(()=>g.value!==null&&Object.keys(g.value).length===0);async function E(){if(h.value){l.value=c(h.value);return}r.value=!0,l.value="";try{let z=n.model?await ke.changeModel(n.model.name,g.value??{}):await ke.addModel(ed(s));Se.data&&(Se.data.models=z.models),xe(n.model?c("Model saved"):c("Model added")),o("done")}catch(z){l.value=z instanceof Oe?z.message:String(z)}finally{r.value=!1}}return(z,D)=>(f(),m("form",{class:"card model-form",onSubmit:Ye(E,["prevent"])},[a("div",vy,d(e.model?i(c)("Edit {name}",{name:e.model.name}):i(c)("Add a model")),1),a("div",yy,[a("label",by,d(i(c)("Model id")),1),Ee(a("input",{id:"mf-model","onUpdate:modelValue":D[0]||(D[0]=V=>s.model=V),required:"",autocomplete:"off",spellcheck:"false",placeholder:"gpt-4.1"},null,512),[[Ae,s.model]])]),a("div",ky,[a("label",xy,d(i(c)("Shown as")),1),Ee(a("input",{id:"mf-name","onUpdate:modelValue":D[1]||(D[1]=V=>s.display_model=V),autocomplete:"off",placeholder:i(c)("Same as the model id")},null,8,wy),[[Ae,s.display_model]])]),a("div",Ey,d(i(c)("Protocol")),1),C(Dt,{modelValue:s.api,"onUpdate:modelValue":D[2]||(D[2]=V=>s.api=V),options:p.value,label:i(c)("Protocol")},null,8,["modelValue","options","label"]),a("div",Ny,[a("label",Sy,d(i(c)("Base URL")),1),Ee(a("input",{id:"mf-url","onUpdate:modelValue":D[3]||(D[3]=V=>s.base_url=V),type:"url",autocomplete:"off",spellcheck:"false",placeholder:i(c)("The protocol\u2019s own address")},null,8,Cy),[[Ae,s.base_url]])]),a("div",Ty,[a("label",zy,d(i(c)("API key")),1),Ee(a("input",{id:"mf-token","onUpdate:modelValue":D[4]||(D[4]=V=>s.token=V),type:u.value?"text":"password",autocomplete:"new-password",spellcheck:"false",placeholder:e.model?i(c)("Leave empty to keep the saved key"):i(c)("Or set it in the environment")},null,8,Vy),[[Il,s.token]]),a("button",{class:"btn sm ghost",type:"button",onClick:D[5]||(D[5]=V=>u.value=!u.value)},d(u.value?i(c)("Hide"):i(c)("Show")),1)]),a("div",Oy,[a("label",Dy,d(i(c)("Context")),1),Ee(a("input",{id:"mf-window","onUpdate:modelValue":D[6]||(D[6]=V=>s.context_window=V),inputmode:"numeric",autocomplete:"off",placeholder:"128000"},null,512),[[Ae,s.context_window]])]),a("div",My,[a("label",Ay,d(i(c)("Compact at")),1),Ee(a("input",{id:"mf-compact","onUpdate:modelValue":D[7]||(D[7]=V=>s.compact_percent=V),inputmode:"decimal",autocomplete:"off",placeholder:"80"},null,512),[[Ae,s.compact_percent]]),D[12]||(D[12]=a("span",{class:"unit"},"%",-1))]),a("div",Py,[a("label",Ry,d(i(c)("Temperature")),1),Ee(a("input",{id:"mf-temp","onUpdate:modelValue":D[8]||(D[8]=V=>s.temperature=V),inputmode:"decimal",autocomplete:"off",placeholder:i(c)("Provider default")},null,8,Iy),[[Ae,s.temperature]])]),C(bn,{modelValue:s.multimodal,"onUpdate:modelValue":D[9]||(D[9]=V=>s.multimodal=V),label:i(c)("Accepts images")},null,8,["modelValue","label"]),C(bn,{modelValue:s.web_search,"onUpdate:modelValue":D[10]||(D[10]=V=>s.web_search=V),label:i(c)("Web search"),hint:i(c)("The provider searches the web for the model.")},null,8,["modelValue","label","hint"]),a("div",$y,d(i(c)("Effort levels")),1),a("div",{class:"levels",role:"group","aria-label":i(c)("Effort levels")},[(f(!0),m(S,null,J(i(fr),V=>(f(),m("button",{key:V,type:"button",class:"level","aria-pressed":s.efforts.includes(V),onClick:W=>s.efforts=i(nd)(s.efforts,V)},d(V),9,Ly))),128))],8,By),a("p",Fy,d(i(c)("Choose none to allow every level.")),1),l.value?(f(),m("p",Uy,d(l.value),1)):N("v-if",!0),a("div",Hy,[a("button",{class:"btn sm",type:"submit",disabled:r.value||y.value},[r.value?(f(),m("span",Gy)):N("v-if",!0),le(" "+d(e.model?i(c)("Save"):i(c)("Add model")),1)],8,Ky),a("button",{class:"btn sm ghost",type:"button",onClick:D[11]||(D[11]=V=>o("done"))},d(i(c)("Cancel")),1)])],32))}});var jy={class:"card-hint"},Wy={key:1,class:"card"},Xy={class:"card-title"},Yy={class:"kv"},qy={class:"mono"},Jy={class:"kv"},Zy={key:0,class:"kv"},Qy={class:"mono"},eb={class:"kv"},tb={class:"kv"},nb={key:1,class:"kv"},ob={class:"kv"},sb={class:"actions"},rb=["onClick"],ib=["disabled","title","onClick"],ab={key:0,class:"empty"},lb={key:2,class:"actions"},od=O({__name:"ModelsSection",setup(e){let t=X("");async function n(o){if(await _t({title:c("Remove {name}?",{name:o}),text:c("It is taken out of the configuration file. A daemon already running keeps using it until it restarts."),ok:c("Remove"),danger:!0}))try{let r=await ke.removeModel(o);Se.data&&(Se.data.models=r.models),xe(c("Model removed"))}catch(r){xe(r instanceof Oe?r.message:String(r),"bad")}}return(o,s)=>(f(),m(S,null,[a("p",jy,d(i(c)("Written to the ZettCode configuration file, with its comments kept. A new daemon uses the change; one that is running keeps what it started with.")),1),(f(!0),m(S,null,J(i(Se).data?.models??[],r=>(f(),m(S,{key:r.name},[t.value===r.name?(f(),ae(Wi,{key:0,model:r,onDone:s[0]||(s[0]=l=>t.value="")},null,8,["model"])):(f(),m("div",Wy,[a("div",Xy,[le(d(r.name),1),r.default?(f(),m(S,{key:0},[le(" \xB7 "+d(i(c)("default")),1)],64)):N("v-if",!0)]),a("div",Yy,[a("span",null,d(i(c)("Model id")),1),a("span",qy,d(r.model),1)]),a("div",Jy,[a("span",null,d(i(c)("Protocol")),1),a("span",null,d(r.api),1)]),r.base_url?(f(),m("div",Zy,[a("span",null,d(i(c)("Base URL")),1),a("span",Qy,d(r.base_url),1)])):N("v-if",!0),a("div",eb,[a("span",null,d(i(c)("Context")),1),a("span",null,d(i(cu)(r.context_window)),1)]),a("div",tb,[a("span",null,d(i(c)("Images")),1),a("span",null,d(r.multimodal?i(c)("yes"):i(c)("no")),1)]),r.web_search?(f(),m("div",nb,[a("span",null,d(i(c)("Web search")),1),a("span",null,d(i(c)("yes")),1)])):N("v-if",!0),a("div",ob,[a("span",null,d(i(c)("Effort levels")),1),a("span",null,d(r.efforts.join(", ")||"\u2013"),1)]),a("div",sb,[a("button",{class:"btn sm ghost",type:"button",onClick:l=>t.value=r.name},d(i(c)("Edit")),9,rb),a("button",{class:"btn sm danger",type:"button",disabled:(i(Se).data?.models.length??0)<2,title:(i(Se).data?.models.length??0)<2?i(c)("The last model cannot be removed"):"",onClick:l=>n(r.name)},d(i(c)("Remove")),9,ib)])]))],64))),128)),i(Se).data&&!i(Se).data.models.length?(f(),m("div",ab,[a("b",null,d(i(c)("No models")),1),le(d(i(c)("Add one below.")),1)])):N("v-if",!0),t.value==="new"?(f(),ae(Wi,{key:1,onDone:s[1]||(s[1]=r=>t.value="")})):(f(),m("div",lb,[a("button",{class:"btn",type:"button",onClick:s[2]||(s[2]=r=>t.value="new")},d(i(c)("Add a model")),1)]))],64))}});var cb={class:"card"},ub={class:"card-hint"},sd=O({__name:"SendingSection",setup(e){return(t,n)=>(f(),m(S,null,[a("div",cb,[C(bn,{modelValue:i(j).askReply,"onUpdate:modelValue":n[0]||(n[0]=o=>i(j).askReply=o),label:i(c)("Ask daemons to answer"),hint:i(c)("A daemon answers into its own conversation unless its model calls send_message. This adds a line asking it to. The line is not shown in the chat.")},null,8,["modelValue","label","hint"]),C(bn,{modelValue:i(j).confirmSession,"onUpdate:modelValue":n[1]||(n[1]=o=>i(j).confirmSession=o),label:i(c)("Confirm before writing to a session"),hint:i(c)("A session other than a daemon may have a person at it. Your message starts a turn there and spends that session's tokens.")},null,8,["modelValue","label","hint"])]),a("p",ub,d(i(c)("A message is delivered at most once. If the gateway cannot tell whether one arrived, it says so and never sends it again by itself.")),1)],64))}});var db={class:"card-hint"},fb={class:"card"},pb={class:"card-title"},mb={class:"mono"},hb={key:0,class:"card"},gb={class:"card-title"},_b={class:"mono"},vb={class:"actions"},rd=O({__name:"WorkspacesSection",setup(e){return(t,n)=>(f(),m(S,null,[a("p",db,d(i(c)("Agents can be started in these folders or below them. With no --root the gateway allows any folder; --root narrows it.")),1),a("div",fb,[a("div",pb,d(i(c)("Allowed roots")),1),(f(!0),m(S,null,J(i(Se).data?.roots??[],o=>(f(),m("div",{key:o,class:"kv"},[a("span",mb,d(o),1)]))),128))]),i(j).recent.length?(f(),m("div",hb,[a("div",gb,d(i(c)("Recently used")),1),(f(!0),m(S,null,J(i(j).recent,o=>(f(),m("div",{key:o,class:"kv"},[a("span",_b,d(o),1)]))),128)),a("div",vb,[a("button",{class:"btn sm ghost",onClick:n[0]||(n[0]=o=>i(j).recent=[])},d(i(c)("Clear")),1)])])):N("v-if",!0)],64))}});var yb={class:"page"},bb={class:"page-inner"},kb={key:0,class:"errcard"},id=O({__name:"ConfigPage",setup(e){let t={models:od,defaults:Yu,workspaces:rd,sending:sd,limits:qu},n=x(()=>ye.arg in t?ye.arg:"models"),o=x(()=>c(ur.find(s=>s.id===n.value)?.label??"Config"));return Re(()=>void uo()),(s,r)=>(f(),m(S,null,[C(jt,{title:o.value,back:""},null,8,["title"]),a("div",yb,[a("div",bb,[i(Se).error?(f(),m("p",kb,d(i(Se).error),1)):N("v-if",!0),(f(),ae(ht(t[n.value])))])])],64))}});var xb={class:"pane-list"},wb={key:0,class:"empty"},Eb=["href","aria-current"],Nb={class:"row-body"},Sb={class:"row-name"},Cb={class:"row-sub"},ad=O({__name:"LogsPane",setup(e){return(t,n)=>(f(),m(S,null,[C(Gt,{title:i(c)("Logs")},null,8,["title"]),a("div",xb,[i(ci).length?N("v-if",!0):(f(),m("div",wb,[a("b",null,d(i(c)("No daemons")),1),le(d(i(c)("A daemon's state and log appear here.")),1)])),(f(!0),m(S,null,J(i(ci),o=>(f(),m("a",{key:o.id,class:"row",href:i(je)("logs",o.id),"aria-current":i(ye).arg===o.id?"true":void 0},[C(et,{thread:o,size:"sm"},null,8,["thread"]),a("div",Nb,[a("span",Sb,d(o.name),1),a("span",Cb,d(i(c)(o.status))+" \xB7 "+d(i(vn)(o.workspace)),1)])],8,Eb))),128))])],64))}});var Tb=/^(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2}) (.*)$/,zb=/\b(fail(?:ed|ure)?|error|traceback|exception|could not|cannot|not retried|refused)\b/i;function Vb(e,t=0){let n=Tb.exec(e),o=n?.[1]??"",s=n?.[2]??"",r=n?.[3]??e,l={at:t,date:o,time:s,raw:e},u=/^tool (\S+)(?: (failed|skipped)\b[^:]*:?\s*(.*)| finished in (.*)| · (.*))?$/s.exec(r);if(u){let p=u[1]??"";return u[2]==="failed"?{...l,kind:"error",name:p,text:u[3]??""}:u[2]==="skipped"?{...l,kind:"info",name:p,text:u[3]||"skipped"}:u[4]!==void 0?{...l,kind:"info",name:p,text:`finished in ${u[4]}`}:{...l,kind:"tool",name:p,text:u[5]??""}}return r.startsWith("turn from ")?{...l,kind:"turn",name:"",text:r.slice(10)}:r.startsWith("turn finished")?{...l,kind:"done",name:"",text:r.slice(5)}:{...l,kind:zb.test(r)?"error":"info",name:"",text:r}}function ld(e){return e.split(`
3
+ `).filter(t=>t.trim()!=="").map((t,n)=>Vb(t,n))}var cd=e=>e.name!=="";function ud(e,t,n){let o=n.trim().toLowerCase();return e.filter(s=>t==="tools"&&!cd(s)||t==="problems"&&s.kind!=="error"?!1:o===""||s.raw.toLowerCase().includes(o))}function dd(e){let t=0,n=0;for(let o of e)cd(o)&&(t+=1),o.kind==="error"&&(n+=1);return{all:e.length,tools:t,problems:n}}var Ob=["aria-label"],Db={class:"page"},Mb={class:"page-inner"},Ab={key:0,class:"card"},Pb={class:"kv"},Rb={class:"kv"},Ib={class:"kv"},$b={class:"kv"},Bb={class:"mono"},Lb={class:"kv"},Fb={class:"kv"},Ub={class:"actions"},Hb={key:1,class:"errcard"},Kb={class:"log-tools"},Gb=["aria-label"],jb=["aria-checked","onClick"],Wb=["placeholder","aria-label"],Xb={key:0,class:"log-day"},Yb={class:"log-time"},qb={class:"log-kind"},Jb={class:"log-text"},Zb={key:1,class:"mute"},fd=O({__name:"LogView",props:{id:{}},setup(e){let t=e,n=x(()=>tt(t.id)),o=X([]),s=X(""),r=X("all"),l=X(""),u=X(null),p=X(!0),h,g=null,y=x(()=>dd(o.value)),E=x(()=>ud(o.value,r.value,l.value)),z=x(()=>[{id:"all",label:c("All"),count:y.value.all},{id:"tools",label:c("Tools"),count:y.value.tools},{id:"problems",label:c("Problems"),count:y.value.problems}]);function D(){let U=u.value;return!U||U.scrollHeight-U.scrollTop-U.clientHeight<60}function V(){Ue(()=>u.value?.scrollTo({top:u.value.scrollHeight}))}async function W(){let U=t.id;try{let $=D(),H=(await ke.log(U)).text;if(U!==t.id||(s.value="",H===g))return;g=H,o.value=ld(H),$&&V()}catch($){if(U!==t.id)return;s.value=$ instanceof Oe?$.message:String($)}}function re(U){let $=E.value[U];return!!$?.date&&$.date!==E.value[U-1]?.date}return ve(()=>t.id,()=>{g=null,W()}),ve([r,l],V),Re(()=>{W(),V(),h=setInterval(()=>!document.hidden&&void W(),4e3)}),bt(()=>clearInterval(h)),(U,$)=>(f(),m(S,null,[C(jt,{title:n.value?.name??i(c)("Logs"),back:""},{default:en(()=>[a("button",{class:"iconbtn","aria-label":i(c)("Refresh"),onClick:W},[C(se,{name:"refresh"})],8,Ob)]),_:1},8,["title"]),a("div",Db,[a("div",Mb,[n.value?(f(),m("div",Ab,[a("div",Pb,[a("span",null,d(i(c)("Status")),1),a("span",null,d(i(c)(n.value.status)),1)]),a("div",Rb,[a("span",null,d(i(c)("Model")),1),a("span",null,[le(d(n.value.model),1),n.value.effort?(f(),m(S,{key:0},[le(" \xB7 "+d(n.value.effort),1)],64)):N("v-if",!0)])]),a("div",Ib,[a("span",null,d(i(c)("Shell level")),1),a("span",null,d(n.value.permission),1)]),a("div",$b,[a("span",null,d(i(c)("Workspace")),1),a("span",Bb,d(n.value.workspace),1)]),a("div",Lb,[a("span",null,d(i(c)("Process")),1),a("span",null,d(n.value.pid||"\u2013"),1)]),a("div",Fb,[a("span",null,d(i(c)("Running for")),1),a("span",null,d(n.value.started_at?i(_n)(Date.now()/1e3-n.value.started_at):"\u2013"),1)]),a("div",Ub,[a("button",{class:"btn sm ghost",onClick:$[0]||($[0]=H=>i(lt)("chats",n.value.id))},d(i(c)("Open chat")),1),a("button",{class:"btn sm ghost",onClick:$[1]||($[1]=H=>i(Fi)(n.value))},d(i(c)("Restart with a new configuration")),1),n.value.online?(f(),m("button",{key:0,class:"btn sm danger",onClick:$[2]||($[2]=H=>i(Bi)(n.value))},d(i(c)("Stop")),1)):(f(),m("button",{key:1,class:"btn sm danger",onClick:$[3]||($[3]=H=>i(Li)(n.value))},d(i(c)("Delete")),1))])])):N("v-if",!0),s.value?(f(),m("p",Hb,d(s.value),1)):N("v-if",!0),a("div",Kb,[a("div",{class:"log-chips",role:"radiogroup","aria-label":i(c)("Show")},[(f(!0),m(S,null,J(z.value,H=>(f(),m("button",{key:H.id,type:"button",role:"radio",class:ie(["log-chip",{"is-bad":H.id==="problems"&&H.count>0}]),"aria-checked":r.value===H.id,onClick:L=>r.value=H.id},[le(d(H.label)+" ",1),a("b",null,d(H.count),1)],10,jb))),128))],8,Gb),Ee(a("input",{"onUpdate:modelValue":$[4]||($[4]=H=>l.value=H),class:"log-search",type:"search",placeholder:i(c)("Search the log"),"aria-label":i(c)("Search the log")},null,8,Wb),[[Ae,l.value]])]),a("div",{ref_key:"box",ref:u,class:"logbox",role:"log",onScrollPassive:$[5]||($[5]=H=>p.value=D())},[E.value.length?(f(!0),m(S,{key:0},J(E.value,(H,L)=>(f(),m(S,{key:H.at},[re(L)?(f(),m("div",Xb,d(H.date),1)):N("v-if",!0),a("div",{class:ie(["log-row",`is-${H.kind}`])},[a("span",Yb,d(H.time),1),a("span",qb,d(H.kind==="turn"?i(c)("turn"):H.kind==="done"?i(c)("done"):H.name||""),1),a("span",Jb,d(H.text||(H.kind==="tool"?"":H.raw)),1)],2)],64))),128)):(f(),m("span",Zb,d(o.value.length?i(c)("Nothing matches."):i(c)("The log is empty.")),1))],544),Ee(a("button",{class:"btn sm ghost log-jump",onClick:V},d(i(c)("Jump to the newest line")),513),[[$s,!p.value]])])])],64))}});var Qb=["onClick"],ek=["aria-label"],tk={class:"sheet-head"},nk=["aria-label","onClick"],ok={class:"sheet-body"},pd=O({__name:"SheetHost",setup(e){let t=X(null);function n(s){s.key==="Escape"&&cc()&&s.stopPropagation()}Re(()=>document.addEventListener("keydown",n,!0)),bt(()=>document.removeEventListener("keydown",n,!0));function o(s){Ue(()=>s.querySelector("button.menu-item, input, button.btn")?.focus())}return(s,r)=>(f(),m("div",{ref_key:"host",ref:t},[(f(!0),m(S,null,J(i(Pn),l=>(f(),m("div",{key:l.id,ref_for:!0,ref:u=>u&&o(u),class:"backdrop",onClick:Ye(u=>i(Go)(l.id),["self"])},[a("div",{class:"sheet",role:"dialog","aria-modal":"true","aria-label":l.title},[a("div",tk,[a("h3",null,d(l.title),1),a("button",{class:"iconbtn","aria-label":i(c)("Close"),onClick:u=>i(Go)(l.id)},[C(se,{name:"close"})],8,nk)]),a("div",ok,[(f(),ae(ht(l.component),Fo({ref_for:!0},l.props,{onClose:u=>i(Go)(l.id,u)}),null,16,["onClose"]))])],8,ek)],8,Qb))),128))],512))}});var sk={class:"toasts",role:"status","aria-live":"polite"},md=O({__name:"ToastHost",setup(e){return(t,n)=>(f(),m("div",sk,[(f(!0),m(S,null,J(i(Ko),o=>(f(),m("div",{key:o.id,class:ie(["toast",o.kind])},d(o.text),3))),128))]))}});var rk={class:"card"},ik={class:"card-title"},ak={class:"field-row"},lk={for:"spawn-name"},ck=["placeholder"],uk={key:0,class:"field-row"},dk={class:"mono spawn-resume"},fk=["aria-label"],pk={class:"field-row stack"},mk={for:"spawn-message"},hk=["placeholder"],hd=O({__name:"SpawnExtra",setup(e){return(t,n)=>(f(),m("div",rk,[a("div",ik,d(i(c)("About it")),1),a("div",ak,[a("label",lk,d(i(c)("Name")),1),Ee(a("input",{id:"spawn-name","onUpdate:modelValue":n[0]||(n[0]=o=>i(_e).name=o),type:"text",maxlength:"40",autocomplete:"off",placeholder:i(c)("What it is for")},null,8,ck),[[Ae,i(_e).name]])]),i(_e).resume?(f(),m("div",uk,[a("label",null,d(i(c)("Continues")),1),a("span",dk,d(i(_e).resume),1),a("button",{class:"iconbtn",type:"button","aria-label":i(c)("Start an empty conversation instead"),onClick:n[1]||(n[1]=o=>i(_e).resume="")},[C(se,{name:"close",size:"sm"})],8,fk)])):N("v-if",!0),a("div",pk,[a("label",mk,d(i(c)("First message")),1),Ee(a("textarea",{id:"spawn-message","onUpdate:modelValue":n[2]||(n[2]=o=>i(_e).message=o),rows:"3",placeholder:i(c)("Optional. Sent as soon as it is up.")},null,8,hk),[[Ae,i(_e).message]])])]))}});var gk={class:"card"},_k={class:"card-title"},vk={class:"field-row"},yk={for:"spawn-model"},bk={value:""},kk=["value"],xk={class:"field-row"},wk={for:"spawn-effort"},Ek=["disabled"],Nk={value:""},Sk=["value"],Ck={key:0,class:"card-hint warn"},gd=O({__name:"SpawnModel",setup(e){let t=x(()=>Se.data?.models??[]),n=x(()=>t.value.find(s=>s.name===_e.model)??t.value.find(s=>s.default)),o=x(()=>n.value?.efforts??[]);return ve(n,s=>{_e.effort&&s&&!s.efforts.includes(_e.effort)&&(_e.effort="")}),(s,r)=>(f(),m("div",gk,[a("div",_k,d(i(c)("Model")),1),a("div",vk,[a("label",yk,d(i(c)("Model")),1),Ee(a("select",{id:"spawn-model","onUpdate:modelValue":r[0]||(r[0]=l=>i(_e).model=l)},[a("option",bk,d(i(c)("Default"))+d(t.value[0]?` (${t.value[0].name})`:""),1),(f(!0),m(S,null,J(t.value,l=>(f(),m("option",{key:l.name,value:l.name},d(l.name),9,kk))),128))],512),[[An,i(_e).model]])]),a("div",xk,[a("label",wk,d(i(c)("Effort")),1),Ee(a("select",{id:"spawn-effort","onUpdate:modelValue":r[1]||(r[1]=l=>i(_e).effort=l),disabled:!o.value.length},[a("option",Nk,d(i(c)("Model default")),1),(f(!0),m(S,null,J(o.value,l=>(f(),m("option",{key:l,value:l},d(l),9,Sk))),128))],8,Ek),[[An,i(_e).effort]])]),!t.value.length&&!i(Se).loading?(f(),m("p",Ck,d(i(c)("No models are configured. Add one with /config in ZettCode, or in the config file.")),1)):N("v-if",!0)]))}});var Tk={class:"card"},zk={class:"card-title"},Vk={key:0,class:"card-hint"},Ok={class:"card-hint"},_d=O({__name:"SpawnShell",setup(e){let t=x(()=>Se.data?.allow_full===!0),n=x(()=>[{value:"deny",label:c("No shell")},{value:"safe",label:c("Sandboxed")},{value:"full",label:c("Full"),disabled:!t.value}]),o=x(()=>({deny:c("It can read and edit files and talk, but never runs a command."),safe:c("Every command runs in a sandbox: it writes only the workspace, credentials are hidden, the network is open."),full:c("Commands run with your account's full access: no sandbox, no approval, no network limit.")})[_e.permission]??"");return(s,r)=>(f(),m("div",Tk,[a("div",zk,d(i(c)("Shell access")),1),C(Dt,{modelValue:i(_e).permission,"onUpdate:modelValue":r[0]||(r[0]=l=>i(_e).permission=l),options:n.value,label:i(c)("Shell access")},null,8,["modelValue","options","label"]),a("p",{class:ie(["card-hint",{warn:i(_e).permission==="full"}])},d(o.value),3),t.value?N("v-if",!0):(f(),m("p",Vk,d(i(c)("Full access is turned off. It was started with --no-full.")),1)),a("p",Ok,d(i(c)("A daemon never asks anyone: there is nobody to approve a command.")),1)]))}});var Dk={class:"spawn-templates"},Mk={class:"chips"},Ak=["onClick"],vd=O({__name:"SpawnTemplates",setup(e){return(t,n)=>(f(),m("div",Dk,[a("div",Mk,[(f(!0),m(S,null,J([...i(sr),...i(j).templates],o=>(f(),m("button",{key:o.label,type:"button",class:"chip",onClick:s=>i(nr)(o)},d(i(c)(o.label)),9,Ak))),128))])]))}});var Pk={key:0},Rk={class:"picker-path"},Ik={key:0,class:"card-hint bad"},$k=["onClick"],Bk={class:"picker-name"},Lk={key:2,class:"card-hint"},Fk={key:3,class:"actions"},Uk={key:1,class:"empty"},Hk={key:0,class:"spin"},yd=O({__name:"FolderPicker",props:{start:{}},emits:["close"],setup(e,{emit:t}){let n=e,o=t,s=X(null),r=X(""),l=X(!1);async function u(p){l.value=!0;try{s.value=await ke.directories(p),r.value=""}catch(h){r.value=h instanceof Oe?h.message:String(h),p&&await u("")}finally{l.value=!1}}return Re(()=>void u(n.start)),(p,h)=>s.value?(f(),m("div",Pk,[a("div",Rk,d(s.value.path||i(c)("Folders agents may work in")),1),r.value?(f(),m("p",Ik,d(r.value),1)):N("v-if",!0),s.value.parent!==null?(f(),m("button",{key:1,class:"menu-item",onClick:h[0]||(h[0]=g=>u(s.value.parent))},[C(se,{name:"back"}),a("span",null,d(i(c)("Up")),1)])):N("v-if",!0),(f(!0),m(S,null,J(s.value.dirs,g=>(f(),m("button",{key:g.path,class:"menu-item",onClick:y=>u(g.path)},[C(se,{name:"folder"}),a("span",Bk,d(g.name),1),C(se,{class:"chev",name:"chevron",size:"sm"})],8,$k))),128)),s.value.dirs.length?N("v-if",!0):(f(),m("p",Lk,d(i(c)("No folders here.")),1)),s.value.path?(f(),m("div",Fk,[a("button",{class:"btn block",onClick:h[1]||(h[1]=g=>o("close",s.value.path))},d(i(c)("Use this folder")),1)])):N("v-if",!0)])):(f(),m("div",Uk,[l.value?(f(),m("span",Hk)):(f(),m(S,{key:1},[le(d(r.value),1)],64))]))}});var Kk={class:"card"},Gk={class:"card-title"},jk={class:"field-row"},Wk={for:"spawn-workspace"},Xk=["placeholder"],Yk=["aria-label"],qk={key:0,class:"chips"},Jk=["onClick"],Zk={class:"card-hint"},bd=O({__name:"SpawnWhere",setup(e){async function t(){let n=await Rn(c("Choose a folder"),yd,{start:_e.workspace});n&&(_e.workspace=n)}return(n,o)=>(f(),m("div",Kk,[a("div",Gk,d(i(c)("Where")),1),a("div",jk,[a("label",Wk,d(i(c)("Workspace")),1),Ee(a("input",{id:"spawn-workspace","onUpdate:modelValue":o[0]||(o[0]=s=>i(_e).workspace=s),type:"text",inputmode:"url",autocapitalize:"off",autocomplete:"off",spellcheck:"false",placeholder:i(c)("/path/to/project")},null,8,Xk),[[Ae,i(_e).workspace]]),a("button",{class:"iconbtn",type:"button","aria-label":i(c)("Choose a folder"),onClick:t},[C(se,{name:"folder"})],8,Yk)]),i(j).recent.length?(f(),m("div",qk,[(f(!0),m(S,null,J(i(j).recent,s=>(f(),m("button",{key:s,type:"button",class:"chip",onClick:r=>i(_e).workspace=s},d(s),9,Jk))),128))])):N("v-if",!0),a("p",Zk,d(i(c)("The agent reads and changes files here. Any folder on the machine the gateway runs on can be chosen, unless it was started with --root.")),1)]))}});var Qk={class:"page"},ex={key:0,class:"errcard",role:"alert"},tx=["disabled"],nx={key:0,class:"spin"},ox={class:"actions"},kd=O({__name:"NewForm",setup(e){let t=X(!1),n=X(null),o=x(()=>_e.workspace.trim()!==""&&!t.value);Re(()=>void uo());function s(){let u={workspace:_e.workspace.trim(),permission:_e.permission};for(let p of["model","effort","name","resume","message"]){let h=_e[p].trim();h&&(u[p]=h)}return u}async function r(){if(!(_e.permission==="full"&&!await _t({title:c("Start with full access?"),text:c("It will run commands as you in {folder}, with no sandbox and nobody to approve them. Model: {model}.",{folder:_e.workspace.trim(),model:_e.model||c("Default")}),ok:c("Start daemon"),danger:!0}))){t.value=!0,n.value=null;try{let u=await ke.spawn(s());nc(u.thread?.workspace??_e.workspace.trim()),await sn(),u.first&&!u.first.ok?xe(u.first.error?.message??c("The first message was not sent"),"bad"):xe(c("Daemon started")),Bn(),lt("chats",u.thread?.id??"")}catch(u){n.value=u instanceof Oe?u:new Oe(0,{message:String(u)})}finally{t.value=!1}}}function l(){let u=_e.name.trim()||c("Template {number}",{number:j.templates.length+1});j.templates.push({label:u,name:_e.name,model:_e.model,effort:_e.effort,permission:_e.permission,message:_e.message}),xe(c("Saved as a template"))}return(u,p)=>(f(),m(S,null,[C(jt,{title:i(c)("New daemon")},null,8,["title"]),a("div",Qk,[a("form",{class:"page-inner",onSubmit:Ye(r,["prevent"])},[C(vd),C(bd),C(gd),C(_d),C(hd),n.value?(f(),m("div",ex,[a("b",null,d(i(c)("It did not start.")),1),le(" "+d(n.value.message),1)])):N("v-if",!0),a("button",{class:"btn block",type:"submit",disabled:!o.value},[t.value?(f(),m("span",nx)):N("v-if",!0),le(" "+d(t.value?i(c)("Starting\u2026 this can take a few seconds"):i(c)("Start daemon")),1)],8,tx),a("div",ox,[a("button",{class:"btn sm ghost",type:"button",onClick:l},d(i(c)("Save as template")),1),a("button",{class:"btn sm ghost",type:"button",onClick:p[0]||(p[0]=h=>i(Bn)())},d(i(c)("Clear")),1)])],32)])],64))}});var sx={class:"simple-icon"},rx={class:"simple-text"},ix={key:0},ho=O({__name:"SimpleRow",props:{icon:{},title:{},subtitle:{},href:{},current:{type:Boolean}},setup(e){return(t,n)=>(f(),ae(ht(e.href?"a":"button"),{class:"simple-row",href:e.href,type:e.href?void 0:"button","aria-current":e.current?"true":void 0},{default:en(()=>[a("span",sx,[C(se,{name:e.icon},null,8,["name"])]),a("span",rx,[a("b",null,d(e.title),1),e.subtitle?(f(),m("small",ix,d(e.subtitle),1)):N("v-if",!0)]),C(se,{class:"simple-chev",name:"chevron",size:"sm"})]),_:1},8,["href","type","aria-current"]))}});var ax={class:"pane-list"},lx={class:"pane-group"},cx={class:"pane-group"},ux=["aria-label","onClick"],xd=O({__name:"NewPane",setup(e){function t(o){Bn(),nr(o),xe(c("Filled in from {name}",{name:o.label}))}async function n(o){let s=j.templates[o];if(!s)return;await _t({title:c("Delete {name}?",{name:s.label}),text:c("The template is removed from this browser."),ok:c("Delete"),danger:!0})&&j.templates.splice(o,1)}return(o,s)=>(f(),m(S,null,[C(Gt,{title:i(c)("New")},null,8,["title"]),a("div",ax,[a("div",lx,d(i(c)("Start from")),1),C(ho,{icon:"plus",title:i(c)("Blank"),subtitle:i(c)("Your defaults"),onClick:s[0]||(s[0]=r=>i(Bn)())},null,8,["title","subtitle"]),(f(!0),m(S,null,J(i(sr),r=>(f(),ae(ho,{key:r.label,icon:"bot",title:i(c)(r.label),subtitle:r.message,onClick:l=>t(r)},null,8,["title","subtitle","onClick"]))),128)),i(j).templates.length?(f(),m(S,{key:0},[a("div",cx,d(i(c)("Your templates")),1),(f(!0),m(S,null,J(i(j).templates,(r,l)=>(f(),m("div",{key:l,class:"template-row"},[C(ho,{icon:"bot",title:r.label,subtitle:r.message||r.permission,onClick:u=>t(r)},null,8,["title","subtitle","onClick"]),a("button",{class:"iconbtn","aria-label":i(c)("Delete"),onClick:u=>n(l)},[...s[1]||(s[1]=[a("span",{class:"template-x"},"\xD7",-1)])],8,ux)]))),128))],64)):N("v-if",!0)])],64))}});async function wd(e,t=160){if(!e.type.startsWith("image/"))throw new Error("not an image");let n=await createImageBitmap(e),o=Math.min(n.width,n.height),s=document.createElement("canvas");s.width=s.height=t;let r=s.getContext("2d");if(!r)throw new Error("no canvas");return r.drawImage(n,(n.width-o)/2,(n.height-o)/2,o,o,0,0,t,t),n.close(),s.toDataURL("image/jpeg",.85)}var dx={class:"card profile"},fx={class:"profile-side"},px={class:"actions"},Ed=O({__name:"ProfileCard",setup(e){let t=X(null);async function n(o){let s=o.target,r=s.files?.[0];if(s.value="",!!r)try{j.avatar=await wd(r)}catch{xe(c("That file is not a picture this browser can read."),"bad")}}return(o,s)=>(f(),m("div",dx,[C(fo,{size:"xl"}),a("div",fx,[a("b",null,d(i(c)("Your picture")),1),a("small",null,d(i(c)("Shown beside your messages. It stays in this browser.")),1),a("div",px,[a("button",{class:"btn sm",onClick:s[0]||(s[0]=r=>t.value?.click())},d(i(c)("Upload a picture")),1),i(j).avatar?(f(),m("button",{key:0,class:"btn sm ghost",onClick:s[1]||(s[1]=r=>i(j).avatar="")},d(i(c)("Use the default")),1)):N("v-if",!0)])]),a("input",{ref_key:"input",ref:t,type:"file",accept:"image/*",class:"sr",tabindex:"-1",onChange:n},null,544)]))}});var mx={class:"card"},hx={class:"card-title"},gx={class:"card-title"},_x={class:"card-title"},vx={class:"card-hint"},yx={class:"card-title"},Nd=O({__name:"AppearanceSection",setup(e){return(t,n)=>(f(),m(S,null,[C(Ed),a("div",mx,[a("div",hx,d(i(c)("Theme")),1),C(Dt,{modelValue:i(j).theme,"onUpdate:modelValue":n[0]||(n[0]=o=>i(j).theme=o),label:i(c)("Theme"),options:[{value:"auto",label:i(c)("System")},{value:"light",label:i(c)("Light")},{value:"dark",label:i(c)("Dark")}]},null,8,["modelValue","label","options"]),a("div",gx,d(i(c)("Text size")),1),C(Dt,{modelValue:i(j).size,"onUpdate:modelValue":n[1]||(n[1]=o=>i(j).size=o),label:i(c)("Text size"),options:[{value:"s",label:i(c)("Small")},{value:"m",label:i(c)("Medium")},{value:"l",label:i(c)("Large")}]},null,8,["modelValue","label","options"]),a("div",_x,d(i(c)("Messages")),1),C(Dt,{modelValue:i(j).render,"onUpdate:modelValue":n[2]||(n[2]=o=>i(j).render=o),label:i(c)("Messages"),options:[{value:"markdown",label:i(c)("Rendered")},{value:"source",label:i(c)("Source")}]},null,8,["modelValue","label","options"]),a("p",vx,d(i(c)("Rendered shows markdown with highlighted code and typeset math. Source shows the text exactly as it was written.")),1),a("div",yx,d(i(c)("Language")),1),C(Dt,{modelValue:i(j).language,"onUpdate:modelValue":n[3]||(n[3]=o=>i(j).language=o),label:i(c)("Language"),options:[{value:"en",label:"English"},{value:"zh",label:"\u4E2D\u6587"}]},null,8,["modelValue","label"])])],64))}});var qe=be({checked:!1,signedIn:!1,open:!1});Gl(()=>{qe.signedIn=!1});async function Sd(){try{let e=await ke.session();qe.signedIn=e.authenticated,qe.open=e.open===!0}catch{qe.signedIn=!1}qe.checked=!0}async function Cd(e){qe.signedIn=(await ke.login(e.trim())).authenticated}async function Xi(){try{await ke.logout()}finally{qe.signedIn=!1}}var bx={class:"card"},kx={class:"kv"},xx={class:"kv"},wx={class:"kv"},Ex={class:"kv"},Nx={class:"mono"},Sx={class:"kv"},Cx={class:"mono"},Tx={key:0,class:"card-hint"},zx={key:1,class:"card-hint"},Vx={key:2,class:"actions"},Td=O({__name:"ConnectionSection",setup(e){return(t,n)=>(f(),m(S,null,[a("div",bx,[a("div",kx,[a("span",null,d(i(c)("Gateway")),1),a("span",null,d(i(pe).status?.version??"\u2013"),1)]),a("div",xx,[a("span",null,d(i(c)("Live updates")),1),a("span",null,d(i(pe).live?i(c)("connected"):i(c)("reconnecting")),1)]),a("div",wx,[a("span",null,d(i(c)("Session broker")),1),a("span",null,d(i(pe).status?.broker.reachable?i(c)("connected"):i(c)("not connected")),1)]),a("div",Ex,[a("span",null,d(i(c)("This gateway is")),1),a("span",Nx,d(i(pe).status?.gateway.id??"\u2013"),1)]),a("div",Sx,[a("span",null,d(i(c)("Handle")),1),a("span",Cx,"@"+d(i(pe).status?.gateway.handle),1)])]),i(qe).open?(f(),m("p",Tx,d(i(c)("This gateway has no token: anyone on this machine can start agents that run commands as you.")),1)):(f(),m("p",zx,d(i(c)("Anyone signed in here can start agents that run commands as you. Keep the token private.")),1)),i(qe).open?N("v-if",!0):(f(),m("div",Vx,[a("button",{class:"btn danger",onClick:n[0]||(n[0]=(...o)=>i(Xi)&&i(Xi)(...o))},d(i(c)("Sign out")),1)]))],64))}});var Ox={class:"card-hint"},Dx={class:"actions"},zd=O({__name:"DataSection",setup(e){async function t(){await _t({title:c("Clear what this browser remembers?"),text:c("Drafts, templates, recent folders and preferences are removed from this browser. Sessions and daemons are not touched."),ok:c("Clear"),danger:!0})&&(rn.clear(),oc(),xe(c("Cleared")))}return(n,o)=>(f(),m(S,null,[a("p",Ox,d(i(c)("The gateway itself keeps only which messages you have read. Everything else here lives in this browser.")),1),a("div",Dx,[a("button",{class:"btn danger",onClick:t},d(i(c)("Clear browser data")),1)])],64))}});var pr=class{constructor(t){this.handlers=t}socket=null;attempts=0;timer;wanted=!1;start(){if(this.wanted=!0,this.socket)return;let t=location.protocol==="https:"?"wss:":"ws:",n=new WebSocket(`${t}//${location.host}/api/events`);this.socket=n,n.onopen=()=>{this.attempts=0,this.handlers.connection(!0)},n.onmessage=o=>{try{this.handlers.event(JSON.parse(String(o.data)))}catch{}},n.onclose=o=>{if(this.socket=null,this.handlers.connection(!1),o.code===4401){this.handlers.unauthorized();return}this.wanted&&(this.attempts+=1,this.timer=setTimeout(()=>this.start(),Math.min(8e3,400*2**Math.min(this.attempts,5))))},n.onerror=()=>n.close()}stop(){this.wanted=!1,clearTimeout(this.timer),this.socket?.close(),this.socket=null}};var es=null;function Mx(e){if(!j.notify||typeof Notification>"u"||Notification.permission!=="granted"||!document.hidden&&ye.nav==="chats"&&ye.arg===e.id)return;let n=new Notification(e.sender,{body:e.text,tag:e.id});n.onclick=()=>{window.focus(),location.hash=`#/chats/${encodeURIComponent(e.id)}`,n.close()}}function Ax(e){e.type==="threads"?(ui(e.threads,e.status),Z.id&&!document.hidden&&fn()):e.type==="thread"?mi(e.id):e.type==="stream"?rc(e.id,e.event):e.type==="inbound"?Mx(e):e.type==="traffic"?(Xc(e.message),ou(e.message)):e.type==="graph"&&io().catch(()=>{})}function Vd(){es?.stop(),es=new pr({event:Ax,connection(e){pe.live=e,e&&(ac(),sn().catch(()=>{}),io().catch(()=>{}),Z.id&&mi(Z.id))},unauthorized(){qe.signedIn=!1}}),es.start()}function Od(){es?.stop(),es=null,pe.live=!1}function Yi(){return typeof Notification>"u"?c("Not supported by this browser"):Notification.permission}async function Dd(){return typeof Notification>"u"?!1:(Notification.permission==="default"?await Notification.requestPermission():Notification.permission)==="granted"}var Px={class:"card"},Rx={class:"kv"},Md=O({__name:"NotificationsSection",setup(e){let t=X(Yi());async function n(o){o&&!await Dd()&&(j.notify=!1,xe(c("Notifications are blocked in this browser."),"bad")),t.value=Yi()}return(o,s)=>(f(),m("div",Px,[C(bn,{"model-value":i(j).notify,label:i(c)("Notify when a session replies"),hint:i(c)("Only while this page is open, and only for a chat you are not looking at."),"onUpdate:modelValue":s[0]||(s[0]=r=>{i(j).notify=r,n(r)})},null,8,["model-value","label","hint"]),a("div",Rx,[a("span",null,d(i(c)("Permission")),1),a("span",null,d(t.value),1)])]))}});var Ix={class:"page"},$x={class:"page-inner"},Ad=O({__name:"SettingsPage",setup(e){let t={connection:Td,appearance:Nd,notifications:Md,data:zd},n=x(()=>ye.arg in t?ye.arg:"connection"),o=x(()=>c(dr.find(s=>s.id===n.value)?.label??"Settings"));return(s,r)=>(f(),m(S,null,[C(jt,{title:o.value,back:""},null,8,["title"]),a("div",Ix,[a("div",$x,[(f(),ae(ht(t[n.value])))])])],64))}});var Bx={class:"login"},Lx=["placeholder","aria-label"],Fx={class:"err",role:"alert"},Ux=["disabled"],Hx={key:0,class:"spin"},Pd=O({__name:"LoginScreen",setup(e){let t=X(new URLSearchParams(location.hash.replace(/^#/,"")).get("token")??""),n=X(""),o=X(!1);t.value&&history.replaceState(null,"",location.pathname);async function s(){o.value=!0,n.value="";try{await Cd(t.value)}catch(r){n.value=r instanceof Oe?r.message:String(r)}finally{o.value=!1}}return t.value&&s(),(r,l)=>(f(),m("div",Bx,[a("form",{onSubmit:Ye(s,["prevent"])},[l[1]||(l[1]=a("img",{src:"/static/logo.svg",alt:"",width:"72",height:"72"},null,-1)),l[2]||(l[2]=a("h1",null,"ZettCode Gateway",-1)),a("p",null,d(i(c)("Type the token the gateway printed when it started.")),1),Ee(a("input",{"onUpdate:modelValue":l[0]||(l[0]=u=>t.value=u),type:"password",autocomplete:"current-password",autocapitalize:"off",spellcheck:"false",placeholder:i(c)("Token"),"aria-label":i(c)("Token")},null,8,Lx),[[Ae,t.value]]),a("div",Fx,d(n.value),1),a("button",{class:"btn block",type:"submit",disabled:o.value||!t.value.trim()},[o.value?(f(),m("span",Hx)):N("v-if",!0),le(d(i(c)("Sign in")),1)],8,Ux)],32)]))}});var Kx=["aria-label"],Gx=["href","aria-current"],jx={key:0,class:"badge"},Wx=["title"],Rd=O({__name:"Rail",setup(e){let t=[{nav:"chats",label:"Chats",icon:"chat"},{nav:"new",label:"New",icon:"plus"},{nav:"config",label:"Config",icon:"config"},{nav:"logs",label:"Logs",icon:"logs"},{nav:"graph",label:"Graph",icon:"graph"},{nav:"settings",label:"Settings",icon:"settings"}],n=x(()=>pe.live?pe.status?.broker.reachable===!1?"bad":"ok":"warn"),o=x(()=>pe.live?pe.status?.broker.reachable===!1?c("No broker"):c("Online"):c("Connecting"));return(s,r)=>(f(),m("nav",{class:"rail","aria-label":i(c)("Sections")},[r[0]||(r[0]=a("div",{class:"rail-logo"},[a("img",{src:"/static/logo.svg",alt:"",width:"36",height:"36"})],-1)),(f(),m(S,null,J(t,l=>a("a",{key:l.nav,class:"rail-tab",href:i(je)(l.nav),"aria-current":i(ye).nav===l.nav?"page":void 0},[C(se,{name:l.icon},null,8,["name"]),a("span",null,d(i(c)(l.label)),1),l.nav==="chats"&&i(li)?(f(),m("span",jx,d(i(so)(i(li))),1)):N("v-if",!0)],8,Gx)),64)),r[1]||(r[1]=a("div",{class:"rail-spacer"},null,-1)),a("div",{class:"rail-status",title:o.value},[a("span",{class:ie(["rail-dot",n.value])},null,2),a("span",null,d(o.value),1)],8,Wx)],8,Kx))}});var Xx={class:"pane-list"},qi=O({__name:"SectionPane",props:{nav:{},title:{},sections:{}},setup(e){return(t,n)=>(f(),m(S,null,[C(Gt,{title:e.title},null,8,["title"]),a("div",Xx,[(f(!0),m(S,null,J(e.sections,o=>(f(),ae(ho,{key:o.id,icon:o.icon,title:i(c)(o.label),href:i(je)(e.nav,o.id),current:i(ye).nav===e.nav&&i(ye).arg===o.id},null,8,["icon","title","href","current"]))),128))])],64))}});var Yx={class:"welcome"},Id=O({__name:"WelcomeMain",setup(e){return(t,n)=>(f(),m("div",Yx,[n[1]||(n[1]=a("img",{src:"/static/logo.svg",alt:"",width:"84",height:"84"},null,-1)),a("b",null,d(i(c)("Pick a conversation")),1),a("span",null,d(i(c)("Choose a session on the left, or start a new daemon.")),1),a("button",{class:"btn",onClick:n[0]||(n[0]=o=>i(lt)("new"))},d(i(c)("New daemon")),1)]))}});var qx={id:"root"},Jx=["data-view","data-fullscreen"],Zx={class:"pane"},Qx={class:"main"},$d=O({__name:"App",setup(e){let t=x(()=>{switch(ye.nav){case"new":return{component:xd,props:{}};case"config":return{component:qi,props:{nav:"config",title:c("Config"),sections:ur}};case"logs":return{component:ad,props:{}};case"graph":return{component:Bu,props:{}};case"settings":return{component:qi,props:{nav:"settings",title:c("Settings"),sections:dr}};default:return{component:mu,props:{}}}}),n=x(()=>{switch(ye.nav){case"new":return{component:kd,props:{},key:"new"};case"config":return{component:id,props:{},key:"config"};case"graph":return{component:Xu,props:{},key:"graph"};case"settings":return{component:Ad,props:{},key:"settings"};case"logs":return ye.arg?{component:fd,props:{id:ye.arg},key:`logs:${ye.arg}`}:null;default:return ye.arg?Ai(ye.arg)?{component:$u,props:{name:Zc(ye.arg)},key:`group:${ye.arg}`}:{component:Ru,props:{id:ye.arg},key:`chat:${ye.arg}`}:null}}),o=x(()=>n.value&&(ye.arg||ye.nav==="new"||ye.nav==="graph")?"main":"pane"),s=x(()=>ye.nav==="chats"&&ye.arg!=="");return(r,l)=>(f(),m("div",qx,[i(qe).checked&&!i(qe).signedIn?(f(),ae(Pd,{key:0})):i(qe).checked?(f(),m("div",{key:1,class:"app","data-view":o.value,"data-fullscreen":s.value},[C(Rd),a("section",Zx,[(f(),ae(ht(t.value.component),vr(ei(t.value.props)),null,16))]),a("main",Qx,[n.value?(f(),ae(ht(n.value.component),Fo({key:n.value.key},n.value.props),null,16)):(f(),ae(Id,{key:1}))])],8,Jx)):N("v-if",!0),C(md),C(pd)]))}});tc();Hl();function ts(){let e=window.visualViewport,t=document.documentElement,n=e?.height??window.innerHeight;t.style.setProperty("--app-h",`${n}px`),t.style.setProperty("--app-top",`${e?.offsetTop??0}px`),t.dataset.keyboard=String(window.innerHeight-n>120),(window.scrollY!==0||window.scrollX!==0)&&window.scrollTo(0,0)}ts();window.visualViewport?.addEventListener("resize",ts);window.visualViewport?.addEventListener("scroll",ts);window.addEventListener("scroll",ts,{passive:!0});window.addEventListener("orientationchange",ts);Bl($d).mount("#app");ve(()=>qe.signedIn,e=>e?Vd():Od());Sd();