sensorium-mcp 3.0.24 → 3.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/config.d.ts +2 -2
- package/dist/config.js +4 -4
- package/dist/config.js.map +1 -1
- package/dist/daily-session.d.ts.map +1 -1
- package/dist/daily-session.js +15 -2
- package/dist/daily-session.js.map +1 -1
- package/dist/dashboard/routes/data.d.ts +0 -1
- package/dist/dashboard/routes/data.d.ts.map +1 -1
- package/dist/dashboard/routes/data.js +1 -13
- package/dist/dashboard/routes/data.js.map +1 -1
- package/dist/dashboard/routes/snapshots.d.ts +18 -0
- package/dist/dashboard/routes/snapshots.d.ts.map +1 -0
- package/dist/dashboard/routes/snapshots.js +162 -0
- package/dist/dashboard/routes/snapshots.js.map +1 -0
- package/dist/dashboard/routes/threads.d.ts +2 -2
- package/dist/dashboard/routes/threads.d.ts.map +1 -1
- package/dist/dashboard/routes/threads.js +24 -8
- package/dist/dashboard/routes/threads.js.map +1 -1
- package/dist/dashboard/routes.d.ts.map +1 -1
- package/dist/dashboard/routes.js +14 -4
- package/dist/dashboard/routes.js.map +1 -1
- package/dist/dashboard/spa.html +10 -10
- package/dist/data/interfaces.d.ts +1 -0
- package/dist/data/interfaces.d.ts.map +1 -1
- package/dist/data/memory/bootstrap.d.ts +0 -4
- package/dist/data/memory/bootstrap.d.ts.map +1 -1
- package/dist/data/memory/bootstrap.js +2 -30
- package/dist/data/memory/bootstrap.js.map +1 -1
- package/dist/data/memory/consolidation.d.ts +7 -0
- package/dist/data/memory/consolidation.d.ts.map +1 -1
- package/dist/data/memory/consolidation.js +19 -1
- package/dist/data/memory/consolidation.js.map +1 -1
- package/dist/data/memory/index.d.ts +1 -2
- package/dist/data/memory/index.d.ts.map +1 -1
- package/dist/data/memory/index.js +1 -2
- package/dist/data/memory/index.js.map +1 -1
- package/dist/data/memory/migration-runner.d.ts +1 -1
- package/dist/data/memory/migration-runner.d.ts.map +1 -1
- package/dist/data/memory/migration-runner.js +11 -1
- package/dist/data/memory/migration-runner.js.map +1 -1
- package/dist/data/memory/narrative.d.ts.map +1 -1
- package/dist/data/memory/narrative.js +49 -22
- package/dist/data/memory/narrative.js.map +1 -1
- package/dist/data/memory/reflection.d.ts +1 -1
- package/dist/data/memory/reflection.d.ts.map +1 -1
- package/dist/data/memory/reflection.js +88 -17
- package/dist/data/memory/reflection.js.map +1 -1
- package/dist/data/memory/schema-ddl.d.ts +1 -1
- package/dist/data/memory/schema-ddl.d.ts.map +1 -1
- package/dist/data/memory/schema-ddl.js +1 -22
- package/dist/data/memory/schema-ddl.js.map +1 -1
- package/dist/data/memory/schema.d.ts.map +1 -1
- package/dist/data/memory/schema.js +4 -0
- package/dist/data/memory/schema.js.map +1 -1
- package/dist/data/memory/semantic.d.ts +7 -2
- package/dist/data/memory/semantic.d.ts.map +1 -1
- package/dist/data/memory/semantic.js +26 -12
- package/dist/data/memory/semantic.js.map +1 -1
- package/dist/data/memory/synthesis.d.ts +4 -24
- package/dist/data/memory/synthesis.d.ts.map +1 -1
- package/dist/data/memory/synthesis.js +76 -190
- package/dist/data/memory/synthesis.js.map +1 -1
- package/dist/data/memory/thread-registry.d.ts +7 -0
- package/dist/data/memory/thread-registry.d.ts.map +1 -1
- package/dist/data/memory/thread-registry.js +38 -3
- package/dist/data/memory/thread-registry.js.map +1 -1
- package/dist/data/memory/topic-shift.d.ts +1 -1
- package/dist/data/memory/topic-shift.js +1 -1
- package/dist/data/memory/utils.d.ts +1 -1
- package/dist/data/memory/utils.js +1 -1
- package/dist/http-server.d.ts.map +1 -1
- package/dist/http-server.js +27 -5
- package/dist/http-server.js.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +2 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +59 -4
- package/dist/logger.js.map +1 -1
- package/dist/server/factory.js +6 -3
- package/dist/server/factory.js.map +1 -1
- package/dist/services/agent-spawn.service.d.ts.map +1 -1
- package/dist/services/agent-spawn.service.js +38 -19
- package/dist/services/agent-spawn.service.js.map +1 -1
- package/dist/services/background-runner.d.ts +1 -0
- package/dist/services/background-runner.d.ts.map +1 -1
- package/dist/services/background-runner.js +37 -0
- package/dist/services/background-runner.js.map +1 -1
- package/dist/services/consolidation.service.d.ts.map +1 -1
- package/dist/services/consolidation.service.js +149 -67
- package/dist/services/consolidation.service.js.map +1 -1
- package/dist/services/dispatcher/lock.d.ts +3 -3
- package/dist/services/dispatcher/lock.d.ts.map +1 -1
- package/dist/services/dispatcher/lock.js +9 -9
- package/dist/services/dispatcher/lock.js.map +1 -1
- package/dist/services/dispatcher/poller.d.ts.map +1 -1
- package/dist/services/dispatcher/poller.js +3 -49
- package/dist/services/dispatcher/poller.js.map +1 -1
- package/dist/services/keeper.service.d.ts.map +1 -1
- package/dist/services/keeper.service.js +20 -3
- package/dist/services/keeper.service.js.map +1 -1
- package/dist/services/memory-briefing.service.d.ts.map +1 -1
- package/dist/services/memory-briefing.service.js +7 -16
- package/dist/services/memory-briefing.service.js.map +1 -1
- package/dist/services/process.service.d.ts.map +1 -1
- package/dist/services/process.service.js +10 -3
- package/dist/services/process.service.js.map +1 -1
- package/dist/services/thread-health.service.d.ts +2 -1
- package/dist/services/thread-health.service.d.ts.map +1 -1
- package/dist/services/thread-health.service.js +4 -5
- package/dist/services/thread-health.service.js.map +1 -1
- package/dist/services/thread-lifecycle.service.d.ts.map +1 -1
- package/dist/services/thread-lifecycle.service.js +7 -0
- package/dist/services/thread-lifecycle.service.js.map +1 -1
- package/dist/services/worker-cleanup.service.d.ts.map +1 -1
- package/dist/services/worker-cleanup.service.js +5 -15
- package/dist/services/worker-cleanup.service.js.map +1 -1
- package/dist/sessions.d.ts +2 -0
- package/dist/sessions.d.ts.map +1 -1
- package/dist/sessions.js +12 -0
- package/dist/sessions.js.map +1 -1
- package/dist/tools/defs/memory-defs.js +7 -7
- package/dist/tools/defs/memory-defs.js.map +1 -1
- package/dist/tools/defs/session-defs.d.ts.map +1 -1
- package/dist/tools/defs/session-defs.js +6 -4
- package/dist/tools/defs/session-defs.js.map +1 -1
- package/dist/tools/delegate-tool.d.ts.map +1 -1
- package/dist/tools/delegate-tool.js +13 -7
- package/dist/tools/delegate-tool.js.map +1 -1
- package/dist/tools/memory-tools.d.ts.map +1 -1
- package/dist/tools/memory-tools.js +25 -27
- package/dist/tools/memory-tools.js.map +1 -1
- package/dist/tools/session-tools.d.ts +1 -0
- package/dist/tools/session-tools.d.ts.map +1 -1
- package/dist/tools/session-tools.js +2 -1
- package/dist/tools/session-tools.js.map +1 -1
- package/dist/tools/start-session-tool.d.ts.map +1 -1
- package/dist/tools/start-session-tool.js +37 -21
- package/dist/tools/start-session-tool.js.map +1 -1
- package/dist/tools/wait/media-processor.d.ts.map +1 -1
- package/dist/tools/wait/media-processor.js +6 -2
- package/dist/tools/wait/media-processor.js.map +1 -1
- package/dist/tools/wait/message-delivery.d.ts.map +1 -1
- package/dist/tools/wait/message-delivery.js +27 -6
- package/dist/tools/wait/message-delivery.js.map +1 -1
- package/dist/tools/wait/message-processing.d.ts.map +1 -1
- package/dist/tools/wait/message-processing.js +17 -2
- package/dist/tools/wait/message-processing.js.map +1 -1
- package/dist/tools/wait/poll-loop.d.ts +1 -0
- package/dist/tools/wait/poll-loop.d.ts.map +1 -1
- package/dist/tools/wait/poll-loop.js +27 -10
- package/dist/tools/wait/poll-loop.js.map +1 -1
- package/package.json +1 -1
- package/templates/azure-devops-securevault.default.md +36 -0
- package/dist/data/memory/procedures.d.ts +0 -51
- package/dist/data/memory/procedures.d.ts.map +0 -1
- package/dist/data/memory/procedures.js +0 -140
- package/dist/data/memory/procedures.js.map +0 -1
package/dist/dashboard/spa.html
CHANGED
|
@@ -45,31 +45,31 @@
|
|
|
45
45
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
46
46
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
47
47
|
|
|
48
|
-
<script type="module" crossorigin>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const
|
|
48
|
+
<script type="module" crossorigin>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function s(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function n(o){if(o.ep)return;o.ep=!0;const l=s(o);fetch(o.href,l)}})();/**
|
|
49
49
|
* @vue/shared v3.5.31
|
|
50
50
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
51
51
|
* @license MIT
|
|
52
|
-
**/function
|
|
52
|
+
**/function an(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const xe={},Dt=[],st=()=>{},po=()=>!1,Es=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),As=e=>e.startsWith("onUpdate:"),Ae=Object.assign,cn=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},yr=Object.prototype.hasOwnProperty,ce=(e,t)=>yr.call(e,t),Z=Array.isArray,Rt=e=>us(e)==="[object Map]",Bt=e=>us(e)==="[object Set]",In=e=>us(e)==="[object Date]",X=e=>typeof e=="function",Ce=e=>typeof e=="string",ot=e=>typeof e=="symbol",fe=e=>e!==null&&typeof e=="object",mo=e=>(fe(e)||X(e))&&X(e.then)&&X(e.catch),xo=Object.prototype.toString,us=e=>xo.call(e),br=e=>us(e).slice(8,-1),ho=e=>us(e)==="[object Object]",un=e=>Ce(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Zt=an(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Is=e=>{const t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},_r=/-\w/g,Re=Is(e=>e.replace(_r,t=>t.slice(1).toUpperCase())),wr=/\B([A-Z])/g,St=Is(e=>e.replace(wr,"-$1").toLowerCase()),Ps=Is(e=>e.charAt(0).toUpperCase()+e.slice(1)),Vs=Is(e=>e?`on${Ps(e)}`:""),tt=(e,t)=>!Object.is(e,t),gs=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},go=(e,t,s,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},Ms=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Pn;const Os=()=>Pn||(Pn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Lt(e){if(Z(e)){const t={};for(let s=0;s<e.length;s++){const n=e[s],o=Ce(n)?$r(n):Lt(n);if(o)for(const l in o)t[l]=o[l]}return t}else if(Ce(e)||fe(e))return e}const kr=/;(?![^(]*\))/g,Sr=/:([^]+)/,Cr=/\/\*[^]*?\*\//g;function $r(e){const t={};return e.replace(Cr,"").split(kr).forEach(s=>{if(s){const n=s.split(Sr);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function J(e){let t="";if(Ce(e))t=e;else if(Z(e))for(let s=0;s<e.length;s++){const n=J(e[s]);n&&(t+=n+" ")}else if(fe(e))for(const s in e)e[s]&&(t+=s+" ");return t.trim()}const Tr="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Er=an(Tr);function vo(e){return!!e||e===""}function Ar(e,t){if(e.length!==t.length)return!1;let s=!0;for(let n=0;s&&n<e.length;n++)s=Kt(e[n],t[n]);return s}function Kt(e,t){if(e===t)return!0;let s=In(e),n=In(t);if(s||n)return s&&n?e.getTime()===t.getTime():!1;if(s=ot(e),n=ot(t),s||n)return e===t;if(s=Z(e),n=Z(t),s||n)return s&&n?Ar(e,t):!1;if(s=fe(e),n=fe(t),s||n){if(!s||!n)return!1;const o=Object.keys(e).length,l=Object.keys(t).length;if(o!==l)return!1;for(const a in e){const c=e.hasOwnProperty(a),u=t.hasOwnProperty(a);if(c&&!u||!c&&u||!Kt(e[a],t[a]))return!1}}return String(e)===String(t)}function dn(e,t){return e.findIndex(s=>Kt(s,t))}const yo=e=>!!(e&&e.__v_isRef===!0),_=e=>Ce(e)?e:e==null?"":Z(e)||fe(e)&&(e.toString===xo||!X(e.toString))?yo(e)?_(e.value):JSON.stringify(e,bo,2):String(e),bo=(e,t)=>yo(t)?bo(e,t.value):Rt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,o],l)=>(s[Fs(n,l)+" =>"]=o,s),{})}:Bt(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Fs(s))}:ot(t)?Fs(t):fe(t)&&!Z(t)&&!ho(t)?String(t):t,Fs=(e,t="")=>{var s;return ot(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};/**
|
|
53
53
|
* @vue/reactivity v3.5.31
|
|
54
54
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
55
55
|
* @license MIT
|
|
56
|
-
**/let je;class Er{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=je,!t&&je&&(this.index=(je.scopes||(je.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].pause();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].resume();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].resume()}}run(t){if(this._active){const s=je;try{return je=this,t()}finally{je=s}}}on(){++this._on===1&&(this.prevScope=je,je=this)}off(){this._on>0&&--this._on===0&&(je=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s<n;s++)this.effects[s].stop();for(this.effects.length=0,s=0,n=this.cleanups.length;s<n;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){for(s=0,n=this.scopes.length;s<n;s++)this.scopes[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function Ir(){return je}let pe;const Us=new WeakSet;class bo{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)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Us.has(this)&&(Us.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||wo(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Pn(this),So(this);const t=pe,s=ze;pe=this,ze=!0;try{return this.fn()}finally{ko(this),pe=t,ze=s,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)pn(t);this.deps=this.depsTail=void 0,Pn(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Us.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Gs(this)&&this.run()}get dirty(){return Gs(this)}}let _o=0,Gt,Yt;function wo(e,t=!1){if(e.flags|=8,t){e.next=Yt,Yt=e;return}e.next=Gt,Gt=e}function dn(){_o++}function fn(){if(--_o>0)return;if(Yt){let t=Yt;for(Yt=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;Gt;){let t=Gt;for(Gt=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function So(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ko(e){let t,s=e.depsTail,n=s;for(;n;){const o=n.prevDep;n.version===-1?(n===s&&(s=o),pn(n),Pr(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=o}e.deps=t,e.depsTail=s}function Gs(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Co(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Co(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ts)||(e.globalVersion=ts,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Gs(e))))return;e.flags|=2;const t=e.dep,s=pe,n=ze;pe=e,ze=!0;try{So(e);const o=e.fn(e._value);(t.version===0||st(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{pe=s,ze=n,ko(e),e.flags&=-3}}function pn(e,t=!1){const{dep:s,prevSub:n,nextSub:o}=e;if(n&&(n.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let r=s.computed.deps;r;r=r.nextDep)pn(r,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function Pr(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let ze=!0;const To=[];function pt(){To.push(ze),ze=!1}function ht(){const e=To.pop();ze=e===void 0?!0:e}function Pn(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=pe;pe=void 0;try{t()}finally{pe=s}}}let ts=0;class Mr{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class hn{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||!ze||pe===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==pe)s=this.activeLink=new Mr(pe,this),pe.deps?(s.prevDep=pe.depsTail,pe.depsTail.nextDep=s,pe.depsTail=s):pe.deps=pe.depsTail=s,$o(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=pe.depsTail,s.nextDep=void 0,pe.depsTail.nextDep=s,pe.depsTail=s,pe.deps===s&&(pe.deps=n)}return s}trigger(t){this.version++,ts++,this.notify(t)}notify(t){dn();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{fn()}}}function $o(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)$o(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const Ys=new WeakMap,Tt=Symbol(""),Zs=Symbol(""),ss=Symbol("");function Ee(e,t,s){if(ze&&pe){let n=Ys.get(e);n||Ys.set(e,n=new Map);let o=n.get(s);o||(n.set(s,o=new hn),o.map=n,o.key=s),o.track()}}function ut(e,t,s,n,o,r){const l=Ys.get(e);if(!l){ts++;return}const a=u=>{u&&u.trigger()};if(dn(),t==="clear")l.forEach(a);else{const u=J(e),h=u&&cn(s);if(u&&s==="length"){const f=Number(n);l.forEach((p,v)=>{(v==="length"||v===ss||!rt(v)&&v>=f)&&a(p)})}else switch((s!==void 0||l.has(void 0))&&a(l.get(s)),h&&a(l.get(ss)),t){case"add":u?h&&a(l.get("length")):(a(l.get(Tt)),Dt(e)&&a(l.get(Zs)));break;case"delete":u||(a(l.get(Tt)),Dt(e)&&a(l.get(Zs)));break;case"set":Dt(e)&&a(l.get(Tt));break}}fn()}function Pt(e){const t=oe(e);return t===e?t:(Ee(t,"iterate",ss),Ue(e)?t:t.map(Je))}function Os(e){return Ee(e=oe(e),"iterate",ss),e}function et(e,t){return mt(e)?Nt($t(e)?Je(t):t):Je(t)}const Or={__proto__:null,[Symbol.iterator](){return Hs(this,Symbol.iterator,e=>et(this,e))},concat(...e){return Pt(this).concat(...e.map(t=>J(t)?Pt(t):t))},entries(){return Hs(this,"entries",e=>(e[1]=et(this,e[1]),e))},every(e,t){return lt(this,"every",e,t,void 0,arguments)},filter(e,t){return lt(this,"filter",e,t,s=>s.map(n=>et(this,n)),arguments)},find(e,t){return lt(this,"find",e,t,s=>et(this,s),arguments)},findIndex(e,t){return lt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return lt(this,"findLast",e,t,s=>et(this,s),arguments)},findLastIndex(e,t){return lt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return lt(this,"forEach",e,t,void 0,arguments)},includes(...e){return Bs(this,"includes",e)},indexOf(...e){return Bs(this,"indexOf",e)},join(e){return Pt(this).join(e)},lastIndexOf(...e){return Bs(this,"lastIndexOf",e)},map(e,t){return lt(this,"map",e,t,void 0,arguments)},pop(){return Bt(this,"pop")},push(...e){return Bt(this,"push",e)},reduce(e,...t){return Mn(this,"reduce",e,t)},reduceRight(e,...t){return Mn(this,"reduceRight",e,t)},shift(){return Bt(this,"shift")},some(e,t){return lt(this,"some",e,t,void 0,arguments)},splice(...e){return Bt(this,"splice",e)},toReversed(){return Pt(this).toReversed()},toSorted(e){return Pt(this).toSorted(e)},toSpliced(...e){return Pt(this).toSpliced(...e)},unshift(...e){return Bt(this,"unshift",e)},values(){return Hs(this,"values",e=>et(this,e))}};function Hs(e,t,s){const n=Os(e),o=n[t]();return n!==e&&!Ue(e)&&(o._next=o.next,o.next=()=>{const r=o._next();return r.done||(r.value=s(r.value)),r}),o}const Dr=Array.prototype;function lt(e,t,s,n,o,r){const l=Os(e),a=l!==e&&!Ue(e),u=l[t];if(u!==Dr[t]){const p=u.apply(e,r);return a?Je(p):p}let h=s;l!==e&&(a?h=function(p,v){return s.call(this,et(e,p),v,e)}:s.length>2&&(h=function(p,v){return s.call(this,p,v,e)}));const f=u.call(l,h,n);return a&&o?o(f):f}function Mn(e,t,s,n){const o=Os(e),r=o!==e&&!Ue(e);let l=s,a=!1;o!==e&&(r?(a=n.length===0,l=function(h,f,p){return a&&(a=!1,h=et(e,h)),s.call(this,h,et(e,f),p,e)}):s.length>3&&(l=function(h,f,p){return s.call(this,h,f,p,e)}));const u=o[t](l,...n);return a?et(e,u):u}function Bs(e,t,s){const n=oe(e);Ee(n,"iterate",ss);const o=n[t](...s);return(o===-1||o===!1)&&vn(s[0])?(s[0]=oe(s[0]),n[t](...s)):o}function Bt(e,t,s=[]){pt(),dn();const n=oe(e)[t].apply(e,s);return fn(),ht(),n}const Rr=ln("__proto__,__v_isRef,__isVue"),Ao=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(rt));function jr(e){rt(e)||(e=String(e));const t=oe(this);return Ee(t,"has",e),t.hasOwnProperty(e)}class Eo{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const o=this._isReadonly,r=this._isShallow;if(s==="__v_isReactive")return!o;if(s==="__v_isReadonly")return o;if(s==="__v_isShallow")return r;if(s==="__v_raw")return n===(o?r?zr:Oo:r?Mo:Po).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const l=J(t);if(!o){let u;if(l&&(u=Or[s]))return u;if(s==="hasOwnProperty")return jr}const a=Reflect.get(t,s,Pe(t)?t:n);if((rt(s)?Ao.has(s):Rr(s))||(o||Ee(t,"get",s),r))return a;if(Pe(a)){const u=l&&cn(s)?a:a.value;return o&&ae(u)?Xs(u):u}return ae(a)?o?Xs(a):gn(a):a}}class Io extends Eo{constructor(t=!1){super(!1,t)}set(t,s,n,o){let r=t[s];const l=J(t)&&cn(s);if(!this._isShallow){const h=mt(r);if(!Ue(n)&&!mt(n)&&(r=oe(r),n=oe(n)),!l&&Pe(r)&&!Pe(n))return h||(r.value=n),!0}const a=l?Number(s)<t.length:re(t,s),u=Reflect.set(t,s,n,Pe(t)?t:o);return t===oe(o)&&(a?st(n,r)&&ut(t,"set",s,n):ut(t,"add",s,n)),u}deleteProperty(t,s){const n=re(t,s);t[s];const o=Reflect.deleteProperty(t,s);return o&&n&&ut(t,"delete",s,void 0),o}has(t,s){const n=Reflect.has(t,s);return(!rt(s)||!Ao.has(s))&&Ee(t,"has",s),n}ownKeys(t){return Ee(t,"iterate",J(t)?"length":Tt),Reflect.ownKeys(t)}}class Nr extends Eo{constructor(t=!1){super(!0,t)}set(t,s){return!0}deleteProperty(t,s){return!0}}const Lr=new Io,Fr=new Nr,Vr=new Io(!0);const Qs=e=>e,ds=e=>Reflect.getPrototypeOf(e);function Ur(e,t,s){return function(...n){const o=this.__v_raw,r=oe(o),l=Dt(r),a=e==="entries"||e===Symbol.iterator&&l,u=e==="keys"&&l,h=o[e](...n),f=s?Qs:t?Nt:Je;return!t&&Ee(r,"iterate",u?Zs:Tt),Ae(Object.create(h),{next(){const{value:p,done:v}=h.next();return v?{value:p,done:v}:{value:a?[f(p[0]),f(p[1])]:f(p),done:v}}})}}function fs(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Hr(e,t){const s={get(o){const r=this.__v_raw,l=oe(r),a=oe(o);e||(st(o,a)&&Ee(l,"get",o),Ee(l,"get",a));const{has:u}=ds(l),h=t?Qs:e?Nt:Je;if(u.call(l,o))return h(r.get(o));if(u.call(l,a))return h(r.get(a));r!==l&&r.get(o)},get size(){const o=this.__v_raw;return!e&&Ee(oe(o),"iterate",Tt),o.size},has(o){const r=this.__v_raw,l=oe(r),a=oe(o);return e||(st(o,a)&&Ee(l,"has",o),Ee(l,"has",a)),o===a?r.has(o):r.has(o)||r.has(a)},forEach(o,r){const l=this,a=l.__v_raw,u=oe(a),h=t?Qs:e?Nt:Je;return!e&&Ee(u,"iterate",Tt),a.forEach((f,p)=>o.call(r,h(f),h(p),l))}};return Ae(s,e?{add:fs("add"),set:fs("set"),delete:fs("delete"),clear:fs("clear")}:{add(o){const r=oe(this),l=ds(r),a=oe(o),u=!t&&!Ue(o)&&!mt(o)?a:o;return l.has.call(r,u)||st(o,u)&&l.has.call(r,o)||st(a,u)&&l.has.call(r,a)||(r.add(u),ut(r,"add",u,u)),this},set(o,r){!t&&!Ue(r)&&!mt(r)&&(r=oe(r));const l=oe(this),{has:a,get:u}=ds(l);let h=a.call(l,o);h||(o=oe(o),h=a.call(l,o));const f=u.call(l,o);return l.set(o,r),h?st(r,f)&&ut(l,"set",o,r):ut(l,"add",o,r),this},delete(o){const r=oe(this),{has:l,get:a}=ds(r);let u=l.call(r,o);u||(o=oe(o),u=l.call(r,o)),a&&a.call(r,o);const h=r.delete(o);return u&&ut(r,"delete",o,void 0),h},clear(){const o=oe(this),r=o.size!==0,l=o.clear();return r&&ut(o,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(o=>{s[o]=Ur(o,e,t)}),s}function mn(e,t){const s=Hr(e,t);return(n,o,r)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?n:Reflect.get(re(s,o)&&o in n?s:n,o,r)}const Br={get:mn(!1,!1)},Wr={get:mn(!1,!0)},Kr={get:mn(!0,!1)};const Po=new WeakMap,Mo=new WeakMap,Oo=new WeakMap,zr=new WeakMap;function Jr(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function qr(e){return e.__v_skip||!Object.isExtensible(e)?0:Jr(yr(e))}function gn(e){return mt(e)?e:xn(e,!1,Lr,Br,Po)}function Gr(e){return xn(e,!1,Vr,Wr,Mo)}function Xs(e){return xn(e,!0,Fr,Kr,Oo)}function xn(e,t,s,n,o){if(!ae(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const r=qr(e);if(r===0)return e;const l=o.get(e);if(l)return l;const a=new Proxy(e,r===2?n:s);return o.set(e,a),a}function $t(e){return mt(e)?$t(e.__v_raw):!!(e&&e.__v_isReactive)}function mt(e){return!!(e&&e.__v_isReadonly)}function Ue(e){return!!(e&&e.__v_isShallow)}function vn(e){return e?!!e.__v_raw:!1}function oe(e){const t=e&&e.__v_raw;return t?oe(t):e}function Yr(e){return!re(e,"__v_skip")&&Object.isExtensible(e)&&go(e,"__v_skip",!0),e}const Je=e=>ae(e)?gn(e):e,Nt=e=>ae(e)?Xs(e):e;function Pe(e){return e?e.__v_isRef===!0:!1}function R(e){return Zr(e,!1)}function Zr(e,t){return Pe(e)?e:new Qr(e,t)}class Qr{constructor(t,s){this.dep=new hn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:oe(t),this._value=s?t:Je(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||Ue(t)||mt(t);t=n?t:oe(t),st(t,s)&&(this._rawValue=t,this._value=n?t:Je(t),this.dep.trigger())}}function Xr(e){return Pe(e)?e.value:e}const ei={get:(e,t,s)=>t==="__v_raw"?e:Xr(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const o=e[t];return Pe(o)&&!Pe(s)?(o.value=s,!0):Reflect.set(e,t,s,n)}};function Do(e){return $t(e)?e:new Proxy(e,ei)}class ti{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new hn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ts-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&pe!==this)return wo(this,!0),!0}get value(){const t=this.dep.track();return Co(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function si(e,t,s=!1){let n,o;return Y(e)?n=e:(n=e.get,o=e.set),new ti(n,o,s)}const ps={},bs=new WeakMap;let Ct;function ni(e,t=!1,s=Ct){if(s){let n=bs.get(s);n||bs.set(s,n=[]),n.push(e)}}function oi(e,t,s=de){const{immediate:n,deep:o,once:r,scheduler:l,augmentJob:a,call:u}=s,h=F=>o?F:Ue(F)||o===!1||o===0?dt(F,1):dt(F);let f,p,v,A,H=!1,$=!1;if(Pe(e)?(p=()=>e.value,H=Ue(e)):$t(e)?(p=()=>h(e),H=!0):J(e)?($=!0,H=e.some(F=>$t(F)||Ue(F)),p=()=>e.map(F=>{if(Pe(F))return F.value;if($t(F))return h(F);if(Y(F))return u?u(F,2):F()})):Y(e)?t?p=u?()=>u(e,2):e:p=()=>{if(v){pt();try{v()}finally{ht()}}const F=Ct;Ct=f;try{return u?u(e,3,[A]):e(A)}finally{Ct=F}}:p=nt,t&&o){const F=p,Z=o===!0?1/0:o;p=()=>dt(F(),Z)}const b=Ir(),I=()=>{f.stop(),b&&b.active&&an(b.effects,f)};if(r&&t){const F=t;t=(...Z)=>{F(...Z),I()}}let L=$?new Array(e.length).fill(ps):ps;const B=F=>{if(!(!(f.flags&1)||!f.dirty&&!F))if(t){const Z=f.run();if(o||H||($?Z.some((he,W)=>st(he,L[W])):st(Z,L))){v&&v();const he=Ct;Ct=f;try{const W=[Z,L===ps?void 0:$&&L[0]===ps?[]:L,A];L=Z,u?u(t,3,W):t(...W)}finally{Ct=he}}}else f.run()};return a&&a(B),f=new bo(p),f.scheduler=l?()=>l(B,!1):B,A=F=>ni(F,!1,f),v=f.onStop=()=>{const F=bs.get(f);if(F){if(u)u(F,4);else for(const Z of F)Z();bs.delete(f)}},t?n?B(!0):L=f.run():l?l(B.bind(null,!0),!0):f.run(),I.pause=f.pause.bind(f),I.resume=f.resume.bind(f),I.stop=I,I}function dt(e,t=1/0,s){if(t<=0||!ae(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,Pe(e))dt(e.value,t,s);else if(J(e))for(let n=0;n<e.length;n++)dt(e[n],t,s);else if(Vt(e)||Dt(e))e.forEach(n=>{dt(n,t,s)});else if(mo(e)){for(const n in e)dt(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&dt(e[n],t,s)}return e}/**
|
|
56
|
+
**/let Ne;class Ir{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Ne,!t&&Ne&&(this.index=(Ne.scopes||(Ne.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].pause();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].resume();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].resume()}}run(t){if(this._active){const s=Ne;try{return Ne=this,t()}finally{Ne=s}}}on(){++this._on===1&&(this.prevScope=Ne,Ne=this)}off(){this._on>0&&--this._on===0&&(Ne=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s<n;s++)this.effects[s].stop();for(this.effects.length=0,s=0,n=this.cleanups.length;s<n;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){for(s=0,n=this.scopes.length;s<n;s++)this.scopes[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function Pr(){return Ne}let ge;const Hs=new WeakSet;class _o{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,Ne&&Ne.active&&Ne.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Hs.has(this)&&(Hs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ko(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Mn(this),So(this);const t=ge,s=Be;ge=this,Be=!0;try{return this.fn()}finally{Co(this),ge=t,Be=s,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)mn(t);this.deps=this.depsTail=void 0,Mn(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Hs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ys(this)&&this.run()}get dirty(){return Ys(this)}}let wo=0,Qt,Xt;function ko(e,t=!1){if(e.flags|=8,t){e.next=Xt,Xt=e;return}e.next=Qt,Qt=e}function fn(){wo++}function pn(){if(--wo>0)return;if(Xt){let t=Xt;for(Xt=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;Qt;){let t=Qt;for(Qt=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function So(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Co(e){let t,s=e.depsTail,n=s;for(;n;){const o=n.prevDep;n.version===-1?(n===s&&(s=o),mn(n),Mr(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=o}e.deps=t,e.depsTail=s}function Ys(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&($o(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function $o(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===os)||(e.globalVersion=os,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ys(e))))return;e.flags|=2;const t=e.dep,s=ge,n=Be;ge=e,Be=!0;try{So(e);const o=e.fn(e._value);(t.version===0||tt(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{ge=s,Be=n,Co(e),e.flags&=-3}}function mn(e,t=!1){const{dep:s,prevSub:n,nextSub:o}=e;if(n&&(n.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let l=s.computed.deps;l;l=l.nextDep)mn(l,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function Mr(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let Be=!0;const To=[];function xt(){To.push(Be),Be=!1}function ht(){const e=To.pop();Be=e===void 0?!0:e}function Mn(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=ge;ge=void 0;try{t()}finally{ge=s}}}let os=0;class Or{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class xn{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(!ge||!Be||ge===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==ge)s=this.activeLink=new Or(ge,this),ge.deps?(s.prevDep=ge.depsTail,ge.depsTail.nextDep=s,ge.depsTail=s):ge.deps=ge.depsTail=s,Eo(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=ge.depsTail,s.nextDep=void 0,ge.depsTail.nextDep=s,ge.depsTail=s,ge.deps===s&&(ge.deps=n)}return s}trigger(t){this.version++,os++,this.notify(t)}notify(t){fn();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{pn()}}}function Eo(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)Eo(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const Zs=new WeakMap,Et=Symbol(""),Qs=Symbol(""),rs=Symbol("");function Ie(e,t,s){if(Be&&ge){let n=Zs.get(e);n||Zs.set(e,n=new Map);let o=n.get(s);o||(n.set(s,o=new xn),o.map=n,o.key=s),o.track()}}function ft(e,t,s,n,o,l){const a=Zs.get(e);if(!a){os++;return}const c=u=>{u&&u.trigger()};if(fn(),t==="clear")a.forEach(c);else{const u=Z(e),x=u&&un(s);if(u&&s==="length"){const d=Number(n);a.forEach((m,y)=>{(y==="length"||y===rs||!ot(y)&&y>=d)&&c(m)})}else switch((s!==void 0||a.has(void 0))&&c(a.get(s)),x&&c(a.get(rs)),t){case"add":u?x&&c(a.get("length")):(c(a.get(Et)),Rt(e)&&c(a.get(Qs)));break;case"delete":u||(c(a.get(Et)),Rt(e)&&c(a.get(Qs)));break;case"set":Rt(e)&&c(a.get(Et));break}}pn()}function Mt(e){const t=ae(e);return t===e?t:(Ie(t,"iterate",rs),He(e)?t:t.map(Ke))}function Ds(e){return Ie(e=ae(e),"iterate",rs),e}function Qe(e,t){return gt(e)?Ut(At(e)?Ke(t):t):Ke(t)}const Dr={__proto__:null,[Symbol.iterator](){return Bs(this,Symbol.iterator,e=>Qe(this,e))},concat(...e){return Mt(this).concat(...e.map(t=>Z(t)?Mt(t):t))},entries(){return Bs(this,"entries",e=>(e[1]=Qe(this,e[1]),e))},every(e,t){return ct(this,"every",e,t,void 0,arguments)},filter(e,t){return ct(this,"filter",e,t,s=>s.map(n=>Qe(this,n)),arguments)},find(e,t){return ct(this,"find",e,t,s=>Qe(this,s),arguments)},findIndex(e,t){return ct(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ct(this,"findLast",e,t,s=>Qe(this,s),arguments)},findLastIndex(e,t){return ct(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ct(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ks(this,"includes",e)},indexOf(...e){return Ks(this,"indexOf",e)},join(e){return Mt(this).join(e)},lastIndexOf(...e){return Ks(this,"lastIndexOf",e)},map(e,t){return ct(this,"map",e,t,void 0,arguments)},pop(){return zt(this,"pop")},push(...e){return zt(this,"push",e)},reduce(e,...t){return On(this,"reduce",e,t)},reduceRight(e,...t){return On(this,"reduceRight",e,t)},shift(){return zt(this,"shift")},some(e,t){return ct(this,"some",e,t,void 0,arguments)},splice(...e){return zt(this,"splice",e)},toReversed(){return Mt(this).toReversed()},toSorted(e){return Mt(this).toSorted(e)},toSpliced(...e){return Mt(this).toSpliced(...e)},unshift(...e){return zt(this,"unshift",e)},values(){return Bs(this,"values",e=>Qe(this,e))}};function Bs(e,t,s){const n=Ds(e),o=n[t]();return n!==e&&!He(e)&&(o._next=o.next,o.next=()=>{const l=o._next();return l.done||(l.value=s(l.value)),l}),o}const Rr=Array.prototype;function ct(e,t,s,n,o,l){const a=Ds(e),c=a!==e&&!He(e),u=a[t];if(u!==Rr[t]){const m=u.apply(e,l);return c?Ke(m):m}let x=s;a!==e&&(c?x=function(m,y){return s.call(this,Qe(e,m),y,e)}:s.length>2&&(x=function(m,y){return s.call(this,m,y,e)}));const d=u.call(a,x,n);return c&&o?o(d):d}function On(e,t,s,n){const o=Ds(e),l=o!==e&&!He(e);let a=s,c=!1;o!==e&&(l?(c=n.length===0,a=function(x,d,m){return c&&(c=!1,x=Qe(e,x)),s.call(this,x,Qe(e,d),m,e)}):s.length>3&&(a=function(x,d,m){return s.call(this,x,d,m,e)}));const u=o[t](a,...n);return c?Qe(e,u):u}function Ks(e,t,s){const n=ae(e);Ie(n,"iterate",rs);const o=n[t](...s);return(o===-1||o===!1)&&yn(s[0])?(s[0]=ae(s[0]),n[t](...s)):o}function zt(e,t,s=[]){xt(),fn();const n=ae(e)[t].apply(e,s);return pn(),ht(),n}const jr=an("__proto__,__v_isRef,__isVue"),Ao=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ot));function Nr(e){ot(e)||(e=String(e));const t=ae(this);return Ie(t,"has",e),t.hasOwnProperty(e)}class Io{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const o=this._isReadonly,l=this._isShallow;if(s==="__v_isReactive")return!o;if(s==="__v_isReadonly")return o;if(s==="__v_isShallow")return l;if(s==="__v_raw")return n===(o?l?Jr:Do:l?Oo:Mo).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const a=Z(t);if(!o){let u;if(a&&(u=Dr[s]))return u;if(s==="hasOwnProperty")return Nr}const c=Reflect.get(t,s,Me(t)?t:n);if((ot(s)?Ao.has(s):jr(s))||(o||Ie(t,"get",s),l))return c;if(Me(c)){const u=a&&un(s)?c:c.value;return o&&fe(u)?en(u):u}return fe(c)?o?en(c):gn(c):c}}class Po extends Io{constructor(t=!1){super(!1,t)}set(t,s,n,o){let l=t[s];const a=Z(t)&&un(s);if(!this._isShallow){const x=gt(l);if(!He(n)&&!gt(n)&&(l=ae(l),n=ae(n)),!a&&Me(l)&&!Me(n))return x||(l.value=n),!0}const c=a?Number(s)<t.length:ce(t,s),u=Reflect.set(t,s,n,Me(t)?t:o);return t===ae(o)&&(c?tt(n,l)&&ft(t,"set",s,n):ft(t,"add",s,n)),u}deleteProperty(t,s){const n=ce(t,s);t[s];const o=Reflect.deleteProperty(t,s);return o&&n&&ft(t,"delete",s,void 0),o}has(t,s){const n=Reflect.has(t,s);return(!ot(s)||!Ao.has(s))&&Ie(t,"has",s),n}ownKeys(t){return Ie(t,"iterate",Z(t)?"length":Et),Reflect.ownKeys(t)}}class Lr extends Io{constructor(t=!1){super(!0,t)}set(t,s){return!0}deleteProperty(t,s){return!0}}const Ur=new Po,Vr=new Lr,Fr=new Po(!0);const Xs=e=>e,ps=e=>Reflect.getPrototypeOf(e);function Hr(e,t,s){return function(...n){const o=this.__v_raw,l=ae(o),a=Rt(l),c=e==="entries"||e===Symbol.iterator&&a,u=e==="keys"&&a,x=o[e](...n),d=s?Xs:t?Ut:Ke;return!t&&Ie(l,"iterate",u?Qs:Et),Ae(Object.create(x),{next(){const{value:m,done:y}=x.next();return y?{value:m,done:y}:{value:c?[d(m[0]),d(m[1])]:d(m),done:y}}})}}function ms(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Br(e,t){const s={get(o){const l=this.__v_raw,a=ae(l),c=ae(o);e||(tt(o,c)&&Ie(a,"get",o),Ie(a,"get",c));const{has:u}=ps(a),x=t?Xs:e?Ut:Ke;if(u.call(a,o))return x(l.get(o));if(u.call(a,c))return x(l.get(c));l!==a&&l.get(o)},get size(){const o=this.__v_raw;return!e&&Ie(ae(o),"iterate",Et),o.size},has(o){const l=this.__v_raw,a=ae(l),c=ae(o);return e||(tt(o,c)&&Ie(a,"has",o),Ie(a,"has",c)),o===c?l.has(o):l.has(o)||l.has(c)},forEach(o,l){const a=this,c=a.__v_raw,u=ae(c),x=t?Xs:e?Ut:Ke;return!e&&Ie(u,"iterate",Et),c.forEach((d,m)=>o.call(l,x(d),x(m),a))}};return Ae(s,e?{add:ms("add"),set:ms("set"),delete:ms("delete"),clear:ms("clear")}:{add(o){const l=ae(this),a=ps(l),c=ae(o),u=!t&&!He(o)&&!gt(o)?c:o;return a.has.call(l,u)||tt(o,u)&&a.has.call(l,o)||tt(c,u)&&a.has.call(l,c)||(l.add(u),ft(l,"add",u,u)),this},set(o,l){!t&&!He(l)&&!gt(l)&&(l=ae(l));const a=ae(this),{has:c,get:u}=ps(a);let x=c.call(a,o);x||(o=ae(o),x=c.call(a,o));const d=u.call(a,o);return a.set(o,l),x?tt(l,d)&&ft(a,"set",o,l):ft(a,"add",o,l),this},delete(o){const l=ae(this),{has:a,get:c}=ps(l);let u=a.call(l,o);u||(o=ae(o),u=a.call(l,o)),c&&c.call(l,o);const x=l.delete(o);return u&&ft(l,"delete",o,void 0),x},clear(){const o=ae(this),l=o.size!==0,a=o.clear();return l&&ft(o,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(o=>{s[o]=Hr(o,e,t)}),s}function hn(e,t){const s=Br(e,t);return(n,o,l)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?n:Reflect.get(ce(s,o)&&o in n?s:n,o,l)}const Kr={get:hn(!1,!1)},Wr={get:hn(!1,!0)},zr={get:hn(!0,!1)};const Mo=new WeakMap,Oo=new WeakMap,Do=new WeakMap,Jr=new WeakMap;function qr(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Gr(e){return e.__v_skip||!Object.isExtensible(e)?0:qr(br(e))}function gn(e){return gt(e)?e:vn(e,!1,Ur,Kr,Mo)}function Yr(e){return vn(e,!1,Fr,Wr,Oo)}function en(e){return vn(e,!0,Vr,zr,Do)}function vn(e,t,s,n,o){if(!fe(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const l=Gr(e);if(l===0)return e;const a=o.get(e);if(a)return a;const c=new Proxy(e,l===2?n:s);return o.set(e,c),c}function At(e){return gt(e)?At(e.__v_raw):!!(e&&e.__v_isReactive)}function gt(e){return!!(e&&e.__v_isReadonly)}function He(e){return!!(e&&e.__v_isShallow)}function yn(e){return e?!!e.__v_raw:!1}function ae(e){const t=e&&e.__v_raw;return t?ae(t):e}function Zr(e){return!ce(e,"__v_skip")&&Object.isExtensible(e)&&go(e,"__v_skip",!0),e}const Ke=e=>fe(e)?gn(e):e,Ut=e=>fe(e)?en(e):e;function Me(e){return e?e.__v_isRef===!0:!1}function E(e){return Qr(e,!1)}function Qr(e,t){return Me(e)?e:new Xr(e,t)}class Xr{constructor(t,s){this.dep=new xn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:ae(t),this._value=s?t:Ke(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||He(t)||gt(t);t=n?t:ae(t),tt(t,s)&&(this._rawValue=t,this._value=n?t:Ke(t),this.dep.trigger())}}function el(e){return Me(e)?e.value:e}const tl={get:(e,t,s)=>t==="__v_raw"?e:el(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const o=e[t];return Me(o)&&!Me(s)?(o.value=s,!0):Reflect.set(e,t,s,n)}};function Ro(e){return At(e)?e:new Proxy(e,tl)}class sl{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new xn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=os-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&ge!==this)return ko(this,!0),!0}get value(){const t=this.dep.track();return $o(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function nl(e,t,s=!1){let n,o;return X(e)?n=e:(n=e.get,o=e.set),new sl(n,o,s)}const xs={},ws=new WeakMap;let Tt;function ol(e,t=!1,s=Tt){if(s){let n=ws.get(s);n||ws.set(s,n=[]),n.push(e)}}function rl(e,t,s=xe){const{immediate:n,deep:o,once:l,scheduler:a,augmentJob:c,call:u}=s,x=V=>o?V:He(V)||o===!1||o===0?pt(V,1):pt(V);let d,m,y,T,B=!1,C=!1;if(Me(e)?(m=()=>e.value,B=He(e)):At(e)?(m=()=>x(e),B=!0):Z(e)?(C=!0,B=e.some(V=>At(V)||He(V)),m=()=>e.map(V=>{if(Me(V))return V.value;if(At(V))return x(V);if(X(V))return u?u(V,2):V()})):X(e)?t?m=u?()=>u(e,2):e:m=()=>{if(y){xt();try{y()}finally{ht()}}const V=Tt;Tt=d;try{return u?u(e,3,[T]):e(T)}finally{Tt=V}}:m=st,t&&o){const V=m,se=o===!0?1/0:o;m=()=>pt(V(),se)}const w=Pr(),k=()=>{d.stop(),w&&w.active&&cn(w.effects,d)};if(l&&t){const V=t;t=(...se)=>{V(...se),k()}}let P=C?new Array(e.length).fill(xs):xs;const H=V=>{if(!(!(d.flags&1)||!d.dirty&&!V))if(t){const se=d.run();if(o||B||(C?se.some((ne,W)=>tt(ne,P[W])):tt(se,P))){y&&y();const ne=Tt;Tt=d;try{const W=[se,P===xs?void 0:C&&P[0]===xs?[]:P,T];P=se,u?u(t,3,W):t(...W)}finally{Tt=ne}}}else d.run()};return c&&c(H),d=new _o(m),d.scheduler=a?()=>a(H,!1):H,T=V=>ol(V,!1,d),y=d.onStop=()=>{const V=ws.get(d);if(V){if(u)u(V,4);else for(const se of V)se();ws.delete(d)}},t?n?H(!0):P=d.run():a?a(H.bind(null,!0),!0):d.run(),k.pause=d.pause.bind(d),k.resume=d.resume.bind(d),k.stop=k,k}function pt(e,t=1/0,s){if(t<=0||!fe(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,Me(e))pt(e.value,t,s);else if(Z(e))for(let n=0;n<e.length;n++)pt(e[n],t,s);else if(Bt(e)||Rt(e))e.forEach(n=>{pt(n,t,s)});else if(ho(e)){for(const n in e)pt(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&pt(e[n],t,s)}return e}/**
|
|
57
57
|
* @vue/runtime-core v3.5.31
|
|
58
58
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
59
59
|
* @license MIT
|
|
60
|
-
**/function cs(e,t,s,n){try{return n?e(...n):e()}catch(o){Ds(o,t,s)}}function it(e,t,s,n){if(Y(e)){const o=cs(e,t,s,n);return o&&po(o)&&o.catch(r=>{Ds(r,t,s)}),o}if(J(e)){const o=[];for(let r=0;r<e.length;r++)o.push(it(e[r],t,s,n));return o}}function Ds(e,t,s,n=!0){const o=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||de;if(t){let a=t.parent;const u=t.proxy,h=`https://vuejs.org/error-reference/#runtime-${s}`;for(;a;){const f=a.ec;if(f){for(let p=0;p<f.length;p++)if(f[p](e,u,h)===!1)return}a=a.parent}if(r){pt(),cs(r,null,10,[e,u,h]),ht();return}}ri(e,s,o,n,l)}function ri(e,t,s,n=!0,o=!1){if(o)throw e;console.error(e)}const Oe=[];let Xe=-1;const Rt=[];let vt=null,Mt=0;const Ro=Promise.resolve();let _s=null;function jo(e){const t=_s||Ro;return e?t.then(this?e.bind(this):e):t}function ii(e){let t=Xe+1,s=Oe.length;for(;t<s;){const n=t+s>>>1,o=Oe[n],r=ns(o);r<e||r===e&&o.flags&2?t=n+1:s=n}return t}function yn(e){if(!(e.flags&1)){const t=ns(e),s=Oe[Oe.length-1];!s||!(e.flags&2)&&t>=ns(s)?Oe.push(e):Oe.splice(ii(t),0,e),e.flags|=1,No()}}function No(){_s||(_s=Ro.then(Fo))}function li(e){J(e)?Rt.push(...e):vt&&e.id===-1?vt.splice(Mt+1,0,e):e.flags&1||(Rt.push(e),e.flags|=1),No()}function On(e,t,s=Xe+1){for(;s<Oe.length;s++){const n=Oe[s];if(n&&n.flags&2){if(e&&n.id!==e.uid)continue;Oe.splice(s,1),s--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Lo(e){if(Rt.length){const t=[...new Set(Rt)].sort((s,n)=>ns(s)-ns(n));if(Rt.length=0,vt){vt.push(...t);return}for(vt=t,Mt=0;Mt<vt.length;Mt++){const s=vt[Mt];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}vt=null,Mt=0}}const ns=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Fo(e){try{for(Xe=0;Xe<Oe.length;Xe++){const t=Oe[Xe];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),cs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Xe<Oe.length;Xe++){const t=Oe[Xe];t&&(t.flags&=-2)}Xe=-1,Oe.length=0,Lo(),_s=null,(Oe.length||Rt.length)&&Fo()}}let Le=null,Vo=null;function ws(e){const t=Le;return Le=e,Vo=e&&e.type.__scopeId||null,t}function ai(e,t=Le,s){if(!t||e._n)return e;const n=(...o)=>{n._d&&Kn(-1);const r=ws(t);let l;try{l=e(...o)}finally{ws(r),n._d&&Kn(1)}return l};return n._n=!0,n._c=!0,n._d=!0,n}function le(e,t){if(Le===null)return e;const s=Ls(Le),n=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[r,l,a,u=de]=t[o];r&&(Y(r)&&(r={mounted:r,updated:r}),r.deep&&dt(l),n.push({dir:r,instance:s,value:l,oldValue:void 0,arg:a,modifiers:u}))}return e}function St(e,t,s,n){const o=e.dirs,r=t&&t.dirs;for(let l=0;l<o.length;l++){const a=o[l];r&&(a.oldValue=r[l].value);let u=a.dir[n];u&&(pt(),it(u,s,8,[e.el,a,e,t]),ht())}}function ci(e,t){if(Ie){let s=Ie.provides;const n=Ie.parent&&Ie.parent.provides;n===s&&(s=Ie.provides=Object.create(n)),s[e]=t}}function gs(e,t,s=!1){const n=cl();if(n||jt){let o=jt?jt._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return s&&Y(t)?t.call(n&&n.proxy):t}}const ui=Symbol.for("v-scx"),di=()=>gs(ui);function Ws(e,t,s){return Uo(e,t,s)}function Uo(e,t,s=de){const{immediate:n,deep:o,flush:r,once:l}=s,a=Ae({},s),u=t&&n||!t&&r!=="post";let h;if(rs){if(r==="sync"){const A=di();h=A.__watcherHandles||(A.__watcherHandles=[])}else if(!u){const A=()=>{};return A.stop=nt,A.resume=nt,A.pause=nt,A}}const f=Ie;a.call=(A,H,$)=>it(A,f,H,$);let p=!1;r==="post"?a.scheduler=A=>{Re(A,f&&f.suspense)}:r!=="sync"&&(p=!0,a.scheduler=(A,H)=>{H?A():yn(A)}),a.augmentJob=A=>{t&&(A.flags|=4),p&&(A.flags|=2,f&&(A.id=f.uid,A.i=f))};const v=oi(e,t,a);return rs&&(h?h.push(v):u&&v()),v}function fi(e,t,s){const n=this.proxy,o=ve(e)?e.includes(".")?Ho(n,e):()=>n[e]:e.bind(n,n);let r;Y(t)?r=t:(r=t.handler,s=t);const l=us(this),a=Uo(o,r.bind(n),s);return l(),a}function Ho(e,t){const s=t.split(".");return()=>{let n=e;for(let o=0;o<s.length&&n;o++)n=n[s[o]];return n}}const pi=Symbol("_vte"),hi=e=>e.__isTeleport,mi=Symbol("_leaveCb");function bn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,bn(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function At(e,t){return Y(e)?Ae({name:e.name},t,{setup:e}):e}function Bo(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Dn(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const Ss=new WeakMap;function Zt(e,t,s,n,o=!1){if(J(e)){e.forEach(($,b)=>Zt($,t&&(J(t)?t[b]:t),s,n,o));return}if(Qt(n)&&!o){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&Zt(e,t,s,n.component.subTree);return}const r=n.shapeFlag&4?Ls(n.component):n.el,l=o?null:r,{i:a,r:u}=e,h=t&&t.r,f=a.refs===de?a.refs={}:a.refs,p=a.setupState,v=oe(p),A=p===de?fo:$=>Dn(f,$)?!1:re(v,$),H=($,b)=>!(b&&Dn(f,b));if(h!=null&&h!==u){if(Rn(t),ve(h))f[h]=null,A(h)&&(p[h]=null);else if(Pe(h)){const $=t;H(h,$.k)&&(h.value=null),$.k&&(f[$.k]=null)}}if(Y(u))cs(u,a,12,[l,f]);else{const $=ve(u),b=Pe(u);if($||b){const I=()=>{if(e.f){const L=$?A(u)?p[u]:f[u]:H()||!e.k?u.value:f[e.k];if(o)J(L)&&an(L,r);else if(J(L))L.includes(r)||L.push(r);else if($)f[u]=[r],A(u)&&(p[u]=f[u]);else{const B=[r];H(u,e.k)&&(u.value=B),e.k&&(f[e.k]=B)}}else $?(f[u]=l,A(u)&&(p[u]=l)):b&&(H(u,e.k)&&(u.value=l),e.k&&(f[e.k]=l))};if(l){const L=()=>{I(),Ss.delete(e)};L.id=-1,Ss.set(e,L),Re(L,s)}else Rn(e),I()}}}function Rn(e){const t=Ss.get(e);t&&(t.flags|=8,Ss.delete(e))}Ps().requestIdleCallback;Ps().cancelIdleCallback;const Qt=e=>!!e.type.__asyncLoader,Wo=e=>e.type.__isKeepAlive;function gi(e,t){Ko(e,"a",t)}function xi(e,t){Ko(e,"da",t)}function Ko(e,t,s=Ie){const n=e.__wdc||(e.__wdc=()=>{let o=s;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Rs(t,n,s),s){let o=s.parent;for(;o&&o.parent;)Wo(o.parent.vnode)&&vi(n,t,s,o),o=o.parent}}function vi(e,t,s,n){const o=Rs(t,e,n,!0);_n(()=>{an(n[t],o)},s)}function Rs(e,t,s=Ie,n=!1){if(s){const o=s[e]||(s[e]=[]),r=t.__weh||(t.__weh=(...l)=>{pt();const a=us(s),u=it(t,s,e,l);return a(),ht(),u});return n?o.unshift(r):o.push(r),r}}const gt=e=>(t,s=Ie)=>{(!rs||e==="sp")&&Rs(e,(...n)=>t(...n),s)},yi=gt("bm"),wt=gt("m"),bi=gt("bu"),_i=gt("u"),wi=gt("bum"),_n=gt("um"),Si=gt("sp"),ki=gt("rtg"),Ci=gt("rtc");function Ti(e,t=Ie){Rs("ec",e,t)}const $i="components",zo=Symbol.for("v-ndc");function Ai(e){return ve(e)?Ei($i,e,!1)||e:e||zo}function Ei(e,t,s=!0,n=!1){const o=Le||Ie;if(o){const r=o.type;{const a=hl(r,!1);if(a&&(a===t||a===De(t)||a===Es(De(t))))return r}const l=jn(o[e]||r[e],t)||jn(o.appContext[e],t);return!l&&n?r:l}}function jn(e,t){return e&&(e[t]||e[De(t)]||e[Es(De(t))])}function Se(e,t,s,n){let o;const r=s,l=J(e);if(l||ve(e)){const a=l&&$t(e);let u=!1,h=!1;a&&(u=!Ue(e),h=mt(e),e=Os(e)),o=new Array(e.length);for(let f=0,p=e.length;f<p;f++)o[f]=t(u?h?Nt(Je(e[f])):Je(e[f]):e[f],f,void 0,r)}else if(typeof e=="number"){o=new Array(e);for(let a=0;a<e;a++)o[a]=t(a+1,a,void 0,r)}else if(ae(e))if(e[Symbol.iterator])o=Array.from(e,(a,u)=>t(a,u,void 0,r));else{const a=Object.keys(e);o=new Array(a.length);for(let u=0,h=a.length;u<h;u++){const f=a[u];o[u]=t(e[f],f,u,r)}}else o=[];return o}const en=e=>e?hr(e)?Ls(e):en(e.parent):null,Xt=Ae(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=>en(e.parent),$root:e=>en(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>qo(e),$forceUpdate:e=>e.f||(e.f=()=>{yn(e.update)}),$nextTick:e=>e.n||(e.n=jo.bind(e.proxy)),$watch:e=>fi.bind(e)}),Ks=(e,t)=>e!==de&&!e.__isScriptSetup&&re(e,t),Ii={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:o,props:r,accessCache:l,type:a,appContext:u}=e;if(t[0]!=="$"){const v=l[t];if(v!==void 0)switch(v){case 1:return n[t];case 2:return o[t];case 4:return s[t];case 3:return r[t]}else{if(Ks(n,t))return l[t]=1,n[t];if(o!==de&&re(o,t))return l[t]=2,o[t];if(re(r,t))return l[t]=3,r[t];if(s!==de&&re(s,t))return l[t]=4,s[t];tn&&(l[t]=0)}}const h=Xt[t];let f,p;if(h)return t==="$attrs"&&Ee(e.attrs,"get",""),h(e);if((f=a.__cssModules)&&(f=f[t]))return f;if(s!==de&&re(s,t))return l[t]=4,s[t];if(p=u.config.globalProperties,re(p,t))return p[t]},set({_:e},t,s){const{data:n,setupState:o,ctx:r}=e;return Ks(o,t)?(o[t]=s,!0):n!==de&&re(n,t)?(n[t]=s,!0):re(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:o,props:r,type:l}},a){let u;return!!(s[a]||e!==de&&a[0]!=="$"&&re(e,a)||Ks(t,a)||re(r,a)||re(n,a)||re(Xt,a)||re(o.config.globalProperties,a)||(u=l.__cssModules)&&u[a])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:re(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function Nn(e){return J(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let tn=!0;function Pi(e){const t=qo(e),s=e.proxy,n=e.ctx;tn=!1,t.beforeCreate&&Ln(t.beforeCreate,e,"bc");const{data:o,computed:r,methods:l,watch:a,provide:u,inject:h,created:f,beforeMount:p,mounted:v,beforeUpdate:A,updated:H,activated:$,deactivated:b,beforeDestroy:I,beforeUnmount:L,destroyed:B,unmounted:F,render:Z,renderTracked:he,renderTriggered:W,errorCaptured:j,serverPrefetch:z,expose:X,inheritAttrs:ee,components:ke,directives:Ce,filters:xt}=t;if(h&&Mi(h,n,null),l)for(const ce in l){const se=l[ce];Y(se)&&(n[ce]=se.bind(s))}if(o){const ce=o.call(s,s);ae(ce)&&(e.data=gn(ce))}if(tn=!0,r)for(const ce in r){const se=r[ce],V=Y(se)?se.bind(s,s):Y(se.get)?se.get.bind(s,s):nt,E=!Y(se)&&Y(se.set)?se.set.bind(s):nt,Te=Ke({get:V,set:E});Object.defineProperty(n,ce,{enumerable:!0,configurable:!0,get:()=>Te.value,set:ge=>Te.value=ge})}if(a)for(const ce in a)Jo(a[ce],n,s,ce);if(u){const ce=Y(u)?u.call(s):u;Reflect.ownKeys(ce).forEach(se=>{ci(se,ce[se])})}f&&Ln(f,e,"c");function we(ce,se){J(se)?se.forEach(V=>ce(V.bind(s))):se&&ce(se.bind(s))}if(we(yi,p),we(wt,v),we(bi,A),we(_i,H),we(gi,$),we(xi,b),we(Ti,j),we(Ci,he),we(ki,W),we(wi,L),we(_n,F),we(Si,z),J(X))if(X.length){const ce=e.exposed||(e.exposed={});X.forEach(se=>{Object.defineProperty(ce,se,{get:()=>s[se],set:V=>s[se]=V,enumerable:!0})})}else e.exposed||(e.exposed={});Z&&e.render===nt&&(e.render=Z),ee!=null&&(e.inheritAttrs=ee),ke&&(e.components=ke),Ce&&(e.directives=Ce),z&&Bo(e)}function Mi(e,t,s=nt){J(e)&&(e=sn(e));for(const n in e){const o=e[n];let r;ae(o)?"default"in o?r=gs(o.from||n,o.default,!0):r=gs(o.from||n):r=gs(o),Pe(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:l=>r.value=l}):t[n]=r}}function Ln(e,t,s){it(J(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function Jo(e,t,s,n){let o=n.includes(".")?Ho(s,n):()=>s[n];if(ve(e)){const r=t[e];Y(r)&&Ws(o,r)}else if(Y(e))Ws(o,e.bind(s));else if(ae(e))if(J(e))e.forEach(r=>Jo(r,t,s,n));else{const r=Y(e.handler)?e.handler.bind(s):t[e.handler];Y(r)&&Ws(o,r,e)}}function qo(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:o,optionsCache:r,config:{optionMergeStrategies:l}}=e.appContext,a=r.get(t);let u;return a?u=a:!o.length&&!s&&!n?u=t:(u={},o.length&&o.forEach(h=>ks(u,h,l,!0)),ks(u,t,l)),ae(t)&&r.set(t,u),u}function ks(e,t,s,n=!1){const{mixins:o,extends:r}=t;r&&ks(e,r,s,!0),o&&o.forEach(l=>ks(e,l,s,!0));for(const l in t)if(!(n&&l==="expose")){const a=Oi[l]||s&&s[l];e[l]=a?a(e[l],t[l]):t[l]}return e}const Oi={data:Fn,props:Vn,emits:Vn,methods:zt,computed:zt,beforeCreate:Me,created:Me,beforeMount:Me,mounted:Me,beforeUpdate:Me,updated:Me,beforeDestroy:Me,beforeUnmount:Me,destroyed:Me,unmounted:Me,activated:Me,deactivated:Me,errorCaptured:Me,serverPrefetch:Me,components:zt,directives:zt,watch:Ri,provide:Fn,inject:Di};function Fn(e,t){return t?e?function(){return Ae(Y(e)?e.call(this,this):e,Y(t)?t.call(this,this):t)}:t:e}function Di(e,t){return zt(sn(e),sn(t))}function sn(e){if(J(e)){const t={};for(let s=0;s<e.length;s++)t[e[s]]=e[s];return t}return e}function Me(e,t){return e?[...new Set([].concat(e,t))]:t}function zt(e,t){return e?Ae(Object.create(null),e,t):t}function Vn(e,t){return e?J(e)&&J(t)?[...new Set([...e,...t])]:Ae(Object.create(null),Nn(e),Nn(t??{})):t}function Ri(e,t){if(!e)return t;if(!t)return e;const s=Ae(Object.create(null),e);for(const n in t)s[n]=Me(e[n],t[n]);return s}function Go(){return{app:null,config:{isNativeTag:fo,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}}let ji=0;function Ni(e,t){return function(n,o=null){Y(n)||(n=Ae({},n)),o!=null&&!ae(o)&&(o=null);const r=Go(),l=new WeakSet,a=[];let u=!1;const h=r.app={_uid:ji++,_component:n,_props:o,_container:null,_context:r,_instance:null,version:gl,get config(){return r.config},set config(f){},use(f,...p){return l.has(f)||(f&&Y(f.install)?(l.add(f),f.install(h,...p)):Y(f)&&(l.add(f),f(h,...p))),h},mixin(f){return r.mixins.includes(f)||r.mixins.push(f),h},component(f,p){return p?(r.components[f]=p,h):r.components[f]},directive(f,p){return p?(r.directives[f]=p,h):r.directives[f]},mount(f,p,v){if(!u){const A=h._ceVNode||ot(n,o);return A.appContext=r,v===!0?v="svg":v===!1&&(v=void 0),e(A,f,v),u=!0,h._container=f,f.__vue_app__=h,Ls(A.component)}},onUnmount(f){a.push(f)},unmount(){u&&(it(a,h._instance,16),e(null,h._container),delete h._container.__vue_app__)},provide(f,p){return r.provides[f]=p,h},runWithContext(f){const p=jt;jt=h;try{return f()}finally{jt=p}}};return h}}let jt=null;const Li=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${De(t)}Modifiers`]||e[`${_t(t)}Modifiers`];function Fi(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||de;let o=s;const r=t.startsWith("update:"),l=r&&Li(n,t.slice(7));l&&(l.trim&&(o=s.map(f=>ve(f)?f.trim():f)),l.number&&(o=s.map(Is)));let a,u=n[a=Fs(t)]||n[a=Fs(De(t))];!u&&r&&(u=n[a=Fs(_t(t))]),u&&it(u,e,6,o);const h=n[a+"Once"];if(h){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,it(h,e,6,o)}}const Vi=new WeakMap;function Yo(e,t,s=!1){const n=s?Vi:t.emitsCache,o=n.get(e);if(o!==void 0)return o;const r=e.emits;let l={},a=!1;if(!Y(e)){const u=h=>{const f=Yo(h,t,!0);f&&(a=!0,Ae(l,f))};!s&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!r&&!a?(ae(e)&&n.set(e,null),null):(J(r)?r.forEach(u=>l[u]=null):Ae(l,r),ae(e)&&n.set(e,l),l)}function js(e,t){return!e||!Ts(t)?!1:(t=t.slice(2).replace(/Once$/,""),re(e,t[0].toLowerCase()+t.slice(1))||re(e,_t(t))||re(e,t))}function Un(e){const{type:t,vnode:s,proxy:n,withProxy:o,propsOptions:[r],slots:l,attrs:a,emit:u,render:h,renderCache:f,props:p,data:v,setupState:A,ctx:H,inheritAttrs:$}=e,b=ws(e);let I,L;try{if(s.shapeFlag&4){const F=o||n,Z=F;I=tt(h.call(Z,F,f,p,A,v,H)),L=a}else{const F=t;I=tt(F.length>1?F(p,{attrs:a,slots:l,emit:u}):F(p,null)),L=t.props?a:Ui(a)}}catch(F){es.length=0,Ds(F,e,1),I=ot(bt)}let B=I;if(L&&$!==!1){const F=Object.keys(L),{shapeFlag:Z}=B;F.length&&Z&7&&(r&&F.some($s)&&(L=Hi(L,r)),B=Lt(B,L,!1,!0))}return s.dirs&&(B=Lt(B,null,!1,!0),B.dirs=B.dirs?B.dirs.concat(s.dirs):s.dirs),s.transition&&bn(B,s.transition),I=B,ws(b),I}const Ui=e=>{let t;for(const s in e)(s==="class"||s==="style"||Ts(s))&&((t||(t={}))[s]=e[s]);return t},Hi=(e,t)=>{const s={};for(const n in e)(!$s(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function Bi(e,t,s){const{props:n,children:o,component:r}=e,{props:l,children:a,patchFlag:u}=t,h=r.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&u>=0){if(u&1024)return!0;if(u&16)return n?Hn(n,l,h):!!l;if(u&8){const f=t.dynamicProps;for(let p=0;p<f.length;p++){const v=f[p];if(Zo(l,n,v)&&!js(h,v))return!0}}}else return(o||a)&&(!a||!a.$stable)?!0:n===l?!1:n?l?Hn(n,l,h):!0:!!l;return!1}function Hn(e,t,s){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let o=0;o<n.length;o++){const r=n[o];if(Zo(t,e,r)&&!js(s,r))return!0}return!1}function Zo(e,t,s){const n=e[s],o=t[s];return s==="style"&&ae(n)&&ae(o)?!Ut(n,o):n!==o}function Wi({vnode:e,parent:t,suspense:s},n){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=n,e=o),o===e)(e=t.vnode).el=n,t=t.parent;else break}s&&s.activeBranch===e&&(s.vnode.el=n)}const Qo={},Xo=()=>Object.create(Qo),er=e=>Object.getPrototypeOf(e)===Qo;function Ki(e,t,s,n=!1){const o={},r=Xo();e.propsDefaults=Object.create(null),tr(e,t,o,r);for(const l in e.propsOptions[0])l in o||(o[l]=void 0);s?e.props=n?o:Gr(o):e.type.props?e.props=o:e.props=r,e.attrs=r}function zi(e,t,s,n){const{props:o,attrs:r,vnode:{patchFlag:l}}=e,a=oe(o),[u]=e.propsOptions;let h=!1;if((n||l>0)&&!(l&16)){if(l&8){const f=e.vnode.dynamicProps;for(let p=0;p<f.length;p++){let v=f[p];if(js(e.emitsOptions,v))continue;const A=t[v];if(u)if(re(r,v))A!==r[v]&&(r[v]=A,h=!0);else{const H=De(v);o[H]=nn(u,a,H,A,e,!1)}else A!==r[v]&&(r[v]=A,h=!0)}}}else{tr(e,t,o,r)&&(h=!0);let f;for(const p in a)(!t||!re(t,p)&&((f=_t(p))===p||!re(t,f)))&&(u?s&&(s[p]!==void 0||s[f]!==void 0)&&(o[p]=nn(u,a,p,void 0,e,!0)):delete o[p]);if(r!==a)for(const p in r)(!t||!re(t,p))&&(delete r[p],h=!0)}h&&ut(e.attrs,"set","")}function tr(e,t,s,n){const[o,r]=e.propsOptions;let l=!1,a;if(t)for(let u in t){if(qt(u))continue;const h=t[u];let f;o&&re(o,f=De(u))?!r||!r.includes(f)?s[f]=h:(a||(a={}))[f]=h:js(e.emitsOptions,u)||(!(u in n)||h!==n[u])&&(n[u]=h,l=!0)}if(r){const u=oe(s),h=a||de;for(let f=0;f<r.length;f++){const p=r[f];s[p]=nn(o,u,p,h[p],e,!re(h,p))}}return l}function nn(e,t,s,n,o,r){const l=e[s];if(l!=null){const a=re(l,"default");if(a&&n===void 0){const u=l.default;if(l.type!==Function&&!l.skipFactory&&Y(u)){const{propsDefaults:h}=o;if(s in h)n=h[s];else{const f=us(o);n=h[s]=u.call(null,t),f()}}else n=u;o.ce&&o.ce._setProp(s,n)}l[0]&&(r&&!a?n=!1:l[1]&&(n===""||n===_t(s))&&(n=!0))}return n}const Ji=new WeakMap;function sr(e,t,s=!1){const n=s?Ji:t.propsCache,o=n.get(e);if(o)return o;const r=e.props,l={},a=[];let u=!1;if(!Y(e)){const f=p=>{u=!0;const[v,A]=sr(p,t,!0);Ae(l,v),A&&a.push(...A)};!s&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!r&&!u)return ae(e)&&n.set(e,Ot),Ot;if(J(r))for(let f=0;f<r.length;f++){const p=De(r[f]);Bn(p)&&(l[p]=de)}else if(r)for(const f in r){const p=De(f);if(Bn(p)){const v=r[f],A=l[p]=J(v)||Y(v)?{type:v}:Ae({},v),H=A.type;let $=!1,b=!0;if(J(H))for(let I=0;I<H.length;++I){const L=H[I],B=Y(L)&&L.name;if(B==="Boolean"){$=!0;break}else B==="String"&&(b=!1)}else $=Y(H)&&H.name==="Boolean";A[0]=$,A[1]=b,($||re(A,"default"))&&a.push(p)}}const h=[l,a];return ae(e)&&n.set(e,h),h}function Bn(e){return e[0]!=="$"&&!qt(e)}const wn=e=>e==="_"||e==="_ctx"||e==="$stable",Sn=e=>J(e)?e.map(tt):[tt(e)],qi=(e,t,s)=>{if(t._n)return t;const n=ai((...o)=>Sn(t(...o)),s);return n._c=!1,n},nr=(e,t,s)=>{const n=e._ctx;for(const o in e){if(wn(o))continue;const r=e[o];if(Y(r))t[o]=qi(o,r,n);else if(r!=null){const l=Sn(r);t[o]=()=>l}}},or=(e,t)=>{const s=Sn(t);e.slots.default=()=>s},rr=(e,t,s)=>{for(const n in t)(s||!wn(n))&&(e[n]=t[n])},Gi=(e,t,s)=>{const n=e.slots=Xo();if(e.vnode.shapeFlag&32){const o=t._;o?(rr(n,t,s),s&&go(n,"_",o,!0)):nr(t,n)}else t&&or(e,t)},Yi=(e,t,s)=>{const{vnode:n,slots:o}=e;let r=!0,l=de;if(n.shapeFlag&32){const a=t._;a?s&&a===1?r=!1:rr(o,t,s):(r=!t.$stable,nr(t,o)),l=t}else t&&(or(e,t),l={default:1});if(r)for(const a in o)!wn(a)&&l[a]==null&&delete o[a]},Re=tl;function Zi(e){return Qi(e)}function Qi(e,t){const s=Ps();s.__VUE__=!0;const{insert:n,remove:o,patchProp:r,createElement:l,createText:a,createComment:u,setText:h,setElementText:f,parentNode:p,nextSibling:v,setScopeId:A=nt,insertStaticContent:H}=e,$=(d,c,g,k=null,y=null,C=null,D=void 0,M=null,P=!!c.dynamicChildren)=>{if(d===c)return;d&&!Wt(d,c)&&(k=qe(d),ge(d,y,C,!0),d=null),c.patchFlag===-2&&(P=!1,c.dynamicChildren=null);const{type:T,ref:K,shapeFlag:N}=c;switch(T){case Ns:b(d,c,g,k);break;case bt:I(d,c,g,k);break;case xs:d==null&&L(c,g,k,D);break;case ie:ke(d,c,g,k,y,C,D,M,P);break;default:N&1?Z(d,c,g,k,y,C,D,M,P):N&6?Ce(d,c,g,k,y,C,D,M,P):(N&64||N&128)&&T.process(d,c,g,k,y,C,D,M,P,m)}K!=null&&y?Zt(K,d&&d.ref,C,c||d,!c):K==null&&d&&d.ref!=null&&Zt(d.ref,null,C,d,!0)},b=(d,c,g,k)=>{if(d==null)n(c.el=a(c.children),g,k);else{const y=c.el=d.el;c.children!==d.children&&h(y,c.children)}},I=(d,c,g,k)=>{d==null?n(c.el=u(c.children||""),g,k):c.el=d.el},L=(d,c,g,k)=>{[d.el,d.anchor]=H(d.children,c,g,k,d.el,d.anchor)},B=({el:d,anchor:c},g,k)=>{let y;for(;d&&d!==c;)y=v(d),n(d,g,k),d=y;n(c,g,k)},F=({el:d,anchor:c})=>{let g;for(;d&&d!==c;)g=v(d),o(d),d=g;o(c)},Z=(d,c,g,k,y,C,D,M,P)=>{if(c.type==="svg"?D="svg":c.type==="math"&&(D="mathml"),d==null)he(c,g,k,y,C,D,M,P);else{const T=d.el&&d.el._isVueCE?d.el:null;try{T&&T._beginPatch(),z(d,c,y,C,D,M,P)}finally{T&&T._endPatch()}}},he=(d,c,g,k,y,C,D,M)=>{let P,T;const{props:K,shapeFlag:N,transition:U,dirs:q}=d;if(P=d.el=l(d.type,C,K&&K.is,K),N&8?f(P,d.children):N&16&&j(d.children,P,null,k,y,zs(d,C),D,M),q&&St(d,null,k,"created"),W(P,d,d.scopeId,D,k),K){for(const ue in K)ue!=="value"&&!qt(ue)&&r(P,ue,null,K[ue],C,k);"value"in K&&r(P,"value",null,K.value,C),(T=K.onVnodeBeforeMount)&&Qe(T,k,d)}q&&St(d,null,k,"beforeMount");const te=Xi(y,U);te&&U.beforeEnter(P),n(P,c,g),((T=K&&K.onVnodeMounted)||te||q)&&Re(()=>{try{T&&Qe(T,k,d),te&&U.enter(P),q&&St(d,null,k,"mounted")}finally{}},y)},W=(d,c,g,k,y)=>{if(g&&A(d,g),k)for(let C=0;C<k.length;C++)A(d,k[C]);if(y){let C=y.subTree;if(c===C||cr(C.type)&&(C.ssContent===c||C.ssFallback===c)){const D=y.vnode;W(d,D,D.scopeId,D.slotScopeIds,y.parent)}}},j=(d,c,g,k,y,C,D,M,P=0)=>{for(let T=P;T<d.length;T++){const K=d[T]=M?ct(d[T]):tt(d[T]);$(null,K,c,g,k,y,C,D,M)}},z=(d,c,g,k,y,C,D)=>{const M=c.el=d.el;let{patchFlag:P,dynamicChildren:T,dirs:K}=c;P|=d.patchFlag&16;const N=d.props||de,U=c.props||de;let q;if(g&&kt(g,!1),(q=U.onVnodeBeforeUpdate)&&Qe(q,g,c,d),K&&St(c,d,g,"beforeUpdate"),g&&kt(g,!0),(N.innerHTML&&U.innerHTML==null||N.textContent&&U.textContent==null)&&f(M,""),T?X(d.dynamicChildren,T,M,g,k,zs(c,y),C):D||se(d,c,M,null,g,k,zs(c,y),C,!1),P>0){if(P&16)ee(M,N,U,g,y);else if(P&2&&N.class!==U.class&&r(M,"class",null,U.class,y),P&4&&r(M,"style",N.style,U.style,y),P&8){const te=c.dynamicProps;for(let ue=0;ue<te.length;ue++){const fe=te[ue],be=N[fe],$e=U[fe];($e!==be||fe==="value")&&r(M,fe,be,$e,y,g)}}P&1&&d.children!==c.children&&f(M,c.children)}else!D&&T==null&&ee(M,N,U,g,y);((q=U.onVnodeUpdated)||K)&&Re(()=>{q&&Qe(q,g,c,d),K&&St(c,d,g,"updated")},k)},X=(d,c,g,k,y,C,D)=>{for(let M=0;M<c.length;M++){const P=d[M],T=c[M],K=P.el&&(P.type===ie||!Wt(P,T)||P.shapeFlag&198)?p(P.el):g;$(P,T,K,null,k,y,C,D,!0)}},ee=(d,c,g,k,y)=>{if(c!==g){if(c!==de)for(const C in c)!qt(C)&&!(C in g)&&r(d,C,c[C],null,y,k);for(const C in g){if(qt(C))continue;const D=g[C],M=c[C];D!==M&&C!=="value"&&r(d,C,M,D,y,k)}"value"in g&&r(d,"value",c.value,g.value,y)}},ke=(d,c,g,k,y,C,D,M,P)=>{const T=c.el=d?d.el:a(""),K=c.anchor=d?d.anchor:a("");let{patchFlag:N,dynamicChildren:U,slotScopeIds:q}=c;q&&(M=M?M.concat(q):q),d==null?(n(T,g,k),n(K,g,k),j(c.children||[],g,K,y,C,D,M,P)):N>0&&N&64&&U&&d.dynamicChildren&&d.dynamicChildren.length===U.length?(X(d.dynamicChildren,U,g,y,C,D,M),(c.key!=null||y&&c===y.subTree)&&ir(d,c,!0)):se(d,c,g,K,y,C,D,M,P)},Ce=(d,c,g,k,y,C,D,M,P)=>{c.slotScopeIds=M,d==null?c.shapeFlag&512?y.ctx.activate(c,g,k,D,P):xt(c,g,k,y,C,D,P):Et(d,c,P)},xt=(d,c,g,k,y,C,D)=>{const M=d.component=al(d,k,y);if(Wo(d)&&(M.ctx.renderer=m),ul(M,!1,D),M.asyncDep){if(y&&y.registerDep(M,we,D),!d.el){const P=M.subTree=ot(bt);I(null,P,c,g),d.placeholder=P.el}}else we(M,d,c,g,y,C,D)},Et=(d,c,g)=>{const k=c.component=d.component;if(Bi(d,c,g))if(k.asyncDep&&!k.asyncResolved){ce(k,c,g);return}else k.next=c,k.update();else c.el=d.el,k.vnode=c},we=(d,c,g,k,y,C,D)=>{const M=()=>{if(d.isMounted){let{next:N,bu:U,u:q,parent:te,vnode:ue}=d;{const Ye=lr(d);if(Ye){N&&(N.el=ue.el,ce(d,N,D)),Ye.asyncDep.then(()=>{Re(()=>{d.isUnmounted||T()},y)});return}}let fe=N,be;kt(d,!1),N?(N.el=ue.el,ce(d,N,D)):N=ue,U&&ms(U),(be=N.props&&N.props.onVnodeBeforeUpdate)&&Qe(be,te,N,ue),kt(d,!0);const $e=Un(d),Ge=d.subTree;d.subTree=$e,$(Ge,$e,p(Ge.el),qe(Ge),d,y,C),N.el=$e.el,fe===null&&Wi(d,$e.el),q&&Re(q,y),(be=N.props&&N.props.onVnodeUpdated)&&Re(()=>Qe(be,te,N,ue),y)}else{let N;const{el:U,props:q}=c,{bm:te,m:ue,parent:fe,root:be,type:$e}=d,Ge=Qt(c);kt(d,!1),te&&ms(te),!Ge&&(N=q&&q.onVnodeBeforeMount)&&Qe(N,fe,c),kt(d,!0);{be.ce&&be.ce._hasShadowRoot()&&be.ce._injectChildStyle($e,d.parent?d.parent.type:void 0);const Ye=d.subTree=Un(d);$(null,Ye,g,k,d,y,C),c.el=Ye.el}if(ue&&Re(ue,y),!Ge&&(N=q&&q.onVnodeMounted)){const Ye=c;Re(()=>Qe(N,fe,Ye),y)}(c.shapeFlag&256||fe&&Qt(fe.vnode)&&fe.vnode.shapeFlag&256)&&d.a&&Re(d.a,y),d.isMounted=!0,c=g=k=null}};d.scope.on();const P=d.effect=new bo(M);d.scope.off();const T=d.update=P.run.bind(P),K=d.job=P.runIfDirty.bind(P);K.i=d,K.id=d.uid,P.scheduler=()=>yn(K),kt(d,!0),T()},ce=(d,c,g)=>{c.component=d;const k=d.vnode.props;d.vnode=c,d.next=null,zi(d,c.props,k,g),Yi(d,c.children,g),pt(),On(d),ht()},se=(d,c,g,k,y,C,D,M,P=!1)=>{const T=d&&d.children,K=d?d.shapeFlag:0,N=c.children,{patchFlag:U,shapeFlag:q}=c;if(U>0){if(U&128){E(T,N,g,k,y,C,D,M,P);return}else if(U&256){V(T,N,g,k,y,C,D,M,P);return}}q&8?(K&16&&Be(T,y,C),N!==T&&f(g,N)):K&16?q&16?E(T,N,g,k,y,C,D,M,P):Be(T,y,C,!0):(K&8&&f(g,""),q&16&&j(N,g,k,y,C,D,M,P))},V=(d,c,g,k,y,C,D,M,P)=>{d=d||Ot,c=c||Ot;const T=d.length,K=c.length,N=Math.min(T,K);let U;for(U=0;U<N;U++){const q=c[U]=P?ct(c[U]):tt(c[U]);$(d[U],q,g,null,y,C,D,M,P)}T>K?Be(d,y,C,!0,!1,N):j(c,g,k,y,C,D,M,P,N)},E=(d,c,g,k,y,C,D,M,P)=>{let T=0;const K=c.length;let N=d.length-1,U=K-1;for(;T<=N&&T<=U;){const q=d[T],te=c[T]=P?ct(c[T]):tt(c[T]);if(Wt(q,te))$(q,te,g,null,y,C,D,M,P);else break;T++}for(;T<=N&&T<=U;){const q=d[N],te=c[U]=P?ct(c[U]):tt(c[U]);if(Wt(q,te))$(q,te,g,null,y,C,D,M,P);else break;N--,U--}if(T>N){if(T<=U){const q=U+1,te=q<K?c[q].el:k;for(;T<=U;)$(null,c[T]=P?ct(c[T]):tt(c[T]),g,te,y,C,D,M,P),T++}}else if(T>U)for(;T<=N;)ge(d[T],y,C,!0),T++;else{const q=T,te=T,ue=new Map;for(T=te;T<=U;T++){const Ne=c[T]=P?ct(c[T]):tt(c[T]);Ne.key!=null&&ue.set(Ne.key,T)}let fe,be=0;const $e=U-te+1;let Ge=!1,Ye=0;const Ht=new Array($e);for(T=0;T<$e;T++)Ht[T]=0;for(T=q;T<=N;T++){const Ne=d[T];if(be>=$e){ge(Ne,y,C,!0);continue}let Ze;if(Ne.key!=null)Ze=ue.get(Ne.key);else for(fe=te;fe<=U;fe++)if(Ht[fe-te]===0&&Wt(Ne,c[fe])){Ze=fe;break}Ze===void 0?ge(Ne,y,C,!0):(Ht[Ze-te]=T+1,Ze>=Ye?Ye=Ze:Ge=!0,$(Ne,c[Ze],g,null,y,C,D,M,P),be++)}const Tn=Ge?el(Ht):Ot;for(fe=Tn.length-1,T=$e-1;T>=0;T--){const Ne=te+T,Ze=c[Ne],$n=c[Ne+1],An=Ne+1<K?$n.el||ar($n):k;Ht[T]===0?$(null,Ze,g,An,y,C,D,M,P):Ge&&(fe<0||T!==Tn[fe]?Te(Ze,g,An,2):fe--)}}},Te=(d,c,g,k,y=null)=>{const{el:C,type:D,transition:M,children:P,shapeFlag:T}=d;if(T&6){Te(d.component.subTree,c,g,k);return}if(T&128){d.suspense.move(c,g,k);return}if(T&64){D.move(d,c,g,m);return}if(D===ie){n(C,c,g);for(let N=0;N<P.length;N++)Te(P[N],c,g,k);n(d.anchor,c,g);return}if(D===xs){B(d,c,g);return}if(k!==2&&T&1&&M)if(k===0)M.beforeEnter(C),n(C,c,g),Re(()=>M.enter(C),y);else{const{leave:N,delayLeave:U,afterLeave:q}=M,te=()=>{d.ctx.isUnmounted?o(C):n(C,c,g)},ue=()=>{C._isLeaving&&C[mi](!0),N(C,()=>{te(),q&&q()})};U?U(C,te,ue):ue()}else n(C,c,g)},ge=(d,c,g,k=!1,y=!1)=>{const{type:C,props:D,ref:M,children:P,dynamicChildren:T,shapeFlag:K,patchFlag:N,dirs:U,cacheIndex:q,memo:te}=d;if(N===-2&&(y=!1),M!=null&&(pt(),Zt(M,null,g,d,!0),ht()),q!=null&&(c.renderCache[q]=void 0),K&256){c.ctx.deactivate(d);return}const ue=K&1&&U,fe=!Qt(d);let be;if(fe&&(be=D&&D.onVnodeBeforeUnmount)&&Qe(be,c,d),K&6)It(d.component,g,k);else{if(K&128){d.suspense.unmount(g,k);return}ue&&St(d,null,c,"beforeUnmount"),K&64?d.type.remove(d,c,g,m,k):T&&!T.hasOnce&&(C!==ie||N>0&&N&64)?Be(T,c,g,!1,!0):(C===ie&&N&384||!y&&K&16)&&Be(P,c,g),k&&ne(d)}const $e=te!=null&&q==null;(fe&&(be=D&&D.onVnodeUnmounted)||ue||$e)&&Re(()=>{be&&Qe(be,c,d),ue&&St(d,null,c,"unmounted"),$e&&(d.el=null)},g)},ne=d=>{const{type:c,el:g,anchor:k,transition:y}=d;if(c===ie){He(g,k);return}if(c===xs){F(d);return}const C=()=>{o(g),y&&!y.persisted&&y.afterLeave&&y.afterLeave()};if(d.shapeFlag&1&&y&&!y.persisted){const{leave:D,delayLeave:M}=y,P=()=>D(g,C);M?M(d.el,C,P):P()}else C()},He=(d,c)=>{let g;for(;d!==c;)g=v(d),o(d),d=g;o(c)},It=(d,c,g)=>{const{bum:k,scope:y,job:C,subTree:D,um:M,m:P,a:T}=d;Wn(P),Wn(T),k&&ms(k),y.stop(),C&&(C.flags|=8,ge(D,d,c,g)),M&&Re(M,c),Re(()=>{d.isUnmounted=!0},c)},Be=(d,c,g,k=!1,y=!1,C=0)=>{for(let D=C;D<d.length;D++)ge(d[D],c,g,k,y)},qe=d=>{if(d.shapeFlag&6)return qe(d.component.subTree);if(d.shapeFlag&128)return d.suspense.next();const c=v(d.anchor||d.el),g=c&&c[pi];return g?v(g):c};let O=!1;const x=(d,c,g)=>{let k;d==null?c._vnode&&(ge(c._vnode,null,null,!0),k=c._vnode.component):$(c._vnode||null,d,c,null,null,null,g),c._vnode=d,O||(O=!0,On(k),Lo(),O=!1)},m={p:$,um:ge,m:Te,r:ne,mt:xt,mc:j,pc:se,pbc:X,n:qe,o:e};return{render:x,hydrate:void 0,createApp:Ni(x)}}function zs({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function kt({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Xi(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ir(e,t,s=!1){const n=e.children,o=t.children;if(J(n)&&J(o))for(let r=0;r<n.length;r++){const l=n[r];let a=o[r];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=o[r]=ct(o[r]),a.el=l.el),!s&&a.patchFlag!==-2&&ir(l,a)),a.type===Ns&&(a.patchFlag===-1&&(a=o[r]=ct(a)),a.el=l.el),a.type===bt&&!a.el&&(a.el=l.el)}}function el(e){const t=e.slice(),s=[0];let n,o,r,l,a;const u=e.length;for(n=0;n<u;n++){const h=e[n];if(h!==0){if(o=s[s.length-1],e[o]<h){t[n]=o,s.push(n);continue}for(r=0,l=s.length-1;r<l;)a=r+l>>1,e[s[a]]<h?r=a+1:l=a;h<e[s[r]]&&(r>0&&(t[n]=s[r-1]),s[r]=n)}}for(r=s.length,l=s[r-1];r-- >0;)s[r]=l,l=t[l];return s}function lr(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:lr(t)}function Wn(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function ar(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?ar(t.subTree):null}const cr=e=>e.__isSuspense;function tl(e,t){t&&t.pendingBranch?J(e)?t.effects.push(...e):t.effects.push(e):li(e)}const ie=Symbol.for("v-fgt"),Ns=Symbol.for("v-txt"),bt=Symbol.for("v-cmt"),xs=Symbol.for("v-stc"),es=[];let Fe=null;function w(e=!1){es.push(Fe=e?null:[])}function sl(){es.pop(),Fe=es[es.length-1]||null}let os=1;function Kn(e,t=!1){os+=e,e<0&&Fe&&t&&(Fe.hasOnce=!0)}function ur(e){return e.dynamicChildren=os>0?Fe||Ot:null,sl(),os>0&&Fe&&Fe.push(e),e}function S(e,t,s,n,o,r){return ur(i(e,t,s,n,o,r,!0))}function dr(e,t,s,n,o){return ur(ot(e,t,s,n,o,!0))}function fr(e){return e?e.__v_isVNode===!0:!1}function Wt(e,t){return e.type===t.type&&e.key===t.key}const pr=({key:e})=>e??null,vs=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?ve(e)||Pe(e)||Y(e)?{i:Le,r:e,k:t,f:!!s}:e:null);function i(e,t=null,s=null,n=0,o=null,r=e===ie?0:1,l=!1,a=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&pr(t),ref:t&&vs(t),scopeId:Vo,slotScopeIds:null,children:s,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:n,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Le};return a?(kn(u,s),r&128&&e.normalize(u)):s&&(u.shapeFlag|=ve(s)?8:16),os>0&&!l&&Fe&&(u.patchFlag>0||r&6)&&u.patchFlag!==32&&Fe.push(u),u}const ot=nl;function nl(e,t=null,s=null,n=0,o=null,r=!1){if((!e||e===zo)&&(e=bt),fr(e)){const a=Lt(e,t,!0);return s&&kn(a,s),os>0&&!r&&Fe&&(a.shapeFlag&6?Fe[Fe.indexOf(e)]=a:Fe.push(a)),a.patchFlag=-2,a}if(ml(e)&&(e=e.__vccOpts),t){t=ol(t);let{class:a,style:u}=t;a&&!ve(a)&&(t.class=G(a)),ae(u)&&(vn(u)&&!J(u)&&(u=Ae({},u)),t.style=Ms(u))}const l=ve(e)?1:cr(e)?128:hi(e)?64:ae(e)?4:Y(e)?2:0;return i(e,t,s,n,o,l,r,!0)}function ol(e){return e?vn(e)||er(e)?Ae({},e):e:null}function Lt(e,t,s=!1,n=!1){const{props:o,ref:r,patchFlag:l,children:a,transition:u}=e,h=t?rl(o||{},t):o,f={__v_isVNode:!0,__v_skip:!0,type:e.type,props:h,key:h&&pr(h),ref:t&&t.ref?s&&r?J(r)?r.concat(vs(t)):[r,vs(t)]:vs(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ie?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Lt(e.ssContent),ssFallback:e.ssFallback&&Lt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&n&&bn(f,u.clone(f)),f}function Ve(e=" ",t=0){return ot(Ns,null,e,t)}function We(e,t){const s=ot(xs,null,e);return s.staticCount=t,s}function Q(e="",t=!1){return t?(w(),dr(bt,null,e)):ot(bt,null,e)}function tt(e){return e==null||typeof e=="boolean"?ot(bt):J(e)?ot(ie,null,e.slice()):fr(e)?ct(e):ot(Ns,null,String(e))}function ct(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Lt(e)}function kn(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(J(t))s=16;else if(typeof t=="object")if(n&65){const o=t.default;o&&(o._c&&(o._d=!1),kn(e,o()),o._c&&(o._d=!0));return}else{s=32;const o=t._;!o&&!er(t)?t._ctx=Le:o===3&&Le&&(Le.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Y(t)?(t={default:t,_ctx:Le},s=32):(t=String(t),n&64?(s=16,t=[Ve(t)]):s=8);e.children=t,e.shapeFlag|=s}function rl(...e){const t={};for(let s=0;s<e.length;s++){const n=e[s];for(const o in n)if(o==="class")t.class!==n.class&&(t.class=G([t.class,n.class]));else if(o==="style")t.style=Ms([t.style,n.style]);else if(Ts(o)){const r=t[o],l=n[o];l&&r!==l&&!(J(r)&&r.includes(l))?t[o]=r?[].concat(r,l):l:l==null&&r==null&&!$s(o)&&(t[o]=l)}else o!==""&&(t[o]=n[o])}return t}function Qe(e,t,s,n=null){it(e,t,7,[s,n])}const il=Go();let ll=0;function al(e,t,s){const n=e.type,o=(t?t.appContext:e.appContext)||il,r={uid:ll++,vnode:e,type:n,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Er(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:sr(n,o),emitsOptions:Yo(n,o),emit:null,emitted:null,propsDefaults:de,inheritAttrs:n.inheritAttrs,ctx:de,data:de,props:de,attrs:de,slots:de,refs:de,setupState:de,setupContext:null,suspense:s,suspenseId:s?s.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=Fi.bind(null,r),e.ce&&e.ce(r),r}let Ie=null;const cl=()=>Ie||Le;let Cs,on;{const e=Ps(),t=(s,n)=>{let o;return(o=e[s])||(o=e[s]=[]),o.push(n),r=>{o.length>1?o.forEach(l=>l(r)):o[0](r)}};Cs=t("__VUE_INSTANCE_SETTERS__",s=>Ie=s),on=t("__VUE_SSR_SETTERS__",s=>rs=s)}const us=e=>{const t=Ie;return Cs(e),e.scope.on(),()=>{e.scope.off(),Cs(t)}},zn=()=>{Ie&&Ie.scope.off(),Cs(null)};function hr(e){return e.vnode.shapeFlag&4}let rs=!1;function ul(e,t=!1,s=!1){t&&on(t);const{props:n,children:o}=e.vnode,r=hr(e);Ki(e,n,r,t),Gi(e,o,s||t);const l=r?dl(e,t):void 0;return t&&on(!1),l}function dl(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ii);const{setup:n}=s;if(n){pt();const o=e.setupContext=n.length>1?pl(e):null,r=us(e),l=cs(n,e,0,[e.props,o]),a=po(l);if(ht(),r(),(a||e.sp)&&!Qt(e)&&Bo(e),a){if(l.then(zn,zn),t)return l.then(u=>{Jn(e,u)}).catch(u=>{Ds(u,e,0)});e.asyncDep=l}else Jn(e,l)}else mr(e)}function Jn(e,t,s){Y(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ae(t)&&(e.setupState=Do(t)),mr(e)}function mr(e,t,s){const n=e.type;e.render||(e.render=n.render||nt);{const o=us(e);pt();try{Pi(e)}finally{ht(),o()}}}const fl={get(e,t){return Ee(e,"get",""),e[t]}};function pl(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,fl),slots:e.slots,emit:e.emit,expose:t}}function Ls(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Do(Yr(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in Xt)return Xt[s](e)},has(t,s){return s in t||s in Xt}})):e.proxy}function hl(e,t=!0){return Y(e)?e.displayName||e.name:e.name||t&&e.__name}function ml(e){return Y(e)&&"__vccOpts"in e}const Ke=(e,t)=>si(e,t,rs),gl="3.5.31";/**
|
|
60
|
+
**/function ds(e,t,s,n){try{return n?e(...n):e()}catch(o){Rs(o,t,s)}}function rt(e,t,s,n){if(X(e)){const o=ds(e,t,s,n);return o&&mo(o)&&o.catch(l=>{Rs(l,t,s)}),o}if(Z(e)){const o=[];for(let l=0;l<e.length;l++)o.push(rt(e[l],t,s,n));return o}}function Rs(e,t,s,n=!0){const o=t?t.vnode:null,{errorHandler:l,throwUnhandledErrorInProduction:a}=t&&t.appContext.config||xe;if(t){let c=t.parent;const u=t.proxy,x=`https://vuejs.org/error-reference/#runtime-${s}`;for(;c;){const d=c.ec;if(d){for(let m=0;m<d.length;m++)if(d[m](e,u,x)===!1)return}c=c.parent}if(l){xt(),ds(l,null,10,[e,u,x]),ht();return}}ll(e,s,o,n,a)}function ll(e,t,s,n=!0,o=!1){if(o)throw e;console.error(e)}const De=[];let Ye=-1;const jt=[];let _t=null,Ot=0;const jo=Promise.resolve();let ks=null;function No(e){const t=ks||jo;return e?t.then(this?e.bind(this):e):t}function il(e){let t=Ye+1,s=De.length;for(;t<s;){const n=t+s>>>1,o=De[n],l=ls(o);l<e||l===e&&o.flags&2?t=n+1:s=n}return t}function bn(e){if(!(e.flags&1)){const t=ls(e),s=De[De.length-1];!s||!(e.flags&2)&&t>=ls(s)?De.push(e):De.splice(il(t),0,e),e.flags|=1,Lo()}}function Lo(){ks||(ks=jo.then(Vo))}function al(e){Z(e)?jt.push(...e):_t&&e.id===-1?_t.splice(Ot+1,0,e):e.flags&1||(jt.push(e),e.flags|=1),Lo()}function Dn(e,t,s=Ye+1){for(;s<De.length;s++){const n=De[s];if(n&&n.flags&2){if(e&&n.id!==e.uid)continue;De.splice(s,1),s--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Uo(e){if(jt.length){const t=[...new Set(jt)].sort((s,n)=>ls(s)-ls(n));if(jt.length=0,_t){_t.push(...t);return}for(_t=t,Ot=0;Ot<_t.length;Ot++){const s=_t[Ot];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}_t=null,Ot=0}}const ls=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Vo(e){try{for(Ye=0;Ye<De.length;Ye++){const t=De[Ye];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),ds(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ye<De.length;Ye++){const t=De[Ye];t&&(t.flags&=-2)}Ye=-1,De.length=0,Uo(),ks=null,(De.length||jt.length)&&Vo()}}let Ue=null,Fo=null;function Ss(e){const t=Ue;return Ue=e,Fo=e&&e.type.__scopeId||null,t}function cl(e,t=Ue,s){if(!t||e._n)return e;const n=(...o)=>{n._d&&zn(-1);const l=Ss(t);let a;try{a=e(...o)}finally{Ss(l),n._d&&zn(1)}return a};return n._n=!0,n._c=!0,n._d=!0,n}function ee(e,t){if(Ue===null)return e;const s=Us(Ue),n=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[l,a,c,u=xe]=t[o];l&&(X(l)&&(l={mounted:l,updated:l}),l.deep&&pt(a),n.push({dir:l,instance:s,value:a,oldValue:void 0,arg:c,modifiers:u}))}return e}function Ct(e,t,s,n){const o=e.dirs,l=t&&t.dirs;for(let a=0;a<o.length;a++){const c=o[a];l&&(c.oldValue=l[a].value);let u=c.dir[n];u&&(xt(),rt(u,s,8,[e.el,c,e,t]),ht())}}function ul(e,t){if(Pe){let s=Pe.provides;const n=Pe.parent&&Pe.parent.provides;n===s&&(s=Pe.provides=Object.create(n)),s[e]=t}}function vs(e,t,s=!1){const n=ui();if(n||Nt){let o=Nt?Nt._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return s&&X(t)?t.call(n&&n.proxy):t}}const dl=Symbol.for("v-scx"),fl=()=>vs(dl);function Ws(e,t,s){return Ho(e,t,s)}function Ho(e,t,s=xe){const{immediate:n,deep:o,flush:l,once:a}=s,c=Ae({},s),u=t&&n||!t&&l!=="post";let x;if(as){if(l==="sync"){const T=fl();x=T.__watcherHandles||(T.__watcherHandles=[])}else if(!u){const T=()=>{};return T.stop=st,T.resume=st,T.pause=st,T}}const d=Pe;c.call=(T,B,C)=>rt(T,d,B,C);let m=!1;l==="post"?c.scheduler=T=>{je(T,d&&d.suspense)}:l!=="sync"&&(m=!0,c.scheduler=(T,B)=>{B?T():bn(T)}),c.augmentJob=T=>{t&&(T.flags|=4),m&&(T.flags|=2,d&&(T.id=d.uid,T.i=d))};const y=rl(e,t,c);return as&&(x?x.push(y):u&&y()),y}function pl(e,t,s){const n=this.proxy,o=Ce(e)?e.includes(".")?Bo(n,e):()=>n[e]:e.bind(n,n);let l;X(t)?l=t:(l=t.handler,s=t);const a=fs(this),c=Ho(o,l.bind(n),s);return a(),c}function Bo(e,t){const s=t.split(".");return()=>{let n=e;for(let o=0;o<s.length&&n;o++)n=n[s[o]];return n}}const ml=Symbol("_vte"),xl=e=>e.__isTeleport,hl=Symbol("_leaveCb");function _n(e,t){e.shapeFlag&6&&e.component?(e.transition=t,_n(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function vt(e,t){return X(e)?Ae({name:e.name},t,{setup:e}):e}function Ko(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Rn(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const Cs=new WeakMap;function es(e,t,s,n,o=!1){if(Z(e)){e.forEach((C,w)=>es(C,t&&(Z(t)?t[w]:t),s,n,o));return}if(ts(n)&&!o){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&es(e,t,s,n.component.subTree);return}const l=n.shapeFlag&4?Us(n.component):n.el,a=o?null:l,{i:c,r:u}=e,x=t&&t.r,d=c.refs===xe?c.refs={}:c.refs,m=c.setupState,y=ae(m),T=m===xe?po:C=>Rn(d,C)?!1:ce(y,C),B=(C,w)=>!(w&&Rn(d,w));if(x!=null&&x!==u){if(jn(t),Ce(x))d[x]=null,T(x)&&(m[x]=null);else if(Me(x)){const C=t;B(x,C.k)&&(x.value=null),C.k&&(d[C.k]=null)}}if(X(u))ds(u,c,12,[a,d]);else{const C=Ce(u),w=Me(u);if(C||w){const k=()=>{if(e.f){const P=C?T(u)?m[u]:d[u]:B()||!e.k?u.value:d[e.k];if(o)Z(P)&&cn(P,l);else if(Z(P))P.includes(l)||P.push(l);else if(C)d[u]=[l],T(u)&&(m[u]=d[u]);else{const H=[l];B(u,e.k)&&(u.value=H),e.k&&(d[e.k]=H)}}else C?(d[u]=a,T(u)&&(m[u]=a)):w&&(B(u,e.k)&&(u.value=a),e.k&&(d[e.k]=a))};if(a){const P=()=>{k(),Cs.delete(e)};P.id=-1,Cs.set(e,P),je(P,s)}else jn(e),k()}}}function jn(e){const t=Cs.get(e);t&&(t.flags|=8,Cs.delete(e))}Os().requestIdleCallback;Os().cancelIdleCallback;const ts=e=>!!e.type.__asyncLoader,Wo=e=>e.type.__isKeepAlive;function gl(e,t){zo(e,"a",t)}function vl(e,t){zo(e,"da",t)}function zo(e,t,s=Pe){const n=e.__wdc||(e.__wdc=()=>{let o=s;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(js(t,n,s),s){let o=s.parent;for(;o&&o.parent;)Wo(o.parent.vnode)&&yl(n,t,s,o),o=o.parent}}function yl(e,t,s,n){const o=js(t,e,n,!0);wn(()=>{cn(n[t],o)},s)}function js(e,t,s=Pe,n=!1){if(s){const o=s[e]||(s[e]=[]),l=t.__weh||(t.__weh=(...a)=>{xt();const c=fs(s),u=rt(t,s,e,a);return c(),ht(),u});return n?o.unshift(l):o.push(l),l}}const yt=e=>(t,s=Pe)=>{(!as||e==="sp")&&js(e,(...n)=>t(...n),s)},bl=yt("bm"),lt=yt("m"),_l=yt("bu"),wl=yt("u"),kl=yt("bum"),wn=yt("um"),Sl=yt("sp"),Cl=yt("rtg"),$l=yt("rtc");function Tl(e,t=Pe){js("ec",e,t)}const El="components",Jo=Symbol.for("v-ndc");function Al(e){return Ce(e)?Il(El,e,!1)||e:e||Jo}function Il(e,t,s=!0,n=!1){const o=Ue||Pe;if(o){const l=o.type;{const c=xi(l,!1);if(c&&(c===t||c===Re(t)||c===Ps(Re(t))))return l}const a=Nn(o[e]||l[e],t)||Nn(o.appContext[e],t);return!a&&n?l:a}}function Nn(e,t){return e&&(e[t]||e[Re(t)]||e[Ps(Re(t))])}function be(e,t,s,n){let o;const l=s,a=Z(e);if(a||Ce(e)){const c=a&&At(e);let u=!1,x=!1;c&&(u=!He(e),x=gt(e),e=Ds(e)),o=new Array(e.length);for(let d=0,m=e.length;d<m;d++)o[d]=t(u?x?Ut(Ke(e[d])):Ke(e[d]):e[d],d,void 0,l)}else if(typeof e=="number"){o=new Array(e);for(let c=0;c<e;c++)o[c]=t(c+1,c,void 0,l)}else if(fe(e))if(e[Symbol.iterator])o=Array.from(e,(c,u)=>t(c,u,void 0,l));else{const c=Object.keys(e);o=new Array(c.length);for(let u=0,x=c.length;u<x;u++){const d=c[u];o[u]=t(e[d],d,u,l)}}else o=[];return o}const tn=e=>e?xr(e)?Us(e):tn(e.parent):null,ss=Ae(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=>tn(e.parent),$root:e=>tn(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Go(e),$forceUpdate:e=>e.f||(e.f=()=>{bn(e.update)}),$nextTick:e=>e.n||(e.n=No.bind(e.proxy)),$watch:e=>pl.bind(e)}),zs=(e,t)=>e!==xe&&!e.__isScriptSetup&&ce(e,t),Pl={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:o,props:l,accessCache:a,type:c,appContext:u}=e;if(t[0]!=="$"){const y=a[t];if(y!==void 0)switch(y){case 1:return n[t];case 2:return o[t];case 4:return s[t];case 3:return l[t]}else{if(zs(n,t))return a[t]=1,n[t];if(o!==xe&&ce(o,t))return a[t]=2,o[t];if(ce(l,t))return a[t]=3,l[t];if(s!==xe&&ce(s,t))return a[t]=4,s[t];sn&&(a[t]=0)}}const x=ss[t];let d,m;if(x)return t==="$attrs"&&Ie(e.attrs,"get",""),x(e);if((d=c.__cssModules)&&(d=d[t]))return d;if(s!==xe&&ce(s,t))return a[t]=4,s[t];if(m=u.config.globalProperties,ce(m,t))return m[t]},set({_:e},t,s){const{data:n,setupState:o,ctx:l}=e;return zs(o,t)?(o[t]=s,!0):n!==xe&&ce(n,t)?(n[t]=s,!0):ce(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(l[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:o,props:l,type:a}},c){let u;return!!(s[c]||e!==xe&&c[0]!=="$"&&ce(e,c)||zs(t,c)||ce(l,c)||ce(n,c)||ce(ss,c)||ce(o.config.globalProperties,c)||(u=a.__cssModules)&&u[c])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:ce(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function Ln(e){return Z(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let sn=!0;function Ml(e){const t=Go(e),s=e.proxy,n=e.ctx;sn=!1,t.beforeCreate&&Un(t.beforeCreate,e,"bc");const{data:o,computed:l,methods:a,watch:c,provide:u,inject:x,created:d,beforeMount:m,mounted:y,beforeUpdate:T,updated:B,activated:C,deactivated:w,beforeDestroy:k,beforeUnmount:P,destroyed:H,unmounted:V,render:se,renderTracked:ne,renderTriggered:W,errorCaptured:N,serverPrefetch:G,expose:ue,inheritAttrs:U,components:R,directives:K,filters:oe}=t;if(x&&Ol(x,n,null),a)for(const pe in a){const le=a[pe];X(le)&&(n[pe]=le.bind(s))}if(o){const pe=o.call(s,s);fe(pe)&&(e.data=gn(pe))}if(sn=!0,l)for(const pe in l){const le=l[pe],F=X(le)?le.bind(s,s):X(le.get)?le.get.bind(s,s):st,M=!X(le)&&X(le.set)?le.set.bind(s):st,$e=Fe({get:F,set:M});Object.defineProperty(n,pe,{enumerable:!0,configurable:!0,get:()=>$e.value,set:ke=>$e.value=ke})}if(c)for(const pe in c)qo(c[pe],n,s,pe);if(u){const pe=X(u)?u.call(s):u;Reflect.ownKeys(pe).forEach(le=>{ul(le,pe[le])})}d&&Un(d,e,"c");function Se(pe,le){Z(le)?le.forEach(F=>pe(F.bind(s))):le&&pe(le.bind(s))}if(Se(bl,m),Se(lt,y),Se(_l,T),Se(wl,B),Se(gl,C),Se(vl,w),Se(Tl,N),Se($l,ne),Se(Cl,W),Se(kl,P),Se(wn,V),Se(Sl,G),Z(ue))if(ue.length){const pe=e.exposed||(e.exposed={});ue.forEach(le=>{Object.defineProperty(pe,le,{get:()=>s[le],set:F=>s[le]=F,enumerable:!0})})}else e.exposed||(e.exposed={});se&&e.render===st&&(e.render=se),U!=null&&(e.inheritAttrs=U),R&&(e.components=R),K&&(e.directives=K),G&&Ko(e)}function Ol(e,t,s=st){Z(e)&&(e=nn(e));for(const n in e){const o=e[n];let l;fe(o)?"default"in o?l=vs(o.from||n,o.default,!0):l=vs(o.from||n):l=vs(o),Me(l)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>l.value,set:a=>l.value=a}):t[n]=l}}function Un(e,t,s){rt(Z(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function qo(e,t,s,n){let o=n.includes(".")?Bo(s,n):()=>s[n];if(Ce(e)){const l=t[e];X(l)&&Ws(o,l)}else if(X(e))Ws(o,e.bind(s));else if(fe(e))if(Z(e))e.forEach(l=>qo(l,t,s,n));else{const l=X(e.handler)?e.handler.bind(s):t[e.handler];X(l)&&Ws(o,l,e)}}function Go(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:o,optionsCache:l,config:{optionMergeStrategies:a}}=e.appContext,c=l.get(t);let u;return c?u=c:!o.length&&!s&&!n?u=t:(u={},o.length&&o.forEach(x=>$s(u,x,a,!0)),$s(u,t,a)),fe(t)&&l.set(t,u),u}function $s(e,t,s,n=!1){const{mixins:o,extends:l}=t;l&&$s(e,l,s,!0),o&&o.forEach(a=>$s(e,a,s,!0));for(const a in t)if(!(n&&a==="expose")){const c=Dl[a]||s&&s[a];e[a]=c?c(e[a],t[a]):t[a]}return e}const Dl={data:Vn,props:Fn,emits:Fn,methods:Yt,computed:Yt,beforeCreate:Oe,created:Oe,beforeMount:Oe,mounted:Oe,beforeUpdate:Oe,updated:Oe,beforeDestroy:Oe,beforeUnmount:Oe,destroyed:Oe,unmounted:Oe,activated:Oe,deactivated:Oe,errorCaptured:Oe,serverPrefetch:Oe,components:Yt,directives:Yt,watch:jl,provide:Vn,inject:Rl};function Vn(e,t){return t?e?function(){return Ae(X(e)?e.call(this,this):e,X(t)?t.call(this,this):t)}:t:e}function Rl(e,t){return Yt(nn(e),nn(t))}function nn(e){if(Z(e)){const t={};for(let s=0;s<e.length;s++)t[e[s]]=e[s];return t}return e}function Oe(e,t){return e?[...new Set([].concat(e,t))]:t}function Yt(e,t){return e?Ae(Object.create(null),e,t):t}function Fn(e,t){return e?Z(e)&&Z(t)?[...new Set([...e,...t])]:Ae(Object.create(null),Ln(e),Ln(t??{})):t}function jl(e,t){if(!e)return t;if(!t)return e;const s=Ae(Object.create(null),e);for(const n in t)s[n]=Oe(e[n],t[n]);return s}function Yo(){return{app:null,config:{isNativeTag:po,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}}let Nl=0;function Ll(e,t){return function(n,o=null){X(n)||(n=Ae({},n)),o!=null&&!fe(o)&&(o=null);const l=Yo(),a=new WeakSet,c=[];let u=!1;const x=l.app={_uid:Nl++,_component:n,_props:o,_container:null,_context:l,_instance:null,version:gi,get config(){return l.config},set config(d){},use(d,...m){return a.has(d)||(d&&X(d.install)?(a.add(d),d.install(x,...m)):X(d)&&(a.add(d),d(x,...m))),x},mixin(d){return l.mixins.includes(d)||l.mixins.push(d),x},component(d,m){return m?(l.components[d]=m,x):l.components[d]},directive(d,m){return m?(l.directives[d]=m,x):l.directives[d]},mount(d,m,y){if(!u){const T=x._ceVNode||nt(n,o);return T.appContext=l,y===!0?y="svg":y===!1&&(y=void 0),e(T,d,y),u=!0,x._container=d,d.__vue_app__=x,Us(T.component)}},onUnmount(d){c.push(d)},unmount(){u&&(rt(c,x._instance,16),e(null,x._container),delete x._container.__vue_app__)},provide(d,m){return l.provides[d]=m,x},runWithContext(d){const m=Nt;Nt=x;try{return d()}finally{Nt=m}}};return x}}let Nt=null;const Ul=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Re(t)}Modifiers`]||e[`${St(t)}Modifiers`];function Vl(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||xe;let o=s;const l=t.startsWith("update:"),a=l&&Ul(n,t.slice(7));a&&(a.trim&&(o=s.map(d=>Ce(d)?d.trim():d)),a.number&&(o=s.map(Ms)));let c,u=n[c=Vs(t)]||n[c=Vs(Re(t))];!u&&l&&(u=n[c=Vs(St(t))]),u&&rt(u,e,6,o);const x=n[c+"Once"];if(x){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,rt(x,e,6,o)}}const Fl=new WeakMap;function Zo(e,t,s=!1){const n=s?Fl:t.emitsCache,o=n.get(e);if(o!==void 0)return o;const l=e.emits;let a={},c=!1;if(!X(e)){const u=x=>{const d=Zo(x,t,!0);d&&(c=!0,Ae(a,d))};!s&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!l&&!c?(fe(e)&&n.set(e,null),null):(Z(l)?l.forEach(u=>a[u]=null):Ae(a,l),fe(e)&&n.set(e,a),a)}function Ns(e,t){return!e||!Es(t)?!1:(t=t.slice(2).replace(/Once$/,""),ce(e,t[0].toLowerCase()+t.slice(1))||ce(e,St(t))||ce(e,t))}function Hn(e){const{type:t,vnode:s,proxy:n,withProxy:o,propsOptions:[l],slots:a,attrs:c,emit:u,render:x,renderCache:d,props:m,data:y,setupState:T,ctx:B,inheritAttrs:C}=e,w=Ss(e);let k,P;try{if(s.shapeFlag&4){const V=o||n,se=V;k=et(x.call(se,V,d,m,T,y,B)),P=c}else{const V=t;k=et(V.length>1?V(m,{attrs:c,slots:a,emit:u}):V(m,null)),P=t.props?c:Hl(c)}}catch(V){ns.length=0,Rs(V,e,1),k=nt(kt)}let H=k;if(P&&C!==!1){const V=Object.keys(P),{shapeFlag:se}=H;V.length&&se&7&&(l&&V.some(As)&&(P=Bl(P,l)),H=Vt(H,P,!1,!0))}return s.dirs&&(H=Vt(H,null,!1,!0),H.dirs=H.dirs?H.dirs.concat(s.dirs):s.dirs),s.transition&&_n(H,s.transition),k=H,Ss(w),k}const Hl=e=>{let t;for(const s in e)(s==="class"||s==="style"||Es(s))&&((t||(t={}))[s]=e[s]);return t},Bl=(e,t)=>{const s={};for(const n in e)(!As(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function Kl(e,t,s){const{props:n,children:o,component:l}=e,{props:a,children:c,patchFlag:u}=t,x=l.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&u>=0){if(u&1024)return!0;if(u&16)return n?Bn(n,a,x):!!a;if(u&8){const d=t.dynamicProps;for(let m=0;m<d.length;m++){const y=d[m];if(Qo(a,n,y)&&!Ns(x,y))return!0}}}else return(o||c)&&(!c||!c.$stable)?!0:n===a?!1:n?a?Bn(n,a,x):!0:!!a;return!1}function Bn(e,t,s){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let o=0;o<n.length;o++){const l=n[o];if(Qo(t,e,l)&&!Ns(s,l))return!0}return!1}function Qo(e,t,s){const n=e[s],o=t[s];return s==="style"&&fe(n)&&fe(o)?!Kt(n,o):n!==o}function Wl({vnode:e,parent:t,suspense:s},n){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=n,e=o),o===e)(e=t.vnode).el=n,t=t.parent;else break}s&&s.activeBranch===e&&(s.vnode.el=n)}const Xo={},er=()=>Object.create(Xo),tr=e=>Object.getPrototypeOf(e)===Xo;function zl(e,t,s,n=!1){const o={},l=er();e.propsDefaults=Object.create(null),sr(e,t,o,l);for(const a in e.propsOptions[0])a in o||(o[a]=void 0);s?e.props=n?o:Yr(o):e.type.props?e.props=o:e.props=l,e.attrs=l}function Jl(e,t,s,n){const{props:o,attrs:l,vnode:{patchFlag:a}}=e,c=ae(o),[u]=e.propsOptions;let x=!1;if((n||a>0)&&!(a&16)){if(a&8){const d=e.vnode.dynamicProps;for(let m=0;m<d.length;m++){let y=d[m];if(Ns(e.emitsOptions,y))continue;const T=t[y];if(u)if(ce(l,y))T!==l[y]&&(l[y]=T,x=!0);else{const B=Re(y);o[B]=on(u,c,B,T,e,!1)}else T!==l[y]&&(l[y]=T,x=!0)}}}else{sr(e,t,o,l)&&(x=!0);let d;for(const m in c)(!t||!ce(t,m)&&((d=St(m))===m||!ce(t,d)))&&(u?s&&(s[m]!==void 0||s[d]!==void 0)&&(o[m]=on(u,c,m,void 0,e,!0)):delete o[m]);if(l!==c)for(const m in l)(!t||!ce(t,m))&&(delete l[m],x=!0)}x&&ft(e.attrs,"set","")}function sr(e,t,s,n){const[o,l]=e.propsOptions;let a=!1,c;if(t)for(let u in t){if(Zt(u))continue;const x=t[u];let d;o&&ce(o,d=Re(u))?!l||!l.includes(d)?s[d]=x:(c||(c={}))[d]=x:Ns(e.emitsOptions,u)||(!(u in n)||x!==n[u])&&(n[u]=x,a=!0)}if(l){const u=ae(s),x=c||xe;for(let d=0;d<l.length;d++){const m=l[d];s[m]=on(o,u,m,x[m],e,!ce(x,m))}}return a}function on(e,t,s,n,o,l){const a=e[s];if(a!=null){const c=ce(a,"default");if(c&&n===void 0){const u=a.default;if(a.type!==Function&&!a.skipFactory&&X(u)){const{propsDefaults:x}=o;if(s in x)n=x[s];else{const d=fs(o);n=x[s]=u.call(null,t),d()}}else n=u;o.ce&&o.ce._setProp(s,n)}a[0]&&(l&&!c?n=!1:a[1]&&(n===""||n===St(s))&&(n=!0))}return n}const ql=new WeakMap;function nr(e,t,s=!1){const n=s?ql:t.propsCache,o=n.get(e);if(o)return o;const l=e.props,a={},c=[];let u=!1;if(!X(e)){const d=m=>{u=!0;const[y,T]=nr(m,t,!0);Ae(a,y),T&&c.push(...T)};!s&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!l&&!u)return fe(e)&&n.set(e,Dt),Dt;if(Z(l))for(let d=0;d<l.length;d++){const m=Re(l[d]);Kn(m)&&(a[m]=xe)}else if(l)for(const d in l){const m=Re(d);if(Kn(m)){const y=l[d],T=a[m]=Z(y)||X(y)?{type:y}:Ae({},y),B=T.type;let C=!1,w=!0;if(Z(B))for(let k=0;k<B.length;++k){const P=B[k],H=X(P)&&P.name;if(H==="Boolean"){C=!0;break}else H==="String"&&(w=!1)}else C=X(B)&&B.name==="Boolean";T[0]=C,T[1]=w,(C||ce(T,"default"))&&c.push(m)}}const x=[a,c];return fe(e)&&n.set(e,x),x}function Kn(e){return e[0]!=="$"&&!Zt(e)}const kn=e=>e==="_"||e==="_ctx"||e==="$stable",Sn=e=>Z(e)?e.map(et):[et(e)],Gl=(e,t,s)=>{if(t._n)return t;const n=cl((...o)=>Sn(t(...o)),s);return n._c=!1,n},or=(e,t,s)=>{const n=e._ctx;for(const o in e){if(kn(o))continue;const l=e[o];if(X(l))t[o]=Gl(o,l,n);else if(l!=null){const a=Sn(l);t[o]=()=>a}}},rr=(e,t)=>{const s=Sn(t);e.slots.default=()=>s},lr=(e,t,s)=>{for(const n in t)(s||!kn(n))&&(e[n]=t[n])},Yl=(e,t,s)=>{const n=e.slots=er();if(e.vnode.shapeFlag&32){const o=t._;o?(lr(n,t,s),s&&go(n,"_",o,!0)):or(t,n)}else t&&rr(e,t)},Zl=(e,t,s)=>{const{vnode:n,slots:o}=e;let l=!0,a=xe;if(n.shapeFlag&32){const c=t._;c?s&&c===1?l=!1:lr(o,t,s):(l=!t.$stable,or(t,o)),a=t}else t&&(rr(e,t),a={default:1});if(l)for(const c in o)!kn(c)&&a[c]==null&&delete o[c]},je=si;function Ql(e){return Xl(e)}function Xl(e,t){const s=Os();s.__VUE__=!0;const{insert:n,remove:o,patchProp:l,createElement:a,createText:c,createComment:u,setText:x,setElementText:d,parentNode:m,nextSibling:y,setScopeId:T=st,insertStaticContent:B}=e,C=(i,p,v,f=null,S=null,$=null,I=void 0,j=null,O=!!p.dynamicChildren)=>{if(i===p)return;i&&!Jt(i,p)&&(f=Pt(i),ke(i,S,$,!0),i=null),p.patchFlag===-2&&(O=!1,p.dynamicChildren=null);const{type:A,ref:Y,shapeFlag:L}=p;switch(A){case Ls:w(i,p,v,f);break;case kt:k(i,p,v,f);break;case ys:i==null&&P(p,v,f,I);break;case te:R(i,p,v,f,S,$,I,j,O);break;default:L&1?se(i,p,v,f,S,$,I,j,O):L&6?K(i,p,v,f,S,$,I,j,O):(L&64||L&128)&&A.process(i,p,v,f,S,$,I,j,O,D)}Y!=null&&S?es(Y,i&&i.ref,$,p||i,!p):Y==null&&i&&i.ref!=null&&es(i.ref,null,$,i,!0)},w=(i,p,v,f)=>{if(i==null)n(p.el=c(p.children),v,f);else{const S=p.el=i.el;p.children!==i.children&&x(S,p.children)}},k=(i,p,v,f)=>{i==null?n(p.el=u(p.children||""),v,f):p.el=i.el},P=(i,p,v,f)=>{[i.el,i.anchor]=B(i.children,p,v,f,i.el,i.anchor)},H=({el:i,anchor:p},v,f)=>{let S;for(;i&&i!==p;)S=y(i),n(i,v,f),i=S;n(p,v,f)},V=({el:i,anchor:p})=>{let v;for(;i&&i!==p;)v=y(i),o(i),i=v;o(p)},se=(i,p,v,f,S,$,I,j,O)=>{if(p.type==="svg"?I="svg":p.type==="math"&&(I="mathml"),i==null)ne(p,v,f,S,$,I,j,O);else{const A=i.el&&i.el._isVueCE?i.el:null;try{A&&A._beginPatch(),G(i,p,S,$,I,j,O)}finally{A&&A._endPatch()}}},ne=(i,p,v,f,S,$,I,j)=>{let O,A;const{props:Y,shapeFlag:L,transition:z,dirs:Q}=i;if(O=i.el=a(i.type,$,Y&&Y.is,Y),L&8?d(O,i.children):L&16&&N(i.children,O,null,f,S,Js(i,$),I,j),Q&&Ct(i,null,f,"created"),W(O,i,i.scopeId,I,f),Y){for(const me in Y)me!=="value"&&!Zt(me)&&l(O,me,null,Y[me],$,f);"value"in Y&&l(O,"value",null,Y.value,$),(A=Y.onVnodeBeforeMount)&&Ge(A,f,i)}Q&&Ct(i,null,f,"beforeMount");const ie=ei(S,z);ie&&z.beforeEnter(O),n(O,p,v),((A=Y&&Y.onVnodeMounted)||ie||Q)&&je(()=>{try{A&&Ge(A,f,i),ie&&z.enter(O),Q&&Ct(i,null,f,"mounted")}finally{}},S)},W=(i,p,v,f,S)=>{if(v&&T(i,v),f)for(let $=0;$<f.length;$++)T(i,f[$]);if(S){let $=S.subTree;if(p===$||ur($.type)&&($.ssContent===p||$.ssFallback===p)){const I=S.vnode;W(i,I,I.scopeId,I.slotScopeIds,S.parent)}}},N=(i,p,v,f,S,$,I,j,O=0)=>{for(let A=O;A<i.length;A++){const Y=i[A]=j?dt(i[A]):et(i[A]);C(null,Y,p,v,f,S,$,I,j)}},G=(i,p,v,f,S,$,I)=>{const j=p.el=i.el;let{patchFlag:O,dynamicChildren:A,dirs:Y}=p;O|=i.patchFlag&16;const L=i.props||xe,z=p.props||xe;let Q;if(v&&$t(v,!1),(Q=z.onVnodeBeforeUpdate)&&Ge(Q,v,p,i),Y&&Ct(p,i,v,"beforeUpdate"),v&&$t(v,!0),(L.innerHTML&&z.innerHTML==null||L.textContent&&z.textContent==null)&&d(j,""),A?ue(i.dynamicChildren,A,j,v,f,Js(p,S),$):I||le(i,p,j,null,v,f,Js(p,S),$,!1),O>0){if(O&16)U(j,L,z,v,S);else if(O&2&&L.class!==z.class&&l(j,"class",null,z.class,S),O&4&&l(j,"style",L.style,z.style,S),O&8){const ie=p.dynamicProps;for(let me=0;me<ie.length;me++){const he=ie[me],Te=L[he],Ee=z[he];(Ee!==Te||he==="value")&&l(j,he,Te,Ee,S,v)}}O&1&&i.children!==p.children&&d(j,p.children)}else!I&&A==null&&U(j,L,z,v,S);((Q=z.onVnodeUpdated)||Y)&&je(()=>{Q&&Ge(Q,v,p,i),Y&&Ct(p,i,v,"updated")},f)},ue=(i,p,v,f,S,$,I)=>{for(let j=0;j<p.length;j++){const O=i[j],A=p[j],Y=O.el&&(O.type===te||!Jt(O,A)||O.shapeFlag&198)?m(O.el):v;C(O,A,Y,null,f,S,$,I,!0)}},U=(i,p,v,f,S)=>{if(p!==v){if(p!==xe)for(const $ in p)!Zt($)&&!($ in v)&&l(i,$,p[$],null,S,f);for(const $ in v){if(Zt($))continue;const I=v[$],j=p[$];I!==j&&$!=="value"&&l(i,$,j,I,S,f)}"value"in v&&l(i,"value",p.value,v.value,S)}},R=(i,p,v,f,S,$,I,j,O)=>{const A=p.el=i?i.el:c(""),Y=p.anchor=i?i.anchor:c("");let{patchFlag:L,dynamicChildren:z,slotScopeIds:Q}=p;Q&&(j=j?j.concat(Q):Q),i==null?(n(A,v,f),n(Y,v,f),N(p.children||[],v,Y,S,$,I,j,O)):L>0&&L&64&&z&&i.dynamicChildren&&i.dynamicChildren.length===z.length?(ue(i.dynamicChildren,z,v,S,$,I,j),(p.key!=null||S&&p===S.subTree)&&ir(i,p,!0)):le(i,p,v,Y,S,$,I,j,O)},K=(i,p,v,f,S,$,I,j,O)=>{p.slotScopeIds=j,i==null?p.shapeFlag&512?S.ctx.activate(p,v,f,I,O):oe(p,v,f,S,$,I,O):ve(i,p,O)},oe=(i,p,v,f,S,$,I)=>{const j=i.component=ci(i,f,S);if(Wo(i)&&(j.ctx.renderer=D),di(j,!1,I),j.asyncDep){if(S&&S.registerDep(j,Se,I),!i.el){const O=j.subTree=nt(kt);k(null,O,p,v),i.placeholder=O.el}}else Se(j,i,p,v,S,$,I)},ve=(i,p,v)=>{const f=p.component=i.component;if(Kl(i,p,v))if(f.asyncDep&&!f.asyncResolved){pe(f,p,v);return}else f.next=p,f.update();else p.el=i.el,f.vnode=p},Se=(i,p,v,f,S,$,I)=>{const j=()=>{if(i.isMounted){let{next:L,bu:z,u:Q,parent:ie,vnode:me}=i;{const Je=ar(i);if(Je){L&&(L.el=me.el,pe(i,L,I)),Je.asyncDep.then(()=>{je(()=>{i.isUnmounted||A()},S)});return}}let he=L,Te;$t(i,!1),L?(L.el=me.el,pe(i,L,I)):L=me,z&&gs(z),(Te=L.props&&L.props.onVnodeBeforeUpdate)&&Ge(Te,ie,L,me),$t(i,!0);const Ee=Hn(i),ze=i.subTree;i.subTree=Ee,C(ze,Ee,m(ze.el),Pt(ze),i,S,$),L.el=Ee.el,he===null&&Wl(i,Ee.el),Q&&je(Q,S),(Te=L.props&&L.props.onVnodeUpdated)&&je(()=>Ge(Te,ie,L,me),S)}else{let L;const{el:z,props:Q}=p,{bm:ie,m:me,parent:he,root:Te,type:Ee}=i,ze=ts(p);$t(i,!1),ie&&gs(ie),!ze&&(L=Q&&Q.onVnodeBeforeMount)&&Ge(L,he,p),$t(i,!0);{Te.ce&&Te.ce._hasShadowRoot()&&Te.ce._injectChildStyle(Ee,i.parent?i.parent.type:void 0);const Je=i.subTree=Hn(i);C(null,Je,v,f,i,S,$),p.el=Je.el}if(me&&je(me,S),!ze&&(L=Q&&Q.onVnodeMounted)){const Je=p;je(()=>Ge(L,he,Je),S)}(p.shapeFlag&256||he&&ts(he.vnode)&&he.vnode.shapeFlag&256)&&i.a&&je(i.a,S),i.isMounted=!0,p=v=f=null}};i.scope.on();const O=i.effect=new _o(j);i.scope.off();const A=i.update=O.run.bind(O),Y=i.job=O.runIfDirty.bind(O);Y.i=i,Y.id=i.uid,O.scheduler=()=>bn(Y),$t(i,!0),A()},pe=(i,p,v)=>{p.component=i;const f=i.vnode.props;i.vnode=p,i.next=null,Jl(i,p.props,f,v),Zl(i,p.children,v),xt(),Dn(i),ht()},le=(i,p,v,f,S,$,I,j,O=!1)=>{const A=i&&i.children,Y=i?i.shapeFlag:0,L=p.children,{patchFlag:z,shapeFlag:Q}=p;if(z>0){if(z&128){M(A,L,v,f,S,$,I,j,O);return}else if(z&256){F(A,L,v,f,S,$,I,j,O);return}}Q&8?(Y&16&&it(A,S,$),L!==A&&d(v,L)):Y&16?Q&16?M(A,L,v,f,S,$,I,j,O):it(A,S,$,!0):(Y&8&&d(v,""),Q&16&&N(L,v,f,S,$,I,j,O))},F=(i,p,v,f,S,$,I,j,O)=>{i=i||Dt,p=p||Dt;const A=i.length,Y=p.length,L=Math.min(A,Y);let z;for(z=0;z<L;z++){const Q=p[z]=O?dt(p[z]):et(p[z]);C(i[z],Q,v,null,S,$,I,j,O)}A>Y?it(i,S,$,!0,!1,L):N(p,v,f,S,$,I,j,O,L)},M=(i,p,v,f,S,$,I,j,O)=>{let A=0;const Y=p.length;let L=i.length-1,z=Y-1;for(;A<=L&&A<=z;){const Q=i[A],ie=p[A]=O?dt(p[A]):et(p[A]);if(Jt(Q,ie))C(Q,ie,v,null,S,$,I,j,O);else break;A++}for(;A<=L&&A<=z;){const Q=i[L],ie=p[z]=O?dt(p[z]):et(p[z]);if(Jt(Q,ie))C(Q,ie,v,null,S,$,I,j,O);else break;L--,z--}if(A>L){if(A<=z){const Q=z+1,ie=Q<Y?p[Q].el:f;for(;A<=z;)C(null,p[A]=O?dt(p[A]):et(p[A]),v,ie,S,$,I,j,O),A++}}else if(A>z)for(;A<=L;)ke(i[A],S,$,!0),A++;else{const Q=A,ie=A,me=new Map;for(A=ie;A<=z;A++){const Le=p[A]=O?dt(p[A]):et(p[A]);Le.key!=null&&me.set(Le.key,A)}let he,Te=0;const Ee=z-ie+1;let ze=!1,Je=0;const Wt=new Array(Ee);for(A=0;A<Ee;A++)Wt[A]=0;for(A=Q;A<=L;A++){const Le=i[A];if(Te>=Ee){ke(Le,S,$,!0);continue}let qe;if(Le.key!=null)qe=me.get(Le.key);else for(he=ie;he<=z;he++)if(Wt[he-ie]===0&&Jt(Le,p[he])){qe=he;break}qe===void 0?ke(Le,S,$,!0):(Wt[qe-ie]=A+1,qe>=Je?Je=qe:ze=!0,C(Le,p[qe],v,null,S,$,I,j,O),Te++)}const Tn=ze?ti(Wt):Dt;for(he=Tn.length-1,A=Ee-1;A>=0;A--){const Le=ie+A,qe=p[Le],En=p[Le+1],An=Le+1<Y?En.el||cr(En):f;Wt[A]===0?C(null,qe,v,An,S,$,I,j,O):ze&&(he<0||A!==Tn[he]?$e(qe,v,An,2):he--)}}},$e=(i,p,v,f,S=null)=>{const{el:$,type:I,transition:j,children:O,shapeFlag:A}=i;if(A&6){$e(i.component.subTree,p,v,f);return}if(A&128){i.suspense.move(p,v,f);return}if(A&64){I.move(i,p,v,D);return}if(I===te){n($,p,v);for(let L=0;L<O.length;L++)$e(O[L],p,v,f);n(i.anchor,p,v);return}if(I===ys){H(i,p,v);return}if(f!==2&&A&1&&j)if(f===0)j.beforeEnter($),n($,p,v),je(()=>j.enter($),S);else{const{leave:L,delayLeave:z,afterLeave:Q}=j,ie=()=>{i.ctx.isUnmounted?o($):n($,p,v)},me=()=>{$._isLeaving&&$[hl](!0),L($,()=>{ie(),Q&&Q()})};z?z($,ie,me):me()}else n($,p,v)},ke=(i,p,v,f=!1,S=!1)=>{const{type:$,props:I,ref:j,children:O,dynamicChildren:A,shapeFlag:Y,patchFlag:L,dirs:z,cacheIndex:Q,memo:ie}=i;if(L===-2&&(S=!1),j!=null&&(xt(),es(j,null,v,i,!0),ht()),Q!=null&&(p.renderCache[Q]=void 0),Y&256){p.ctx.deactivate(i);return}const me=Y&1&&z,he=!ts(i);let Te;if(he&&(Te=I&&I.onVnodeBeforeUnmount)&&Ge(Te,p,i),Y&6)It(i.component,v,f);else{if(Y&128){i.suspense.unmount(v,f);return}me&&Ct(i,null,p,"beforeUnmount"),Y&64?i.type.remove(i,p,v,D,f):A&&!A.hasOnce&&($!==te||L>0&&L&64)?it(A,p,v,!1,!0):($===te&&L&384||!S&&Y&16)&&it(O,p,v),f&&de(i)}const Ee=ie!=null&&Q==null;(he&&(Te=I&&I.onVnodeUnmounted)||me||Ee)&&je(()=>{Te&&Ge(Te,p,i),me&&Ct(i,null,p,"unmounted"),Ee&&(i.el=null)},v)},de=i=>{const{type:p,el:v,anchor:f,transition:S}=i;if(p===te){We(v,f);return}if(p===ys){V(i);return}const $=()=>{o(v),S&&!S.persisted&&S.afterLeave&&S.afterLeave()};if(i.shapeFlag&1&&S&&!S.persisted){const{leave:I,delayLeave:j}=S,O=()=>I(v,$);j?j(i.el,$,O):O()}else $()},We=(i,p)=>{let v;for(;i!==p;)v=y(i),o(i),i=v;o(p)},It=(i,p,v)=>{const{bum:f,scope:S,job:$,subTree:I,um:j,m:O,a:A}=i;Wn(O),Wn(A),f&&gs(f),S.stop(),$&&($.flags|=8,ke(I,i,p,v)),j&&je(j,p),je(()=>{i.isUnmounted=!0},p)},it=(i,p,v,f=!1,S=!1,$=0)=>{for(let I=$;I<i.length;I++)ke(i[I],p,v,f,S)},Pt=i=>{if(i.shapeFlag&6)return Pt(i.component.subTree);if(i.shapeFlag&128)return i.suspense.next();const p=y(i.anchor||i.el),v=p&&p[ml];return v?y(v):p};let at=!1;const bt=(i,p,v)=>{let f;i==null?p._vnode&&(ke(p._vnode,null,null,!0),f=p._vnode.component):C(p._vnode||null,i,p,null,null,null,v),p._vnode=i,at||(at=!0,Dn(f),Uo(),at=!1)},D={p:C,um:ke,m:$e,r:de,mt:oe,mc:N,pc:le,pbc:ue,n:Pt,o:e};return{render:bt,hydrate:void 0,createApp:Ll(bt)}}function Js({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function $t({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ei(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ir(e,t,s=!1){const n=e.children,o=t.children;if(Z(n)&&Z(o))for(let l=0;l<n.length;l++){const a=n[l];let c=o[l];c.shapeFlag&1&&!c.dynamicChildren&&((c.patchFlag<=0||c.patchFlag===32)&&(c=o[l]=dt(o[l]),c.el=a.el),!s&&c.patchFlag!==-2&&ir(a,c)),c.type===Ls&&(c.patchFlag===-1&&(c=o[l]=dt(c)),c.el=a.el),c.type===kt&&!c.el&&(c.el=a.el)}}function ti(e){const t=e.slice(),s=[0];let n,o,l,a,c;const u=e.length;for(n=0;n<u;n++){const x=e[n];if(x!==0){if(o=s[s.length-1],e[o]<x){t[n]=o,s.push(n);continue}for(l=0,a=s.length-1;l<a;)c=l+a>>1,e[s[c]]<x?l=c+1:a=c;x<e[s[l]]&&(l>0&&(t[n]=s[l-1]),s[l]=n)}}for(l=s.length,a=s[l-1];l-- >0;)s[l]=a,a=t[a];return s}function ar(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ar(t)}function Wn(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function cr(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?cr(t.subTree):null}const ur=e=>e.__isSuspense;function si(e,t){t&&t.pendingBranch?Z(e)?t.effects.push(...e):t.effects.push(e):al(e)}const te=Symbol.for("v-fgt"),Ls=Symbol.for("v-txt"),kt=Symbol.for("v-cmt"),ys=Symbol.for("v-stc"),ns=[];let Ve=null;function h(e=!1){ns.push(Ve=e?null:[])}function ni(){ns.pop(),Ve=ns[ns.length-1]||null}let is=1;function zn(e,t=!1){is+=e,e<0&&Ve&&t&&(Ve.hasOnce=!0)}function dr(e){return e.dynamicChildren=is>0?Ve||Dt:null,ni(),is>0&&Ve&&Ve.push(e),e}function g(e,t,s,n,o,l){return dr(r(e,t,s,n,o,l,!0))}function fr(e,t,s,n,o){return dr(nt(e,t,s,n,o,!0))}function pr(e){return e?e.__v_isVNode===!0:!1}function Jt(e,t){return e.type===t.type&&e.key===t.key}const mr=({key:e})=>e??null,bs=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?Ce(e)||Me(e)||X(e)?{i:Ue,r:e,k:t,f:!!s}:e:null);function r(e,t=null,s=null,n=0,o=null,l=e===te?0:1,a=!1,c=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&mr(t),ref:t&&bs(t),scopeId:Fo,slotScopeIds:null,children:s,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:l,patchFlag:n,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Ue};return c?(Cn(u,s),l&128&&e.normalize(u)):s&&(u.shapeFlag|=Ce(s)?8:16),is>0&&!a&&Ve&&(u.patchFlag>0||l&6)&&u.patchFlag!==32&&Ve.push(u),u}const nt=oi;function oi(e,t=null,s=null,n=0,o=null,l=!1){if((!e||e===Jo)&&(e=kt),pr(e)){const c=Vt(e,t,!0);return s&&Cn(c,s),is>0&&!l&&Ve&&(c.shapeFlag&6?Ve[Ve.indexOf(e)]=c:Ve.push(c)),c.patchFlag=-2,c}if(hi(e)&&(e=e.__vccOpts),t){t=ri(t);let{class:c,style:u}=t;c&&!Ce(c)&&(t.class=J(c)),fe(u)&&(yn(u)&&!Z(u)&&(u=Ae({},u)),t.style=Lt(u))}const a=Ce(e)?1:ur(e)?128:xl(e)?64:fe(e)?4:X(e)?2:0;return r(e,t,s,n,o,a,l,!0)}function ri(e){return e?yn(e)||tr(e)?Ae({},e):e:null}function Vt(e,t,s=!1,n=!1){const{props:o,ref:l,patchFlag:a,children:c,transition:u}=e,x=t?li(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:x,key:x&&mr(x),ref:t&&t.ref?s&&l?Z(l)?l.concat(bs(t)):[l,bs(t)]:bs(t):l,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==te?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Vt(e.ssContent),ssFallback:e.ssFallback&&Vt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&n&&_n(d,u.clone(d)),d}function we(e=" ",t=0){return nt(Ls,null,e,t)}function Xe(e,t){const s=nt(ys,null,e);return s.staticCount=t,s}function q(e="",t=!1){return t?(h(),fr(kt,null,e)):nt(kt,null,e)}function et(e){return e==null||typeof e=="boolean"?nt(kt):Z(e)?nt(te,null,e.slice()):pr(e)?dt(e):nt(Ls,null,String(e))}function dt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Vt(e)}function Cn(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(Z(t))s=16;else if(typeof t=="object")if(n&65){const o=t.default;o&&(o._c&&(o._d=!1),Cn(e,o()),o._c&&(o._d=!0));return}else{s=32;const o=t._;!o&&!tr(t)?t._ctx=Ue:o===3&&Ue&&(Ue.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else X(t)?(t={default:t,_ctx:Ue},s=32):(t=String(t),n&64?(s=16,t=[we(t)]):s=8);e.children=t,e.shapeFlag|=s}function li(...e){const t={};for(let s=0;s<e.length;s++){const n=e[s];for(const o in n)if(o==="class")t.class!==n.class&&(t.class=J([t.class,n.class]));else if(o==="style")t.style=Lt([t.style,n.style]);else if(Es(o)){const l=t[o],a=n[o];a&&l!==a&&!(Z(l)&&l.includes(a))?t[o]=l?[].concat(l,a):a:a==null&&l==null&&!As(o)&&(t[o]=a)}else o!==""&&(t[o]=n[o])}return t}function Ge(e,t,s,n=null){rt(e,t,7,[s,n])}const ii=Yo();let ai=0;function ci(e,t,s){const n=e.type,o=(t?t.appContext:e.appContext)||ii,l={uid:ai++,vnode:e,type:n,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ir(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:nr(n,o),emitsOptions:Zo(n,o),emit:null,emitted:null,propsDefaults:xe,inheritAttrs:n.inheritAttrs,ctx:xe,data:xe,props:xe,attrs:xe,slots:xe,refs:xe,setupState:xe,setupContext:null,suspense:s,suspenseId:s?s.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 l.ctx={_:l},l.root=t?t.root:l,l.emit=Vl.bind(null,l),e.ce&&e.ce(l),l}let Pe=null;const ui=()=>Pe||Ue;let Ts,rn;{const e=Os(),t=(s,n)=>{let o;return(o=e[s])||(o=e[s]=[]),o.push(n),l=>{o.length>1?o.forEach(a=>a(l)):o[0](l)}};Ts=t("__VUE_INSTANCE_SETTERS__",s=>Pe=s),rn=t("__VUE_SSR_SETTERS__",s=>as=s)}const fs=e=>{const t=Pe;return Ts(e),e.scope.on(),()=>{e.scope.off(),Ts(t)}},Jn=()=>{Pe&&Pe.scope.off(),Ts(null)};function xr(e){return e.vnode.shapeFlag&4}let as=!1;function di(e,t=!1,s=!1){t&&rn(t);const{props:n,children:o}=e.vnode,l=xr(e);zl(e,n,l,t),Yl(e,o,s||t);const a=l?fi(e,t):void 0;return t&&rn(!1),a}function fi(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Pl);const{setup:n}=s;if(n){xt();const o=e.setupContext=n.length>1?mi(e):null,l=fs(e),a=ds(n,e,0,[e.props,o]),c=mo(a);if(ht(),l(),(c||e.sp)&&!ts(e)&&Ko(e),c){if(a.then(Jn,Jn),t)return a.then(u=>{qn(e,u)}).catch(u=>{Rs(u,e,0)});e.asyncDep=a}else qn(e,a)}else hr(e)}function qn(e,t,s){X(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:fe(t)&&(e.setupState=Ro(t)),hr(e)}function hr(e,t,s){const n=e.type;e.render||(e.render=n.render||st);{const o=fs(e);xt();try{Ml(e)}finally{ht(),o()}}}const pi={get(e,t){return Ie(e,"get",""),e[t]}};function mi(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,pi),slots:e.slots,emit:e.emit,expose:t}}function Us(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ro(Zr(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in ss)return ss[s](e)},has(t,s){return s in t||s in ss}})):e.proxy}function xi(e,t=!0){return X(e)?e.displayName||e.name:e.name||t&&e.__name}function hi(e){return X(e)&&"__vccOpts"in e}const Fe=(e,t)=>nl(e,t,as),gi="3.5.31";/**
|
|
61
61
|
* @vue/runtime-dom v3.5.31
|
|
62
62
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
63
63
|
* @license MIT
|
|
64
|
-
**/let rn;const qn=typeof window<"u"&&window.trustedTypes;if(qn)try{rn=qn.createPolicy("vue",{createHTML:e=>e})}catch{}const gr=rn?e=>rn.createHTML(e):e=>e,xl="http://www.w3.org/2000/svg",vl="http://www.w3.org/1998/Math/MathML",at=typeof document<"u"?document:null,Gn=at&&at.createElement("template"),yl={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const o=t==="svg"?at.createElementNS(xl,e):t==="mathml"?at.createElementNS(vl,e):s?at.createElement(e,{is:s}):at.createElement(e);return e==="select"&&n&&n.multiple!=null&&o.setAttribute("multiple",n.multiple),o},createText:e=>at.createTextNode(e),createComment:e=>at.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>at.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,o,r){const l=s?s.previousSibling:t.lastChild;if(o&&(o===r||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),s),!(o===r||!(o=o.nextSibling)););else{Gn.innerHTML=gr(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const a=Gn.content;if(n==="svg"||n==="mathml"){const u=a.firstChild;for(;u.firstChild;)a.appendChild(u.firstChild);a.removeChild(u)}t.insertBefore(a,s)}return[l?l.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},bl=Symbol("_vtc");function _l(e,t,s){const n=e[bl];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Yn=Symbol("_vod"),wl=Symbol("_vsh"),Sl=Symbol(""),kl=/(?:^|;)\s*display\s*:/;function Cl(e,t,s){const n=e.style,o=ve(s);let r=!1;if(s&&!o){if(t)if(ve(t))for(const l of t.split(";")){const a=l.slice(0,l.indexOf(":")).trim();s[a]==null&&ys(n,a,"")}else for(const l in t)s[l]==null&&ys(n,l,"");for(const l in s)l==="display"&&(r=!0),ys(n,l,s[l])}else if(o){if(t!==s){const l=n[Sl];l&&(s+=";"+l),n.cssText=s,r=kl.test(s)}}else t&&e.removeAttribute("style");Yn in e&&(e[Yn]=r?n.display:"",e[wl]&&(n.display="none"))}const Zn=/\s*!important$/;function ys(e,t,s){if(J(s))s.forEach(n=>ys(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=Tl(e,t);Zn.test(s)?e.setProperty(_t(n),s.replace(Zn,""),"important"):e[n]=s}}const Qn=["Webkit","Moz","ms"],Js={};function Tl(e,t){const s=Js[t];if(s)return s;let n=De(t);if(n!=="filter"&&n in e)return Js[t]=n;n=Es(n);for(let o=0;o<Qn.length;o++){const r=Qn[o]+n;if(r in e)return Js[t]=r}return t}const Xn="http://www.w3.org/1999/xlink";function eo(e,t,s,n,o,r=$r(t)){n&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(Xn,t.slice(6,t.length)):e.setAttributeNS(Xn,t,s):s==null||r&&!xo(s)?e.removeAttribute(t):e.setAttribute(t,r?"":rt(s)?String(s):s)}function to(e,t,s,n,o){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?gr(s):s);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const a=r==="OPTION"?e.getAttribute("value")||"":e.value,u=s==null?e.type==="checkbox"?"on":"":String(s);(a!==u||!("_value"in e))&&(e.value=u),s==null&&e.removeAttribute(t),e._value=s;return}let l=!1;if(s===""||s==null){const a=typeof e[t];a==="boolean"?s=xo(s):s==null&&a==="string"?(s="",l=!0):a==="number"&&(s=0,l=!0)}try{e[t]=s}catch{}l&&e.removeAttribute(o||t)}function yt(e,t,s,n){e.addEventListener(t,s,n)}function $l(e,t,s,n){e.removeEventListener(t,s,n)}const so=Symbol("_vei");function Al(e,t,s,n,o=null){const r=e[so]||(e[so]={}),l=r[t];if(n&&l)l.value=n;else{const[a,u]=El(t);if(n){const h=r[t]=Ml(n,o);yt(e,a,h,u)}else l&&($l(e,a,l,u),r[t]=void 0)}}const no=/(?:Once|Passive|Capture)$/;function El(e){let t;if(no.test(e)){t={};let n;for(;n=e.match(no);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):_t(e.slice(2)),t]}let qs=0;const Il=Promise.resolve(),Pl=()=>qs||(Il.then(()=>qs=0),qs=Date.now());function Ml(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;it(Ol(n,s.value),t,5,[n])};return s.value=e,s.attached=Pl(),s}function Ol(e,t){if(J(t)){const s=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{s.call(e),e._stopped=!0},t.map(n=>o=>!o._stopped&&n&&n(o))}else return t}const oo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Dl=(e,t,s,n,o,r)=>{const l=o==="svg";t==="class"?_l(e,n,l):t==="style"?Cl(e,s,n):Ts(t)?$s(t)||Al(e,t,s,n,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Rl(e,t,n,l))?(to(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&eo(e,t,n,l,r,t!=="value")):e._isVueCE&&(jl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!ve(n)))?to(e,De(t),n,r,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),eo(e,t,n,l))};function Rl(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&oo(t)&&Y(s));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"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return oo(t)&&ve(s)?!1:t in e}function jl(e,t){const s=e._def.props;if(!s)return!1;const n=De(t);return Array.isArray(s)?s.some(o=>De(o)===n):Object.keys(s).some(o=>De(o)===n)}const Ft=e=>{const t=e.props["onUpdate:modelValue"]||!1;return J(t)?s=>ms(t,s):t};function Nl(e){e.target.composing=!0}function ro(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ft=Symbol("_assign");function io(e,t,s){return t&&(e=e.trim()),s&&(e=Is(e)),e}const me={created(e,{modifiers:{lazy:t,trim:s,number:n}},o){e[ft]=Ft(o);const r=n||o.props&&o.props.type==="number";yt(e,t?"change":"input",l=>{l.target.composing||e[ft](io(e.value,s,r))}),(s||r)&&yt(e,"change",()=>{e.value=io(e.value,s,r)}),t||(yt(e,"compositionstart",Nl),yt(e,"compositionend",ro),yt(e,"change",ro))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:o,number:r}},l){if(e[ft]=Ft(l),e.composing)return;const a=(r||e.type==="number")&&!/^0\d/.test(e.value)?Is(e.value):e.value,u=t??"";if(a===u)return;const h=e.getRootNode();(h instanceof Document||h instanceof ShadowRoot)&&h.activeElement===e&&e.type!=="range"&&(n&&t===s||o&&e.value.trim()===u)||(e.value=u)}},lo={deep:!0,created(e,t,s){e[ft]=Ft(s),yt(e,"change",()=>{const n=e._modelValue,o=ls(e),r=e.checked,l=e[ft];if(J(n)){const a=un(n,o),u=a!==-1;if(r&&!u)l(n.concat(o));else if(!r&&u){const h=[...n];h.splice(a,1),l(h)}}else if(Vt(n)){const a=new Set(n);r?a.add(o):a.delete(o),l(a)}else l(xr(e,r))})},mounted:ao,beforeUpdate(e,t,s){e[ft]=Ft(s),ao(e,t,s)}};function ao(e,{value:t,oldValue:s},n){e._modelValue=t;let o;if(J(t))o=un(t,n.props.value)>-1;else if(Vt(t))o=t.has(n.props.value);else{if(t===s)return;o=Ut(t,xr(e,!0))}e.checked!==o&&(e.checked=o)}const is={deep:!0,created(e,{value:t,modifiers:{number:s}},n){const o=Vt(t);yt(e,"change",()=>{const r=Array.prototype.filter.call(e.options,l=>l.selected).map(l=>s?Is(ls(l)):ls(l));e[ft](e.multiple?o?new Set(r):r:r[0]),e._assigning=!0,jo(()=>{e._assigning=!1})}),e[ft]=Ft(n)},mounted(e,{value:t}){co(e,t)},beforeUpdate(e,t,s){e[ft]=Ft(s)},updated(e,{value:t}){e._assigning||co(e,t)}};function co(e,t){const s=e.multiple,n=J(t);if(!(s&&!n&&!Vt(t))){for(let o=0,r=e.options.length;o<r;o++){const l=e.options[o],a=ls(l);if(s)if(n){const u=typeof a;u==="string"||u==="number"?l.selected=t.some(h=>String(h)===String(a)):l.selected=un(t,a)>-1}else l.selected=t.has(a);else if(Ut(ls(l),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ls(e){return"_value"in e?e._value:e.value}function xr(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const Ll={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Jt=(e,t)=>{const s=e._withKeys||(e._withKeys={}),n=t.join(".");return s[n]||(s[n]=(o=>{if(!("key"in o))return;const r=_t(o.key);if(t.some(l=>l===r||Ll[l]===r))return e(o)}))},Fl=Ae({patchProp:Dl},yl);let uo;function Vl(){return uo||(uo=Zi(Fl))}const Ul=((...e)=>{const t=Vl().createApp(...e),{mount:s}=t;return t.mount=n=>{const o=Bl(n);if(!o)return;const r=t._component;!Y(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const l=s(o,!1,Hl(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),l},t});function Hl(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Bl(e){return ve(e)?document.querySelector(e):e}let Cn="";function Kt(e){Cn=e}function xe(){return Cn}async function _e(e,t){const s=await fetch(e,{...t,headers:{Authorization:`Bearer ${Cn}`,"Content-Type":"application/json",...(t==null?void 0:t.headers)??{}}});if(!s.ok){const n=new Error(s.statusText);throw n.status=s.status,n}return s.json()}const Wl={class:"animate-fade-in"},Kl={key:0,class:"text-center py-12 text-textSecondary"},zl={key:1,class:"text-center text-textSecondary py-12"},Jl={key:2,class:"space-y-3"},ql={class:"flex items-center justify-between"},Gl={class:"flex items-center gap-3"},Yl={class:"font-medium"},Zl={class:"text-accentLight"},Ql={class:"text-textSecondary text-xs"},Xl={key:2,class:"text-muted italic"},ea={class:"text-xs text-textSecondary font-mono"},ta={class:"text-right"},sa={class:"flex items-center gap-2 justify-end"},na={class:"text-xs text-textSecondary"},oa=At({__name:"SessionsTab",props:{status:{}},setup(e){const t=e,s=R([]),n=R(!0);async function o(){n.value=!0;try{const h=await _e("/api/status");s.value=(h.sessions||[]).slice().sort((f,p)=>f.status==="active"&&p.status!=="active"?-1:f.status!=="active"&&p.status==="active"?1:p.lastActivity-f.lastActivity)}finally{n.value=!1}}const r=Ke(()=>{var f;return(((f=t.status)==null?void 0:f.sessions)??s.value).slice().sort((p,v)=>p.status==="active"&&v.status!=="active"?-1:p.status!=="active"&&v.status==="active"?1:v.lastActivity-p.lastActivity)});function l(h){const f=Math.floor((Date.now()-h.lastActivity)/6e4);return h.status==="disconnected"?{label:`Disconnected${f>0?` — ${f}m ago`:""}`,color:"text-muted"}:f<5?{label:"Active",color:"text-success"}:f<30?{label:`Idle ${f}m`,color:"text-warn"}:{label:`Dormant ${f}m`,color:"text-danger"}}function a(h){if(!h.lastWaitCallAt)return"";const f=Math.floor((Date.now()-h.lastWaitCallAt)/6e4);return f<5?`Polling — ${f===0?"just now":f+"m ago"}`:`Last poll — ${f}m ago`}function u(h){return h.lastWaitCallAt?Math.floor((Date.now()-h.lastWaitCallAt)/6e4)<5?"text-success":"text-warn":""}return wt(o),(h,f)=>(w(),S("div",Wl,[n.value&&r.value.length===0?(w(),S("div",Kl,"Loading sessions...")):r.value.length===0?(w(),S("div",zl,"No sessions")):(w(),S("div",Jl,[(w(!0),S(ie,null,Se(r.value,p=>(w(),S("div",{key:p.mcpSessionId,class:G(["glass rounded-xl p-4 animate-slide-up",p.status==="disconnected"?"opacity-60":""])},[i("div",ql,[i("div",Gl,[i("span",{class:G(["w-2.5 h-2.5 rounded-full",p.status==="disconnected"?"bg-muted":Math.floor((Date.now()-p.lastActivity)/6e4)<5?"bg-success":Math.floor((Date.now()-p.lastActivity)/6e4)<30?"bg-warn":"bg-danger"])},null,2),i("div",null,[i("div",Yl,[p.topicName?(w(),S(ie,{key:0},[i("span",Zl,_(p.topicName),1),i("span",Ql," (thread "+_(p.threadId)+")",1)],64)):p.threadId!=null?(w(),S(ie,{key:1},[Ve("Thread "+_(p.threadId),1)],64)):(w(),S("span",Xl,"Awaiting start_session…"))]),i("div",ea,_(p.mcpSessionId.slice(0,12))+"...",1)])]),i("div",ta,[i("div",sa,[i("span",{class:G(["text-sm font-medium",l(p).color])},_(l(p).label),3),a(p)?(w(),S("span",{key:0,class:G(["text-xs ml-2",u(p)])},_(a(p)),3)):Q("",!0)]),i("div",na,_(p.transportType),1)])])],2))),128))]))]))}}),ra={class:"animate-fade-in"},ia={class:"flex flex-wrap items-center gap-3 mb-4"},la={key:0,class:"text-center py-12 text-textSecondary"},aa={key:1,class:"text-center py-12 text-textSecondary"},ca={key:2,class:"space-y-2"},ua={class:"flex items-start justify-between gap-3"},da={class:"flex-1 min-w-0"},fa={class:"flex items-center gap-2 mb-1"},pa={key:0,class:"type-badge",style:{background:"rgba(239,68,68,0.15)",color:"#f87171"}},ha={key:1,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},ma={class:"text-xs text-textSecondary"},ga={class:"text-sm text-textPrimary leading-relaxed"},xa={class:"flex flex-wrap gap-1.5 mt-2"},va={class:"text-right shrink-0"},ya={class:"text-sm font-mono text-textSecondary"},ba={class:"text-xs text-muted"},_a={class:"text-xs text-muted"},wa=At({__name:"MemoryNotesTab",setup(e){const t=R([]),s=R(!1),n=R(""),o=R("created_at"),r=R("");let l=null;async function a(){s.value=!0;try{const f=r.value.trim();let p;if(f)p=await _e(`/api/search?q=${encodeURIComponent(f)}&limit=50`);else{const v=new URLSearchParams({limit:"50",sort:o.value});n.value&&v.set("type",n.value),p=await _e(`/api/notes?${v}`)}t.value=p}finally{s.value=!1}}function u(){l&&clearTimeout(l),l=setTimeout(a,300)}function h(f){if(!f)return"never";const p=Date.now()-new Date(f).getTime(),v=Math.floor(p/6e4);if(v<1)return"just now";if(v<60)return`${v}m ago`;const A=Math.floor(v/60);return A<24?`${A}h ago`:`${Math.floor(A/24)}d ago`}return wt(a),(f,p)=>(w(),S("div",ra,[i("div",ia,[le(i("input",{"onUpdate:modelValue":p[0]||(p[0]=v=>r.value=v),onInput:u,type:"text",placeholder:"Search notes...",class:"flex-1 min-w-[200px] px-4 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,544),[[me,r.value]]),le(i("select",{"onUpdate:modelValue":p[1]||(p[1]=v=>n.value=v),onChange:a,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...p[3]||(p[3]=[We('<option value="">All types</option><option value="fact">Facts</option><option value="preference">Preferences</option><option value="pattern">Patterns</option><option value="entity">Entities</option><option value="relationship">Relationships</option>',6)])],544),[[is,n.value]]),le(i("select",{"onUpdate:modelValue":p[2]||(p[2]=v=>o.value=v),onChange:a,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...p[4]||(p[4]=[i("option",{value:"created_at"},"Newest",-1),i("option",{value:"confidence"},"Confidence",-1),i("option",{value:"access_count"},"Most accessed",-1)])],544),[[is,o.value]])]),s.value?(w(),S("div",la,"Loading notes...")):t.value.length===0?(w(),S("div",aa,"No notes found")):(w(),S("div",ca,[(w(!0),S(ie,null,Se(t.value,v=>(w(),S("div",{key:v.noteId,class:G(["glass rounded-xl p-4 animate-fade-in",`priority-${v.priority||0}`])},[i("div",ua,[i("div",da,[i("div",fa,[i("span",{class:G(["type-badge",`type-${v.type}`])},_(v.type),3),v.priority>=2?(w(),S("span",pa,"HIGH IMPORTANCE")):v.priority===1?(w(),S("span",ha,"NOTABLE")):Q("",!0),i("span",ma,_(v.noteId),1)]),i("p",ga,_(v.content),1),i("div",xa,[(w(!0),S(ie,null,Se(v.keywords||[],A=>(w(),S("span",{key:A,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},_(A),1))),128))])]),i("div",va,[i("div",ya,_(((Number(v.confidence)||0)*100).toFixed(0))+"%",1),i("div",ba,_(h(v.createdAt)),1),i("div",_a,_(v.accessCount??0)+" hits",1)])])],2))),128))]))]))}}),Sa={class:"animate-fade-in space-y-6"},ka={class:"glass rounded-xl p-4"},Ca={class:"flex flex-wrap items-center gap-4 mb-4"},Ta={key:0,class:"text-sm text-success"},$a={class:"flex flex-wrap items-center gap-3 mb-4"},Aa={key:0,class:"text-sm text-success"},Ea={class:"glass rounded-xl p-6"},Ia={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Pa={class:"flex items-center gap-2"},Ma={key:0,class:"text-sm text-success"},Oa={key:0,class:"mb-3"},Da={class:"mt-4"},Ra=["innerHTML"],ja={class:"glass rounded-xl p-6"},Na={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},La={class:"flex items-center gap-2"},Fa={key:0,class:"text-sm text-success"},Va={class:"flex gap-2 mb-4"},Ua=["onClick"],Ha={key:0,class:"mb-3"},Ba=["value","placeholder"],Wa={class:"glass rounded-xl p-6"},Ka={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},za={class:"flex items-center gap-2"},Ja={key:0,class:"text-sm text-success"},qa={class:"mb-4 flex flex-wrap items-center gap-3"},Ga={class:"flex items-center gap-2"},Ya={class:"font-mono text-sm text-textPrimary"},Za={key:0,class:"mb-3"},Qa={class:"flex flex-wrap gap-2 mb-3"},Xa=["onClick"],ec={class:"mt-4"},tc=["innerHTML"],sc=At({__name:"TemplatesTab",setup(e){function t(V){return V.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\{\{([A-Z_]+)\}\}/g,'<span class="text-accentLight" style="background:rgba(99,102,241,0.1);padding:0 2px;border-radius:3px">{{$1}}</span>')}const s=R("copilot"),n=R(""),o=R(50),r=R(""),l=R(""),a=R(!0),u=R(""),h=R(!1),f=R({}),p=R("copilot"),v=R(""),A=R(""),H=R(!0),$=R(""),b=R(!1),I=R([]),L=R("");async function B(){await Promise.all([F(),Z(),he(),W()])}async function F(){try{const V=await _e("/api/settings/agent-type");s.value=V.agentType||"copilot"}catch{}}async function Z(){try{const V=await _e("/api/settings/bootstrap-message-count");o.value=V.count??50}catch{}}async function he(){try{const V=await _e("/api/templates");if(V.templates&&V.templates.length>0){const E=V.templates[0];l.value=E.content||"",a.value=E.isDefault??!0}V.agentReminders&&(f.value=V.agentReminders)}catch{}}async function W(){try{const[V,E,Te]=await Promise.all([_e("/api/templates/drive"),_e("/api/templates/drive-presets"),_e("/api/settings/dmn-activation-hours")]);I.value=E.presets||[],L.value=String(Te.value??"not set"),V.custom?(A.value=V.custom,H.value=!1):(A.value=V.default||"",H.value=!0)}catch{}}async function j(){try{await _e("/api/settings/agent-type",{method:"POST",body:JSON.stringify({agentType:s.value})}),await _e("/api/templates/reminders",{method:"DELETE"}),n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3),await he()}catch(V){n.value="Error: "+V.message}}async function z(){try{await _e("/api/settings/bootstrap-message-count",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:o.value})}),r.value="Saved ✓",setTimeout(()=>{r.value=""},3e3)}catch(V){r.value="Error: "+V.message}}async function X(){try{const V=await fetch("/api/templates/reminders",{method:"POST",headers:{Authorization:`Bearer ${xe()}`,"Content-Type":"application/json"},body:JSON.stringify({content:l.value})});if(!V.ok)throw new Error(V.statusText);a.value=!1,u.value="Saved ✓",setTimeout(()=>{u.value=""},3e3)}catch(V){u.value="Error: "+V.message}}async function ee(){if(confirm("Reset to default template? Your customizations will be lost."))try{const V=await fetch("/api/templates/reminders",{method:"DELETE",headers:{Authorization:`Bearer ${xe()}`}});if(!V.ok)throw new Error(V.statusText);await he(),u.value="Reset to default ✓",setTimeout(()=>{u.value=""},3e3)}catch(V){u.value="Error: "+V.message}}async function ke(){var Te;const V=p.value,E=((Te=f.value[V])==null?void 0:Te.content)??"";try{const ge=await fetch(`/api/templates/reminders-${V}`,{method:"POST",headers:{Authorization:`Bearer ${xe()}`,"Content-Type":"application/json"},body:JSON.stringify({content:E})});if(!ge.ok)throw new Error(ge.statusText);f.value[V]={content:E,isDefault:!1},v.value=`Saved ${V} ✓`,setTimeout(()=>{v.value=""},3e3)}catch(ge){v.value="Error: "+ge.message}}async function Ce(){const V=p.value;if(confirm(`Reset ${V} agent reminder? The custom template will be removed.`))try{const E=await fetch(`/api/templates/reminders-${V}`,{method:"DELETE",headers:{Authorization:`Bearer ${xe()}`}});if(!E.ok)throw new Error(E.statusText);await he(),v.value=`Reset ${V} ✓`,setTimeout(()=>{v.value=""},3e3)}catch(E){v.value="Error: "+E.message}}async function xt(){const V=A.value;if(!V.trim()){$.value="Template is empty — load a preset first",setTimeout(()=>{$.value=""},3e3);return}try{const E=await fetch("/api/templates/drive",{method:"POST",headers:{Authorization:`Bearer ${xe()}`,"Content-Type":"application/json"},body:JSON.stringify({content:V})});if(!E.ok)throw new Error(E.statusText);H.value=!1,$.value="Saved ✓",setTimeout(()=>{$.value=""},3e3)}catch(E){$.value="Error: "+E.message}}async function Et(){if(confirm("Reset drive template? The custom template will be removed."))try{const V=await fetch("/api/templates/drive",{method:"DELETE",headers:{Authorization:`Bearer ${xe()}`}});if(!V.ok)throw new Error(V.statusText);await W(),$.value="Reset to default ✓",setTimeout(()=>{$.value=""},3e3)}catch(V){$.value="Error: "+V.message}}function we(V){A.value=V.content,H.value=!1}const ce=Ke(()=>t(l.value)),se=Ke(()=>A.value?t(A.value):'<span style="color:#6b7280">(no template loaded)</span>');return wt(B),(V,E)=>{var Te,ge;return w(),S("div",Sa,[i("div",ka,[i("div",Ca,[E[8]||(E[8]=i("label",{class:"text-sm font-medium text-textSecondary"},"Agent Type",-1)),le(i("select",{"onUpdate:modelValue":E[0]||(E[0]=ne=>s.value=ne),onChange:j,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...E[7]||(E[7]=[We('<option value="copilot">Copilot</option><option value="copilot_claude">Copilot (Claude)</option><option value="copilot_codex">Copilot (Codex)</option><option value="claude">Claude</option><option value="cursor">Cursor</option><option value="codex">Codex</option><option value="openai_codex">OpenAI Codex</option>',7)])],544),[[is,s.value]]),n.value?(w(),S("span",Ta,_(n.value),1)):Q("",!0),E[9]||(E[9]=i("span",{class:"text-xs text-muted"},"Changes which default reminders template is used",-1))]),i("div",$a,[E[10]||(E[10]=i("label",{class:"text-sm font-medium text-textSecondary"},"Bootstrap Messages",-1)),le(i("input",{"onUpdate:modelValue":E[1]||(E[1]=ne=>o.value=ne),type:"number",min:"0",max:"500",class:"w-24 px-3 py-2 rounded-xl bg-card border border-gray-700 text-text text-sm focus:border-accent focus:outline-none"},null,512),[[me,o.value,void 0,{number:!0}]]),i("button",{onClick:z,class:"px-4 py-2 rounded-xl bg-accent text-white text-sm font-medium hover:bg-accent/80 transition-colors"},"Save"),r.value?(w(),S("span",Aa,_(r.value),1)):Q("",!0),E[11]||(E[11]=i("span",{class:"text-xs text-muted"},"Number of recent messages injected as warm context (0 = off)",-1))])]),i("div",Ea,[i("div",Ia,[E[12]||(E[12]=i("div",null,[i("h3",{class:"text-lg font-semibold"},"Reminders Template"),i("p",{class:"text-sm text-textSecondary mt-1"},"Edit the system prompt template sent with every reminder")],-1)),i("div",Pa,[u.value?(w(),S("span",Ma,_(u.value),1)):Q("",!0),i("button",{onClick:ee,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset to Default"),i("button",{onClick:X,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),a.value?(w(),S("div",Oa,[...E[13]||(E[13]=[i("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"USING DEFAULT — edit and save to customize",-1)])])):Q("",!0),le(i("textarea",{"onUpdate:modelValue":E[2]||(E[2]=ne=>l.value=ne),rows:"20",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Loading..."},null,512),[[me,l.value]]),i("div",Da,[i("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:E[3]||(E[3]=ne=>h.value=!h.value)},[(w(),S("svg",{class:G(["w-4 h-4 text-textSecondary transition-transform",h.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...E[14]||(E[14]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),E[15]||(E[15]=i("span",{class:"text-sm font-medium text-textSecondary"},"Preview with highlighted variables",-1))]),h.value?(w(),S("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:ce.value},null,8,Ra)):Q("",!0)]),E[16]||(E[16]=We('<details class="mt-4"><summary class="text-sm font-medium text-textSecondary cursor-pointer hover:text-textPrimary transition">Available Variables</summary><div class="mt-2 glass rounded-xl p-4 grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"><div><code class="text-accentLight">{{OPERATOR_MESSAGE}}</code> <span class="text-textSecondary">— latest operator message</span></div><div><code class="text-accentLight">{{THREAD_ID}}</code> <span class="text-textSecondary">— Telegram thread ID</span></div><div><code class="text-accentLight">{{TIME}}</code> <span class="text-textSecondary">— formatted timestamp</span></div><div><code class="text-accentLight">{{UPTIME}}</code> <span class="text-textSecondary">— session uptime</span></div><div><code class="text-accentLight">{{VERSION}}</code> <span class="text-textSecondary">— package version</span></div><div><code class="text-accentLight">{{MODE}}</code> <span class="text-textSecondary">— "autonomous" or "standard"</span></div></div></details>',1))]),i("div",ja,[i("div",Na,[E[17]||(E[17]=i("div",null,[i("h3",{class:"text-lg font-semibold"},"Agent-Specific Reminders"),i("p",{class:"text-sm text-textSecondary mt-1"},"Appended after the base reminders template — per agent type")],-1)),i("div",La,[v.value?(w(),S("span",Fa,_(v.value),1)):Q("",!0),i("button",{onClick:Ce,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset"),i("button",{onClick:ke,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),i("div",Va,[(w(),S(ie,null,Se(["copilot","claude","cursor","codex"],ne=>i("button",{key:ne,onClick:He=>p.value=ne,class:G(["px-4 py-2 rounded-xl text-sm font-medium transition",p.value===ne?"bg-accent text-white":"bg-card hover:bg-cardHover border border-gray-700 text-textSecondary hover:text-textPrimary"])},_(ne.charAt(0).toUpperCase()+ne.slice(1)),11,Ua)),64))]),((Te=f.value[p.value])==null?void 0:Te.isDefault)!==!1?(w(),S("div",Ha,[...E[18]||(E[18]=[i("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"NO CUSTOM OVERRIDE — this agent uses only the base reminders",-1)])])):Q("",!0),i("textarea",{value:((ge=f.value[p.value])==null?void 0:ge.content)??"",onInput:E[4]||(E[4]=ne=>{const He=ne.target;f.value[p.value]={content:He.value,isDefault:!1}}),rows:"8",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:`Add ${p.value}-specific reminders (e.g. orchestrator hints, subagent policies)...`},null,40,Ba)]),i("div",Wa,[i("div",Ka,[E[19]||(E[19]=i("div",null,[i("h3",{class:"text-lg font-semibold"},"Drive Framing Template"),i("p",{class:"text-sm text-textSecondary mt-1"},"Customize the autonomous drive prompt sent when the operator is away")],-1)),i("div",za,[$.value?(w(),S("span",Ja,_($.value),1)):Q("",!0),i("button",{onClick:Et,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset to Default"),i("button",{onClick:xt,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),i("div",qa,[E[21]||(E[21]=i("label",{class:"text-sm text-textSecondary"},"Drive Activation Period:",-1)),i("div",Ga,[i("span",Ya,_(L.value),1),E[20]||(E[20]=i("span",{class:"text-sm text-textSecondary"},"hours",-1))]),E[22]||(E[22]=i("span",{class:"text-xs text-muted"},"(informational — set via DMN_ACTIVATION_HOURS env var)",-1))]),H.value?(w(),S("div",Za,[...E[23]||(E[23]=[i("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"(Default — edit to override)",-1)])])):Q("",!0),i("div",Qa,[E[24]||(E[24]=i("span",{class:"text-sm text-textSecondary self-center"},"Presets:",-1)),(w(!0),S(ie,null,Se(I.value,ne=>(w(),S("button",{key:ne.key,onClick:He=>we(ne),class:"px-3 py-1.5 rounded-lg bg-card hover:bg-cardHover border border-gray-700 text-xs text-textSecondary hover:text-textPrimary transition"},_(ne.label),9,Xa))),128))]),le(i("textarea",{"onUpdate:modelValue":E[5]||(E[5]=ne=>A.value=ne),rows:"15",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Load a preset or type a custom drive template..."},null,512),[[me,A.value]]),i("div",ec,[i("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:E[6]||(E[6]=ne=>b.value=!b.value)},[(w(),S("svg",{class:G(["w-4 h-4 text-textSecondary transition-transform",b.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...E[25]||(E[25]=[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),E[26]||(E[26]=i("span",{class:"text-sm font-medium text-textSecondary"},"Preview with sample values",-1))]),b.value?(w(),S("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:se.value},null,8,tc)):Q("",!0)]),E[27]||(E[27]=We('<details class="mt-4"><summary class="text-sm font-medium text-textSecondary cursor-pointer hover:text-textPrimary transition">Available Variables</summary><div class="mt-2 glass rounded-xl p-4 grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"><div><code class="text-accentLight">{{IDLE_HOURS}}</code> <span class="text-textSecondary">— hours since last operator interaction</span></div><div><code class="text-accentLight">{{TIME}}</code> <span class="text-textSecondary">— ISO timestamp</span></div><div><code class="text-accentLight">{{PROBABILITY}}</code> <span class="text-textSecondary">— drive activation probability (0.2–1.0)</span></div></div></details>',1))])])}}}),nc={class:"animate-fade-in"},oc={class:"glass rounded-xl p-6 mb-6"},rc={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},ic={key:0,class:"glass rounded-xl p-4 mb-4 border border-accent/30"},lc={class:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3"},ac={class:"flex items-center gap-4 mb-3"},cc={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer"},uc={class:"flex items-center gap-2"},dc={key:0,class:"text-sm text-warn"},fc={key:1,class:"text-center py-8 text-textSecondary text-sm"},pc={key:2,class:"text-center text-textSecondary py-12"},hc={key:3,class:"space-y-2"},mc=["onClick"],gc={class:"flex items-start justify-between gap-3"},xc={class:"flex-1 min-w-0"},vc={class:"flex items-center gap-2 mb-1"},yc={class:"font-medium text-sm"},bc={key:0,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},_c={class:"flex flex-wrap gap-1.5 mt-1"},wc=["title"],Sc={key:0,class:"glass rounded-xl p-6"},kc={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Cc={class:"text-lg font-semibold"},Tc={class:"text-sm text-textSecondary mt-1"},$c={class:"flex items-center gap-2"},Ac={key:0,class:"text-sm text-success"},Ec={key:1,class:"text-sm text-warn"},Ic={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-4"},Pc=["value"],Mc={class:"flex items-end"},Oc={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer pb-2"},Dc=At({__name:"SkillsTab",setup(e){const t=R([]),s=R(!0),n=R(null),o=R(""),r=R(""),l=R(!1),a=R(""),u=R(""),h=R(!1),f=R(""),p=R(""),v=R(!1),A=R("");async function H(){s.value=!0;try{const W=await _e("/api/skills");t.value=W.skills||[]}finally{s.value=!1}}function $(W){return W?W.includes(".remote-copilot-mcp")&&W.includes("skills")?"user":W.endsWith(".default.md")?"default":W.endsWith(".skill.md")?"project":"unknown":"unknown"}function b(W){const j={user:"background:rgba(99,102,241,0.15);color:#818cf8",default:"background:rgba(107,114,128,0.15);color:#9ca3af",project:"background:rgba(34,197,94,0.15);color:#4ade80",unknown:"background:rgba(107,114,128,0.15);color:#9ca3af"};return j[W]||j.unknown}function I(W){n.value=W,o.value=W.content,r.value=(W.triggers||[]).join(", "),l.value=!!W.replacesOrchestrator,h.value=!1}function L(){n.value=null,u.value=""}function B(W,j,z,X){let ee=`---
|
|
64
|
+
**/let ln;const Gn=typeof window<"u"&&window.trustedTypes;if(Gn)try{ln=Gn.createPolicy("vue",{createHTML:e=>e})}catch{}const gr=ln?e=>ln.createHTML(e):e=>e,vi="http://www.w3.org/2000/svg",yi="http://www.w3.org/1998/Math/MathML",ut=typeof document<"u"?document:null,Yn=ut&&ut.createElement("template"),bi={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const o=t==="svg"?ut.createElementNS(vi,e):t==="mathml"?ut.createElementNS(yi,e):s?ut.createElement(e,{is:s}):ut.createElement(e);return e==="select"&&n&&n.multiple!=null&&o.setAttribute("multiple",n.multiple),o},createText:e=>ut.createTextNode(e),createComment:e=>ut.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ut.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,o,l){const a=s?s.previousSibling:t.lastChild;if(o&&(o===l||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),s),!(o===l||!(o=o.nextSibling)););else{Yn.innerHTML=gr(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const c=Yn.content;if(n==="svg"||n==="mathml"){const u=c.firstChild;for(;u.firstChild;)c.appendChild(u.firstChild);c.removeChild(u)}t.insertBefore(c,s)}return[a?a.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},_i=Symbol("_vtc");function wi(e,t,s){const n=e[_i];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Zn=Symbol("_vod"),ki=Symbol("_vsh"),Si=Symbol(""),Ci=/(?:^|;)\s*display\s*:/;function $i(e,t,s){const n=e.style,o=Ce(s);let l=!1;if(s&&!o){if(t)if(Ce(t))for(const a of t.split(";")){const c=a.slice(0,a.indexOf(":")).trim();s[c]==null&&_s(n,c,"")}else for(const a in t)s[a]==null&&_s(n,a,"");for(const a in s)a==="display"&&(l=!0),_s(n,a,s[a])}else if(o){if(t!==s){const a=n[Si];a&&(s+=";"+a),n.cssText=s,l=Ci.test(s)}}else t&&e.removeAttribute("style");Zn in e&&(e[Zn]=l?n.display:"",e[ki]&&(n.display="none"))}const Qn=/\s*!important$/;function _s(e,t,s){if(Z(s))s.forEach(n=>_s(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=Ti(e,t);Qn.test(s)?e.setProperty(St(n),s.replace(Qn,""),"important"):e[n]=s}}const Xn=["Webkit","Moz","ms"],qs={};function Ti(e,t){const s=qs[t];if(s)return s;let n=Re(t);if(n!=="filter"&&n in e)return qs[t]=n;n=Ps(n);for(let o=0;o<Xn.length;o++){const l=Xn[o]+n;if(l in e)return qs[t]=l}return t}const eo="http://www.w3.org/1999/xlink";function to(e,t,s,n,o,l=Er(t)){n&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(eo,t.slice(6,t.length)):e.setAttributeNS(eo,t,s):s==null||l&&!vo(s)?e.removeAttribute(t):e.setAttribute(t,l?"":ot(s)?String(s):s)}function so(e,t,s,n,o){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?gr(s):s);return}const l=e.tagName;if(t==="value"&&l!=="PROGRESS"&&!l.includes("-")){const c=l==="OPTION"?e.getAttribute("value")||"":e.value,u=s==null?e.type==="checkbox"?"on":"":String(s);(c!==u||!("_value"in e))&&(e.value=u),s==null&&e.removeAttribute(t),e._value=s;return}let a=!1;if(s===""||s==null){const c=typeof e[t];c==="boolean"?s=vo(s):s==null&&c==="string"?(s="",a=!0):c==="number"&&(s=0,a=!0)}try{e[t]=s}catch{}a&&e.removeAttribute(o||t)}function wt(e,t,s,n){e.addEventListener(t,s,n)}function Ei(e,t,s,n){e.removeEventListener(t,s,n)}const no=Symbol("_vei");function Ai(e,t,s,n,o=null){const l=e[no]||(e[no]={}),a=l[t];if(n&&a)a.value=n;else{const[c,u]=Ii(t);if(n){const x=l[t]=Oi(n,o);wt(e,c,x,u)}else a&&(Ei(e,c,a,u),l[t]=void 0)}}const oo=/(?:Once|Passive|Capture)$/;function Ii(e){let t;if(oo.test(e)){t={};let n;for(;n=e.match(oo);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):St(e.slice(2)),t]}let Gs=0;const Pi=Promise.resolve(),Mi=()=>Gs||(Pi.then(()=>Gs=0),Gs=Date.now());function Oi(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;rt(Di(n,s.value),t,5,[n])};return s.value=e,s.attached=Mi(),s}function Di(e,t){if(Z(t)){const s=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{s.call(e),e._stopped=!0},t.map(n=>o=>!o._stopped&&n&&n(o))}else return t}const ro=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ri=(e,t,s,n,o,l)=>{const a=o==="svg";t==="class"?wi(e,n,a):t==="style"?$i(e,s,n):Es(t)?As(t)||Ai(e,t,s,n,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ji(e,t,n,a))?(so(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&to(e,t,n,a,l,t!=="value")):e._isVueCE&&(Ni(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Ce(n)))?so(e,Re(t),n,l,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),to(e,t,n,a))};function ji(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&ro(t)&&X(s));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"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return ro(t)&&Ce(s)?!1:t in e}function Ni(e,t){const s=e._def.props;if(!s)return!1;const n=Re(t);return Array.isArray(s)?s.some(o=>Re(o)===n):Object.keys(s).some(o=>Re(o)===n)}const Ft=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Z(t)?s=>gs(t,s):t};function Li(e){e.target.composing=!0}function lo(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const mt=Symbol("_assign");function io(e,t,s){return t&&(e=e.trim()),s&&(e=Ms(e)),e}const re={created(e,{modifiers:{lazy:t,trim:s,number:n}},o){e[mt]=Ft(o);const l=n||o.props&&o.props.type==="number";wt(e,t?"change":"input",a=>{a.target.composing||e[mt](io(e.value,s,l))}),(s||l)&&wt(e,"change",()=>{e.value=io(e.value,s,l)}),t||(wt(e,"compositionstart",Li),wt(e,"compositionend",lo),wt(e,"change",lo))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:o,number:l}},a){if(e[mt]=Ft(a),e.composing)return;const c=(l||e.type==="number")&&!/^0\d/.test(e.value)?Ms(e.value):e.value,u=t??"";if(c===u)return;const x=e.getRootNode();(x instanceof Document||x instanceof ShadowRoot)&&x.activeElement===e&&e.type!=="range"&&(n&&t===s||o&&e.value.trim()===u)||(e.value=u)}},ao={deep:!0,created(e,t,s){e[mt]=Ft(s),wt(e,"change",()=>{const n=e._modelValue,o=cs(e),l=e.checked,a=e[mt];if(Z(n)){const c=dn(n,o),u=c!==-1;if(l&&!u)a(n.concat(o));else if(!l&&u){const x=[...n];x.splice(c,1),a(x)}}else if(Bt(n)){const c=new Set(n);l?c.add(o):c.delete(o),a(c)}else a(vr(e,l))})},mounted:co,beforeUpdate(e,t,s){e[mt]=Ft(s),co(e,t,s)}};function co(e,{value:t,oldValue:s},n){e._modelValue=t;let o;if(Z(t))o=dn(t,n.props.value)>-1;else if(Bt(t))o=t.has(n.props.value);else{if(t===s)return;o=Kt(t,vr(e,!0))}e.checked!==o&&(e.checked=o)}const Ht={deep:!0,created(e,{value:t,modifiers:{number:s}},n){const o=Bt(t);wt(e,"change",()=>{const l=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>s?Ms(cs(a)):cs(a));e[mt](e.multiple?o?new Set(l):l:l[0]),e._assigning=!0,No(()=>{e._assigning=!1})}),e[mt]=Ft(n)},mounted(e,{value:t}){uo(e,t)},beforeUpdate(e,t,s){e[mt]=Ft(s)},updated(e,{value:t}){e._assigning||uo(e,t)}};function uo(e,t){const s=e.multiple,n=Z(t);if(!(s&&!n&&!Bt(t))){for(let o=0,l=e.options.length;o<l;o++){const a=e.options[o],c=cs(a);if(s)if(n){const u=typeof c;u==="string"||u==="number"?a.selected=t.some(x=>String(x)===String(c)):a.selected=dn(t,c)>-1}else a.selected=t.has(c);else if(Kt(cs(a),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function cs(e){return"_value"in e?e._value:e.value}function vr(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const Ui={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ze=(e,t)=>{const s=e._withKeys||(e._withKeys={}),n=t.join(".");return s[n]||(s[n]=(o=>{if(!("key"in o))return;const l=St(o.key);if(t.some(a=>a===l||Ui[a]===l))return e(o)}))},Vi=Ae({patchProp:Ri},bi);let fo;function Fi(){return fo||(fo=Ql(Vi))}const Hi=((...e)=>{const t=Fi().createApp(...e),{mount:s}=t;return t.mount=n=>{const o=Ki(n);if(!o)return;const l=t._component;!X(l)&&!l.render&&!l.template&&(l.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const a=s(o,!1,Bi(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),a},t});function Bi(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ki(e){return Ce(e)?document.querySelector(e):e}let $n="";function qt(e){$n=e}function _e(){return $n}async function ye(e,t){const s=await fetch(e,{...t,headers:{Authorization:`Bearer ${$n}`,"Content-Type":"application/json",...(t==null?void 0:t.headers)??{}}});if(!s.ok){const n=new Error(s.statusText);throw n.status=s.status,n}return s.json()}const Wi={class:"animate-fade-in"},zi={key:0,class:"text-center py-12 text-textSecondary"},Ji={key:1,class:"text-center text-textSecondary py-12"},qi={key:2,class:"space-y-3"},Gi={class:"flex items-center justify-between"},Yi={class:"flex items-center gap-3"},Zi={class:"font-medium"},Qi={class:"text-accentLight"},Xi={class:"text-textSecondary text-xs"},ea={key:2,class:"text-muted italic"},ta={class:"text-xs text-textSecondary font-mono"},sa={class:"text-right"},na={class:"flex items-center gap-2 justify-end"},oa={class:"text-xs text-textSecondary"},ra=vt({__name:"SessionsTab",props:{status:{}},setup(e){const t=e,s=E([]),n=E(!0);async function o(){n.value=!0;try{const x=await ye("/api/status");s.value=(x.sessions||[]).slice().sort((d,m)=>d.status==="active"&&m.status!=="active"?-1:d.status!=="active"&&m.status==="active"?1:m.lastActivity-d.lastActivity)}finally{n.value=!1}}const l=Fe(()=>{var d;return(((d=t.status)==null?void 0:d.sessions)??s.value).slice().sort((m,y)=>m.status==="active"&&y.status!=="active"?-1:m.status!=="active"&&y.status==="active"?1:y.lastActivity-m.lastActivity)});function a(x){const d=Math.floor((Date.now()-x.lastActivity)/6e4);return x.status==="disconnected"?{label:`Disconnected${d>0?` — ${d}m ago`:""}`,color:"text-muted"}:d<5?{label:"Active",color:"text-success"}:d<30?{label:`Idle ${d}m`,color:"text-warn"}:{label:`Dormant ${d}m`,color:"text-danger"}}function c(x){if(!x.lastWaitCallAt)return"";const d=Math.floor((Date.now()-x.lastWaitCallAt)/6e4);return d<5?`Polling — ${d===0?"just now":d+"m ago"}`:`Last poll — ${d}m ago`}function u(x){return x.lastWaitCallAt?Math.floor((Date.now()-x.lastWaitCallAt)/6e4)<5?"text-success":"text-warn":""}return lt(o),(x,d)=>(h(),g("div",Wi,[n.value&&l.value.length===0?(h(),g("div",zi,"Loading sessions...")):l.value.length===0?(h(),g("div",Ji,"No sessions")):(h(),g("div",qi,[(h(!0),g(te,null,be(l.value,m=>(h(),g("div",{key:m.mcpSessionId,class:J(["glass rounded-xl p-4 animate-slide-up",m.status==="disconnected"?"opacity-60":""])},[r("div",Gi,[r("div",Yi,[r("span",{class:J(["w-2.5 h-2.5 rounded-full",m.status==="disconnected"?"bg-muted":Math.floor((Date.now()-m.lastActivity)/6e4)<5?"bg-success":Math.floor((Date.now()-m.lastActivity)/6e4)<30?"bg-warn":"bg-danger"])},null,2),r("div",null,[r("div",Zi,[m.topicName?(h(),g(te,{key:0},[r("span",Qi,_(m.topicName),1),r("span",Xi," (thread "+_(m.threadId)+")",1)],64)):m.threadId!=null?(h(),g(te,{key:1},[we("Thread "+_(m.threadId),1)],64)):(h(),g("span",ea,"Awaiting start_session…"))]),r("div",ta,_(m.mcpSessionId.slice(0,12))+"...",1)])]),r("div",sa,[r("div",na,[r("span",{class:J(["text-sm font-medium",a(m).color])},_(a(m).label),3),c(m)?(h(),g("span",{key:0,class:J(["text-xs ml-2",u(m)])},_(c(m)),3)):q("",!0)]),r("div",oa,_(m.transportType),1)])])],2))),128))]))]))}}),la={class:"animate-fade-in"},ia={class:"flex flex-wrap items-center gap-3 mb-4"},aa={key:0,class:"text-center py-12 text-textSecondary"},ca={key:1,class:"text-center py-12 text-textSecondary"},ua={key:2,class:"space-y-2"},da={class:"flex items-start justify-between gap-3"},fa={class:"flex-1 min-w-0"},pa={class:"flex items-center gap-2 mb-1"},ma={key:0,class:"type-badge",style:{background:"rgba(239,68,68,0.15)",color:"#f87171"}},xa={key:1,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},ha={class:"text-xs text-textSecondary"},ga={class:"text-sm text-textPrimary leading-relaxed"},va={class:"flex flex-wrap gap-1.5 mt-2"},ya={class:"text-right shrink-0"},ba={class:"text-sm font-mono text-textSecondary"},_a={class:"text-xs text-muted"},wa={class:"text-xs text-muted"},ka=vt({__name:"MemoryNotesTab",setup(e){const t=E([]),s=E(!1),n=E(""),o=E("created_at"),l=E("");let a=null;async function c(){s.value=!0;try{const d=l.value.trim();let m;if(d)m=await ye(`/api/search?q=${encodeURIComponent(d)}&limit=50`);else{const y=new URLSearchParams({limit:"50",sort:o.value});n.value&&y.set("type",n.value),m=await ye(`/api/notes?${y}`)}t.value=m}finally{s.value=!1}}function u(){a&&clearTimeout(a),a=setTimeout(c,300)}function x(d){if(!d)return"never";const m=Date.now()-new Date(d).getTime(),y=Math.floor(m/6e4);if(y<1)return"just now";if(y<60)return`${y}m ago`;const T=Math.floor(y/60);return T<24?`${T}h ago`:`${Math.floor(T/24)}d ago`}return lt(c),(d,m)=>(h(),g("div",la,[r("div",ia,[ee(r("input",{"onUpdate:modelValue":m[0]||(m[0]=y=>l.value=y),onInput:u,type:"text",placeholder:"Search notes...",class:"flex-1 min-w-[200px] px-4 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,544),[[re,l.value]]),ee(r("select",{"onUpdate:modelValue":m[1]||(m[1]=y=>n.value=y),onChange:c,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...m[3]||(m[3]=[Xe('<option value="">All types</option><option value="fact">Facts</option><option value="preference">Preferences</option><option value="pattern">Patterns</option><option value="entity">Entities</option><option value="relationship">Relationships</option>',6)])],544),[[Ht,n.value]]),ee(r("select",{"onUpdate:modelValue":m[2]||(m[2]=y=>o.value=y),onChange:c,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...m[4]||(m[4]=[r("option",{value:"created_at"},"Newest",-1),r("option",{value:"confidence"},"Confidence",-1),r("option",{value:"access_count"},"Most accessed",-1)])],544),[[Ht,o.value]])]),s.value?(h(),g("div",aa,"Loading notes...")):t.value.length===0?(h(),g("div",ca,"No notes found")):(h(),g("div",ua,[(h(!0),g(te,null,be(t.value,y=>(h(),g("div",{key:y.noteId,class:J(["glass rounded-xl p-4 animate-fade-in",`priority-${y.priority||0}`])},[r("div",da,[r("div",fa,[r("div",pa,[r("span",{class:J(["type-badge",`type-${y.type}`])},_(y.type),3),y.priority>=2?(h(),g("span",ma,"HIGH IMPORTANCE")):y.priority===1?(h(),g("span",xa,"NOTABLE")):q("",!0),r("span",ha,_(y.noteId),1)]),r("p",ga,_(y.content),1),r("div",va,[(h(!0),g(te,null,be(y.keywords||[],T=>(h(),g("span",{key:T,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},_(T),1))),128))])]),r("div",ya,[r("div",ba,_(((Number(y.confidence)||0)*100).toFixed(0))+"%",1),r("div",_a,_(x(y.createdAt)),1),r("div",wa,_(y.accessCount??0)+" hits",1)])])],2))),128))]))]))}}),Sa={class:"animate-fade-in space-y-6"},Ca={class:"glass rounded-xl p-4"},$a={class:"flex flex-wrap items-center gap-4 mb-4"},Ta={key:0,class:"text-sm text-success"},Ea={class:"flex flex-wrap items-center gap-3 mb-4"},Aa={key:0,class:"text-sm text-success"},Ia={class:"glass rounded-xl p-6"},Pa={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ma={class:"flex items-center gap-2"},Oa={key:0,class:"text-sm text-success"},Da={key:0,class:"mb-3"},Ra={class:"mt-4"},ja=["innerHTML"],Na={class:"glass rounded-xl p-6"},La={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ua={class:"flex items-center gap-2"},Va={key:0,class:"text-sm text-success"},Fa={class:"flex gap-2 mb-4"},Ha=["onClick"],Ba={key:0,class:"mb-3"},Ka=["value","placeholder"],Wa={class:"glass rounded-xl p-6"},za={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ja={class:"flex items-center gap-2"},qa={key:0,class:"text-sm text-success"},Ga={class:"mb-4 flex flex-wrap items-center gap-3"},Ya={class:"flex items-center gap-2"},Za={class:"font-mono text-sm text-textPrimary"},Qa={key:0,class:"mb-3"},Xa={class:"flex flex-wrap gap-2 mb-3"},ec=["onClick"],tc={class:"mt-4"},sc=["innerHTML"],nc=vt({__name:"TemplatesTab",setup(e){function t(F){return F.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\{\{([A-Z_]+)\}\}/g,'<span class="text-accentLight" style="background:rgba(99,102,241,0.1);padding:0 2px;border-radius:3px">{{$1}}</span>')}const s=E("copilot"),n=E(""),o=E(50),l=E(""),a=E(""),c=E(!0),u=E(""),x=E(!1),d=E({}),m=E("copilot"),y=E(""),T=E(""),B=E(!0),C=E(""),w=E(!1),k=E([]),P=E("");async function H(){await Promise.all([V(),se(),ne(),W()])}async function V(){try{const F=await ye("/api/settings/agent-type");s.value=F.agentType||"copilot"}catch{}}async function se(){try{const F=await ye("/api/settings/bootstrap-message-count");o.value=F.count??50}catch{}}async function ne(){try{const F=await ye("/api/templates");if(F.templates&&F.templates.length>0){const M=F.templates[0];a.value=M.content||"",c.value=M.isDefault??!0}F.agentReminders&&(d.value=F.agentReminders)}catch{}}async function W(){try{const[F,M,$e]=await Promise.all([ye("/api/templates/drive"),ye("/api/templates/drive-presets"),ye("/api/settings/dmn-activation-hours")]);k.value=M.presets||[],P.value=String($e.value??"not set"),F.custom?(T.value=F.custom,B.value=!1):(T.value=F.default||"",B.value=!0)}catch{}}async function N(){try{await ye("/api/settings/agent-type",{method:"POST",body:JSON.stringify({agentType:s.value})}),await ye("/api/templates/reminders",{method:"DELETE"}),n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3),await ne()}catch(F){n.value="Error: "+F.message}}async function G(){try{await ye("/api/settings/bootstrap-message-count",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:o.value})}),l.value="Saved ✓",setTimeout(()=>{l.value=""},3e3)}catch(F){l.value="Error: "+F.message}}async function ue(){try{const F=await fetch("/api/templates/reminders",{method:"POST",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({content:a.value})});if(!F.ok)throw new Error(F.statusText);c.value=!1,u.value="Saved ✓",setTimeout(()=>{u.value=""},3e3)}catch(F){u.value="Error: "+F.message}}async function U(){if(confirm("Reset to default template? Your customizations will be lost."))try{const F=await fetch("/api/templates/reminders",{method:"DELETE",headers:{Authorization:`Bearer ${_e()}`}});if(!F.ok)throw new Error(F.statusText);await ne(),u.value="Reset to default ✓",setTimeout(()=>{u.value=""},3e3)}catch(F){u.value="Error: "+F.message}}async function R(){var $e;const F=m.value,M=(($e=d.value[F])==null?void 0:$e.content)??"";try{const ke=await fetch(`/api/templates/reminders-${F}`,{method:"POST",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({content:M})});if(!ke.ok)throw new Error(ke.statusText);d.value[F]={content:M,isDefault:!1},y.value=`Saved ${F} ✓`,setTimeout(()=>{y.value=""},3e3)}catch(ke){y.value="Error: "+ke.message}}async function K(){const F=m.value;if(confirm(`Reset ${F} agent reminder? The custom template will be removed.`))try{const M=await fetch(`/api/templates/reminders-${F}`,{method:"DELETE",headers:{Authorization:`Bearer ${_e()}`}});if(!M.ok)throw new Error(M.statusText);await ne(),y.value=`Reset ${F} ✓`,setTimeout(()=>{y.value=""},3e3)}catch(M){y.value="Error: "+M.message}}async function oe(){const F=T.value;if(!F.trim()){C.value="Template is empty — load a preset first",setTimeout(()=>{C.value=""},3e3);return}try{const M=await fetch("/api/templates/drive",{method:"POST",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({content:F})});if(!M.ok)throw new Error(M.statusText);B.value=!1,C.value="Saved ✓",setTimeout(()=>{C.value=""},3e3)}catch(M){C.value="Error: "+M.message}}async function ve(){if(confirm("Reset drive template? The custom template will be removed."))try{const F=await fetch("/api/templates/drive",{method:"DELETE",headers:{Authorization:`Bearer ${_e()}`}});if(!F.ok)throw new Error(F.statusText);await W(),C.value="Reset to default ✓",setTimeout(()=>{C.value=""},3e3)}catch(F){C.value="Error: "+F.message}}function Se(F){T.value=F.content,B.value=!1}const pe=Fe(()=>t(a.value)),le=Fe(()=>T.value?t(T.value):'<span style="color:#6b7280">(no template loaded)</span>');return lt(H),(F,M)=>{var $e,ke;return h(),g("div",Sa,[r("div",Ca,[r("div",$a,[M[8]||(M[8]=r("label",{class:"text-sm font-medium text-textSecondary"},"Agent Type",-1)),ee(r("select",{"onUpdate:modelValue":M[0]||(M[0]=de=>s.value=de),onChange:N,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...M[7]||(M[7]=[Xe('<option value="copilot">Copilot</option><option value="copilot_claude">Copilot (Claude)</option><option value="copilot_codex">Copilot (Codex)</option><option value="claude">Claude</option><option value="cursor">Cursor</option><option value="codex">Codex</option><option value="openai_codex">OpenAI Codex</option>',7)])],544),[[Ht,s.value]]),n.value?(h(),g("span",Ta,_(n.value),1)):q("",!0),M[9]||(M[9]=r("span",{class:"text-xs text-muted"},"Changes which default reminders template is used",-1))]),r("div",Ea,[M[10]||(M[10]=r("label",{class:"text-sm font-medium text-textSecondary"},"Bootstrap Messages",-1)),ee(r("input",{"onUpdate:modelValue":M[1]||(M[1]=de=>o.value=de),type:"number",min:"0",max:"500",class:"w-24 px-3 py-2 rounded-xl bg-card border border-gray-700 text-text text-sm focus:border-accent focus:outline-none"},null,512),[[re,o.value,void 0,{number:!0}]]),r("button",{onClick:G,class:"px-4 py-2 rounded-xl bg-accent text-white text-sm font-medium hover:bg-accent/80 transition-colors"},"Save"),l.value?(h(),g("span",Aa,_(l.value),1)):q("",!0),M[11]||(M[11]=r("span",{class:"text-xs text-muted"},"Number of recent messages injected as warm context (0 = off)",-1))])]),r("div",Ia,[r("div",Pa,[M[12]||(M[12]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Reminders Template"),r("p",{class:"text-sm text-textSecondary mt-1"},"Edit the system prompt template sent with every reminder")],-1)),r("div",Ma,[u.value?(h(),g("span",Oa,_(u.value),1)):q("",!0),r("button",{onClick:U,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset to Default"),r("button",{onClick:ue,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),c.value?(h(),g("div",Da,[...M[13]||(M[13]=[r("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"USING DEFAULT — edit and save to customize",-1)])])):q("",!0),ee(r("textarea",{"onUpdate:modelValue":M[2]||(M[2]=de=>a.value=de),rows:"20",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Loading..."},null,512),[[re,a.value]]),r("div",Ra,[r("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:M[3]||(M[3]=de=>x.value=!x.value)},[(h(),g("svg",{class:J(["w-4 h-4 text-textSecondary transition-transform",x.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...M[14]||(M[14]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),M[15]||(M[15]=r("span",{class:"text-sm font-medium text-textSecondary"},"Preview with highlighted variables",-1))]),x.value?(h(),g("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:pe.value},null,8,ja)):q("",!0)]),M[16]||(M[16]=Xe('<details class="mt-4"><summary class="text-sm font-medium text-textSecondary cursor-pointer hover:text-textPrimary transition">Available Variables</summary><div class="mt-2 glass rounded-xl p-4 grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"><div><code class="text-accentLight">{{OPERATOR_MESSAGE}}</code> <span class="text-textSecondary">— latest operator message</span></div><div><code class="text-accentLight">{{THREAD_ID}}</code> <span class="text-textSecondary">— Telegram thread ID</span></div><div><code class="text-accentLight">{{TIME}}</code> <span class="text-textSecondary">— formatted timestamp</span></div><div><code class="text-accentLight">{{UPTIME}}</code> <span class="text-textSecondary">— session uptime</span></div><div><code class="text-accentLight">{{VERSION}}</code> <span class="text-textSecondary">— package version</span></div><div><code class="text-accentLight">{{MODE}}</code> <span class="text-textSecondary">— "autonomous" or "standard"</span></div></div></details>',1))]),r("div",Na,[r("div",La,[M[17]||(M[17]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Agent-Specific Reminders"),r("p",{class:"text-sm text-textSecondary mt-1"},"Appended after the base reminders template — per agent type")],-1)),r("div",Ua,[y.value?(h(),g("span",Va,_(y.value),1)):q("",!0),r("button",{onClick:K,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset"),r("button",{onClick:R,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),r("div",Fa,[(h(),g(te,null,be(["copilot","claude","cursor","codex"],de=>r("button",{key:de,onClick:We=>m.value=de,class:J(["px-4 py-2 rounded-xl text-sm font-medium transition",m.value===de?"bg-accent text-white":"bg-card hover:bg-cardHover border border-gray-700 text-textSecondary hover:text-textPrimary"])},_(de.charAt(0).toUpperCase()+de.slice(1)),11,Ha)),64))]),(($e=d.value[m.value])==null?void 0:$e.isDefault)!==!1?(h(),g("div",Ba,[...M[18]||(M[18]=[r("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"NO CUSTOM OVERRIDE — this agent uses only the base reminders",-1)])])):q("",!0),r("textarea",{value:((ke=d.value[m.value])==null?void 0:ke.content)??"",onInput:M[4]||(M[4]=de=>{const We=de.target;d.value[m.value]={content:We.value,isDefault:!1}}),rows:"8",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:`Add ${m.value}-specific reminders (e.g. orchestrator hints, subagent policies)...`},null,40,Ka)]),r("div",Wa,[r("div",za,[M[19]||(M[19]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Drive Framing Template"),r("p",{class:"text-sm text-textSecondary mt-1"},"Customize the autonomous drive prompt sent when the operator is away")],-1)),r("div",Ja,[C.value?(h(),g("span",qa,_(C.value),1)):q("",!0),r("button",{onClick:ve,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset to Default"),r("button",{onClick:oe,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),r("div",Ga,[M[21]||(M[21]=r("label",{class:"text-sm text-textSecondary"},"Drive Activation Period:",-1)),r("div",Ya,[r("span",Za,_(P.value),1),M[20]||(M[20]=r("span",{class:"text-sm text-textSecondary"},"hours",-1))]),M[22]||(M[22]=r("span",{class:"text-xs text-muted"},"(informational — set via DMN_ACTIVATION_HOURS env var)",-1))]),B.value?(h(),g("div",Qa,[...M[23]||(M[23]=[r("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"(Default — edit to override)",-1)])])):q("",!0),r("div",Xa,[M[24]||(M[24]=r("span",{class:"text-sm text-textSecondary self-center"},"Presets:",-1)),(h(!0),g(te,null,be(k.value,de=>(h(),g("button",{key:de.key,onClick:We=>Se(de),class:"px-3 py-1.5 rounded-lg bg-card hover:bg-cardHover border border-gray-700 text-xs text-textSecondary hover:text-textPrimary transition"},_(de.label),9,ec))),128))]),ee(r("textarea",{"onUpdate:modelValue":M[5]||(M[5]=de=>T.value=de),rows:"15",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Load a preset or type a custom drive template..."},null,512),[[re,T.value]]),r("div",tc,[r("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:M[6]||(M[6]=de=>w.value=!w.value)},[(h(),g("svg",{class:J(["w-4 h-4 text-textSecondary transition-transform",w.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...M[25]||(M[25]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),M[26]||(M[26]=r("span",{class:"text-sm font-medium text-textSecondary"},"Preview with sample values",-1))]),w.value?(h(),g("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:le.value},null,8,sc)):q("",!0)]),M[27]||(M[27]=Xe('<details class="mt-4"><summary class="text-sm font-medium text-textSecondary cursor-pointer hover:text-textPrimary transition">Available Variables</summary><div class="mt-2 glass rounded-xl p-4 grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"><div><code class="text-accentLight">{{IDLE_HOURS}}</code> <span class="text-textSecondary">— hours since last operator interaction</span></div><div><code class="text-accentLight">{{TIME}}</code> <span class="text-textSecondary">— ISO timestamp</span></div><div><code class="text-accentLight">{{PROBABILITY}}</code> <span class="text-textSecondary">— drive activation probability (0.2–1.0)</span></div></div></details>',1))])])}}}),oc={class:"animate-fade-in"},rc={class:"glass rounded-xl p-6 mb-6"},lc={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},ic={key:0,class:"glass rounded-xl p-4 mb-4 border border-accent/30"},ac={class:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3"},cc={class:"flex items-center gap-4 mb-3"},uc={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer"},dc={class:"flex items-center gap-2"},fc={key:0,class:"text-sm text-warn"},pc={key:1,class:"text-center py-8 text-textSecondary text-sm"},mc={key:2,class:"text-center text-textSecondary py-12"},xc={key:3,class:"space-y-2"},hc=["onClick"],gc={class:"flex items-start justify-between gap-3"},vc={class:"flex-1 min-w-0"},yc={class:"flex items-center gap-2 mb-1"},bc={class:"font-medium text-sm"},_c={key:0,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},wc={class:"flex flex-wrap gap-1.5 mt-1"},kc=["title"],Sc={key:0,class:"glass rounded-xl p-6"},Cc={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},$c={class:"text-lg font-semibold"},Tc={class:"text-sm text-textSecondary mt-1"},Ec={class:"flex items-center gap-2"},Ac={key:0,class:"text-sm text-success"},Ic={key:1,class:"text-sm text-warn"},Pc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-4"},Mc=["value"],Oc={class:"flex items-end"},Dc={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer pb-2"},Rc=vt({__name:"SkillsTab",setup(e){const t=E([]),s=E(!0),n=E(null),o=E(""),l=E(""),a=E(!1),c=E(""),u=E(""),x=E(!1),d=E(""),m=E(""),y=E(!1),T=E("");async function B(){s.value=!0;try{const W=await ye("/api/skills");t.value=W.skills||[]}finally{s.value=!1}}function C(W){return W?W.includes(".remote-copilot-mcp")&&W.includes("skills")?"user":W.endsWith(".default.md")?"default":W.endsWith(".skill.md")?"project":"unknown":"unknown"}function w(W){const N={user:"background:rgba(99,102,241,0.15);color:#818cf8",default:"background:rgba(107,114,128,0.15);color:#9ca3af",project:"background:rgba(34,197,94,0.15);color:#4ade80",unknown:"background:rgba(107,114,128,0.15);color:#9ca3af"};return N[W]||N.unknown}function k(W){n.value=W,o.value=W.content,l.value=(W.triggers||[]).join(", "),a.value=!!W.replacesOrchestrator,x.value=!1}function P(){n.value=null,u.value=""}function H(W,N,G,ue){let U=`---
|
|
65
65
|
name: ${W}
|
|
66
66
|
triggers:
|
|
67
|
-
`;return
|
|
68
|
-
`}),
|
|
69
|
-
`),
|
|
67
|
+
`;return N.forEach(R=>{U+=` - ${R.trim()}
|
|
68
|
+
`}),G&&(U+=`replaces_orchestrator: true
|
|
69
|
+
`),U+=`---
|
|
70
70
|
|
|
71
|
-
`,
|
|
72
|
-
`);try{const ee=await fetch(`/api/skills/${encodeURIComponent(W)}`,{method:"PUT",headers:{Authorization:`Bearer ${xe()}`,"Content-Type":"application/json"},body:JSON.stringify({content:X})});if(!ee.ok)throw new Error(ee.statusText);A.value="Created ✓",h.value=!1,await H();const ke=t.value.find(Ce=>Ce.name===W);ke&&I(ke)}catch(ee){A.value="Error: "+ee.message}}return wt(H),(W,j)=>(w(),S("div",nc,[i("div",oc,[i("div",rc,[j[8]||(j[8]=i("div",null,[i("h3",{class:"text-lg font-semibold"},"Skill Library"),i("p",{class:"text-sm text-textSecondary mt-1"},"Manage intent-routing skills — user overrides, defaults, and project skills")],-1)),i("button",{onClick:j[0]||(j[0]=z=>{h.value=!h.value,n.value=null}),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + New Skill ")]),h.value?(w(),S("div",ic,[j[12]||(j[12]=i("h4",{class:"text-sm font-semibold mb-3"},"Create New Skill",-1)),i("div",lc,[i("div",null,[j[9]||(j[9]=i("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),le(i("input",{"onUpdate:modelValue":j[1]||(j[1]=z=>f.value=z),type:"text",placeholder:"my-skill",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[me,f.value]])]),i("div",null,[j[10]||(j[10]=i("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),le(i("input",{"onUpdate:modelValue":j[2]||(j[2]=z=>p.value=z),type:"text",placeholder:"trigger1, trigger2",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},null,512),[[me,p.value]])])]),i("div",ac,[i("label",cc,[le(i("input",{"onUpdate:modelValue":j[3]||(j[3]=z=>v.value=z),type:"checkbox",class:"rounded"},null,512),[[lo,v.value]]),j[11]||(j[11]=i("span",null,"Replaces orchestrator",-1))])]),i("div",uc,[i("button",{onClick:he,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Create"),i("button",{onClick:j[4]||(j[4]=z=>h.value=!1),class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Cancel"),A.value?(w(),S("span",dc,_(A.value),1)):Q("",!0)])])):Q("",!0),s.value?(w(),S("div",fc,"Loading...")):t.value.length===0?(w(),S("div",pc,"No skills loaded")):(w(),S("div",hc,[(w(!0),S(ie,null,Se(t.value,z=>{var X;return w(),S("div",{key:z.name,onClick:ee=>I(z),class:G(["glass rounded-xl p-4 cursor-pointer hover:bg-cardHover transition border",((X=n.value)==null?void 0:X.name)===z.name?"border-accent":"border-transparent"])},[i("div",gc,[i("div",xc,[i("div",vc,[i("span",yc,_(z.name),1),i("span",{class:"type-badge",style:Ms(b($(z.source)))},_($(z.source)),5),z.replacesOrchestrator?(w(),S("span",bc,"REPLACES ORCH")):Q("",!0)]),i("div",_c,[(w(!0),S(ie,null,Se(z.triggers||[],ee=>(w(),S("span",{key:ee,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},_(ee),1))),128))])]),i("div",{class:"text-xs text-muted font-mono shrink-0 max-w-[200px] truncate",title:z.source||""},_((z.source||"").split(/[\\/]/).pop()||""),9,wc)])],10,mc)}),128))]))]),n.value?(w(),S("div",Sc,[i("div",kc,[i("div",null,[i("h3",Cc,"Edit: "+_(n.value.name),1),i("p",Tc,_(n.value.source||"(unknown source)"),1)]),i("div",$c,[a.value?(w(),S("span",Ac,_(a.value),1)):Q("",!0),u.value?(w(),S("span",Ec,_(u.value),1)):Q("",!0),$(n.value.source)==="user"?(w(),S("button",{key:2,onClick:Z,class:"px-4 py-2 rounded-xl bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-sm text-textSecondary hover:text-red-400 transition",title:"Remove user override (reverts to default)"},"Remove override")):Q("",!0),i("button",{onClick:L,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Close"),i("button",{onClick:F,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),i("div",Ic,[i("div",null,[j[13]||(j[13]=i("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),i("input",{value:n.value.name,type:"text",readonly:"",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono opacity-60 cursor-not-allowed"},null,8,Pc)]),i("div",null,[j[14]||(j[14]=i("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),le(i("input",{"onUpdate:modelValue":j[5]||(j[5]=z=>r.value=z),type:"text",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},null,512),[[me,r.value]])]),i("div",Mc,[i("label",Oc,[le(i("input",{"onUpdate:modelValue":j[6]||(j[6]=z=>l.value=z),type:"checkbox",class:"rounded"},null,512),[[lo,l.value]]),j[15]||(j[15]=i("span",null,"Replaces orchestrator",-1))])])]),le(i("textarea",{"onUpdate:modelValue":j[7]||(j[7]=z=>o.value=z),rows:"20",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Skill body (markdown)..."},null,512),[[me,o.value]])])):Q("",!0)]))}}),Rc={class:"animate-fade-in space-y-6"},jc={class:"glass rounded-xl p-6"},Nc={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},Lc={class:"flex items-center gap-3"},Fc={key:0,class:"mt-4 p-4 rounded-xl bg-surface border border-gray-700/50 space-y-3"},Vc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3"},Uc=["value"],Hc={class:"flex justify-end"},Bc=["disabled"],Wc={key:0,class:"text-center py-12 text-textSecondary"},Kc={key:1,class:"text-center py-8 text-danger text-sm"},zc={key:2,class:"text-center py-12 text-textSecondary"},Jc={key:3},qc={class:"space-y-3"},Gc={class:"p-4"},Yc={class:"flex flex-wrap items-center gap-3"},Zc=["onBlur"],Qc=["onDblclick"],Xc={class:"text-xs text-muted font-mono"},eu=["value","onChange"],tu=["value"],su={class:"text-xs text-muted"},nu=["onKeyup","onBlur"],ou=["title","onDblclick"],ru={class:"ml-auto flex items-center gap-3"},iu=["onClick","disabled"],lu={class:"flex items-center gap-1.5"},au=["onClick"],cu={class:"flex items-center gap-1.5"},uu=["onClick"],du={class:"flex items-center gap-1.5"},fu=["onClick"],pu=["onClick"],hu=["onClick"],mu=["onClick"],gu={key:0,class:"mt-3 p-3 rounded-lg bg-surface border border-purple-500/20 space-y-2"},xu={class:"grid grid-cols-1 sm:grid-cols-3 gap-2"},vu=["value"],yu={class:"flex items-center gap-2"},bu=["onClick","disabled"],_u={key:0,class:"border-t border-gray-700/30 bg-surface/30 px-4 py-3 space-y-2"},wu={key:0,class:"text-xs text-muted py-1"},Su={class:"text-sm font-medium"},ku={class:"text-xs text-muted font-mono"},Cu=["value","onChange"],Tu=["value"],$u={class:"text-xs text-muted"},Au={class:"ml-auto flex items-center gap-3"},Eu=["onClick","disabled"],Iu=["onClick","disabled"],Pu={key:1,class:"flex items-center gap-1.5"},Mu=["onClick"],Ou={key:2,class:"flex items-center gap-1.5"},Du=["onClick"],Ru=["onClick"],ju={key:4},Nu={class:"space-y-2"},Lu={class:"font-medium"},Fu={class:"text-xs text-muted font-mono"},Vu={class:"text-xs text-textSecondary"},Uu={class:"text-xs text-muted"},Hu={class:"ml-auto flex items-center gap-2"},Bu=["onClick","disabled"],Wu=["onClick","disabled"],Ku=["onClick"],zu={key:5},Ju={class:"space-y-2"},qu={class:"font-medium"},Gu={class:"text-xs text-muted font-mono"},Yu=["value","onChange"],Zu=["value"],Qu={class:"text-xs text-muted"},Xu={class:"ml-auto flex items-center gap-3"},ed=["onClick","disabled"],td=["onClick","disabled"],sd={class:"flex items-center gap-1.5"},nd=["onClick"],od={class:"flex items-center gap-1.5"},rd=["onClick"],id=["onClick"],ld={key:6},ad={class:"space-y-2"},cd={class:"font-medium"},ud={class:"text-xs text-muted font-mono"},dd=["value","onChange"],fd=["value"],pd={class:"text-xs text-muted"},hd={class:"ml-auto flex items-center gap-2"},md=["onClick","disabled"],gd=["onClick","disabled"],xd=["onClick"],vd=At({__name:"ThreadsTab",setup(e){const t=R([]),s=R(!0),n=R(""),o=R({}),r=R(new Set),l=R(!1),a=R({name:"",threadId:0,client:"claude",workingDirectory:""}),u=R(""),h=R(!1),f=R(null),p=R(""),v=R(null),A=R(""),H=R(null),$=R({name:"",threadId:0,client:"claude",workingDirectory:""}),b=R(""),I=R(!1),L=R(null),B=R(null),F=["claude","copilot","codex","openai_codex","copilot_claude","copilot_codex","cursor"],Z={root:{emoji:"🟢",classes:"bg-green-500/20 text-green-400 border-green-500/30"},daily:{emoji:"🔵",classes:"bg-blue-500/20 text-blue-400 border-blue-500/30"},branch:{emoji:"🟣",classes:"bg-purple-500/20 text-purple-400 border-purple-500/30"},worker:{emoji:"🟡",classes:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30"}},he=Ke(()=>t.value.filter(O=>O.type==="root")),W=Ke(()=>t.value.filter(O=>O.type==="daily")),j=Ke(()=>t.value.filter(O=>O.type==="branch")),z=Ke(()=>t.value.filter(O=>O.type==="worker"));async function X(){s.value=!0,n.value="";try{const O=await _e("/api/threads");t.value=O.threads??[]}catch(O){n.value=O.message||"Failed to load threads"}finally{s.value=!1}}async function ee(O){try{const x=await _e(`/api/threads/${O}/children`);o.value[O]=x.threads??[]}catch{o.value[O]=[]}}function ke(O){r.value.has(O)?r.value.delete(O):(r.value.add(O),ee(O))}async function Ce(){if(!(!a.value.name.trim()||!a.value.threadId)){h.value=!0,u.value="";try{const O=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${xe()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:a.value.threadId,name:a.value.name.trim(),type:"root",client:a.value.client,keepAlive:!1,...a.value.workingDirectory.trim()?{workingDirectory:a.value.workingDirectory.trim()}:{}})});if(!O.ok){const x=await O.json().catch(()=>({error:O.statusText}));throw new Error(x.error??O.statusText)}u.value="Created ✓",a.value={name:"",threadId:0,client:"claude",workingDirectory:""},l.value=!1,setTimeout(()=>{u.value=""},3e3),await X()}catch(O){u.value="Error: "+O.message}finally{h.value=!1}}}async function xt(O){if(!(!$.value.name.trim()||!$.value.threadId)){I.value=!0,b.value="";try{const x=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${xe()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:$.value.threadId,name:$.value.name.trim(),type:"branch",rootThreadId:O,client:$.value.client,...$.value.workingDirectory.trim()?{workingDirectory:$.value.workingDirectory.trim()}:{}})});if(!x.ok){const m=await x.json().catch(()=>({error:x.statusText}));throw new Error(m.error??x.statusText)}b.value="Branch created ✓",$.value={name:"",threadId:0,client:"claude",workingDirectory:""},H.value=null,setTimeout(()=>{b.value=""},3e3),await X(),ee(O)}catch(x){b.value="Error: "+x.message}finally{I.value=!1}}}function Et(O){f.value=O.threadId,p.value=O.name}async function we(O){const x=p.value.trim();if(f.value=null,!!x)try{const m=await fetch(`/api/threads/${O}`,{method:"PATCH",headers:{Authorization:`Bearer ${xe()}`,"Content-Type":"application/json"},body:JSON.stringify({name:x})});if(!m.ok)throw new Error(m.statusText);await X()}catch(m){n.value="Failed to rename thread: "+m.message}}function ce(O){v.value=O.threadId,A.value=O.workingDirectory??""}async function se(O){const x=A.value.trim();v.value=null;try{const m=await fetch(`/api/threads/${O}`,{method:"PATCH",headers:{Authorization:`Bearer ${xe()}`,"Content-Type":"application/json"},body:JSON.stringify({workingDirectory:x||null})});if(!m.ok)throw new Error(m.statusText);await X()}catch(m){n.value="Failed to update working directory: "+m.message}}async function V(O){try{const x=await fetch(`/api/threads/${O.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${xe()}`,"Content-Type":"application/json"},body:JSON.stringify({keepAlive:!O.keepAlive})});if(!x.ok)throw new Error(x.statusText);await X()}catch(x){n.value="Failed to toggle keep-alive: "+x.message}}async function E(O,x){try{const m=await fetch(`/api/threads/${O.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${xe()}`,"Content-Type":"application/json"},body:JSON.stringify({client:x})});if(!m.ok)throw new Error(m.statusText);await X()}catch(m){n.value="Failed to change agent type: "+m.message}}async function Te(O){try{const x=await fetch(`/api/threads/${O.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${xe()}`,"Content-Type":"application/json"},body:JSON.stringify({dailyRotation:!O.dailyRotation})});if(!x.ok)throw new Error(x.statusText);await X()}catch(x){n.value="Failed to toggle daily rotation: "+x.message}}async function ge(O){try{const x=await fetch(`/api/threads/${O.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${xe()}`,"Content-Type":"application/json"},body:JSON.stringify({autonomousMode:!O.autonomousMode})});if(!x.ok)throw new Error(x.statusText);await X()}catch(x){n.value="Failed to toggle autonomous mode: "+x.message}}async function ne(O){if(confirm(`Archive thread "${O.name}" (${O.threadId})?`))try{const x=await fetch(`/api/threads/${O.threadId}`,{method:"DELETE",headers:{Authorization:`Bearer ${xe()}`}});if(!x.ok)throw new Error(x.statusText);await X()}catch(x){n.value="Failed to archive: "+x.message}}async function He(O){if(confirm(`Start thread "${O.name}" (${O.threadId})?`)){L.value=O.threadId;try{const x=await fetch(`/api/threads/${O.threadId}/start`,{method:"POST",headers:{Authorization:`Bearer ${xe()}`}});if(!x.ok){const m=await x.json().catch(()=>({error:x.statusText}));throw new Error(m.error??x.statusText)}await X()}catch(x){n.value="Failed to start thread: "+x.message}finally{L.value=null}}}async function It(O){if(confirm(`Sync memory from "${O.name}" to its root thread?`)){B.value=O.threadId;try{const x=await fetch(`/api/threads/${O.threadId}/synthesize`,{method:"POST",headers:{Authorization:`Bearer ${xe()}`}});if(!x.ok){const ye=await x.json().catch(()=>({error:x.statusText}));throw new Error(ye.error??x.statusText)}const m=await x.json();n.value="",u.value=`Synced ${m.synthesizedNotes??0} notes ✓`,setTimeout(()=>{u.value=""},3e3),await X()}catch(x){n.value="Failed to sync memory: "+x.message}finally{B.value=null}}}function Be(O){if(!O)return"—";const x=new Date(O),ye=Date.now()-x.getTime();return ye<6e4?"just now":ye<36e5?`${Math.floor(ye/6e4)}m ago`:ye<864e5?`${Math.floor(ye/36e5)}h ago`:x.toLocaleDateString()}function qe(O){return O==="active"?"text-success":O==="archived"?"text-muted":"text-warn"}return wt(X),(O,x)=>(w(),S("div",Rc,[i("div",jc,[i("div",Nc,[x[14]||(x[14]=i("div",null,[i("h3",{class:"text-lg font-semibold"},"Thread Registry"),i("p",{class:"text-sm text-textSecondary mt-1"},"Manage conversation threads, branches, and daily sessions")],-1)),i("div",Lc,[u.value?(w(),S("span",{key:0,class:G([u.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},_(u.value),3)):Q("",!0),i("button",{onClick:x[0]||(x[0]=m=>l.value=!l.value),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},_(l.value?"Cancel":"+ New Root Thread"),1),i("button",{onClick:X,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),l.value?(w(),S("div",Fc,[i("div",Vc,[i("div",null,[x[15]||(x[15]=i("label",{class:"block text-xs text-textSecondary mb-1"},"Name",-1)),le(i("input",{"onUpdate:modelValue":x[1]||(x[1]=m=>a.value.name=m),type:"text",placeholder:"e.g. Main Workspace",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[me,a.value.name]])]),i("div",null,[x[16]||(x[16]=i("label",{class:"block text-xs text-textSecondary mb-1"},"Thread ID",-1)),le(i("input",{"onUpdate:modelValue":x[2]||(x[2]=m=>a.value.threadId=m),type:"number",min:"1",placeholder:"Telegram thread ID",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[me,a.value.threadId,void 0,{number:!0}]])]),i("div",null,[x[17]||(x[17]=i("label",{class:"block text-xs text-textSecondary mb-1"},"Client",-1)),le(i("select",{"onUpdate:modelValue":x[3]||(x[3]=m=>a.value.client=m),class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition appearance-none"},[(w(),S(ie,null,Se(F,m=>i("option",{key:m,value:m},_(m),9,Uc)),64))],512),[[is,a.value.client]])])]),i("div",null,[x[18]||(x[18]=i("label",{class:"block text-xs text-textSecondary mb-1"},"Working Directory (optional)",-1)),le(i("input",{"onUpdate:modelValue":x[4]||(x[4]=m=>a.value.workingDirectory=m),type:"text",placeholder:"e.g. C:\\src\\my-project",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition font-mono"},null,512),[[me,a.value.workingDirectory]])]),i("div",Hc,[i("button",{onClick:Ce,disabled:h.value||!a.value.name.trim()||!a.value.threadId,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},_(h.value?"Creating…":"Create Root Thread"),9,Bc)])])):Q("",!0)]),s.value&&t.value.length===0?(w(),S("div",Wc,"Loading threads…")):n.value?(w(),S("div",Kc,_(n.value),1)):t.value.length===0?(w(),S("div",zc,"No threads registered")):Q("",!0),he.value.length>0?(w(),S("div",Jc,[x[24]||(x[24]=i("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟢 Root Threads",-1)),i("div",qc,[(w(!0),S(ie,null,Se(he.value,m=>{var ye,d;return w(),S("div",{key:m.id,class:"glass rounded-xl overflow-hidden"},[i("div",Gc,[i("div",Yc,[i("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(ye=Z[m.type])==null?void 0:ye.classes])},_((d=Z[m.type])==null?void 0:d.emoji)+" "+_(m.type.toUpperCase()),3),f.value===m.threadId?le((w(),S("input",{key:0,"onUpdate:modelValue":x[5]||(x[5]=c=>p.value=c),onBlur:c=>we(m.threadId),onKeyup:[x[6]||(x[6]=Jt(c=>c.target.blur(),["enter"])),x[7]||(x[7]=Jt(c=>f.value=null,["escape"]))],class:"font-semibold bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-40",ref_for:!0,ref:"nameInput"},null,40,Zc)),[[me,p.value]]):(w(),S("span",{key:1,class:"font-semibold cursor-pointer hover:text-accent transition",onDblclick:c=>Et(m),title:"Double-click to rename"},_(m.name),41,Qc)),i("span",{class:G(["text-xs font-medium",qe(m.status)])},_(m.status),3),i("span",Xc,"ID: "+_(m.threadId),1),i("select",{value:m.client,onChange:c=>E(m,c.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(w(),S(ie,null,Se(F,c=>i("option",{key:c,value:c},_(c),9,tu)),64))],40,eu),i("span",su,_(Be(m.lastActiveAt)),1),v.value===m.threadId?le((w(),S("input",{key:2,"onUpdate:modelValue":x[8]||(x[8]=c=>A.value=c),onKeyup:[Jt(c=>se(m.threadId),["enter"]),x[9]||(x[9]=Jt(c=>v.value=null,["escape"]))],onBlur:c=>se(m.threadId),type:"text",placeholder:"Set working directory…",class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-48"},null,40,nu)),[[me,A.value]]):(w(),S("span",{key:3,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(m.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:c=>ce(m)},"📁 "+_(m.workingDirectory??"—"),41,ou)),i("div",ru,[i("button",{onClick:c=>He(m),disabled:L.value===m.threadId,class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},_(L.value===m.threadId?"Starting…":"▶ Start"),9,iu),i("div",lu,[i("button",{onClick:c=>V(m),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",m.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[i("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",m.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,au),x[19]||(x[19]=i("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),i("div",cu,[i("button",{onClick:c=>Te(m),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",m.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[i("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",m.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,uu),x[20]||(x[20]=i("span",{class:"text-xs text-muted"},"Daily",-1))]),i("div",du,[i("button",{onClick:c=>ge(m),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",m.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[i("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",m.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,fu),x[21]||(x[21]=i("span",{class:"text-xs text-muted"},"Auto",-1))]),i("button",{onClick:c=>ke(m.threadId),class:"px-2 py-1 rounded-lg text-xs bg-card border border-gray-700 hover:bg-surface transition"},_(r.value.has(m.threadId)?"▾ Children":"▸ Children"),9,pu),i("button",{onClick:c=>{H.value=H.value===m.threadId?null:m.threadId,$.value={name:"",threadId:0,client:"claude",workingDirectory:""},b.value=""},class:"px-2 py-1 rounded-lg text-xs bg-purple-500/20 text-purple-400 border border-purple-500/30 hover:bg-purple-500/30 transition"}," + Branch ",8,hu),i("button",{onClick:c=>ne(m),class:"px-2 py-1 rounded-lg text-xs bg-red-500/20 text-red-400 border border-red-500/30 hover:bg-red-500/30 transition"}," Archive ",8,mu)])]),H.value===m.threadId?(w(),S("div",gu,[i("div",xu,[le(i("input",{"onUpdate:modelValue":x[10]||(x[10]=c=>$.value.name=c),type:"text",placeholder:"Branch name",class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[me,$.value.name]]),le(i("input",{"onUpdate:modelValue":x[11]||(x[11]=c=>$.value.threadId=c),type:"number",min:"1",placeholder:"Thread ID",class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[me,$.value.threadId,void 0,{number:!0}]]),le(i("select",{"onUpdate:modelValue":x[12]||(x[12]=c=>$.value.client=c),class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition appearance-none"},[(w(),S(ie,null,Se(F,c=>i("option",{key:c,value:c},_(c),9,vu)),64))],512),[[is,$.value.client]])]),le(i("input",{"onUpdate:modelValue":x[13]||(x[13]=c=>$.value.workingDirectory=c),type:"text",placeholder:"Working directory (optional)",class:"w-full px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition font-mono"},null,512),[[me,$.value.workingDirectory]]),i("div",yu,[i("button",{onClick:c=>xt(m.threadId),disabled:I.value||!$.value.name.trim()||!$.value.threadId,class:"px-3 py-1.5 rounded-lg bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-xs font-medium transition"},_(I.value?"Creating…":"Create Branch"),9,bu),b.value?(w(),S("span",{key:0,class:G([b.value.startsWith("Error")?"text-danger":"text-success","text-xs"])},_(b.value),3)):Q("",!0)])])):Q("",!0)]),r.value.has(m.threadId)&&o.value[m.threadId]?(w(),S("div",_u,[o.value[m.threadId].length===0?(w(),S("div",wu,"No children")):Q("",!0),(w(!0),S(ie,null,Se(o.value[m.threadId],c=>{var g,k;return w(),S("div",{key:c.id,class:"flex flex-wrap items-center gap-2 px-3 py-2 rounded-lg bg-card/50 border border-gray-700/30"},[i("span",{class:G(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-xs font-medium border",(g=Z[c.type])==null?void 0:g.classes])},_((k=Z[c.type])==null?void 0:k.emoji)+" "+_(c.type.toUpperCase()),3),i("span",Su,_(c.name),1),i("span",{class:G(["text-xs",qe(c.status)])},_(c.status),3),i("span",ku,"ID: "+_(c.threadId),1),i("select",{value:c.client,onChange:y=>E(c,y.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(w(),S(ie,null,Se(F,y=>i("option",{key:y,value:y},_(y),9,Tu)),64))],40,Cu),i("span",$u,_(Be(c.lastActiveAt)),1),i("div",Au,[i("button",{onClick:y=>He(c),disabled:L.value===c.threadId,class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},_(L.value===c.threadId?"Starting…":"▶ Start"),9,Eu),c.rootThreadId?(w(),S("button",{key:0,onClick:y=>It(c),disabled:B.value===c.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},_(B.value===c.threadId?"Syncing…":"⟳ Sync to Root"),9,Iu)):Q("",!0),c.type==="branch"?(w(),S("div",Pu,[i("button",{onClick:y=>V(c),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",c.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[i("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",c.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,Mu),x[22]||(x[22]=i("span",{class:"text-xs text-muted"},"Keep-alive",-1))])):Q("",!0),c.type==="branch"?(w(),S("div",Ou,[i("button",{onClick:y=>ge(c),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",c.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[i("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",c.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,Du),x[23]||(x[23]=i("span",{class:"text-xs text-muted"},"Auto",-1))])):Q("",!0),c.type!=="root"?(w(),S("button",{key:3,onClick:y=>ne(c),class:"px-2 py-0.5 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,Ru)):Q("",!0)])])}),128))])):Q("",!0)])}),128))])])):Q("",!0),W.value.length>0?(w(),S("div",ju,[x[25]||(x[25]=i("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🔵 Daily Sessions",-1)),i("div",Nu,[(w(!0),S(ie,null,Se(W.value,m=>{var ye,d;return w(),S("div",{key:m.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[i("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(ye=Z[m.type])==null?void 0:ye.classes])},_((d=Z[m.type])==null?void 0:d.emoji)+" "+_(m.type.toUpperCase()),3),i("span",Lu,_(m.name),1),i("span",{class:G(["text-xs font-medium",qe(m.status)])},_(m.status),3),i("span",Fu,"ID: "+_(m.threadId),1),i("span",Vu,_(m.client),1),i("span",Uu,_(Be(m.lastActiveAt)),1),i("div",Hu,[i("button",{onClick:c=>He(m),disabled:L.value===m.threadId,class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},_(L.value===m.threadId?"Starting…":"▶ Start"),9,Bu),m.rootThreadId?(w(),S("button",{key:0,onClick:c=>It(m),disabled:B.value===m.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},_(B.value===m.threadId?"Syncing…":"⟳ Sync to Root"),9,Wu)):Q("",!0),i("button",{onClick:c=>ne(m),class:"px-2 py-1 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,Ku)])])}),128))])])):Q("",!0),j.value.length>0?(w(),S("div",zu,[x[28]||(x[28]=i("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟣 Branches",-1)),i("div",Ju,[(w(!0),S(ie,null,Se(j.value,m=>{var ye,d;return w(),S("div",{key:m.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[i("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(ye=Z[m.type])==null?void 0:ye.classes])},_((d=Z[m.type])==null?void 0:d.emoji)+" "+_(m.type.toUpperCase()),3),i("span",qu,_(m.name),1),i("span",{class:G(["text-xs font-medium",qe(m.status)])},_(m.status),3),i("span",Gu,"ID: "+_(m.threadId),1),i("select",{value:m.client,onChange:c=>E(m,c.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(w(),S(ie,null,Se(F,c=>i("option",{key:c,value:c},_(c),9,Zu)),64))],40,Yu),i("span",Qu,_(Be(m.lastActiveAt)),1),i("div",Xu,[i("button",{onClick:c=>He(m),disabled:L.value===m.threadId,class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},_(L.value===m.threadId?"Starting…":"▶ Start"),9,ed),m.rootThreadId?(w(),S("button",{key:0,onClick:c=>It(m),disabled:B.value===m.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},_(B.value===m.threadId?"Syncing…":"⟳ Sync to Root"),9,td)):Q("",!0),i("div",sd,[i("button",{onClick:c=>V(m),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",m.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[i("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",m.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,nd),x[26]||(x[26]=i("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),i("div",od,[i("button",{onClick:c=>ge(m),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",m.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[i("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",m.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,rd),x[27]||(x[27]=i("span",{class:"text-xs text-muted"},"Auto",-1))]),i("button",{onClick:c=>ne(m),class:"px-2 py-1 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,id)])])}),128))])])):Q("",!0),z.value.length>0?(w(),S("div",ld,[x[29]||(x[29]=i("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟡 Workers",-1)),i("div",ad,[(w(!0),S(ie,null,Se(z.value,m=>{var ye,d;return w(),S("div",{key:m.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[i("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(ye=Z[m.type])==null?void 0:ye.classes])},_((d=Z[m.type])==null?void 0:d.emoji)+" "+_(m.type.toUpperCase()),3),i("span",cd,_(m.name),1),i("span",{class:G(["text-xs font-medium",qe(m.status)])},_(m.status),3),i("span",ud,"ID: "+_(m.threadId),1),i("select",{value:m.client,onChange:c=>E(m,c.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(w(),S(ie,null,Se(F,c=>i("option",{key:c,value:c},_(c),9,fd)),64))],40,dd),i("span",pd,_(Be(m.lastActiveAt)),1),i("div",hd,[i("button",{onClick:c=>He(m),disabled:L.value===m.threadId,class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},_(L.value===m.threadId?"Starting…":"▶ Start"),9,md),m.rootThreadId?(w(),S("button",{key:0,onClick:c=>It(m),disabled:B.value===m.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},_(B.value===m.threadId?"Syncing…":"⟳ Sync to Root"),9,gd)):Q("",!0),i("button",{onClick:c=>ne(m),class:"px-2 py-1 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,xd)])])}),128))])])):Q("",!0)]))}}),yd={class:"animate-fade-in"},bd={class:"glass rounded-xl p-6 mb-6"},_d={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},wd={class:"flex items-center gap-3"},Sd=["disabled"],kd={key:0,class:"text-center py-8 text-textSecondary text-sm"},Cd={key:1,class:"space-y-6"},Td={class:"glass rounded-xl p-4 border border-gray-700/50"},$d={class:"flex items-center gap-4"},Ad={class:"flex justify-between text-xs text-muted mt-2"},Ed={class:"font-mono"},Id={key:0,class:"mt-3 px-3 py-2 rounded-lg bg-warn/10 border border-warn/20 text-xs text-warn"},Pd={class:"glass rounded-xl p-4 border border-gray-700/50"},Md={class:"flex items-center gap-4"},Od={class:"flex justify-between text-xs text-muted mt-2"},Dd={class:"font-mono"},Rd={class:"glass rounded-xl p-4 border border-gray-700/50"},jd={class:"glass rounded-xl p-4 border border-gray-700/50"},Nd={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},Ld={class:"grid grid-cols-2 gap-4"},Fd={class:"text-sm font-medium text-textSecondary"},Vd={class:"text-sm font-medium font-mono text-textSecondary"},Ud={class:"text-sm font-medium font-mono text-textSecondary"},Hd={class:"mt-3"},Bd=At({__name:"SettingsTab",setup(e){const t=R(!0),s=R(!1),n=R(""),o=R(50),r=R(50),l=R(1440),a=R(1440),u=R("claude-opus-4-6"),h=R("claude-opus-4-6"),f=R("claude-sonnet-4-5"),p=R("claude-sonnet-4-5"),v=Ke(()=>o.value!==r.value||l.value!==a.value||u.value!==h.value||f.value!==p.value);async function A(){t.value=!0;try{const[$,b,I,L]=await Promise.all([_e("/api/settings/bootstrap-message-count"),_e("/api/settings/wait-timeout"),_e("/api/settings/default-thread-model"),_e("/api/settings/default-worker-model")]);o.value=$.count,r.value=$.count,l.value=b.minutes,a.value=b.minutes,u.value=I.defaultThreadModel,h.value=I.defaultThreadModel,f.value=L.defaultWorkerModel,p.value=L.defaultWorkerModel}finally{t.value=!1}}async function H(){if(s.value=!0,n.value="",!u.value){n.value="Error: Thread model cannot be empty",s.value=!1;return}if(!f.value){n.value="Error: Worker model cannot be empty",s.value=!1;return}try{const $={Authorization:`Bearer ${xe()}`,"Content-Type":"application/json"},[b,I,L,B]=await Promise.all([fetch("/api/settings/bootstrap-message-count",{method:"POST",headers:$,body:JSON.stringify({count:o.value})}),fetch("/api/settings/wait-timeout",{method:"POST",headers:$,body:JSON.stringify({minutes:l.value})}),fetch("/api/settings/default-thread-model",{method:"POST",headers:$,body:JSON.stringify({model:u.value})}),fetch("/api/settings/default-worker-model",{method:"POST",headers:$,body:JSON.stringify({model:f.value})})]);for(const j of[b,I,L,B])if(!j.ok){const z=await j.json().catch(()=>({error:j.statusText}));throw new Error(z.error??j.statusText)}const F=await b.json(),Z=await I.json(),he=await L.json(),W=await B.json();r.value=F.count,o.value=F.count,a.value=Z.minutes,l.value=Z.minutes,h.value=he.defaultThreadModel,u.value=he.defaultThreadModel,p.value=W.defaultWorkerModel,f.value=W.defaultWorkerModel,n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3)}catch($){n.value="Error: "+$.message}finally{s.value=!1}}return wt(A),($,b)=>(w(),S("div",yd,[i("div",bd,[i("div",_d,[b[6]||(b[6]=i("div",null,[i("h3",{class:"text-lg font-semibold"},"Settings"),i("p",{class:"text-sm text-textSecondary mt-1"},"Configure agent behavior and context injection")],-1)),i("div",wd,[n.value?(w(),S("span",{key:0,class:G([n.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},_(n.value),3)):Q("",!0),i("button",{onClick:H,disabled:s.value||t.value||!v.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},_(s.value?"Saving…":"Save"),9,Sd)])]),t.value?(w(),S("div",kd,"Loading…")):(w(),S("div",Cd,[i("div",Td,[b[10]||(b[10]=i("label",{class:"block text-sm font-medium mb-1"},"Recent Conversation Buffer",-1)),b[11]||(b[11]=i("p",{class:"text-xs text-textSecondary mb-3"},[Ve(" Number of recent messages injected into the agent's bootstrap context. Set to "),i("span",{class:"font-mono text-accentLight"},"0"),Ve(" to disable (useful when using VS Code, which maintains its own conversation history). ")],-1)),i("div",$d,[le(i("input",{"onUpdate:modelValue":b[0]||(b[0]=I=>o.value=I),type:"range",min:"0",max:"100",step:"5",class:"flex-1 accent-accent"},null,512),[[me,o.value,void 0,{number:!0}]]),le(i("input",{"onUpdate:modelValue":b[1]||(b[1]=I=>o.value=I),type:"number",min:"0",max:"200",class:"w-20 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono text-center focus:outline-none focus:border-accent transition"},null,512),[[me,o.value,void 0,{number:!0}]])]),i("div",Ad,[b[7]||(b[7]=i("span",null,"Off",-1)),i("span",Ed,_(o.value)+" messages",1),b[8]||(b[8]=i("span",null,"Max",-1))]),o.value===0?(w(),S("div",Id,[...b[9]||(b[9]=[Ve(" Message buffer injection is ",-1),i("strong",null,"disabled",-1),Ve(". The agent will not see recent conversation history in its bootstrap context. Use this when VS Code (or another IDE) already provides conversation history. ",-1)])])):Q("",!0)]),i("div",Pd,[b[14]||(b[14]=i("label",{class:"block text-sm font-medium mb-1"},"Poll Timeout (wait_for_instructions)",-1)),b[15]||(b[15]=i("p",{class:"text-xs text-textSecondary mb-3"},[Ve(" Maximum time (in minutes) a single "),i("span",{class:"font-mono text-accentLight"},"wait_for_instructions"),Ve(" call will poll before timing out. Claude Code agents use the full value; Copilot agents are capped at 10 min. ")],-1)),i("div",Md,[le(i("input",{"onUpdate:modelValue":b[2]||(b[2]=I=>l.value=I),type:"range",min:"1",max:"1440",step:"10",class:"flex-1 accent-accent"},null,512),[[me,l.value,void 0,{number:!0}]]),le(i("input",{"onUpdate:modelValue":b[3]||(b[3]=I=>l.value=I),type:"number",min:"1",max:"10080",class:"w-24 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono text-center focus:outline-none focus:border-accent transition"},null,512),[[me,l.value,void 0,{number:!0}]])]),i("div",Od,[b[12]||(b[12]=i("span",null,"1 min",-1)),i("span",Dd,_(l.value>=60?Math.floor(l.value/60)+"h "+l.value%60+"m":l.value+" min"),1),b[13]||(b[13]=i("span",null,"24h",-1))])]),i("div",Rd,[b[16]||(b[16]=i("label",{class:"block text-sm font-medium mb-1"},"Default Thread Model",-1)),b[17]||(b[17]=i("p",{class:"text-xs text-textSecondary mb-3"},[Ve(" Model used when spawning a normal (orchestrator) Claude thread. Overridden by the "),i("span",{class:"font-mono text-accentLight"},"CLAUDE_MODEL"),Ve(" env var if set. ")],-1)),le(i("input",{"onUpdate:modelValue":b[4]||(b[4]=I=>u.value=I),type:"text",placeholder:"claude-opus-4-6",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[me,u.value,void 0,{trim:!0}]])]),i("div",jd,[b[18]||(b[18]=i("label",{class:"block text-sm font-medium mb-1"},"Default Worker Model",-1)),b[19]||(b[19]=i("p",{class:"text-xs text-textSecondary mb-3"},[Ve(" Model used when spawning a worker Claude thread. Overridden by the "),i("span",{class:"font-mono text-accentLight"},"CLAUDE_WORKER_MODEL"),Ve(" env var if set. ")],-1)),le(i("input",{"onUpdate:modelValue":b[5]||(b[5]=I=>f.value=I),type:"text",placeholder:"claude-sonnet-4-5",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[me,f.value,void 0,{trim:!0}]])]),i("div",Nd,[b[24]||(b[24]=i("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),i("div",Ld,[i("div",null,[b[20]||(b[20]=i("div",{class:"text-xs text-muted mb-1"},"Message Buffer",-1)),i("span",{class:G(["text-sm font-medium",r.value>0?"text-success":"text-textSecondary"])},_(r.value>0?`${r.value} messages`:"Disabled"),3)]),i("div",null,[b[21]||(b[21]=i("div",{class:"text-xs text-muted mb-1"},"Poll Timeout",-1)),i("span",Fd,_(a.value>=60?Math.floor(a.value/60)+"h "+a.value%60+"m":a.value+" min"),1)]),i("div",null,[b[22]||(b[22]=i("div",{class:"text-xs text-muted mb-1"},"Thread Model",-1)),i("span",Vd,_(h.value),1)]),i("div",null,[b[23]||(b[23]=i("div",{class:"text-xs text-muted mb-1"},"Worker Model",-1)),i("span",Ud,_(p.value),1)])]),i("div",Hd,[i("span",{class:G(["text-sm font-medium",v.value?"text-warn":"text-textSecondary"])},_(v.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),Wd={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/95 backdrop-blur-sm"},Kd={class:"glass rounded-2xl p-8 max-w-md w-full mx-4 animate-slide-up"},zd=["disabled"],Jd={key:0,class:"mt-3 text-sm text-danger"},qd={key:1,class:"min-h-screen font-sans text-textPrimary animate-fade-in"},Gd={class:"glass sticky top-0 z-40 border-b border-gray-800/50"},Yd={class:"max-w-7xl mx-auto px-4 sm:px-6 py-4 flex items-center justify-between"},Zd={class:"flex items-center gap-4"},Qd={class:"text-sm text-textSecondary font-mono"},Xd={class:"max-w-7xl mx-auto px-4 sm:px-6 py-6"},ef={class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3"},tf={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},sf={class:"text-2xl font-bold font-mono"},nf={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},of={class:"text-2xl font-bold font-mono"},rf={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},lf={class:"text-2xl font-bold font-mono"},af={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},cf={class:"flex items-center gap-2 mb-2"},uf={class:"text-2xl font-bold font-mono"},df={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},ff={class:"text-2xl font-bold font-mono"},pf={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},hf={class:"text-2xl font-bold font-mono"},mf={class:"max-w-7xl mx-auto px-4 sm:px-6"},gf={class:"flex gap-6 border-b border-gray-800/50 mb-6"},xf=["onClick"],vf={class:"max-w-7xl mx-auto px-4 sm:px-6 pb-12"},hs="sensorium_token",yf=At({__name:"App",setup(e){const t=R(!1),s=R(""),n=R(""),o=R(!1),r=R(null),l=R("sessions");let a=null;const u=[{id:"sessions",label:"Sessions"},{id:"notes",label:"Memory Notes"},{id:"templates",label:"Templates"},{id:"skills",label:"Skills"},{id:"threads",label:"Threads"},{id:"settings",label:"Settings"}],h={sessions:oa,notes:wa,templates:sc,skills:Dc,threads:vd,settings:Bd},f=Ke(()=>h[l.value]),p=Ke(()=>{if(!r.value)return"—";const b=Math.floor(r.value.uptime),I=Math.floor(b/86400),L=Math.floor(b%86400/3600),B=Math.floor(b%3600/60);return I>0?`${I}d ${L}h`:L>0?`${L}h ${B}m`:`${B}m`});async function v(){const b=s.value.trim()||"no-auth";o.value=!0,n.value="";try{Kt(b),await H(),localStorage.setItem(hs,b),t.value=!0,$()}catch(I){const L=I;L.status===401?n.value="Invalid token":n.value=L.message??"Connection failed",Kt("")}finally{o.value=!1}}function A(){localStorage.removeItem(hs),t.value=!1,s.value="",r.value=null,a&&clearInterval(a),Kt("")}async function H(){r.value=await _e("/api/status")}function $(){a&&clearInterval(a),a=setInterval(H,3e4)}return wt(async()=>{const b=localStorage.getItem(hs);if(b){s.value=b;try{Kt(b),await H(),t.value=!0,$()}catch{localStorage.removeItem(hs),Kt("")}}}),_n(()=>{a&&clearInterval(a)}),(b,I)=>{var L,B,F,Z,he,W,j,z,X,ee,ke;return t.value?(w(),S("div",qd,[i("header",Gd,[i("div",Yd,[I[3]||(I[3]=We('<div class="flex items-center gap-3"><div class="w-8 h-8 rounded-lg bg-gradient-to-br from-accent to-purple-500 flex items-center justify-center"><span class="text-white text-sm font-bold">S</span></div><div><h1 class="text-lg font-semibold tracking-tight">Sensorium MCP</h1><p class="text-xs text-textSecondary">Agent Dashboard</p></div></div>',1)),i("div",Zd,[I[2]||(I[2]=i("div",{class:"flex items-center gap-2 text-sm"},[i("span",{class:"w-2 h-2 rounded-full bg-success animate-pulse-slow"}),i("span",{class:"text-textSecondary"},"Connected")],-1)),i("div",Qd,_(p.value),1),i("button",{onClick:A,class:"text-sm text-muted hover:text-textSecondary transition"},"Disconnect")])])]),i("div",Xd,[i("div",ef,[i("div",tf,[I[4]||(I[4]=We('<div class="flex items-center gap-2 mb-2"><span class="text-success"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Sessions</span></div>',1)),i("div",sf,_(((L=r.value)==null?void 0:L.activeSessions)??0),1)]),i("div",nf,[I[5]||(I[5]=We('<div class="flex items-center gap-2 mb-2"><span class="text-accentLight"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Notes</span></div>',1)),i("div",of,_(((F=(B=r.value)==null?void 0:B.memory)==null?void 0:F.totalSemanticNotes)??0),1)]),i("div",rf,[I[6]||(I[6]=We('<div class="flex items-center gap-2 mb-2"><span class="text-warn"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Episodes</span></div>',1)),i("div",lf,_(((he=(Z=r.value)==null?void 0:Z.memory)==null?void 0:he.totalEpisodes)??0),1)]),i("div",af,[i("div",cf,[i("span",{class:G((((j=(W=r.value)==null?void 0:W.memory)==null?void 0:j.unconsolidatedEpisodes)??0)>10?"text-danger":"text-success")},[...I[7]||(I[7]=[i("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)])],2),I[8]||(I[8]=i("span",{class:"text-xs text-textSecondary font-medium uppercase tracking-wider"},"Unconsolidated",-1))]),i("div",uf,_(((X=(z=r.value)==null?void 0:z.memory)==null?void 0:X.unconsolidatedEpisodes)??0),1)]),i("div",df,[I[9]||(I[9]=We('<div class="flex items-center gap-2 mb-2"><span class="text-accent"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Procedures</span></div>',1)),i("div",ff,_(((ke=(ee=r.value)==null?void 0:ee.memory)==null?void 0:ke.totalProcedures)??0),1)]),i("div",pf,[I[10]||(I[10]=We('<div class="flex items-center gap-2 mb-2"><span class="text-success"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M12 5l7 7-7 7"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Uptime</span></div>',1)),i("div",hf,_(p.value),1)])])]),i("div",mf,[i("nav",gf,[(w(),S(ie,null,Se(u,Ce=>i("button",{key:Ce.id,onClick:xt=>l.value=Ce.id,class:G(["pb-3 text-sm font-medium transition",l.value===Ce.id?"tab-active":"tab-inactive"])},_(Ce.label),11,xf)),64))])]),i("div",vf,[(w(),dr(Ai(f.value),{status:r.value},null,8,["status"]))])])):(w(),S("div",Wd,[i("div",Kd,[I[1]||(I[1]=We('<div class="flex items-center gap-3 mb-6"><div class="w-10 h-10 rounded-xl bg-accent/20 flex items-center justify-center"><svg class="w-5 h-5 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"></path></svg></div><div><h2 class="text-lg font-semibold">Sensorium MCP</h2><p class="text-sm text-textSecondary">Enter your API token</p></div></div>',1)),le(i("input",{"onUpdate:modelValue":I[0]||(I[0]=Ce=>s.value=Ce),type:"password",placeholder:"MCP_HTTP_SECRET",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary placeholder-muted focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition font-mono text-sm",onKeydown:Jt(v,["enter"])},null,544),[[me,s.value]]),i("button",{onClick:v,disabled:o.value,class:"w-full mt-4 px-4 py-3 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white font-medium transition"},_(o.value?"Connecting...":"Connect"),9,zd),n.value?(w(),S("p",Jd,_(n.value),1)):Q("",!0)])]))}}});Ul(yf).mount("#app");</script>
|
|
71
|
+
`,U+ue}async function V(){if(!n.value)return;const W=n.value.name;try{const N=l.value.split(",").map(R=>R.trim()).filter(Boolean),G=o.value;let ue;G.trimStart().startsWith("---")?ue=G:ue=H(W,N,a.value,G);const U=await fetch(`/api/skills/${encodeURIComponent(W)}`,{method:"PUT",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ue})});if(!U.ok)throw new Error(U.statusText);c.value="Saved ✓",setTimeout(()=>{c.value=""},3e3),await B()}catch(N){c.value="Error: "+N.message}}async function se(){if(!n.value)return;const W=n.value.name;try{const N=await fetch(`/api/skills/${encodeURIComponent(W)}`,{method:"DELETE",headers:{Authorization:`Bearer ${_e()}`}});if(!N.ok)throw new Error(N.statusText);P(),await B()}catch(N){u.value="Error: "+N.message}}async function ne(){const W=d.value.trim(),N=m.value;if(!W){T.value="Name is required";return}const G=N.split(",").map(U=>U.trim()).filter(Boolean);if(!G.length){T.value="At least one trigger is required";return}const ue=H(W,G,y.value,`\x3C!-- Write your skill instructions here -->
|
|
72
|
+
`);try{const U=await fetch(`/api/skills/${encodeURIComponent(W)}`,{method:"PUT",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ue})});if(!U.ok)throw new Error(U.statusText);T.value="Created ✓",x.value=!1,await B();const R=t.value.find(K=>K.name===W);R&&k(R)}catch(U){T.value="Error: "+U.message}}return lt(B),(W,N)=>(h(),g("div",oc,[r("div",rc,[r("div",lc,[N[8]||(N[8]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Skill Library"),r("p",{class:"text-sm text-textSecondary mt-1"},"Manage intent-routing skills — user overrides, defaults, and project skills")],-1)),r("button",{onClick:N[0]||(N[0]=G=>{x.value=!x.value,n.value=null}),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + New Skill ")]),x.value?(h(),g("div",ic,[N[12]||(N[12]=r("h4",{class:"text-sm font-semibold mb-3"},"Create New Skill",-1)),r("div",ac,[r("div",null,[N[9]||(N[9]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),ee(r("input",{"onUpdate:modelValue":N[1]||(N[1]=G=>d.value=G),type:"text",placeholder:"my-skill",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,d.value]])]),r("div",null,[N[10]||(N[10]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),ee(r("input",{"onUpdate:modelValue":N[2]||(N[2]=G=>m.value=G),type:"text",placeholder:"trigger1, trigger2",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},null,512),[[re,m.value]])])]),r("div",cc,[r("label",uc,[ee(r("input",{"onUpdate:modelValue":N[3]||(N[3]=G=>y.value=G),type:"checkbox",class:"rounded"},null,512),[[ao,y.value]]),N[11]||(N[11]=r("span",null,"Replaces orchestrator",-1))])]),r("div",dc,[r("button",{onClick:ne,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Create"),r("button",{onClick:N[4]||(N[4]=G=>x.value=!1),class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Cancel"),T.value?(h(),g("span",fc,_(T.value),1)):q("",!0)])])):q("",!0),s.value?(h(),g("div",pc,"Loading...")):t.value.length===0?(h(),g("div",mc,"No skills loaded")):(h(),g("div",xc,[(h(!0),g(te,null,be(t.value,G=>{var ue;return h(),g("div",{key:G.name,onClick:U=>k(G),class:J(["glass rounded-xl p-4 cursor-pointer hover:bg-cardHover transition border",((ue=n.value)==null?void 0:ue.name)===G.name?"border-accent":"border-transparent"])},[r("div",gc,[r("div",vc,[r("div",yc,[r("span",bc,_(G.name),1),r("span",{class:"type-badge",style:Lt(w(C(G.source)))},_(C(G.source)),5),G.replacesOrchestrator?(h(),g("span",_c,"REPLACES ORCH")):q("",!0)]),r("div",wc,[(h(!0),g(te,null,be(G.triggers||[],U=>(h(),g("span",{key:U,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},_(U),1))),128))])]),r("div",{class:"text-xs text-muted font-mono shrink-0 max-w-[200px] truncate",title:G.source||""},_((G.source||"").split(/[\\/]/).pop()||""),9,kc)])],10,hc)}),128))]))]),n.value?(h(),g("div",Sc,[r("div",Cc,[r("div",null,[r("h3",$c,"Edit: "+_(n.value.name),1),r("p",Tc,_(n.value.source||"(unknown source)"),1)]),r("div",Ec,[c.value?(h(),g("span",Ac,_(c.value),1)):q("",!0),u.value?(h(),g("span",Ic,_(u.value),1)):q("",!0),C(n.value.source)==="user"?(h(),g("button",{key:2,onClick:se,class:"px-4 py-2 rounded-xl bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-sm text-textSecondary hover:text-red-400 transition",title:"Remove user override (reverts to default)"},"Remove override")):q("",!0),r("button",{onClick:P,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Close"),r("button",{onClick:V,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),r("div",Pc,[r("div",null,[N[13]||(N[13]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),r("input",{value:n.value.name,type:"text",readonly:"",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono opacity-60 cursor-not-allowed"},null,8,Mc)]),r("div",null,[N[14]||(N[14]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),ee(r("input",{"onUpdate:modelValue":N[5]||(N[5]=G=>l.value=G),type:"text",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},null,512),[[re,l.value]])]),r("div",Oc,[r("label",Dc,[ee(r("input",{"onUpdate:modelValue":N[6]||(N[6]=G=>a.value=G),type:"checkbox",class:"rounded"},null,512),[[ao,a.value]]),N[15]||(N[15]=r("span",null,"Replaces orchestrator",-1))])])]),ee(r("textarea",{"onUpdate:modelValue":N[7]||(N[7]=G=>o.value=G),rows:"20",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Skill body (markdown)..."},null,512),[[re,o.value]])])):q("",!0)]))}}),jc={class:"animate-fade-in space-y-6"},Nc={class:"glass rounded-xl p-6"},Lc={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},Uc={class:"flex items-center gap-3"},Vc={key:0,class:"mt-4 p-4 rounded-xl bg-surface border border-gray-700/50 space-y-3"},Fc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3"},Hc=["value"],Bc={class:"flex justify-end"},Kc=["disabled"],Wc={key:0,class:"text-center py-12 text-textSecondary"},zc={key:1,class:"text-center py-8 text-danger text-sm"},Jc={key:2,class:"text-center py-12 text-textSecondary"},qc={key:3},Gc={class:"space-y-3"},Yc={class:"p-4"},Zc={class:"flex flex-wrap items-center gap-3"},Qc=["onBlur"],Xc=["onDblclick"],eu={class:"text-xs text-muted font-mono"},tu=["value","onChange"],su=["value"],nu={class:"text-xs text-muted"},ou=["onKeyup","onBlur"],ru=["title","onDblclick"],lu={class:"ml-auto flex items-center gap-3"},iu=["onClick","disabled"],au={class:"flex items-center gap-1.5"},cu=["onClick"],uu={class:"flex items-center gap-1.5"},du=["onClick"],fu={class:"flex items-center gap-1.5"},pu=["onClick"],mu=["onClick"],xu=["onClick"],hu=["onClick"],gu={key:0,class:"mt-3 p-3 rounded-lg bg-surface border border-purple-500/20 space-y-2"},vu={class:"grid grid-cols-1 sm:grid-cols-3 gap-2"},yu=["value"],bu={class:"flex items-center gap-2"},_u=["onClick","disabled"],wu={key:0,class:"border-t border-gray-700/30 bg-surface/30 px-4 py-3 space-y-2"},ku={key:0,class:"text-xs text-muted py-1"},Su={class:"text-sm font-medium"},Cu={class:"text-xs text-muted font-mono"},$u=["value","onChange"],Tu=["value"],Eu={class:"text-xs text-muted"},Au=["onBlur","onKeyup"],Iu=["title","onDblclick"],Pu={class:"ml-auto flex items-center gap-3"},Mu=["onClick","disabled"],Ou=["onClick","disabled"],Du=["onClick","disabled"],Ru={key:2,class:"flex items-center gap-1.5"},ju=["onClick"],Nu={key:3,class:"flex items-center gap-1.5"},Lu=["onClick"],Uu={key:4,class:"flex items-center gap-1.5"},Vu=["onClick"],Fu=["onClick"],Hu={key:4},Bu={class:"space-y-2"},Ku={class:"font-medium"},Wu={class:"text-xs text-muted font-mono"},zu={class:"text-xs text-textSecondary"},Ju={class:"text-xs text-muted"},qu={class:"ml-auto flex items-center gap-2"},Gu=["onClick","disabled"],Yu=["onClick","disabled"],Zu=["onClick"],Qu={key:5},Xu={class:"space-y-2"},ed={class:"font-medium"},td={class:"text-xs text-muted font-mono"},sd=["value","onChange"],nd=["value"],od={class:"text-xs text-muted"},rd=["onBlur","onKeyup"],ld=["title","onDblclick"],id={class:"ml-auto flex items-center gap-3"},ad=["onClick","disabled"],cd=["onClick","disabled"],ud={class:"flex items-center gap-1.5"},dd=["onClick"],fd={class:"flex items-center gap-1.5"},pd=["onClick"],md={class:"flex items-center gap-1.5"},xd=["onClick"],hd=["onClick"],gd={key:6},vd={class:"space-y-2"},yd={class:"font-medium"},bd={class:"text-xs text-muted font-mono"},_d=["value","onChange"],wd=["value"],kd={class:"text-xs text-muted"},Sd=vt({__name:"ThreadsTab",setup(e){const t=E([]),s=E(!0),n=E(""),o=E({}),l=E(new Set),a=E(!1),c=E({name:"",threadId:0,client:"claude",workingDirectory:""}),u=E(""),x=E(!1),d=E(null),m=E(""),y=E(null),T=E(""),B=E(null),C=E({name:"",threadId:0,client:"claude",workingDirectory:""}),w=E(""),k=E(!1),P=E(null),H=E(null),V=E(null),se=["claude","copilot","codex","openai_codex","copilot_claude","copilot_codex","cursor"],ne={root:{emoji:"🟢",classes:"bg-green-500/20 text-green-400 border-green-500/30"},daily:{emoji:"🔵",classes:"bg-blue-500/20 text-blue-400 border-blue-500/30"},branch:{emoji:"🟣",classes:"bg-purple-500/20 text-purple-400 border-purple-500/30"},worker:{emoji:"🟡",classes:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30"}},W=Fe(()=>t.value.filter(D=>D.type==="root")),N=Fe(()=>t.value.filter(D=>D.type==="daily")),G=Fe(()=>t.value.filter(D=>D.type==="branch")),ue=Fe(()=>t.value.filter(D=>D.type==="worker"));async function U(){s.value=!0,n.value="";try{const D=await ye("/api/threads");t.value=D.threads??[]}catch(D){n.value=D.message||"Failed to load threads"}finally{s.value=!1}}async function R(D){try{const b=await ye(`/api/threads/${D}/children`);o.value[D]=b.threads??[]}catch{o.value[D]=[]}}function K(D){l.value.has(D)?l.value.delete(D):(l.value.add(D),R(D))}async function oe(){if(!(!c.value.name.trim()||!c.value.threadId)){x.value=!0,u.value="";try{const D=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:c.value.threadId,name:c.value.name.trim(),type:"root",client:c.value.client,keepAlive:!0,...c.value.workingDirectory.trim()?{workingDirectory:c.value.workingDirectory.trim()}:{}})});if(!D.ok){const b=await D.json().catch(()=>({error:D.statusText}));throw new Error(b.error??D.statusText)}u.value="Created ✓",c.value={name:"",threadId:0,client:"claude",workingDirectory:""},a.value=!1,setTimeout(()=>{u.value=""},3e3),await U()}catch(D){u.value="Error: "+D.message}finally{x.value=!1}}}async function ve(D){if(!(!C.value.name.trim()||!C.value.threadId)){k.value=!0,w.value="";try{const b=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:C.value.threadId,name:C.value.name.trim(),type:"branch",rootThreadId:D,client:C.value.client,...C.value.workingDirectory.trim()?{workingDirectory:C.value.workingDirectory.trim()}:{}})});if(!b.ok){const i=await b.json().catch(()=>({error:b.statusText}));throw new Error(i.error??b.statusText)}w.value="Branch created ✓",C.value={name:"",threadId:0,client:"claude",workingDirectory:""},B.value=null,setTimeout(()=>{w.value=""},3e3),await U(),R(D)}catch(b){w.value="Error: "+b.message}finally{k.value=!1}}}function Se(D){d.value=D.threadId,m.value=D.name}async function pe(D){const b=m.value.trim();if(d.value=null,!!b)try{const i=await fetch(`/api/threads/${D}`,{method:"PATCH",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({name:b})});if(!i.ok)throw new Error(i.statusText);await U()}catch(i){n.value="Failed to rename thread: "+i.message}}function le(D){y.value=D.threadId,T.value=D.workingDirectory??""}async function F(D){const b=T.value.trim();y.value=null;try{const i=await fetch(`/api/threads/${D}`,{method:"PATCH",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({workingDirectory:b||null})});if(!i.ok)throw new Error(i.statusText);await U()}catch(i){n.value="Failed to update working directory: "+i.message}}async function M(D){try{const b=await fetch(`/api/threads/${D.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({keepAlive:!D.keepAlive})});if(!b.ok)throw new Error(b.statusText);await U()}catch(b){n.value="Failed to toggle keep-alive: "+b.message}}async function $e(D,b){try{const i=await fetch(`/api/threads/${D.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({client:b})});if(!i.ok)throw new Error(i.statusText);await U()}catch(i){n.value="Failed to change agent type: "+i.message}}async function ke(D){try{const b=await fetch(`/api/threads/${D.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({dailyRotation:!D.dailyRotation})});if(!b.ok)throw new Error(b.statusText);await U()}catch(b){n.value="Failed to toggle daily rotation: "+b.message}}async function de(D){try{const b=await fetch(`/api/threads/${D.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({autonomousMode:!D.autonomousMode})});if(!b.ok)throw new Error(b.statusText);await U()}catch(b){n.value="Failed to toggle autonomous mode: "+b.message}}async function We(D){if(confirm(`Archive thread "${D.name}" (${D.threadId})?`))try{const b=await fetch(`/api/threads/${D.threadId}`,{method:"DELETE",headers:{Authorization:`Bearer ${_e()}`}});if(!b.ok)throw new Error(b.statusText);await U()}catch(b){n.value="Failed to archive: "+b.message}}async function It(D){if(confirm(`Start thread "${D.name}" (${D.threadId})?`)){P.value=D.threadId;try{const b=await fetch(`/api/threads/${D.threadId}/start`,{method:"POST",headers:{Authorization:`Bearer ${_e()}`}});if(!b.ok){const i=await b.json().catch(()=>({error:b.statusText}));throw new Error(i.error??b.statusText)}await U()}catch(b){n.value="Failed to start thread: "+b.message}finally{P.value=null}}}function it(D){u.value="Sync to Root — not yet implemented",setTimeout(()=>{u.value=""},3e3)}async function Pt(D){if(confirm(`Convert "${D.name}" to a root thread? This will detach it from its parent.`)){V.value=D.threadId;try{const b=await fetch(`/api/threads/${D.threadId}/convert-to-root`,{method:"POST",headers:{Authorization:`Bearer ${_e()}`}});if(!b.ok){const i=await b.json().catch(()=>({error:b.statusText}));throw new Error(i.error??b.statusText)}n.value="",u.value=`Converted "${D.name}" to root ✓`,setTimeout(()=>{u.value=""},3e3),await U()}catch(b){n.value="Failed to convert: "+b.message}finally{V.value=null}}}function at(D){if(!D)return"—";const b=new Date(D),p=Date.now()-b.getTime();return p<6e4?"just now":p<36e5?`${Math.floor(p/6e4)}m ago`:p<864e5?`${Math.floor(p/36e5)}h ago`:b.toLocaleDateString()}function bt(D){return D==="active"?"text-success":D==="archived"?"text-muted":"text-warn"}return lt(U),(D,b)=>(h(),g("div",jc,[r("div",Nc,[r("div",Lc,[b[18]||(b[18]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Thread Registry"),r("p",{class:"text-sm text-textSecondary mt-1"},"Manage conversation threads, branches, and daily sessions")],-1)),r("div",Uc,[u.value?(h(),g("span",{key:0,class:J([u.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},_(u.value),3)):q("",!0),r("button",{onClick:b[0]||(b[0]=i=>a.value=!a.value),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},_(a.value?"Cancel":"+ New Root Thread"),1),r("button",{onClick:U,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),a.value?(h(),g("div",Vc,[r("div",Fc,[r("div",null,[b[19]||(b[19]=r("label",{class:"block text-xs text-textSecondary mb-1"},"Name",-1)),ee(r("input",{"onUpdate:modelValue":b[1]||(b[1]=i=>c.value.name=i),type:"text",placeholder:"e.g. Main Workspace",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[re,c.value.name]])]),r("div",null,[b[20]||(b[20]=r("label",{class:"block text-xs text-textSecondary mb-1"},"Thread ID",-1)),ee(r("input",{"onUpdate:modelValue":b[2]||(b[2]=i=>c.value.threadId=i),type:"number",min:"1",placeholder:"Telegram thread ID",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[re,c.value.threadId,void 0,{number:!0}]])]),r("div",null,[b[21]||(b[21]=r("label",{class:"block text-xs text-textSecondary mb-1"},"Client",-1)),ee(r("select",{"onUpdate:modelValue":b[3]||(b[3]=i=>c.value.client=i),class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition appearance-none"},[(h(),g(te,null,be(se,i=>r("option",{key:i,value:i},_(i),9,Hc)),64))],512),[[Ht,c.value.client]])])]),r("div",null,[b[22]||(b[22]=r("label",{class:"block text-xs text-textSecondary mb-1"},"Working Directory (optional)",-1)),ee(r("input",{"onUpdate:modelValue":b[4]||(b[4]=i=>c.value.workingDirectory=i),type:"text",placeholder:"e.g. C:\\src\\my-project",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition font-mono"},null,512),[[re,c.value.workingDirectory]])]),r("div",Bc,[r("button",{onClick:oe,disabled:x.value||!c.value.name.trim()||!c.value.threadId,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},_(x.value?"Creating…":"Create Root Thread"),9,Kc)])])):q("",!0)]),s.value&&t.value.length===0?(h(),g("div",Wc,"Loading threads…")):n.value?(h(),g("div",zc,_(n.value),1)):t.value.length===0?(h(),g("div",Jc,"No threads registered")):q("",!0),W.value.length>0?(h(),g("div",qc,[b[29]||(b[29]=r("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟢 Root Threads",-1)),r("div",Gc,[(h(!0),g(te,null,be(W.value,i=>{var p,v;return h(),g("div",{key:i.id,class:"glass rounded-xl overflow-hidden"},[r("div",Yc,[r("div",Zc,[r("span",{class:J(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(p=ne[i.type])==null?void 0:p.classes])},_((v=ne[i.type])==null?void 0:v.emoji)+" "+_(i.type.toUpperCase()),3),d.value===i.threadId?ee((h(),g("input",{key:0,"onUpdate:modelValue":b[5]||(b[5]=f=>m.value=f),onBlur:f=>pe(i.threadId),onKeyup:[b[6]||(b[6]=Ze(f=>f.target.blur(),["enter"])),b[7]||(b[7]=Ze(f=>d.value=null,["escape"]))],class:"font-semibold bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-40",ref_for:!0,ref:"nameInput"},null,40,Qc)),[[re,m.value]]):(h(),g("span",{key:1,class:"font-semibold cursor-pointer hover:text-accent transition",onDblclick:f=>Se(i),title:"Double-click to rename"},_(i.name),41,Xc)),r("span",{class:J(["text-xs font-medium",bt(i.status)])},_(i.status),3),r("span",eu,"ID: "+_(i.threadId),1),r("select",{value:i.client,onChange:f=>$e(i,f.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(h(),g(te,null,be(se,f=>r("option",{key:f,value:f},_(f),9,su)),64))],40,tu),r("span",nu,_(at(i.lastActiveAt)),1),y.value===i.threadId?ee((h(),g("input",{key:2,"onUpdate:modelValue":b[8]||(b[8]=f=>T.value=f),onKeyup:[Ze(f=>F(i.threadId),["enter"]),b[9]||(b[9]=Ze(f=>y.value=null,["escape"]))],onBlur:f=>F(i.threadId),type:"text",placeholder:"Set working directory…",class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-48"},null,40,ou)),[[re,T.value]]):(h(),g("span",{key:3,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(i.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:f=>le(i)},"📁 "+_(i.workingDirectory??"—"),41,ru)),r("div",lu,[r("button",{onClick:f=>It(i),disabled:P.value===i.threadId||i.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},_(P.value===i.threadId?"Starting…":"▶ Start"),9,iu),r("div",au,[r("button",{onClick:f=>M(i),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,cu),b[23]||(b[23]=r("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),r("div",uu,[r("button",{onClick:f=>ke(i),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,du),b[24]||(b[24]=r("span",{class:"text-xs text-muted"},"Daily",-1))]),r("div",fu,[r("button",{onClick:f=>de(i),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,pu),b[25]||(b[25]=r("span",{class:"text-xs text-muted"},"Auto",-1))]),r("button",{onClick:f=>K(i.threadId),class:"px-2 py-1 rounded-lg text-xs bg-card border border-gray-700 hover:bg-surface transition"},_(l.value.has(i.threadId)?"▾ Children":"▸ Children"),9,mu),r("button",{onClick:f=>{B.value=B.value===i.threadId?null:i.threadId,C.value={name:"",threadId:0,client:"claude",workingDirectory:""},w.value=""},class:"px-2 py-1 rounded-lg text-xs bg-purple-500/20 text-purple-400 border border-purple-500/30 hover:bg-purple-500/30 transition"}," + Branch ",8,xu),r("button",{onClick:f=>We(i),class:"px-2 py-1 rounded-lg text-xs bg-red-500/20 text-red-400 border border-red-500/30 hover:bg-red-500/30 transition"}," Archive ",8,hu)])]),B.value===i.threadId?(h(),g("div",gu,[r("div",vu,[ee(r("input",{"onUpdate:modelValue":b[10]||(b[10]=f=>C.value.name=f),type:"text",placeholder:"Branch name",class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[re,C.value.name]]),ee(r("input",{"onUpdate:modelValue":b[11]||(b[11]=f=>C.value.threadId=f),type:"number",min:"1",placeholder:"Thread ID",class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[re,C.value.threadId,void 0,{number:!0}]]),ee(r("select",{"onUpdate:modelValue":b[12]||(b[12]=f=>C.value.client=f),class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition appearance-none"},[(h(),g(te,null,be(se,f=>r("option",{key:f,value:f},_(f),9,yu)),64))],512),[[Ht,C.value.client]])]),ee(r("input",{"onUpdate:modelValue":b[13]||(b[13]=f=>C.value.workingDirectory=f),type:"text",placeholder:"Working directory (optional)",class:"w-full px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition font-mono"},null,512),[[re,C.value.workingDirectory]]),r("div",bu,[r("button",{onClick:f=>ve(i.threadId),disabled:k.value||!C.value.name.trim()||!C.value.threadId,class:"px-3 py-1.5 rounded-lg bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-xs font-medium transition"},_(k.value?"Creating…":"Create Branch"),9,_u),w.value?(h(),g("span",{key:0,class:J([w.value.startsWith("Error")?"text-danger":"text-success","text-xs"])},_(w.value),3)):q("",!0)])])):q("",!0)]),l.value.has(i.threadId)&&o.value[i.threadId]?(h(),g("div",wu,[o.value[i.threadId].length===0?(h(),g("div",ku,"No children")):q("",!0),(h(!0),g(te,null,be(o.value[i.threadId],f=>{var S,$;return h(),g("div",{key:f.id,class:"flex flex-wrap items-center gap-2 px-3 py-2 rounded-lg bg-card/50 border border-gray-700/30"},[r("span",{class:J(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-xs font-medium border",(S=ne[f.type])==null?void 0:S.classes])},_(($=ne[f.type])==null?void 0:$.emoji)+" "+_(f.type.toUpperCase()),3),r("span",Su,_(f.name),1),r("span",{class:J(["text-xs",bt(f.status)])},_(f.status),3),r("span",Cu,"ID: "+_(f.threadId),1),r("select",{value:f.client,onChange:I=>$e(f,I.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(h(),g(te,null,be(se,I=>r("option",{key:I,value:I},_(I),9,Tu)),64))],40,$u),r("span",Eu,_(at(f.lastActiveAt)),1),f.type==="branch"&&y.value===f.threadId?ee((h(),g("input",{key:0,"onUpdate:modelValue":b[14]||(b[14]=I=>T.value=I),onBlur:I=>F(f.threadId),onKeyup:[Ze(I=>F(f.threadId),["enter"]),b[15]||(b[15]=Ze(I=>y.value=null,["escape"]))],type:"text",placeholder:"Set working directory…",class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-48"},null,40,Au)),[[re,T.value]]):f.type==="branch"?(h(),g("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(f.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:I=>le(f)},"📁 "+_(f.workingDirectory??"—"),41,Iu)):q("",!0),r("div",Pu,[r("button",{onClick:I=>It(f),disabled:P.value===f.threadId||f.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},_(P.value===f.threadId?"Starting…":"▶ Start"),9,Mu),f.rootThreadId?(h(),g("button",{key:0,onClick:I=>it(),disabled:H.value===f.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},_(H.value===f.threadId?"Syncing…":"⟳ Sync to Root"),9,Ou)):q("",!0),f.type==="branch"||f.type==="daily"?(h(),g("button",{key:1,onClick:I=>Pt(f),disabled:V.value===f.threadId,class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Convert to independent root thread"},_(V.value===f.threadId?"Converting…":"↑ To Root"),9,Du)):q("",!0),f.type==="branch"?(h(),g("div",Ru,[r("button",{onClick:I=>M(f),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",f.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",f.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,ju),b[26]||(b[26]=r("span",{class:"text-xs text-muted"},"Keep-alive",-1))])):q("",!0),f.type==="branch"?(h(),g("div",Nu,[r("button",{onClick:I=>ke(f),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",f.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",f.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,Lu),b[27]||(b[27]=r("span",{class:"text-xs text-muted"},"Daily",-1))])):q("",!0),f.type==="branch"?(h(),g("div",Uu,[r("button",{onClick:I=>de(f),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",f.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",f.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,Vu),b[28]||(b[28]=r("span",{class:"text-xs text-muted"},"Auto",-1))])):q("",!0),f.type!=="root"?(h(),g("button",{key:5,onClick:I=>We(f),class:"px-2 py-0.5 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,Fu)):q("",!0)])])}),128))])):q("",!0)])}),128))])])):q("",!0),N.value.length>0?(h(),g("div",Hu,[b[30]||(b[30]=r("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🔵 Daily Sessions",-1)),r("div",Bu,[(h(!0),g(te,null,be(N.value,i=>{var p,v;return h(),g("div",{key:i.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[r("span",{class:J(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(p=ne[i.type])==null?void 0:p.classes])},_((v=ne[i.type])==null?void 0:v.emoji)+" "+_(i.type.toUpperCase()),3),r("span",Ku,_(i.name),1),r("span",{class:J(["text-xs font-medium",bt(i.status)])},_(i.status),3),r("span",Wu,"ID: "+_(i.threadId),1),r("span",zu,_(i.client),1),r("span",Ju,_(at(i.lastActiveAt)),1),r("div",qu,[r("button",{onClick:f=>It(i),disabled:P.value===i.threadId||i.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},_(P.value===i.threadId?"Starting…":"▶ Start"),9,Gu),i.rootThreadId?(h(),g("button",{key:0,onClick:f=>it(),disabled:H.value===i.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},_(H.value===i.threadId?"Syncing…":"⟳ Sync to Root"),9,Yu)):q("",!0),r("button",{onClick:f=>We(i),class:"px-2 py-1 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,Zu)])])}),128))])])):q("",!0),G.value.length>0?(h(),g("div",Qu,[b[34]||(b[34]=r("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟣 Branches",-1)),r("div",Xu,[(h(!0),g(te,null,be(G.value,i=>{var p,v;return h(),g("div",{key:i.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[r("span",{class:J(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(p=ne[i.type])==null?void 0:p.classes])},_((v=ne[i.type])==null?void 0:v.emoji)+" "+_(i.type.toUpperCase()),3),r("span",ed,_(i.name),1),r("span",{class:J(["text-xs font-medium",bt(i.status)])},_(i.status),3),r("span",td,"ID: "+_(i.threadId),1),r("select",{value:i.client,onChange:f=>$e(i,f.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(h(),g(te,null,be(se,f=>r("option",{key:f,value:f},_(f),9,nd)),64))],40,sd),r("span",od,_(at(i.lastActiveAt)),1),y.value===i.threadId?ee((h(),g("input",{key:0,"onUpdate:modelValue":b[16]||(b[16]=f=>T.value=f),onBlur:f=>F(i.threadId),onKeyup:[Ze(f=>F(i.threadId),["enter"]),b[17]||(b[17]=Ze(f=>y.value=null,["escape"]))],type:"text",placeholder:"Set working directory…",class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-48"},null,40,rd)),[[re,T.value]]):(h(),g("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(i.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:f=>le(i)},"📁 "+_(i.workingDirectory??"—"),41,ld)),r("div",id,[r("button",{onClick:f=>It(i),disabled:P.value===i.threadId||i.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},_(P.value===i.threadId?"Starting…":"▶ Start"),9,ad),i.rootThreadId?(h(),g("button",{key:0,onClick:f=>it(),disabled:H.value===i.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},_(H.value===i.threadId?"Syncing…":"⟳ Sync to Root"),9,cd)):q("",!0),r("div",ud,[r("button",{onClick:f=>M(i),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,dd),b[31]||(b[31]=r("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),r("div",fd,[r("button",{onClick:f=>ke(i),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,pd),b[32]||(b[32]=r("span",{class:"text-xs text-muted"},"Daily",-1))]),r("div",md,[r("button",{onClick:f=>de(i),class:J(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[r("span",{class:J(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,xd),b[33]||(b[33]=r("span",{class:"text-xs text-muted"},"Auto",-1))]),r("button",{onClick:f=>We(i),class:"px-2 py-1 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,hd)])])}),128))])])):q("",!0),ue.value.length>0?(h(),g("div",gd,[b[36]||(b[36]=r("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟡 Workers",-1)),r("div",vd,[(h(!0),g(te,null,be(ue.value,i=>{var p,v;return h(),g("div",{key:i.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[r("span",{class:J(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(p=ne[i.type])==null?void 0:p.classes])},_((v=ne[i.type])==null?void 0:v.emoji)+" "+_(i.type.toUpperCase()),3),r("span",yd,_(i.name),1),r("span",{class:J(["text-xs font-medium",bt(i.status)])},_(i.status),3),r("span",bd,"ID: "+_(i.threadId),1),r("select",{value:i.client,onChange:f=>$e(i,f.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(h(),g(te,null,be(se,f=>r("option",{key:f,value:f},_(f),9,wd)),64))],40,_d),r("span",kd,_(at(i.lastActiveAt)),1),b[35]||(b[35]=r("span",{class:"ml-auto text-xs text-muted italic"},"auto-managed",-1))])}),128))])])):q("",!0)]))}}),Cd={class:"animate-fade-in"},$d={class:"glass rounded-xl p-6 mb-6"},Td={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ed={class:"flex items-center gap-3"},Ad={key:0,class:"text-center py-8 text-textSecondary text-sm"},Id={key:1,class:"text-center py-8 text-danger text-sm"},Pd={key:2,class:"text-center text-textSecondary py-12"},Md={key:3,class:"space-y-2"},Od={key:0,class:"glass rounded-xl p-4 border border-gray-700/50 opacity-75"},Dd={class:"flex items-center justify-between gap-3"},Rd={class:"flex items-center gap-2 min-w-0"},jd={class:"flex items-center justify-between gap-3"},Nd={class:"flex-1 min-w-0"},Ld={class:"flex items-center gap-2 mb-1"},Ud={class:"font-medium text-sm font-mono"},Vd={class:"text-xs text-muted font-mono truncate"},Fd={class:"flex items-center gap-2 shrink-0"},Hd=["onClick"],Bd=["onClick","disabled"],Kd={key:0,class:"glass rounded-xl p-6 border border-accent/30"},Wd={class:"text-lg font-semibold mb-4"},zd={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Jd=["readonly"],qd={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Gd={class:"mb-4"},Yd={class:"flex items-center justify-between mb-2"},Zd=["onUpdate:modelValue"],Qd=["onUpdate:modelValue"],Xd=["onClick"],ef={key:0,class:"text-xs text-muted italic"},tf={class:"mb-4"},sf={class:"mb-4"},nf={class:"flex items-center justify-between mb-2"},of=["onUpdate:modelValue"],rf=["onUpdate:modelValue"],lf=["onClick"],af={key:0,class:"text-xs text-muted italic"},cf={class:"flex items-center gap-3 flex-wrap"},uf=["disabled"],df={key:0,class:"text-sm text-danger"},Gt="sensorium-mcp",ff=vt({__name:"McpServersTab",setup(e){const t=E({}),s=E(!0),n=E(""),o=E(""),l=E(!0),a=E(!1),c=E(null),u=E(!1),x=E(null),d=E(""),m=E("stdio"),y=E(""),T=E(""),B=E(""),C=E([]),w=E([]),k=E(""),P=Fe(()=>Object.entries(t.value).filter(([U])=>U!==Gt));async function H(){s.value=!0,n.value="";try{const U=await ye("/api/mcp-servers");t.value=U.servers||{}}catch(U){n.value="Failed to load MCP servers: "+U.message}finally{s.value=!1}}function V(U){return U==="stdio"?"background:rgba(99,102,241,0.15);color:#818cf8":"background:rgba(34,197,94,0.15);color:#4ade80"}function se(){x.value=null,d.value="",m.value="stdio",y.value="",T.value="",B.value="",C.value=[],w.value=[],k.value="",u.value=!0}function ne(U,R){x.value=U,d.value=U,m.value=R.type,y.value=R.command||"",T.value=(R.args||[]).join(" "),B.value=R.url||"",C.value=Object.entries(R.env||{}).map(([K,oe])=>({k:K,v:oe})),w.value=Object.entries(R.headers||{}).map(([K,oe])=>({k:K,v:oe})),k.value="",u.value=!0}function W(){u.value=!1,x.value=null}function N(){if(k.value="",!d.value.trim())return k.value="Name is required",!1;if(m.value==="stdio"&&!y.value.trim())return k.value="Command is required for stdio type",!1;if(m.value==="http"){const U=B.value.trim();if(!U)return k.value="URL is required for http type",!1;if(!/^https?:\/\/.+/.test(U))return k.value="URL must start with http:// or https://",!1}return!0}async function G(){if(!N()||a.value)return;a.value=!0;const U=d.value.trim(),R={type:m.value};if(m.value==="stdio"){R.command=y.value.trim();const K=T.value.trim();K&&(R.args=K.split(/\s+/));const oe=Object.fromEntries(C.value.filter(ve=>ve.k.trim()).map(ve=>[ve.k.trim(),ve.v]));Object.keys(oe).length&&(R.env=oe)}else{R.url=B.value.trim();const K=Object.fromEntries(w.value.filter(oe=>oe.k.trim()).map(oe=>[oe.k.trim(),oe.v]));Object.keys(K).length&&(R.headers=K)}try{const K=await fetch("/api/mcp-servers",{method:"POST",headers:{Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},body:JSON.stringify({name:U,config:R})});if(!K.ok)throw new Error(K.statusText);o.value="Saved ✓",l.value=!0,setTimeout(()=>{o.value=""},3e3),W(),await H()}catch(K){k.value="Error: "+K.message}finally{a.value=!1}}async function ue(U){if(confirm(`Delete MCP server "${U}"?`)&&!c.value){c.value=U;try{const R=await fetch(`/api/mcp-servers/${encodeURIComponent(U)}`,{method:"DELETE",headers:{Authorization:`Bearer ${_e()}`}});if(!R.ok)throw new Error(R.statusText);o.value="Deleted ✓",l.value=!0,setTimeout(()=>{o.value=""},3e3),await H()}catch(R){o.value="Error: "+R.message,l.value=!1}finally{c.value=null}}}return lt(H),(U,R)=>(h(),g("div",Cd,[r("div",$d,[r("div",Td,[R[7]||(R[7]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"MCP Servers"),r("p",{class:"text-sm text-textSecondary mt-1"},"Manage external MCP server connections (stdio and HTTP)")],-1)),r("div",Ed,[o.value?(h(),g("span",{key:0,class:J(["text-sm",l.value?"text-success":"text-danger"])},_(o.value),3)):q("",!0),r("button",{onClick:se,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + Add Server ")])]),s.value?(h(),g("div",Ad,"Loading...")):n.value?(h(),g("div",Id,_(n.value),1)):Object.keys(t.value).length===0?(h(),g("div",Pd,"No MCP servers configured")):(h(),g("div",Md,[t.value[Gt]?(h(),g("div",Od,[r("div",Dd,[r("div",Rd,[r("span",{class:"font-medium text-sm font-mono"},_(Gt)),r("span",{class:"type-badge",style:Lt(V(t.value[Gt].type))},_(t.value[Gt].type),5),R[8]||(R[8]=r("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"built-in",-1))]),R[9]||(R[9]=r("span",{class:"text-xs text-muted italic"},"read-only",-1))])])):q("",!0),(h(!0),g(te,null,be(P.value,([K,oe])=>{var ve;return h(),g("div",{key:K,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[r("div",jd,[r("div",Nd,[r("div",Ld,[r("span",Ud,_(K),1),r("span",{class:"type-badge",style:Lt(V(oe.type))},_(oe.type),5)]),r("div",Vd,[oe.type==="stdio"?(h(),g(te,{key:0},[we(_(oe.command)+_((ve=oe.args)!=null&&ve.length?" "+oe.args.join(" "):""),1)],64)):(h(),g(te,{key:1},[we(_(oe.url),1)],64))])]),r("div",Fd,[r("button",{onClick:Se=>ne(K,oe),class:"px-3 py-1.5 rounded-lg bg-card hover:bg-cardHover border border-gray-700 text-xs text-textSecondary hover:text-textPrimary transition"},"Edit",8,Hd),r("button",{onClick:Se=>ue(K),disabled:c.value===K,class:"px-3 py-1.5 rounded-lg bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-xs text-textSecondary hover:text-red-400 transition disabled:opacity-50"},_(c.value===K?"…":"Delete"),9,Bd)])])])}),128))]))]),u.value?(h(),g("div",Kd,[r("h3",Wd,_(x.value?`Edit: ${x.value}`:"Add MCP Server"),1),r("div",zd,[r("div",null,[R[10]||(R[10]=r("label",{class:"text-xs text-textSecondary block mb-1"},[we("Name "),r("span",{class:"text-danger"},"*")],-1)),ee(r("input",{"onUpdate:modelValue":R[0]||(R[0]=K=>d.value=K),type:"text",readonly:!!x.value,placeholder:"my-server",class:J(["w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition",x.value?"opacity-60 cursor-not-allowed":""])},null,10,Jd),[[re,d.value]])]),r("div",null,[R[12]||(R[12]=r("label",{class:"text-xs text-textSecondary block mb-1"},[we("Type "),r("span",{class:"text-danger"},"*")],-1)),ee(r("select",{"onUpdate:modelValue":R[1]||(R[1]=K=>m.value=K),class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...R[11]||(R[11]=[r("option",{value:"stdio"},"stdio",-1),r("option",{value:"http"},"http",-1)])],512),[[Ht,m.value]])])]),m.value==="stdio"?(h(),g(te,{key:0},[r("div",qd,[r("div",null,[R[13]||(R[13]=r("label",{class:"text-xs text-textSecondary block mb-1"},[we("Command "),r("span",{class:"text-danger"},"*")],-1)),ee(r("input",{"onUpdate:modelValue":R[2]||(R[2]=K=>y.value=K),type:"text",placeholder:"node",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,y.value]])]),r("div",null,[R[14]||(R[14]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Args (space-separated)",-1)),ee(r("input",{"onUpdate:modelValue":R[3]||(R[3]=K=>T.value=K),type:"text",placeholder:"./server.js --port 3000",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,T.value]])])]),r("div",Gd,[r("div",Yd,[R[15]||(R[15]=r("label",{class:"text-xs text-textSecondary"},"Environment Variables",-1)),r("button",{onClick:R[4]||(R[4]=K=>C.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(h(!0),g(te,null,be(C.value,(K,oe)=>(h(),g("div",{key:oe,class:"flex items-center gap-2 mb-2"},[ee(r("input",{"onUpdate:modelValue":ve=>K.k=ve,type:"text",placeholder:"KEY",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,Zd),[[re,K.k]]),R[16]||(R[16]=r("span",{class:"text-muted text-xs"},"=",-1)),ee(r("input",{"onUpdate:modelValue":ve=>K.v=ve,type:"text",placeholder:"value",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,Qd),[[re,K.v]]),r("button",{onClick:ve=>C.value.splice(oe,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Xd)]))),128)),C.value.length===0?(h(),g("div",ef,"No env vars")):q("",!0)])],64)):(h(),g(te,{key:1},[r("div",tf,[R[17]||(R[17]=r("label",{class:"text-xs text-textSecondary block mb-1"},[we("URL "),r("span",{class:"text-danger"},"*")],-1)),ee(r("input",{"onUpdate:modelValue":R[5]||(R[5]=K=>B.value=K),type:"text",placeholder:"http://localhost:3000/mcp",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,B.value]])]),r("div",sf,[r("div",nf,[R[18]||(R[18]=r("label",{class:"text-xs text-textSecondary"},"Headers",-1)),r("button",{onClick:R[6]||(R[6]=K=>w.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(h(!0),g(te,null,be(w.value,(K,oe)=>(h(),g("div",{key:oe,class:"flex items-center gap-2 mb-2"},[ee(r("input",{"onUpdate:modelValue":ve=>K.k=ve,type:"text",placeholder:"Header-Name",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,of),[[re,K.k]]),R[19]||(R[19]=r("span",{class:"text-muted text-xs"},":",-1)),ee(r("input",{"onUpdate:modelValue":ve=>K.v=ve,type:"text",placeholder:"value",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,rf),[[re,K.v]]),r("button",{onClick:ve=>w.value.splice(oe,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,lf)]))),128)),w.value.length===0?(h(),g("div",af,"No headers")):q("",!0)])],64)),r("div",cf,[r("button",{onClick:G,disabled:a.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},_(a.value?"Saving…":x.value?"Save Changes":"Add Server"),9,uf),r("button",{onClick:W,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"}," Cancel "),k.value?(h(),g("span",df,_(k.value),1)):q("",!0)])])):q("",!0)]))}}),pf={class:"animate-fade-in"},mf={class:"glass rounded-xl p-6 mb-6"},xf={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},hf={class:"flex items-center gap-3"},gf=["disabled"],vf={key:0,class:"text-center py-8 text-textSecondary text-sm"},yf={key:1,class:"space-y-6"},bf={class:"glass rounded-xl p-4 border border-gray-700/50"},_f={class:"flex items-center gap-4"},wf={class:"flex justify-between text-xs text-muted mt-2"},kf={class:"font-mono"},Sf={key:0,class:"mt-3 px-3 py-2 rounded-lg bg-warn/10 border border-warn/20 text-xs text-warn"},Cf={class:"glass rounded-xl p-4 border border-gray-700/50"},$f={class:"flex items-center gap-4"},Tf={class:"flex justify-between text-xs text-muted mt-2"},Ef={class:"font-mono"},Af={class:"glass rounded-xl p-4 border border-gray-700/50"},If={class:"glass rounded-xl p-4 border border-gray-700/50"},Pf={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},Mf={class:"grid grid-cols-2 gap-4"},Of={class:"text-sm font-medium text-textSecondary"},Df={class:"text-sm font-medium font-mono text-textSecondary"},Rf={class:"text-sm font-medium font-mono text-textSecondary"},jf={class:"mt-3"},Nf=vt({__name:"SettingsTab",setup(e){const t=E(!0),s=E(!1),n=E(""),o=E(50),l=E(50),a=E(1440),c=E(1440),u=E("claude-opus-4-6"),x=E("claude-opus-4-6"),d=E("claude-sonnet-4-5"),m=E("claude-sonnet-4-5"),y=Fe(()=>o.value!==l.value||a.value!==c.value||u.value!==x.value||d.value!==m.value);async function T(){t.value=!0;try{const[C,w,k,P]=await Promise.all([ye("/api/settings/bootstrap-message-count"),ye("/api/settings/wait-timeout"),ye("/api/settings/default-thread-model"),ye("/api/settings/default-worker-model")]);o.value=C.count,l.value=C.count,a.value=w.minutes,c.value=w.minutes,u.value=k.defaultThreadModel,x.value=k.defaultThreadModel,d.value=P.defaultWorkerModel,m.value=P.defaultWorkerModel}finally{t.value=!1}}async function B(){if(s.value=!0,n.value="",!u.value){n.value="Error: Thread model cannot be empty",s.value=!1;return}if(!d.value){n.value="Error: Worker model cannot be empty",s.value=!1;return}try{const C={Authorization:`Bearer ${_e()}`,"Content-Type":"application/json"},[w,k,P,H]=await Promise.all([fetch("/api/settings/bootstrap-message-count",{method:"POST",headers:C,body:JSON.stringify({count:o.value})}),fetch("/api/settings/wait-timeout",{method:"POST",headers:C,body:JSON.stringify({minutes:a.value})}),fetch("/api/settings/default-thread-model",{method:"POST",headers:C,body:JSON.stringify({model:u.value})}),fetch("/api/settings/default-worker-model",{method:"POST",headers:C,body:JSON.stringify({model:d.value})})]);for(const N of[w,k,P,H])if(!N.ok){const G=await N.json().catch(()=>({error:N.statusText}));throw new Error(G.error??N.statusText)}const V=await w.json(),se=await k.json(),ne=await P.json(),W=await H.json();l.value=V.count,o.value=V.count,c.value=se.minutes,a.value=se.minutes,x.value=ne.defaultThreadModel,u.value=ne.defaultThreadModel,m.value=W.defaultWorkerModel,d.value=W.defaultWorkerModel,n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3)}catch(C){n.value="Error: "+C.message}finally{s.value=!1}}return lt(T),(C,w)=>(h(),g("div",pf,[r("div",mf,[r("div",xf,[w[6]||(w[6]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Settings"),r("p",{class:"text-sm text-textSecondary mt-1"},"Configure agent behavior and context injection")],-1)),r("div",hf,[n.value?(h(),g("span",{key:0,class:J([n.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},_(n.value),3)):q("",!0),r("button",{onClick:B,disabled:s.value||t.value||!y.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},_(s.value?"Saving…":"Save"),9,gf)])]),t.value?(h(),g("div",vf,"Loading…")):(h(),g("div",yf,[r("div",bf,[w[10]||(w[10]=r("label",{class:"block text-sm font-medium mb-1"},"Recent Conversation Buffer",-1)),w[11]||(w[11]=r("p",{class:"text-xs text-textSecondary mb-3"},[we(" Number of recent messages injected into the agent's bootstrap context. Set to "),r("span",{class:"font-mono text-accentLight"},"0"),we(" to disable (useful when using VS Code, which maintains its own conversation history). ")],-1)),r("div",_f,[ee(r("input",{"onUpdate:modelValue":w[0]||(w[0]=k=>o.value=k),type:"range",min:"0",max:"100",step:"5",class:"flex-1 accent-accent"},null,512),[[re,o.value,void 0,{number:!0}]]),ee(r("input",{"onUpdate:modelValue":w[1]||(w[1]=k=>o.value=k),type:"number",min:"0",max:"200",class:"w-20 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono text-center focus:outline-none focus:border-accent transition"},null,512),[[re,o.value,void 0,{number:!0}]])]),r("div",wf,[w[7]||(w[7]=r("span",null,"Off",-1)),r("span",kf,_(o.value)+" messages",1),w[8]||(w[8]=r("span",null,"Max",-1))]),o.value===0?(h(),g("div",Sf,[...w[9]||(w[9]=[we(" Message buffer injection is ",-1),r("strong",null,"disabled",-1),we(". The agent will not see recent conversation history in its bootstrap context. Use this when VS Code (or another IDE) already provides conversation history. ",-1)])])):q("",!0)]),r("div",Cf,[w[14]||(w[14]=r("label",{class:"block text-sm font-medium mb-1"},"Poll Timeout (wait_for_instructions)",-1)),w[15]||(w[15]=r("p",{class:"text-xs text-textSecondary mb-3"},[we(" Maximum time (in minutes) a single "),r("span",{class:"font-mono text-accentLight"},"wait_for_instructions"),we(" call will poll before timing out. Claude Code agents use the full value; Copilot agents are capped at 10 min. ")],-1)),r("div",$f,[ee(r("input",{"onUpdate:modelValue":w[2]||(w[2]=k=>a.value=k),type:"range",min:"1",max:"1440",step:"10",class:"flex-1 accent-accent"},null,512),[[re,a.value,void 0,{number:!0}]]),ee(r("input",{"onUpdate:modelValue":w[3]||(w[3]=k=>a.value=k),type:"number",min:"1",max:"10080",class:"w-24 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono text-center focus:outline-none focus:border-accent transition"},null,512),[[re,a.value,void 0,{number:!0}]])]),r("div",Tf,[w[12]||(w[12]=r("span",null,"1 min",-1)),r("span",Ef,_(a.value>=60?Math.floor(a.value/60)+"h "+a.value%60+"m":a.value+" min"),1),w[13]||(w[13]=r("span",null,"24h",-1))])]),r("div",Af,[w[16]||(w[16]=r("label",{class:"block text-sm font-medium mb-1"},"Default Thread Model",-1)),w[17]||(w[17]=r("p",{class:"text-xs text-textSecondary mb-3"},[we(" Model used when spawning a normal (orchestrator) Claude thread. Overridden by the "),r("span",{class:"font-mono text-accentLight"},"CLAUDE_MODEL"),we(" env var if set. ")],-1)),ee(r("input",{"onUpdate:modelValue":w[4]||(w[4]=k=>u.value=k),type:"text",placeholder:"claude-opus-4-6",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,u.value,void 0,{trim:!0}]])]),r("div",If,[w[18]||(w[18]=r("label",{class:"block text-sm font-medium mb-1"},"Default Worker Model",-1)),w[19]||(w[19]=r("p",{class:"text-xs text-textSecondary mb-3"},[we(" Model used when spawning a worker Claude thread. Overridden by the "),r("span",{class:"font-mono text-accentLight"},"CLAUDE_WORKER_MODEL"),we(" env var if set. ")],-1)),ee(r("input",{"onUpdate:modelValue":w[5]||(w[5]=k=>d.value=k),type:"text",placeholder:"claude-sonnet-4-5",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,d.value,void 0,{trim:!0}]])]),r("div",Pf,[w[24]||(w[24]=r("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),r("div",Mf,[r("div",null,[w[20]||(w[20]=r("div",{class:"text-xs text-muted mb-1"},"Message Buffer",-1)),r("span",{class:J(["text-sm font-medium",l.value>0?"text-success":"text-textSecondary"])},_(l.value>0?`${l.value} messages`:"Disabled"),3)]),r("div",null,[w[21]||(w[21]=r("div",{class:"text-xs text-muted mb-1"},"Poll Timeout",-1)),r("span",Of,_(c.value>=60?Math.floor(c.value/60)+"h "+c.value%60+"m":c.value+" min"),1)]),r("div",null,[w[22]||(w[22]=r("div",{class:"text-xs text-muted mb-1"},"Thread Model",-1)),r("span",Df,_(x.value),1)]),r("div",null,[w[23]||(w[23]=r("div",{class:"text-xs text-muted mb-1"},"Worker Model",-1)),r("span",Rf,_(m.value),1)])]),r("div",jf,[r("span",{class:J(["text-sm font-medium",y.value?"text-warn":"text-textSecondary"])},_(y.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),Lf={class:"animate-fade-in"},Uf={class:"glass rounded-xl p-6 mb-6"},Vf={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ff={class:"flex flex-wrap gap-3 items-center"},Hf=["disabled"],Bf={key:0,class:"flex items-center gap-2"},Kf={key:1},Wf={class:"glass rounded-xl p-6"},zf={key:0,class:"text-center py-8 text-textSecondary text-sm"},Jf={key:1,class:"text-center py-12 text-textSecondary text-sm"},qf={key:2,class:"space-y-2"},Gf={class:"flex items-center justify-between gap-3"},Yf={class:"flex-1 min-w-0"},Zf={class:"flex flex-wrap items-center gap-2 mb-1"},Qf={class:"font-medium text-sm font-mono"},Xf={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},ep={class:"text-xs text-muted"},tp={class:"text-xs text-muted"},sp=["onClick","disabled"],np={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/80 backdrop-blur-sm"},op={class:"glass rounded-2xl p-6 max-w-sm w-full mx-4"},rp={class:"text-sm text-textSecondary mb-4"},lp={class:"font-mono text-textPrimary"},ip=vt({__name:"SnapshotsTab",setup(e){const t=E([]),s=E(!0),n=E(!1),o=E(null),l=E(""),a=E(""),c=E(!0),u=E(null);function x(k){return k<1024?`${k} B`:k<1024*1024?`${(k/1024).toFixed(1)} KB`:`${(k/(1024*1024)).toFixed(1)} MB`}function d(k){try{return new Date(k).toLocaleString()}catch{return k}}function m(k,P){a.value=k,c.value=P,setTimeout(()=>{a.value=""},4e3)}async function y(){s.value=!0;try{const k=await ye("/api/snapshots");t.value=k.snapshots}catch(k){m("Failed to load snapshots: "+k.message,!1)}finally{s.value=!1}}async function T(){if(!n.value){n.value=!0;try{await ye("/api/snapshots",{method:"POST",body:JSON.stringify({description:l.value})}),l.value="",m("Snapshot created ✓",!0),await y()}catch(k){m("Error: "+k.message,!1)}finally{n.value=!1}}}function B(k){u.value=k}function C(){u.value=null}async function w(){const k=u.value;if(!(!k||o.value)){u.value=null,o.value=k;try{await ye(`/api/snapshots/${encodeURIComponent(k)}`,{method:"DELETE"}),m("Deleted ✓",!0),await y()}catch(P){m("Error: "+P.message,!1)}finally{o.value=null}}}return lt(y),(k,P)=>(h(),g("div",Lf,[r("div",Uf,[r("div",Vf,[P[1]||(P[1]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Snapshots"),r("p",{class:"text-sm text-textSecondary mt-1"},"Create and manage data directory snapshots")],-1)),a.value?(h(),g("span",{key:0,class:J(["text-sm",c.value?"text-success":"text-danger"])},_(a.value),3)):q("",!0)]),r("div",Ff,[ee(r("input",{"onUpdate:modelValue":P[0]||(P[0]=H=>l.value=H),type:"text",placeholder:"Description (optional)",class:"flex-1 min-w-48 px-3 py-2 rounded-xl bg-surface border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition",onKeydown:Ze(T,["enter"])},null,544),[[re,l.value]]),r("button",{onClick:T,disabled:n.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition whitespace-nowrap"},[n.value?(h(),g("span",Bf,[...P[2]||(P[2]=[r("svg",{class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 12a8 8 0 018-8v8H4z"})],-1),we(" Creating… ",-1)])])):(h(),g("span",Kf,"+ Create Snapshot"))],8,Hf)])]),r("div",Wf,[s.value?(h(),g("div",zf,"Loading…")):t.value.length===0?(h(),g("div",Jf,"No snapshots yet")):(h(),g("div",qf,[(h(!0),g(te,null,be(t.value,H=>(h(),g("div",{key:H.name,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[r("div",Gf,[r("div",Yf,[r("div",Zf,[r("span",Qf,_(H.name),1),r("span",Xf,"v"+_(H.mcpVersion),1),r("span",ep,_(x(H.sizeBytes)),1)]),r("div",tp,[we(_(d(H.createdAt)),1),H.description?(h(),g(te,{key:0},[we(" · "+_(H.description),1)],64)):q("",!0)])]),r("button",{onClick:V=>B(H.name),disabled:o.value===H.name,class:"px-3 py-1.5 rounded-lg bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-xs text-textSecondary hover:text-red-400 transition disabled:opacity-50 shrink-0"},_(o.value===H.name?"…":"Delete"),9,sp)])]))),128))]))]),u.value?(h(),g("div",np,[r("div",op,[P[5]||(P[5]=r("h3",{class:"text-base font-semibold mb-2"},"Delete Snapshot",-1)),r("p",rp,[P[3]||(P[3]=we(" Delete ",-1)),r("span",lp,_(u.value),1),P[4]||(P[4]=we("? This cannot be undone. ",-1))]),r("div",{class:"flex gap-3"},[r("button",{onClick:w,class:"flex-1 px-4 py-2 rounded-xl bg-danger hover:opacity-80 text-white text-sm font-medium transition"},"Delete"),r("button",{onClick:C,class:"flex-1 px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Cancel")])])])):q("",!0)]))}}),ap={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/95 backdrop-blur-sm"},cp={class:"glass rounded-2xl p-8 max-w-md w-full mx-4 animate-slide-up"},up=["disabled"],dp={key:0,class:"mt-3 text-sm text-danger"},fp={key:1,class:"min-h-screen font-sans text-textPrimary animate-fade-in"},pp={class:"glass sticky top-0 z-40 border-b border-gray-800/50"},mp={class:"max-w-7xl mx-auto px-4 sm:px-6 py-4 flex items-center justify-between"},xp={class:"flex items-center gap-4"},hp={class:"text-sm text-textSecondary font-mono"},gp={class:"max-w-7xl mx-auto px-4 sm:px-6 py-6"},vp={class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3"},yp={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},bp={class:"text-2xl font-bold font-mono"},_p={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},wp={class:"text-2xl font-bold font-mono"},kp={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Sp={class:"text-2xl font-bold font-mono"},Cp={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},$p={class:"flex items-center gap-2 mb-2"},Tp={class:"text-2xl font-bold font-mono"},Ep={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Ap={class:"text-2xl font-bold font-mono"},Ip={class:"max-w-7xl mx-auto px-4 sm:px-6"},Pp={class:"flex gap-6 border-b border-gray-800/50 mb-6"},Mp=["onClick"],Op={class:"max-w-7xl mx-auto px-4 sm:px-6 pb-12"},hs="sensorium_token",Dp=vt({__name:"App",setup(e){const t=E(!1),s=E(""),n=E(""),o=E(!1),l=E(null),a=E("sessions");let c=null;const u=[{id:"sessions",label:"Sessions"},{id:"notes",label:"Memory Notes"},{id:"templates",label:"Templates"},{id:"skills",label:"Skills"},{id:"threads",label:"Threads"},{id:"mcp",label:"MCP Servers"},{id:"snapshots",label:"Snapshots"},{id:"settings",label:"Settings"}],x={sessions:ra,notes:ka,templates:nc,skills:Rc,threads:Sd,mcp:ff,snapshots:ip,settings:Nf},d=Fe(()=>x[a.value]),m=Fe(()=>{if(!l.value)return"—";const w=Math.floor(l.value.uptime),k=Math.floor(w/86400),P=Math.floor(w%86400/3600),H=Math.floor(w%3600/60);return k>0?`${k}d ${P}h`:P>0?`${P}h ${H}m`:`${H}m`});async function y(){const w=s.value.trim()||"no-auth";o.value=!0,n.value="";try{qt(w),await B(),localStorage.setItem(hs,w),t.value=!0,C()}catch(k){const P=k;P.status===401?n.value="Invalid token":n.value=P.message??"Connection failed",qt("")}finally{o.value=!1}}function T(){localStorage.removeItem(hs),t.value=!1,s.value="",l.value=null,c&&clearInterval(c),qt("")}async function B(){l.value=await ye("/api/status")}function C(){c&&clearInterval(c),c=setInterval(B,3e4)}return lt(async()=>{const w=localStorage.getItem(hs);if(w){s.value=w;try{qt(w),await B(),t.value=!0,C()}catch{localStorage.removeItem(hs),qt("")}}}),wn(()=>{c&&clearInterval(c)}),(w,k)=>{var P,H,V,se,ne,W,N,G,ue;return t.value?(h(),g("div",fp,[r("header",pp,[r("div",mp,[k[3]||(k[3]=Xe('<div class="flex items-center gap-3"><div class="w-8 h-8 rounded-lg bg-gradient-to-br from-accent to-purple-500 flex items-center justify-center"><span class="text-white text-sm font-bold">S</span></div><div><h1 class="text-lg font-semibold tracking-tight">Sensorium MCP</h1><p class="text-xs text-textSecondary">Agent Dashboard</p></div></div>',1)),r("div",xp,[k[2]||(k[2]=r("div",{class:"flex items-center gap-2 text-sm"},[r("span",{class:"w-2 h-2 rounded-full bg-success animate-pulse-slow"}),r("span",{class:"text-textSecondary"},"Connected")],-1)),r("div",hp,_(m.value),1),r("button",{onClick:T,class:"text-sm text-muted hover:text-textSecondary transition"},"Disconnect")])])]),r("div",gp,[r("div",vp,[r("div",yp,[k[4]||(k[4]=Xe('<div class="flex items-center gap-2 mb-2"><span class="text-success"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Sessions</span></div>',1)),r("div",bp,_(((P=l.value)==null?void 0:P.activeSessions)??0),1)]),r("div",_p,[k[5]||(k[5]=Xe('<div class="flex items-center gap-2 mb-2"><span class="text-accentLight"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Notes</span></div>',1)),r("div",wp,_(((V=(H=l.value)==null?void 0:H.memory)==null?void 0:V.totalSemanticNotes)??0),1)]),r("div",kp,[k[6]||(k[6]=Xe('<div class="flex items-center gap-2 mb-2"><span class="text-warn"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Episodes</span></div>',1)),r("div",Sp,_(((ne=(se=l.value)==null?void 0:se.memory)==null?void 0:ne.totalEpisodes)??0),1)]),r("div",Cp,[r("div",$p,[r("span",{class:J((((N=(W=l.value)==null?void 0:W.memory)==null?void 0:N.unconsolidatedEpisodes)??0)>10?"text-danger":"text-success")},[...k[7]||(k[7]=[r("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)])],2),k[8]||(k[8]=r("span",{class:"text-xs text-textSecondary font-medium uppercase tracking-wider"},"Unconsolidated",-1))]),r("div",Tp,_(((ue=(G=l.value)==null?void 0:G.memory)==null?void 0:ue.unconsolidatedEpisodes)??0),1)]),r("div",Ep,[k[9]||(k[9]=Xe('<div class="flex items-center gap-2 mb-2"><span class="text-success"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M12 5l7 7-7 7"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Uptime</span></div>',1)),r("div",Ap,_(m.value),1)])])]),r("div",Ip,[r("nav",Pp,[(h(),g(te,null,be(u,U=>r("button",{key:U.id,onClick:R=>a.value=U.id,class:J(["pb-3 text-sm font-medium transition",a.value===U.id?"tab-active":"tab-inactive"])},_(U.label),11,Mp)),64))])]),r("div",Op,[(h(),fr(Al(d.value),{status:l.value},null,8,["status"]))])])):(h(),g("div",ap,[r("div",cp,[k[1]||(k[1]=Xe('<div class="flex items-center gap-3 mb-6"><div class="w-10 h-10 rounded-xl bg-accent/20 flex items-center justify-center"><svg class="w-5 h-5 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"></path></svg></div><div><h2 class="text-lg font-semibold">Sensorium MCP</h2><p class="text-sm text-textSecondary">Enter your API token</p></div></div>',1)),ee(r("input",{"onUpdate:modelValue":k[0]||(k[0]=U=>s.value=U),type:"password",placeholder:"MCP_HTTP_SECRET",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary placeholder-muted focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition font-mono text-sm",onKeydown:Ze(y,["enter"])},null,544),[[re,s.value]]),r("button",{onClick:y,disabled:o.value,class:"w-full mt-4 px-4 py-3 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white font-medium transition"},_(o.value?"Connecting...":"Connect"),9,up),n.value?(h(),g("p",dp,_(n.value),1)):q("",!0)])]))}}});Hi(Dp).mount("#app");</script>
|
|
73
73
|
<style rel="stylesheet" crossorigin>body{background:#0f1419}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:#1a1f2e}::-webkit-scrollbar-thumb{background:#374151;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#4b5563}.glass{background:#1a1f2ecc;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border:1px solid rgba(99,102,241,.1)}.stat-glow{box-shadow:0 0 20px #6366f114}.priority-2{border-left:3px solid #ef4444}.priority-1{border-left:3px solid #f59e0b}.priority-0{border-left:3px solid transparent}.type-badge{font-size:.65rem;padding:2px 6px;border-radius:9999px;font-weight:600;text-transform:uppercase;letter-spacing:.05em}.type-fact{background:#3b82f626;color:#60a5fa}.type-preference{background:#a855f726;color:#c084fc}.type-pattern{background:#22c55e26;color:#4ade80}.type-entity{background:#fbbf2426;color:#fbbf24}.type-relationship{background:#f472b626;color:#f472b6}.tab-active{border-bottom:2px solid #6366f1;color:#e5e7eb}.tab-inactive{border-bottom:2px solid transparent;color:#6b7280}.tab-inactive:hover{color:#9ca3af}</style>
|
|
74
74
|
</head>
|
|
75
75
|
<body class="font-sans text-textPrimary min-h-screen">
|