sensorium-mcp 3.1.0-refactor.0 → 3.1.0-refactor.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/Install-Sensorium.ps1 +19 -5
  2. package/dist/config/agent-settings.d.ts +7 -0
  3. package/dist/config/agent-settings.d.ts.map +1 -1
  4. package/dist/config/agent-settings.js +14 -0
  5. package/dist/config/agent-settings.js.map +1 -1
  6. package/dist/dashboard/routes/claude.d.ts.map +1 -1
  7. package/dist/dashboard/routes/claude.js +9 -1
  8. package/dist/dashboard/routes/claude.js.map +1 -1
  9. package/dist/dashboard/spa.html +11 -11
  10. package/dist/index.js +19 -9
  11. package/dist/index.js.map +1 -1
  12. package/dist/integrations/openai/chat.d.ts +2 -0
  13. package/dist/integrations/openai/chat.d.ts.map +1 -1
  14. package/dist/integrations/openai/chat.js +14 -1
  15. package/dist/integrations/openai/chat.js.map +1 -1
  16. package/dist/integrations/openai/speech.d.ts +3 -1
  17. package/dist/integrations/openai/speech.d.ts.map +1 -1
  18. package/dist/integrations/openai/speech.js +5 -1
  19. package/dist/integrations/openai/speech.js.map +1 -1
  20. package/dist/server/factory.js +6 -7
  21. package/dist/server/factory.js.map +1 -1
  22. package/dist/server/http-server.d.ts +1 -0
  23. package/dist/server/http-server.d.ts.map +1 -1
  24. package/dist/server/http-server.js +45 -3
  25. package/dist/server/http-server.js.map +1 -1
  26. package/dist/services/claude-spawn.service.d.ts.map +1 -1
  27. package/dist/services/claude-spawn.service.js +70 -4
  28. package/dist/services/claude-spawn.service.js.map +1 -1
  29. package/dist/services/consolidation.service.d.ts.map +1 -1
  30. package/dist/services/consolidation.service.js +3 -0
  31. package/dist/services/consolidation.service.js.map +1 -1
  32. package/dist/services/dispatcher/poller.d.ts.map +1 -1
  33. package/dist/services/dispatcher/poller.js +12 -0
  34. package/dist/services/dispatcher/poller.js.map +1 -1
  35. package/dist/services/keeper.service.d.ts.map +1 -1
  36. package/dist/services/keeper.service.js +97 -1
  37. package/dist/services/keeper.service.js.map +1 -1
  38. package/dist/services/process.service.d.ts.map +1 -1
  39. package/dist/services/process.service.js +30 -0
  40. package/dist/services/process.service.js.map +1 -1
  41. package/dist/services/spawn-common.d.ts.map +1 -1
  42. package/dist/services/spawn-common.js +9 -2
  43. package/dist/services/spawn-common.js.map +1 -1
  44. package/dist/services/thread-lifecycle.service.d.ts.map +1 -1
  45. package/dist/services/thread-lifecycle.service.js +5 -0
  46. package/dist/services/thread-lifecycle.service.js.map +1 -1
  47. package/dist/services/usage-metering/index.d.ts +13 -0
  48. package/dist/services/usage-metering/index.d.ts.map +1 -0
  49. package/dist/services/usage-metering/index.js +10 -0
  50. package/dist/services/usage-metering/index.js.map +1 -0
  51. package/dist/services/usage-metering/meter.d.ts +34 -0
  52. package/dist/services/usage-metering/meter.d.ts.map +1 -0
  53. package/dist/services/usage-metering/meter.js +28 -0
  54. package/dist/services/usage-metering/meter.js.map +1 -0
  55. package/dist/services/usage-metering/pricing.d.ts +39 -0
  56. package/dist/services/usage-metering/pricing.d.ts.map +1 -0
  57. package/dist/services/usage-metering/pricing.js +49 -0
  58. package/dist/services/usage-metering/pricing.js.map +1 -0
  59. package/dist/services/usage-metering/sink.d.ts +24 -0
  60. package/dist/services/usage-metering/sink.d.ts.map +1 -0
  61. package/dist/services/usage-metering/sink.js +56 -0
  62. package/dist/services/usage-metering/sink.js.map +1 -0
  63. package/dist/services/worker-cleanup.service.d.ts +12 -0
  64. package/dist/services/worker-cleanup.service.d.ts.map +1 -1
  65. package/dist/services/worker-cleanup.service.js +188 -66
  66. package/dist/services/worker-cleanup.service.js.map +1 -1
  67. package/dist/sessions/mcp-registry.d.ts +6 -0
  68. package/dist/sessions/mcp-registry.d.ts.map +1 -1
  69. package/dist/sessions/mcp-registry.js +8 -0
  70. package/dist/sessions/mcp-registry.js.map +1 -1
  71. package/dist/tools/delegate-tool.d.ts.map +1 -1
  72. package/dist/tools/delegate-tool.js +84 -4
  73. package/dist/tools/delegate-tool.js.map +1 -1
  74. package/dist/tools/wait/media-processor.js +2 -2
  75. package/dist/tools/wait/media-processor.js.map +1 -1
  76. package/dist/tools/wait/poll-loop.d.ts.map +1 -1
  77. package/dist/tools/wait/poll-loop.js +18 -0
  78. package/dist/tools/wait/poll-loop.js.map +1 -1
  79. package/package.json +1 -1
@@ -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 r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const l of r)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function s(r){const l={};return r.integrity&&(l.integrity=r.integrity),r.referrerPolicy&&(l.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?l.credentials="include":r.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(r){if(r.ep)return;r.ep=!0;const l=s(r);fetch(r.href,l)}})();/**
48
+ <script type="module" crossorigin>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function s(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function o(r){if(r.ep)return;r.ep=!0;const a=s(r);fetch(r.href,a)}})();/**
49
49
  * @vue/shared v3.5.31
50
50
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
51
51
  * @license MIT
52
- **/function an(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const ye={},Rt=[],nt=()=>{},po=()=>!1,Ps=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Es=e=>e.startsWith("onUpdate:"),Ee=Object.assign,cn=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},br=Object.prototype.hasOwnProperty,xe=(e,t)=>br.call(e,t),ae=Array.isArray,jt=e=>us(e)==="[object Map]",Ft=e=>us(e)==="[object Set]",An=e=>us(e)==="[object Date]",ue=e=>typeof e=="function",$e=e=>typeof e=="string",rt=e=>typeof e=="symbol",he=e=>e!==null&&typeof e=="object",mo=e=>(he(e)||ue(e))&&ue(e.then)&&ue(e.catch),xo=Object.prototype.toString,us=e=>xo.call(e),yr=e=>us(e).slice(8,-1),vo=e=>us(e)==="[object Object]",un=e=>$e(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Zt=an(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),As=e=>{const t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},_r=/-\w/g,Re=As(e=>e.replace(_r,t=>t.slice(1).toUpperCase())),wr=/\B([A-Z])/g,St=As(e=>e.replace(wr,"-$1").toLowerCase()),Is=As(e=>e.charAt(0).toUpperCase()+e.slice(1)),Vs=As(e=>e?`on${Is(e)}`:""),st=(e,t)=>!Object.is(e,t),gs=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},go=(e,t,s,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:s})},Os=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let In;const Ms=()=>In||(In=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function It(e){if(ae(e)){const t={};for(let s=0;s<e.length;s++){const o=e[s],r=$e(o)?Cr(o):It(o);if(r)for(const l in r)t[l]=r[l]}return t}else if($e(e)||he(e))return e}const kr=/;(?![^(]*\))/g,$r=/:([^]+)/,Sr=/\/\*[^]*?\*\//g;function Cr(e){const t={};return e.replace(Sr,"").split(kr).forEach(s=>{if(s){const o=s.split($r);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function G(e){let t="";if($e(e))t=e;else if(ae(e))for(let s=0;s<e.length;s++){const o=G(e[s]);o&&(t+=o+" ")}else if(he(e))for(const s in e)e[s]&&(t+=s+" ");return t.trim()}const Tr="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Pr=an(Tr);function ho(e){return!!e||e===""}function Er(e,t){if(e.length!==t.length)return!1;let s=!0;for(let o=0;s&&o<e.length;o++)s=Ht(e[o],t[o]);return s}function Ht(e,t){if(e===t)return!0;let s=An(e),o=An(t);if(s||o)return s&&o?e.getTime()===t.getTime():!1;if(s=rt(e),o=rt(t),s||o)return e===t;if(s=ae(e),o=ae(t),s||o)return s&&o?Er(e,t):!1;if(s=he(e),o=he(t),s||o){if(!s||!o)return!1;const r=Object.keys(e).length,l=Object.keys(t).length;if(r!==l)return!1;for(const a in e){const c=e.hasOwnProperty(a),d=t.hasOwnProperty(a);if(c&&!d||!c&&d||!Ht(e[a],t[a]))return!1}}return String(e)===String(t)}function dn(e,t){return e.findIndex(s=>Ht(s,t))}const bo=e=>!!(e&&e.__v_isRef===!0),b=e=>$e(e)?e:e==null?"":ae(e)||he(e)&&(e.toString===xo||!ue(e.toString))?bo(e)?b(e.value):JSON.stringify(e,yo,2):String(e),yo=(e,t)=>bo(t)?yo(e,t.value):jt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[o,r],l)=>(s[Bs(o,l)+" =>"]=r,s),{})}:Ft(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Bs(s))}:rt(t)?Bs(t):he(t)&&!ae(t)&&!vo(t)?String(t):t,Bs=(e,t="")=>{var s;return rt(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};/**
52
+ **/function ln(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const ye={},Rt=[],nt=()=>{},po=()=>!1,Es=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ps=e=>e.startsWith("onUpdate:"),Pe=Object.assign,cn=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},br=Object.prototype.hasOwnProperty,xe=(e,t)=>br.call(e,t),ae=Array.isArray,jt=e=>us(e)==="[object Map]",Ft=e=>us(e)==="[object Set]",An=e=>us(e)==="[object Date]",ce=e=>typeof e=="function",Se=e=>typeof e=="string",rt=e=>typeof e=="symbol",he=e=>e!==null&&typeof e=="object",mo=e=>(he(e)||ce(e))&&ce(e.then)&&ce(e.catch),xo=Object.prototype.toString,us=e=>xo.call(e),yr=e=>us(e).slice(8,-1),vo=e=>us(e)==="[object Object]",un=e=>Se(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Zt=ln(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),As=e=>{const t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},_r=/-\w/g,Re=As(e=>e.replace(_r,t=>t.slice(1).toUpperCase())),wr=/\B([A-Z])/g,St=As(e=>e.replace(wr,"-$1").toLowerCase()),Is=As(e=>e.charAt(0).toUpperCase()+e.slice(1)),Vs=As(e=>e?`on${Is(e)}`:""),st=(e,t)=>!Object.is(e,t),gs=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},go=(e,t,s,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:s})},Os=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let In;const Ms=()=>In||(In=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function It(e){if(ae(e)){const t={};for(let s=0;s<e.length;s++){const o=e[s],r=Se(o)?Cr(o):It(o);if(r)for(const a in r)t[a]=r[a]}return t}else if(Se(e)||he(e))return e}const kr=/;(?![^(]*\))/g,$r=/:([^]+)/,Sr=/\/\*[^]*?\*\//g;function Cr(e){const t={};return e.replace(Sr,"").split(kr).forEach(s=>{if(s){const o=s.split($r);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Y(e){let t="";if(Se(e))t=e;else if(ae(e))for(let s=0;s<e.length;s++){const o=Y(e[s]);o&&(t+=o+" ")}else if(he(e))for(const s in e)e[s]&&(t+=s+" ");return t.trim()}const Tr="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Er=ln(Tr);function ho(e){return!!e||e===""}function Pr(e,t){if(e.length!==t.length)return!1;let s=!0;for(let o=0;s&&o<e.length;o++)s=Ht(e[o],t[o]);return s}function Ht(e,t){if(e===t)return!0;let s=An(e),o=An(t);if(s||o)return s&&o?e.getTime()===t.getTime():!1;if(s=rt(e),o=rt(t),s||o)return e===t;if(s=ae(e),o=ae(t),s||o)return s&&o?Pr(e,t):!1;if(s=he(e),o=he(t),s||o){if(!s||!o)return!1;const r=Object.keys(e).length,a=Object.keys(t).length;if(r!==a)return!1;for(const l in e){const c=e.hasOwnProperty(l),d=t.hasOwnProperty(l);if(c&&!d||!c&&d||!Ht(e[l],t[l]))return!1}}return String(e)===String(t)}function dn(e,t){return e.findIndex(s=>Ht(s,t))}const bo=e=>!!(e&&e.__v_isRef===!0),y=e=>Se(e)?e:e==null?"":ae(e)||he(e)&&(e.toString===xo||!ce(e.toString))?bo(e)?y(e.value):JSON.stringify(e,yo,2):String(e),yo=(e,t)=>bo(t)?yo(e,t.value):jt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[o,r],a)=>(s[Bs(o,a)+" =>"]=r,s),{})}:Ft(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Bs(s))}:rt(t)?Bs(t):he(t)&&!ae(t)&&!vo(t)?String(t):t,Bs=(e,t="")=>{var s;return rt(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 Ue;class Ar{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=Ue,!t&&Ue&&(this.index=(Ue.scopes||(Ue.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=Ue;try{return Ue=this,t()}finally{Ue=s}}}on(){++this._on===1&&(this.prevScope=Ue,Ue=this)}off(){this._on>0&&--this._on===0&&(Ue=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let s,o;for(s=0,o=this.effects.length;s<o;s++)this.effects[s].stop();for(this.effects.length=0,s=0,o=this.cleanups.length;s<o;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){for(s=0,o=this.scopes.length;s<o;s++)this.scopes[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Ir(){return Ue}let we;const Fs=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,Ue&&Ue.active&&Ue.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Fs.has(this)&&(Fs.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,On(this),$o(this);const t=we,s=We;we=this,We=!0;try{return this.fn()}finally{So(this),we=t,We=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,On(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Fs.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(o){e||(e=o)}t=s}}if(e)throw e}function $o(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function So(e){let t,s=e.depsTail,o=s;for(;o;){const r=o.prevDep;o.version===-1?(o===s&&(s=r),mn(o),Or(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=r}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&&(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===os)||(e.globalVersion=os,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ys(e))))return;e.flags|=2;const t=e.dep,s=we,o=We;we=e,We=!0;try{$o(e);const r=e.fn(e._value);(t.version===0||st(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{we=s,We=o,So(e),e.flags&=-3}}function mn(e,t=!1){const{dep:s,prevSub:o,nextSub:r}=e;if(o&&(o.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=o,e.nextSub=void 0),s.subs===e&&(s.subs=o,!o&&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 Or(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let We=!0;const To=[];function xt(){To.push(We),We=!1}function vt(){const e=To.pop();We=e===void 0?!0:e}function On(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=we;we=void 0;try{t()}finally{we=s}}}let os=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 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(!we||!We||we===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==we)s=this.activeLink=new Mr(we,this),we.deps?(s.prevDep=we.depsTail,we.depsTail.nextDep=s,we.depsTail=s):we.deps=we.depsTail=s,Po(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const o=s.nextDep;o.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=o),s.prevDep=we.depsTail,s.nextDep=void 0,we.depsTail.nextDep=s,we.depsTail=s,we.deps===s&&(we.deps=o)}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 Po(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)Po(o)}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 Ae(e,t,s){if(We&&we){let o=Zs.get(e);o||Zs.set(e,o=new Map);let r=o.get(s);r||(o.set(s,r=new xn),r.map=o,r.key=s),r.track()}}function ft(e,t,s,o,r,l){const a=Zs.get(e);if(!a){os++;return}const c=d=>{d&&d.trigger()};if(fn(),t==="clear")a.forEach(c);else{const d=ae(e),h=d&&un(s);if(d&&s==="length"){const f=Number(o);a.forEach((p,g)=>{(g==="length"||g===rs||!rt(g)&&g>=f)&&c(p)})}else switch((s!==void 0||a.has(void 0))&&c(a.get(s)),h&&c(a.get(rs)),t){case"add":d?h&&c(a.get("length")):(c(a.get(Et)),jt(e)&&c(a.get(Qs)));break;case"delete":d||(c(a.get(Et)),jt(e)&&c(a.get(Qs)));break;case"set":jt(e)&&c(a.get(Et));break}}pn()}function Mt(e){const t=me(e);return t===e?t:(Ae(t,"iterate",rs),He(e)?t:t.map(ze))}function Ds(e){return Ae(e=me(e),"iterate",rs),e}function et(e,t){return gt(e)?Nt(At(e)?ze(t):t):ze(t)}const Dr={__proto__:null,[Symbol.iterator](){return Hs(this,Symbol.iterator,e=>et(this,e))},concat(...e){return Mt(this).concat(...e.map(t=>ae(t)?Mt(t):t))},entries(){return Hs(this,"entries",e=>(e[1]=et(this,e[1]),e))},every(e,t){return it(this,"every",e,t,void 0,arguments)},filter(e,t){return it(this,"filter",e,t,s=>s.map(o=>et(this,o)),arguments)},find(e,t){return it(this,"find",e,t,s=>et(this,s),arguments)},findIndex(e,t){return it(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return it(this,"findLast",e,t,s=>et(this,s),arguments)},findLastIndex(e,t){return it(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return it(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 it(this,"map",e,t,void 0,arguments)},pop(){return zt(this,"pop")},push(...e){return zt(this,"push",e)},reduce(e,...t){return Mn(this,"reduce",e,t)},reduceRight(e,...t){return Mn(this,"reduceRight",e,t)},shift(){return zt(this,"shift")},some(e,t){return it(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 Hs(this,"values",e=>et(this,e))}};function Hs(e,t,s){const o=Ds(e),r=o[t]();return o!==e&&!He(e)&&(r._next=r.next,r.next=()=>{const l=r._next();return l.done||(l.value=s(l.value)),l}),r}const Rr=Array.prototype;function it(e,t,s,o,r,l){const a=Ds(e),c=a!==e&&!He(e),d=a[t];if(d!==Rr[t]){const p=d.apply(e,l);return c?ze(p):p}let h=s;a!==e&&(c?h=function(p,g){return s.call(this,et(e,p),g,e)}:s.length>2&&(h=function(p,g){return s.call(this,p,g,e)}));const f=d.call(a,h,o);return c&&r?r(f):f}function Mn(e,t,s,o){const r=Ds(e),l=r!==e&&!He(e);let a=s,c=!1;r!==e&&(l?(c=o.length===0,a=function(h,f,p){return c&&(c=!1,h=et(e,h)),s.call(this,h,et(e,f),p,e)}):s.length>3&&(a=function(h,f,p){return s.call(this,h,f,p,e)}));const d=r[t](a,...o);return c?et(e,d):d}function Ks(e,t,s){const o=me(e);Ae(o,"iterate",rs);const r=o[t](...s);return(r===-1||r===!1)&&bn(s[0])?(s[0]=me(s[0]),o[t](...s)):r}function zt(e,t,s=[]){xt(),fn();const o=me(e)[t].apply(e,s);return pn(),vt(),o}const jr=an("__proto__,__v_isRef,__isVue"),Eo=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(rt));function Lr(e){rt(e)||(e=String(e));const t=me(this);return Ae(t,"has",e),t.hasOwnProperty(e)}class Ao{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,o){if(s==="__v_skip")return t.__v_skip;const r=this._isReadonly,l=this._isShallow;if(s==="__v_isReactive")return!r;if(s==="__v_isReadonly")return r;if(s==="__v_isShallow")return l;if(s==="__v_raw")return o===(r?l?Jr:Do:l?Mo:Oo).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const a=ae(t);if(!r){let d;if(a&&(d=Dr[s]))return d;if(s==="hasOwnProperty")return Lr}const c=Reflect.get(t,s,Oe(t)?t:o);if((rt(s)?Eo.has(s):jr(s))||(r||Ae(t,"get",s),l))return c;if(Oe(c)){const d=a&&un(s)?c:c.value;return r&&he(d)?en(d):d}return he(c)?r?en(c):gn(c):c}}class Io extends Ao{constructor(t=!1){super(!1,t)}set(t,s,o,r){let l=t[s];const a=ae(t)&&un(s);if(!this._isShallow){const h=gt(l);if(!He(o)&&!gt(o)&&(l=me(l),o=me(o)),!a&&Oe(l)&&!Oe(o))return h||(l.value=o),!0}const c=a?Number(s)<t.length:xe(t,s),d=Reflect.set(t,s,o,Oe(t)?t:r);return t===me(r)&&(c?st(o,l)&&ft(t,"set",s,o):ft(t,"add",s,o)),d}deleteProperty(t,s){const o=xe(t,s);t[s];const r=Reflect.deleteProperty(t,s);return r&&o&&ft(t,"delete",s,void 0),r}has(t,s){const o=Reflect.has(t,s);return(!rt(s)||!Eo.has(s))&&Ae(t,"has",s),o}ownKeys(t){return Ae(t,"iterate",ae(t)?"length":Et),Reflect.ownKeys(t)}}class Ur extends Ao{constructor(t=!1){super(!0,t)}set(t,s){return!0}deleteProperty(t,s){return!0}}const Nr=new Io,Vr=new Ur,Br=new Io(!0);const Xs=e=>e,ps=e=>Reflect.getPrototypeOf(e);function Fr(e,t,s){return function(...o){const r=this.__v_raw,l=me(r),a=jt(l),c=e==="entries"||e===Symbol.iterator&&a,d=e==="keys"&&a,h=r[e](...o),f=s?Xs:t?Nt:ze;return!t&&Ae(l,"iterate",d?Qs:Et),Ee(Object.create(h),{next(){const{value:p,done:g}=h.next();return g?{value:p,done:g}:{value:c?[f(p[0]),f(p[1])]:f(p),done:g}}})}}function ms(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Hr(e,t){const s={get(r){const l=this.__v_raw,a=me(l),c=me(r);e||(st(r,c)&&Ae(a,"get",r),Ae(a,"get",c));const{has:d}=ps(a),h=t?Xs:e?Nt:ze;if(d.call(a,r))return h(l.get(r));if(d.call(a,c))return h(l.get(c));l!==a&&l.get(r)},get size(){const r=this.__v_raw;return!e&&Ae(me(r),"iterate",Et),r.size},has(r){const l=this.__v_raw,a=me(l),c=me(r);return e||(st(r,c)&&Ae(a,"has",r),Ae(a,"has",c)),r===c?l.has(r):l.has(r)||l.has(c)},forEach(r,l){const a=this,c=a.__v_raw,d=me(c),h=t?Xs:e?Nt:ze;return!e&&Ae(d,"iterate",Et),c.forEach((f,p)=>r.call(l,h(f),h(p),a))}};return Ee(s,e?{add:ms("add"),set:ms("set"),delete:ms("delete"),clear:ms("clear")}:{add(r){const l=me(this),a=ps(l),c=me(r),d=!t&&!He(r)&&!gt(r)?c:r;return a.has.call(l,d)||st(r,d)&&a.has.call(l,r)||st(c,d)&&a.has.call(l,c)||(l.add(d),ft(l,"add",d,d)),this},set(r,l){!t&&!He(l)&&!gt(l)&&(l=me(l));const a=me(this),{has:c,get:d}=ps(a);let h=c.call(a,r);h||(r=me(r),h=c.call(a,r));const f=d.call(a,r);return a.set(r,l),h?st(l,f)&&ft(a,"set",r,l):ft(a,"add",r,l),this},delete(r){const l=me(this),{has:a,get:c}=ps(l);let d=a.call(l,r);d||(r=me(r),d=a.call(l,r)),c&&c.call(l,r);const h=l.delete(r);return d&&ft(l,"delete",r,void 0),h},clear(){const r=me(this),l=r.size!==0,a=r.clear();return l&&ft(r,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(r=>{s[r]=Fr(r,e,t)}),s}function vn(e,t){const s=Hr(e,t);return(o,r,l)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?o:Reflect.get(xe(s,r)&&r in o?s:o,r,l)}const Kr={get:vn(!1,!1)},Wr={get:vn(!1,!0)},zr={get:vn(!0,!1)};const Oo=new WeakMap,Mo=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(yr(e))}function gn(e){return gt(e)?e:hn(e,!1,Nr,Kr,Oo)}function Yr(e){return hn(e,!1,Br,Wr,Mo)}function en(e){return hn(e,!0,Vr,zr,Do)}function hn(e,t,s,o,r){if(!he(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const l=Gr(e);if(l===0)return e;const a=r.get(e);if(a)return a;const c=new Proxy(e,l===2?o:s);return r.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 bn(e){return e?!!e.__v_raw:!1}function me(e){const t=e&&e.__v_raw;return t?me(t):e}function Zr(e){return!xe(e,"__v_skip")&&Object.isExtensible(e)&&go(e,"__v_skip",!0),e}const ze=e=>he(e)?gn(e):e,Nt=e=>he(e)?en(e):e;function Oe(e){return e?e.__v_isRef===!0:!1}function _(e){return Qr(e,!1)}function Qr(e,t){return Oe(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:me(t),this._value=s?t:ze(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,o=this.__v_isShallow||He(t)||gt(t);t=o?t:me(t),st(t,s)&&(this._rawValue=t,this._value=o?t:ze(t),this.dep.trigger())}}function el(e){return Oe(e)?e.value:e}const tl={get:(e,t,s)=>t==="__v_raw"?e:el(Reflect.get(e,t,s)),set:(e,t,s,o)=>{const r=e[t];return Oe(r)&&!Oe(s)?(r.value=s,!0):Reflect.set(e,t,s,o)}};function Ro(e){return At(e)?e:new Proxy(e,tl)}class sl{constructor(t,s,o){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=o}notify(){if(this.flags|=16,!(this.flags&8)&&we!==this)return ko(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 nl(e,t,s=!1){let o,r;return ue(e)?o=e:(o=e.get,r=e.set),new sl(o,r,s)}const xs={},ws=new WeakMap;let Pt;function ol(e,t=!1,s=Pt){if(s){let o=ws.get(s);o||ws.set(s,o=[]),o.push(e)}}function rl(e,t,s=ye){const{immediate:o,deep:r,once:l,scheduler:a,augmentJob:c,call:d}=s,h=O=>r?O:He(O)||r===!1||r===0?pt(O,1):pt(O);let f,p,g,$,B=!1,S=!1;if(Oe(e)?(p=()=>e.value,B=He(e)):At(e)?(p=()=>h(e),B=!0):ae(e)?(S=!0,B=e.some(O=>At(O)||He(O)),p=()=>e.map(O=>{if(Oe(O))return O.value;if(At(O))return h(O);if(ue(O))return d?d(O,2):O()})):ue(e)?t?p=d?()=>d(e,2):e:p=()=>{if(g){xt();try{g()}finally{vt()}}const O=Pt;Pt=f;try{return d?d(e,3,[$]):e($)}finally{Pt=O}}:p=nt,t&&r){const O=p,Q=r===!0?1/0:r;p=()=>pt(O(),Q)}const V=Ir(),C=()=>{f.stop(),V&&V.active&&cn(V.effects,f)};if(l&&t){const O=t;t=(...Q)=>{O(...Q),C()}}let P=S?new Array(e.length).fill(xs):xs;const U=O=>{if(!(!(f.flags&1)||!f.dirty&&!O))if(t){const Q=f.run();if(r||B||(S?Q.some((ie,re)=>st(ie,P[re])):st(Q,P))){g&&g();const ie=Pt;Pt=f;try{const re=[Q,P===xs?void 0:S&&P[0]===xs?[]:P,$];P=Q,d?d(t,3,re):t(...re)}finally{Pt=ie}}}else f.run()};return c&&c(U),f=new _o(p),f.scheduler=a?()=>a(U,!1):U,$=O=>ol(O,!1,f),g=f.onStop=()=>{const O=ws.get(f);if(O){if(d)d(O,4);else for(const Q of O)Q();ws.delete(f)}},t?o?U(!0):P=f.run():a?a(U.bind(null,!0),!0):f.run(),C.pause=f.pause.bind(f),C.resume=f.resume.bind(f),C.stop=C,C}function pt(e,t=1/0,s){if(t<=0||!he(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,Oe(e))pt(e.value,t,s);else if(ae(e))for(let o=0;o<e.length;o++)pt(e[o],t,s);else if(Ft(e)||jt(e))e.forEach(o=>{pt(o,t,s)});else if(vo(e)){for(const o in e)pt(e[o],t,s);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&pt(e[o],t,s)}return e}/**
56
+ **/let Ue;class Ar{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=Ue,!t&&Ue&&(this.index=(Ue.scopes||(Ue.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=Ue;try{return Ue=this,t()}finally{Ue=s}}}on(){++this._on===1&&(this.prevScope=Ue,Ue=this)}off(){this._on>0&&--this._on===0&&(Ue=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let s,o;for(s=0,o=this.effects.length;s<o;s++)this.effects[s].stop();for(this.effects.length=0,s=0,o=this.cleanups.length;s<o;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){for(s=0,o=this.scopes.length;s<o;s++)this.scopes[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Ir(){return Ue}let we;const Fs=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,Ue&&Ue.active&&Ue.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Fs.has(this)&&(Fs.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,On(this),$o(this);const t=we,s=We;we=this,We=!0;try{return this.fn()}finally{So(this),we=t,We=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,On(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Fs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Gs(this)&&this.run()}get dirty(){return Gs(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(o){e||(e=o)}t=s}}if(e)throw e}function $o(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function So(e){let t,s=e.depsTail,o=s;for(;o;){const r=o.prevDep;o.version===-1?(o===s&&(s=r),mn(o),Or(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=r}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===os)||(e.globalVersion=os,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Gs(e))))return;e.flags|=2;const t=e.dep,s=we,o=We;we=e,We=!0;try{$o(e);const r=e.fn(e._value);(t.version===0||st(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{we=s,We=o,So(e),e.flags&=-3}}function mn(e,t=!1){const{dep:s,prevSub:o,nextSub:r}=e;if(o&&(o.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=o,e.nextSub=void 0),s.subs===e&&(s.subs=o,!o&&s.computed)){s.computed.flags&=-5;for(let a=s.computed.deps;a;a=a.nextDep)mn(a,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function Or(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let We=!0;const To=[];function xt(){To.push(We),We=!1}function vt(){const e=To.pop();We=e===void 0?!0:e}function On(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=we;we=void 0;try{t()}finally{we=s}}}let os=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 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(!we||!We||we===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==we)s=this.activeLink=new Mr(we,this),we.deps?(s.prevDep=we.depsTail,we.depsTail.nextDep=s,we.depsTail=s):we.deps=we.depsTail=s,Eo(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const o=s.nextDep;o.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=o),s.prevDep=we.depsTail,s.nextDep=void 0,we.depsTail.nextDep=s,we.depsTail=s,we.deps===s&&(we.deps=o)}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 o=t.deps;o;o=o.nextDep)Eo(o)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const Zs=new WeakMap,Pt=Symbol(""),Qs=Symbol(""),rs=Symbol("");function Ae(e,t,s){if(We&&we){let o=Zs.get(e);o||Zs.set(e,o=new Map);let r=o.get(s);r||(o.set(s,r=new xn),r.map=o,r.key=s),r.track()}}function ft(e,t,s,o,r,a){const l=Zs.get(e);if(!l){os++;return}const c=d=>{d&&d.trigger()};if(fn(),t==="clear")l.forEach(c);else{const d=ae(e),h=d&&un(s);if(d&&s==="length"){const f=Number(o);l.forEach((p,g)=>{(g==="length"||g===rs||!rt(g)&&g>=f)&&c(p)})}else switch((s!==void 0||l.has(void 0))&&c(l.get(s)),h&&c(l.get(rs)),t){case"add":d?h&&c(l.get("length")):(c(l.get(Pt)),jt(e)&&c(l.get(Qs)));break;case"delete":d||(c(l.get(Pt)),jt(e)&&c(l.get(Qs)));break;case"set":jt(e)&&c(l.get(Pt));break}}pn()}function Mt(e){const t=me(e);return t===e?t:(Ae(t,"iterate",rs),He(e)?t:t.map(ze))}function Ds(e){return Ae(e=me(e),"iterate",rs),e}function et(e,t){return gt(e)?Nt(At(e)?ze(t):t):ze(t)}const Dr={__proto__:null,[Symbol.iterator](){return Hs(this,Symbol.iterator,e=>et(this,e))},concat(...e){return Mt(this).concat(...e.map(t=>ae(t)?Mt(t):t))},entries(){return Hs(this,"entries",e=>(e[1]=et(this,e[1]),e))},every(e,t){return it(this,"every",e,t,void 0,arguments)},filter(e,t){return it(this,"filter",e,t,s=>s.map(o=>et(this,o)),arguments)},find(e,t){return it(this,"find",e,t,s=>et(this,s),arguments)},findIndex(e,t){return it(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return it(this,"findLast",e,t,s=>et(this,s),arguments)},findLastIndex(e,t){return it(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return it(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 it(this,"map",e,t,void 0,arguments)},pop(){return zt(this,"pop")},push(...e){return zt(this,"push",e)},reduce(e,...t){return Mn(this,"reduce",e,t)},reduceRight(e,...t){return Mn(this,"reduceRight",e,t)},shift(){return zt(this,"shift")},some(e,t){return it(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 Hs(this,"values",e=>et(this,e))}};function Hs(e,t,s){const o=Ds(e),r=o[t]();return o!==e&&!He(e)&&(r._next=r.next,r.next=()=>{const a=r._next();return a.done||(a.value=s(a.value)),a}),r}const Rr=Array.prototype;function it(e,t,s,o,r,a){const l=Ds(e),c=l!==e&&!He(e),d=l[t];if(d!==Rr[t]){const p=d.apply(e,a);return c?ze(p):p}let h=s;l!==e&&(c?h=function(p,g){return s.call(this,et(e,p),g,e)}:s.length>2&&(h=function(p,g){return s.call(this,p,g,e)}));const f=d.call(l,h,o);return c&&r?r(f):f}function Mn(e,t,s,o){const r=Ds(e),a=r!==e&&!He(e);let l=s,c=!1;r!==e&&(a?(c=o.length===0,l=function(h,f,p){return c&&(c=!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 d=r[t](l,...o);return c?et(e,d):d}function Ks(e,t,s){const o=me(e);Ae(o,"iterate",rs);const r=o[t](...s);return(r===-1||r===!1)&&bn(s[0])?(s[0]=me(s[0]),o[t](...s)):r}function zt(e,t,s=[]){xt(),fn();const o=me(e)[t].apply(e,s);return pn(),vt(),o}const jr=ln("__proto__,__v_isRef,__isVue"),Po=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(rt));function Lr(e){rt(e)||(e=String(e));const t=me(this);return Ae(t,"has",e),t.hasOwnProperty(e)}class Ao{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,o){if(s==="__v_skip")return t.__v_skip;const r=this._isReadonly,a=this._isShallow;if(s==="__v_isReactive")return!r;if(s==="__v_isReadonly")return r;if(s==="__v_isShallow")return a;if(s==="__v_raw")return o===(r?a?Jr:Do:a?Mo:Oo).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const l=ae(t);if(!r){let d;if(l&&(d=Dr[s]))return d;if(s==="hasOwnProperty")return Lr}const c=Reflect.get(t,s,Oe(t)?t:o);if((rt(s)?Po.has(s):jr(s))||(r||Ae(t,"get",s),a))return c;if(Oe(c)){const d=l&&un(s)?c:c.value;return r&&he(d)?en(d):d}return he(c)?r?en(c):gn(c):c}}class Io extends Ao{constructor(t=!1){super(!1,t)}set(t,s,o,r){let a=t[s];const l=ae(t)&&un(s);if(!this._isShallow){const h=gt(a);if(!He(o)&&!gt(o)&&(a=me(a),o=me(o)),!l&&Oe(a)&&!Oe(o))return h||(a.value=o),!0}const c=l?Number(s)<t.length:xe(t,s),d=Reflect.set(t,s,o,Oe(t)?t:r);return t===me(r)&&(c?st(o,a)&&ft(t,"set",s,o):ft(t,"add",s,o)),d}deleteProperty(t,s){const o=xe(t,s);t[s];const r=Reflect.deleteProperty(t,s);return r&&o&&ft(t,"delete",s,void 0),r}has(t,s){const o=Reflect.has(t,s);return(!rt(s)||!Po.has(s))&&Ae(t,"has",s),o}ownKeys(t){return Ae(t,"iterate",ae(t)?"length":Pt),Reflect.ownKeys(t)}}class Ur extends Ao{constructor(t=!1){super(!0,t)}set(t,s){return!0}deleteProperty(t,s){return!0}}const Nr=new Io,Vr=new Ur,Br=new Io(!0);const Xs=e=>e,ps=e=>Reflect.getPrototypeOf(e);function Fr(e,t,s){return function(...o){const r=this.__v_raw,a=me(r),l=jt(a),c=e==="entries"||e===Symbol.iterator&&l,d=e==="keys"&&l,h=r[e](...o),f=s?Xs:t?Nt:ze;return!t&&Ae(a,"iterate",d?Qs:Pt),Pe(Object.create(h),{next(){const{value:p,done:g}=h.next();return g?{value:p,done:g}:{value:c?[f(p[0]),f(p[1])]:f(p),done:g}}})}}function ms(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Hr(e,t){const s={get(r){const a=this.__v_raw,l=me(a),c=me(r);e||(st(r,c)&&Ae(l,"get",r),Ae(l,"get",c));const{has:d}=ps(l),h=t?Xs:e?Nt:ze;if(d.call(l,r))return h(a.get(r));if(d.call(l,c))return h(a.get(c));a!==l&&a.get(r)},get size(){const r=this.__v_raw;return!e&&Ae(me(r),"iterate",Pt),r.size},has(r){const a=this.__v_raw,l=me(a),c=me(r);return e||(st(r,c)&&Ae(l,"has",r),Ae(l,"has",c)),r===c?a.has(r):a.has(r)||a.has(c)},forEach(r,a){const l=this,c=l.__v_raw,d=me(c),h=t?Xs:e?Nt:ze;return!e&&Ae(d,"iterate",Pt),c.forEach((f,p)=>r.call(a,h(f),h(p),l))}};return Pe(s,e?{add:ms("add"),set:ms("set"),delete:ms("delete"),clear:ms("clear")}:{add(r){const a=me(this),l=ps(a),c=me(r),d=!t&&!He(r)&&!gt(r)?c:r;return l.has.call(a,d)||st(r,d)&&l.has.call(a,r)||st(c,d)&&l.has.call(a,c)||(a.add(d),ft(a,"add",d,d)),this},set(r,a){!t&&!He(a)&&!gt(a)&&(a=me(a));const l=me(this),{has:c,get:d}=ps(l);let h=c.call(l,r);h||(r=me(r),h=c.call(l,r));const f=d.call(l,r);return l.set(r,a),h?st(a,f)&&ft(l,"set",r,a):ft(l,"add",r,a),this},delete(r){const a=me(this),{has:l,get:c}=ps(a);let d=l.call(a,r);d||(r=me(r),d=l.call(a,r)),c&&c.call(a,r);const h=a.delete(r);return d&&ft(a,"delete",r,void 0),h},clear(){const r=me(this),a=r.size!==0,l=r.clear();return a&&ft(r,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(r=>{s[r]=Fr(r,e,t)}),s}function vn(e,t){const s=Hr(e,t);return(o,r,a)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?o:Reflect.get(xe(s,r)&&r in o?s:o,r,a)}const Kr={get:vn(!1,!1)},Wr={get:vn(!1,!0)},zr={get:vn(!0,!1)};const Oo=new WeakMap,Mo=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 Yr(e){return e.__v_skip||!Object.isExtensible(e)?0:qr(yr(e))}function gn(e){return gt(e)?e:hn(e,!1,Nr,Kr,Oo)}function Gr(e){return hn(e,!1,Br,Wr,Mo)}function en(e){return hn(e,!0,Vr,zr,Do)}function hn(e,t,s,o,r){if(!he(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const a=Yr(e);if(a===0)return e;const l=r.get(e);if(l)return l;const c=new Proxy(e,a===2?o:s);return r.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 bn(e){return e?!!e.__v_raw:!1}function me(e){const t=e&&e.__v_raw;return t?me(t):e}function Zr(e){return!xe(e,"__v_skip")&&Object.isExtensible(e)&&go(e,"__v_skip",!0),e}const ze=e=>he(e)?gn(e):e,Nt=e=>he(e)?en(e):e;function Oe(e){return e?e.__v_isRef===!0:!1}function _(e){return Qr(e,!1)}function Qr(e,t){return Oe(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:me(t),this._value=s?t:ze(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,o=this.__v_isShallow||He(t)||gt(t);t=o?t:me(t),st(t,s)&&(this._rawValue=t,this._value=o?t:ze(t),this.dep.trigger())}}function ea(e){return Oe(e)?e.value:e}const ta={get:(e,t,s)=>t==="__v_raw"?e:ea(Reflect.get(e,t,s)),set:(e,t,s,o)=>{const r=e[t];return Oe(r)&&!Oe(s)?(r.value=s,!0):Reflect.set(e,t,s,o)}};function Ro(e){return At(e)?e:new Proxy(e,ta)}class sa{constructor(t,s,o){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=o}notify(){if(this.flags|=16,!(this.flags&8)&&we!==this)return ko(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 na(e,t,s=!1){let o,r;return ce(e)?o=e:(o=e.get,r=e.set),new sa(o,r,s)}const xs={},ws=new WeakMap;let Et;function oa(e,t=!1,s=Et){if(s){let o=ws.get(s);o||ws.set(s,o=[]),o.push(e)}}function ra(e,t,s=ye){const{immediate:o,deep:r,once:a,scheduler:l,augmentJob:c,call:d}=s,h=O=>r?O:He(O)||r===!1||r===0?pt(O,1):pt(O);let f,p,g,$,N=!1,C=!1;if(Oe(e)?(p=()=>e.value,N=He(e)):At(e)?(p=()=>h(e),N=!0):ae(e)?(C=!0,N=e.some(O=>At(O)||He(O)),p=()=>e.map(O=>{if(Oe(O))return O.value;if(At(O))return h(O);if(ce(O))return d?d(O,2):O()})):ce(e)?t?p=d?()=>d(e,2):e:p=()=>{if(g){xt();try{g()}finally{vt()}}const O=Et;Et=f;try{return d?d(e,3,[$]):e($)}finally{Et=O}}:p=nt,t&&r){const O=p,X=r===!0?1/0:r;p=()=>pt(O(),X)}const U=Ir(),S=()=>{f.stop(),U&&U.active&&cn(U.effects,f)};if(a&&t){const O=t;t=(...X)=>{O(...X),S()}}let P=C?new Array(e.length).fill(xs):xs;const L=O=>{if(!(!(f.flags&1)||!f.dirty&&!O))if(t){const X=f.run();if(r||N||(C?X.some((le,oe)=>st(le,P[oe])):st(X,P))){g&&g();const le=Et;Et=f;try{const oe=[X,P===xs?void 0:C&&P[0]===xs?[]:P,$];P=X,d?d(t,3,oe):t(...oe)}finally{Et=le}}}else f.run()};return c&&c(L),f=new _o(p),f.scheduler=l?()=>l(L,!1):L,$=O=>oa(O,!1,f),g=f.onStop=()=>{const O=ws.get(f);if(O){if(d)d(O,4);else for(const X of O)X();ws.delete(f)}},t?o?L(!0):P=f.run():l?l(L.bind(null,!0),!0):f.run(),S.pause=f.pause.bind(f),S.resume=f.resume.bind(f),S.stop=S,S}function pt(e,t=1/0,s){if(t<=0||!he(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,Oe(e))pt(e.value,t,s);else if(ae(e))for(let o=0;o<e.length;o++)pt(e[o],t,s);else if(Ft(e)||jt(e))e.forEach(o=>{pt(o,t,s)});else if(vo(e)){for(const o in e)pt(e[o],t,s);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&pt(e[o],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 ds(e,t,s,o){try{return o?e(...o):e()}catch(r){Rs(r,t,s)}}function lt(e,t,s,o){if(ue(e)){const r=ds(e,t,s,o);return r&&mo(r)&&r.catch(l=>{Rs(l,t,s)}),r}if(ae(e)){const r=[];for(let l=0;l<e.length;l++)r.push(lt(e[l],t,s,o));return r}}function Rs(e,t,s,o=!0){const r=t?t.vnode:null,{errorHandler:l,throwUnhandledErrorInProduction:a}=t&&t.appContext.config||ye;if(t){let c=t.parent;const d=t.proxy,h=`https://vuejs.org/error-reference/#runtime-${s}`;for(;c;){const f=c.ec;if(f){for(let p=0;p<f.length;p++)if(f[p](e,d,h)===!1)return}c=c.parent}if(l){xt(),ds(l,null,10,[e,d,h]),vt();return}}ll(e,s,r,o,a)}function ll(e,t,s,o=!0,r=!1){if(r)throw e;console.error(e)}const De=[];let Qe=-1;const Lt=[];let wt=null,Dt=0;const jo=Promise.resolve();let ks=null;function Lo(e){const t=ks||jo;return e?t.then(this?e.bind(this):e):t}function al(e){let t=Qe+1,s=De.length;for(;t<s;){const o=t+s>>>1,r=De[o],l=ls(r);l<e||l===e&&r.flags&2?t=o+1:s=o}return t}function yn(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(al(t),0,e),e.flags|=1,Uo()}}function Uo(){ks||(ks=jo.then(Vo))}function il(e){ae(e)?Lt.push(...e):wt&&e.id===-1?wt.splice(Dt+1,0,e):e.flags&1||(Lt.push(e),e.flags|=1),Uo()}function Dn(e,t,s=Qe+1){for(;s<De.length;s++){const o=De[s];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;De.splice(s,1),s--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function No(e){if(Lt.length){const t=[...new Set(Lt)].sort((s,o)=>ls(s)-ls(o));if(Lt.length=0,wt){wt.push(...t);return}for(wt=t,Dt=0;Dt<wt.length;Dt++){const s=wt[Dt];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}wt=null,Dt=0}}const ls=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Vo(e){try{for(Qe=0;Qe<De.length;Qe++){const t=De[Qe];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(;Qe<De.length;Qe++){const t=De[Qe];t&&(t.flags&=-2)}Qe=-1,De.length=0,No(),ks=null,(De.length||Lt.length)&&Vo()}}let Be=null,Bo=null;function $s(e){const t=Be;return Be=e,Bo=e&&e.type.__scopeId||null,t}function cl(e,t=Be,s){if(!t||e._n)return e;const o=(...r)=>{o._d&&zn(-1);const l=$s(t);let a;try{a=e(...r)}finally{$s(l),o._d&&zn(1)}return a};return o._n=!0,o._c=!0,o._d=!0,o}function Y(e,t){if(Be===null)return e;const s=Ns(Be),o=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[l,a,c,d=ye]=t[r];l&&(ue(l)&&(l={mounted:l,updated:l}),l.deep&&pt(a),o.push({dir:l,instance:s,value:a,oldValue:void 0,arg:c,modifiers:d}))}return e}function Ct(e,t,s,o){const r=e.dirs,l=t&&t.dirs;for(let a=0;a<r.length;a++){const c=r[a];l&&(c.oldValue=l[a].value);let d=c.dir[o];d&&(xt(),lt(d,s,8,[e.el,c,e,t]),vt())}}function ul(e,t){if(Ie){let s=Ie.provides;const o=Ie.parent&&Ie.parent.provides;o===s&&(s=Ie.provides=Object.create(o)),s[e]=t}}function hs(e,t,s=!1){const o=ua();if(o||Ut){let r=Ut?Ut._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return s&&ue(t)?t.call(o&&o.proxy):t}}const dl=Symbol.for("v-scx"),fl=()=>hs(dl);function Ws(e,t,s){return Fo(e,t,s)}function Fo(e,t,s=ye){const{immediate:o,deep:r,flush:l,once:a}=s,c=Ee({},s),d=t&&o||!t&&l!=="post";let h;if(is){if(l==="sync"){const $=fl();h=$.__watcherHandles||($.__watcherHandles=[])}else if(!d){const $=()=>{};return $.stop=nt,$.resume=nt,$.pause=nt,$}}const f=Ie;c.call=($,B,S)=>lt($,f,B,S);let p=!1;l==="post"?c.scheduler=$=>{Le($,f&&f.suspense)}:l!=="sync"&&(p=!0,c.scheduler=($,B)=>{B?$():yn($)}),c.augmentJob=$=>{t&&($.flags|=4),p&&($.flags|=2,f&&($.id=f.uid,$.i=f))};const g=rl(e,t,c);return is&&(h?h.push(g):d&&g()),g}function pl(e,t,s){const o=this.proxy,r=$e(e)?e.includes(".")?Ho(o,e):()=>o[e]:e.bind(o,o);let l;ue(t)?l=t:(l=t.handler,s=t);const a=fs(this),c=Fo(r,l.bind(o),s);return a(),c}function Ho(e,t){const s=t.split(".");return()=>{let o=e;for(let r=0;r<s.length&&o;r++)o=o[s[r]];return o}}const ml=Symbol("_vte"),xl=e=>e.__isTeleport,vl=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 Ne(e,t){return ue(e)?Ee({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 Ss=new WeakMap;function es(e,t,s,o,r=!1){if(ae(e)){e.forEach((S,V)=>es(S,t&&(ae(t)?t[V]:t),s,o,r));return}if(ts(o)&&!r){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&es(e,t,s,o.component.subTree);return}const l=o.shapeFlag&4?Ns(o.component):o.el,a=r?null:l,{i:c,r:d}=e,h=t&&t.r,f=c.refs===ye?c.refs={}:c.refs,p=c.setupState,g=me(p),$=p===ye?po:S=>Rn(f,S)?!1:xe(g,S),B=(S,V)=>!(V&&Rn(f,V));if(h!=null&&h!==d){if(jn(t),$e(h))f[h]=null,$(h)&&(p[h]=null);else if(Oe(h)){const S=t;B(h,S.k)&&(h.value=null),S.k&&(f[S.k]=null)}}if(ue(d))ds(d,c,12,[a,f]);else{const S=$e(d),V=Oe(d);if(S||V){const C=()=>{if(e.f){const P=S?$(d)?p[d]:f[d]:B()||!e.k?d.value:f[e.k];if(r)ae(P)&&cn(P,l);else if(ae(P))P.includes(l)||P.push(l);else if(S)f[d]=[l],$(d)&&(p[d]=f[d]);else{const U=[l];B(d,e.k)&&(d.value=U),e.k&&(f[e.k]=U)}}else S?(f[d]=a,$(d)&&(p[d]=a)):V&&(B(d,e.k)&&(d.value=a),e.k&&(f[e.k]=a))};if(a){const P=()=>{C(),Ss.delete(e)};P.id=-1,Ss.set(e,P),Le(P,s)}else jn(e),C()}}}function jn(e){const t=Ss.get(e);t&&(t.flags|=8,Ss.delete(e))}Ms().requestIdleCallback;Ms().cancelIdleCallback;const ts=e=>!!e.type.__asyncLoader,Wo=e=>e.type.__isKeepAlive;function gl(e,t){zo(e,"a",t)}function hl(e,t){zo(e,"da",t)}function zo(e,t,s=Ie){const o=e.__wdc||(e.__wdc=()=>{let r=s;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(js(t,o,s),s){let r=s.parent;for(;r&&r.parent;)Wo(r.parent.vnode)&&bl(o,t,s,r),r=r.parent}}function bl(e,t,s,o){const r=js(t,e,o,!0);wn(()=>{cn(o[t],r)},s)}function js(e,t,s=Ie,o=!1){if(s){const r=s[e]||(s[e]=[]),l=t.__weh||(t.__weh=(...a)=>{xt();const c=fs(s),d=lt(t,s,e,a);return c(),vt(),d});return o?r.unshift(l):r.push(l),l}}const bt=e=>(t,s=Ie)=>{(!is||e==="sp")&&js(e,(...o)=>t(...o),s)},yl=bt("bm"),je=bt("m"),_l=bt("bu"),wl=bt("u"),kl=bt("bum"),wn=bt("um"),$l=bt("sp"),Sl=bt("rtg"),Cl=bt("rtc");function Tl(e,t=Ie){js("ec",e,t)}const Pl="components",Jo=Symbol.for("v-ndc");function El(e){return $e(e)?Al(Pl,e,!1)||e:e||Jo}function Al(e,t,s=!0,o=!1){const r=Be||Ie;if(r){const l=r.type;{const c=xa(l,!1);if(c&&(c===t||c===Re(t)||c===Is(Re(t))))return l}const a=Ln(r[e]||l[e],t)||Ln(r.appContext[e],t);return!a&&o?l:a}}function Ln(e,t){return e&&(e[t]||e[Re(t)]||e[Is(Re(t))])}function de(e,t,s,o){let r;const l=s,a=ae(e);if(a||$e(e)){const c=a&&At(e);let d=!1,h=!1;c&&(d=!He(e),h=gt(e),e=Ds(e)),r=new Array(e.length);for(let f=0,p=e.length;f<p;f++)r[f]=t(d?h?Nt(ze(e[f])):ze(e[f]):e[f],f,void 0,l)}else if(typeof e=="number"){r=new Array(e);for(let c=0;c<e;c++)r[c]=t(c+1,c,void 0,l)}else if(he(e))if(e[Symbol.iterator])r=Array.from(e,(c,d)=>t(c,d,void 0,l));else{const c=Object.keys(e);r=new Array(c.length);for(let d=0,h=c.length;d<h;d++){const f=c[d];r[d]=t(e[f],f,d,l)}}else r=[];return r}const tn=e=>e?xr(e)?Ns(e):tn(e.parent):null,ss=Ee(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=()=>{yn(e.update)}),$nextTick:e=>e.n||(e.n=Lo.bind(e.proxy)),$watch:e=>pl.bind(e)}),zs=(e,t)=>e!==ye&&!e.__isScriptSetup&&xe(e,t),Il={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:o,data:r,props:l,accessCache:a,type:c,appContext:d}=e;if(t[0]!=="$"){const g=a[t];if(g!==void 0)switch(g){case 1:return o[t];case 2:return r[t];case 4:return s[t];case 3:return l[t]}else{if(zs(o,t))return a[t]=1,o[t];if(r!==ye&&xe(r,t))return a[t]=2,r[t];if(xe(l,t))return a[t]=3,l[t];if(s!==ye&&xe(s,t))return a[t]=4,s[t];sn&&(a[t]=0)}}const h=ss[t];let f,p;if(h)return t==="$attrs"&&Ae(e.attrs,"get",""),h(e);if((f=c.__cssModules)&&(f=f[t]))return f;if(s!==ye&&xe(s,t))return a[t]=4,s[t];if(p=d.config.globalProperties,xe(p,t))return p[t]},set({_:e},t,s){const{data:o,setupState:r,ctx:l}=e;return zs(r,t)?(r[t]=s,!0):o!==ye&&xe(o,t)?(o[t]=s,!0):xe(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(l[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:o,appContext:r,props:l,type:a}},c){let d;return!!(s[c]||e!==ye&&c[0]!=="$"&&xe(e,c)||zs(t,c)||xe(l,c)||xe(o,c)||xe(ss,c)||xe(r.config.globalProperties,c)||(d=a.__cssModules)&&d[c])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:xe(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function Un(e){return ae(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let sn=!0;function Ol(e){const t=Go(e),s=e.proxy,o=e.ctx;sn=!1,t.beforeCreate&&Nn(t.beforeCreate,e,"bc");const{data:r,computed:l,methods:a,watch:c,provide:d,inject:h,created:f,beforeMount:p,mounted:g,beforeUpdate:$,updated:B,activated:S,deactivated:V,beforeDestroy:C,beforeUnmount:P,destroyed:U,unmounted:O,render:Q,renderTracked:ie,renderTriggered:re,errorCaptured:Z,serverPrefetch:T,expose:R,inheritAttrs:w,components:y,directives:I,filters:L}=t;if(h&&Ml(h,o,null),a)for(const le in a){const ee=a[le];ue(ee)&&(o[le]=ee.bind(s))}if(r){const le=r.call(s,s);he(le)&&(e.data=gn(le))}if(sn=!0,l)for(const le in l){const ee=l[le],J=ue(ee)?ee.bind(s,s):ue(ee.get)?ee.get.bind(s,s):nt,N=!ue(ee)&&ue(ee.set)?ee.set.bind(s):nt,Ce=Pe({get:J,set:N});Object.defineProperty(o,le,{enumerable:!0,configurable:!0,get:()=>Ce.value,set:ke=>Ce.value=ke})}if(c)for(const le in c)qo(c[le],o,s,le);if(d){const le=ue(d)?d.call(s):d;Reflect.ownKeys(le).forEach(ee=>{ul(ee,le[ee])})}f&&Nn(f,e,"c");function z(le,ee){ae(ee)?ee.forEach(J=>le(J.bind(s))):ee&&le(ee.bind(s))}if(z(yl,p),z(je,g),z(_l,$),z(wl,B),z(gl,S),z(hl,V),z(Tl,Z),z(Cl,ie),z(Sl,re),z(kl,P),z(wn,O),z($l,T),ae(R))if(R.length){const le=e.exposed||(e.exposed={});R.forEach(ee=>{Object.defineProperty(le,ee,{get:()=>s[ee],set:J=>s[ee]=J,enumerable:!0})})}else e.exposed||(e.exposed={});Q&&e.render===nt&&(e.render=Q),w!=null&&(e.inheritAttrs=w),y&&(e.components=y),I&&(e.directives=I),T&&Ko(e)}function Ml(e,t,s=nt){ae(e)&&(e=nn(e));for(const o in e){const r=e[o];let l;he(r)?"default"in r?l=hs(r.from||o,r.default,!0):l=hs(r.from||o):l=hs(r),Oe(l)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>l.value,set:a=>l.value=a}):t[o]=l}}function Nn(e,t,s){lt(ae(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,s)}function qo(e,t,s,o){let r=o.includes(".")?Ho(s,o):()=>s[o];if($e(e)){const l=t[e];ue(l)&&Ws(r,l)}else if(ue(e))Ws(r,e.bind(s));else if(he(e))if(ae(e))e.forEach(l=>qo(l,t,s,o));else{const l=ue(e.handler)?e.handler.bind(s):t[e.handler];ue(l)&&Ws(r,l,e)}}function Go(e){const t=e.type,{mixins:s,extends:o}=t,{mixins:r,optionsCache:l,config:{optionMergeStrategies:a}}=e.appContext,c=l.get(t);let d;return c?d=c:!r.length&&!s&&!o?d=t:(d={},r.length&&r.forEach(h=>Cs(d,h,a,!0)),Cs(d,t,a)),he(t)&&l.set(t,d),d}function Cs(e,t,s,o=!1){const{mixins:r,extends:l}=t;l&&Cs(e,l,s,!0),r&&r.forEach(a=>Cs(e,a,s,!0));for(const a in t)if(!(o&&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:Bn,emits:Bn,methods:Yt,computed:Yt,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:Yt,directives:Yt,watch:jl,provide:Vn,inject:Rl};function Vn(e,t){return t?e?function(){return Ee(ue(e)?e.call(this,this):e,ue(t)?t.call(this,this):t)}:t:e}function Rl(e,t){return Yt(nn(e),nn(t))}function nn(e){if(ae(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 Yt(e,t){return e?Ee(Object.create(null),e,t):t}function Bn(e,t){return e?ae(e)&&ae(t)?[...new Set([...e,...t])]:Ee(Object.create(null),Un(e),Un(t??{})):t}function jl(e,t){if(!e)return t;if(!t)return e;const s=Ee(Object.create(null),e);for(const o in t)s[o]=Me(e[o],t[o]);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 Ll=0;function Ul(e,t){return function(o,r=null){ue(o)||(o=Ee({},o)),r!=null&&!he(r)&&(r=null);const l=Yo(),a=new WeakSet,c=[];let d=!1;const h=l.app={_uid:Ll++,_component:o,_props:r,_container:null,_context:l,_instance:null,version:ga,get config(){return l.config},set config(f){},use(f,...p){return a.has(f)||(f&&ue(f.install)?(a.add(f),f.install(h,...p)):ue(f)&&(a.add(f),f(h,...p))),h},mixin(f){return l.mixins.includes(f)||l.mixins.push(f),h},component(f,p){return p?(l.components[f]=p,h):l.components[f]},directive(f,p){return p?(l.directives[f]=p,h):l.directives[f]},mount(f,p,g){if(!d){const $=h._ceVNode||ot(o,r);return $.appContext=l,g===!0?g="svg":g===!1&&(g=void 0),e($,f,g),d=!0,h._container=f,f.__vue_app__=h,Ns($.component)}},onUnmount(f){c.push(f)},unmount(){d&&(lt(c,h._instance,16),e(null,h._container),delete h._container.__vue_app__)},provide(f,p){return l.provides[f]=p,h},runWithContext(f){const p=Ut;Ut=h;try{return f()}finally{Ut=p}}};return h}}let Ut=null;const Nl=(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 o=e.vnode.props||ye;let r=s;const l=t.startsWith("update:"),a=l&&Nl(o,t.slice(7));a&&(a.trim&&(r=s.map(f=>$e(f)?f.trim():f)),a.number&&(r=s.map(Os)));let c,d=o[c=Vs(t)]||o[c=Vs(Re(t))];!d&&l&&(d=o[c=Vs(St(t))]),d&&lt(d,e,6,r);const h=o[c+"Once"];if(h){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,lt(h,e,6,r)}}const Bl=new WeakMap;function Zo(e,t,s=!1){const o=s?Bl:t.emitsCache,r=o.get(e);if(r!==void 0)return r;const l=e.emits;let a={},c=!1;if(!ue(e)){const d=h=>{const f=Zo(h,t,!0);f&&(c=!0,Ee(a,f))};!s&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}return!l&&!c?(he(e)&&o.set(e,null),null):(ae(l)?l.forEach(d=>a[d]=null):Ee(a,l),he(e)&&o.set(e,a),a)}function Ls(e,t){return!e||!Ps(t)?!1:(t=t.slice(2).replace(/Once$/,""),xe(e,t[0].toLowerCase()+t.slice(1))||xe(e,St(t))||xe(e,t))}function Fn(e){const{type:t,vnode:s,proxy:o,withProxy:r,propsOptions:[l],slots:a,attrs:c,emit:d,render:h,renderCache:f,props:p,data:g,setupState:$,ctx:B,inheritAttrs:S}=e,V=$s(e);let C,P;try{if(s.shapeFlag&4){const O=r||o,Q=O;C=tt(h.call(Q,O,f,p,$,g,B)),P=c}else{const O=t;C=tt(O.length>1?O(p,{attrs:c,slots:a,emit:d}):O(p,null)),P=t.props?c:Fl(c)}}catch(O){ns.length=0,Rs(O,e,1),C=ot($t)}let U=C;if(P&&S!==!1){const O=Object.keys(P),{shapeFlag:Q}=U;O.length&&Q&7&&(l&&O.some(Es)&&(P=Hl(P,l)),U=Vt(U,P,!1,!0))}return s.dirs&&(U=Vt(U,null,!1,!0),U.dirs=U.dirs?U.dirs.concat(s.dirs):s.dirs),s.transition&&_n(U,s.transition),C=U,$s(V),C}const Fl=e=>{let t;for(const s in e)(s==="class"||s==="style"||Ps(s))&&((t||(t={}))[s]=e[s]);return t},Hl=(e,t)=>{const s={};for(const o in e)(!Es(o)||!(o.slice(9)in t))&&(s[o]=e[o]);return s};function Kl(e,t,s){const{props:o,children:r,component:l}=e,{props:a,children:c,patchFlag:d}=t,h=l.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&d>=0){if(d&1024)return!0;if(d&16)return o?Hn(o,a,h):!!a;if(d&8){const f=t.dynamicProps;for(let p=0;p<f.length;p++){const g=f[p];if(Qo(a,o,g)&&!Ls(h,g))return!0}}}else return(r||c)&&(!c||!c.$stable)?!0:o===a?!1:o?a?Hn(o,a,h):!0:!!a;return!1}function Hn(e,t,s){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let r=0;r<o.length;r++){const l=o[r];if(Qo(t,e,l)&&!Ls(s,l))return!0}return!1}function Qo(e,t,s){const o=e[s],r=t[s];return s==="style"&&he(o)&&he(r)?!Ht(o,r):o!==r}function Wl({vnode:e,parent:t,suspense:s},o){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.suspense.vnode.el=r.el=o,e=r),r===e)(e=t.vnode).el=o,t=t.parent;else break}s&&s.activeBranch===e&&(s.vnode.el=o)}const Xo={},er=()=>Object.create(Xo),tr=e=>Object.getPrototypeOf(e)===Xo;function zl(e,t,s,o=!1){const r={},l=er();e.propsDefaults=Object.create(null),sr(e,t,r,l);for(const a in e.propsOptions[0])a in r||(r[a]=void 0);s?e.props=o?r:Yr(r):e.type.props?e.props=r:e.props=l,e.attrs=l}function Jl(e,t,s,o){const{props:r,attrs:l,vnode:{patchFlag:a}}=e,c=me(r),[d]=e.propsOptions;let h=!1;if((o||a>0)&&!(a&16)){if(a&8){const f=e.vnode.dynamicProps;for(let p=0;p<f.length;p++){let g=f[p];if(Ls(e.emitsOptions,g))continue;const $=t[g];if(d)if(xe(l,g))$!==l[g]&&(l[g]=$,h=!0);else{const B=Re(g);r[B]=on(d,c,B,$,e,!1)}else $!==l[g]&&(l[g]=$,h=!0)}}}else{sr(e,t,r,l)&&(h=!0);let f;for(const p in c)(!t||!xe(t,p)&&((f=St(p))===p||!xe(t,f)))&&(d?s&&(s[p]!==void 0||s[f]!==void 0)&&(r[p]=on(d,c,p,void 0,e,!0)):delete r[p]);if(l!==c)for(const p in l)(!t||!xe(t,p))&&(delete l[p],h=!0)}h&&ft(e.attrs,"set","")}function sr(e,t,s,o){const[r,l]=e.propsOptions;let a=!1,c;if(t)for(let d in t){if(Zt(d))continue;const h=t[d];let f;r&&xe(r,f=Re(d))?!l||!l.includes(f)?s[f]=h:(c||(c={}))[f]=h:Ls(e.emitsOptions,d)||(!(d in o)||h!==o[d])&&(o[d]=h,a=!0)}if(l){const d=me(s),h=c||ye;for(let f=0;f<l.length;f++){const p=l[f];s[p]=on(r,d,p,h[p],e,!xe(h,p))}}return a}function on(e,t,s,o,r,l){const a=e[s];if(a!=null){const c=xe(a,"default");if(c&&o===void 0){const d=a.default;if(a.type!==Function&&!a.skipFactory&&ue(d)){const{propsDefaults:h}=r;if(s in h)o=h[s];else{const f=fs(r);o=h[s]=d.call(null,t),f()}}else o=d;r.ce&&r.ce._setProp(s,o)}a[0]&&(l&&!c?o=!1:a[1]&&(o===""||o===St(s))&&(o=!0))}return o}const ql=new WeakMap;function nr(e,t,s=!1){const o=s?ql:t.propsCache,r=o.get(e);if(r)return r;const l=e.props,a={},c=[];let d=!1;if(!ue(e)){const f=p=>{d=!0;const[g,$]=nr(p,t,!0);Ee(a,g),$&&c.push(...$)};!s&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!l&&!d)return he(e)&&o.set(e,Rt),Rt;if(ae(l))for(let f=0;f<l.length;f++){const p=Re(l[f]);Kn(p)&&(a[p]=ye)}else if(l)for(const f in l){const p=Re(f);if(Kn(p)){const g=l[f],$=a[p]=ae(g)||ue(g)?{type:g}:Ee({},g),B=$.type;let S=!1,V=!0;if(ae(B))for(let C=0;C<B.length;++C){const P=B[C],U=ue(P)&&P.name;if(U==="Boolean"){S=!0;break}else U==="String"&&(V=!1)}else S=ue(B)&&B.name==="Boolean";$[0]=S,$[1]=V,(S||xe($,"default"))&&c.push(p)}}const h=[a,c];return he(e)&&o.set(e,h),h}function Kn(e){return e[0]!=="$"&&!Zt(e)}const kn=e=>e==="_"||e==="_ctx"||e==="$stable",$n=e=>ae(e)?e.map(tt):[tt(e)],Gl=(e,t,s)=>{if(t._n)return t;const o=cl((...r)=>$n(t(...r)),s);return o._c=!1,o},or=(e,t,s)=>{const o=e._ctx;for(const r in e){if(kn(r))continue;const l=e[r];if(ue(l))t[r]=Gl(r,l,o);else if(l!=null){const a=$n(l);t[r]=()=>a}}},rr=(e,t)=>{const s=$n(t);e.slots.default=()=>s},lr=(e,t,s)=>{for(const o in t)(s||!kn(o))&&(e[o]=t[o])},Yl=(e,t,s)=>{const o=e.slots=er();if(e.vnode.shapeFlag&32){const r=t._;r?(lr(o,t,s),s&&go(o,"_",r,!0)):or(t,o)}else t&&rr(e,t)},Zl=(e,t,s)=>{const{vnode:o,slots:r}=e;let l=!0,a=ye;if(o.shapeFlag&32){const c=t._;c?s&&c===1?l=!1:lr(r,t,s):(l=!t.$stable,or(t,r)),a=t}else t&&(rr(e,t),a={default:1});if(l)for(const c in r)!kn(c)&&a[c]==null&&delete r[c]},Le=sa;function Ql(e){return Xl(e)}function Xl(e,t){const s=Ms();s.__VUE__=!0;const{insert:o,remove:r,patchProp:l,createElement:a,createText:c,createComment:d,setText:h,setElementText:f,parentNode:p,nextSibling:g,setScopeId:$=nt,insertStaticContent:B}=e,S=(i,u,k,E=null,m=null,M=null,W=void 0,j=null,F=!!u.dynamicChildren)=>{if(i===u)return;i&&!Jt(i,u)&&(E=yt(i),ke(i,m,M,!0),i=null),u.patchFlag===-2&&(F=!1,u.dynamicChildren=null);const{type:D,ref:oe,shapeFlag:q}=u;switch(D){case Us:V(i,u,k,E);break;case $t:C(i,u,k,E);break;case bs:i==null&&P(u,k,E,W);break;case ne:y(i,u,k,E,m,M,W,j,F);break;default:q&1?Q(i,u,k,E,m,M,W,j,F):q&6?I(i,u,k,E,m,M,W,j,F):(q&64||q&128)&&D.process(i,u,k,E,m,M,W,j,F,Ke)}oe!=null&&m?es(oe,i&&i.ref,M,u||i,!u):oe==null&&i&&i.ref!=null&&es(i.ref,null,M,i,!0)},V=(i,u,k,E)=>{if(i==null)o(u.el=c(u.children),k,E);else{const m=u.el=i.el;u.children!==i.children&&h(m,u.children)}},C=(i,u,k,E)=>{i==null?o(u.el=d(u.children||""),k,E):u.el=i.el},P=(i,u,k,E)=>{[i.el,i.anchor]=B(i.children,u,k,E,i.el,i.anchor)},U=({el:i,anchor:u},k,E)=>{let m;for(;i&&i!==u;)m=g(i),o(i,k,E),i=m;o(u,k,E)},O=({el:i,anchor:u})=>{let k;for(;i&&i!==u;)k=g(i),r(i),i=k;r(u)},Q=(i,u,k,E,m,M,W,j,F)=>{if(u.type==="svg"?W="svg":u.type==="math"&&(W="mathml"),i==null)ie(u,k,E,m,M,W,j,F);else{const D=i.el&&i.el._isVueCE?i.el:null;try{D&&D._beginPatch(),T(i,u,m,M,W,j,F)}finally{D&&D._endPatch()}}},ie=(i,u,k,E,m,M,W,j)=>{let F,D;const{props:oe,shapeFlag:q,transition:se,dirs:ce}=i;if(F=i.el=a(i.type,M,oe&&oe.is,oe),q&8?f(F,i.children):q&16&&Z(i.children,F,null,E,m,Js(i,M),W,j),ce&&Ct(i,null,E,"created"),re(F,i,i.scopeId,W,E),oe){for(const be in oe)be!=="value"&&!Zt(be)&&l(F,be,null,oe[be],M,E);"value"in oe&&l(F,"value",null,oe.value,M),(D=oe.onVnodeBeforeMount)&&Ze(D,E,i)}ce&&Ct(i,null,E,"beforeMount");const pe=ea(m,se);pe&&se.beforeEnter(F),o(F,u,k),((D=oe&&oe.onVnodeMounted)||pe||ce)&&Le(()=>{try{D&&Ze(D,E,i),pe&&se.enter(F),ce&&Ct(i,null,E,"mounted")}finally{}},m)},re=(i,u,k,E,m)=>{if(k&&$(i,k),E)for(let M=0;M<E.length;M++)$(i,E[M]);if(m){let M=m.subTree;if(u===M||ur(M.type)&&(M.ssContent===u||M.ssFallback===u)){const W=m.vnode;re(i,W,W.scopeId,W.slotScopeIds,m.parent)}}},Z=(i,u,k,E,m,M,W,j,F=0)=>{for(let D=F;D<i.length;D++){const oe=i[D]=j?dt(i[D]):tt(i[D]);S(null,oe,u,k,E,m,M,W,j)}},T=(i,u,k,E,m,M,W)=>{const j=u.el=i.el;let{patchFlag:F,dynamicChildren:D,dirs:oe}=u;F|=i.patchFlag&16;const q=i.props||ye,se=u.props||ye;let ce;if(k&&Tt(k,!1),(ce=se.onVnodeBeforeUpdate)&&Ze(ce,k,u,i),oe&&Ct(u,i,k,"beforeUpdate"),k&&Tt(k,!0),(q.innerHTML&&se.innerHTML==null||q.textContent&&se.textContent==null)&&f(j,""),D?R(i.dynamicChildren,D,j,k,E,Js(u,m),M):W||ee(i,u,j,null,k,E,Js(u,m),M,!1),F>0){if(F&16)w(j,q,se,k,m);else if(F&2&&q.class!==se.class&&l(j,"class",null,se.class,m),F&4&&l(j,"style",q.style,se.style,m),F&8){const pe=u.dynamicProps;for(let be=0;be<pe.length;be++){const _e=pe[be],Se=q[_e],Te=se[_e];(Te!==Se||_e==="value")&&l(j,_e,Se,Te,m,k)}}F&1&&i.children!==u.children&&f(j,u.children)}else!W&&D==null&&w(j,q,se,k,m);((ce=se.onVnodeUpdated)||oe)&&Le(()=>{ce&&Ze(ce,k,u,i),oe&&Ct(u,i,k,"updated")},E)},R=(i,u,k,E,m,M,W)=>{for(let j=0;j<u.length;j++){const F=i[j],D=u[j],oe=F.el&&(F.type===ne||!Jt(F,D)||F.shapeFlag&198)?p(F.el):k;S(F,D,oe,null,E,m,M,W,!0)}},w=(i,u,k,E,m)=>{if(u!==k){if(u!==ye)for(const M in u)!Zt(M)&&!(M in k)&&l(i,M,u[M],null,m,E);for(const M in k){if(Zt(M))continue;const W=k[M],j=u[M];W!==j&&M!=="value"&&l(i,M,j,W,m,E)}"value"in k&&l(i,"value",u.value,k.value,m)}},y=(i,u,k,E,m,M,W,j,F)=>{const D=u.el=i?i.el:c(""),oe=u.anchor=i?i.anchor:c("");let{patchFlag:q,dynamicChildren:se,slotScopeIds:ce}=u;ce&&(j=j?j.concat(ce):ce),i==null?(o(D,k,E),o(oe,k,E),Z(u.children||[],k,oe,m,M,W,j,F)):q>0&&q&64&&se&&i.dynamicChildren&&i.dynamicChildren.length===se.length?(R(i.dynamicChildren,se,k,m,M,W,j),(u.key!=null||m&&u===m.subTree)&&ar(i,u,!0)):ee(i,u,k,oe,m,M,W,j,F)},I=(i,u,k,E,m,M,W,j,F)=>{u.slotScopeIds=j,i==null?u.shapeFlag&512?m.ctx.activate(u,k,E,W,F):L(u,k,E,m,M,W,F):A(i,u,F)},L=(i,u,k,E,m,M,W)=>{const j=i.component=ca(i,E,m);if(Wo(i)&&(j.ctx.renderer=Ke),da(j,!1,W),j.asyncDep){if(m&&m.registerDep(j,z,W),!i.el){const F=j.subTree=ot($t);C(null,F,u,k),i.placeholder=F.el}}else z(j,i,u,k,m,M,W)},A=(i,u,k)=>{const E=u.component=i.component;if(Kl(i,u,k))if(E.asyncDep&&!E.asyncResolved){le(E,u,k);return}else E.next=u,E.update();else u.el=i.el,E.vnode=u},z=(i,u,k,E,m,M,W)=>{const j=()=>{if(i.isMounted){let{next:q,bu:se,u:ce,parent:pe,vnode:be}=i;{const Ge=ir(i);if(Ge){q&&(q.el=be.el,le(i,q,W)),Ge.asyncDep.then(()=>{Le(()=>{i.isUnmounted||D()},m)});return}}let _e=q,Se;Tt(i,!1),q?(q.el=be.el,le(i,q,W)):q=be,se&&gs(se),(Se=q.props&&q.props.onVnodeBeforeUpdate)&&Ze(Se,pe,q,be),Tt(i,!0);const Te=Fn(i),qe=i.subTree;i.subTree=Te,S(qe,Te,p(qe.el),yt(qe),i,m,M),q.el=Te.el,_e===null&&Wl(i,Te.el),ce&&Le(ce,m),(Se=q.props&&q.props.onVnodeUpdated)&&Le(()=>Ze(Se,pe,q,be),m)}else{let q;const{el:se,props:ce}=u,{bm:pe,m:be,parent:_e,root:Se,type:Te}=i,qe=ts(u);Tt(i,!1),pe&&gs(pe),!qe&&(q=ce&&ce.onVnodeBeforeMount)&&Ze(q,_e,u),Tt(i,!0);{Se.ce&&Se.ce._hasShadowRoot()&&Se.ce._injectChildStyle(Te,i.parent?i.parent.type:void 0);const Ge=i.subTree=Fn(i);S(null,Ge,k,E,i,m,M),u.el=Ge.el}if(be&&Le(be,m),!qe&&(q=ce&&ce.onVnodeMounted)){const Ge=u;Le(()=>Ze(q,_e,Ge),m)}(u.shapeFlag&256||_e&&ts(_e.vnode)&&_e.vnode.shapeFlag&256)&&i.a&&Le(i.a,m),i.isMounted=!0,u=k=E=null}};i.scope.on();const F=i.effect=new _o(j);i.scope.off();const D=i.update=F.run.bind(F),oe=i.job=F.runIfDirty.bind(F);oe.i=i,oe.id=i.uid,F.scheduler=()=>yn(oe),Tt(i,!0),D()},le=(i,u,k)=>{u.component=i;const E=i.vnode.props;i.vnode=u,i.next=null,Jl(i,u.props,E,k),Zl(i,u.children,k),xt(),Dn(i),vt()},ee=(i,u,k,E,m,M,W,j,F=!1)=>{const D=i&&i.children,oe=i?i.shapeFlag:0,q=u.children,{patchFlag:se,shapeFlag:ce}=u;if(se>0){if(se&128){N(D,q,k,E,m,M,W,j,F);return}else if(se&256){J(D,q,k,E,m,M,W,j,F);return}}ce&8?(oe&16&&Je(D,m,M),q!==D&&f(k,q)):oe&16?ce&16?N(D,q,k,E,m,M,W,j,F):Je(D,m,M,!0):(oe&8&&f(k,""),ce&16&&Z(q,k,E,m,M,W,j,F))},J=(i,u,k,E,m,M,W,j,F)=>{i=i||Rt,u=u||Rt;const D=i.length,oe=u.length,q=Math.min(D,oe);let se;for(se=0;se<q;se++){const ce=u[se]=F?dt(u[se]):tt(u[se]);S(i[se],ce,k,null,m,M,W,j,F)}D>oe?Je(i,m,M,!0,!1,q):Z(u,k,E,m,M,W,j,F,q)},N=(i,u,k,E,m,M,W,j,F)=>{let D=0;const oe=u.length;let q=i.length-1,se=oe-1;for(;D<=q&&D<=se;){const ce=i[D],pe=u[D]=F?dt(u[D]):tt(u[D]);if(Jt(ce,pe))S(ce,pe,k,null,m,M,W,j,F);else break;D++}for(;D<=q&&D<=se;){const ce=i[q],pe=u[se]=F?dt(u[se]):tt(u[se]);if(Jt(ce,pe))S(ce,pe,k,null,m,M,W,j,F);else break;q--,se--}if(D>q){if(D<=se){const ce=se+1,pe=ce<oe?u[ce].el:E;for(;D<=se;)S(null,u[D]=F?dt(u[D]):tt(u[D]),k,pe,m,M,W,j,F),D++}}else if(D>se)for(;D<=q;)ke(i[D],m,M,!0),D++;else{const ce=D,pe=D,be=new Map;for(D=pe;D<=se;D++){const Ve=u[D]=F?dt(u[D]):tt(u[D]);Ve.key!=null&&be.set(Ve.key,D)}let _e,Se=0;const Te=se-pe+1;let qe=!1,Ge=0;const Wt=new Array(Te);for(D=0;D<Te;D++)Wt[D]=0;for(D=ce;D<=q;D++){const Ve=i[D];if(Se>=Te){ke(Ve,m,M,!0);continue}let Ye;if(Ve.key!=null)Ye=be.get(Ve.key);else for(_e=pe;_e<=se;_e++)if(Wt[_e-pe]===0&&Jt(Ve,u[_e])){Ye=_e;break}Ye===void 0?ke(Ve,m,M,!0):(Wt[Ye-pe]=D+1,Ye>=Ge?Ge=Ye:qe=!0,S(Ve,u[Ye],k,null,m,M,W,j,F),Se++)}const Tn=qe?ta(Wt):Rt;for(_e=Tn.length-1,D=Te-1;D>=0;D--){const Ve=pe+D,Ye=u[Ve],Pn=u[Ve+1],En=Ve+1<oe?Pn.el||cr(Pn):E;Wt[D]===0?S(null,Ye,k,En,m,M,W,j,F):qe&&(_e<0||D!==Tn[_e]?Ce(Ye,k,En,2):_e--)}}},Ce=(i,u,k,E,m=null)=>{const{el:M,type:W,transition:j,children:F,shapeFlag:D}=i;if(D&6){Ce(i.component.subTree,u,k,E);return}if(D&128){i.suspense.move(u,k,E);return}if(D&64){W.move(i,u,k,Ke);return}if(W===ne){o(M,u,k);for(let q=0;q<F.length;q++)Ce(F[q],u,k,E);o(i.anchor,u,k);return}if(W===bs){U(i,u,k);return}if(E!==2&&D&1&&j)if(E===0)j.beforeEnter(M),o(M,u,k),Le(()=>j.enter(M),m);else{const{leave:q,delayLeave:se,afterLeave:ce}=j,pe=()=>{i.ctx.isUnmounted?r(M):o(M,u,k)},be=()=>{M._isLeaving&&M[vl](!0),q(M,()=>{pe(),ce&&ce()})};se?se(M,pe,be):be()}else o(M,u,k)},ke=(i,u,k,E=!1,m=!1)=>{const{type:M,props:W,ref:j,children:F,dynamicChildren:D,shapeFlag:oe,patchFlag:q,dirs:se,cacheIndex:ce,memo:pe}=i;if(q===-2&&(m=!1),j!=null&&(xt(),es(j,null,k,i,!0),vt()),ce!=null&&(u.renderCache[ce]=void 0),oe&256){u.ctx.deactivate(i);return}const be=oe&1&&se,_e=!ts(i);let Se;if(_e&&(Se=W&&W.onVnodeBeforeUnmount)&&Ze(Se,u,i),oe&6)Ot(i.component,k,E);else{if(oe&128){i.suspense.unmount(k,E);return}be&&Ct(i,null,u,"beforeUnmount"),oe&64?i.type.remove(i,u,k,Ke,E):D&&!D.hasOnce&&(M!==ne||q>0&&q&64)?Je(D,u,k,!1,!0):(M===ne&&q&384||!m&&oe&16)&&Je(F,u,k),E&&ge(i)}const Te=pe!=null&&ce==null;(_e&&(Se=W&&W.onVnodeUnmounted)||be||Te)&&Le(()=>{Se&&Ze(Se,u,i),be&&Ct(i,null,u,"unmounted"),Te&&(i.el=null)},k)},ge=i=>{const{type:u,el:k,anchor:E,transition:m}=i;if(u===ne){at(k,E);return}if(u===bs){O(i);return}const M=()=>{r(k),m&&!m.persisted&&m.afterLeave&&m.afterLeave()};if(i.shapeFlag&1&&m&&!m.persisted){const{leave:W,delayLeave:j}=m,F=()=>W(k,M);j?j(i.el,M,F):F()}else M()},at=(i,u)=>{let k;for(;i!==u;)k=g(i),r(i),i=k;r(u)},Ot=(i,u,k)=>{const{bum:E,scope:m,job:M,subTree:W,um:j,m:F,a:D}=i;Wn(F),Wn(D),E&&gs(E),m.stop(),M&&(M.flags|=8,ke(W,i,u,k)),j&&Le(j,u),Le(()=>{i.isUnmounted=!0},u)},Je=(i,u,k,E=!1,m=!1,M=0)=>{for(let W=M;W<i.length;W++)ke(i[W],u,k,E,m)},yt=i=>{if(i.shapeFlag&6)return yt(i.component.subTree);if(i.shapeFlag&128)return i.suspense.next();const u=g(i.anchor||i.el),k=u&&u[ml];return k?g(k):u};let Kt=!1;const _t=(i,u,k)=>{let E;i==null?u._vnode&&(ke(u._vnode,null,null,!0),E=u._vnode.component):S(u._vnode||null,i,u,null,null,null,k),u._vnode=i,Kt||(Kt=!0,Dn(E),No(),Kt=!1)},Ke={p:S,um:ke,m:Ce,r:ge,mt:L,mc:Z,pc:ee,pbc:R,n:yt,o:e};return{render:_t,hydrate:void 0,createApp:Ul(_t)}}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 Tt({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ea(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ar(e,t,s=!1){const o=e.children,r=t.children;if(ae(o)&&ae(r))for(let l=0;l<o.length;l++){const a=o[l];let c=r[l];c.shapeFlag&1&&!c.dynamicChildren&&((c.patchFlag<=0||c.patchFlag===32)&&(c=r[l]=dt(r[l]),c.el=a.el),!s&&c.patchFlag!==-2&&ar(a,c)),c.type===Us&&(c.patchFlag===-1&&(c=r[l]=dt(c)),c.el=a.el),c.type===$t&&!c.el&&(c.el=a.el)}}function ta(e){const t=e.slice(),s=[0];let o,r,l,a,c;const d=e.length;for(o=0;o<d;o++){const h=e[o];if(h!==0){if(r=s[s.length-1],e[r]<h){t[o]=r,s.push(o);continue}for(l=0,a=s.length-1;l<a;)c=l+a>>1,e[s[c]]<h?l=c+1:a=c;h<e[s[l]]&&(l>0&&(t[o]=s[l-1]),s[l]=o)}}for(l=s.length,a=s[l-1];l-- >0;)s[l]=a,a=t[a];return s}function ir(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ir(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 sa(e,t){t&&t.pendingBranch?ae(e)?t.effects.push(...e):t.effects.push(e):il(e)}const ne=Symbol.for("v-fgt"),Us=Symbol.for("v-txt"),$t=Symbol.for("v-cmt"),bs=Symbol.for("v-stc"),ns=[];let Fe=null;function x(e=!1){ns.push(Fe=e?null:[])}function na(){ns.pop(),Fe=ns[ns.length-1]||null}let as=1;function zn(e,t=!1){as+=e,e<0&&Fe&&t&&(Fe.hasOnce=!0)}function dr(e){return e.dynamicChildren=as>0?Fe||Rt:null,na(),as>0&&Fe&&Fe.push(e),e}function v(e,t,s,o,r,l){return dr(n(e,t,s,o,r,l,!0))}function fr(e,t,s,o,r){return dr(ot(e,t,s,o,r,!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,ys=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?$e(e)||Oe(e)||ue(e)?{i:Be,r:e,k:t,f:!!s}:e:null);function n(e,t=null,s=null,o=0,r=null,l=e===ne?0:1,a=!1,c=!1){const d={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&mr(t),ref:t&&ys(t),scopeId:Bo,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:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Be};return c?(Sn(d,s),l&128&&e.normalize(d)):s&&(d.shapeFlag|=$e(s)?8:16),as>0&&!a&&Fe&&(d.patchFlag>0||l&6)&&d.patchFlag!==32&&Fe.push(d),d}const ot=oa;function oa(e,t=null,s=null,o=0,r=null,l=!1){if((!e||e===Jo)&&(e=$t),pr(e)){const c=Vt(e,t,!0);return s&&Sn(c,s),as>0&&!l&&Fe&&(c.shapeFlag&6?Fe[Fe.indexOf(e)]=c:Fe.push(c)),c.patchFlag=-2,c}if(va(e)&&(e=e.__vccOpts),t){t=ra(t);let{class:c,style:d}=t;c&&!$e(c)&&(t.class=G(c)),he(d)&&(bn(d)&&!ae(d)&&(d=Ee({},d)),t.style=It(d))}const a=$e(e)?1:ur(e)?128:xl(e)?64:he(e)?4:ue(e)?2:0;return n(e,t,s,o,r,a,l,!0)}function ra(e){return e?bn(e)||tr(e)?Ee({},e):e:null}function Vt(e,t,s=!1,o=!1){const{props:r,ref:l,patchFlag:a,children:c,transition:d}=e,h=t?la(r||{},t):r,f={__v_isVNode:!0,__v_skip:!0,type:e.type,props:h,key:h&&mr(h),ref:t&&t.ref?s&&l?ae(l)?l.concat(ys(t)):[l,ys(t)]:ys(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!==ne?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:d,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 d&&o&&_n(f,d.clone(f)),f}function X(e=" ",t=0){return ot(Us,null,e,t)}function ut(e,t){const s=ot(bs,null,e);return s.staticCount=t,s}function H(e="",t=!1){return t?(x(),fr($t,null,e)):ot($t,null,e)}function tt(e){return e==null||typeof e=="boolean"?ot($t):ae(e)?ot(ne,null,e.slice()):pr(e)?dt(e):ot(Us,null,String(e))}function dt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Vt(e)}function Sn(e,t){let s=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(ae(t))s=16;else if(typeof t=="object")if(o&65){const r=t.default;r&&(r._c&&(r._d=!1),Sn(e,r()),r._c&&(r._d=!0));return}else{s=32;const r=t._;!r&&!tr(t)?t._ctx=Be:r===3&&Be&&(Be.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ue(t)?(t={default:t,_ctx:Be},s=32):(t=String(t),o&64?(s=16,t=[X(t)]):s=8);e.children=t,e.shapeFlag|=s}function la(...e){const t={};for(let s=0;s<e.length;s++){const o=e[s];for(const r in o)if(r==="class")t.class!==o.class&&(t.class=G([t.class,o.class]));else if(r==="style")t.style=It([t.style,o.style]);else if(Ps(r)){const l=t[r],a=o[r];a&&l!==a&&!(ae(l)&&l.includes(a))?t[r]=l?[].concat(l,a):a:a==null&&l==null&&!Es(r)&&(t[r]=a)}else r!==""&&(t[r]=o[r])}return t}function Ze(e,t,s,o=null){lt(e,t,7,[s,o])}const aa=Yo();let ia=0;function ca(e,t,s){const o=e.type,r=(t?t.appContext:e.appContext)||aa,l={uid:ia++,vnode:e,type:o,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ar(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:nr(o,r),emitsOptions:Zo(o,r),emit:null,emitted:null,propsDefaults:ye,inheritAttrs:o.inheritAttrs,ctx:ye,data:ye,props:ye,attrs:ye,slots:ye,refs:ye,setupState:ye,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 Ie=null;const ua=()=>Ie||Be;let Ts,rn;{const e=Ms(),t=(s,o)=>{let r;return(r=e[s])||(r=e[s]=[]),r.push(o),l=>{r.length>1?r.forEach(a=>a(l)):r[0](l)}};Ts=t("__VUE_INSTANCE_SETTERS__",s=>Ie=s),rn=t("__VUE_SSR_SETTERS__",s=>is=s)}const fs=e=>{const t=Ie;return Ts(e),e.scope.on(),()=>{e.scope.off(),Ts(t)}},Jn=()=>{Ie&&Ie.scope.off(),Ts(null)};function xr(e){return e.vnode.shapeFlag&4}let is=!1;function da(e,t=!1,s=!1){t&&rn(t);const{props:o,children:r}=e.vnode,l=xr(e);zl(e,o,l,t),Yl(e,r,s||t);const a=l?fa(e,t):void 0;return t&&rn(!1),a}function fa(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Il);const{setup:o}=s;if(o){xt();const r=e.setupContext=o.length>1?ma(e):null,l=fs(e),a=ds(o,e,0,[e.props,r]),c=mo(a);if(vt(),l(),(c||e.sp)&&!ts(e)&&Ko(e),c){if(a.then(Jn,Jn),t)return a.then(d=>{qn(e,d)}).catch(d=>{Rs(d,e,0)});e.asyncDep=a}else qn(e,a)}else vr(e)}function qn(e,t,s){ue(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:he(t)&&(e.setupState=Ro(t)),vr(e)}function vr(e,t,s){const o=e.type;e.render||(e.render=o.render||nt);{const r=fs(e);xt();try{Ol(e)}finally{vt(),r()}}}const pa={get(e,t){return Ae(e,"get",""),e[t]}};function ma(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,pa),slots:e.slots,emit:e.emit,expose:t}}function Ns(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 xa(e,t=!0){return ue(e)?e.displayName||e.name:e.name||t&&e.__name}function va(e){return ue(e)&&"__vccOpts"in e}const Pe=(e,t)=>nl(e,t,is),ga="3.5.31";/**
60
+ **/function ds(e,t,s,o){try{return o?e(...o):e()}catch(r){Rs(r,t,s)}}function at(e,t,s,o){if(ce(e)){const r=ds(e,t,s,o);return r&&mo(r)&&r.catch(a=>{Rs(a,t,s)}),r}if(ae(e)){const r=[];for(let a=0;a<e.length;a++)r.push(at(e[a],t,s,o));return r}}function Rs(e,t,s,o=!0){const r=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||ye;if(t){let c=t.parent;const d=t.proxy,h=`https://vuejs.org/error-reference/#runtime-${s}`;for(;c;){const f=c.ec;if(f){for(let p=0;p<f.length;p++)if(f[p](e,d,h)===!1)return}c=c.parent}if(a){xt(),ds(a,null,10,[e,d,h]),vt();return}}aa(e,s,r,o,l)}function aa(e,t,s,o=!0,r=!1){if(r)throw e;console.error(e)}const De=[];let Qe=-1;const Lt=[];let wt=null,Dt=0;const jo=Promise.resolve();let ks=null;function Lo(e){const t=ks||jo;return e?t.then(this?e.bind(this):e):t}function la(e){let t=Qe+1,s=De.length;for(;t<s;){const o=t+s>>>1,r=De[o],a=as(r);a<e||a===e&&r.flags&2?t=o+1:s=o}return t}function yn(e){if(!(e.flags&1)){const t=as(e),s=De[De.length-1];!s||!(e.flags&2)&&t>=as(s)?De.push(e):De.splice(la(t),0,e),e.flags|=1,Uo()}}function Uo(){ks||(ks=jo.then(Vo))}function ia(e){ae(e)?Lt.push(...e):wt&&e.id===-1?wt.splice(Dt+1,0,e):e.flags&1||(Lt.push(e),e.flags|=1),Uo()}function Dn(e,t,s=Qe+1){for(;s<De.length;s++){const o=De[s];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;De.splice(s,1),s--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function No(e){if(Lt.length){const t=[...new Set(Lt)].sort((s,o)=>as(s)-as(o));if(Lt.length=0,wt){wt.push(...t);return}for(wt=t,Dt=0;Dt<wt.length;Dt++){const s=wt[Dt];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}wt=null,Dt=0}}const as=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Vo(e){try{for(Qe=0;Qe<De.length;Qe++){const t=De[Qe];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(;Qe<De.length;Qe++){const t=De[Qe];t&&(t.flags&=-2)}Qe=-1,De.length=0,No(),ks=null,(De.length||Lt.length)&&Vo()}}let Be=null,Bo=null;function $s(e){const t=Be;return Be=e,Bo=e&&e.type.__scopeId||null,t}function ca(e,t=Be,s){if(!t||e._n)return e;const o=(...r)=>{o._d&&zn(-1);const a=$s(t);let l;try{l=e(...r)}finally{$s(a),o._d&&zn(1)}return l};return o._n=!0,o._c=!0,o._d=!0,o}function G(e,t){if(Be===null)return e;const s=Ns(Be),o=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[a,l,c,d=ye]=t[r];a&&(ce(a)&&(a={mounted:a,updated:a}),a.deep&&pt(l),o.push({dir:a,instance:s,value:l,oldValue:void 0,arg:c,modifiers:d}))}return e}function Ct(e,t,s,o){const r=e.dirs,a=t&&t.dirs;for(let l=0;l<r.length;l++){const c=r[l];a&&(c.oldValue=a[l].value);let d=c.dir[o];d&&(xt(),at(d,s,8,[e.el,c,e,t]),vt())}}function ua(e,t){if(Ie){let s=Ie.provides;const o=Ie.parent&&Ie.parent.provides;o===s&&(s=Ie.provides=Object.create(o)),s[e]=t}}function hs(e,t,s=!1){const o=ul();if(o||Ut){let r=Ut?Ut._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return s&&ce(t)?t.call(o&&o.proxy):t}}const da=Symbol.for("v-scx"),fa=()=>hs(da);function Ws(e,t,s){return Fo(e,t,s)}function Fo(e,t,s=ye){const{immediate:o,deep:r,flush:a,once:l}=s,c=Pe({},s),d=t&&o||!t&&a!=="post";let h;if(is){if(a==="sync"){const $=fa();h=$.__watcherHandles||($.__watcherHandles=[])}else if(!d){const $=()=>{};return $.stop=nt,$.resume=nt,$.pause=nt,$}}const f=Ie;c.call=($,N,C)=>at($,f,N,C);let p=!1;a==="post"?c.scheduler=$=>{Le($,f&&f.suspense)}:a!=="sync"&&(p=!0,c.scheduler=($,N)=>{N?$():yn($)}),c.augmentJob=$=>{t&&($.flags|=4),p&&($.flags|=2,f&&($.id=f.uid,$.i=f))};const g=ra(e,t,c);return is&&(h?h.push(g):d&&g()),g}function pa(e,t,s){const o=this.proxy,r=Se(e)?e.includes(".")?Ho(o,e):()=>o[e]:e.bind(o,o);let a;ce(t)?a=t:(a=t.handler,s=t);const l=fs(this),c=Fo(r,a.bind(o),s);return l(),c}function Ho(e,t){const s=t.split(".");return()=>{let o=e;for(let r=0;r<s.length&&o;r++)o=o[s[r]];return o}}const ma=Symbol("_vte"),xa=e=>e.__isTeleport,va=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 Ne(e,t){return ce(e)?Pe({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 Ss=new WeakMap;function es(e,t,s,o,r=!1){if(ae(e)){e.forEach((C,U)=>es(C,t&&(ae(t)?t[U]:t),s,o,r));return}if(ts(o)&&!r){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&es(e,t,s,o.component.subTree);return}const a=o.shapeFlag&4?Ns(o.component):o.el,l=r?null:a,{i:c,r:d}=e,h=t&&t.r,f=c.refs===ye?c.refs={}:c.refs,p=c.setupState,g=me(p),$=p===ye?po:C=>Rn(f,C)?!1:xe(g,C),N=(C,U)=>!(U&&Rn(f,U));if(h!=null&&h!==d){if(jn(t),Se(h))f[h]=null,$(h)&&(p[h]=null);else if(Oe(h)){const C=t;N(h,C.k)&&(h.value=null),C.k&&(f[C.k]=null)}}if(ce(d))ds(d,c,12,[l,f]);else{const C=Se(d),U=Oe(d);if(C||U){const S=()=>{if(e.f){const P=C?$(d)?p[d]:f[d]:N()||!e.k?d.value:f[e.k];if(r)ae(P)&&cn(P,a);else if(ae(P))P.includes(a)||P.push(a);else if(C)f[d]=[a],$(d)&&(p[d]=f[d]);else{const L=[a];N(d,e.k)&&(d.value=L),e.k&&(f[e.k]=L)}}else C?(f[d]=l,$(d)&&(p[d]=l)):U&&(N(d,e.k)&&(d.value=l),e.k&&(f[e.k]=l))};if(l){const P=()=>{S(),Ss.delete(e)};P.id=-1,Ss.set(e,P),Le(P,s)}else jn(e),S()}}}function jn(e){const t=Ss.get(e);t&&(t.flags|=8,Ss.delete(e))}Ms().requestIdleCallback;Ms().cancelIdleCallback;const ts=e=>!!e.type.__asyncLoader,Wo=e=>e.type.__isKeepAlive;function ga(e,t){zo(e,"a",t)}function ha(e,t){zo(e,"da",t)}function zo(e,t,s=Ie){const o=e.__wdc||(e.__wdc=()=>{let r=s;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(js(t,o,s),s){let r=s.parent;for(;r&&r.parent;)Wo(r.parent.vnode)&&ba(o,t,s,r),r=r.parent}}function ba(e,t,s,o){const r=js(t,e,o,!0);wn(()=>{cn(o[t],r)},s)}function js(e,t,s=Ie,o=!1){if(s){const r=s[e]||(s[e]=[]),a=t.__weh||(t.__weh=(...l)=>{xt();const c=fs(s),d=at(t,s,e,l);return c(),vt(),d});return o?r.unshift(a):r.push(a),a}}const bt=e=>(t,s=Ie)=>{(!is||e==="sp")&&js(e,(...o)=>t(...o),s)},ya=bt("bm"),je=bt("m"),_a=bt("bu"),wa=bt("u"),ka=bt("bum"),wn=bt("um"),$a=bt("sp"),Sa=bt("rtg"),Ca=bt("rtc");function Ta(e,t=Ie){js("ec",e,t)}const Ea="components",Jo=Symbol.for("v-ndc");function Pa(e){return Se(e)?Aa(Ea,e,!1)||e:e||Jo}function Aa(e,t,s=!0,o=!1){const r=Be||Ie;if(r){const a=r.type;{const c=xl(a,!1);if(c&&(c===t||c===Re(t)||c===Is(Re(t))))return a}const l=Ln(r[e]||a[e],t)||Ln(r.appContext[e],t);return!l&&o?a:l}}function Ln(e,t){return e&&(e[t]||e[Re(t)]||e[Is(Re(t))])}function de(e,t,s,o){let r;const a=s,l=ae(e);if(l||Se(e)){const c=l&&At(e);let d=!1,h=!1;c&&(d=!He(e),h=gt(e),e=Ds(e)),r=new Array(e.length);for(let f=0,p=e.length;f<p;f++)r[f]=t(d?h?Nt(ze(e[f])):ze(e[f]):e[f],f,void 0,a)}else if(typeof e=="number"){r=new Array(e);for(let c=0;c<e;c++)r[c]=t(c+1,c,void 0,a)}else if(he(e))if(e[Symbol.iterator])r=Array.from(e,(c,d)=>t(c,d,void 0,a));else{const c=Object.keys(e);r=new Array(c.length);for(let d=0,h=c.length;d<h;d++){const f=c[d];r[d]=t(e[f],f,d,a)}}else r=[];return r}const tn=e=>e?xr(e)?Ns(e):tn(e.parent):null,ss=Pe(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=>Yo(e),$forceUpdate:e=>e.f||(e.f=()=>{yn(e.update)}),$nextTick:e=>e.n||(e.n=Lo.bind(e.proxy)),$watch:e=>pa.bind(e)}),zs=(e,t)=>e!==ye&&!e.__isScriptSetup&&xe(e,t),Ia={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:o,data:r,props:a,accessCache:l,type:c,appContext:d}=e;if(t[0]!=="$"){const g=l[t];if(g!==void 0)switch(g){case 1:return o[t];case 2:return r[t];case 4:return s[t];case 3:return a[t]}else{if(zs(o,t))return l[t]=1,o[t];if(r!==ye&&xe(r,t))return l[t]=2,r[t];if(xe(a,t))return l[t]=3,a[t];if(s!==ye&&xe(s,t))return l[t]=4,s[t];sn&&(l[t]=0)}}const h=ss[t];let f,p;if(h)return t==="$attrs"&&Ae(e.attrs,"get",""),h(e);if((f=c.__cssModules)&&(f=f[t]))return f;if(s!==ye&&xe(s,t))return l[t]=4,s[t];if(p=d.config.globalProperties,xe(p,t))return p[t]},set({_:e},t,s){const{data:o,setupState:r,ctx:a}=e;return zs(r,t)?(r[t]=s,!0):o!==ye&&xe(o,t)?(o[t]=s,!0):xe(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(a[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:o,appContext:r,props:a,type:l}},c){let d;return!!(s[c]||e!==ye&&c[0]!=="$"&&xe(e,c)||zs(t,c)||xe(a,c)||xe(o,c)||xe(ss,c)||xe(r.config.globalProperties,c)||(d=l.__cssModules)&&d[c])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:xe(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function Un(e){return ae(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let sn=!0;function Oa(e){const t=Yo(e),s=e.proxy,o=e.ctx;sn=!1,t.beforeCreate&&Nn(t.beforeCreate,e,"bc");const{data:r,computed:a,methods:l,watch:c,provide:d,inject:h,created:f,beforeMount:p,mounted:g,beforeUpdate:$,updated:N,activated:C,deactivated:U,beforeDestroy:S,beforeUnmount:P,destroyed:L,unmounted:O,render:X,renderTracked:le,renderTriggered:oe,errorCaptured:Z,serverPrefetch:E,expose:F,inheritAttrs:V,components:w,directives:b,filters:T}=t;if(h&&Ma(h,o,null),l)for(const ue in l){const se=l[ue];ce(se)&&(o[ue]=se.bind(s))}if(r){const ue=r.call(s,s);he(ue)&&(e.data=gn(ue))}if(sn=!0,a)for(const ue in a){const se=a[ue],H=ce(se)?se.bind(s,s):ce(se.get)?se.get.bind(s,s):nt,j=!ce(se)&&ce(se.set)?se.set.bind(s):nt,$e=Ee({get:H,set:j});Object.defineProperty(o,ue,{enumerable:!0,configurable:!0,get:()=>$e.value,set:ke=>$e.value=ke})}if(c)for(const ue in c)qo(c[ue],o,s,ue);if(d){const ue=ce(d)?d.call(s):d;Reflect.ownKeys(ue).forEach(se=>{ua(se,ue[se])})}f&&Nn(f,e,"c");function J(ue,se){ae(se)?se.forEach(H=>ue(H.bind(s))):se&&ue(se.bind(s))}if(J(ya,p),J(je,g),J(_a,$),J(wa,N),J(ga,C),J(ha,U),J(Ta,Z),J(Ca,le),J(Sa,oe),J(ka,P),J(wn,O),J($a,E),ae(F))if(F.length){const ue=e.exposed||(e.exposed={});F.forEach(se=>{Object.defineProperty(ue,se,{get:()=>s[se],set:H=>s[se]=H,enumerable:!0})})}else e.exposed||(e.exposed={});X&&e.render===nt&&(e.render=X),V!=null&&(e.inheritAttrs=V),w&&(e.components=w),b&&(e.directives=b),E&&Ko(e)}function Ma(e,t,s=nt){ae(e)&&(e=nn(e));for(const o in e){const r=e[o];let a;he(r)?"default"in r?a=hs(r.from||o,r.default,!0):a=hs(r.from||o):a=hs(r),Oe(a)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>a.value,set:l=>a.value=l}):t[o]=a}}function Nn(e,t,s){at(ae(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,s)}function qo(e,t,s,o){let r=o.includes(".")?Ho(s,o):()=>s[o];if(Se(e)){const a=t[e];ce(a)&&Ws(r,a)}else if(ce(e))Ws(r,e.bind(s));else if(he(e))if(ae(e))e.forEach(a=>qo(a,t,s,o));else{const a=ce(e.handler)?e.handler.bind(s):t[e.handler];ce(a)&&Ws(r,a,e)}}function Yo(e){const t=e.type,{mixins:s,extends:o}=t,{mixins:r,optionsCache:a,config:{optionMergeStrategies:l}}=e.appContext,c=a.get(t);let d;return c?d=c:!r.length&&!s&&!o?d=t:(d={},r.length&&r.forEach(h=>Cs(d,h,l,!0)),Cs(d,t,l)),he(t)&&a.set(t,d),d}function Cs(e,t,s,o=!1){const{mixins:r,extends:a}=t;a&&Cs(e,a,s,!0),r&&r.forEach(l=>Cs(e,l,s,!0));for(const l in t)if(!(o&&l==="expose")){const c=Da[l]||s&&s[l];e[l]=c?c(e[l],t[l]):t[l]}return e}const Da={data:Vn,props:Bn,emits:Bn,methods:Gt,computed:Gt,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:Gt,directives:Gt,watch:ja,provide:Vn,inject:Ra};function Vn(e,t){return t?e?function(){return Pe(ce(e)?e.call(this,this):e,ce(t)?t.call(this,this):t)}:t:e}function Ra(e,t){return Gt(nn(e),nn(t))}function nn(e){if(ae(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 Gt(e,t){return e?Pe(Object.create(null),e,t):t}function Bn(e,t){return e?ae(e)&&ae(t)?[...new Set([...e,...t])]:Pe(Object.create(null),Un(e),Un(t??{})):t}function ja(e,t){if(!e)return t;if(!t)return e;const s=Pe(Object.create(null),e);for(const o in t)s[o]=Me(e[o],t[o]);return s}function Go(){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 La=0;function Ua(e,t){return function(o,r=null){ce(o)||(o=Pe({},o)),r!=null&&!he(r)&&(r=null);const a=Go(),l=new WeakSet,c=[];let d=!1;const h=a.app={_uid:La++,_component:o,_props:r,_container:null,_context:a,_instance:null,version:gl,get config(){return a.config},set config(f){},use(f,...p){return l.has(f)||(f&&ce(f.install)?(l.add(f),f.install(h,...p)):ce(f)&&(l.add(f),f(h,...p))),h},mixin(f){return a.mixins.includes(f)||a.mixins.push(f),h},component(f,p){return p?(a.components[f]=p,h):a.components[f]},directive(f,p){return p?(a.directives[f]=p,h):a.directives[f]},mount(f,p,g){if(!d){const $=h._ceVNode||ot(o,r);return $.appContext=a,g===!0?g="svg":g===!1&&(g=void 0),e($,f,g),d=!0,h._container=f,f.__vue_app__=h,Ns($.component)}},onUnmount(f){c.push(f)},unmount(){d&&(at(c,h._instance,16),e(null,h._container),delete h._container.__vue_app__)},provide(f,p){return a.provides[f]=p,h},runWithContext(f){const p=Ut;Ut=h;try{return f()}finally{Ut=p}}};return h}}let Ut=null;const Na=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Re(t)}Modifiers`]||e[`${St(t)}Modifiers`];function Va(e,t,...s){if(e.isUnmounted)return;const o=e.vnode.props||ye;let r=s;const a=t.startsWith("update:"),l=a&&Na(o,t.slice(7));l&&(l.trim&&(r=s.map(f=>Se(f)?f.trim():f)),l.number&&(r=s.map(Os)));let c,d=o[c=Vs(t)]||o[c=Vs(Re(t))];!d&&a&&(d=o[c=Vs(St(t))]),d&&at(d,e,6,r);const h=o[c+"Once"];if(h){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,at(h,e,6,r)}}const Ba=new WeakMap;function Zo(e,t,s=!1){const o=s?Ba:t.emitsCache,r=o.get(e);if(r!==void 0)return r;const a=e.emits;let l={},c=!1;if(!ce(e)){const d=h=>{const f=Zo(h,t,!0);f&&(c=!0,Pe(l,f))};!s&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}return!a&&!c?(he(e)&&o.set(e,null),null):(ae(a)?a.forEach(d=>l[d]=null):Pe(l,a),he(e)&&o.set(e,l),l)}function Ls(e,t){return!e||!Es(t)?!1:(t=t.slice(2).replace(/Once$/,""),xe(e,t[0].toLowerCase()+t.slice(1))||xe(e,St(t))||xe(e,t))}function Fn(e){const{type:t,vnode:s,proxy:o,withProxy:r,propsOptions:[a],slots:l,attrs:c,emit:d,render:h,renderCache:f,props:p,data:g,setupState:$,ctx:N,inheritAttrs:C}=e,U=$s(e);let S,P;try{if(s.shapeFlag&4){const O=r||o,X=O;S=tt(h.call(X,O,f,p,$,g,N)),P=c}else{const O=t;S=tt(O.length>1?O(p,{attrs:c,slots:l,emit:d}):O(p,null)),P=t.props?c:Fa(c)}}catch(O){ns.length=0,Rs(O,e,1),S=ot($t)}let L=S;if(P&&C!==!1){const O=Object.keys(P),{shapeFlag:X}=L;O.length&&X&7&&(a&&O.some(Ps)&&(P=Ha(P,a)),L=Vt(L,P,!1,!0))}return s.dirs&&(L=Vt(L,null,!1,!0),L.dirs=L.dirs?L.dirs.concat(s.dirs):s.dirs),s.transition&&_n(L,s.transition),S=L,$s(U),S}const Fa=e=>{let t;for(const s in e)(s==="class"||s==="style"||Es(s))&&((t||(t={}))[s]=e[s]);return t},Ha=(e,t)=>{const s={};for(const o in e)(!Ps(o)||!(o.slice(9)in t))&&(s[o]=e[o]);return s};function Ka(e,t,s){const{props:o,children:r,component:a}=e,{props:l,children:c,patchFlag:d}=t,h=a.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&d>=0){if(d&1024)return!0;if(d&16)return o?Hn(o,l,h):!!l;if(d&8){const f=t.dynamicProps;for(let p=0;p<f.length;p++){const g=f[p];if(Qo(l,o,g)&&!Ls(h,g))return!0}}}else return(r||c)&&(!c||!c.$stable)?!0:o===l?!1:o?l?Hn(o,l,h):!0:!!l;return!1}function Hn(e,t,s){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let r=0;r<o.length;r++){const a=o[r];if(Qo(t,e,a)&&!Ls(s,a))return!0}return!1}function Qo(e,t,s){const o=e[s],r=t[s];return s==="style"&&he(o)&&he(r)?!Ht(o,r):o!==r}function Wa({vnode:e,parent:t,suspense:s},o){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.suspense.vnode.el=r.el=o,e=r),r===e)(e=t.vnode).el=o,t=t.parent;else break}s&&s.activeBranch===e&&(s.vnode.el=o)}const Xo={},er=()=>Object.create(Xo),tr=e=>Object.getPrototypeOf(e)===Xo;function za(e,t,s,o=!1){const r={},a=er();e.propsDefaults=Object.create(null),sr(e,t,r,a);for(const l in e.propsOptions[0])l in r||(r[l]=void 0);s?e.props=o?r:Gr(r):e.type.props?e.props=r:e.props=a,e.attrs=a}function Ja(e,t,s,o){const{props:r,attrs:a,vnode:{patchFlag:l}}=e,c=me(r),[d]=e.propsOptions;let h=!1;if((o||l>0)&&!(l&16)){if(l&8){const f=e.vnode.dynamicProps;for(let p=0;p<f.length;p++){let g=f[p];if(Ls(e.emitsOptions,g))continue;const $=t[g];if(d)if(xe(a,g))$!==a[g]&&(a[g]=$,h=!0);else{const N=Re(g);r[N]=on(d,c,N,$,e,!1)}else $!==a[g]&&(a[g]=$,h=!0)}}}else{sr(e,t,r,a)&&(h=!0);let f;for(const p in c)(!t||!xe(t,p)&&((f=St(p))===p||!xe(t,f)))&&(d?s&&(s[p]!==void 0||s[f]!==void 0)&&(r[p]=on(d,c,p,void 0,e,!0)):delete r[p]);if(a!==c)for(const p in a)(!t||!xe(t,p))&&(delete a[p],h=!0)}h&&ft(e.attrs,"set","")}function sr(e,t,s,o){const[r,a]=e.propsOptions;let l=!1,c;if(t)for(let d in t){if(Zt(d))continue;const h=t[d];let f;r&&xe(r,f=Re(d))?!a||!a.includes(f)?s[f]=h:(c||(c={}))[f]=h:Ls(e.emitsOptions,d)||(!(d in o)||h!==o[d])&&(o[d]=h,l=!0)}if(a){const d=me(s),h=c||ye;for(let f=0;f<a.length;f++){const p=a[f];s[p]=on(r,d,p,h[p],e,!xe(h,p))}}return l}function on(e,t,s,o,r,a){const l=e[s];if(l!=null){const c=xe(l,"default");if(c&&o===void 0){const d=l.default;if(l.type!==Function&&!l.skipFactory&&ce(d)){const{propsDefaults:h}=r;if(s in h)o=h[s];else{const f=fs(r);o=h[s]=d.call(null,t),f()}}else o=d;r.ce&&r.ce._setProp(s,o)}l[0]&&(a&&!c?o=!1:l[1]&&(o===""||o===St(s))&&(o=!0))}return o}const qa=new WeakMap;function nr(e,t,s=!1){const o=s?qa:t.propsCache,r=o.get(e);if(r)return r;const a=e.props,l={},c=[];let d=!1;if(!ce(e)){const f=p=>{d=!0;const[g,$]=nr(p,t,!0);Pe(l,g),$&&c.push(...$)};!s&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!a&&!d)return he(e)&&o.set(e,Rt),Rt;if(ae(a))for(let f=0;f<a.length;f++){const p=Re(a[f]);Kn(p)&&(l[p]=ye)}else if(a)for(const f in a){const p=Re(f);if(Kn(p)){const g=a[f],$=l[p]=ae(g)||ce(g)?{type:g}:Pe({},g),N=$.type;let C=!1,U=!0;if(ae(N))for(let S=0;S<N.length;++S){const P=N[S],L=ce(P)&&P.name;if(L==="Boolean"){C=!0;break}else L==="String"&&(U=!1)}else C=ce(N)&&N.name==="Boolean";$[0]=C,$[1]=U,(C||xe($,"default"))&&c.push(p)}}const h=[l,c];return he(e)&&o.set(e,h),h}function Kn(e){return e[0]!=="$"&&!Zt(e)}const kn=e=>e==="_"||e==="_ctx"||e==="$stable",$n=e=>ae(e)?e.map(tt):[tt(e)],Ya=(e,t,s)=>{if(t._n)return t;const o=ca((...r)=>$n(t(...r)),s);return o._c=!1,o},or=(e,t,s)=>{const o=e._ctx;for(const r in e){if(kn(r))continue;const a=e[r];if(ce(a))t[r]=Ya(r,a,o);else if(a!=null){const l=$n(a);t[r]=()=>l}}},rr=(e,t)=>{const s=$n(t);e.slots.default=()=>s},ar=(e,t,s)=>{for(const o in t)(s||!kn(o))&&(e[o]=t[o])},Ga=(e,t,s)=>{const o=e.slots=er();if(e.vnode.shapeFlag&32){const r=t._;r?(ar(o,t,s),s&&go(o,"_",r,!0)):or(t,o)}else t&&rr(e,t)},Za=(e,t,s)=>{const{vnode:o,slots:r}=e;let a=!0,l=ye;if(o.shapeFlag&32){const c=t._;c?s&&c===1?a=!1:ar(r,t,s):(a=!t.$stable,or(t,r)),l=t}else t&&(rr(e,t),l={default:1});if(a)for(const c in r)!kn(c)&&l[c]==null&&delete r[c]},Le=sl;function Qa(e){return Xa(e)}function Xa(e,t){const s=Ms();s.__VUE__=!0;const{insert:o,remove:r,patchProp:a,createElement:l,createText:c,createComment:d,setText:h,setElementText:f,parentNode:p,nextSibling:g,setScopeId:$=nt,insertStaticContent:N}=e,C=(i,u,k,I=null,m=null,M=null,z=void 0,R=null,B=!!u.dynamicChildren)=>{if(i===u)return;i&&!Jt(i,u)&&(I=yt(i),ke(i,m,M,!0),i=null),u.patchFlag===-2&&(B=!1,u.dynamicChildren=null);const{type:D,ref:re,shapeFlag:q}=u;switch(D){case Us:U(i,u,k,I);break;case $t:S(i,u,k,I);break;case bs:i==null&&P(u,k,I,z);break;case ne:w(i,u,k,I,m,M,z,R,B);break;default:q&1?X(i,u,k,I,m,M,z,R,B):q&6?b(i,u,k,I,m,M,z,R,B):(q&64||q&128)&&D.process(i,u,k,I,m,M,z,R,B,Ke)}re!=null&&m?es(re,i&&i.ref,M,u||i,!u):re==null&&i&&i.ref!=null&&es(i.ref,null,M,i,!0)},U=(i,u,k,I)=>{if(i==null)o(u.el=c(u.children),k,I);else{const m=u.el=i.el;u.children!==i.children&&h(m,u.children)}},S=(i,u,k,I)=>{i==null?o(u.el=d(u.children||""),k,I):u.el=i.el},P=(i,u,k,I)=>{[i.el,i.anchor]=N(i.children,u,k,I,i.el,i.anchor)},L=({el:i,anchor:u},k,I)=>{let m;for(;i&&i!==u;)m=g(i),o(i,k,I),i=m;o(u,k,I)},O=({el:i,anchor:u})=>{let k;for(;i&&i!==u;)k=g(i),r(i),i=k;r(u)},X=(i,u,k,I,m,M,z,R,B)=>{if(u.type==="svg"?z="svg":u.type==="math"&&(z="mathml"),i==null)le(u,k,I,m,M,z,R,B);else{const D=i.el&&i.el._isVueCE?i.el:null;try{D&&D._beginPatch(),E(i,u,m,M,z,R,B)}finally{D&&D._endPatch()}}},le=(i,u,k,I,m,M,z,R)=>{let B,D;const{props:re,shapeFlag:q,transition:te,dirs:ie}=i;if(B=i.el=l(i.type,M,re&&re.is,re),q&8?f(B,i.children):q&16&&Z(i.children,B,null,I,m,Js(i,M),z,R),ie&&Ct(i,null,I,"created"),oe(B,i,i.scopeId,z,I),re){for(const be in re)be!=="value"&&!Zt(be)&&a(B,be,null,re[be],M,I);"value"in re&&a(B,"value",null,re.value,M),(D=re.onVnodeBeforeMount)&&Ze(D,I,i)}ie&&Ct(i,null,I,"beforeMount");const pe=el(m,te);pe&&te.beforeEnter(B),o(B,u,k),((D=re&&re.onVnodeMounted)||pe||ie)&&Le(()=>{try{D&&Ze(D,I,i),pe&&te.enter(B),ie&&Ct(i,null,I,"mounted")}finally{}},m)},oe=(i,u,k,I,m)=>{if(k&&$(i,k),I)for(let M=0;M<I.length;M++)$(i,I[M]);if(m){let M=m.subTree;if(u===M||ur(M.type)&&(M.ssContent===u||M.ssFallback===u)){const z=m.vnode;oe(i,z,z.scopeId,z.slotScopeIds,m.parent)}}},Z=(i,u,k,I,m,M,z,R,B=0)=>{for(let D=B;D<i.length;D++){const re=i[D]=R?dt(i[D]):tt(i[D]);C(null,re,u,k,I,m,M,z,R)}},E=(i,u,k,I,m,M,z)=>{const R=u.el=i.el;let{patchFlag:B,dynamicChildren:D,dirs:re}=u;B|=i.patchFlag&16;const q=i.props||ye,te=u.props||ye;let ie;if(k&&Tt(k,!1),(ie=te.onVnodeBeforeUpdate)&&Ze(ie,k,u,i),re&&Ct(u,i,k,"beforeUpdate"),k&&Tt(k,!0),(q.innerHTML&&te.innerHTML==null||q.textContent&&te.textContent==null)&&f(R,""),D?F(i.dynamicChildren,D,R,k,I,Js(u,m),M):z||se(i,u,R,null,k,I,Js(u,m),M,!1),B>0){if(B&16)V(R,q,te,k,m);else if(B&2&&q.class!==te.class&&a(R,"class",null,te.class,m),B&4&&a(R,"style",q.style,te.style,m),B&8){const pe=u.dynamicProps;for(let be=0;be<pe.length;be++){const _e=pe[be],Ce=q[_e],Te=te[_e];(Te!==Ce||_e==="value")&&a(R,_e,Ce,Te,m,k)}}B&1&&i.children!==u.children&&f(R,u.children)}else!z&&D==null&&V(R,q,te,k,m);((ie=te.onVnodeUpdated)||re)&&Le(()=>{ie&&Ze(ie,k,u,i),re&&Ct(u,i,k,"updated")},I)},F=(i,u,k,I,m,M,z)=>{for(let R=0;R<u.length;R++){const B=i[R],D=u[R],re=B.el&&(B.type===ne||!Jt(B,D)||B.shapeFlag&198)?p(B.el):k;C(B,D,re,null,I,m,M,z,!0)}},V=(i,u,k,I,m)=>{if(u!==k){if(u!==ye)for(const M in u)!Zt(M)&&!(M in k)&&a(i,M,u[M],null,m,I);for(const M in k){if(Zt(M))continue;const z=k[M],R=u[M];z!==R&&M!=="value"&&a(i,M,R,z,m,I)}"value"in k&&a(i,"value",u.value,k.value,m)}},w=(i,u,k,I,m,M,z,R,B)=>{const D=u.el=i?i.el:c(""),re=u.anchor=i?i.anchor:c("");let{patchFlag:q,dynamicChildren:te,slotScopeIds:ie}=u;ie&&(R=R?R.concat(ie):ie),i==null?(o(D,k,I),o(re,k,I),Z(u.children||[],k,re,m,M,z,R,B)):q>0&&q&64&&te&&i.dynamicChildren&&i.dynamicChildren.length===te.length?(F(i.dynamicChildren,te,k,m,M,z,R),(u.key!=null||m&&u===m.subTree)&&lr(i,u,!0)):se(i,u,k,re,m,M,z,R,B)},b=(i,u,k,I,m,M,z,R,B)=>{u.slotScopeIds=R,i==null?u.shapeFlag&512?m.ctx.activate(u,k,I,z,B):T(u,k,I,m,M,z,B):A(i,u,B)},T=(i,u,k,I,m,M,z)=>{const R=i.component=cl(i,I,m);if(Wo(i)&&(R.ctx.renderer=Ke),dl(R,!1,z),R.asyncDep){if(m&&m.registerDep(R,J,z),!i.el){const B=R.subTree=ot($t);S(null,B,u,k),i.placeholder=B.el}}else J(R,i,u,k,m,M,z)},A=(i,u,k)=>{const I=u.component=i.component;if(Ka(i,u,k))if(I.asyncDep&&!I.asyncResolved){ue(I,u,k);return}else I.next=u,I.update();else u.el=i.el,I.vnode=u},J=(i,u,k,I,m,M,z)=>{const R=()=>{if(i.isMounted){let{next:q,bu:te,u:ie,parent:pe,vnode:be}=i;{const Ye=ir(i);if(Ye){q&&(q.el=be.el,ue(i,q,z)),Ye.asyncDep.then(()=>{Le(()=>{i.isUnmounted||D()},m)});return}}let _e=q,Ce;Tt(i,!1),q?(q.el=be.el,ue(i,q,z)):q=be,te&&gs(te),(Ce=q.props&&q.props.onVnodeBeforeUpdate)&&Ze(Ce,pe,q,be),Tt(i,!0);const Te=Fn(i),qe=i.subTree;i.subTree=Te,C(qe,Te,p(qe.el),yt(qe),i,m,M),q.el=Te.el,_e===null&&Wa(i,Te.el),ie&&Le(ie,m),(Ce=q.props&&q.props.onVnodeUpdated)&&Le(()=>Ze(Ce,pe,q,be),m)}else{let q;const{el:te,props:ie}=u,{bm:pe,m:be,parent:_e,root:Ce,type:Te}=i,qe=ts(u);Tt(i,!1),pe&&gs(pe),!qe&&(q=ie&&ie.onVnodeBeforeMount)&&Ze(q,_e,u),Tt(i,!0);{Ce.ce&&Ce.ce._hasShadowRoot()&&Ce.ce._injectChildStyle(Te,i.parent?i.parent.type:void 0);const Ye=i.subTree=Fn(i);C(null,Ye,k,I,i,m,M),u.el=Ye.el}if(be&&Le(be,m),!qe&&(q=ie&&ie.onVnodeMounted)){const Ye=u;Le(()=>Ze(q,_e,Ye),m)}(u.shapeFlag&256||_e&&ts(_e.vnode)&&_e.vnode.shapeFlag&256)&&i.a&&Le(i.a,m),i.isMounted=!0,u=k=I=null}};i.scope.on();const B=i.effect=new _o(R);i.scope.off();const D=i.update=B.run.bind(B),re=i.job=B.runIfDirty.bind(B);re.i=i,re.id=i.uid,B.scheduler=()=>yn(re),Tt(i,!0),D()},ue=(i,u,k)=>{u.component=i;const I=i.vnode.props;i.vnode=u,i.next=null,Ja(i,u.props,I,k),Za(i,u.children,k),xt(),Dn(i),vt()},se=(i,u,k,I,m,M,z,R,B=!1)=>{const D=i&&i.children,re=i?i.shapeFlag:0,q=u.children,{patchFlag:te,shapeFlag:ie}=u;if(te>0){if(te&128){j(D,q,k,I,m,M,z,R,B);return}else if(te&256){H(D,q,k,I,m,M,z,R,B);return}}ie&8?(re&16&&Je(D,m,M),q!==D&&f(k,q)):re&16?ie&16?j(D,q,k,I,m,M,z,R,B):Je(D,m,M,!0):(re&8&&f(k,""),ie&16&&Z(q,k,I,m,M,z,R,B))},H=(i,u,k,I,m,M,z,R,B)=>{i=i||Rt,u=u||Rt;const D=i.length,re=u.length,q=Math.min(D,re);let te;for(te=0;te<q;te++){const ie=u[te]=B?dt(u[te]):tt(u[te]);C(i[te],ie,k,null,m,M,z,R,B)}D>re?Je(i,m,M,!0,!1,q):Z(u,k,I,m,M,z,R,B,q)},j=(i,u,k,I,m,M,z,R,B)=>{let D=0;const re=u.length;let q=i.length-1,te=re-1;for(;D<=q&&D<=te;){const ie=i[D],pe=u[D]=B?dt(u[D]):tt(u[D]);if(Jt(ie,pe))C(ie,pe,k,null,m,M,z,R,B);else break;D++}for(;D<=q&&D<=te;){const ie=i[q],pe=u[te]=B?dt(u[te]):tt(u[te]);if(Jt(ie,pe))C(ie,pe,k,null,m,M,z,R,B);else break;q--,te--}if(D>q){if(D<=te){const ie=te+1,pe=ie<re?u[ie].el:I;for(;D<=te;)C(null,u[D]=B?dt(u[D]):tt(u[D]),k,pe,m,M,z,R,B),D++}}else if(D>te)for(;D<=q;)ke(i[D],m,M,!0),D++;else{const ie=D,pe=D,be=new Map;for(D=pe;D<=te;D++){const Ve=u[D]=B?dt(u[D]):tt(u[D]);Ve.key!=null&&be.set(Ve.key,D)}let _e,Ce=0;const Te=te-pe+1;let qe=!1,Ye=0;const Wt=new Array(Te);for(D=0;D<Te;D++)Wt[D]=0;for(D=ie;D<=q;D++){const Ve=i[D];if(Ce>=Te){ke(Ve,m,M,!0);continue}let Ge;if(Ve.key!=null)Ge=be.get(Ve.key);else for(_e=pe;_e<=te;_e++)if(Wt[_e-pe]===0&&Jt(Ve,u[_e])){Ge=_e;break}Ge===void 0?ke(Ve,m,M,!0):(Wt[Ge-pe]=D+1,Ge>=Ye?Ye=Ge:qe=!0,C(Ve,u[Ge],k,null,m,M,z,R,B),Ce++)}const Tn=qe?tl(Wt):Rt;for(_e=Tn.length-1,D=Te-1;D>=0;D--){const Ve=pe+D,Ge=u[Ve],En=u[Ve+1],Pn=Ve+1<re?En.el||cr(En):I;Wt[D]===0?C(null,Ge,k,Pn,m,M,z,R,B):qe&&(_e<0||D!==Tn[_e]?$e(Ge,k,Pn,2):_e--)}}},$e=(i,u,k,I,m=null)=>{const{el:M,type:z,transition:R,children:B,shapeFlag:D}=i;if(D&6){$e(i.component.subTree,u,k,I);return}if(D&128){i.suspense.move(u,k,I);return}if(D&64){z.move(i,u,k,Ke);return}if(z===ne){o(M,u,k);for(let q=0;q<B.length;q++)$e(B[q],u,k,I);o(i.anchor,u,k);return}if(z===bs){L(i,u,k);return}if(I!==2&&D&1&&R)if(I===0)R.beforeEnter(M),o(M,u,k),Le(()=>R.enter(M),m);else{const{leave:q,delayLeave:te,afterLeave:ie}=R,pe=()=>{i.ctx.isUnmounted?r(M):o(M,u,k)},be=()=>{M._isLeaving&&M[va](!0),q(M,()=>{pe(),ie&&ie()})};te?te(M,pe,be):be()}else o(M,u,k)},ke=(i,u,k,I=!1,m=!1)=>{const{type:M,props:z,ref:R,children:B,dynamicChildren:D,shapeFlag:re,patchFlag:q,dirs:te,cacheIndex:ie,memo:pe}=i;if(q===-2&&(m=!1),R!=null&&(xt(),es(R,null,k,i,!0),vt()),ie!=null&&(u.renderCache[ie]=void 0),re&256){u.ctx.deactivate(i);return}const be=re&1&&te,_e=!ts(i);let Ce;if(_e&&(Ce=z&&z.onVnodeBeforeUnmount)&&Ze(Ce,u,i),re&6)Ot(i.component,k,I);else{if(re&128){i.suspense.unmount(k,I);return}be&&Ct(i,null,u,"beforeUnmount"),re&64?i.type.remove(i,u,k,Ke,I):D&&!D.hasOnce&&(M!==ne||q>0&&q&64)?Je(D,u,k,!1,!0):(M===ne&&q&384||!m&&re&16)&&Je(B,u,k),I&&ge(i)}const Te=pe!=null&&ie==null;(_e&&(Ce=z&&z.onVnodeUnmounted)||be||Te)&&Le(()=>{Ce&&Ze(Ce,u,i),be&&Ct(i,null,u,"unmounted"),Te&&(i.el=null)},k)},ge=i=>{const{type:u,el:k,anchor:I,transition:m}=i;if(u===ne){lt(k,I);return}if(u===bs){O(i);return}const M=()=>{r(k),m&&!m.persisted&&m.afterLeave&&m.afterLeave()};if(i.shapeFlag&1&&m&&!m.persisted){const{leave:z,delayLeave:R}=m,B=()=>z(k,M);R?R(i.el,M,B):B()}else M()},lt=(i,u)=>{let k;for(;i!==u;)k=g(i),r(i),i=k;r(u)},Ot=(i,u,k)=>{const{bum:I,scope:m,job:M,subTree:z,um:R,m:B,a:D}=i;Wn(B),Wn(D),I&&gs(I),m.stop(),M&&(M.flags|=8,ke(z,i,u,k)),R&&Le(R,u),Le(()=>{i.isUnmounted=!0},u)},Je=(i,u,k,I=!1,m=!1,M=0)=>{for(let z=M;z<i.length;z++)ke(i[z],u,k,I,m)},yt=i=>{if(i.shapeFlag&6)return yt(i.component.subTree);if(i.shapeFlag&128)return i.suspense.next();const u=g(i.anchor||i.el),k=u&&u[ma];return k?g(k):u};let Kt=!1;const _t=(i,u,k)=>{let I;i==null?u._vnode&&(ke(u._vnode,null,null,!0),I=u._vnode.component):C(u._vnode||null,i,u,null,null,null,k),u._vnode=i,Kt||(Kt=!0,Dn(I),No(),Kt=!1)},Ke={p:C,um:ke,m:$e,r:ge,mt:T,mc:Z,pc:se,pbc:F,n:yt,o:e};return{render:_t,hydrate:void 0,createApp:Ua(_t)}}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 Tt({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function el(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function lr(e,t,s=!1){const o=e.children,r=t.children;if(ae(o)&&ae(r))for(let a=0;a<o.length;a++){const l=o[a];let c=r[a];c.shapeFlag&1&&!c.dynamicChildren&&((c.patchFlag<=0||c.patchFlag===32)&&(c=r[a]=dt(r[a]),c.el=l.el),!s&&c.patchFlag!==-2&&lr(l,c)),c.type===Us&&(c.patchFlag===-1&&(c=r[a]=dt(c)),c.el=l.el),c.type===$t&&!c.el&&(c.el=l.el)}}function tl(e){const t=e.slice(),s=[0];let o,r,a,l,c;const d=e.length;for(o=0;o<d;o++){const h=e[o];if(h!==0){if(r=s[s.length-1],e[r]<h){t[o]=r,s.push(o);continue}for(a=0,l=s.length-1;a<l;)c=a+l>>1,e[s[c]]<h?a=c+1:l=c;h<e[s[a]]&&(a>0&&(t[o]=s[a-1]),s[a]=o)}}for(a=s.length,l=s[a-1];a-- >0;)s[a]=l,l=t[l];return s}function ir(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ir(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 sl(e,t){t&&t.pendingBranch?ae(e)?t.effects.push(...e):t.effects.push(e):ia(e)}const ne=Symbol.for("v-fgt"),Us=Symbol.for("v-txt"),$t=Symbol.for("v-cmt"),bs=Symbol.for("v-stc"),ns=[];let Fe=null;function x(e=!1){ns.push(Fe=e?null:[])}function nl(){ns.pop(),Fe=ns[ns.length-1]||null}let ls=1;function zn(e,t=!1){ls+=e,e<0&&Fe&&t&&(Fe.hasOnce=!0)}function dr(e){return e.dynamicChildren=ls>0?Fe||Rt:null,nl(),ls>0&&Fe&&Fe.push(e),e}function v(e,t,s,o,r,a){return dr(n(e,t,s,o,r,a,!0))}function fr(e,t,s,o,r){return dr(ot(e,t,s,o,r,!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,ys=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?Se(e)||Oe(e)||ce(e)?{i:Be,r:e,k:t,f:!!s}:e:null);function n(e,t=null,s=null,o=0,r=null,a=e===ne?0:1,l=!1,c=!1){const d={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&mr(t),ref:t&&ys(t),scopeId:Bo,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:a,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Be};return c?(Sn(d,s),a&128&&e.normalize(d)):s&&(d.shapeFlag|=Se(s)?8:16),ls>0&&!l&&Fe&&(d.patchFlag>0||a&6)&&d.patchFlag!==32&&Fe.push(d),d}const ot=ol;function ol(e,t=null,s=null,o=0,r=null,a=!1){if((!e||e===Jo)&&(e=$t),pr(e)){const c=Vt(e,t,!0);return s&&Sn(c,s),ls>0&&!a&&Fe&&(c.shapeFlag&6?Fe[Fe.indexOf(e)]=c:Fe.push(c)),c.patchFlag=-2,c}if(vl(e)&&(e=e.__vccOpts),t){t=rl(t);let{class:c,style:d}=t;c&&!Se(c)&&(t.class=Y(c)),he(d)&&(bn(d)&&!ae(d)&&(d=Pe({},d)),t.style=It(d))}const l=Se(e)?1:ur(e)?128:xa(e)?64:he(e)?4:ce(e)?2:0;return n(e,t,s,o,r,l,a,!0)}function rl(e){return e?bn(e)||tr(e)?Pe({},e):e:null}function Vt(e,t,s=!1,o=!1){const{props:r,ref:a,patchFlag:l,children:c,transition:d}=e,h=t?al(r||{},t):r,f={__v_isVNode:!0,__v_skip:!0,type:e.type,props:h,key:h&&mr(h),ref:t&&t.ref?s&&a?ae(a)?a.concat(ys(t)):[a,ys(t)]:ys(t):a,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!==ne?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:d,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 d&&o&&_n(f,d.clone(f)),f}function Q(e=" ",t=0){return ot(Us,null,e,t)}function ut(e,t){const s=ot(bs,null,e);return s.staticCount=t,s}function K(e="",t=!1){return t?(x(),fr($t,null,e)):ot($t,null,e)}function tt(e){return e==null||typeof e=="boolean"?ot($t):ae(e)?ot(ne,null,e.slice()):pr(e)?dt(e):ot(Us,null,String(e))}function dt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Vt(e)}function Sn(e,t){let s=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(ae(t))s=16;else if(typeof t=="object")if(o&65){const r=t.default;r&&(r._c&&(r._d=!1),Sn(e,r()),r._c&&(r._d=!0));return}else{s=32;const r=t._;!r&&!tr(t)?t._ctx=Be:r===3&&Be&&(Be.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ce(t)?(t={default:t,_ctx:Be},s=32):(t=String(t),o&64?(s=16,t=[Q(t)]):s=8);e.children=t,e.shapeFlag|=s}function al(...e){const t={};for(let s=0;s<e.length;s++){const o=e[s];for(const r in o)if(r==="class")t.class!==o.class&&(t.class=Y([t.class,o.class]));else if(r==="style")t.style=It([t.style,o.style]);else if(Es(r)){const a=t[r],l=o[r];l&&a!==l&&!(ae(a)&&a.includes(l))?t[r]=a?[].concat(a,l):l:l==null&&a==null&&!Ps(r)&&(t[r]=l)}else r!==""&&(t[r]=o[r])}return t}function Ze(e,t,s,o=null){at(e,t,7,[s,o])}const ll=Go();let il=0;function cl(e,t,s){const o=e.type,r=(t?t.appContext:e.appContext)||ll,a={uid:il++,vnode:e,type:o,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ar(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:nr(o,r),emitsOptions:Zo(o,r),emit:null,emitted:null,propsDefaults:ye,inheritAttrs:o.inheritAttrs,ctx:ye,data:ye,props:ye,attrs:ye,slots:ye,refs:ye,setupState:ye,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 a.ctx={_:a},a.root=t?t.root:a,a.emit=Va.bind(null,a),e.ce&&e.ce(a),a}let Ie=null;const ul=()=>Ie||Be;let Ts,rn;{const e=Ms(),t=(s,o)=>{let r;return(r=e[s])||(r=e[s]=[]),r.push(o),a=>{r.length>1?r.forEach(l=>l(a)):r[0](a)}};Ts=t("__VUE_INSTANCE_SETTERS__",s=>Ie=s),rn=t("__VUE_SSR_SETTERS__",s=>is=s)}const fs=e=>{const t=Ie;return Ts(e),e.scope.on(),()=>{e.scope.off(),Ts(t)}},Jn=()=>{Ie&&Ie.scope.off(),Ts(null)};function xr(e){return e.vnode.shapeFlag&4}let is=!1;function dl(e,t=!1,s=!1){t&&rn(t);const{props:o,children:r}=e.vnode,a=xr(e);za(e,o,a,t),Ga(e,r,s||t);const l=a?fl(e,t):void 0;return t&&rn(!1),l}function fl(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ia);const{setup:o}=s;if(o){xt();const r=e.setupContext=o.length>1?ml(e):null,a=fs(e),l=ds(o,e,0,[e.props,r]),c=mo(l);if(vt(),a(),(c||e.sp)&&!ts(e)&&Ko(e),c){if(l.then(Jn,Jn),t)return l.then(d=>{qn(e,d)}).catch(d=>{Rs(d,e,0)});e.asyncDep=l}else qn(e,l)}else vr(e)}function qn(e,t,s){ce(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:he(t)&&(e.setupState=Ro(t)),vr(e)}function vr(e,t,s){const o=e.type;e.render||(e.render=o.render||nt);{const r=fs(e);xt();try{Oa(e)}finally{vt(),r()}}}const pl={get(e,t){return Ae(e,"get",""),e[t]}};function ml(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,pl),slots:e.slots,emit:e.emit,expose:t}}function Ns(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 xl(e,t=!0){return ce(e)?e.displayName||e.name:e.name||t&&e.__name}function vl(e){return ce(e)&&"__vccOpts"in e}const Ee=(e,t)=>na(e,t,is),gl="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 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,ha="http://www.w3.org/2000/svg",ba="http://www.w3.org/1998/Math/MathML",ct=typeof document<"u"?document:null,Yn=ct&&ct.createElement("template"),ya={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,o)=>{const r=t==="svg"?ct.createElementNS(ha,e):t==="mathml"?ct.createElementNS(ba,e):s?ct.createElement(e,{is:s}):ct.createElement(e);return e==="select"&&o&&o.multiple!=null&&r.setAttribute("multiple",o.multiple),r},createText:e=>ct.createTextNode(e),createComment:e=>ct.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ct.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,o,r,l){const a=s?s.previousSibling:t.lastChild;if(r&&(r===l||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),s),!(r===l||!(r=r.nextSibling)););else{Yn.innerHTML=gr(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const c=Yn.content;if(o==="svg"||o==="mathml"){const d=c.firstChild;for(;d.firstChild;)c.appendChild(d.firstChild);c.removeChild(d)}t.insertBefore(c,s)}return[a?a.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},_a=Symbol("_vtc");function wa(e,t,s){const o=e[_a];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Zn=Symbol("_vod"),ka=Symbol("_vsh"),$a=Symbol(""),Sa=/(?:^|;)\s*display\s*:/;function Ca(e,t,s){const o=e.style,r=$e(s);let l=!1;if(s&&!r){if(t)if($e(t))for(const a of t.split(";")){const c=a.slice(0,a.indexOf(":")).trim();s[c]==null&&_s(o,c,"")}else for(const a in t)s[a]==null&&_s(o,a,"");for(const a in s)a==="display"&&(l=!0),_s(o,a,s[a])}else if(r){if(t!==s){const a=o[$a];a&&(s+=";"+a),o.cssText=s,l=Sa.test(s)}}else t&&e.removeAttribute("style");Zn in e&&(e[Zn]=l?o.display:"",e[ka]&&(o.display="none"))}const Qn=/\s*!important$/;function _s(e,t,s){if(ae(s))s.forEach(o=>_s(e,t,o));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const o=Ta(e,t);Qn.test(s)?e.setProperty(St(o),s.replace(Qn,""),"important"):e[o]=s}}const Xn=["Webkit","Moz","ms"],qs={};function Ta(e,t){const s=qs[t];if(s)return s;let o=Re(t);if(o!=="filter"&&o in e)return qs[t]=o;o=Is(o);for(let r=0;r<Xn.length;r++){const l=Xn[r]+o;if(l in e)return qs[t]=l}return t}const eo="http://www.w3.org/1999/xlink";function to(e,t,s,o,r,l=Pr(t)){o&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(eo,t.slice(6,t.length)):e.setAttributeNS(eo,t,s):s==null||l&&!ho(s)?e.removeAttribute(t):e.setAttribute(t,l?"":rt(s)?String(s):s)}function so(e,t,s,o,r){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,d=s==null?e.type==="checkbox"?"on":"":String(s);(c!==d||!("_value"in e))&&(e.value=d),s==null&&e.removeAttribute(t),e._value=s;return}let a=!1;if(s===""||s==null){const c=typeof e[t];c==="boolean"?s=ho(s):s==null&&c==="string"?(s="",a=!0):c==="number"&&(s=0,a=!0)}try{e[t]=s}catch{}a&&e.removeAttribute(r||t)}function kt(e,t,s,o){e.addEventListener(t,s,o)}function Pa(e,t,s,o){e.removeEventListener(t,s,o)}const no=Symbol("_vei");function Ea(e,t,s,o,r=null){const l=e[no]||(e[no]={}),a=l[t];if(o&&a)a.value=o;else{const[c,d]=Aa(t);if(o){const h=l[t]=Ma(o,r);kt(e,c,h,d)}else a&&(Pa(e,c,a,d),l[t]=void 0)}}const oo=/(?:Once|Passive|Capture)$/;function Aa(e){let t;if(oo.test(e)){t={};let o;for(;o=e.match(oo);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):St(e.slice(2)),t]}let Gs=0;const Ia=Promise.resolve(),Oa=()=>Gs||(Ia.then(()=>Gs=0),Gs=Date.now());function Ma(e,t){const s=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=s.attached)return;lt(Da(o,s.value),t,5,[o])};return s.value=e,s.attached=Oa(),s}function Da(e,t){if(ae(t)){const s=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{s.call(e),e._stopped=!0},t.map(o=>r=>!r._stopped&&o&&o(r))}else return t}const ro=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ra=(e,t,s,o,r,l)=>{const a=r==="svg";t==="class"?wa(e,o,a):t==="style"?Ca(e,s,o):Ps(t)?Es(t)||Ea(e,t,s,o,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ja(e,t,o,a))?(so(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&to(e,t,o,a,l,t!=="value")):e._isVueCE&&(La(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!$e(o)))?so(e,Re(t),o,l,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),to(e,t,o,a))};function ja(e,t,s,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&ro(t)&&ue(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 r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return ro(t)&&$e(s)?!1:t in e}function La(e,t){const s=e._def.props;if(!s)return!1;const o=Re(t);return Array.isArray(s)?s.some(r=>Re(r)===o):Object.keys(s).some(r=>Re(r)===o)}const Bt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ae(t)?s=>gs(t,s):t};function Ua(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 ao(e,t,s){return t&&(e=e.trim()),s&&(e=Os(e)),e}const te={created(e,{modifiers:{lazy:t,trim:s,number:o}},r){e[mt]=Bt(r);const l=o||r.props&&r.props.type==="number";kt(e,t?"change":"input",a=>{a.target.composing||e[mt](ao(e.value,s,l))}),(s||l)&&kt(e,"change",()=>{e.value=ao(e.value,s,l)}),t||(kt(e,"compositionstart",Ua),kt(e,"compositionend",lo),kt(e,"change",lo))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:o,trim:r,number:l}},a){if(e[mt]=Bt(a),e.composing)return;const c=(l||e.type==="number")&&!/^0\d/.test(e.value)?Os(e.value):e.value,d=t??"";if(c===d)return;const h=e.getRootNode();(h instanceof Document||h instanceof ShadowRoot)&&h.activeElement===e&&e.type!=="range"&&(o&&t===s||r&&e.value.trim()===d)||(e.value=d)}},io={deep:!0,created(e,t,s){e[mt]=Bt(s),kt(e,"change",()=>{const o=e._modelValue,r=cs(e),l=e.checked,a=e[mt];if(ae(o)){const c=dn(o,r),d=c!==-1;if(l&&!d)a(o.concat(r));else if(!l&&d){const h=[...o];h.splice(c,1),a(h)}}else if(Ft(o)){const c=new Set(o);l?c.add(r):c.delete(r),a(c)}else a(hr(e,l))})},mounted:co,beforeUpdate(e,t,s){e[mt]=Bt(s),co(e,t,s)}};function co(e,{value:t,oldValue:s},o){e._modelValue=t;let r;if(ae(t))r=dn(t,o.props.value)>-1;else if(Ft(t))r=t.has(o.props.value);else{if(t===s)return;r=Ht(t,hr(e,!0))}e.checked!==r&&(e.checked=r)}const ht={deep:!0,created(e,{value:t,modifiers:{number:s}},o){const r=Ft(t);kt(e,"change",()=>{const l=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>s?Os(cs(a)):cs(a));e[mt](e.multiple?r?new Set(l):l:l[0]),e._assigning=!0,Lo(()=>{e._assigning=!1})}),e[mt]=Bt(o)},mounted(e,{value:t}){uo(e,t)},beforeUpdate(e,t,s){e[mt]=Bt(s)},updated(e,{value:t}){e._assigning||uo(e,t)}};function uo(e,t){const s=e.multiple,o=ae(t);if(!(s&&!o&&!Ft(t))){for(let r=0,l=e.options.length;r<l;r++){const a=e.options[r],c=cs(a);if(s)if(o){const d=typeof c;d==="string"||d==="number"?a.selected=t.some(h=>String(h)===String(c)):a.selected=dn(t,c)>-1}else a.selected=t.has(c);else if(Ht(cs(a),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function cs(e){return"_value"in e?e._value:e.value}function hr(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const Na={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Xe=(e,t)=>{const s=e._withKeys||(e._withKeys={}),o=t.join(".");return s[o]||(s[o]=(r=>{if(!("key"in r))return;const l=St(r.key);if(t.some(a=>a===l||Na[a]===l))return e(r)}))},Va=Ee({patchProp:Ra},ya);let fo;function Ba(){return fo||(fo=Ql(Va))}const Fa=((...e)=>{const t=Ba().createApp(...e),{mount:s}=t;return t.mount=o=>{const r=Ka(o);if(!r)return;const l=t._component;!ue(l)&&!l.render&&!l.template&&(l.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const a=s(r,!1,Ha(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),a},t});function Ha(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ka(e){return $e(e)?document.querySelector(e):e}let Cn="";function qt(e){Cn=e}function fe(){return Cn}async function ve(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 o=new Error(s.statusText);throw o.status=s.status,o}return s.json()}const Wa={class:"animate-fade-in"},za={key:0,class:"text-center py-12 text-textSecondary"},Ja={key:1,class:"text-center text-textSecondary py-12"},qa={key:2,class:"space-y-3"},Ga={class:"flex items-center justify-between"},Ya={class:"flex items-center gap-3"},Za={class:"font-medium"},Qa={class:"text-accentLight"},Xa={class:"text-textSecondary text-xs"},ei={key:2,class:"text-muted italic"},ti={class:"text-xs text-textSecondary font-mono"},si={class:"text-right"},ni={class:"flex items-center gap-2 justify-end"},oi={class:"text-xs text-textSecondary"},ri=Ne({__name:"SessionsTab",props:{status:{}},setup(e){const t=e,s=_([]),o=_(!0);async function r(){o.value=!0;try{const h=await ve("/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{o.value=!1}}const l=Pe(()=>{var f;return(((f=t.status)==null?void 0:f.sessions)??s.value).slice().sort((p,g)=>p.status==="active"&&g.status!=="active"?-1:p.status!=="active"&&g.status==="active"?1:g.lastActivity-p.lastActivity)});function a(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 c(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 d(h){return h.lastWaitCallAt?Math.floor((Date.now()-h.lastWaitCallAt)/6e4)<5?"text-success":"text-warn":""}return je(r),(h,f)=>(x(),v("div",Wa,[o.value&&l.value.length===0?(x(),v("div",za,"Loading sessions...")):l.value.length===0?(x(),v("div",Ja,"No sessions")):(x(),v("div",qa,[(x(!0),v(ne,null,de(l.value,p=>(x(),v("div",{key:p.mcpSessionId,class:G(["glass rounded-xl p-4 animate-slide-up",p.status==="disconnected"?"opacity-60":""])},[n("div",Ga,[n("div",Ya,[n("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),n("div",null,[n("div",Za,[p.topicName?(x(),v(ne,{key:0},[n("span",Qa,b(p.topicName),1),n("span",Xa," (thread "+b(p.threadId)+")",1)],64)):p.threadId!=null?(x(),v(ne,{key:1},[X("Thread "+b(p.threadId),1)],64)):(x(),v("span",ei,"Awaiting start_session…"))]),n("div",ti,b(p.mcpSessionId.slice(0,12))+"...",1)])]),n("div",si,[n("div",ni,[n("span",{class:G(["text-sm font-medium",a(p).color])},b(a(p).label),3),c(p)?(x(),v("span",{key:0,class:G(["text-xs ml-2",d(p)])},b(c(p)),3)):H("",!0)]),n("div",oi,b(p.transportType),1)])])],2))),128))]))]))}}),li={class:"animate-fade-in"},ai={class:"flex flex-wrap items-center gap-3 mb-4"},ii={key:0,class:"text-center py-12 text-textSecondary"},ci={key:1,class:"text-center py-12 text-textSecondary"},ui={key:2,class:"space-y-2"},di={class:"flex items-start justify-between gap-3"},fi={class:"flex-1 min-w-0"},pi={class:"flex items-center gap-2 mb-1"},mi={key:0,class:"type-badge",style:{background:"rgba(239,68,68,0.15)",color:"#f87171"}},xi={key:1,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},vi={class:"text-xs text-textSecondary"},gi={class:"text-sm text-textPrimary leading-relaxed"},hi={class:"flex flex-wrap gap-1.5 mt-2"},bi={class:"text-right shrink-0"},yi={class:"text-sm font-mono text-textSecondary"},_i={class:"text-xs text-muted"},wi={class:"text-xs text-muted"},ki=Ne({__name:"MemoryNotesTab",setup(e){const t=_([]),s=_(!1),o=_(""),r=_("created_at"),l=_("");let a=null;async function c(){s.value=!0;try{const f=l.value.trim();let p;if(f)p=await ve(`/api/search?q=${encodeURIComponent(f)}&limit=50`);else{const g=new URLSearchParams({limit:"50",sort:r.value});o.value&&g.set("type",o.value),p=await ve(`/api/notes?${g}`)}t.value=p}finally{s.value=!1}}function d(){a&&clearTimeout(a),a=setTimeout(c,300)}function h(f){if(!f)return"never";const p=Date.now()-new Date(f).getTime(),g=Math.floor(p/6e4);if(g<1)return"just now";if(g<60)return`${g}m ago`;const $=Math.floor(g/60);return $<24?`${$}h ago`:`${Math.floor($/24)}d ago`}return je(c),(f,p)=>(x(),v("div",li,[n("div",ai,[Y(n("input",{"onUpdate:modelValue":p[0]||(p[0]=g=>l.value=g),onInput:d,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),[[te,l.value]]),Y(n("select",{"onUpdate:modelValue":p[1]||(p[1]=g=>o.value=g),onChange:c,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...p[3]||(p[3]=[ut('<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,o.value]]),Y(n("select",{"onUpdate:modelValue":p[2]||(p[2]=g=>r.value=g),onChange:c,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...p[4]||(p[4]=[n("option",{value:"created_at"},"Newest",-1),n("option",{value:"confidence"},"Confidence",-1),n("option",{value:"access_count"},"Most accessed",-1)])],544),[[ht,r.value]])]),s.value?(x(),v("div",ii,"Loading notes...")):t.value.length===0?(x(),v("div",ci,"No notes found")):(x(),v("div",ui,[(x(!0),v(ne,null,de(t.value,g=>(x(),v("div",{key:g.noteId,class:G(["glass rounded-xl p-4 animate-fade-in",`priority-${g.priority||0}`])},[n("div",di,[n("div",fi,[n("div",pi,[n("span",{class:G(["type-badge",`type-${g.type}`])},b(g.type),3),g.priority>=2?(x(),v("span",mi,"HIGH IMPORTANCE")):g.priority===1?(x(),v("span",xi,"NOTABLE")):H("",!0),n("span",vi,b(g.noteId),1)]),n("p",gi,b(g.content),1),n("div",hi,[(x(!0),v(ne,null,de(g.keywords||[],$=>(x(),v("span",{key:$,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},b($),1))),128))])]),n("div",bi,[n("div",yi,b(((Number(g.confidence)||0)*100).toFixed(0))+"%",1),n("div",_i,b(h(g.createdAt)),1),n("div",wi,b(g.accessCount??0)+" hits",1)])])],2))),128))]))]))}}),$i={class:"animate-fade-in space-y-6"},Si={class:"glass rounded-xl p-4"},Ci={class:"flex flex-wrap items-center gap-4 mb-4"},Ti={key:0,class:"text-sm text-success"},Pi={class:"flex flex-wrap items-center gap-3 mb-4"},Ei={key:0,class:"text-sm text-success"},Ai={class:"glass rounded-xl p-6"},Ii={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Oi={class:"flex items-center gap-2"},Mi={key:0,class:"text-sm text-success"},Di={key:0,class:"mb-3"},Ri={class:"mt-4"},ji=["innerHTML"],Li={class:"glass rounded-xl p-6"},Ui={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ni={class:"flex items-center gap-2"},Vi={key:0,class:"text-sm text-success"},Bi={class:"flex gap-2 mb-4"},Fi=["onClick"],Hi={key:0,class:"mb-3"},Ki=["value","placeholder"],Wi={class:"glass rounded-xl p-6"},zi={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ji={class:"flex items-center gap-2"},qi={key:0,class:"text-sm text-success"},Gi={class:"mb-4 flex flex-wrap items-center gap-3"},Yi={class:"flex items-center gap-2"},Zi={class:"font-mono text-sm text-textPrimary"},Qi={key:0,class:"mb-3"},Xi={class:"flex flex-wrap gap-2 mb-3"},ec=["onClick"],tc={class:"mt-4"},sc=["innerHTML"],nc=Ne({__name:"TemplatesTab",setup(e){function t(J){return J.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").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=_("copilot"),o=_(""),r=_(50),l=_(""),a=_(""),c=_(!0),d=_(""),h=_(!1),f=_({}),p=_("copilot"),g=_(""),$=_(""),B=_(!0),S=_(""),V=_(!1),C=_([]),P=_("");async function U(){await Promise.all([O(),Q(),ie(),re()])}async function O(){try{const J=await ve("/api/settings/agent-type");s.value=J.agentType||"copilot"}catch{}}async function Q(){try{const J=await ve("/api/settings/bootstrap-message-count");r.value=J.count??50}catch{}}async function ie(){try{const J=await ve("/api/templates");if(J.templates&&J.templates.length>0){const N=J.templates[0];a.value=N.content||"",c.value=N.isDefault??!0}J.agentReminders&&(f.value=J.agentReminders)}catch{}}async function re(){try{const[J,N,Ce]=await Promise.all([ve("/api/templates/drive"),ve("/api/templates/drive-presets"),ve("/api/settings/dmn-activation-hours")]);C.value=N.presets||[],P.value=String(Ce.value??"not set"),J.custom?($.value=J.custom,B.value=!1):($.value=J.default||"",B.value=!0)}catch{}}async function Z(){try{await ve("/api/settings/agent-type",{method:"POST",body:JSON.stringify({agentType:s.value})}),await ve("/api/templates/reminders",{method:"DELETE"}),o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3),await ie()}catch(J){o.value="Error: "+J.message}}async function T(){try{await ve("/api/settings/bootstrap-message-count",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:r.value})}),l.value="Saved ✓",setTimeout(()=>{l.value=""},3e3)}catch(J){l.value="Error: "+J.message}}async function R(){try{const J=await fetch("/api/templates/reminders",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({content:a.value})});if(!J.ok)throw new Error(J.statusText);c.value=!1,d.value="Saved ✓",setTimeout(()=>{d.value=""},3e3)}catch(J){d.value="Error: "+J.message}}async function w(){if(confirm("Reset to default template? Your customizations will be lost."))try{const J=await fetch("/api/templates/reminders",{method:"DELETE",headers:{Authorization:`Bearer ${fe()}`}});if(!J.ok)throw new Error(J.statusText);await ie(),d.value="Reset to default ✓",setTimeout(()=>{d.value=""},3e3)}catch(J){d.value="Error: "+J.message}}async function y(){var Ce;const J=p.value,N=((Ce=f.value[J])==null?void 0:Ce.content)??"";try{const ke=await fetch(`/api/templates/reminders-${J}`,{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({content:N})});if(!ke.ok)throw new Error(ke.statusText);f.value[J]={content:N,isDefault:!1},g.value=`Saved ${J} ✓`,setTimeout(()=>{g.value=""},3e3)}catch(ke){g.value="Error: "+ke.message}}async function I(){const J=p.value;if(confirm(`Reset ${J} agent reminder? The custom template will be removed.`))try{const N=await fetch(`/api/templates/reminders-${J}`,{method:"DELETE",headers:{Authorization:`Bearer ${fe()}`}});if(!N.ok)throw new Error(N.statusText);await ie(),g.value=`Reset ${J} ✓`,setTimeout(()=>{g.value=""},3e3)}catch(N){g.value="Error: "+N.message}}async function L(){const J=$.value;if(!J.trim()){S.value="Template is empty — load a preset first",setTimeout(()=>{S.value=""},3e3);return}try{const N=await fetch("/api/templates/drive",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({content:J})});if(!N.ok)throw new Error(N.statusText);B.value=!1,S.value="Saved ✓",setTimeout(()=>{S.value=""},3e3)}catch(N){S.value="Error: "+N.message}}async function A(){if(confirm("Reset drive template? The custom template will be removed."))try{const J=await fetch("/api/templates/drive",{method:"DELETE",headers:{Authorization:`Bearer ${fe()}`}});if(!J.ok)throw new Error(J.statusText);await re(),S.value="Reset to default ✓",setTimeout(()=>{S.value=""},3e3)}catch(J){S.value="Error: "+J.message}}function z(J){$.value=J.content,B.value=!1}const le=Pe(()=>t(a.value)),ee=Pe(()=>$.value?t($.value):'<span style="color:#6b7280">(no template loaded)</span>');return je(U),(J,N)=>{var Ce,ke;return x(),v("div",$i,[n("div",Si,[n("div",Ci,[N[8]||(N[8]=n("label",{class:"text-sm font-medium text-textSecondary"},"Agent Type",-1)),Y(n("select",{"onUpdate:modelValue":N[0]||(N[0]=ge=>s.value=ge),onChange:Z,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...N[7]||(N[7]=[n("option",{value:"claude"},"Claude",-1),n("option",{value:"copilot"},"Copilot",-1),n("option",{value:"codex"},"Codex",-1)])],544),[[ht,s.value]]),o.value?(x(),v("span",Ti,b(o.value),1)):H("",!0),N[9]||(N[9]=n("span",{class:"text-xs text-muted"},"Changes which default reminders template is used",-1))]),n("div",Pi,[N[10]||(N[10]=n("label",{class:"text-sm font-medium text-textSecondary"},"Bootstrap Messages",-1)),Y(n("input",{"onUpdate:modelValue":N[1]||(N[1]=ge=>r.value=ge),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),[[te,r.value,void 0,{number:!0}]]),n("button",{onClick:T,class:"px-4 py-2 rounded-xl bg-accent text-white text-sm font-medium hover:bg-accent/80 transition-colors"},"Save"),l.value?(x(),v("span",Ei,b(l.value),1)):H("",!0),N[11]||(N[11]=n("span",{class:"text-xs text-muted"},"Number of recent messages injected as warm context (0 = off)",-1))])]),n("div",Ai,[n("div",Ii,[N[12]||(N[12]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Reminders Template"),n("p",{class:"text-sm text-textSecondary mt-1"},"Edit the system prompt template sent with every reminder")],-1)),n("div",Oi,[d.value?(x(),v("span",Mi,b(d.value),1)):H("",!0),n("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"},"Reset to Default"),n("button",{onClick:R,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),c.value?(x(),v("div",Di,[...N[13]||(N[13]=[n("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"USING DEFAULT — edit and save to customize",-1)])])):H("",!0),Y(n("textarea",{"onUpdate:modelValue":N[2]||(N[2]=ge=>a.value=ge),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),[[te,a.value]]),n("div",Ri,[n("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:N[3]||(N[3]=ge=>h.value=!h.value)},[(x(),v("svg",{class:G(["w-4 h-4 text-textSecondary transition-transform",h.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...N[14]||(N[14]=[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),N[15]||(N[15]=n("span",{class:"text-sm font-medium text-textSecondary"},"Preview with highlighted variables",-1))]),h.value?(x(),v("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,ji)):H("",!0)]),N[16]||(N[16]=ut('<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">— &quot;autonomous&quot; or &quot;standard&quot;</span></div></div></details>',1))]),n("div",Li,[n("div",Ui,[N[17]||(N[17]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Agent-Specific Reminders"),n("p",{class:"text-sm text-textSecondary mt-1"},"Appended after the base reminders template — per agent type")],-1)),n("div",Ni,[g.value?(x(),v("span",Vi,b(g.value),1)):H("",!0),n("button",{onClick:I,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"),n("button",{onClick:y,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),n("div",Bi,[(x(),v(ne,null,de(["claude","copilot","codex"],ge=>n("button",{key:ge,onClick:at=>p.value=ge,class:G(["px-4 py-2 rounded-xl text-sm font-medium transition",p.value===ge?"bg-accent text-white":"bg-card hover:bg-cardHover border border-gray-700 text-textSecondary hover:text-textPrimary"])},b(ge.charAt(0).toUpperCase()+ge.slice(1)),11,Fi)),64))]),((Ce=f.value[p.value])==null?void 0:Ce.isDefault)!==!1?(x(),v("div",Hi,[...N[18]||(N[18]=[n("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)])])):H("",!0),n("textarea",{value:((ke=f.value[p.value])==null?void 0:ke.content)??"",onInput:N[4]||(N[4]=ge=>{const at=ge.target;f.value[p.value]={content:at.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,Ki)]),n("div",Wi,[n("div",zi,[N[19]||(N[19]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Drive Framing Template"),n("p",{class:"text-sm text-textSecondary mt-1"},"Customize the autonomous drive prompt sent when the operator is away")],-1)),n("div",Ji,[S.value?(x(),v("span",qi,b(S.value),1)):H("",!0),n("button",{onClick:A,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"),n("button",{onClick:L,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),n("div",Gi,[N[21]||(N[21]=n("label",{class:"text-sm text-textSecondary"},"Drive Activation Period:",-1)),n("div",Yi,[n("span",Zi,b(P.value),1),N[20]||(N[20]=n("span",{class:"text-sm text-textSecondary"},"hours",-1))]),N[22]||(N[22]=n("span",{class:"text-xs text-muted"},"(informational — set via DMN_ACTIVATION_HOURS env var)",-1))]),B.value?(x(),v("div",Qi,[...N[23]||(N[23]=[n("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"(Default — edit to override)",-1)])])):H("",!0),n("div",Xi,[N[24]||(N[24]=n("span",{class:"text-sm text-textSecondary self-center"},"Presets:",-1)),(x(!0),v(ne,null,de(C.value,ge=>(x(),v("button",{key:ge.key,onClick:at=>z(ge),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"},b(ge.label),9,ec))),128))]),Y(n("textarea",{"onUpdate:modelValue":N[5]||(N[5]=ge=>$.value=ge),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),[[te,$.value]]),n("div",tc,[n("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:N[6]||(N[6]=ge=>V.value=!V.value)},[(x(),v("svg",{class:G(["w-4 h-4 text-textSecondary transition-transform",V.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...N[25]||(N[25]=[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),N[26]||(N[26]=n("span",{class:"text-sm font-medium text-textSecondary"},"Preview with sample values",-1))]),V.value?(x(),v("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:ee.value},null,8,sc)):H("",!0)]),N[27]||(N[27]=ut('<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"},ac={key:0,class:"glass rounded-xl p-4 mb-4 border border-accent/30"},ic={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={class:"glass rounded-xl p-4 mb-4 border border-gray-700/50"},mc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-3"},xc={class:"sm:col-span-2"},vc={class:"flex items-center gap-2 mb-3"},gc={key:0,class:"space-y-2"},hc={class:"flex items-center gap-2 min-w-0"},bc=["title"],yc=["onClick"],_c={key:1,class:"text-center py-8 text-textSecondary text-sm"},wc={key:2,class:"text-center text-textSecondary py-12"},kc={key:3,class:"space-y-2"},$c=["onClick"],Sc={class:"flex items-start justify-between gap-3"},Cc={class:"flex-1 min-w-0"},Tc={class:"flex items-center gap-2 mb-1"},Pc={class:"font-medium text-sm"},Ec={key:0,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},Ac={class:"flex flex-wrap gap-1.5 mt-1"},Ic=["title"],Oc={key:0,class:"glass rounded-xl p-6"},Mc={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Dc={class:"text-lg font-semibold"},Rc={class:"text-sm text-textSecondary mt-1"},jc={class:"flex items-center gap-2"},Lc={key:0,class:"text-sm text-success"},Uc={key:1,class:"text-sm text-warn"},Nc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-4"},Vc=["value"],Bc={class:"flex items-end"},Fc={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer pb-2"},Hc=Ne({__name:"SkillsTab",setup(e){const t=_([]),s=_(!0),o=_(null),r=_(""),l=_(""),a=_(!1),c=_(""),d=_(""),h=_(!1),f=_(""),p=_(""),g=_(!1),$=_(""),B=_([]),S=_(""),V=_("sensorium"),C=_("");async function P(){s.value=!0;try{const L=await ve("/api/skills");t.value=L.skills||[]}finally{s.value=!1}}async function U(){const L=await ve("/api/skills/imported");B.value=L.imported||[]}async function O(){const L=S.value.trim();if(!L){C.value="Path is required";return}try{const A=await fetch("/api/skills/import",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({path:L,type:V.value})});if(!A.ok){const z=await A.json().catch(()=>({error:A.statusText}));throw new Error(z.error??A.statusText)}S.value="",C.value="Imported ✓",setTimeout(()=>{C.value=""},3e3),await U()}catch(A){C.value="Error: "+A.message}}async function Q(L){try{const A=await fetch("/api/skills/imported/remove",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({path:L})});if(!A.ok)throw new Error(A.statusText);await U()}catch(A){C.value="Error: "+A.message}}function ie(L){return L?L.includes(".remote-copilot-mcp")&&L.includes("skills")?"user":L.endsWith(".default.md")?"default":L.endsWith(".skill.md")?"project":"unknown":"unknown"}function re(L){const A={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 A[L]||A.unknown}function Z(L){o.value=L,r.value=L.content,l.value=(L.triggers||[]).join(", "),a.value=!!L.replacesOrchestrator,h.value=!1}function T(){o.value=null,d.value=""}function R(L,A,z,le){let ee=`---
65
- name: ${L}
64
+ **/let an;const Yn=typeof window<"u"&&window.trustedTypes;if(Yn)try{an=Yn.createPolicy("vue",{createHTML:e=>e})}catch{}const gr=an?e=>an.createHTML(e):e=>e,hl="http://www.w3.org/2000/svg",bl="http://www.w3.org/1998/Math/MathML",ct=typeof document<"u"?document:null,Gn=ct&&ct.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,o)=>{const r=t==="svg"?ct.createElementNS(hl,e):t==="mathml"?ct.createElementNS(bl,e):s?ct.createElement(e,{is:s}):ct.createElement(e);return e==="select"&&o&&o.multiple!=null&&r.setAttribute("multiple",o.multiple),r},createText:e=>ct.createTextNode(e),createComment:e=>ct.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ct.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,o,r,a){const l=s?s.previousSibling:t.lastChild;if(r&&(r===a||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),s),!(r===a||!(r=r.nextSibling)););else{Gn.innerHTML=gr(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const c=Gn.content;if(o==="svg"||o==="mathml"){const d=c.firstChild;for(;d.firstChild;)c.appendChild(d.firstChild);c.removeChild(d)}t.insertBefore(c,s)}return[l?l.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},_l=Symbol("_vtc");function wl(e,t,s){const o=e[_l];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Zn=Symbol("_vod"),kl=Symbol("_vsh"),$l=Symbol(""),Sl=/(?:^|;)\s*display\s*:/;function Cl(e,t,s){const o=e.style,r=Se(s);let a=!1;if(s&&!r){if(t)if(Se(t))for(const l of t.split(";")){const c=l.slice(0,l.indexOf(":")).trim();s[c]==null&&_s(o,c,"")}else for(const l in t)s[l]==null&&_s(o,l,"");for(const l in s)l==="display"&&(a=!0),_s(o,l,s[l])}else if(r){if(t!==s){const l=o[$l];l&&(s+=";"+l),o.cssText=s,a=Sl.test(s)}}else t&&e.removeAttribute("style");Zn in e&&(e[Zn]=a?o.display:"",e[kl]&&(o.display="none"))}const Qn=/\s*!important$/;function _s(e,t,s){if(ae(s))s.forEach(o=>_s(e,t,o));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const o=Tl(e,t);Qn.test(s)?e.setProperty(St(o),s.replace(Qn,""),"important"):e[o]=s}}const Xn=["Webkit","Moz","ms"],qs={};function Tl(e,t){const s=qs[t];if(s)return s;let o=Re(t);if(o!=="filter"&&o in e)return qs[t]=o;o=Is(o);for(let r=0;r<Xn.length;r++){const a=Xn[r]+o;if(a in e)return qs[t]=a}return t}const eo="http://www.w3.org/1999/xlink";function to(e,t,s,o,r,a=Er(t)){o&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(eo,t.slice(6,t.length)):e.setAttributeNS(eo,t,s):s==null||a&&!ho(s)?e.removeAttribute(t):e.setAttribute(t,a?"":rt(s)?String(s):s)}function so(e,t,s,o,r){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?gr(s):s);return}const a=e.tagName;if(t==="value"&&a!=="PROGRESS"&&!a.includes("-")){const c=a==="OPTION"?e.getAttribute("value")||"":e.value,d=s==null?e.type==="checkbox"?"on":"":String(s);(c!==d||!("_value"in e))&&(e.value=d),s==null&&e.removeAttribute(t),e._value=s;return}let l=!1;if(s===""||s==null){const c=typeof e[t];c==="boolean"?s=ho(s):s==null&&c==="string"?(s="",l=!0):c==="number"&&(s=0,l=!0)}try{e[t]=s}catch{}l&&e.removeAttribute(r||t)}function kt(e,t,s,o){e.addEventListener(t,s,o)}function El(e,t,s,o){e.removeEventListener(t,s,o)}const no=Symbol("_vei");function Pl(e,t,s,o,r=null){const a=e[no]||(e[no]={}),l=a[t];if(o&&l)l.value=o;else{const[c,d]=Al(t);if(o){const h=a[t]=Ml(o,r);kt(e,c,h,d)}else l&&(El(e,c,l,d),a[t]=void 0)}}const oo=/(?:Once|Passive|Capture)$/;function Al(e){let t;if(oo.test(e)){t={};let o;for(;o=e.match(oo);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):St(e.slice(2)),t]}let Ys=0;const Il=Promise.resolve(),Ol=()=>Ys||(Il.then(()=>Ys=0),Ys=Date.now());function Ml(e,t){const s=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=s.attached)return;at(Dl(o,s.value),t,5,[o])};return s.value=e,s.attached=Ol(),s}function Dl(e,t){if(ae(t)){const s=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{s.call(e),e._stopped=!0},t.map(o=>r=>!r._stopped&&o&&o(r))}else return t}const ro=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Rl=(e,t,s,o,r,a)=>{const l=r==="svg";t==="class"?wl(e,o,l):t==="style"?Cl(e,s,o):Es(t)?Ps(t)||Pl(e,t,s,o,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):jl(e,t,o,l))?(so(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&to(e,t,o,l,a,t!=="value")):e._isVueCE&&(Ll(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Se(o)))?so(e,Re(t),o,a,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),to(e,t,o,l))};function jl(e,t,s,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&ro(t)&&ce(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 r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return ro(t)&&Se(s)?!1:t in e}function Ll(e,t){const s=e._def.props;if(!s)return!1;const o=Re(t);return Array.isArray(s)?s.some(r=>Re(r)===o):Object.keys(s).some(r=>Re(r)===o)}const Bt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ae(t)?s=>gs(t,s):t};function Ul(e){e.target.composing=!0}function ao(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const mt=Symbol("_assign");function lo(e,t,s){return t&&(e=e.trim()),s&&(e=Os(e)),e}const ee={created(e,{modifiers:{lazy:t,trim:s,number:o}},r){e[mt]=Bt(r);const a=o||r.props&&r.props.type==="number";kt(e,t?"change":"input",l=>{l.target.composing||e[mt](lo(e.value,s,a))}),(s||a)&&kt(e,"change",()=>{e.value=lo(e.value,s,a)}),t||(kt(e,"compositionstart",Ul),kt(e,"compositionend",ao),kt(e,"change",ao))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:o,trim:r,number:a}},l){if(e[mt]=Bt(l),e.composing)return;const c=(a||e.type==="number")&&!/^0\d/.test(e.value)?Os(e.value):e.value,d=t??"";if(c===d)return;const h=e.getRootNode();(h instanceof Document||h instanceof ShadowRoot)&&h.activeElement===e&&e.type!=="range"&&(o&&t===s||r&&e.value.trim()===d)||(e.value=d)}},io={deep:!0,created(e,t,s){e[mt]=Bt(s),kt(e,"change",()=>{const o=e._modelValue,r=cs(e),a=e.checked,l=e[mt];if(ae(o)){const c=dn(o,r),d=c!==-1;if(a&&!d)l(o.concat(r));else if(!a&&d){const h=[...o];h.splice(c,1),l(h)}}else if(Ft(o)){const c=new Set(o);a?c.add(r):c.delete(r),l(c)}else l(hr(e,a))})},mounted:co,beforeUpdate(e,t,s){e[mt]=Bt(s),co(e,t,s)}};function co(e,{value:t,oldValue:s},o){e._modelValue=t;let r;if(ae(t))r=dn(t,o.props.value)>-1;else if(Ft(t))r=t.has(o.props.value);else{if(t===s)return;r=Ht(t,hr(e,!0))}e.checked!==r&&(e.checked=r)}const ht={deep:!0,created(e,{value:t,modifiers:{number:s}},o){const r=Ft(t);kt(e,"change",()=>{const a=Array.prototype.filter.call(e.options,l=>l.selected).map(l=>s?Os(cs(l)):cs(l));e[mt](e.multiple?r?new Set(a):a:a[0]),e._assigning=!0,Lo(()=>{e._assigning=!1})}),e[mt]=Bt(o)},mounted(e,{value:t}){uo(e,t)},beforeUpdate(e,t,s){e[mt]=Bt(s)},updated(e,{value:t}){e._assigning||uo(e,t)}};function uo(e,t){const s=e.multiple,o=ae(t);if(!(s&&!o&&!Ft(t))){for(let r=0,a=e.options.length;r<a;r++){const l=e.options[r],c=cs(l);if(s)if(o){const d=typeof c;d==="string"||d==="number"?l.selected=t.some(h=>String(h)===String(c)):l.selected=dn(t,c)>-1}else l.selected=t.has(c);else if(Ht(cs(l),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function cs(e){return"_value"in e?e._value:e.value}function hr(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const Nl={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Xe=(e,t)=>{const s=e._withKeys||(e._withKeys={}),o=t.join(".");return s[o]||(s[o]=(r=>{if(!("key"in r))return;const a=St(r.key);if(t.some(l=>l===a||Nl[l]===a))return e(r)}))},Vl=Pe({patchProp:Rl},yl);let fo;function Bl(){return fo||(fo=Qa(Vl))}const Fl=((...e)=>{const t=Bl().createApp(...e),{mount:s}=t;return t.mount=o=>{const r=Kl(o);if(!r)return;const a=t._component;!ce(a)&&!a.render&&!a.template&&(a.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const l=s(r,!1,Hl(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.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 Kl(e){return Se(e)?document.querySelector(e):e}let Cn="";function qt(e){Cn=e}function fe(){return Cn}async function ve(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 o=new Error(s.statusText);throw o.status=s.status,o}return s.json()}const Wl={class:"animate-fade-in"},zl={key:0,class:"text-center py-12 text-textSecondary"},Jl={key:1,class:"text-center text-textSecondary py-12"},ql={key:2,class:"space-y-3"},Yl={class:"flex items-center justify-between"},Gl={class:"flex items-center gap-3"},Zl={class:"font-medium"},Ql={class:"text-accentLight"},Xl={class:"text-textSecondary text-xs"},ei={key:2,class:"text-muted italic"},ti={class:"text-xs text-textSecondary font-mono"},si={class:"text-right"},ni={class:"flex items-center gap-2 justify-end"},oi={class:"text-xs text-textSecondary"},ri=Ne({__name:"SessionsTab",props:{status:{}},setup(e){const t=e,s=_([]),o=_(!0);async function r(){o.value=!0;try{const h=await ve("/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{o.value=!1}}const a=Ee(()=>{var f;return(((f=t.status)==null?void 0:f.sessions)??s.value).slice().sort((p,g)=>p.status==="active"&&g.status!=="active"?-1:p.status!=="active"&&g.status==="active"?1:g.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 c(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 d(h){return h.lastWaitCallAt?Math.floor((Date.now()-h.lastWaitCallAt)/6e4)<5?"text-success":"text-warn":""}return je(r),(h,f)=>(x(),v("div",Wl,[o.value&&a.value.length===0?(x(),v("div",zl,"Loading sessions...")):a.value.length===0?(x(),v("div",Jl,"No sessions")):(x(),v("div",ql,[(x(!0),v(ne,null,de(a.value,p=>(x(),v("div",{key:p.mcpSessionId,class:Y(["glass rounded-xl p-4 animate-slide-up",p.status==="disconnected"?"opacity-60":""])},[n("div",Yl,[n("div",Gl,[n("span",{class:Y(["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),n("div",null,[n("div",Zl,[p.topicName?(x(),v(ne,{key:0},[n("span",Ql,y(p.topicName),1),n("span",Xl," (thread "+y(p.threadId)+")",1)],64)):p.threadId!=null?(x(),v(ne,{key:1},[Q("Thread "+y(p.threadId),1)],64)):(x(),v("span",ei,"Awaiting start_session…"))]),n("div",ti,y(p.mcpSessionId.slice(0,12))+"...",1)])]),n("div",si,[n("div",ni,[n("span",{class:Y(["text-sm font-medium",l(p).color])},y(l(p).label),3),c(p)?(x(),v("span",{key:0,class:Y(["text-xs ml-2",d(p)])},y(c(p)),3)):K("",!0)]),n("div",oi,y(p.transportType),1)])])],2))),128))]))]))}}),ai={class:"animate-fade-in"},li={class:"flex flex-wrap items-center gap-3 mb-4"},ii={key:0,class:"text-center py-12 text-textSecondary"},ci={key:1,class:"text-center py-12 text-textSecondary"},ui={key:2,class:"space-y-2"},di={class:"flex items-start justify-between gap-3"},fi={class:"flex-1 min-w-0"},pi={class:"flex items-center gap-2 mb-1"},mi={key:0,class:"type-badge",style:{background:"rgba(239,68,68,0.15)",color:"#f87171"}},xi={key:1,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},vi={class:"text-xs text-textSecondary"},gi={class:"text-sm text-textPrimary leading-relaxed"},hi={class:"flex flex-wrap gap-1.5 mt-2"},bi={class:"text-right shrink-0"},yi={class:"text-sm font-mono text-textSecondary"},_i={class:"text-xs text-muted"},wi={class:"text-xs text-muted"},ki=Ne({__name:"MemoryNotesTab",setup(e){const t=_([]),s=_(!1),o=_(""),r=_("created_at"),a=_("");let l=null;async function c(){s.value=!0;try{const f=a.value.trim();let p;if(f)p=await ve(`/api/search?q=${encodeURIComponent(f)}&limit=50`);else{const g=new URLSearchParams({limit:"50",sort:r.value});o.value&&g.set("type",o.value),p=await ve(`/api/notes?${g}`)}t.value=p}finally{s.value=!1}}function d(){l&&clearTimeout(l),l=setTimeout(c,300)}function h(f){if(!f)return"never";const p=Date.now()-new Date(f).getTime(),g=Math.floor(p/6e4);if(g<1)return"just now";if(g<60)return`${g}m ago`;const $=Math.floor(g/60);return $<24?`${$}h ago`:`${Math.floor($/24)}d ago`}return je(c),(f,p)=>(x(),v("div",ai,[n("div",li,[G(n("input",{"onUpdate:modelValue":p[0]||(p[0]=g=>a.value=g),onInput:d,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),[[ee,a.value]]),G(n("select",{"onUpdate:modelValue":p[1]||(p[1]=g=>o.value=g),onChange:c,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...p[3]||(p[3]=[ut('<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,o.value]]),G(n("select",{"onUpdate:modelValue":p[2]||(p[2]=g=>r.value=g),onChange:c,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...p[4]||(p[4]=[n("option",{value:"created_at"},"Newest",-1),n("option",{value:"confidence"},"Confidence",-1),n("option",{value:"access_count"},"Most accessed",-1)])],544),[[ht,r.value]])]),s.value?(x(),v("div",ii,"Loading notes...")):t.value.length===0?(x(),v("div",ci,"No notes found")):(x(),v("div",ui,[(x(!0),v(ne,null,de(t.value,g=>(x(),v("div",{key:g.noteId,class:Y(["glass rounded-xl p-4 animate-fade-in",`priority-${g.priority||0}`])},[n("div",di,[n("div",fi,[n("div",pi,[n("span",{class:Y(["type-badge",`type-${g.type}`])},y(g.type),3),g.priority>=2?(x(),v("span",mi,"HIGH IMPORTANCE")):g.priority===1?(x(),v("span",xi,"NOTABLE")):K("",!0),n("span",vi,y(g.noteId),1)]),n("p",gi,y(g.content),1),n("div",hi,[(x(!0),v(ne,null,de(g.keywords||[],$=>(x(),v("span",{key:$,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},y($),1))),128))])]),n("div",bi,[n("div",yi,y(((Number(g.confidence)||0)*100).toFixed(0))+"%",1),n("div",_i,y(h(g.createdAt)),1),n("div",wi,y(g.accessCount??0)+" hits",1)])])],2))),128))]))]))}}),$i={class:"animate-fade-in space-y-6"},Si={class:"glass rounded-xl p-4"},Ci={class:"flex flex-wrap items-center gap-4 mb-4"},Ti={key:0,class:"text-sm text-success"},Ei={class:"flex flex-wrap items-center gap-3 mb-4"},Pi={key:0,class:"text-sm text-success"},Ai={class:"glass rounded-xl p-6"},Ii={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Oi={class:"flex items-center gap-2"},Mi={key:0,class:"text-sm text-success"},Di={key:0,class:"mb-3"},Ri={class:"mt-4"},ji=["innerHTML"],Li={class:"glass rounded-xl p-6"},Ui={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ni={class:"flex items-center gap-2"},Vi={key:0,class:"text-sm text-success"},Bi={class:"flex gap-2 mb-4"},Fi=["onClick"],Hi={key:0,class:"mb-3"},Ki=["value","placeholder"],Wi={class:"glass rounded-xl p-6"},zi={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ji={class:"flex items-center gap-2"},qi={key:0,class:"text-sm text-success"},Yi={class:"mb-4 flex flex-wrap items-center gap-3"},Gi={class:"flex items-center gap-2"},Zi={class:"font-mono text-sm text-textPrimary"},Qi={key:0,class:"mb-3"},Xi={class:"flex flex-wrap gap-2 mb-3"},ec=["onClick"],tc={class:"mt-4"},sc=["innerHTML"],nc=Ne({__name:"TemplatesTab",setup(e){function t(H){return H.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").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=_("copilot"),o=_(""),r=_(50),a=_(""),l=_(""),c=_(!0),d=_(""),h=_(!1),f=_({}),p=_("copilot"),g=_(""),$=_(""),N=_(!0),C=_(""),U=_(!1),S=_([]),P=_("");async function L(){await Promise.all([O(),X(),le(),oe()])}async function O(){try{const H=await ve("/api/settings/agent-type");s.value=H.agentType||"copilot"}catch{}}async function X(){try{const H=await ve("/api/settings/bootstrap-message-count");r.value=H.count??50}catch{}}async function le(){try{const H=await ve("/api/templates");if(H.templates&&H.templates.length>0){const j=H.templates[0];l.value=j.content||"",c.value=j.isDefault??!0}H.agentReminders&&(f.value=H.agentReminders)}catch{}}async function oe(){try{const[H,j,$e]=await Promise.all([ve("/api/templates/drive"),ve("/api/templates/drive-presets"),ve("/api/settings/dmn-activation-hours")]);S.value=j.presets||[],P.value=String($e.value??"not set"),H.custom?($.value=H.custom,N.value=!1):($.value=H.default||"",N.value=!0)}catch{}}async function Z(){try{await ve("/api/settings/agent-type",{method:"POST",body:JSON.stringify({agentType:s.value})}),await ve("/api/templates/reminders",{method:"DELETE"}),o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3),await le()}catch(H){o.value="Error: "+H.message}}async function E(){try{await ve("/api/settings/bootstrap-message-count",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:r.value})}),a.value="Saved ✓",setTimeout(()=>{a.value=""},3e3)}catch(H){a.value="Error: "+H.message}}async function F(){try{const H=await fetch("/api/templates/reminders",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({content:l.value})});if(!H.ok)throw new Error(H.statusText);c.value=!1,d.value="Saved ✓",setTimeout(()=>{d.value=""},3e3)}catch(H){d.value="Error: "+H.message}}async function V(){if(confirm("Reset to default template? Your customizations will be lost."))try{const H=await fetch("/api/templates/reminders",{method:"DELETE",headers:{Authorization:`Bearer ${fe()}`}});if(!H.ok)throw new Error(H.statusText);await le(),d.value="Reset to default ✓",setTimeout(()=>{d.value=""},3e3)}catch(H){d.value="Error: "+H.message}}async function w(){var $e;const H=p.value,j=(($e=f.value[H])==null?void 0:$e.content)??"";try{const ke=await fetch(`/api/templates/reminders-${H}`,{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({content:j})});if(!ke.ok)throw new Error(ke.statusText);f.value[H]={content:j,isDefault:!1},g.value=`Saved ${H} ✓`,setTimeout(()=>{g.value=""},3e3)}catch(ke){g.value="Error: "+ke.message}}async function b(){const H=p.value;if(confirm(`Reset ${H} agent reminder? The custom template will be removed.`))try{const j=await fetch(`/api/templates/reminders-${H}`,{method:"DELETE",headers:{Authorization:`Bearer ${fe()}`}});if(!j.ok)throw new Error(j.statusText);await le(),g.value=`Reset ${H} ✓`,setTimeout(()=>{g.value=""},3e3)}catch(j){g.value="Error: "+j.message}}async function T(){const H=$.value;if(!H.trim()){C.value="Template is empty — load a preset first",setTimeout(()=>{C.value=""},3e3);return}try{const j=await fetch("/api/templates/drive",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({content:H})});if(!j.ok)throw new Error(j.statusText);N.value=!1,C.value="Saved ✓",setTimeout(()=>{C.value=""},3e3)}catch(j){C.value="Error: "+j.message}}async function A(){if(confirm("Reset drive template? The custom template will be removed."))try{const H=await fetch("/api/templates/drive",{method:"DELETE",headers:{Authorization:`Bearer ${fe()}`}});if(!H.ok)throw new Error(H.statusText);await oe(),C.value="Reset to default ✓",setTimeout(()=>{C.value=""},3e3)}catch(H){C.value="Error: "+H.message}}function J(H){$.value=H.content,N.value=!1}const ue=Ee(()=>t(l.value)),se=Ee(()=>$.value?t($.value):'<span style="color:#6b7280">(no template loaded)</span>');return je(L),(H,j)=>{var $e,ke;return x(),v("div",$i,[n("div",Si,[n("div",Ci,[j[8]||(j[8]=n("label",{class:"text-sm font-medium text-textSecondary"},"Agent Type",-1)),G(n("select",{"onUpdate:modelValue":j[0]||(j[0]=ge=>s.value=ge),onChange:Z,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...j[7]||(j[7]=[n("option",{value:"claude"},"Claude",-1),n("option",{value:"copilot"},"Copilot",-1),n("option",{value:"codex"},"Codex",-1)])],544),[[ht,s.value]]),o.value?(x(),v("span",Ti,y(o.value),1)):K("",!0),j[9]||(j[9]=n("span",{class:"text-xs text-muted"},"Changes which default reminders template is used",-1))]),n("div",Ei,[j[10]||(j[10]=n("label",{class:"text-sm font-medium text-textSecondary"},"Bootstrap Messages",-1)),G(n("input",{"onUpdate:modelValue":j[1]||(j[1]=ge=>r.value=ge),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),[[ee,r.value,void 0,{number:!0}]]),n("button",{onClick:E,class:"px-4 py-2 rounded-xl bg-accent text-white text-sm font-medium hover:bg-accent/80 transition-colors"},"Save"),a.value?(x(),v("span",Pi,y(a.value),1)):K("",!0),j[11]||(j[11]=n("span",{class:"text-xs text-muted"},"Number of recent messages injected as warm context (0 = off)",-1))])]),n("div",Ai,[n("div",Ii,[j[12]||(j[12]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Reminders Template"),n("p",{class:"text-sm text-textSecondary mt-1"},"Edit the system prompt template sent with every reminder")],-1)),n("div",Oi,[d.value?(x(),v("span",Mi,y(d.value),1)):K("",!0),n("button",{onClick:V,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"),n("button",{onClick:F,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),c.value?(x(),v("div",Di,[...j[13]||(j[13]=[n("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"USING DEFAULT — edit and save to customize",-1)])])):K("",!0),G(n("textarea",{"onUpdate:modelValue":j[2]||(j[2]=ge=>l.value=ge),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),[[ee,l.value]]),n("div",Ri,[n("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:j[3]||(j[3]=ge=>h.value=!h.value)},[(x(),v("svg",{class:Y(["w-4 h-4 text-textSecondary transition-transform",h.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...j[14]||(j[14]=[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),j[15]||(j[15]=n("span",{class:"text-sm font-medium text-textSecondary"},"Preview with highlighted variables",-1))]),h.value?(x(),v("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:ue.value},null,8,ji)):K("",!0)]),j[16]||(j[16]=ut('<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">— &quot;autonomous&quot; or &quot;standard&quot;</span></div></div></details>',1))]),n("div",Li,[n("div",Ui,[j[17]||(j[17]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Agent-Specific Reminders"),n("p",{class:"text-sm text-textSecondary mt-1"},"Appended after the base reminders template — per agent type")],-1)),n("div",Ni,[g.value?(x(),v("span",Vi,y(g.value),1)):K("",!0),n("button",{onClick:b,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"),n("button",{onClick:w,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),n("div",Bi,[(x(),v(ne,null,de(["claude","copilot","codex"],ge=>n("button",{key:ge,onClick:lt=>p.value=ge,class:Y(["px-4 py-2 rounded-xl text-sm font-medium transition",p.value===ge?"bg-accent text-white":"bg-card hover:bg-cardHover border border-gray-700 text-textSecondary hover:text-textPrimary"])},y(ge.charAt(0).toUpperCase()+ge.slice(1)),11,Fi)),64))]),(($e=f.value[p.value])==null?void 0:$e.isDefault)!==!1?(x(),v("div",Hi,[...j[18]||(j[18]=[n("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)])])):K("",!0),n("textarea",{value:((ke=f.value[p.value])==null?void 0:ke.content)??"",onInput:j[4]||(j[4]=ge=>{const lt=ge.target;f.value[p.value]={content:lt.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,Ki)]),n("div",Wi,[n("div",zi,[j[19]||(j[19]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Drive Framing Template"),n("p",{class:"text-sm text-textSecondary mt-1"},"Customize the autonomous drive prompt sent when the operator is away")],-1)),n("div",Ji,[C.value?(x(),v("span",qi,y(C.value),1)):K("",!0),n("button",{onClick:A,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"),n("button",{onClick:T,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),n("div",Yi,[j[21]||(j[21]=n("label",{class:"text-sm text-textSecondary"},"Drive Activation Period:",-1)),n("div",Gi,[n("span",Zi,y(P.value),1),j[20]||(j[20]=n("span",{class:"text-sm text-textSecondary"},"hours",-1))]),j[22]||(j[22]=n("span",{class:"text-xs text-muted"},"(informational — set via DMN_ACTIVATION_HOURS env var)",-1))]),N.value?(x(),v("div",Qi,[...j[23]||(j[23]=[n("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"(Default — edit to override)",-1)])])):K("",!0),n("div",Xi,[j[24]||(j[24]=n("span",{class:"text-sm text-textSecondary self-center"},"Presets:",-1)),(x(!0),v(ne,null,de(S.value,ge=>(x(),v("button",{key:ge.key,onClick:lt=>J(ge),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"},y(ge.label),9,ec))),128))]),G(n("textarea",{"onUpdate:modelValue":j[5]||(j[5]=ge=>$.value=ge),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),[[ee,$.value]]),n("div",tc,[n("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:j[6]||(j[6]=ge=>U.value=!U.value)},[(x(),v("svg",{class:Y(["w-4 h-4 text-textSecondary transition-transform",U.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...j[25]||(j[25]=[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),j[26]||(j[26]=n("span",{class:"text-sm font-medium text-textSecondary"},"Preview with sample values",-1))]),U.value?(x(),v("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,sc)):K("",!0)]),j[27]||(j[27]=ut('<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"},ac={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},lc={key:0,class:"glass rounded-xl p-4 mb-4 border border-accent/30"},ic={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={class:"glass rounded-xl p-4 mb-4 border border-gray-700/50"},mc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-3"},xc={class:"sm:col-span-2"},vc={class:"flex items-center gap-2 mb-3"},gc={key:0,class:"space-y-2"},hc={class:"flex items-center gap-2 min-w-0"},bc=["title"],yc=["onClick"],_c={key:1,class:"text-center py-8 text-textSecondary text-sm"},wc={key:2,class:"text-center text-textSecondary py-12"},kc={key:3,class:"space-y-2"},$c=["onClick"],Sc={class:"flex items-start justify-between gap-3"},Cc={class:"flex-1 min-w-0"},Tc={class:"flex items-center gap-2 mb-1"},Ec={class:"font-medium text-sm"},Pc={key:0,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},Ac={class:"flex flex-wrap gap-1.5 mt-1"},Ic=["title"],Oc={key:0,class:"glass rounded-xl p-6"},Mc={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Dc={class:"text-lg font-semibold"},Rc={class:"text-sm text-textSecondary mt-1"},jc={class:"flex items-center gap-2"},Lc={key:0,class:"text-sm text-success"},Uc={key:1,class:"text-sm text-warn"},Nc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-4"},Vc=["value"],Bc={class:"flex items-end"},Fc={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer pb-2"},Hc=Ne({__name:"SkillsTab",setup(e){const t=_([]),s=_(!0),o=_(null),r=_(""),a=_(""),l=_(!1),c=_(""),d=_(""),h=_(!1),f=_(""),p=_(""),g=_(!1),$=_(""),N=_([]),C=_(""),U=_("sensorium"),S=_("");async function P(){s.value=!0;try{const T=await ve("/api/skills");t.value=T.skills||[]}finally{s.value=!1}}async function L(){const T=await ve("/api/skills/imported");N.value=T.imported||[]}async function O(){const T=C.value.trim();if(!T){S.value="Path is required";return}try{const A=await fetch("/api/skills/import",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({path:T,type:U.value})});if(!A.ok){const J=await A.json().catch(()=>({error:A.statusText}));throw new Error(J.error??A.statusText)}C.value="",S.value="Imported ✓",setTimeout(()=>{S.value=""},3e3),await L()}catch(A){S.value="Error: "+A.message}}async function X(T){try{const A=await fetch("/api/skills/imported/remove",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({path:T})});if(!A.ok)throw new Error(A.statusText);await L()}catch(A){S.value="Error: "+A.message}}function le(T){return T?T.includes(".remote-copilot-mcp")&&T.includes("skills")?"user":T.endsWith(".default.md")?"default":T.endsWith(".skill.md")?"project":"unknown":"unknown"}function oe(T){const A={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 A[T]||A.unknown}function Z(T){o.value=T,r.value=T.content,a.value=(T.triggers||[]).join(", "),l.value=!!T.replacesOrchestrator,h.value=!1}function E(){o.value=null,d.value=""}function F(T,A,J,ue){let se=`---
65
+ name: ${T}
66
66
  triggers:
67
- `;return A.forEach(J=>{ee+=` - ${J.trim()}
68
- `}),z&&(ee+=`replaces_orchestrator: true
69
- `),ee+=`---
67
+ `;return A.forEach(H=>{se+=` - ${H.trim()}
68
+ `}),J&&(se+=`replaces_orchestrator: true
69
+ `),se+=`---
70
70
 
71
- `,ee+le}async function w(){if(!o.value)return;const L=o.value.name;try{const A=l.value.split(",").map(J=>J.trim()).filter(Boolean),z=r.value;let le;z.trimStart().startsWith("---")?le=z:le=R(L,A,a.value,z);const ee=await fetch(`/api/skills/${encodeURIComponent(L)}`,{method:"PUT",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({content:le})});if(!ee.ok)throw new Error(ee.statusText);c.value="Saved ✓",setTimeout(()=>{c.value=""},3e3),await P()}catch(A){c.value="Error: "+A.message}}async function y(){if(!o.value)return;const L=o.value.name;try{const A=await fetch(`/api/skills/${encodeURIComponent(L)}`,{method:"DELETE",headers:{Authorization:`Bearer ${fe()}`}});if(!A.ok)throw new Error(A.statusText);T(),await P()}catch(A){d.value="Error: "+A.message}}async function I(){const L=f.value.trim(),A=p.value;if(!L){$.value="Name is required";return}const z=A.split(",").map(ee=>ee.trim()).filter(Boolean);if(!z.length){$.value="At least one trigger is required";return}const le=R(L,z,g.value,`\x3C!-- Write your skill instructions here -->
72
- `);try{const ee=await fetch(`/api/skills/${encodeURIComponent(L)}`,{method:"PUT",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({content:le})});if(!ee.ok)throw new Error(ee.statusText);$.value="Created ✓",h.value=!1,await P();const J=t.value.find(N=>N.name===L);J&&Z(J)}catch(ee){$.value="Error: "+ee.message}}return je(()=>{P(),U()}),(L,A)=>(x(),v("div",oc,[n("div",rc,[n("div",lc,[A[10]||(A[10]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Skill Library"),n("p",{class:"text-sm text-textSecondary mt-1"},"Manage intent-routing skills — user overrides, defaults, and project skills")],-1)),n("button",{onClick:A[0]||(A[0]=z=>{h.value=!h.value,o.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?(x(),v("div",ac,[A[14]||(A[14]=n("h4",{class:"text-sm font-semibold mb-3"},"Create New Skill",-1)),n("div",ic,[n("div",null,[A[11]||(A[11]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),Y(n("input",{"onUpdate:modelValue":A[1]||(A[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),[[te,f.value]])]),n("div",null,[A[12]||(A[12]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),Y(n("input",{"onUpdate:modelValue":A[2]||(A[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),[[te,p.value]])])]),n("div",cc,[n("label",uc,[Y(n("input",{"onUpdate:modelValue":A[3]||(A[3]=z=>g.value=z),type:"checkbox",class:"rounded"},null,512),[[io,g.value]]),A[13]||(A[13]=n("span",null,"Replaces orchestrator",-1))])]),n("div",dc,[n("button",{onClick:I,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Create"),n("button",{onClick:A[4]||(A[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"),$.value?(x(),v("span",fc,b($.value),1)):H("",!0)])])):H("",!0),n("div",pc,[A[18]||(A[18]=n("h4",{class:"text-sm font-semibold mb-1"},"Import Skill",-1)),A[19]||(A[19]=n("p",{class:"text-xs text-textSecondary mb-3"},"Register an external skill file by absolute path — read in place, not copied (a git pull on its source updates it).",-1)),n("div",mc,[n("div",xc,[A[15]||(A[15]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Absolute file path",-1)),Y(n("input",{"onUpdate:modelValue":A[5]||(A[5]=z=>S.value=z),type:"text",placeholder:"C:/path/to/skill.md",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),[[te,S.value]])]),n("div",null,[A[17]||(A[17]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Type",-1)),Y(n("select",{"onUpdate:modelValue":A[6]||(A[6]=z=>V.value=z),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"},[...A[16]||(A[16]=[n("option",{value:"sensorium"},"Sensorium",-1),n("option",{value:"claude"},"Claude",-1),n("option",{value:"copilot"},"Copilot",-1)])],512),[[ht,V.value]])])]),n("div",vc,[n("button",{onClick:O,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Import"),C.value?(x(),v("span",{key:0,class:G([C.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},b(C.value),3)):H("",!0)]),B.value.length?(x(),v("div",gc,[(x(!0),v(ne,null,de(B.value,z=>(x(),v("div",{key:z.path,class:"flex items-center justify-between gap-3 rounded-lg bg-surface/50 border border-gray-700/50 px-3 py-2"},[n("div",hc,[n("span",{class:"type-badge",style:It(re("user"))},b(z.type),5),n("span",{class:"text-xs font-mono text-textSecondary truncate",title:z.path},b(z.path),9,bc)]),n("button",{onClick:le=>Q(z.path),class:"px-3 py-1 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 shrink-0"},"Remove",8,yc)]))),128))])):H("",!0)]),s.value?(x(),v("div",_c,"Loading...")):t.value.length===0?(x(),v("div",wc,"No skills loaded")):(x(),v("div",kc,[(x(!0),v(ne,null,de(t.value,z=>{var le;return x(),v("div",{key:z.name,onClick:ee=>Z(z),class:G(["glass rounded-xl p-4 cursor-pointer hover:bg-cardHover transition border",((le=o.value)==null?void 0:le.name)===z.name?"border-accent":"border-transparent"])},[n("div",Sc,[n("div",Cc,[n("div",Tc,[n("span",Pc,b(z.name),1),n("span",{class:"type-badge",style:It(re(ie(z.source)))},b(ie(z.source)),5),z.replacesOrchestrator?(x(),v("span",Ec,"REPLACES ORCH")):H("",!0)]),n("div",Ac,[(x(!0),v(ne,null,de(z.triggers||[],ee=>(x(),v("span",{key:ee,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},b(ee),1))),128))])]),n("div",{class:"text-xs text-muted font-mono shrink-0 max-w-[200px] truncate",title:z.source||""},b((z.source||"").split(/[\\/]/).pop()||""),9,Ic)])],10,$c)}),128))]))]),o.value?(x(),v("div",Oc,[n("div",Mc,[n("div",null,[n("h3",Dc,"Edit: "+b(o.value.name),1),n("p",Rc,b(o.value.source||"(unknown source)"),1)]),n("div",jc,[c.value?(x(),v("span",Lc,b(c.value),1)):H("",!0),d.value?(x(),v("span",Uc,b(d.value),1)):H("",!0),ie(o.value.source)==="user"?(x(),v("button",{key:2,onClick:y,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")):H("",!0),n("button",{onClick:T,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"),n("button",{onClick:w,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),n("div",Nc,[n("div",null,[A[20]||(A[20]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),n("input",{value:o.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,Vc)]),n("div",null,[A[21]||(A[21]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),Y(n("input",{"onUpdate:modelValue":A[7]||(A[7]=z=>l.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),[[te,l.value]])]),n("div",Bc,[n("label",Fc,[Y(n("input",{"onUpdate:modelValue":A[8]||(A[8]=z=>a.value=z),type:"checkbox",class:"rounded"},null,512),[[io,a.value]]),A[22]||(A[22]=n("span",null,"Replaces orchestrator",-1))])])]),Y(n("textarea",{"onUpdate:modelValue":A[9]||(A[9]=z=>r.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),[[te,r.value]])])):H("",!0)]))}}),Kc={class:"animate-fade-in space-y-6"},Wc={class:"glass rounded-xl p-6"},zc={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},Jc={class:"flex items-center gap-3"},qc={key:0,class:"mt-4 p-4 rounded-xl bg-surface border border-gray-700/50 space-y-3"},Gc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3"},Yc=["value"],Zc={class:"flex justify-end"},Qc=["disabled"],Xc={key:0,class:"text-center py-12 text-textSecondary"},eu={key:1,class:"text-center py-8 text-danger text-sm"},tu={key:2,class:"text-center py-12 text-textSecondary"},su={key:3},nu={class:"space-y-3"},ou={class:"p-4"},ru={class:"flex flex-wrap items-center gap-3"},lu=["onBlur"],au=["onDblclick"],iu={class:"text-xs text-muted font-mono"},cu=["value","onChange"],uu=["value"],du=["value"],fu={class:"text-xs text-muted"},pu=["onKeyup","onBlur"],mu=["title","onDblclick"],xu={class:"ml-auto flex items-center gap-3"},vu=["onClick","disabled"],gu={class:"flex items-center gap-1.5"},hu=["onClick"],bu={class:"flex items-center gap-1.5"},yu=["onClick"],_u={class:"flex items-center gap-1.5"},wu=["onClick"],ku=["onClick"],$u=["onClick"],Su=["onClick"],Cu={key:0,class:"mt-3 p-3 rounded-lg bg-surface border border-purple-500/20 space-y-2"},Tu={class:"grid grid-cols-1 sm:grid-cols-3 gap-2"},Pu=["value"],Eu={class:"flex items-center gap-2"},Au=["onClick","disabled"],Iu={key:0,class:"border-t border-gray-700/30 bg-surface/30 px-4 py-3 space-y-2"},Ou={key:0,class:"text-xs text-muted py-1"},Mu={class:"text-sm font-medium"},Du={class:"text-xs text-muted font-mono"},Ru=["value","onChange"],ju=["value"],Lu=["value"],Uu={class:"text-xs text-muted"},Nu=["onBlur","onKeyup"],Vu=["title","onDblclick"],Bu={class:"ml-auto flex items-center gap-3"},Fu=["onClick","disabled"],Hu=["onClick","disabled"],Ku=["onClick","disabled"],Wu={key:2,class:"flex items-center gap-1.5"},zu=["onClick"],Ju={key:3,class:"flex items-center gap-1.5"},qu=["onClick"],Gu={key:4,class:"flex items-center gap-1.5"},Yu=["onClick"],Zu=["onClick"],Qu={key:4},Xu={class:"space-y-2"},ed={class:"font-medium"},td={class:"text-xs text-muted font-mono"},sd={class:"text-xs text-textSecondary"},nd={class:"text-xs text-muted"},od={class:"ml-auto flex items-center gap-2"},rd=["onClick","disabled"],ld=["onClick","disabled"],ad=["onClick"],id={key:5},cd={class:"space-y-2"},ud={class:"font-medium"},dd={class:"text-xs text-muted font-mono"},fd=["value","onChange"],pd=["value"],md=["value"],xd={class:"text-xs text-muted"},vd=["onBlur","onKeyup"],gd=["title","onDblclick"],hd={class:"ml-auto flex items-center gap-3"},bd=["onClick","disabled"],yd=["onClick","disabled"],_d={class:"flex items-center gap-1.5"},wd=["onClick"],kd={class:"flex items-center gap-1.5"},$d=["onClick"],Sd={class:"flex items-center gap-1.5"},Cd=["onClick"],Td=["onClick"],Pd={key:6},Ed={class:"space-y-2"},Ad={class:"font-medium"},Id={class:"text-xs text-muted font-mono"},Od=["value","onChange"],Md=["value"],Dd=["value"],Rd={class:"text-xs text-muted"},jd=Ne({__name:"ThreadsTab",setup(e){const t=_([]),s=_(!0),o=_(""),r=_({}),l=_(new Set),a=_(!1),c=_({name:"",threadId:0,client:"claude",workingDirectory:""}),d=_(""),h=_(!1),f=_(null),p=_(""),g=_(null),$=_(""),B=_(null),S=_({name:"",threadId:0,client:"claude",workingDirectory:""}),V=_(""),C=_(!1),P=_(null),U=_(null),O=_(null),Q=["claude","copilot","codex","fable"];function ie(K){return Q.includes(K)}const re={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"}},Z=Pe(()=>t.value.filter(K=>K.type==="root")),T=Pe(()=>t.value.filter(K=>K.type==="daily")),R=Pe(()=>t.value.filter(K=>K.type==="branch")),w=Pe(()=>t.value.filter(K=>K.type==="worker"));async function y(){s.value=!0,o.value="";try{const K=await ve("/api/threads");t.value=K.threads??[]}catch(K){o.value=K.message||"Failed to load threads"}finally{s.value=!1}}async function I(K){try{const i=await ve(`/api/threads/${K}/children`);r.value[K]=i.threads??[]}catch{r.value[K]=[]}}function L(K){l.value.has(K)?l.value.delete(K):(l.value.add(K),I(K))}async function A(){if(!(!c.value.name.trim()||!c.value.threadId)){h.value=!0,d.value="";try{const K=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"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(!K.ok){const i=await K.json().catch(()=>({error:K.statusText}));throw new Error(i.error??K.statusText)}d.value="Created ✓",c.value={name:"",threadId:0,client:"claude",workingDirectory:""},a.value=!1,setTimeout(()=>{d.value=""},3e3),await y()}catch(K){d.value="Error: "+K.message}finally{h.value=!1}}}async function z(K){if(!(!S.value.name.trim()||!S.value.threadId)){C.value=!0,V.value="";try{const i=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:S.value.threadId,name:S.value.name.trim(),type:"branch",rootThreadId:K,client:S.value.client,...S.value.workingDirectory.trim()?{workingDirectory:S.value.workingDirectory.trim()}:{}})});if(!i.ok){const u=await i.json().catch(()=>({error:i.statusText}));throw new Error(u.error??i.statusText)}V.value="Branch created ✓",S.value={name:"",threadId:0,client:"claude",workingDirectory:""},B.value=null,setTimeout(()=>{V.value=""},3e3),await y(),I(K)}catch(i){V.value="Error: "+i.message}finally{C.value=!1}}}function le(K){f.value=K.threadId,p.value=K.name}async function ee(K){const i=p.value.trim();if(f.value=null,!!i)try{const u=await fetch(`/api/threads/${K}`,{method:"PATCH",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({name:i})});if(!u.ok)throw new Error(u.statusText);await y()}catch(u){o.value="Failed to rename thread: "+u.message}}function J(K){g.value=K.threadId,$.value=K.workingDirectory??""}async function N(K){const i=$.value.trim();g.value=null;try{const u=await fetch(`/api/threads/${K}`,{method:"PATCH",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({workingDirectory:i||null})});if(!u.ok)throw new Error(u.statusText);await y()}catch(u){o.value="Failed to update working directory: "+u.message}}async function Ce(K){try{const i=await fetch(`/api/threads/${K.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({keepAlive:!K.keepAlive})});if(!i.ok)throw new Error(i.statusText);await y()}catch(i){o.value="Failed to toggle keep-alive: "+i.message}}async function ke(K,i){try{const u=await fetch(`/api/threads/${K.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({client:i})});if(!u.ok)throw new Error(u.statusText);await y()}catch(u){o.value="Failed to change agent type: "+u.message}}async function ge(K){try{const i=await fetch(`/api/threads/${K.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({dailyRotation:!K.dailyRotation})});if(!i.ok)throw new Error(i.statusText);await y()}catch(i){o.value="Failed to toggle daily rotation: "+i.message}}async function at(K){try{const i=await fetch(`/api/threads/${K.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({autonomousMode:!K.autonomousMode})});if(!i.ok)throw new Error(i.statusText);await y()}catch(i){o.value="Failed to toggle autonomous mode: "+i.message}}async function Ot(K){if(confirm(`Archive thread "${K.name}" (${K.threadId})?`))try{const i=await fetch(`/api/threads/${K.threadId}`,{method:"DELETE",headers:{Authorization:`Bearer ${fe()}`}});if(!i.ok)throw new Error(i.statusText);await y()}catch(i){o.value="Failed to archive: "+i.message}}async function Je(K){if(confirm(`Start thread "${K.name}" (${K.threadId})?`)){P.value=K.threadId;try{const i=await fetch(`/api/threads/${K.threadId}/start`,{method:"POST",headers:{Authorization:`Bearer ${fe()}`}});if(!i.ok){const u=await i.json().catch(()=>({error:i.statusText}));throw new Error(u.error??i.statusText)}await y()}catch(i){o.value="Failed to start thread: "+i.message}finally{P.value=null}}}function yt(K){d.value="Sync to Root — not yet implemented",setTimeout(()=>{d.value=""},3e3)}async function Kt(K){if(confirm(`Convert "${K.name}" to a root thread? This will detach it from its parent.`)){O.value=K.threadId;try{const i=await fetch(`/api/threads/${K.threadId}/convert-to-root`,{method:"POST",headers:{Authorization:`Bearer ${fe()}`}});if(!i.ok){const u=await i.json().catch(()=>({error:i.statusText}));throw new Error(u.error??i.statusText)}o.value="",d.value=`Converted "${K.name}" to root ✓`,setTimeout(()=>{d.value=""},3e3),await y()}catch(i){o.value="Failed to convert: "+i.message}finally{O.value=null}}}function _t(K){if(!K)return"—";const i=new Date(K),k=Date.now()-i.getTime();return k<6e4?"just now":k<36e5?`${Math.floor(k/6e4)}m ago`:k<864e5?`${Math.floor(k/36e5)}h ago`:i.toLocaleDateString()}function Ke(K){return K==="active"?"text-success":K==="archived"?"text-muted":"text-warn"}return je(y),(K,i)=>(x(),v("div",Kc,[n("div",Wc,[n("div",zc,[i[18]||(i[18]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Thread Registry"),n("p",{class:"text-sm text-textSecondary mt-1"},"Manage conversation threads, branches, and daily sessions")],-1)),n("div",Jc,[d.value?(x(),v("span",{key:0,class:G([d.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},b(d.value),3)):H("",!0),n("button",{onClick:i[0]||(i[0]=u=>a.value=!a.value),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},b(a.value?"Cancel":"+ New Root Thread"),1),n("button",{onClick:y,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),a.value?(x(),v("div",qc,[n("div",Gc,[n("div",null,[i[19]||(i[19]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Name",-1)),Y(n("input",{"onUpdate:modelValue":i[1]||(i[1]=u=>c.value.name=u),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),[[te,c.value.name]])]),n("div",null,[i[20]||(i[20]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Thread ID",-1)),Y(n("input",{"onUpdate:modelValue":i[2]||(i[2]=u=>c.value.threadId=u),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),[[te,c.value.threadId,void 0,{number:!0}]])]),n("div",null,[i[21]||(i[21]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Client",-1)),Y(n("select",{"onUpdate:modelValue":i[3]||(i[3]=u=>c.value.client=u),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"},[(x(),v(ne,null,de(Q,u=>n("option",{key:u,value:u},b(u),9,Yc)),64))],512),[[ht,c.value.client]])])]),n("div",null,[i[22]||(i[22]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Working Directory (optional)",-1)),Y(n("input",{"onUpdate:modelValue":i[4]||(i[4]=u=>c.value.workingDirectory=u),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),[[te,c.value.workingDirectory]])]),n("div",Zc,[n("button",{onClick:A,disabled:h.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"},b(h.value?"Creating…":"Create Root Thread"),9,Qc)])])):H("",!0)]),s.value&&t.value.length===0?(x(),v("div",Xc,"Loading threads…")):o.value?(x(),v("div",eu,b(o.value),1)):t.value.length===0?(x(),v("div",tu,"No threads registered")):H("",!0),Z.value.length>0?(x(),v("div",su,[i[29]||(i[29]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟢 Root Threads",-1)),n("div",nu,[(x(!0),v(ne,null,de(Z.value,u=>{var k,E;return x(),v("div",{key:u.id,class:"glass rounded-xl overflow-hidden"},[n("div",ou,[n("div",ru,[n("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(k=re[u.type])==null?void 0:k.classes])},b((E=re[u.type])==null?void 0:E.emoji)+" "+b(u.type.toUpperCase()),3),f.value===u.threadId?Y((x(),v("input",{key:0,"onUpdate:modelValue":i[5]||(i[5]=m=>p.value=m),onBlur:m=>ee(u.threadId),onKeyup:[i[6]||(i[6]=Xe(m=>m.target.blur(),["enter"])),i[7]||(i[7]=Xe(m=>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,lu)),[[te,p.value]]):(x(),v("span",{key:1,class:"font-semibold cursor-pointer hover:text-accent transition",onDblclick:m=>le(u),title:"Double-click to rename"},b(u.name),41,au)),n("span",{class:G(["text-xs font-medium",Ke(u.status)])},b(u.status),3),n("span",iu,"ID: "+b(u.threadId),1),n("select",{value:u.client,onChange:m=>ke(u,m.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"},[ie(u.client)?H("",!0):(x(),v("option",{key:0,value:u.client,disabled:""},b(u.client)+" (legacy)",9,uu)),(x(),v(ne,null,de(Q,m=>n("option",{key:m,value:m},b(m),9,du)),64))],40,cu),n("span",fu,b(_t(u.lastActiveAt)),1),g.value===u.threadId?Y((x(),v("input",{key:2,"onUpdate:modelValue":i[8]||(i[8]=m=>$.value=m),onKeyup:[Xe(m=>N(u.threadId),["enter"]),i[9]||(i[9]=Xe(m=>g.value=null,["escape"]))],onBlur:m=>N(u.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,pu)),[[te,$.value]]):(x(),v("span",{key:3,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(u.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:m=>J(u)},"📁 "+b(u.workingDirectory??"—"),41,mu)),n("div",xu,[n("button",{onClick:m=>Je(u),disabled:P.value===u.threadId||u.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"},b(P.value===u.threadId?"Starting…":"▶ Start"),9,vu),n("div",gu,[n("button",{onClick:m=>Ce(u),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[n("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,hu),i[23]||(i[23]=n("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),n("div",bu,[n("button",{onClick:m=>ge(u),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[n("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,yu),i[24]||(i[24]=n("span",{class:"text-xs text-muted"},"Daily",-1))]),n("div",_u,[n("button",{onClick:m=>at(u),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[n("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,wu),i[25]||(i[25]=n("span",{class:"text-xs text-muted"},"Auto",-1))]),n("button",{onClick:m=>L(u.threadId),class:"px-2 py-1 rounded-lg text-xs bg-card border border-gray-700 hover:bg-surface transition"},b(l.value.has(u.threadId)?"▾ Children":"▸ Children"),9,ku),n("button",{onClick:m=>{B.value=B.value===u.threadId?null:u.threadId,S.value={name:"",threadId:0,client:"claude",workingDirectory:""},V.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,$u),n("button",{onClick:m=>Ot(u),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,Su)])]),B.value===u.threadId?(x(),v("div",Cu,[n("div",Tu,[Y(n("input",{"onUpdate:modelValue":i[10]||(i[10]=m=>S.value.name=m),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),[[te,S.value.name]]),Y(n("input",{"onUpdate:modelValue":i[11]||(i[11]=m=>S.value.threadId=m),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),[[te,S.value.threadId,void 0,{number:!0}]]),Y(n("select",{"onUpdate:modelValue":i[12]||(i[12]=m=>S.value.client=m),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"},[(x(),v(ne,null,de(Q,m=>n("option",{key:m,value:m},b(m),9,Pu)),64))],512),[[ht,S.value.client]])]),Y(n("input",{"onUpdate:modelValue":i[13]||(i[13]=m=>S.value.workingDirectory=m),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),[[te,S.value.workingDirectory]]),n("div",Eu,[n("button",{onClick:m=>z(u.threadId),disabled:C.value||!S.value.name.trim()||!S.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"},b(C.value?"Creating…":"Create Branch"),9,Au),V.value?(x(),v("span",{key:0,class:G([V.value.startsWith("Error")?"text-danger":"text-success","text-xs"])},b(V.value),3)):H("",!0)])])):H("",!0)]),l.value.has(u.threadId)&&r.value[u.threadId]?(x(),v("div",Iu,[r.value[u.threadId].length===0?(x(),v("div",Ou,"No children")):H("",!0),(x(!0),v(ne,null,de(r.value[u.threadId],m=>{var M,W;return x(),v("div",{key:m.id,class:"flex flex-wrap items-center gap-2 px-3 py-2 rounded-lg bg-card/50 border border-gray-700/30"},[n("span",{class:G(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-xs font-medium border",(M=re[m.type])==null?void 0:M.classes])},b((W=re[m.type])==null?void 0:W.emoji)+" "+b(m.type.toUpperCase()),3),n("span",Mu,b(m.name),1),n("span",{class:G(["text-xs",Ke(m.status)])},b(m.status),3),n("span",Du,"ID: "+b(m.threadId),1),n("select",{value:m.client,onChange:j=>ke(m,j.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"},[ie(m.client)?H("",!0):(x(),v("option",{key:0,value:m.client,disabled:""},b(m.client)+" (legacy)",9,ju)),(x(),v(ne,null,de(Q,j=>n("option",{key:j,value:j},b(j),9,Lu)),64))],40,Ru),n("span",Uu,b(_t(m.lastActiveAt)),1),m.type==="branch"&&g.value===m.threadId?Y((x(),v("input",{key:0,"onUpdate:modelValue":i[14]||(i[14]=j=>$.value=j),onBlur:j=>N(m.threadId),onKeyup:[Xe(j=>N(m.threadId),["enter"]),i[15]||(i[15]=Xe(j=>g.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,Nu)),[[te,$.value]]):m.type==="branch"?(x(),v("span",{key:1,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:j=>J(m)},"📁 "+b(m.workingDirectory??"—"),41,Vu)):H("",!0),n("div",Bu,[n("button",{onClick:j=>Je(m),disabled:P.value===m.threadId||m.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"},b(P.value===m.threadId?"Starting…":"▶ Start"),9,Fu),m.rootThreadId?(x(),v("button",{key:0,onClick:j=>yt(),disabled:U.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(U.value===m.threadId?"Syncing…":"⟳ Sync to Root"),9,Hu)):H("",!0),m.type==="branch"||m.type==="daily"?(x(),v("button",{key:1,onClick:j=>Kt(m),disabled:O.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:"Convert to independent root thread"},b(O.value===m.threadId?"Converting…":"↑ To Root"),9,Ku)):H("",!0),m.type==="branch"?(x(),v("div",Wu,[n("button",{onClick:j=>Ce(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"},[n("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,zu),i[26]||(i[26]=n("span",{class:"text-xs text-muted"},"Keep-alive",-1))])):H("",!0),m.type==="branch"?(x(),v("div",Ju,[n("button",{onClick:j=>ge(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"},[n("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,qu),i[27]||(i[27]=n("span",{class:"text-xs text-muted"},"Daily",-1))])):H("",!0),m.type==="branch"?(x(),v("div",Gu,[n("button",{onClick:j=>at(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"},[n("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,Yu),i[28]||(i[28]=n("span",{class:"text-xs text-muted"},"Auto",-1))])):H("",!0),m.type!=="root"?(x(),v("button",{key:5,onClick:j=>Ot(m),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,Zu)):H("",!0)])])}),128))])):H("",!0)])}),128))])])):H("",!0),T.value.length>0?(x(),v("div",Qu,[i[30]||(i[30]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🔵 Daily Sessions",-1)),n("div",Xu,[(x(!0),v(ne,null,de(T.value,u=>{var k,E;return x(),v("div",{key:u.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[n("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(k=re[u.type])==null?void 0:k.classes])},b((E=re[u.type])==null?void 0:E.emoji)+" "+b(u.type.toUpperCase()),3),n("span",ed,b(u.name),1),n("span",{class:G(["text-xs font-medium",Ke(u.status)])},b(u.status),3),n("span",td,"ID: "+b(u.threadId),1),n("span",sd,b(u.client),1),n("span",nd,b(_t(u.lastActiveAt)),1),n("div",od,[n("button",{onClick:m=>Je(u),disabled:P.value===u.threadId||u.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"},b(P.value===u.threadId?"Starting…":"▶ Start"),9,rd),u.rootThreadId?(x(),v("button",{key:0,onClick:m=>yt(),disabled:U.value===u.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(U.value===u.threadId?"Syncing…":"⟳ Sync to Root"),9,ld)):H("",!0),n("button",{onClick:m=>Ot(u),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,ad)])])}),128))])])):H("",!0),R.value.length>0?(x(),v("div",id,[i[34]||(i[34]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟣 Branches",-1)),n("div",cd,[(x(!0),v(ne,null,de(R.value,u=>{var k,E;return x(),v("div",{key:u.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[n("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(k=re[u.type])==null?void 0:k.classes])},b((E=re[u.type])==null?void 0:E.emoji)+" "+b(u.type.toUpperCase()),3),n("span",ud,b(u.name),1),n("span",{class:G(["text-xs font-medium",Ke(u.status)])},b(u.status),3),n("span",dd,"ID: "+b(u.threadId),1),n("select",{value:u.client,onChange:m=>ke(u,m.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"},[ie(u.client)?H("",!0):(x(),v("option",{key:0,value:u.client,disabled:""},b(u.client)+" (legacy)",9,pd)),(x(),v(ne,null,de(Q,m=>n("option",{key:m,value:m},b(m),9,md)),64))],40,fd),n("span",xd,b(_t(u.lastActiveAt)),1),g.value===u.threadId?Y((x(),v("input",{key:0,"onUpdate:modelValue":i[16]||(i[16]=m=>$.value=m),onBlur:m=>N(u.threadId),onKeyup:[Xe(m=>N(u.threadId),["enter"]),i[17]||(i[17]=Xe(m=>g.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,vd)),[[te,$.value]]):(x(),v("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(u.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:m=>J(u)},"📁 "+b(u.workingDirectory??"—"),41,gd)),n("div",hd,[n("button",{onClick:m=>Je(u),disabled:P.value===u.threadId||u.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"},b(P.value===u.threadId?"Starting…":"▶ Start"),9,bd),u.rootThreadId?(x(),v("button",{key:0,onClick:m=>yt(),disabled:U.value===u.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(U.value===u.threadId?"Syncing…":"⟳ Sync to Root"),9,yd)):H("",!0),n("div",_d,[n("button",{onClick:m=>Ce(u),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[n("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,wd),i[31]||(i[31]=n("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),n("div",kd,[n("button",{onClick:m=>ge(u),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[n("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,$d),i[32]||(i[32]=n("span",{class:"text-xs text-muted"},"Daily",-1))]),n("div",Sd,[n("button",{onClick:m=>at(u),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[n("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,Cd),i[33]||(i[33]=n("span",{class:"text-xs text-muted"},"Auto",-1))]),n("button",{onClick:m=>Ot(u),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,Td)])])}),128))])])):H("",!0),w.value.length>0?(x(),v("div",Pd,[i[36]||(i[36]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟡 Workers",-1)),n("div",Ed,[(x(!0),v(ne,null,de(w.value,u=>{var k,E;return x(),v("div",{key:u.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[n("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(k=re[u.type])==null?void 0:k.classes])},b((E=re[u.type])==null?void 0:E.emoji)+" "+b(u.type.toUpperCase()),3),n("span",Ad,b(u.name),1),n("span",{class:G(["text-xs font-medium",Ke(u.status)])},b(u.status),3),n("span",Id,"ID: "+b(u.threadId),1),n("select",{value:u.client,onChange:m=>ke(u,m.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"},[ie(u.client)?H("",!0):(x(),v("option",{key:0,value:u.client,disabled:""},b(u.client)+" (legacy)",9,Md)),(x(),v(ne,null,de(Q,m=>n("option",{key:m,value:m},b(m),9,Dd)),64))],40,Od),n("span",Rd,b(_t(u.lastActiveAt)),1),i[35]||(i[35]=n("span",{class:"ml-auto text-xs text-muted italic"},"auto-managed",-1))])}),128))])])):H("",!0)]))}}),Ld={class:"animate-fade-in"},Ud={class:"glass rounded-xl p-6 mb-6"},Nd={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Vd={class:"flex items-center gap-3"},Bd={key:0,class:"text-center py-8 text-textSecondary text-sm"},Fd={key:1,class:"text-center py-8 text-danger text-sm"},Hd={key:2,class:"text-center text-textSecondary py-12"},Kd={key:3,class:"space-y-2"},Wd={class:"flex items-center justify-between gap-3"},zd={class:"flex-1 min-w-0"},Jd={class:"flex items-center gap-2 mb-1"},qd={class:"font-medium text-sm"},Gd={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},Yd={key:0,class:"type-badge",style:{background:"rgba(34,197,94,0.15)",color:"#4ade80"}},Zd={class:"text-xs text-muted font-mono truncate"},Qd={class:"flex items-center gap-2 shrink-0"},Xd=["onClick","disabled"],ef=["onClick"],tf=["onClick","disabled"],sf={key:0,class:"glass rounded-xl p-6 border border-accent/30"},nf={class:"text-lg font-semibold mb-4"},of={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},rf=["value"],lf={class:"mb-4"},af={class:"mb-4"},cf={class:"mb-4"},uf={class:"flex items-center gap-3 flex-wrap"},df=["disabled"],ff={key:0,class:"text-sm text-danger"},pf=Ne({__name:"AgentsTab",setup(e){const t=["claude","copilot","codex","openai_codex","fable"],s=_([]),o=_(!0),r=_(""),l=_(""),a=_(!0),c=_(!1),d=_(null),h=_(null),f=_(!1),p=_(null),g=_(""),$=_("claude"),B=_(""),S=_(""),V=_(""),C=_("");async function P(){o.value=!0,r.value="";try{const w=await ve("/api/agent-templates");s.value=w.templates||[]}catch(w){r.value="Failed to load templates: "+w.message}finally{o.value=!1}}function U(){p.value=null,g.value="",$.value="claude",B.value="",S.value="",V.value="",C.value="",f.value=!0}function O(w){p.value=w.id,g.value=w.name,$.value=w.client,B.value=w.workingDirectory,S.value=w.systemPrompt||"",V.value=w.mcpServers&&Object.keys(w.mcpServers).length?JSON.stringify(w.mcpServers,null,2):"",C.value="",f.value=!0}function Q(){f.value=!1,p.value=null}function ie(){C.value="";const w=g.value.trim(),y=B.value.trim();if(!w)return C.value="Name is required",null;if(!y)return C.value="Working directory is required",null;let I={};const L=V.value.trim();if(L){try{I=JSON.parse(L)}catch{return C.value="MCP servers must be valid JSON",null}if(typeof I!="object"||I===null||Array.isArray(I))return C.value="MCP servers must be a JSON object",null}return{name:w,client:$.value,workingDirectory:y,systemPrompt:S.value.trim()||null,mcpServers:I}}async function re(){if(c.value)return;const w=ie();if(w){c.value=!0;try{const y=p.value?`/api/agent-templates/${p.value}`:"/api/agent-templates",I=p.value?"PATCH":"POST",L=await fetch(y,{method:I,headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify(w)});if(!L.ok){const A=await L.json().catch(()=>({}));throw new Error(A.error||L.statusText)}R("Saved ✓",!0),Q(),await P()}catch(y){C.value="Error: "+y.message}finally{c.value=!1}}}async function Z(w){if(!d.value){d.value=w.id;try{const y=await fetch(`/api/agent-templates/${w.id}/start`,{method:"POST",headers:{Authorization:`Bearer ${fe()}`}});if(!y.ok){const L=await y.json().catch(()=>({}));throw new Error(L.error||y.statusText)}const I=await y.json();R(`Started thread ${I.threadId} ✓`,!0)}catch(y){R("Error: "+y.message,!1)}finally{d.value=null}}}async function T(w){if(confirm(`Delete template "${w.name}"?`)&&!h.value){h.value=w.id;try{const y=await fetch(`/api/agent-templates/${w.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${fe()}`}});if(!y.ok)throw new Error(y.statusText);R("Deleted ✓",!0),await P()}catch(y){R("Error: "+y.message,!1)}finally{h.value=null}}}function R(w,y){l.value=w,a.value=y,setTimeout(()=>{l.value=""},3e3)}return je(P),(w,y)=>(x(),v("div",Ld,[n("div",Ud,[n("div",Nd,[y[5]||(y[5]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Agent Templates"),n("p",{class:"text-sm text-textSecondary mt-1"},"Reusable spawn presets. Starting one stamps out a fresh root thread.")],-1)),n("div",Vd,[l.value?(x(),v("span",{key:0,class:G(["text-sm",a.value?"text-success":"text-danger"])},b(l.value),3)):H("",!0),n("button",{onClick:U,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + New Template ")])]),o.value?(x(),v("div",Bd,"Loading...")):r.value?(x(),v("div",Fd,b(r.value),1)):s.value.length===0?(x(),v("div",Hd,"No agent templates yet")):(x(),v("div",Kd,[(x(!0),v(ne,null,de(s.value,I=>(x(),v("div",{key:I.id,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[n("div",Wd,[n("div",zd,[n("div",Jd,[n("span",qd,b(I.name),1),n("span",Gd,b(I.client),1),I.mcpServers&&Object.keys(I.mcpServers).length?(x(),v("span",Yd,b(Object.keys(I.mcpServers).length)+" mcp",1)):H("",!0)]),n("div",Zd,b(I.workingDirectory),1)]),n("div",Qd,[n("button",{onClick:L=>Z(I),disabled:d.value===I.id,class:"px-3 py-1.5 rounded-lg bg-accent hover:bg-accentLight text-xs text-white font-medium transition disabled:opacity-50"},b(d.value===I.id?"Starting…":"Start"),9,Xd),n("button",{onClick:L=>O(I),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,ef),n("button",{onClick:L=>T(I),disabled:h.value===I.id,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"},b(h.value===I.id?"…":"Delete"),9,tf)])])]))),128))]))]),f.value?(x(),v("div",sf,[n("h3",nf,b(p.value?`Edit: ${g.value}`:"New Agent Template"),1),n("div",of,[n("div",null,[y[6]||(y[6]=n("label",{class:"text-xs text-textSecondary block mb-1"},[X("Name "),n("span",{class:"text-danger"},"*")],-1)),Y(n("input",{"onUpdate:modelValue":y[0]||(y[0]=I=>g.value=I),type:"text",placeholder:"YouTube Researcher",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),[[te,g.value]])]),n("div",null,[y[7]||(y[7]=n("label",{class:"text-xs text-textSecondary block mb-1"},[X("Client "),n("span",{class:"text-danger"},"*")],-1)),Y(n("select",{"onUpdate:modelValue":y[1]||(y[1]=I=>$.value=I),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"},[(x(),v(ne,null,de(t,I=>n("option",{key:I,value:I},b(I),9,rf)),64))],512),[[ht,$.value]])])]),n("div",lf,[y[8]||(y[8]=n("label",{class:"text-xs text-textSecondary block mb-1"},[X("Working Directory "),n("span",{class:"text-danger"},"*")],-1)),Y(n("input",{"onUpdate:modelValue":y[2]||(y[2]=I=>B.value=I),type:"text",placeholder:"C:\\src\\my-project",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),[[te,B.value]])]),n("div",af,[y[9]||(y[9]=n("label",{class:"text-xs text-textSecondary block mb-1"},"System Prompt",-1)),Y(n("textarea",{"onUpdate:modelValue":y[3]||(y[3]=I=>S.value=I),rows:"4",placeholder:"Optional identity prompt for the spawned thread",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 resize-y"},null,512),[[te,S.value]])]),n("div",cf,[y[10]||(y[10]=n("label",{class:"text-xs text-textSecondary block mb-1"},"MCP Servers (JSON)",-1)),Y(n("textarea",{"onUpdate:modelValue":y[4]||(y[4]=I=>V.value=I),rows:"6",placeholder:'{ "my-server": { "type": "http", "url": "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 resize-y"},null,512),[[te,V.value]]),y[11]||(y[11]=n("p",{class:"text-xs text-muted mt-1"},"Per-thread HTTP MCP servers. Leave empty for none.",-1))]),n("div",uf,[n("button",{onClick:re,disabled:c.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},b(c.value?"Saving…":p.value?"Save Changes":"Create Template"),9,df),n("button",{onClick:Q,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 "),C.value?(x(),v("span",ff,b(C.value),1)):H("",!0)])])):H("",!0)]))}}),mf={class:"animate-fade-in"},xf={class:"glass rounded-xl p-6 mb-6"},vf={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},gf={class:"flex items-center gap-3"},hf={key:0,class:"text-center py-8 text-textSecondary text-sm"},bf={key:1,class:"text-center py-8 text-danger text-sm"},yf={key:2,class:"text-center text-textSecondary py-12"},_f={key:3,class:"space-y-2"},wf={key:0,class:"glass rounded-xl p-4 border border-gray-700/50 opacity-75"},kf={class:"flex items-center justify-between gap-3"},$f={class:"flex items-center gap-2 min-w-0"},Sf={class:"flex items-center justify-between gap-3"},Cf={class:"flex-1 min-w-0"},Tf={class:"flex items-center gap-2 mb-1"},Pf={class:"font-medium text-sm font-mono"},Ef={class:"text-xs text-muted font-mono truncate"},Af={class:"flex items-center gap-2 shrink-0"},If=["onClick"],Of=["onClick","disabled"],Mf={key:0,class:"glass rounded-xl p-6 border border-accent/30"},Df={class:"text-lg font-semibold mb-4"},Rf={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},jf=["readonly"],Lf={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Uf={class:"mb-4"},Nf={class:"flex items-center justify-between mb-2"},Vf=["onUpdate:modelValue"],Bf=["onUpdate:modelValue"],Ff=["onClick"],Hf={key:0,class:"text-xs text-muted italic"},Kf={class:"mb-4"},Wf={class:"mb-4"},zf={class:"flex items-center justify-between mb-2"},Jf=["onUpdate:modelValue"],qf=["onUpdate:modelValue"],Gf=["onClick"],Yf={key:0,class:"text-xs text-muted italic"},Zf={class:"flex items-center gap-3 flex-wrap"},Qf=["disabled"],Xf={key:0,class:"text-sm text-danger"},Gt="sensorium-mcp",ep=Ne({__name:"McpServersTab",setup(e){const t=_({}),s=_(!0),o=_(""),r=_(""),l=_(!0),a=_(!1),c=_(null),d=_(!1),h=_(null),f=_(""),p=_("stdio"),g=_(""),$=_(""),B=_(""),S=_([]),V=_([]),C=_(""),P=Pe(()=>Object.entries(t.value).filter(([w])=>w!==Gt));async function U(){s.value=!0,o.value="";try{const w=await ve("/api/mcp-servers");t.value=w.servers||{}}catch(w){o.value="Failed to load MCP servers: "+w.message}finally{s.value=!1}}function O(w){return w==="stdio"?"background:rgba(99,102,241,0.15);color:#818cf8":"background:rgba(34,197,94,0.15);color:#4ade80"}function Q(){h.value=null,f.value="",p.value="stdio",g.value="",$.value="",B.value="",S.value=[],V.value=[],C.value="",d.value=!0}function ie(w,y){h.value=w,f.value=w,p.value=y.type,g.value=y.command||"",$.value=(y.args||[]).join(" "),B.value=y.url||"",S.value=Object.entries(y.env||{}).map(([I,L])=>({k:I,v:L})),V.value=Object.entries(y.headers||{}).map(([I,L])=>({k:I,v:L})),C.value="",d.value=!0}function re(){d.value=!1,h.value=null}function Z(){if(C.value="",!f.value.trim())return C.value="Name is required",!1;if(p.value==="stdio"&&!g.value.trim())return C.value="Command is required for stdio type",!1;if(p.value==="http"){const w=B.value.trim();if(!w)return C.value="URL is required for http type",!1;if(!/^https?:\/\/.+/.test(w))return C.value="URL must start with http:// or https://",!1}return!0}async function T(){if(!Z()||a.value)return;a.value=!0;const w=f.value.trim(),y={type:p.value};if(p.value==="stdio"){y.command=g.value.trim();const I=$.value.trim();I&&(y.args=I.split(/\s+/));const L=Object.fromEntries(S.value.filter(A=>A.k.trim()).map(A=>[A.k.trim(),A.v]));Object.keys(L).length&&(y.env=L)}else{y.url=B.value.trim();const I=Object.fromEntries(V.value.filter(L=>L.k.trim()).map(L=>[L.k.trim(),L.v]));Object.keys(I).length&&(y.headers=I)}try{const I=await fetch("/api/mcp-servers",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({name:w,config:y})});if(!I.ok)throw new Error(I.statusText);r.value="Saved ✓",l.value=!0,setTimeout(()=>{r.value=""},3e3),re(),await U()}catch(I){C.value="Error: "+I.message}finally{a.value=!1}}async function R(w){if(confirm(`Delete MCP server "${w}"?`)&&!c.value){c.value=w;try{const y=await fetch(`/api/mcp-servers/${encodeURIComponent(w)}`,{method:"DELETE",headers:{Authorization:`Bearer ${fe()}`}});if(!y.ok)throw new Error(y.statusText);r.value="Deleted ✓",l.value=!0,setTimeout(()=>{r.value=""},3e3),await U()}catch(y){r.value="Error: "+y.message,l.value=!1}finally{c.value=null}}}return je(U),(w,y)=>(x(),v("div",mf,[n("div",xf,[n("div",vf,[y[7]||(y[7]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"MCP Servers"),n("p",{class:"text-sm text-textSecondary mt-1"},"Manage external MCP server connections (stdio and HTTP)")],-1)),n("div",gf,[r.value?(x(),v("span",{key:0,class:G(["text-sm",l.value?"text-success":"text-danger"])},b(r.value),3)):H("",!0),n("button",{onClick:Q,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + Add Server ")])]),s.value?(x(),v("div",hf,"Loading...")):o.value?(x(),v("div",bf,b(o.value),1)):Object.keys(t.value).length===0?(x(),v("div",yf,"No MCP servers configured")):(x(),v("div",_f,[t.value[Gt]?(x(),v("div",wf,[n("div",kf,[n("div",$f,[n("span",{class:"font-medium text-sm font-mono"},b(Gt)),n("span",{class:"type-badge",style:It(O(t.value[Gt].type))},b(t.value[Gt].type),5),y[8]||(y[8]=n("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"built-in",-1))]),y[9]||(y[9]=n("span",{class:"text-xs text-muted italic"},"read-only",-1))])])):H("",!0),(x(!0),v(ne,null,de(P.value,([I,L])=>{var A;return x(),v("div",{key:I,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[n("div",Sf,[n("div",Cf,[n("div",Tf,[n("span",Pf,b(I),1),n("span",{class:"type-badge",style:It(O(L.type))},b(L.type),5)]),n("div",Ef,[L.type==="stdio"?(x(),v(ne,{key:0},[X(b(L.command)+b((A=L.args)!=null&&A.length?" "+L.args.join(" "):""),1)],64)):(x(),v(ne,{key:1},[X(b(L.url),1)],64))])]),n("div",Af,[n("button",{onClick:z=>ie(I,L),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,If),n("button",{onClick:z=>R(I),disabled:c.value===I,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"},b(c.value===I?"…":"Delete"),9,Of)])])])}),128))]))]),d.value?(x(),v("div",Mf,[n("h3",Df,b(h.value?`Edit: ${h.value}`:"Add MCP Server"),1),n("div",Rf,[n("div",null,[y[10]||(y[10]=n("label",{class:"text-xs text-textSecondary block mb-1"},[X("Name "),n("span",{class:"text-danger"},"*")],-1)),Y(n("input",{"onUpdate:modelValue":y[0]||(y[0]=I=>f.value=I),type:"text",readonly:!!h.value,placeholder:"my-server",class:G(["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",h.value?"opacity-60 cursor-not-allowed":""])},null,10,jf),[[te,f.value]])]),n("div",null,[y[12]||(y[12]=n("label",{class:"text-xs text-textSecondary block mb-1"},[X("Type "),n("span",{class:"text-danger"},"*")],-1)),Y(n("select",{"onUpdate:modelValue":y[1]||(y[1]=I=>p.value=I),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"},[...y[11]||(y[11]=[n("option",{value:"stdio"},"stdio",-1),n("option",{value:"http"},"http",-1)])],512),[[ht,p.value]])])]),p.value==="stdio"?(x(),v(ne,{key:0},[n("div",Lf,[n("div",null,[y[13]||(y[13]=n("label",{class:"text-xs text-textSecondary block mb-1"},[X("Command "),n("span",{class:"text-danger"},"*")],-1)),Y(n("input",{"onUpdate:modelValue":y[2]||(y[2]=I=>g.value=I),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),[[te,g.value]])]),n("div",null,[y[14]||(y[14]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Args (space-separated)",-1)),Y(n("input",{"onUpdate:modelValue":y[3]||(y[3]=I=>$.value=I),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),[[te,$.value]])])]),n("div",Uf,[n("div",Nf,[y[15]||(y[15]=n("label",{class:"text-xs text-textSecondary"},"Environment Variables",-1)),n("button",{onClick:y[4]||(y[4]=I=>S.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(x(!0),v(ne,null,de(S.value,(I,L)=>(x(),v("div",{key:L,class:"flex items-center gap-2 mb-2"},[Y(n("input",{"onUpdate:modelValue":A=>I.k=A,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,Vf),[[te,I.k]]),y[16]||(y[16]=n("span",{class:"text-muted text-xs"},"=",-1)),Y(n("input",{"onUpdate:modelValue":A=>I.v=A,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,Bf),[[te,I.v]]),n("button",{onClick:A=>S.value.splice(L,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Ff)]))),128)),S.value.length===0?(x(),v("div",Hf,"No env vars")):H("",!0)])],64)):(x(),v(ne,{key:1},[n("div",Kf,[y[17]||(y[17]=n("label",{class:"text-xs text-textSecondary block mb-1"},[X("URL "),n("span",{class:"text-danger"},"*")],-1)),Y(n("input",{"onUpdate:modelValue":y[5]||(y[5]=I=>B.value=I),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),[[te,B.value]])]),n("div",Wf,[n("div",zf,[y[18]||(y[18]=n("label",{class:"text-xs text-textSecondary"},"Headers",-1)),n("button",{onClick:y[6]||(y[6]=I=>V.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(x(!0),v(ne,null,de(V.value,(I,L)=>(x(),v("div",{key:L,class:"flex items-center gap-2 mb-2"},[Y(n("input",{"onUpdate:modelValue":A=>I.k=A,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,Jf),[[te,I.k]]),y[19]||(y[19]=n("span",{class:"text-muted text-xs"},":",-1)),Y(n("input",{"onUpdate:modelValue":A=>I.v=A,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,qf),[[te,I.v]]),n("button",{onClick:A=>V.value.splice(L,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Gf)]))),128)),V.value.length===0?(x(),v("div",Yf,"No headers")):H("",!0)])],64)),n("div",Zf,[n("button",{onClick:T,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"},b(a.value?"Saving…":h.value?"Save Changes":"Add Server"),9,Qf),n("button",{onClick:re,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 "),C.value?(x(),v("span",Xf,b(C.value),1)):H("",!0)])])):H("",!0)]))}}),tp={class:"animate-fade-in"},sp={class:"glass rounded-xl p-6 mb-6"},np={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},op={class:"flex items-center gap-3"},rp=["disabled"],lp={key:0,class:"text-center py-8 text-textSecondary text-sm"},ap={key:1,class:"text-center py-8 text-danger text-sm"},ip={key:2,class:"text-center text-textSecondary py-12"},cp={key:3,class:"space-y-3"},up={class:"flex items-start gap-2"},dp={class:"flex-1 space-y-2"},fp=["onUpdate:modelValue"],pp=["onUpdate:modelValue"],mp=["onClick"],xp=Ne({__name:"PromptsTab",setup(e){const t=_([]),s=_(!0),o=_(""),r=_(""),l=_(!0),a=_(!1);async function c(){s.value=!0,o.value="";try{const p=await ve("/api/prompts");t.value=(p.prompts||[]).map(g=>({label:g.label,text:g.text}))}catch(p){o.value="Failed to load prompts: "+p.message}finally{s.value=!1}}function d(){t.value.push({label:"",text:""})}function h(p){t.value.splice(p,1)}async function f(){if(a.value)return;a.value=!0,r.value="";const p=t.value.map(g=>({label:g.label.trim(),text:g.text.trim()})).filter(g=>g.label&&g.text);try{const g=await fetch("/api/prompts",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({prompts:p})});if(!g.ok)throw new Error(g.statusText);r.value="Saved ✓",l.value=!0,setTimeout(()=>{r.value=""},3e3),await c()}catch(g){r.value="Error: "+g.message,l.value=!1}finally{a.value=!1}}return je(c),(p,g)=>(x(),v("div",tp,[n("div",sp,[n("div",np,[g[0]||(g[0]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Predefined Prompts"),n("p",{class:"text-sm text-textSecondary mt-1"},[X(" Each prompt becomes a button in the Telegram "),n("span",{class:"font-mono"},"/prompts"),X(" keyboard. Pressing a button injects its text into the target thread as if you typed it. ")])],-1)),n("div",op,[r.value?(x(),v("span",{key:0,class:G(["text-sm",l.value?"text-success":"text-danger"])},b(r.value),3)):H("",!0),n("button",{onClick:d,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"}," + Add Prompt "),n("button",{onClick:f,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"},b(a.value?"Saving…":"Save"),9,rp)])]),s.value?(x(),v("div",lp,"Loading...")):o.value?(x(),v("div",ap,b(o.value),1)):t.value.length===0?(x(),v("div",ip," No prompts yet — click “+ Add Prompt” to create one. ")):(x(),v("div",cp,[(x(!0),v(ne,null,de(t.value,($,B)=>(x(),v("div",{key:B,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[n("div",up,[n("div",dp,[n("div",null,[g[1]||(g[1]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Label (button text, ≤64 chars)",-1)),Y(n("input",{"onUpdate:modelValue":S=>$.label=S,type:"text",maxlength:"64",placeholder:"Run tests",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,8,fp),[[te,$.label]])]),n("div",null,[g[2]||(g[2]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Prompt text (≤4000 chars)",-1)),Y(n("textarea",{"onUpdate:modelValue":S=>$.text=S,rows:"3",maxlength:"4000",placeholder:"Run the full test suite and report failures.",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 resize-y"},null,8,pp),[[te,$.text]])])]),n("button",{onClick:S=>h(B),class:"text-muted hover:text-danger transition text-sm px-2 pt-6 shrink-0",title:"Remove prompt"},"✕",8,mp)])]))),128))]))])]))}}),vp={class:"animate-fade-in"},gp={class:"glass rounded-xl p-6 mb-6"},hp={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},bp={class:"flex items-center gap-3"},yp=["disabled"],_p={key:0,class:"text-center py-8 text-textSecondary text-sm"},wp={key:1,class:"space-y-6"},kp={class:"glass rounded-xl p-4 border border-gray-700/50"},$p={class:"glass rounded-xl p-4 border border-gray-700/50"},Sp={class:"glass rounded-xl p-4 border border-gray-700/50"},Cp={class:"glass rounded-xl p-4 border border-gray-700/50"},Tp={class:"glass rounded-xl p-4 border border-gray-700/50"},Pp={class:"glass rounded-xl p-4 border border-gray-700/50"},Ep={class:"text-xs text-textSecondary mb-3"},Ap={class:"flex items-center gap-2"},Ip=["placeholder"],Op=["disabled"],Mp={class:"glass rounded-xl p-4 border border-gray-700/50"},Dp={key:0,class:"space-y-2 mb-4"},Rp=["value"],jp=["value"],Lp={class:"flex items-center justify-between mb-2"},Up=["onUpdate:modelValue"],Np=["onUpdate:modelValue"],Vp=["onClick"],Bp={key:1,class:"text-xs text-muted italic"},Fp={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},Hp={class:"grid grid-cols-2 gap-4"},Kp={class:"text-sm font-medium font-mono text-textSecondary"},Wp={class:"text-sm font-medium font-mono text-textSecondary"},zp={class:"mt-3"},Jp=Ne({__name:"ClaudeTab",setup(e){const t=_(!0),s=_(!1),o=_(""),r=_("claude-opus-4-6"),l=_("claude-opus-4-6"),a=_("claude-sonnet-4-5"),c=_("claude-sonnet-4-5"),d=_(!1),h=_(""),f=_(""),p=_(""),g=_(""),$=_(20),B=_(20),S=_(""),V=_(!1),C=_([]),P=_([]),U=_("{}");function O(){const R={};for(const w of P.value){const y=w.k.trim();y&&(R[y]=w.v)}return R}const Q=Pe(()=>r.value!==l.value||a.value!==c.value||h.value!==f.value||p.value!==g.value||$.value!==B.value||S.value.length>0||JSON.stringify(O())!==U.value);function ie(R){C.value=R.filter(w=>w.locked),P.value=R.filter(w=>!w.locked).map(w=>({k:w.key,v:w.value})),U.value=JSON.stringify(O())}async function re(){t.value=!0;try{const[R,w,y]=await Promise.all([ve("/api/settings/default-thread-model"),ve("/api/settings/default-worker-model"),ve("/api/settings/claude")]);r.value=R.defaultThreadModel,l.value=R.defaultThreadModel,a.value=w.defaultWorkerModel,c.value=w.defaultWorkerModel,h.value=y.cliPath,f.value=y.cliPath,p.value=y.gitBashPath,g.value=y.gitBashPath,$.value=y.maxConcurrentThreads,B.value=y.maxConcurrentThreads,V.value=y.oauthTokenSet,S.value="",ie(y.env??[])}finally{t.value=!1}}async function Z(){if(s.value=!0,o.value="",!r.value){o.value="Error: Thread model cannot be empty",s.value=!1;return}if(!a.value){o.value="Error: Worker model cannot be empty",s.value=!1;return}if(!Number.isFinite($.value)||$.value<1){o.value="Error: Max concurrent threads must be at least 1",s.value=!1;return}try{const R={Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},w={cliPath:h.value,gitBashPath:p.value,maxConcurrentThreads:$.value,customEnvVars:O()};S.value.length>0&&(w.oauthToken=S.value);const[y,I,L]=await Promise.all([fetch("/api/settings/default-thread-model",{method:"POST",headers:R,body:JSON.stringify({model:r.value})}),fetch("/api/settings/default-worker-model",{method:"POST",headers:R,body:JSON.stringify({model:a.value})}),fetch("/api/settings/claude",{method:"POST",headers:R,body:JSON.stringify(w)})]);for(const ee of[y,I,L])if(!ee.ok){const J=await ee.json().catch(()=>({error:ee.statusText}));throw new Error(J.error??ee.statusText)}const A=await y.json(),z=await I.json(),le=await L.json();l.value=A.defaultThreadModel,r.value=A.defaultThreadModel,c.value=z.defaultWorkerModel,a.value=z.defaultWorkerModel,h.value=le.cliPath,f.value=le.cliPath,p.value=le.gitBashPath,g.value=le.gitBashPath,$.value=le.maxConcurrentThreads,B.value=le.maxConcurrentThreads,V.value=le.oauthTokenSet,S.value="",ie(le.env??[]),o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(R){o.value="Error: "+R.message}finally{s.value=!1}}async function T(){d.value=!0,o.value="";try{const R={Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},w=await fetch("/api/settings/claude",{method:"POST",headers:R,body:JSON.stringify({clearOauthToken:!0})});if(!w.ok){const I=await w.json().catch(()=>({error:w.statusText}));throw new Error(I.error??w.statusText)}const y=await w.json();V.value=y.oauthTokenSet,S.value="",ie(y.env??[]),o.value="Token cleared ✓",setTimeout(()=>{o.value=""},3e3)}catch(R){o.value="Error: "+R.message}finally{d.value=!1}}return je(re),(R,w)=>(x(),v("div",vp,[n("div",gp,[n("div",hp,[w[7]||(w[7]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Claude"),n("p",{class:"text-sm text-textSecondary mt-1"},"Default models for Claude Code threads and workers")],-1)),n("div",bp,[o.value?(x(),v("span",{key:0,class:G([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},b(o.value),3)):H("",!0),n("button",{onClick:Z,disabled:s.value||t.value||!Q.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},b(s.value?"Saving…":"Save"),9,yp)])]),t.value?(x(),v("div",_p,"Loading…")):(x(),v("div",wp,[n("div",kp,[w[8]||(w[8]=n("label",{class:"block text-sm font-medium mb-1"},"Default Thread Model",-1)),w[9]||(w[9]=n("p",{class:"text-xs text-textSecondary mb-3"},[X(" Model used when spawning a normal (orchestrator) Claude thread. Overridden by the "),n("span",{class:"font-mono text-accentLight"},"CLAUDE_MODEL"),X(" env var if set. ")],-1)),Y(n("input",{"onUpdate:modelValue":w[0]||(w[0]=y=>r.value=y),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),[[te,r.value,void 0,{trim:!0}]])]),n("div",$p,[w[10]||(w[10]=n("label",{class:"block text-sm font-medium mb-1"},"Default Worker Model",-1)),w[11]||(w[11]=n("p",{class:"text-xs text-textSecondary mb-3"},[X(" Model used when spawning a worker Claude thread. Overridden by the "),n("span",{class:"font-mono text-accentLight"},"CLAUDE_WORKER_MODEL"),X(" env var if set. ")],-1)),Y(n("input",{"onUpdate:modelValue":w[1]||(w[1]=y=>a.value=y),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),[[te,a.value,void 0,{trim:!0}]])]),n("div",Sp,[w[12]||(w[12]=n("label",{class:"block text-sm font-medium mb-1"},"Claude CLI Path",-1)),w[13]||(w[13]=n("p",{class:"text-xs text-textSecondary mb-3"},[X(" Explicit path to the Claude binary. Leave empty to auto-detect. Overridden by the "),n("span",{class:"font-mono text-accentLight"},"CLAUDE_CLI_CMD"),X(" env var if set. ")],-1)),Y(n("input",{"onUpdate:modelValue":w[2]||(w[2]=y=>h.value=y),type:"text",placeholder:"(auto-detect)",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),[[te,h.value,void 0,{trim:!0}]])]),n("div",Cp,[w[14]||(w[14]=n("label",{class:"block text-sm font-medium mb-1"},"Git Bash Path (Windows)",-1)),w[15]||(w[15]=n("p",{class:"text-xs text-textSecondary mb-3"},[X(" Path to "),n("span",{class:"font-mono text-accentLight"},"bash.exe"),X(" passed to Claude via "),n("span",{class:"font-mono text-accentLight"},"CLAUDE_CODE_GIT_BASH_PATH"),X(". Leave empty to auto-detect. ")],-1)),Y(n("input",{"onUpdate:modelValue":w[3]||(w[3]=y=>p.value=y),type:"text",placeholder:"(auto-detect)",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),[[te,p.value,void 0,{trim:!0}]])]),n("div",Tp,[w[16]||(w[16]=n("label",{class:"block text-sm font-medium mb-1"},"Max Concurrent Threads",-1)),w[17]||(w[17]=n("p",{class:"text-xs text-textSecondary mb-3"}," Upper limit on simultaneously spawned agent processes. Raising this increases memory and CPU load. ",-1)),Y(n("input",{"onUpdate:modelValue":w[4]||(w[4]=y=>$.value=y),type:"number",min:"1",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),[[te,$.value,void 0,{number:!0}]])]),n("div",Pp,[w[21]||(w[21]=n("label",{class:"block text-sm font-medium mb-1"},"Claude OAuth Token",-1)),n("p",Ep,[w[18]||(w[18]=X(" Long-lived setup token used instead of the OAuth refresh flow. Overridden by the ",-1)),w[19]||(w[19]=n("span",{class:"font-mono text-accentLight"},"CLAUDE_CODE_OAUTH_TOKEN",-1)),w[20]||(w[20]=X(" env var if set. ",-1)),n("span",{class:G(V.value?"text-success":"text-muted")},b(V.value?"A token is currently stored.":"No token stored."),3)]),n("div",Ap,[Y(n("input",{"onUpdate:modelValue":w[5]||(w[5]=y=>S.value=y),type:"password",placeholder:V.value?"•••••••• (leave empty to keep)":"Paste token to store",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,Ip),[[te,S.value]]),V.value?(x(),v("button",{key:0,onClick:T,disabled:d.value,class:"px-3 py-2 rounded-lg border border-gray-700 hover:border-danger hover:text-danger disabled:opacity-50 text-sm transition whitespace-nowrap"},b(d.value?"Clearing…":"Clear"),9,Op)):H("",!0)])]),n("div",Mp,[w[26]||(w[26]=n("label",{class:"block text-sm font-medium mb-1"},"Environment Variables",-1)),w[27]||(w[27]=n("p",{class:"text-xs text-textSecondary mb-3"},[X(" Variables injected into every Claude child process. Locked entries are managed by the settings above and are read-only (secrets are masked). Add your own under "),n("span",{class:"font-mono text-accentLight"},"Additional Variables"),X(". ")],-1)),C.value.length?(x(),v("div",Dp,[(x(!0),v(ne,null,de(C.value,y=>(x(),v("div",{key:y.key,class:"flex items-center gap-2"},[n("input",{value:y.key,readonly:"",class:"flex-1 px-3 py-2 rounded-lg bg-surface/50 border border-gray-700/50 text-sm text-textSecondary font-mono cursor-not-allowed"},null,8,Rp),w[22]||(w[22]=n("span",{class:"text-muted text-xs"},"=",-1)),n("input",{value:y.value,readonly:"",class:"flex-1 px-3 py-2 rounded-lg bg-surface/50 border border-gray-700/50 text-sm text-textSecondary font-mono cursor-not-allowed"},null,8,jp),w[23]||(w[23]=n("span",{class:"text-muted text-xs px-2",title:"Locked"},"🔒",-1))]))),128))])):H("",!0),n("div",Lp,[w[24]||(w[24]=n("label",{class:"text-xs text-textSecondary"},"Additional Variables",-1)),n("button",{onClick:w[6]||(w[6]=y=>P.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(x(!0),v(ne,null,de(P.value,(y,I)=>(x(),v("div",{key:I,class:"flex items-center gap-2 mb-2"},[Y(n("input",{"onUpdate:modelValue":L=>y.k=L,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,Up),[[te,y.k]]),w[25]||(w[25]=n("span",{class:"text-muted text-xs"},"=",-1)),Y(n("input",{"onUpdate:modelValue":L=>y.v=L,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,Np),[[te,y.v]]),n("button",{onClick:L=>P.value.splice(I,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Vp)]))),128)),P.value.length===0?(x(),v("div",Bp,"No additional variables")):H("",!0)]),n("div",Fp,[w[30]||(w[30]=n("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),n("div",Hp,[n("div",null,[w[28]||(w[28]=n("div",{class:"text-xs text-muted mb-1"},"Thread Model",-1)),n("span",Kp,b(l.value),1)]),n("div",null,[w[29]||(w[29]=n("div",{class:"text-xs text-muted mb-1"},"Worker Model",-1)),n("span",Wp,b(c.value),1)])]),n("div",zp,[n("span",{class:G(["text-sm font-medium",Q.value?"text-warn":"text-textSecondary"])},b(Q.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),qp={class:"animate-fade-in"},Gp={class:"glass rounded-xl p-6 mb-6"},Yp={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},Zp={class:"flex items-center gap-3"},Qp=["disabled"],Xp={key:0,class:"text-center py-8 text-textSecondary text-sm"},em={key:1,class:"space-y-6"},tm={class:"glass rounded-xl p-4 border border-gray-700/50"},sm={id:"copilot-models"},nm=["value"],om={key:0,class:"text-xs text-success mt-2"},rm={class:"glass rounded-xl p-4 border border-gray-700/50"},lm={class:"flex items-center justify-between"},am={class:"glass rounded-xl p-4 border border-gray-700/50"},im=["disabled"],cm={class:"glass rounded-xl p-4 border border-gray-700/50"},um=["disabled"],dm={class:"glass rounded-xl p-4 border border-gray-700/50"},fm={class:"text-xs text-textSecondary mb-3"},pm={key:0,class:"text-success"},mm={key:1,class:"text-warn"},xm=["disabled","placeholder"],vm={class:"glass rounded-xl p-4 border border-gray-700/50"},gm={key:0,class:"mt-4 space-y-4"},hm={class:"text-xs text-textSecondary mb-2"},bm=["disabled"],ym={class:"text-xs text-textSecondary mb-2"},_m=["disabled"],wm={class:"glass rounded-xl p-4 border border-gray-700/50"},km={class:"flex items-center justify-between gap-3"},$m=["disabled"],Sm={key:1,class:"mt-3 max-h-48 overflow-y-auto rounded-lg bg-surface/50 border border-gray-700/50 p-3"},Cm={class:"glass rounded-xl p-4 border border-gray-700/50"},Tm={key:0,class:"space-y-2 mb-4"},Pm=["value"],Em=["value"],Am={class:"flex items-center justify-between mb-2"},Im=["onUpdate:modelValue"],Om=["onUpdate:modelValue"],Mm=["onClick"],Dm={key:1,class:"text-xs text-muted italic"},Rm={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},jm={class:"grid grid-cols-2 gap-4"},Lm={class:"text-sm font-medium font-mono text-textSecondary"},Um=Ne({__name:"CopilotTab",setup(e){const t=_(!0),s=_(!1),o=_(""),r=_(""),l=_(!1),a=_("openai"),c=_(""),d=_(""),h=_(""),f=_(""),p=_(!1),g=_(!1),$=_(!1),B=_(""),S=_([]),V=_([]),C=_([]);function P(){const Z={};for(const T of C.value){const R=T.k.trim();R&&(Z[R]=T.v)}return Z}async function U(){t.value=!0;try{const Z=await ve("/api/settings/copilot");O(Z),l.value&&p.value&&re(!0)}finally{t.value=!1}}function O(Z){r.value=Z.model,l.value=Z.byok.enabled,a.value=Z.byok.providerType,c.value=Z.byok.baseUrl,d.value=Z.byok.modelId,h.value=Z.byok.wireModel,p.value=Z.byok.apiKeySet,f.value="";const T=Z.env??[];V.value=T.filter(R=>R.locked),C.value=T.filter(R=>!R.locked).map(R=>({k:R.key,v:R.value}))}const Q=Pe(()=>!(!r.value.trim()||l.value&&(!c.value.trim()||!p.value&&!f.value.trim())));async function ie(){if(s.value=!0,o.value="",!r.value.trim()){o.value="Error: Model cannot be empty",s.value=!1;return}try{const Z={enabled:l.value,providerType:a.value,baseUrl:c.value.trim(),modelId:d.value.trim(),wireModel:h.value.trim()};f.value.trim()&&(Z.apiKey=f.value.trim());const T={Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},R=await fetch("/api/settings/copilot",{method:"POST",headers:T,body:JSON.stringify({model:r.value.trim(),byok:Z,customEnvVars:P()})});if(!R.ok){const y=await R.json().catch(()=>({error:R.statusText}));throw new Error(y.error??R.statusText)}const w=await R.json();O(w),o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(Z){o.value="Error: "+Z.message}finally{s.value=!1}}async function re(Z=!1){$.value=!0,B.value="",S.value=[];try{const T={baseUrl:c.value.trim(),providerType:a.value};f.value.trim()&&(T.apiKey=f.value.trim());const R=await fetch("/api/settings/copilot/models",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify(T)}),w=await R.json();if(!R.ok||!w.ok)throw new Error(w.error??R.statusText);S.value=w.models??[],B.value=`OK — ${w.count??S.value.length} models`}catch(T){Z||(B.value="Error: "+T.message)}finally{$.value=!1}}return je(U),(Z,T)=>(x(),v("div",qp,[n("div",Gp,[n("div",Yp,[T[10]||(T[10]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Copilot"),n("p",{class:"text-sm text-textSecondary mt-1"},"Model and bring-your-own-key provider (OpenRouter, DeepSeek, Kimi)")],-1)),n("div",Zp,[o.value?(x(),v("span",{key:0,class:G([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},b(o.value),3)):H("",!0),n("button",{onClick:ie,disabled:s.value||t.value||!Q.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},b(s.value?"Saving…":"Save"),9,Qp)])]),t.value?(x(),v("div",Xp,"Loading…")):(x(),v("div",em,[n("div",tm,[T[11]||(T[11]=n("label",{class:"block text-sm font-medium mb-1"},"Copilot Model",-1)),T[12]||(T[12]=n("p",{class:"text-xs text-textSecondary mb-3"},[X(" Model passed to the Copilot CLI via "),n("span",{class:"font-mono text-accentLight"},"--model"),X(" / "),n("span",{class:"font-mono text-accentLight"},"COPILOT_MODEL"),X(". ")],-1)),Y(n("input",{"onUpdate:modelValue":T[0]||(T[0]=R=>r.value=R),type:"text",list:"copilot-models",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),[[te,r.value,void 0,{trim:!0}]]),n("datalist",sm,[(x(!0),v(ne,null,de(S.value,R=>(x(),v("option",{key:R,value:R},null,8,nm))),128))]),S.value.length?(x(),v("p",om,b(S.value.length)+" models loaded from provider — pick one from the dropdown. ",1)):H("",!0)]),n("div",rm,[n("div",lm,[T[13]||(T[13]=n("div",null,[n("div",{class:"text-sm font-medium"},"Custom Provider (BYOK)"),n("p",{class:"text-xs text-textSecondary mt-1"}," Route Copilot through an OpenAI-compatible endpoint. GitHub auth is not used while enabled. ")],-1)),n("button",{onClick:T[1]||(T[1]=R=>l.value=!l.value),class:G(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors shrink-0",l.value?"bg-accent":"bg-gray-700"])},[n("span",{class:G(["inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform",l.value?"translate-x-6":"translate-x-1"])},null,2)],2)])]),n("div",{class:G(["space-y-4 transition",l.value?"":"opacity-40 pointer-events-none select-none"])},[n("div",am,[T[15]||(T[15]=n("label",{class:"block text-sm font-medium mb-1"},"Provider Type",-1)),T[16]||(T[16]=n("p",{class:"text-xs text-textSecondary mb-3"},[X(" Wire protocol of the endpoint ("),n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_TYPE"),X("). ")],-1)),Y(n("select",{"onUpdate:modelValue":T[2]||(T[2]=R=>a.value=R),disabled:!l.value,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"},[...T[14]||(T[14]=[n("option",{value:"openai"},"openai",-1),n("option",{value:"azure"},"azure",-1),n("option",{value:"anthropic"},"anthropic",-1)])],8,im),[[ht,a.value]])]),n("div",cm,[T[17]||(T[17]=n("label",{class:"block text-sm font-medium mb-1"},"Base URL",-1)),T[18]||(T[18]=n("p",{class:"text-xs text-textSecondary mb-3"},[X(" e.g. "),n("span",{class:"font-mono text-accentLight"},"https://openrouter.ai/api/v1"),X(" ("),n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_BASE_URL"),X("). ")],-1)),Y(n("input",{"onUpdate:modelValue":T[3]||(T[3]=R=>c.value=R),type:"text",disabled:!l.value,placeholder:"https://openrouter.ai/api/v1",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,8,um),[[te,c.value,void 0,{trim:!0}]])]),n("div",dm,[T[22]||(T[22]=n("label",{class:"block text-sm font-medium mb-1"},"API Key",-1)),n("p",fm,[T[19]||(T[19]=X(" Stored server-side and never echoed back (",-1)),T[20]||(T[20]=n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_API_KEY",-1)),T[21]||(T[21]=X("). ",-1)),p.value?(x(),v("span",pm,"A key is currently set — leave blank to keep it.")):(x(),v("span",mm,"No key set."))]),Y(n("input",{"onUpdate:modelValue":T[4]||(T[4]=R=>f.value=R),type:"password",disabled:!l.value,placeholder:p.value?"•••••••• (unchanged)":"sk-…",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,8,xm),[[te,f.value]])]),n("div",vm,[n("button",{type:"button",onClick:T[5]||(T[5]=R=>g.value=!g.value),class:"text-sm font-medium text-textSecondary hover:text-textPrimary transition flex items-center gap-2"},[n("span",null,b(g.value?"▾":"▸"),1),T[23]||(T[23]=X(" Advanced (model mapping) ",-1))]),g.value?(x(),v("div",gm,[n("div",null,[T[26]||(T[26]=n("label",{class:"block text-sm font-medium mb-1"},"Model ID",-1)),n("p",hm,[T[24]||(T[24]=X(" Well-known base model for tool config (",-1)),T[25]||(T[25]=n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_MODEL_ID",-1)),X("). Defaults to Copilot Model. "+b(S.value.length?"Pick from the tested provider models below.":"Run Test to load the provider’s model list."),1)]),Y(n("input",{"onUpdate:modelValue":T[6]||(T[6]=R=>d.value=R),type:"text",list:"copilot-models",disabled:!l.value,placeholder:"(defaults to Copilot Model)",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,8,bm),[[te,d.value,void 0,{trim:!0}]])]),n("div",null,[T[29]||(T[29]=n("label",{class:"block text-sm font-medium mb-1"},"Wire Model",-1)),n("p",ym,[T[27]||(T[27]=X(" Exact model name sent to the provider (",-1)),T[28]||(T[28]=n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_WIRE_MODEL",-1)),X("). Defaults to Copilot Model. "+b(S.value.length?"Pick from the tested provider models below.":"Run Test to load the provider’s model list."),1)]),Y(n("input",{"onUpdate:modelValue":T[7]||(T[7]=R=>h.value=R),type:"text",list:"copilot-models",disabled:!l.value,placeholder:"(defaults to Copilot Model)",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,8,_m),[[te,h.value,void 0,{trim:!0}]])])])):H("",!0)]),n("div",wm,[n("div",km,[T[30]||(T[30]=n("div",null,[n("div",{class:"text-sm font-medium"},"Test Connection"),n("p",{class:"text-xs text-textSecondary mt-1"}," Lists models from the endpoint above using the values entered here — no need to save first. Uses the right auth for the selected Provider Type (openai/azure/anthropic). ")],-1)),n("button",{onClick:T[8]||(T[8]=R=>re()),disabled:$.value||!l.value,class:"px-4 py-2 rounded-xl bg-surface border border-gray-700 hover:border-accent disabled:opacity-50 text-sm font-medium transition whitespace-nowrap"},b($.value?"Testing…":"Test"),9,$m)]),B.value?(x(),v("div",{key:0,class:G([B.value.startsWith("Error")?"text-danger":"text-success","text-sm mt-3"])},b(B.value),3)):H("",!0),S.value.length?(x(),v("div",Sm,[(x(!0),v(ne,null,de(S.value,R=>(x(),v("div",{key:R,class:"text-xs font-mono text-textSecondary py-0.5"},b(R),1))),128))])):H("",!0)])],2),n("div",Cm,[T[35]||(T[35]=n("label",{class:"block text-sm font-medium mb-1"},"Environment Variables",-1)),T[36]||(T[36]=n("p",{class:"text-xs text-textSecondary mb-3"},[X(" Variables injected into every Copilot child process. Locked entries are managed by the settings above and are read-only (secrets are masked). Add your own under "),n("span",{class:"font-mono text-accentLight"},"Additional Variables"),X(". ")],-1)),V.value.length?(x(),v("div",Tm,[(x(!0),v(ne,null,de(V.value,R=>(x(),v("div",{key:R.key,class:"flex items-center gap-2"},[n("input",{value:R.key,readonly:"",class:"flex-1 px-3 py-2 rounded-lg bg-surface/50 border border-gray-700/50 text-sm text-textSecondary font-mono cursor-not-allowed"},null,8,Pm),T[31]||(T[31]=n("span",{class:"text-muted text-xs"},"=",-1)),n("input",{value:R.value,readonly:"",class:"flex-1 px-3 py-2 rounded-lg bg-surface/50 border border-gray-700/50 text-sm text-textSecondary font-mono cursor-not-allowed"},null,8,Em),T[32]||(T[32]=n("span",{class:"text-muted text-xs px-2",title:"Locked"},"🔒",-1))]))),128))])):H("",!0),n("div",Am,[T[33]||(T[33]=n("label",{class:"text-xs text-textSecondary"},"Additional Variables",-1)),n("button",{onClick:T[9]||(T[9]=R=>C.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(x(!0),v(ne,null,de(C.value,(R,w)=>(x(),v("div",{key:w,class:"flex items-center gap-2 mb-2"},[Y(n("input",{"onUpdate:modelValue":y=>R.k=y,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,Im),[[te,R.k]]),T[34]||(T[34]=n("span",{class:"text-muted text-xs"},"=",-1)),Y(n("input",{"onUpdate:modelValue":y=>R.v=y,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,Om),[[te,R.v]]),n("button",{onClick:y=>C.value.splice(w,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Mm)]))),128)),C.value.length===0?(x(),v("div",Dm,"No additional variables")):H("",!0)]),n("div",Rm,[T[39]||(T[39]=n("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),n("div",jm,[n("div",null,[T[37]||(T[37]=n("div",{class:"text-xs text-muted mb-1"},"Model",-1)),n("span",Lm,b(r.value||"—"),1)]),n("div",null,[T[38]||(T[38]=n("div",{class:"text-xs text-muted mb-1"},"Custom Provider",-1)),n("span",{class:G(["text-sm font-medium",l.value?"text-success":"text-textSecondary"])},b(l.value?"Enabled":"Disabled"),3)])])])]))])]))}}),Nm={class:"animate-fade-in"},Vm={class:"glass rounded-xl p-6 mb-6"},Bm={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},Fm={class:"flex items-center gap-3"},Hm=["disabled"],Km={key:0,class:"text-center py-8 text-textSecondary text-sm"},Wm={key:1,class:"space-y-6"},zm={class:"glass rounded-xl p-4 border border-gray-700/50"},Jm={class:"flex items-center gap-4"},qm={class:"flex justify-between text-xs text-muted mt-2"},Gm={class:"font-mono"},Ym={key:0,class:"mt-3 px-3 py-2 rounded-lg bg-warn/10 border border-warn/20 text-xs text-warn"},Zm={class:"glass rounded-xl p-4 border border-gray-700/50"},Qm={class:"flex items-center gap-4"},Xm={class:"flex justify-between text-xs text-muted mt-2"},ex={class:"font-mono"},tx={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},sx={class:"grid grid-cols-2 gap-4"},nx={class:"text-sm font-medium text-textSecondary"},ox={class:"mt-3"},rx=Ne({__name:"SettingsTab",setup(e){const t=_(!0),s=_(!1),o=_(""),r=_(50),l=_(50),a=_(1440),c=_(1440),d=Pe(()=>r.value!==l.value||a.value!==c.value);async function h(){t.value=!0;try{const[p,g]=await Promise.all([ve("/api/settings/bootstrap-message-count"),ve("/api/settings/wait-timeout")]);r.value=p.count,l.value=p.count,a.value=g.minutes,c.value=g.minutes}finally{t.value=!1}}async function f(){s.value=!0,o.value="";try{const p={Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},[g,$]=await Promise.all([fetch("/api/settings/bootstrap-message-count",{method:"POST",headers:p,body:JSON.stringify({count:r.value})}),fetch("/api/settings/wait-timeout",{method:"POST",headers:p,body:JSON.stringify({minutes:a.value})})]);for(const V of[g,$])if(!V.ok){const C=await V.json().catch(()=>({error:V.statusText}));throw new Error(C.error??V.statusText)}const B=await g.json(),S=await $.json();l.value=B.count,r.value=B.count,c.value=S.minutes,a.value=S.minutes,o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(p){o.value="Error: "+p.message}finally{s.value=!1}}return je(h),(p,g)=>(x(),v("div",Nm,[n("div",Vm,[n("div",Bm,[g[4]||(g[4]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Settings"),n("p",{class:"text-sm text-textSecondary mt-1"},"Configure agent behavior and context injection")],-1)),n("div",Fm,[o.value?(x(),v("span",{key:0,class:G([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},b(o.value),3)):H("",!0),n("button",{onClick:f,disabled:s.value||t.value||!d.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},b(s.value?"Saving…":"Save"),9,Hm)])]),t.value?(x(),v("div",Km,"Loading…")):(x(),v("div",Wm,[n("div",zm,[g[8]||(g[8]=n("label",{class:"block text-sm font-medium mb-1"},"Recent Conversation Buffer",-1)),g[9]||(g[9]=n("p",{class:"text-xs text-textSecondary mb-3"},[X(" Number of recent messages injected into the agent's bootstrap context. Set to "),n("span",{class:"font-mono text-accentLight"},"0"),X(" to disable (useful when using VS Code, which maintains its own conversation history). ")],-1)),n("div",Jm,[Y(n("input",{"onUpdate:modelValue":g[0]||(g[0]=$=>r.value=$),type:"range",min:"0",max:"100",step:"5",class:"flex-1 accent-accent"},null,512),[[te,r.value,void 0,{number:!0}]]),Y(n("input",{"onUpdate:modelValue":g[1]||(g[1]=$=>r.value=$),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),[[te,r.value,void 0,{number:!0}]])]),n("div",qm,[g[5]||(g[5]=n("span",null,"Off",-1)),n("span",Gm,b(r.value)+" messages",1),g[6]||(g[6]=n("span",null,"Max",-1))]),r.value===0?(x(),v("div",Ym,[...g[7]||(g[7]=[X(" Message buffer injection is ",-1),n("strong",null,"disabled",-1),X(". 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)])])):H("",!0)]),n("div",Zm,[g[12]||(g[12]=n("label",{class:"block text-sm font-medium mb-1"},"Poll Timeout (wait_for_instructions)",-1)),g[13]||(g[13]=n("p",{class:"text-xs text-textSecondary mb-3"},[X(" Maximum time (in minutes) a single "),n("span",{class:"font-mono text-accentLight"},"wait_for_instructions"),X(" call will poll before timing out. Claude Code agents use the full value; Copilot agents are capped at 10 min. ")],-1)),n("div",Qm,[Y(n("input",{"onUpdate:modelValue":g[2]||(g[2]=$=>a.value=$),type:"range",min:"1",max:"1440",step:"10",class:"flex-1 accent-accent"},null,512),[[te,a.value,void 0,{number:!0}]]),Y(n("input",{"onUpdate:modelValue":g[3]||(g[3]=$=>a.value=$),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),[[te,a.value,void 0,{number:!0}]])]),n("div",Xm,[g[10]||(g[10]=n("span",null,"1 min",-1)),n("span",ex,b(a.value>=60?Math.floor(a.value/60)+"h "+a.value%60+"m":a.value+" min"),1),g[11]||(g[11]=n("span",null,"24h",-1))])]),n("div",tx,[g[16]||(g[16]=n("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),n("div",sx,[n("div",null,[g[14]||(g[14]=n("div",{class:"text-xs text-muted mb-1"},"Message Buffer",-1)),n("span",{class:G(["text-sm font-medium",l.value>0?"text-success":"text-textSecondary"])},b(l.value>0?`${l.value} messages`:"Disabled"),3)]),n("div",null,[g[15]||(g[15]=n("div",{class:"text-xs text-muted mb-1"},"Poll Timeout",-1)),n("span",nx,b(c.value>=60?Math.floor(c.value/60)+"h "+c.value%60+"m":c.value+" min"),1)])]),n("div",ox,[n("span",{class:G(["text-sm font-medium",d.value?"text-warn":"text-textSecondary"])},b(d.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),lx={class:"animate-fade-in"},ax={class:"glass rounded-xl p-6 mb-6"},ix={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},cx={class:"flex flex-wrap gap-3 items-center"},ux=["disabled"],dx={key:0,class:"flex items-center gap-2"},fx={key:1},px={class:"glass rounded-xl p-6"},mx={key:0,class:"text-center py-8 text-textSecondary text-sm"},xx={key:1,class:"text-center py-12 text-textSecondary text-sm"},vx={key:2,class:"space-y-2"},gx={class:"flex items-center justify-between gap-3"},hx={class:"flex-1 min-w-0"},bx={class:"flex flex-wrap items-center gap-2 mb-1"},yx={class:"font-medium text-sm font-mono"},_x={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},wx={class:"text-xs text-muted"},kx={class:"text-xs text-muted"},$x=["onClick","disabled"],Sx={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/80 backdrop-blur-sm"},Cx={class:"glass rounded-2xl p-6 max-w-sm w-full mx-4"},Tx={class:"text-sm text-textSecondary mb-4"},Px={class:"font-mono text-textPrimary"},Ex=Ne({__name:"SnapshotsTab",setup(e){const t=_([]),s=_(!0),o=_(!1),r=_(null),l=_(""),a=_(""),c=_(!0),d=_(null);function h(C){return C<1024?`${C} B`:C<1024*1024?`${(C/1024).toFixed(1)} KB`:`${(C/(1024*1024)).toFixed(1)} MB`}function f(C){try{return new Date(C).toLocaleString()}catch{return C}}function p(C,P){a.value=C,c.value=P,setTimeout(()=>{a.value=""},4e3)}async function g(){s.value=!0;try{const C=await ve("/api/snapshots");t.value=C.snapshots}catch(C){p("Failed to load snapshots: "+C.message,!1)}finally{s.value=!1}}async function $(){if(!o.value){o.value=!0;try{await ve("/api/snapshots",{method:"POST",body:JSON.stringify({description:l.value})}),l.value="",p("Snapshot created ✓",!0),await g()}catch(C){p("Error: "+C.message,!1)}finally{o.value=!1}}}function B(C){d.value=C}function S(){d.value=null}async function V(){const C=d.value;if(!(!C||r.value)){d.value=null,r.value=C;try{await ve(`/api/snapshots/${encodeURIComponent(C)}`,{method:"DELETE"}),p("Deleted ✓",!0),await g()}catch(P){p("Error: "+P.message,!1)}finally{r.value=null}}}return je(g),(C,P)=>(x(),v("div",lx,[n("div",ax,[n("div",ix,[P[1]||(P[1]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Snapshots"),n("p",{class:"text-sm text-textSecondary mt-1"},"Create and manage data directory snapshots")],-1)),a.value?(x(),v("span",{key:0,class:G(["text-sm",c.value?"text-success":"text-danger"])},b(a.value),3)):H("",!0)]),n("div",cx,[Y(n("input",{"onUpdate:modelValue":P[0]||(P[0]=U=>l.value=U),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:Xe($,["enter"])},null,544),[[te,l.value]]),n("button",{onClick:$,disabled:o.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"},[o.value?(x(),v("span",dx,[...P[2]||(P[2]=[n("svg",{class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 12a8 8 0 018-8v8H4z"})],-1),X(" Creating… ",-1)])])):(x(),v("span",fx,"+ Create Snapshot"))],8,ux)])]),n("div",px,[s.value?(x(),v("div",mx,"Loading…")):t.value.length===0?(x(),v("div",xx,"No snapshots yet")):(x(),v("div",vx,[(x(!0),v(ne,null,de(t.value,U=>(x(),v("div",{key:U.name,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[n("div",gx,[n("div",hx,[n("div",bx,[n("span",yx,b(U.name),1),n("span",_x,"v"+b(U.mcpVersion),1),n("span",wx,b(h(U.sizeBytes)),1)]),n("div",kx,[X(b(f(U.createdAt)),1),U.description?(x(),v(ne,{key:0},[X(" · "+b(U.description),1)],64)):H("",!0)])]),n("button",{onClick:O=>B(U.name),disabled:r.value===U.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"},b(r.value===U.name?"…":"Delete"),9,$x)])]))),128))]))]),d.value?(x(),v("div",Sx,[n("div",Cx,[P[5]||(P[5]=n("h3",{class:"text-base font-semibold mb-2"},"Delete Snapshot",-1)),n("p",Tx,[P[3]||(P[3]=X(" Delete ",-1)),n("span",Px,b(d.value),1),P[4]||(P[4]=X("? This cannot be undone. ",-1))]),n("div",{class:"flex gap-3"},[n("button",{onClick:V,class:"flex-1 px-4 py-2 rounded-xl bg-danger hover:opacity-80 text-white text-sm font-medium transition"},"Delete"),n("button",{onClick:S,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")])])])):H("",!0)]))}}),Ax={class:"animate-fade-in space-y-6"},Ix={class:"glass rounded-xl p-6"},Ox={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},Mx={class:"text-sm text-textSecondary mt-1"},Dx={class:"flex items-center gap-3"},Rx={key:0,class:"text-xs text-accentLight animate-pulse"},jx={key:0,class:"flex flex-wrap gap-2 mt-3"},Lx=["onClick"],Ux={class:"ml-1 opacity-60"},Nx={key:0,class:"text-center py-12 text-textSecondary"},Vx={key:1,class:"text-center py-8 text-danger text-sm"},Bx={key:2,class:"text-center py-12 text-textSecondary"},Fx={key:3,class:"space-y-3"},Hx={class:"flex flex-wrap items-start gap-3"},Kx={class:"flex-1 min-w-0 space-y-2"},Wx={class:"flex flex-wrap items-center gap-2"},zx={class:"font-semibold truncate"},Jx={class:"text-xs text-muted font-mono"},qx={class:"flex flex-wrap items-center gap-4 text-xs text-textSecondary"},Gx={title:"Created"},Yx={title:"Archived"},Zx={key:0,class:"text-muted"},Qx={key:0,class:"text-sm text-textSecondary mt-1 leading-relaxed"},Xx={key:1,class:"text-sm text-muted mt-1 italic animate-pulse"},ev={class:"flex items-center gap-2 shrink-0"},tv=["onClick","disabled"],sv=3,nv=Ne({__name:"ArchivedThreadsTab",setup(e){const t=_([]),s=_(!0),o=_(""),r=_({}),l=_({}),a=_({done:0,total:0}),c=_(null),d=_("all");let h=0;const f={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"}},p=Pe(()=>d.value==="all"?t.value:t.value.filter(P=>P.type===d.value)),g=Pe(()=>{const P={all:t.value.length};for(const U of t.value)P[U.type]=(P[U.type]??0)+1;return P}),$=Pe(()=>Object.values(l.value).some(Boolean));async function B(){s.value=!0,o.value="";try{const P=await ve("/api/threads/archived");t.value=P.threads??[],r.value={},l.value={},t.value.length>0&&S()}catch(P){o.value=P.message||"Failed to load archived threads"}finally{s.value=!1}}async function S(){const P=++h,U=[...t.value];a.value={done:0,total:U.length};async function O(){for(;U.length>0&&P===h;){const ie=U.shift();l.value={...l.value,[ie.threadId]:!0};try{const re=await fetch(`/api/threads/${ie.threadId}/summary`,{method:"POST",headers:{Authorization:`Bearer ${fe()}`}});if(P!==h)return;if(re.ok){const Z=await re.json();Z.summary&&(r.value={...r.value,[ie.threadId]:Z.summary})}}catch{}finally{if(P===h){const{[ie.threadId]:re,...Z}=l.value;l.value=Z,a.value={...a.value,done:a.value.done+1}}}}}const Q=Array.from({length:Math.min(sv,U.length)},()=>O());await Promise.all(Q)}function V(P){if(!P)return"—";const U=new Date(P),Q=Date.now()-U.getTime(),ie=Math.floor(Q/6e4),re=Math.floor(Q/36e5),Z=Math.floor(Q/864e5),T=Math.floor(Z/30);return ie<1?"just now":ie<60?`${ie}m ago`:re<24?`${re}h ago`:Z<30?`${Z}d ago`:T<12?`${T}mo ago`:`${Math.floor(T/12)}y ago`}async function C(P){if(confirm(`Unarchive thread "${P.name}" (${P.threadId})?`)){c.value=P.threadId;try{const U=await fetch(`/api/threads/${P.threadId}/unarchive`,{method:"POST",headers:{Authorization:`Bearer ${fe()}`}});if(!U.ok){const O=await U.json().catch(()=>({error:U.statusText}));throw new Error(O.error??U.statusText)}await B()}catch(U){o.value="Failed to unarchive: "+U.message}finally{c.value=null}}}return je(B),(P,U)=>(x(),v("div",Ax,[n("div",Ix,[n("div",Ox,[n("div",null,[U[0]||(U[0]=n("h3",{class:"text-lg font-semibold"},"Archived Threads",-1)),n("p",Mx,b(t.value.length)+" archived thread"+b(t.value.length!==1?"s":"")+" — auto-purged after 180 days",1)]),n("div",Dx,[$.value?(x(),v("span",Rx," Building summaries… "+b(a.value.done)+"/"+b(a.value.total),1)):H("",!0),n("button",{onClick:B,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),t.value.length>0?(x(),v("div",jx,[(x(),v(ne,null,de(["all","root","branch","daily"],O=>n("button",{key:O,onClick:Q=>d.value=O,class:G(["px-3 py-1 rounded-full text-xs font-medium border transition",d.value===O?"bg-accent/20 text-accent border-accent/30":"bg-card border-gray-700 text-textSecondary hover:border-gray-600"])},[X(b(O==="all"?"All":O.charAt(0).toUpperCase()+O.slice(1))+" ",1),n("span",Ux,"("+b(g.value[O]??0)+")",1)],10,Lx)),64))])):H("",!0)]),s.value&&t.value.length===0?(x(),v("div",Nx,"Loading archived threads…")):o.value?(x(),v("div",Vx,b(o.value),1)):t.value.length===0?(x(),v("div",Bx,"No archived threads")):H("",!0),p.value.length>0?(x(),v("div",Fx,[(x(!0),v(ne,null,de(p.value,O=>{var Q,ie;return x(),v("div",{key:O.id,class:"glass rounded-xl p-4"},[n("div",Hx,[n("div",Kx,[n("div",Wx,[n("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(Q=f[O.type])==null?void 0:Q.classes])},b((ie=f[O.type])==null?void 0:ie.emoji)+" "+b(O.type.toUpperCase()),3),n("span",zx,b(O.name),1),n("span",Jx,"ID: "+b(O.threadId),1)]),n("div",qx,[n("span",Gx,"Created "+b(V(O.createdAt)),1),n("span",Yx,"Archived "+b(V(O.archivedAt??O.lastActiveAt)),1),O.client?(x(),v("span",Zx,b(O.client),1)):H("",!0)]),r.value[O.threadId]?(x(),v("div",Qx,b(r.value[O.threadId]),1)):l.value[O.threadId]?(x(),v("div",Xx," Generating summary… ")):H("",!0)]),n("div",ev,[n("button",{onClick:re=>C(O),disabled:c.value===O.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"},b(c.value===O.threadId?"Restoring…":"↩ Unarchive"),9,tv)])])])}),128))])):H("",!0)]))}}),ov={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/95 backdrop-blur-sm"},rv={class:"glass rounded-2xl p-8 max-w-md w-full mx-4 animate-slide-up"},lv=["disabled"],av={key:0,class:"mt-3 text-sm text-danger"},iv={key:1,class:"min-h-screen font-sans text-textPrimary animate-fade-in"},cv={class:"glass sticky top-0 z-40 border-b border-gray-800/50"},uv={class:"max-w-7xl mx-auto px-4 sm:px-6 py-4 flex items-center justify-between"},dv={class:"flex items-center gap-4"},fv={class:"text-sm text-textSecondary font-mono"},pv={class:"max-w-7xl mx-auto px-4 sm:px-6 py-6"},mv={class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3"},xv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},vv={class:"text-2xl font-bold font-mono"},gv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},hv={class:"text-2xl font-bold font-mono"},bv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},yv={class:"text-2xl font-bold font-mono"},_v={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},wv={class:"flex items-center gap-2 mb-2"},kv={class:"text-2xl font-bold font-mono"},$v={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Sv={class:"text-2xl font-bold font-mono"},Cv={class:"max-w-7xl mx-auto px-4 sm:px-6"},Tv={class:"flex gap-6 border-b border-gray-800/50 mb-6"},Pv=["onClick"],Ev={class:"max-w-7xl mx-auto px-4 sm:px-6 pb-12"},vs="sensorium_token",Av=Ne({__name:"App",setup(e){const t=_(!1),s=_(""),o=_(""),r=_(!1),l=_(null),a=_("sessions");let c=null;const d=[{id:"sessions",label:"Sessions"},{id:"notes",label:"Memory Notes"},{id:"templates",label:"Templates"},{id:"skills",label:"Skills"},{id:"agents",label:"Agents"},{id:"threads",label:"Threads"},{id:"archived",label:"Archived"},{id:"mcp",label:"MCP Servers"},{id:"prompts",label:"Prompts"},{id:"snapshots",label:"Snapshots"},{id:"claude",label:"Claude"},{id:"copilot",label:"Copilot"},{id:"settings",label:"Settings"}],h={sessions:ri,notes:ki,templates:nc,skills:Hc,agents:pf,threads:jd,archived:nv,mcp:ep,prompts:xp,snapshots:Ex,claude:Jp,copilot:Um,settings:rx},f=Pe(()=>h[a.value]),p=Pe(()=>{if(!l.value)return"—";const V=Math.floor(l.value.uptime),C=Math.floor(V/86400),P=Math.floor(V%86400/3600),U=Math.floor(V%3600/60);return C>0?`${C}d ${P}h`:P>0?`${P}h ${U}m`:`${U}m`});async function g(){const V=s.value.trim()||"no-auth";r.value=!0,o.value="";try{qt(V),await B(),localStorage.setItem(vs,V),t.value=!0,S()}catch(C){const P=C;P.status===401?o.value="Invalid token":o.value=P.message??"Connection failed",qt("")}finally{r.value=!1}}function $(){localStorage.removeItem(vs),t.value=!1,s.value="",l.value=null,c&&clearInterval(c),qt("")}async function B(){l.value=await ve("/api/status")}function S(){c&&clearInterval(c),c=setInterval(B,3e4)}return je(async()=>{const V=localStorage.getItem(vs);if(V){s.value=V;try{qt(V),await B(),t.value=!0,S()}catch{localStorage.removeItem(vs),qt("")}}}),wn(()=>{c&&clearInterval(c)}),(V,C)=>{var P,U,O,Q,ie,re,Z,T,R;return t.value?(x(),v("div",iv,[n("header",cv,[n("div",uv,[C[3]||(C[3]=ut('<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)),n("div",dv,[C[2]||(C[2]=n("div",{class:"flex items-center gap-2 text-sm"},[n("span",{class:"w-2 h-2 rounded-full bg-success animate-pulse-slow"}),n("span",{class:"text-textSecondary"},"Connected")],-1)),n("div",fv,b(p.value),1),n("button",{onClick:$,class:"text-sm text-muted hover:text-textSecondary transition"},"Disconnect")])])]),n("div",pv,[n("div",mv,[n("div",xv,[C[4]||(C[4]=ut('<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)),n("div",vv,b(((P=l.value)==null?void 0:P.activeSessions)??0),1)]),n("div",gv,[C[5]||(C[5]=ut('<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)),n("div",hv,b(((O=(U=l.value)==null?void 0:U.memory)==null?void 0:O.totalSemanticNotes)??0),1)]),n("div",bv,[C[6]||(C[6]=ut('<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)),n("div",yv,b(((ie=(Q=l.value)==null?void 0:Q.memory)==null?void 0:ie.totalEpisodes)??0),1)]),n("div",_v,[n("div",wv,[n("span",{class:G((((Z=(re=l.value)==null?void 0:re.memory)==null?void 0:Z.unconsolidatedEpisodes)??0)>10?"text-danger":"text-success")},[...C[7]||(C[7]=[n("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[n("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),C[8]||(C[8]=n("span",{class:"text-xs text-textSecondary font-medium uppercase tracking-wider"},"Unconsolidated",-1))]),n("div",kv,b(((R=(T=l.value)==null?void 0:T.memory)==null?void 0:R.unconsolidatedEpisodes)??0),1)]),n("div",$v,[C[9]||(C[9]=ut('<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)),n("div",Sv,b(p.value),1)])])]),n("div",Cv,[n("nav",Tv,[(x(),v(ne,null,de(d,w=>n("button",{key:w.id,onClick:y=>a.value=w.id,class:G(["pb-3 text-sm font-medium transition",a.value===w.id?"tab-active":"tab-inactive"])},b(w.label),11,Pv)),64))])]),n("div",Ev,[(x(),fr(El(f.value),{status:l.value},null,8,["status"]))])])):(x(),v("div",ov,[n("div",rv,[C[1]||(C[1]=ut('<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)),Y(n("input",{"onUpdate:modelValue":C[0]||(C[0]=w=>s.value=w),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:Xe(g,["enter"])},null,544),[[te,s.value]]),n("button",{onClick:g,disabled:r.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"},b(r.value?"Connecting...":"Connect"),9,lv),o.value?(x(),v("p",av,b(o.value),1)):H("",!0)])]))}}});Fa(Av).mount("#app");</script>
71
+ `,se+ue}async function V(){if(!o.value)return;const T=o.value.name;try{const A=a.value.split(",").map(H=>H.trim()).filter(Boolean),J=r.value;let ue;J.trimStart().startsWith("---")?ue=J:ue=F(T,A,l.value,J);const se=await fetch(`/api/skills/${encodeURIComponent(T)}`,{method:"PUT",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ue})});if(!se.ok)throw new Error(se.statusText);c.value="Saved ✓",setTimeout(()=>{c.value=""},3e3),await P()}catch(A){c.value="Error: "+A.message}}async function w(){if(!o.value)return;const T=o.value.name;try{const A=await fetch(`/api/skills/${encodeURIComponent(T)}`,{method:"DELETE",headers:{Authorization:`Bearer ${fe()}`}});if(!A.ok)throw new Error(A.statusText);E(),await P()}catch(A){d.value="Error: "+A.message}}async function b(){const T=f.value.trim(),A=p.value;if(!T){$.value="Name is required";return}const J=A.split(",").map(se=>se.trim()).filter(Boolean);if(!J.length){$.value="At least one trigger is required";return}const ue=F(T,J,g.value,`\x3C!-- Write your skill instructions here -->
72
+ `);try{const se=await fetch(`/api/skills/${encodeURIComponent(T)}`,{method:"PUT",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ue})});if(!se.ok)throw new Error(se.statusText);$.value="Created ✓",h.value=!1,await P();const H=t.value.find(j=>j.name===T);H&&Z(H)}catch(se){$.value="Error: "+se.message}}return je(()=>{P(),L()}),(T,A)=>(x(),v("div",oc,[n("div",rc,[n("div",ac,[A[10]||(A[10]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Skill Library"),n("p",{class:"text-sm text-textSecondary mt-1"},"Manage intent-routing skills — user overrides, defaults, and project skills")],-1)),n("button",{onClick:A[0]||(A[0]=J=>{h.value=!h.value,o.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?(x(),v("div",lc,[A[14]||(A[14]=n("h4",{class:"text-sm font-semibold mb-3"},"Create New Skill",-1)),n("div",ic,[n("div",null,[A[11]||(A[11]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),G(n("input",{"onUpdate:modelValue":A[1]||(A[1]=J=>f.value=J),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),[[ee,f.value]])]),n("div",null,[A[12]||(A[12]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),G(n("input",{"onUpdate:modelValue":A[2]||(A[2]=J=>p.value=J),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),[[ee,p.value]])])]),n("div",cc,[n("label",uc,[G(n("input",{"onUpdate:modelValue":A[3]||(A[3]=J=>g.value=J),type:"checkbox",class:"rounded"},null,512),[[io,g.value]]),A[13]||(A[13]=n("span",null,"Replaces orchestrator",-1))])]),n("div",dc,[n("button",{onClick:b,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Create"),n("button",{onClick:A[4]||(A[4]=J=>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"),$.value?(x(),v("span",fc,y($.value),1)):K("",!0)])])):K("",!0),n("div",pc,[A[18]||(A[18]=n("h4",{class:"text-sm font-semibold mb-1"},"Import Skill",-1)),A[19]||(A[19]=n("p",{class:"text-xs text-textSecondary mb-3"},"Register an external skill file by absolute path — read in place, not copied (a git pull on its source updates it).",-1)),n("div",mc,[n("div",xc,[A[15]||(A[15]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Absolute file path",-1)),G(n("input",{"onUpdate:modelValue":A[5]||(A[5]=J=>C.value=J),type:"text",placeholder:"C:/path/to/skill.md",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),[[ee,C.value]])]),n("div",null,[A[17]||(A[17]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Type",-1)),G(n("select",{"onUpdate:modelValue":A[6]||(A[6]=J=>U.value=J),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"},[...A[16]||(A[16]=[n("option",{value:"sensorium"},"Sensorium",-1),n("option",{value:"claude"},"Claude",-1),n("option",{value:"copilot"},"Copilot",-1)])],512),[[ht,U.value]])])]),n("div",vc,[n("button",{onClick:O,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Import"),S.value?(x(),v("span",{key:0,class:Y([S.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(S.value),3)):K("",!0)]),N.value.length?(x(),v("div",gc,[(x(!0),v(ne,null,de(N.value,J=>(x(),v("div",{key:J.path,class:"flex items-center justify-between gap-3 rounded-lg bg-surface/50 border border-gray-700/50 px-3 py-2"},[n("div",hc,[n("span",{class:"type-badge",style:It(oe("user"))},y(J.type),5),n("span",{class:"text-xs font-mono text-textSecondary truncate",title:J.path},y(J.path),9,bc)]),n("button",{onClick:ue=>X(J.path),class:"px-3 py-1 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 shrink-0"},"Remove",8,yc)]))),128))])):K("",!0)]),s.value?(x(),v("div",_c,"Loading...")):t.value.length===0?(x(),v("div",wc,"No skills loaded")):(x(),v("div",kc,[(x(!0),v(ne,null,de(t.value,J=>{var ue;return x(),v("div",{key:J.name,onClick:se=>Z(J),class:Y(["glass rounded-xl p-4 cursor-pointer hover:bg-cardHover transition border",((ue=o.value)==null?void 0:ue.name)===J.name?"border-accent":"border-transparent"])},[n("div",Sc,[n("div",Cc,[n("div",Tc,[n("span",Ec,y(J.name),1),n("span",{class:"type-badge",style:It(oe(le(J.source)))},y(le(J.source)),5),J.replacesOrchestrator?(x(),v("span",Pc,"REPLACES ORCH")):K("",!0)]),n("div",Ac,[(x(!0),v(ne,null,de(J.triggers||[],se=>(x(),v("span",{key:se,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},y(se),1))),128))])]),n("div",{class:"text-xs text-muted font-mono shrink-0 max-w-[200px] truncate",title:J.source||""},y((J.source||"").split(/[\\/]/).pop()||""),9,Ic)])],10,$c)}),128))]))]),o.value?(x(),v("div",Oc,[n("div",Mc,[n("div",null,[n("h3",Dc,"Edit: "+y(o.value.name),1),n("p",Rc,y(o.value.source||"(unknown source)"),1)]),n("div",jc,[c.value?(x(),v("span",Lc,y(c.value),1)):K("",!0),d.value?(x(),v("span",Uc,y(d.value),1)):K("",!0),le(o.value.source)==="user"?(x(),v("button",{key:2,onClick:w,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")):K("",!0),n("button",{onClick:E,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"),n("button",{onClick:V,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),n("div",Nc,[n("div",null,[A[20]||(A[20]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),n("input",{value:o.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,Vc)]),n("div",null,[A[21]||(A[21]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),G(n("input",{"onUpdate:modelValue":A[7]||(A[7]=J=>a.value=J),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),[[ee,a.value]])]),n("div",Bc,[n("label",Fc,[G(n("input",{"onUpdate:modelValue":A[8]||(A[8]=J=>l.value=J),type:"checkbox",class:"rounded"},null,512),[[io,l.value]]),A[22]||(A[22]=n("span",null,"Replaces orchestrator",-1))])])]),G(n("textarea",{"onUpdate:modelValue":A[9]||(A[9]=J=>r.value=J),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),[[ee,r.value]])])):K("",!0)]))}}),Kc={class:"animate-fade-in space-y-6"},Wc={class:"glass rounded-xl p-6"},zc={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},Jc={class:"flex items-center gap-3"},qc={key:0,class:"mt-4 p-4 rounded-xl bg-surface border border-gray-700/50 space-y-3"},Yc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3"},Gc=["value"],Zc={class:"flex justify-end"},Qc=["disabled"],Xc={key:0,class:"text-center py-12 text-textSecondary"},eu={key:1,class:"text-center py-8 text-danger text-sm"},tu={key:2,class:"text-center py-12 text-textSecondary"},su={key:3},nu={class:"space-y-3"},ou={class:"p-4"},ru={class:"flex flex-wrap items-center gap-3"},au=["onBlur"],lu=["onDblclick"],iu={class:"text-xs text-muted font-mono"},cu=["value","onChange"],uu=["value"],du=["value"],fu={class:"text-xs text-muted"},pu=["onKeyup","onBlur"],mu=["title","onDblclick"],xu={class:"ml-auto flex items-center gap-3"},vu=["onClick","disabled"],gu={class:"flex items-center gap-1.5"},hu=["onClick"],bu={class:"flex items-center gap-1.5"},yu=["onClick"],_u={class:"flex items-center gap-1.5"},wu=["onClick"],ku=["onClick"],$u=["onClick"],Su=["onClick"],Cu={key:0,class:"mt-3 p-3 rounded-lg bg-surface border border-purple-500/20 space-y-2"},Tu={class:"grid grid-cols-1 sm:grid-cols-3 gap-2"},Eu=["value"],Pu={class:"flex items-center gap-2"},Au=["onClick","disabled"],Iu={key:0,class:"border-t border-gray-700/30 bg-surface/30 px-4 py-3 space-y-2"},Ou={key:0,class:"text-xs text-muted py-1"},Mu={class:"text-sm font-medium"},Du={class:"text-xs text-muted font-mono"},Ru=["value","onChange"],ju=["value"],Lu=["value"],Uu={class:"text-xs text-muted"},Nu=["onBlur","onKeyup"],Vu=["title","onDblclick"],Bu={class:"ml-auto flex items-center gap-3"},Fu=["onClick","disabled"],Hu=["onClick","disabled"],Ku=["onClick","disabled"],Wu={key:2,class:"flex items-center gap-1.5"},zu=["onClick"],Ju={key:3,class:"flex items-center gap-1.5"},qu=["onClick"],Yu={key:4,class:"flex items-center gap-1.5"},Gu=["onClick"],Zu=["onClick"],Qu={key:4},Xu={class:"space-y-2"},ed={class:"font-medium"},td={class:"text-xs text-muted font-mono"},sd={class:"text-xs text-textSecondary"},nd={class:"text-xs text-muted"},od={class:"ml-auto flex items-center gap-2"},rd=["onClick","disabled"],ad=["onClick","disabled"],ld=["onClick"],id={key:5},cd={class:"space-y-2"},ud={class:"font-medium"},dd={class:"text-xs text-muted font-mono"},fd=["value","onChange"],pd=["value"],md=["value"],xd={class:"text-xs text-muted"},vd=["onBlur","onKeyup"],gd=["title","onDblclick"],hd={class:"ml-auto flex items-center gap-3"},bd=["onClick","disabled"],yd=["onClick","disabled"],_d={class:"flex items-center gap-1.5"},wd=["onClick"],kd={class:"flex items-center gap-1.5"},$d=["onClick"],Sd={class:"flex items-center gap-1.5"},Cd=["onClick"],Td=["onClick"],Ed={key:6},Pd={class:"space-y-2"},Ad={class:"font-medium"},Id={class:"text-xs text-muted font-mono"},Od=["value","onChange"],Md=["value"],Dd=["value"],Rd={class:"text-xs text-muted"},jd=Ne({__name:"ThreadsTab",setup(e){const t=_([]),s=_(!0),o=_(""),r=_({}),a=_(new Set),l=_(!1),c=_({name:"",threadId:0,client:"claude",workingDirectory:""}),d=_(""),h=_(!1),f=_(null),p=_(""),g=_(null),$=_(""),N=_(null),C=_({name:"",threadId:0,client:"claude",workingDirectory:""}),U=_(""),S=_(!1),P=_(null),L=_(null),O=_(null),X=["claude","copilot","codex","fable"];function le(W){return X.includes(W)}const oe={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"}},Z=Ee(()=>t.value.filter(W=>W.type==="root")),E=Ee(()=>t.value.filter(W=>W.type==="daily")),F=Ee(()=>t.value.filter(W=>W.type==="branch")),V=Ee(()=>t.value.filter(W=>W.type==="worker"));async function w(){s.value=!0,o.value="";try{const W=await ve("/api/threads");t.value=W.threads??[]}catch(W){o.value=W.message||"Failed to load threads"}finally{s.value=!1}}async function b(W){try{const i=await ve(`/api/threads/${W}/children`);r.value[W]=i.threads??[]}catch{r.value[W]=[]}}function T(W){a.value.has(W)?a.value.delete(W):(a.value.add(W),b(W))}async function A(){if(!(!c.value.name.trim()||!c.value.threadId)){h.value=!0,d.value="";try{const W=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"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(!W.ok){const i=await W.json().catch(()=>({error:W.statusText}));throw new Error(i.error??W.statusText)}d.value="Created ✓",c.value={name:"",threadId:0,client:"claude",workingDirectory:""},l.value=!1,setTimeout(()=>{d.value=""},3e3),await w()}catch(W){d.value="Error: "+W.message}finally{h.value=!1}}}async function J(W){if(!(!C.value.name.trim()||!C.value.threadId)){S.value=!0,U.value="";try{const i=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:C.value.threadId,name:C.value.name.trim(),type:"branch",rootThreadId:W,client:C.value.client,...C.value.workingDirectory.trim()?{workingDirectory:C.value.workingDirectory.trim()}:{}})});if(!i.ok){const u=await i.json().catch(()=>({error:i.statusText}));throw new Error(u.error??i.statusText)}U.value="Branch created ✓",C.value={name:"",threadId:0,client:"claude",workingDirectory:""},N.value=null,setTimeout(()=>{U.value=""},3e3),await w(),b(W)}catch(i){U.value="Error: "+i.message}finally{S.value=!1}}}function ue(W){f.value=W.threadId,p.value=W.name}async function se(W){const i=p.value.trim();if(f.value=null,!!i)try{const u=await fetch(`/api/threads/${W}`,{method:"PATCH",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({name:i})});if(!u.ok)throw new Error(u.statusText);await w()}catch(u){o.value="Failed to rename thread: "+u.message}}function H(W){g.value=W.threadId,$.value=W.workingDirectory??""}async function j(W){const i=$.value.trim();g.value=null;try{const u=await fetch(`/api/threads/${W}`,{method:"PATCH",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({workingDirectory:i||null})});if(!u.ok)throw new Error(u.statusText);await w()}catch(u){o.value="Failed to update working directory: "+u.message}}async function $e(W){try{const i=await fetch(`/api/threads/${W.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({keepAlive:!W.keepAlive})});if(!i.ok)throw new Error(i.statusText);await w()}catch(i){o.value="Failed to toggle keep-alive: "+i.message}}async function ke(W,i){try{const u=await fetch(`/api/threads/${W.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({client:i})});if(!u.ok)throw new Error(u.statusText);await w()}catch(u){o.value="Failed to change agent type: "+u.message}}async function ge(W){try{const i=await fetch(`/api/threads/${W.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({dailyRotation:!W.dailyRotation})});if(!i.ok)throw new Error(i.statusText);await w()}catch(i){o.value="Failed to toggle daily rotation: "+i.message}}async function lt(W){try{const i=await fetch(`/api/threads/${W.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({autonomousMode:!W.autonomousMode})});if(!i.ok)throw new Error(i.statusText);await w()}catch(i){o.value="Failed to toggle autonomous mode: "+i.message}}async function Ot(W){if(confirm(`Archive thread "${W.name}" (${W.threadId})?`))try{const i=await fetch(`/api/threads/${W.threadId}`,{method:"DELETE",headers:{Authorization:`Bearer ${fe()}`}});if(!i.ok)throw new Error(i.statusText);await w()}catch(i){o.value="Failed to archive: "+i.message}}async function Je(W){if(confirm(`Start thread "${W.name}" (${W.threadId})?`)){P.value=W.threadId;try{const i=await fetch(`/api/threads/${W.threadId}/start`,{method:"POST",headers:{Authorization:`Bearer ${fe()}`}});if(!i.ok){const u=await i.json().catch(()=>({error:i.statusText}));throw new Error(u.error??i.statusText)}await w()}catch(i){o.value="Failed to start thread: "+i.message}finally{P.value=null}}}function yt(W){d.value="Sync to Root — not yet implemented",setTimeout(()=>{d.value=""},3e3)}async function Kt(W){if(confirm(`Convert "${W.name}" to a root thread? This will detach it from its parent.`)){O.value=W.threadId;try{const i=await fetch(`/api/threads/${W.threadId}/convert-to-root`,{method:"POST",headers:{Authorization:`Bearer ${fe()}`}});if(!i.ok){const u=await i.json().catch(()=>({error:i.statusText}));throw new Error(u.error??i.statusText)}o.value="",d.value=`Converted "${W.name}" to root ✓`,setTimeout(()=>{d.value=""},3e3),await w()}catch(i){o.value="Failed to convert: "+i.message}finally{O.value=null}}}function _t(W){if(!W)return"—";const i=new Date(W),k=Date.now()-i.getTime();return k<6e4?"just now":k<36e5?`${Math.floor(k/6e4)}m ago`:k<864e5?`${Math.floor(k/36e5)}h ago`:i.toLocaleDateString()}function Ke(W){return W==="active"?"text-success":W==="archived"?"text-muted":"text-warn"}return je(w),(W,i)=>(x(),v("div",Kc,[n("div",Wc,[n("div",zc,[i[18]||(i[18]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Thread Registry"),n("p",{class:"text-sm text-textSecondary mt-1"},"Manage conversation threads, branches, and daily sessions")],-1)),n("div",Jc,[d.value?(x(),v("span",{key:0,class:Y([d.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(d.value),3)):K("",!0),n("button",{onClick:i[0]||(i[0]=u=>l.value=!l.value),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},y(l.value?"Cancel":"+ New Root Thread"),1),n("button",{onClick:w,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),l.value?(x(),v("div",qc,[n("div",Yc,[n("div",null,[i[19]||(i[19]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Name",-1)),G(n("input",{"onUpdate:modelValue":i[1]||(i[1]=u=>c.value.name=u),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),[[ee,c.value.name]])]),n("div",null,[i[20]||(i[20]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Thread ID",-1)),G(n("input",{"onUpdate:modelValue":i[2]||(i[2]=u=>c.value.threadId=u),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),[[ee,c.value.threadId,void 0,{number:!0}]])]),n("div",null,[i[21]||(i[21]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Client",-1)),G(n("select",{"onUpdate:modelValue":i[3]||(i[3]=u=>c.value.client=u),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"},[(x(),v(ne,null,de(X,u=>n("option",{key:u,value:u},y(u),9,Gc)),64))],512),[[ht,c.value.client]])])]),n("div",null,[i[22]||(i[22]=n("label",{class:"block text-xs text-textSecondary mb-1"},"Working Directory (optional)",-1)),G(n("input",{"onUpdate:modelValue":i[4]||(i[4]=u=>c.value.workingDirectory=u),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),[[ee,c.value.workingDirectory]])]),n("div",Zc,[n("button",{onClick:A,disabled:h.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"},y(h.value?"Creating…":"Create Root Thread"),9,Qc)])])):K("",!0)]),s.value&&t.value.length===0?(x(),v("div",Xc,"Loading threads…")):o.value?(x(),v("div",eu,y(o.value),1)):t.value.length===0?(x(),v("div",tu,"No threads registered")):K("",!0),Z.value.length>0?(x(),v("div",su,[i[29]||(i[29]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟢 Root Threads",-1)),n("div",nu,[(x(!0),v(ne,null,de(Z.value,u=>{var k,I;return x(),v("div",{key:u.id,class:"glass rounded-xl overflow-hidden"},[n("div",ou,[n("div",ru,[n("span",{class:Y(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(k=oe[u.type])==null?void 0:k.classes])},y((I=oe[u.type])==null?void 0:I.emoji)+" "+y(u.type.toUpperCase()),3),f.value===u.threadId?G((x(),v("input",{key:0,"onUpdate:modelValue":i[5]||(i[5]=m=>p.value=m),onBlur:m=>se(u.threadId),onKeyup:[i[6]||(i[6]=Xe(m=>m.target.blur(),["enter"])),i[7]||(i[7]=Xe(m=>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,au)),[[ee,p.value]]):(x(),v("span",{key:1,class:"font-semibold cursor-pointer hover:text-accent transition",onDblclick:m=>ue(u),title:"Double-click to rename"},y(u.name),41,lu)),n("span",{class:Y(["text-xs font-medium",Ke(u.status)])},y(u.status),3),n("span",iu,"ID: "+y(u.threadId),1),n("select",{value:u.client,onChange:m=>ke(u,m.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"},[le(u.client)?K("",!0):(x(),v("option",{key:0,value:u.client,disabled:""},y(u.client)+" (legacy)",9,uu)),(x(),v(ne,null,de(X,m=>n("option",{key:m,value:m},y(m),9,du)),64))],40,cu),n("span",fu,y(_t(u.lastActiveAt)),1),g.value===u.threadId?G((x(),v("input",{key:2,"onUpdate:modelValue":i[8]||(i[8]=m=>$.value=m),onKeyup:[Xe(m=>j(u.threadId),["enter"]),i[9]||(i[9]=Xe(m=>g.value=null,["escape"]))],onBlur:m=>j(u.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,pu)),[[ee,$.value]]):(x(),v("span",{key:3,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(u.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:m=>H(u)},"📁 "+y(u.workingDirectory??"—"),41,mu)),n("div",xu,[n("button",{onClick:m=>Je(u),disabled:P.value===u.threadId||u.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"},y(P.value===u.threadId?"Starting…":"▶ Start"),9,vu),n("div",gu,[n("button",{onClick:m=>$e(u),class:Y(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[n("span",{class:Y(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,hu),i[23]||(i[23]=n("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),n("div",bu,[n("button",{onClick:m=>ge(u),class:Y(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[n("span",{class:Y(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,yu),i[24]||(i[24]=n("span",{class:"text-xs text-muted"},"Daily",-1))]),n("div",_u,[n("button",{onClick:m=>lt(u),class:Y(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[n("span",{class:Y(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,wu),i[25]||(i[25]=n("span",{class:"text-xs text-muted"},"Auto",-1))]),n("button",{onClick:m=>T(u.threadId),class:"px-2 py-1 rounded-lg text-xs bg-card border border-gray-700 hover:bg-surface transition"},y(a.value.has(u.threadId)?"▾ Children":"▸ Children"),9,ku),n("button",{onClick:m=>{N.value=N.value===u.threadId?null:u.threadId,C.value={name:"",threadId:0,client:"claude",workingDirectory:""},U.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,$u),n("button",{onClick:m=>Ot(u),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,Su)])]),N.value===u.threadId?(x(),v("div",Cu,[n("div",Tu,[G(n("input",{"onUpdate:modelValue":i[10]||(i[10]=m=>C.value.name=m),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),[[ee,C.value.name]]),G(n("input",{"onUpdate:modelValue":i[11]||(i[11]=m=>C.value.threadId=m),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),[[ee,C.value.threadId,void 0,{number:!0}]]),G(n("select",{"onUpdate:modelValue":i[12]||(i[12]=m=>C.value.client=m),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"},[(x(),v(ne,null,de(X,m=>n("option",{key:m,value:m},y(m),9,Eu)),64))],512),[[ht,C.value.client]])]),G(n("input",{"onUpdate:modelValue":i[13]||(i[13]=m=>C.value.workingDirectory=m),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),[[ee,C.value.workingDirectory]]),n("div",Pu,[n("button",{onClick:m=>J(u.threadId),disabled:S.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"},y(S.value?"Creating…":"Create Branch"),9,Au),U.value?(x(),v("span",{key:0,class:Y([U.value.startsWith("Error")?"text-danger":"text-success","text-xs"])},y(U.value),3)):K("",!0)])])):K("",!0)]),a.value.has(u.threadId)&&r.value[u.threadId]?(x(),v("div",Iu,[r.value[u.threadId].length===0?(x(),v("div",Ou,"No children")):K("",!0),(x(!0),v(ne,null,de(r.value[u.threadId],m=>{var M,z;return x(),v("div",{key:m.id,class:"flex flex-wrap items-center gap-2 px-3 py-2 rounded-lg bg-card/50 border border-gray-700/30"},[n("span",{class:Y(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-xs font-medium border",(M=oe[m.type])==null?void 0:M.classes])},y((z=oe[m.type])==null?void 0:z.emoji)+" "+y(m.type.toUpperCase()),3),n("span",Mu,y(m.name),1),n("span",{class:Y(["text-xs",Ke(m.status)])},y(m.status),3),n("span",Du,"ID: "+y(m.threadId),1),n("select",{value:m.client,onChange:R=>ke(m,R.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"},[le(m.client)?K("",!0):(x(),v("option",{key:0,value:m.client,disabled:""},y(m.client)+" (legacy)",9,ju)),(x(),v(ne,null,de(X,R=>n("option",{key:R,value:R},y(R),9,Lu)),64))],40,Ru),n("span",Uu,y(_t(m.lastActiveAt)),1),m.type==="branch"&&g.value===m.threadId?G((x(),v("input",{key:0,"onUpdate:modelValue":i[14]||(i[14]=R=>$.value=R),onBlur:R=>j(m.threadId),onKeyup:[Xe(R=>j(m.threadId),["enter"]),i[15]||(i[15]=Xe(R=>g.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,Nu)),[[ee,$.value]]):m.type==="branch"?(x(),v("span",{key:1,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:R=>H(m)},"📁 "+y(m.workingDirectory??"—"),41,Vu)):K("",!0),n("div",Bu,[n("button",{onClick:R=>Je(m),disabled:P.value===m.threadId||m.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"},y(P.value===m.threadId?"Starting…":"▶ Start"),9,Fu),m.rootThreadId?(x(),v("button",{key:0,onClick:R=>yt(),disabled:L.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"},y(L.value===m.threadId?"Syncing…":"⟳ Sync to Root"),9,Hu)):K("",!0),m.type==="branch"||m.type==="daily"?(x(),v("button",{key:1,onClick:R=>Kt(m),disabled:O.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:"Convert to independent root thread"},y(O.value===m.threadId?"Converting…":"↑ To Root"),9,Ku)):K("",!0),m.type==="branch"?(x(),v("div",Wu,[n("button",{onClick:R=>$e(m),class:Y(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",m.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[n("span",{class:Y(["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,zu),i[26]||(i[26]=n("span",{class:"text-xs text-muted"},"Keep-alive",-1))])):K("",!0),m.type==="branch"?(x(),v("div",Ju,[n("button",{onClick:R=>ge(m),class:Y(["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"},[n("span",{class:Y(["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,qu),i[27]||(i[27]=n("span",{class:"text-xs text-muted"},"Daily",-1))])):K("",!0),m.type==="branch"?(x(),v("div",Yu,[n("button",{onClick:R=>lt(m),class:Y(["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"},[n("span",{class:Y(["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,Gu),i[28]||(i[28]=n("span",{class:"text-xs text-muted"},"Auto",-1))])):K("",!0),m.type!=="root"?(x(),v("button",{key:5,onClick:R=>Ot(m),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,Zu)):K("",!0)])])}),128))])):K("",!0)])}),128))])])):K("",!0),E.value.length>0?(x(),v("div",Qu,[i[30]||(i[30]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🔵 Daily Sessions",-1)),n("div",Xu,[(x(!0),v(ne,null,de(E.value,u=>{var k,I;return x(),v("div",{key:u.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[n("span",{class:Y(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(k=oe[u.type])==null?void 0:k.classes])},y((I=oe[u.type])==null?void 0:I.emoji)+" "+y(u.type.toUpperCase()),3),n("span",ed,y(u.name),1),n("span",{class:Y(["text-xs font-medium",Ke(u.status)])},y(u.status),3),n("span",td,"ID: "+y(u.threadId),1),n("span",sd,y(u.client),1),n("span",nd,y(_t(u.lastActiveAt)),1),n("div",od,[n("button",{onClick:m=>Je(u),disabled:P.value===u.threadId||u.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"},y(P.value===u.threadId?"Starting…":"▶ Start"),9,rd),u.rootThreadId?(x(),v("button",{key:0,onClick:m=>yt(),disabled:L.value===u.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"},y(L.value===u.threadId?"Syncing…":"⟳ Sync to Root"),9,ad)):K("",!0),n("button",{onClick:m=>Ot(u),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,ld)])])}),128))])])):K("",!0),F.value.length>0?(x(),v("div",id,[i[34]||(i[34]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟣 Branches",-1)),n("div",cd,[(x(!0),v(ne,null,de(F.value,u=>{var k,I;return x(),v("div",{key:u.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[n("span",{class:Y(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(k=oe[u.type])==null?void 0:k.classes])},y((I=oe[u.type])==null?void 0:I.emoji)+" "+y(u.type.toUpperCase()),3),n("span",ud,y(u.name),1),n("span",{class:Y(["text-xs font-medium",Ke(u.status)])},y(u.status),3),n("span",dd,"ID: "+y(u.threadId),1),n("select",{value:u.client,onChange:m=>ke(u,m.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"},[le(u.client)?K("",!0):(x(),v("option",{key:0,value:u.client,disabled:""},y(u.client)+" (legacy)",9,pd)),(x(),v(ne,null,de(X,m=>n("option",{key:m,value:m},y(m),9,md)),64))],40,fd),n("span",xd,y(_t(u.lastActiveAt)),1),g.value===u.threadId?G((x(),v("input",{key:0,"onUpdate:modelValue":i[16]||(i[16]=m=>$.value=m),onBlur:m=>j(u.threadId),onKeyup:[Xe(m=>j(u.threadId),["enter"]),i[17]||(i[17]=Xe(m=>g.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,vd)),[[ee,$.value]]):(x(),v("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(u.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:m=>H(u)},"📁 "+y(u.workingDirectory??"—"),41,gd)),n("div",hd,[n("button",{onClick:m=>Je(u),disabled:P.value===u.threadId||u.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"},y(P.value===u.threadId?"Starting…":"▶ Start"),9,bd),u.rootThreadId?(x(),v("button",{key:0,onClick:m=>yt(),disabled:L.value===u.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"},y(L.value===u.threadId?"Syncing…":"⟳ Sync to Root"),9,yd)):K("",!0),n("div",_d,[n("button",{onClick:m=>$e(u),class:Y(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[n("span",{class:Y(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,wd),i[31]||(i[31]=n("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),n("div",kd,[n("button",{onClick:m=>ge(u),class:Y(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[n("span",{class:Y(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,$d),i[32]||(i[32]=n("span",{class:"text-xs text-muted"},"Daily",-1))]),n("div",Sd,[n("button",{onClick:m=>lt(u),class:Y(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",u.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[n("span",{class:Y(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",u.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,Cd),i[33]||(i[33]=n("span",{class:"text-xs text-muted"},"Auto",-1))]),n("button",{onClick:m=>Ot(u),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,Td)])])}),128))])])):K("",!0),V.value.length>0?(x(),v("div",Ed,[i[36]||(i[36]=n("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟡 Workers",-1)),n("div",Pd,[(x(!0),v(ne,null,de(V.value,u=>{var k,I;return x(),v("div",{key:u.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[n("span",{class:Y(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(k=oe[u.type])==null?void 0:k.classes])},y((I=oe[u.type])==null?void 0:I.emoji)+" "+y(u.type.toUpperCase()),3),n("span",Ad,y(u.name),1),n("span",{class:Y(["text-xs font-medium",Ke(u.status)])},y(u.status),3),n("span",Id,"ID: "+y(u.threadId),1),n("select",{value:u.client,onChange:m=>ke(u,m.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"},[le(u.client)?K("",!0):(x(),v("option",{key:0,value:u.client,disabled:""},y(u.client)+" (legacy)",9,Md)),(x(),v(ne,null,de(X,m=>n("option",{key:m,value:m},y(m),9,Dd)),64))],40,Od),n("span",Rd,y(_t(u.lastActiveAt)),1),i[35]||(i[35]=n("span",{class:"ml-auto text-xs text-muted italic"},"auto-managed",-1))])}),128))])])):K("",!0)]))}}),Ld={class:"animate-fade-in"},Ud={class:"glass rounded-xl p-6 mb-6"},Nd={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Vd={class:"flex items-center gap-3"},Bd={key:0,class:"text-center py-8 text-textSecondary text-sm"},Fd={key:1,class:"text-center py-8 text-danger text-sm"},Hd={key:2,class:"text-center text-textSecondary py-12"},Kd={key:3,class:"space-y-2"},Wd={class:"flex items-center justify-between gap-3"},zd={class:"flex-1 min-w-0"},Jd={class:"flex items-center gap-2 mb-1"},qd={class:"font-medium text-sm"},Yd={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},Gd={key:0,class:"type-badge",style:{background:"rgba(34,197,94,0.15)",color:"#4ade80"}},Zd={class:"text-xs text-muted font-mono truncate"},Qd={class:"flex items-center gap-2 shrink-0"},Xd=["onClick","disabled"],ef=["onClick"],tf=["onClick","disabled"],sf={key:0,class:"glass rounded-xl p-6 border border-accent/30"},nf={class:"text-lg font-semibold mb-4"},of={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},rf=["value"],af={class:"mb-4"},lf={class:"mb-4"},cf={class:"mb-4"},uf={class:"flex items-center gap-3 flex-wrap"},df=["disabled"],ff={key:0,class:"text-sm text-danger"},pf=Ne({__name:"AgentsTab",setup(e){const t=["claude","copilot","codex","openai_codex","fable"],s=_([]),o=_(!0),r=_(""),a=_(""),l=_(!0),c=_(!1),d=_(null),h=_(null),f=_(!1),p=_(null),g=_(""),$=_("claude"),N=_(""),C=_(""),U=_(""),S=_("");async function P(){o.value=!0,r.value="";try{const V=await ve("/api/agent-templates");s.value=V.templates||[]}catch(V){r.value="Failed to load templates: "+V.message}finally{o.value=!1}}function L(){p.value=null,g.value="",$.value="claude",N.value="",C.value="",U.value="",S.value="",f.value=!0}function O(V){p.value=V.id,g.value=V.name,$.value=V.client,N.value=V.workingDirectory,C.value=V.systemPrompt||"",U.value=V.mcpServers&&Object.keys(V.mcpServers).length?JSON.stringify(V.mcpServers,null,2):"",S.value="",f.value=!0}function X(){f.value=!1,p.value=null}function le(){S.value="";const V=g.value.trim(),w=N.value.trim();if(!V)return S.value="Name is required",null;if(!w)return S.value="Working directory is required",null;let b={};const T=U.value.trim();if(T){try{b=JSON.parse(T)}catch{return S.value="MCP servers must be valid JSON",null}if(typeof b!="object"||b===null||Array.isArray(b))return S.value="MCP servers must be a JSON object",null}return{name:V,client:$.value,workingDirectory:w,systemPrompt:C.value.trim()||null,mcpServers:b}}async function oe(){if(c.value)return;const V=le();if(V){c.value=!0;try{const w=p.value?`/api/agent-templates/${p.value}`:"/api/agent-templates",b=p.value?"PATCH":"POST",T=await fetch(w,{method:b,headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify(V)});if(!T.ok){const A=await T.json().catch(()=>({}));throw new Error(A.error||T.statusText)}F("Saved ✓",!0),X(),await P()}catch(w){S.value="Error: "+w.message}finally{c.value=!1}}}async function Z(V){if(!d.value){d.value=V.id;try{const w=await fetch(`/api/agent-templates/${V.id}/start`,{method:"POST",headers:{Authorization:`Bearer ${fe()}`}});if(!w.ok){const T=await w.json().catch(()=>({}));throw new Error(T.error||w.statusText)}const b=await w.json();F(`Started thread ${b.threadId} ✓`,!0)}catch(w){F("Error: "+w.message,!1)}finally{d.value=null}}}async function E(V){if(confirm(`Delete template "${V.name}"?`)&&!h.value){h.value=V.id;try{const w=await fetch(`/api/agent-templates/${V.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${fe()}`}});if(!w.ok)throw new Error(w.statusText);F("Deleted ✓",!0),await P()}catch(w){F("Error: "+w.message,!1)}finally{h.value=null}}}function F(V,w){a.value=V,l.value=w,setTimeout(()=>{a.value=""},3e3)}return je(P),(V,w)=>(x(),v("div",Ld,[n("div",Ud,[n("div",Nd,[w[5]||(w[5]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Agent Templates"),n("p",{class:"text-sm text-textSecondary mt-1"},"Reusable spawn presets. Starting one stamps out a fresh root thread.")],-1)),n("div",Vd,[a.value?(x(),v("span",{key:0,class:Y(["text-sm",l.value?"text-success":"text-danger"])},y(a.value),3)):K("",!0),n("button",{onClick:L,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + New Template ")])]),o.value?(x(),v("div",Bd,"Loading...")):r.value?(x(),v("div",Fd,y(r.value),1)):s.value.length===0?(x(),v("div",Hd,"No agent templates yet")):(x(),v("div",Kd,[(x(!0),v(ne,null,de(s.value,b=>(x(),v("div",{key:b.id,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[n("div",Wd,[n("div",zd,[n("div",Jd,[n("span",qd,y(b.name),1),n("span",Yd,y(b.client),1),b.mcpServers&&Object.keys(b.mcpServers).length?(x(),v("span",Gd,y(Object.keys(b.mcpServers).length)+" mcp",1)):K("",!0)]),n("div",Zd,y(b.workingDirectory),1)]),n("div",Qd,[n("button",{onClick:T=>Z(b),disabled:d.value===b.id,class:"px-3 py-1.5 rounded-lg bg-accent hover:bg-accentLight text-xs text-white font-medium transition disabled:opacity-50"},y(d.value===b.id?"Starting…":"Start"),9,Xd),n("button",{onClick:T=>O(b),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,ef),n("button",{onClick:T=>E(b),disabled:h.value===b.id,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"},y(h.value===b.id?"…":"Delete"),9,tf)])])]))),128))]))]),f.value?(x(),v("div",sf,[n("h3",nf,y(p.value?`Edit: ${g.value}`:"New Agent Template"),1),n("div",of,[n("div",null,[w[6]||(w[6]=n("label",{class:"text-xs text-textSecondary block mb-1"},[Q("Name "),n("span",{class:"text-danger"},"*")],-1)),G(n("input",{"onUpdate:modelValue":w[0]||(w[0]=b=>g.value=b),type:"text",placeholder:"YouTube Researcher",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),[[ee,g.value]])]),n("div",null,[w[7]||(w[7]=n("label",{class:"text-xs text-textSecondary block mb-1"},[Q("Client "),n("span",{class:"text-danger"},"*")],-1)),G(n("select",{"onUpdate:modelValue":w[1]||(w[1]=b=>$.value=b),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"},[(x(),v(ne,null,de(t,b=>n("option",{key:b,value:b},y(b),9,rf)),64))],512),[[ht,$.value]])])]),n("div",af,[w[8]||(w[8]=n("label",{class:"text-xs text-textSecondary block mb-1"},[Q("Working Directory "),n("span",{class:"text-danger"},"*")],-1)),G(n("input",{"onUpdate:modelValue":w[2]||(w[2]=b=>N.value=b),type:"text",placeholder:"C:\\src\\my-project",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),[[ee,N.value]])]),n("div",lf,[w[9]||(w[9]=n("label",{class:"text-xs text-textSecondary block mb-1"},"System Prompt",-1)),G(n("textarea",{"onUpdate:modelValue":w[3]||(w[3]=b=>C.value=b),rows:"4",placeholder:"Optional identity prompt for the spawned thread",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 resize-y"},null,512),[[ee,C.value]])]),n("div",cf,[w[10]||(w[10]=n("label",{class:"text-xs text-textSecondary block mb-1"},"MCP Servers (JSON)",-1)),G(n("textarea",{"onUpdate:modelValue":w[4]||(w[4]=b=>U.value=b),rows:"6",placeholder:'{ "my-server": { "type": "http", "url": "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 resize-y"},null,512),[[ee,U.value]]),w[11]||(w[11]=n("p",{class:"text-xs text-muted mt-1"},"Per-thread HTTP MCP servers. Leave empty for none.",-1))]),n("div",uf,[n("button",{onClick:oe,disabled:c.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},y(c.value?"Saving…":p.value?"Save Changes":"Create Template"),9,df),n("button",{onClick:X,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 "),S.value?(x(),v("span",ff,y(S.value),1)):K("",!0)])])):K("",!0)]))}}),mf={class:"animate-fade-in"},xf={class:"glass rounded-xl p-6 mb-6"},vf={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},gf={class:"flex items-center gap-3"},hf={key:0,class:"text-center py-8 text-textSecondary text-sm"},bf={key:1,class:"text-center py-8 text-danger text-sm"},yf={key:2,class:"text-center text-textSecondary py-12"},_f={key:3,class:"space-y-2"},wf={key:0,class:"glass rounded-xl p-4 border border-gray-700/50 opacity-75"},kf={class:"flex items-center justify-between gap-3"},$f={class:"flex items-center gap-2 min-w-0"},Sf={class:"flex items-center justify-between gap-3"},Cf={class:"flex-1 min-w-0"},Tf={class:"flex items-center gap-2 mb-1"},Ef={class:"font-medium text-sm font-mono"},Pf={class:"text-xs text-muted font-mono truncate"},Af={class:"flex items-center gap-2 shrink-0"},If=["onClick"],Of=["onClick","disabled"],Mf={key:0,class:"glass rounded-xl p-6 border border-accent/30"},Df={class:"text-lg font-semibold mb-4"},Rf={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},jf=["readonly"],Lf={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Uf={class:"mb-4"},Nf={class:"flex items-center justify-between mb-2"},Vf=["onUpdate:modelValue"],Bf=["onUpdate:modelValue"],Ff=["onClick"],Hf={key:0,class:"text-xs text-muted italic"},Kf={class:"mb-4"},Wf={class:"mb-4"},zf={class:"flex items-center justify-between mb-2"},Jf=["onUpdate:modelValue"],qf=["onUpdate:modelValue"],Yf=["onClick"],Gf={key:0,class:"text-xs text-muted italic"},Zf={class:"flex items-center gap-3 flex-wrap"},Qf=["disabled"],Xf={key:0,class:"text-sm text-danger"},Yt="sensorium-mcp",ep=Ne({__name:"McpServersTab",setup(e){const t=_({}),s=_(!0),o=_(""),r=_(""),a=_(!0),l=_(!1),c=_(null),d=_(!1),h=_(null),f=_(""),p=_("stdio"),g=_(""),$=_(""),N=_(""),C=_([]),U=_([]),S=_(""),P=Ee(()=>Object.entries(t.value).filter(([V])=>V!==Yt));async function L(){s.value=!0,o.value="";try{const V=await ve("/api/mcp-servers");t.value=V.servers||{}}catch(V){o.value="Failed to load MCP servers: "+V.message}finally{s.value=!1}}function O(V){return V==="stdio"?"background:rgba(99,102,241,0.15);color:#818cf8":"background:rgba(34,197,94,0.15);color:#4ade80"}function X(){h.value=null,f.value="",p.value="stdio",g.value="",$.value="",N.value="",C.value=[],U.value=[],S.value="",d.value=!0}function le(V,w){h.value=V,f.value=V,p.value=w.type,g.value=w.command||"",$.value=(w.args||[]).join(" "),N.value=w.url||"",C.value=Object.entries(w.env||{}).map(([b,T])=>({k:b,v:T})),U.value=Object.entries(w.headers||{}).map(([b,T])=>({k:b,v:T})),S.value="",d.value=!0}function oe(){d.value=!1,h.value=null}function Z(){if(S.value="",!f.value.trim())return S.value="Name is required",!1;if(p.value==="stdio"&&!g.value.trim())return S.value="Command is required for stdio type",!1;if(p.value==="http"){const V=N.value.trim();if(!V)return S.value="URL is required for http type",!1;if(!/^https?:\/\/.+/.test(V))return S.value="URL must start with http:// or https://",!1}return!0}async function E(){if(!Z()||l.value)return;l.value=!0;const V=f.value.trim(),w={type:p.value};if(p.value==="stdio"){w.command=g.value.trim();const b=$.value.trim();b&&(w.args=b.split(/\s+/));const T=Object.fromEntries(C.value.filter(A=>A.k.trim()).map(A=>[A.k.trim(),A.v]));Object.keys(T).length&&(w.env=T)}else{w.url=N.value.trim();const b=Object.fromEntries(U.value.filter(T=>T.k.trim()).map(T=>[T.k.trim(),T.v]));Object.keys(b).length&&(w.headers=b)}try{const b=await fetch("/api/mcp-servers",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({name:V,config:w})});if(!b.ok)throw new Error(b.statusText);r.value="Saved ✓",a.value=!0,setTimeout(()=>{r.value=""},3e3),oe(),await L()}catch(b){S.value="Error: "+b.message}finally{l.value=!1}}async function F(V){if(confirm(`Delete MCP server "${V}"?`)&&!c.value){c.value=V;try{const w=await fetch(`/api/mcp-servers/${encodeURIComponent(V)}`,{method:"DELETE",headers:{Authorization:`Bearer ${fe()}`}});if(!w.ok)throw new Error(w.statusText);r.value="Deleted ✓",a.value=!0,setTimeout(()=>{r.value=""},3e3),await L()}catch(w){r.value="Error: "+w.message,a.value=!1}finally{c.value=null}}}return je(L),(V,w)=>(x(),v("div",mf,[n("div",xf,[n("div",vf,[w[7]||(w[7]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"MCP Servers"),n("p",{class:"text-sm text-textSecondary mt-1"},"Manage external MCP server connections (stdio and HTTP)")],-1)),n("div",gf,[r.value?(x(),v("span",{key:0,class:Y(["text-sm",a.value?"text-success":"text-danger"])},y(r.value),3)):K("",!0),n("button",{onClick:X,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + Add Server ")])]),s.value?(x(),v("div",hf,"Loading...")):o.value?(x(),v("div",bf,y(o.value),1)):Object.keys(t.value).length===0?(x(),v("div",yf,"No MCP servers configured")):(x(),v("div",_f,[t.value[Yt]?(x(),v("div",wf,[n("div",kf,[n("div",$f,[n("span",{class:"font-medium text-sm font-mono"},y(Yt)),n("span",{class:"type-badge",style:It(O(t.value[Yt].type))},y(t.value[Yt].type),5),w[8]||(w[8]=n("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"built-in",-1))]),w[9]||(w[9]=n("span",{class:"text-xs text-muted italic"},"read-only",-1))])])):K("",!0),(x(!0),v(ne,null,de(P.value,([b,T])=>{var A;return x(),v("div",{key:b,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[n("div",Sf,[n("div",Cf,[n("div",Tf,[n("span",Ef,y(b),1),n("span",{class:"type-badge",style:It(O(T.type))},y(T.type),5)]),n("div",Pf,[T.type==="stdio"?(x(),v(ne,{key:0},[Q(y(T.command)+y((A=T.args)!=null&&A.length?" "+T.args.join(" "):""),1)],64)):(x(),v(ne,{key:1},[Q(y(T.url),1)],64))])]),n("div",Af,[n("button",{onClick:J=>le(b,T),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,If),n("button",{onClick:J=>F(b),disabled:c.value===b,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"},y(c.value===b?"…":"Delete"),9,Of)])])])}),128))]))]),d.value?(x(),v("div",Mf,[n("h3",Df,y(h.value?`Edit: ${h.value}`:"Add MCP Server"),1),n("div",Rf,[n("div",null,[w[10]||(w[10]=n("label",{class:"text-xs text-textSecondary block mb-1"},[Q("Name "),n("span",{class:"text-danger"},"*")],-1)),G(n("input",{"onUpdate:modelValue":w[0]||(w[0]=b=>f.value=b),type:"text",readonly:!!h.value,placeholder:"my-server",class:Y(["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",h.value?"opacity-60 cursor-not-allowed":""])},null,10,jf),[[ee,f.value]])]),n("div",null,[w[12]||(w[12]=n("label",{class:"text-xs text-textSecondary block mb-1"},[Q("Type "),n("span",{class:"text-danger"},"*")],-1)),G(n("select",{"onUpdate:modelValue":w[1]||(w[1]=b=>p.value=b),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"},[...w[11]||(w[11]=[n("option",{value:"stdio"},"stdio",-1),n("option",{value:"http"},"http",-1)])],512),[[ht,p.value]])])]),p.value==="stdio"?(x(),v(ne,{key:0},[n("div",Lf,[n("div",null,[w[13]||(w[13]=n("label",{class:"text-xs text-textSecondary block mb-1"},[Q("Command "),n("span",{class:"text-danger"},"*")],-1)),G(n("input",{"onUpdate:modelValue":w[2]||(w[2]=b=>g.value=b),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),[[ee,g.value]])]),n("div",null,[w[14]||(w[14]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Args (space-separated)",-1)),G(n("input",{"onUpdate:modelValue":w[3]||(w[3]=b=>$.value=b),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),[[ee,$.value]])])]),n("div",Uf,[n("div",Nf,[w[15]||(w[15]=n("label",{class:"text-xs text-textSecondary"},"Environment Variables",-1)),n("button",{onClick:w[4]||(w[4]=b=>C.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(x(!0),v(ne,null,de(C.value,(b,T)=>(x(),v("div",{key:T,class:"flex items-center gap-2 mb-2"},[G(n("input",{"onUpdate:modelValue":A=>b.k=A,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,Vf),[[ee,b.k]]),w[16]||(w[16]=n("span",{class:"text-muted text-xs"},"=",-1)),G(n("input",{"onUpdate:modelValue":A=>b.v=A,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,Bf),[[ee,b.v]]),n("button",{onClick:A=>C.value.splice(T,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Ff)]))),128)),C.value.length===0?(x(),v("div",Hf,"No env vars")):K("",!0)])],64)):(x(),v(ne,{key:1},[n("div",Kf,[w[17]||(w[17]=n("label",{class:"text-xs text-textSecondary block mb-1"},[Q("URL "),n("span",{class:"text-danger"},"*")],-1)),G(n("input",{"onUpdate:modelValue":w[5]||(w[5]=b=>N.value=b),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),[[ee,N.value]])]),n("div",Wf,[n("div",zf,[w[18]||(w[18]=n("label",{class:"text-xs text-textSecondary"},"Headers",-1)),n("button",{onClick:w[6]||(w[6]=b=>U.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(x(!0),v(ne,null,de(U.value,(b,T)=>(x(),v("div",{key:T,class:"flex items-center gap-2 mb-2"},[G(n("input",{"onUpdate:modelValue":A=>b.k=A,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,Jf),[[ee,b.k]]),w[19]||(w[19]=n("span",{class:"text-muted text-xs"},":",-1)),G(n("input",{"onUpdate:modelValue":A=>b.v=A,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,qf),[[ee,b.v]]),n("button",{onClick:A=>U.value.splice(T,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Yf)]))),128)),U.value.length===0?(x(),v("div",Gf,"No headers")):K("",!0)])],64)),n("div",Zf,[n("button",{onClick:E,disabled:l.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},y(l.value?"Saving…":h.value?"Save Changes":"Add Server"),9,Qf),n("button",{onClick:oe,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 "),S.value?(x(),v("span",Xf,y(S.value),1)):K("",!0)])])):K("",!0)]))}}),tp={class:"animate-fade-in"},sp={class:"glass rounded-xl p-6 mb-6"},np={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},op={class:"flex items-center gap-3"},rp=["disabled"],ap={key:0,class:"text-center py-8 text-textSecondary text-sm"},lp={key:1,class:"text-center py-8 text-danger text-sm"},ip={key:2,class:"text-center text-textSecondary py-12"},cp={key:3,class:"space-y-3"},up={class:"flex items-start gap-2"},dp={class:"flex-1 space-y-2"},fp=["onUpdate:modelValue"],pp=["onUpdate:modelValue"],mp=["onClick"],xp=Ne({__name:"PromptsTab",setup(e){const t=_([]),s=_(!0),o=_(""),r=_(""),a=_(!0),l=_(!1);async function c(){s.value=!0,o.value="";try{const p=await ve("/api/prompts");t.value=(p.prompts||[]).map(g=>({label:g.label,text:g.text}))}catch(p){o.value="Failed to load prompts: "+p.message}finally{s.value=!1}}function d(){t.value.push({label:"",text:""})}function h(p){t.value.splice(p,1)}async function f(){if(l.value)return;l.value=!0,r.value="";const p=t.value.map(g=>({label:g.label.trim(),text:g.text.trim()})).filter(g=>g.label&&g.text);try{const g=await fetch("/api/prompts",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify({prompts:p})});if(!g.ok)throw new Error(g.statusText);r.value="Saved ✓",a.value=!0,setTimeout(()=>{r.value=""},3e3),await c()}catch(g){r.value="Error: "+g.message,a.value=!1}finally{l.value=!1}}return je(c),(p,g)=>(x(),v("div",tp,[n("div",sp,[n("div",np,[g[0]||(g[0]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Predefined Prompts"),n("p",{class:"text-sm text-textSecondary mt-1"},[Q(" Each prompt becomes a button in the Telegram "),n("span",{class:"font-mono"},"/prompts"),Q(" keyboard. Pressing a button injects its text into the target thread as if you typed it. ")])],-1)),n("div",op,[r.value?(x(),v("span",{key:0,class:Y(["text-sm",a.value?"text-success":"text-danger"])},y(r.value),3)):K("",!0),n("button",{onClick:d,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"}," + Add Prompt "),n("button",{onClick:f,disabled:l.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},y(l.value?"Saving…":"Save"),9,rp)])]),s.value?(x(),v("div",ap,"Loading...")):o.value?(x(),v("div",lp,y(o.value),1)):t.value.length===0?(x(),v("div",ip," No prompts yet — click “+ Add Prompt” to create one. ")):(x(),v("div",cp,[(x(!0),v(ne,null,de(t.value,($,N)=>(x(),v("div",{key:N,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[n("div",up,[n("div",dp,[n("div",null,[g[1]||(g[1]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Label (button text, ≤64 chars)",-1)),G(n("input",{"onUpdate:modelValue":C=>$.label=C,type:"text",maxlength:"64",placeholder:"Run tests",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,8,fp),[[ee,$.label]])]),n("div",null,[g[2]||(g[2]=n("label",{class:"text-xs text-textSecondary block mb-1"},"Prompt text (≤4000 chars)",-1)),G(n("textarea",{"onUpdate:modelValue":C=>$.text=C,rows:"3",maxlength:"4000",placeholder:"Run the full test suite and report failures.",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 resize-y"},null,8,pp),[[ee,$.text]])])]),n("button",{onClick:C=>h(N),class:"text-muted hover:text-danger transition text-sm px-2 pt-6 shrink-0",title:"Remove prompt"},"✕",8,mp)])]))),128))]))])]))}}),vp={class:"animate-fade-in"},gp={class:"glass rounded-xl p-6 mb-6"},hp={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},bp={class:"flex items-center gap-3"},yp=["disabled"],_p={key:0,class:"text-center py-8 text-textSecondary text-sm"},wp={key:1,class:"space-y-6"},kp={class:"glass rounded-xl p-4 border border-gray-700/50"},$p={class:"glass rounded-xl p-4 border border-gray-700/50"},Sp={class:"glass rounded-xl p-4 border border-gray-700/50"},Cp={class:"glass rounded-xl p-4 border border-gray-700/50"},Tp={class:"glass rounded-xl p-4 border border-gray-700/50"},Ep={class:"glass rounded-xl p-4 border border-gray-700/50"},Pp={class:"flex items-center justify-between gap-4"},Ap=["aria-checked"],Ip={class:"glass rounded-xl p-4 border border-gray-700/50"},Op={class:"text-xs text-textSecondary mb-3"},Mp={class:"flex items-center gap-2"},Dp=["placeholder"],Rp=["disabled"],jp={class:"glass rounded-xl p-4 border border-gray-700/50"},Lp={key:0,class:"space-y-2 mb-4"},Up=["value"],Np=["value"],Vp={class:"flex items-center justify-between mb-2"},Bp=["onUpdate:modelValue"],Fp=["onUpdate:modelValue"],Hp=["onClick"],Kp={key:1,class:"text-xs text-muted italic"},Wp={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},zp={class:"grid grid-cols-2 gap-4"},Jp={class:"text-sm font-medium font-mono text-textSecondary"},qp={class:"text-sm font-medium font-mono text-textSecondary"},Yp={class:"mt-3"},Gp=Ne({__name:"ClaudeTab",setup(e){const t=_(!0),s=_(!1),o=_(""),r=_("claude-opus-4-6"),a=_("claude-opus-4-6"),l=_("claude-sonnet-4-5"),c=_("claude-sonnet-4-5"),d=_(!1),h=_(""),f=_(""),p=_(""),g=_(""),$=_(20),N=_(20),C=_(""),U=_(!1),S=_(!1),P=_(!1),L=_([]),O=_([]),X=_("{}");function le(){const w={};for(const b of O.value){const T=b.k.trim();T&&(w[T]=b.v)}return w}const oe=Ee(()=>r.value!==a.value||l.value!==c.value||h.value!==f.value||p.value!==g.value||$.value!==N.value||C.value.length>0||S.value!==P.value||JSON.stringify(le())!==X.value);function Z(w){L.value=w.filter(b=>b.locked),O.value=w.filter(b=>!b.locked).map(b=>({k:b.key,v:b.value})),X.value=JSON.stringify(le())}async function E(){t.value=!0;try{const[w,b,T]=await Promise.all([ve("/api/settings/default-thread-model"),ve("/api/settings/default-worker-model"),ve("/api/settings/claude")]);r.value=w.defaultThreadModel,a.value=w.defaultThreadModel,l.value=b.defaultWorkerModel,c.value=b.defaultWorkerModel,h.value=T.cliPath,f.value=T.cliPath,p.value=T.gitBashPath,g.value=T.gitBashPath,$.value=T.maxConcurrentThreads,N.value=T.maxConcurrentThreads,U.value=T.oauthTokenSet,C.value="",S.value=T.autoMemoryEnabled,P.value=T.autoMemoryEnabled,Z(T.env??[])}finally{t.value=!1}}async function F(){if(s.value=!0,o.value="",!r.value){o.value="Error: Thread model cannot be empty",s.value=!1;return}if(!l.value){o.value="Error: Worker model cannot be empty",s.value=!1;return}if(!Number.isFinite($.value)||$.value<1){o.value="Error: Max concurrent threads must be at least 1",s.value=!1;return}try{const w={Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},b={cliPath:h.value,gitBashPath:p.value,maxConcurrentThreads:$.value,autoMemoryEnabled:S.value,customEnvVars:le()};C.value.length>0&&(b.oauthToken=C.value);const[T,A,J]=await Promise.all([fetch("/api/settings/default-thread-model",{method:"POST",headers:w,body:JSON.stringify({model:r.value})}),fetch("/api/settings/default-worker-model",{method:"POST",headers:w,body:JSON.stringify({model:l.value})}),fetch("/api/settings/claude",{method:"POST",headers:w,body:JSON.stringify(b)})]);for(const j of[T,A,J])if(!j.ok){const $e=await j.json().catch(()=>({error:j.statusText}));throw new Error($e.error??j.statusText)}const ue=await T.json(),se=await A.json(),H=await J.json();a.value=ue.defaultThreadModel,r.value=ue.defaultThreadModel,c.value=se.defaultWorkerModel,l.value=se.defaultWorkerModel,h.value=H.cliPath,f.value=H.cliPath,p.value=H.gitBashPath,g.value=H.gitBashPath,$.value=H.maxConcurrentThreads,N.value=H.maxConcurrentThreads,U.value=H.oauthTokenSet,C.value="",S.value=H.autoMemoryEnabled,P.value=H.autoMemoryEnabled,Z(H.env??[]),o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(w){o.value="Error: "+w.message}finally{s.value=!1}}async function V(){d.value=!0,o.value="";try{const w={Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},b=await fetch("/api/settings/claude",{method:"POST",headers:w,body:JSON.stringify({clearOauthToken:!0})});if(!b.ok){const A=await b.json().catch(()=>({error:b.statusText}));throw new Error(A.error??b.statusText)}const T=await b.json();U.value=T.oauthTokenSet,C.value="",Z(T.env??[]),o.value="Token cleared ✓",setTimeout(()=>{o.value=""},3e3)}catch(w){o.value="Error: "+w.message}finally{d.value=!1}}return je(E),(w,b)=>(x(),v("div",vp,[n("div",gp,[n("div",hp,[b[8]||(b[8]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Claude"),n("p",{class:"text-sm text-textSecondary mt-1"},"Default models for Claude Code threads and workers")],-1)),n("div",bp,[o.value?(x(),v("span",{key:0,class:Y([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(o.value),3)):K("",!0),n("button",{onClick:F,disabled:s.value||t.value||!oe.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},y(s.value?"Saving…":"Save"),9,yp)])]),t.value?(x(),v("div",_p,"Loading…")):(x(),v("div",wp,[n("div",kp,[b[9]||(b[9]=n("label",{class:"block text-sm font-medium mb-1"},"Default Thread Model",-1)),b[10]||(b[10]=n("p",{class:"text-xs text-textSecondary mb-3"},[Q(" Model used when spawning a normal (orchestrator) Claude thread. Overridden by the "),n("span",{class:"font-mono text-accentLight"},"CLAUDE_MODEL"),Q(" env var if set. ")],-1)),G(n("input",{"onUpdate:modelValue":b[0]||(b[0]=T=>r.value=T),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),[[ee,r.value,void 0,{trim:!0}]])]),n("div",$p,[b[11]||(b[11]=n("label",{class:"block text-sm font-medium mb-1"},"Default Worker Model",-1)),b[12]||(b[12]=n("p",{class:"text-xs text-textSecondary mb-3"},[Q(" Model used when spawning a worker Claude thread. Overridden by the "),n("span",{class:"font-mono text-accentLight"},"CLAUDE_WORKER_MODEL"),Q(" env var if set. ")],-1)),G(n("input",{"onUpdate:modelValue":b[1]||(b[1]=T=>l.value=T),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),[[ee,l.value,void 0,{trim:!0}]])]),n("div",Sp,[b[13]||(b[13]=n("label",{class:"block text-sm font-medium mb-1"},"Claude CLI Path",-1)),b[14]||(b[14]=n("p",{class:"text-xs text-textSecondary mb-3"},[Q(" Explicit path to the Claude binary. Leave empty to auto-detect. Overridden by the "),n("span",{class:"font-mono text-accentLight"},"CLAUDE_CLI_CMD"),Q(" env var if set. ")],-1)),G(n("input",{"onUpdate:modelValue":b[2]||(b[2]=T=>h.value=T),type:"text",placeholder:"(auto-detect)",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),[[ee,h.value,void 0,{trim:!0}]])]),n("div",Cp,[b[15]||(b[15]=n("label",{class:"block text-sm font-medium mb-1"},"Git Bash Path (Windows)",-1)),b[16]||(b[16]=n("p",{class:"text-xs text-textSecondary mb-3"},[Q(" Path to "),n("span",{class:"font-mono text-accentLight"},"bash.exe"),Q(" passed to Claude via "),n("span",{class:"font-mono text-accentLight"},"CLAUDE_CODE_GIT_BASH_PATH"),Q(". Leave empty to auto-detect. ")],-1)),G(n("input",{"onUpdate:modelValue":b[3]||(b[3]=T=>p.value=T),type:"text",placeholder:"(auto-detect)",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),[[ee,p.value,void 0,{trim:!0}]])]),n("div",Tp,[b[17]||(b[17]=n("label",{class:"block text-sm font-medium mb-1"},"Max Concurrent Threads",-1)),b[18]||(b[18]=n("p",{class:"text-xs text-textSecondary mb-3"}," Upper limit on simultaneously spawned agent processes. Raising this increases memory and CPU load. ",-1)),G(n("input",{"onUpdate:modelValue":b[4]||(b[4]=T=>$.value=T),type:"number",min:"1",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),[[ee,$.value,void 0,{number:!0}]])]),n("div",Ep,[n("div",Pp,[b[19]||(b[19]=n("div",null,[n("label",{class:"block text-sm font-medium mb-1"},"Claude Native Auto-Memory"),n("p",{class:"text-xs text-textSecondary"},[Q(" Claude Code's built-in "),n("span",{class:"font-mono text-accentLight"},"MEMORY.md"),Q(" memory. Off by default — it conflicts with Sensorium's own memory system. Applied to each thread's config at spawn. ")])],-1)),n("button",{type:"button",role:"switch","aria-checked":S.value,onClick:b[5]||(b[5]=T=>S.value=!S.value),class:Y([S.value?"bg-accent":"bg-gray-700","relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition"])},[n("span",{class:Y([S.value?"translate-x-6":"translate-x-1","inline-block h-4 w-4 rounded-full bg-white transition"])},null,2)],10,Ap)])]),n("div",Ip,[b[23]||(b[23]=n("label",{class:"block text-sm font-medium mb-1"},"Claude OAuth Token",-1)),n("p",Op,[b[20]||(b[20]=Q(" Long-lived setup token used instead of the OAuth refresh flow. Overridden by the ",-1)),b[21]||(b[21]=n("span",{class:"font-mono text-accentLight"},"CLAUDE_CODE_OAUTH_TOKEN",-1)),b[22]||(b[22]=Q(" env var if set. ",-1)),n("span",{class:Y(U.value?"text-success":"text-muted")},y(U.value?"A token is currently stored.":"No token stored."),3)]),n("div",Mp,[G(n("input",{"onUpdate:modelValue":b[6]||(b[6]=T=>C.value=T),type:"password",placeholder:U.value?"•••••••• (leave empty to keep)":"Paste token to store",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,Dp),[[ee,C.value]]),U.value?(x(),v("button",{key:0,onClick:V,disabled:d.value,class:"px-3 py-2 rounded-lg border border-gray-700 hover:border-danger hover:text-danger disabled:opacity-50 text-sm transition whitespace-nowrap"},y(d.value?"Clearing…":"Clear"),9,Rp)):K("",!0)])]),n("div",jp,[b[28]||(b[28]=n("label",{class:"block text-sm font-medium mb-1"},"Environment Variables",-1)),b[29]||(b[29]=n("p",{class:"text-xs text-textSecondary mb-3"},[Q(" Variables injected into every Claude child process. Locked entries are managed by the settings above and are read-only (secrets are masked). Add your own under "),n("span",{class:"font-mono text-accentLight"},"Additional Variables"),Q(". ")],-1)),L.value.length?(x(),v("div",Lp,[(x(!0),v(ne,null,de(L.value,T=>(x(),v("div",{key:T.key,class:"flex items-center gap-2"},[n("input",{value:T.key,readonly:"",class:"flex-1 px-3 py-2 rounded-lg bg-surface/50 border border-gray-700/50 text-sm text-textSecondary font-mono cursor-not-allowed"},null,8,Up),b[24]||(b[24]=n("span",{class:"text-muted text-xs"},"=",-1)),n("input",{value:T.value,readonly:"",class:"flex-1 px-3 py-2 rounded-lg bg-surface/50 border border-gray-700/50 text-sm text-textSecondary font-mono cursor-not-allowed"},null,8,Np),b[25]||(b[25]=n("span",{class:"text-muted text-xs px-2",title:"Locked"},"🔒",-1))]))),128))])):K("",!0),n("div",Vp,[b[26]||(b[26]=n("label",{class:"text-xs text-textSecondary"},"Additional Variables",-1)),n("button",{onClick:b[7]||(b[7]=T=>O.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(x(!0),v(ne,null,de(O.value,(T,A)=>(x(),v("div",{key:A,class:"flex items-center gap-2 mb-2"},[G(n("input",{"onUpdate:modelValue":J=>T.k=J,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,Bp),[[ee,T.k]]),b[27]||(b[27]=n("span",{class:"text-muted text-xs"},"=",-1)),G(n("input",{"onUpdate:modelValue":J=>T.v=J,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,Fp),[[ee,T.v]]),n("button",{onClick:J=>O.value.splice(A,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Hp)]))),128)),O.value.length===0?(x(),v("div",Kp,"No additional variables")):K("",!0)]),n("div",Wp,[b[32]||(b[32]=n("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),n("div",zp,[n("div",null,[b[30]||(b[30]=n("div",{class:"text-xs text-muted mb-1"},"Thread Model",-1)),n("span",Jp,y(a.value),1)]),n("div",null,[b[31]||(b[31]=n("div",{class:"text-xs text-muted mb-1"},"Worker Model",-1)),n("span",qp,y(c.value),1)])]),n("div",Yp,[n("span",{class:Y(["text-sm font-medium",oe.value?"text-warn":"text-textSecondary"])},y(oe.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),Zp={class:"animate-fade-in"},Qp={class:"glass rounded-xl p-6 mb-6"},Xp={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},em={class:"flex items-center gap-3"},tm=["disabled"],sm={key:0,class:"text-center py-8 text-textSecondary text-sm"},nm={key:1,class:"space-y-6"},om={class:"glass rounded-xl p-4 border border-gray-700/50"},rm={id:"copilot-models"},am=["value"],lm={key:0,class:"text-xs text-success mt-2"},im={class:"glass rounded-xl p-4 border border-gray-700/50"},cm={class:"flex items-center justify-between"},um={class:"glass rounded-xl p-4 border border-gray-700/50"},dm=["disabled"],fm={class:"glass rounded-xl p-4 border border-gray-700/50"},pm=["disabled"],mm={class:"glass rounded-xl p-4 border border-gray-700/50"},xm={class:"text-xs text-textSecondary mb-3"},vm={key:0,class:"text-success"},gm={key:1,class:"text-warn"},hm=["disabled","placeholder"],bm={class:"glass rounded-xl p-4 border border-gray-700/50"},ym={key:0,class:"mt-4 space-y-4"},_m={class:"text-xs text-textSecondary mb-2"},wm=["disabled"],km={class:"text-xs text-textSecondary mb-2"},$m=["disabled"],Sm={class:"glass rounded-xl p-4 border border-gray-700/50"},Cm={class:"flex items-center justify-between gap-3"},Tm=["disabled"],Em={key:1,class:"mt-3 max-h-48 overflow-y-auto rounded-lg bg-surface/50 border border-gray-700/50 p-3"},Pm={class:"glass rounded-xl p-4 border border-gray-700/50"},Am={key:0,class:"space-y-2 mb-4"},Im=["value"],Om=["value"],Mm={class:"flex items-center justify-between mb-2"},Dm=["onUpdate:modelValue"],Rm=["onUpdate:modelValue"],jm=["onClick"],Lm={key:1,class:"text-xs text-muted italic"},Um={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},Nm={class:"grid grid-cols-2 gap-4"},Vm={class:"text-sm font-medium font-mono text-textSecondary"},Bm=Ne({__name:"CopilotTab",setup(e){const t=_(!0),s=_(!1),o=_(""),r=_(""),a=_(!1),l=_("openai"),c=_(""),d=_(""),h=_(""),f=_(""),p=_(!1),g=_(!1),$=_(!1),N=_(""),C=_([]),U=_([]),S=_([]);function P(){const Z={};for(const E of S.value){const F=E.k.trim();F&&(Z[F]=E.v)}return Z}async function L(){t.value=!0;try{const Z=await ve("/api/settings/copilot");O(Z),a.value&&p.value&&oe(!0)}finally{t.value=!1}}function O(Z){r.value=Z.model,a.value=Z.byok.enabled,l.value=Z.byok.providerType,c.value=Z.byok.baseUrl,d.value=Z.byok.modelId,h.value=Z.byok.wireModel,p.value=Z.byok.apiKeySet,f.value="";const E=Z.env??[];U.value=E.filter(F=>F.locked),S.value=E.filter(F=>!F.locked).map(F=>({k:F.key,v:F.value}))}const X=Ee(()=>!(!r.value.trim()||a.value&&(!c.value.trim()||!p.value&&!f.value.trim())));async function le(){if(s.value=!0,o.value="",!r.value.trim()){o.value="Error: Model cannot be empty",s.value=!1;return}try{const Z={enabled:a.value,providerType:l.value,baseUrl:c.value.trim(),modelId:d.value.trim(),wireModel:h.value.trim()};f.value.trim()&&(Z.apiKey=f.value.trim());const E={Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},F=await fetch("/api/settings/copilot",{method:"POST",headers:E,body:JSON.stringify({model:r.value.trim(),byok:Z,customEnvVars:P()})});if(!F.ok){const w=await F.json().catch(()=>({error:F.statusText}));throw new Error(w.error??F.statusText)}const V=await F.json();O(V),o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(Z){o.value="Error: "+Z.message}finally{s.value=!1}}async function oe(Z=!1){$.value=!0,N.value="",C.value=[];try{const E={baseUrl:c.value.trim(),providerType:l.value};f.value.trim()&&(E.apiKey=f.value.trim());const F=await fetch("/api/settings/copilot/models",{method:"POST",headers:{Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},body:JSON.stringify(E)}),V=await F.json();if(!F.ok||!V.ok)throw new Error(V.error??F.statusText);C.value=V.models??[],N.value=`OK — ${V.count??C.value.length} models`}catch(E){Z||(N.value="Error: "+E.message)}finally{$.value=!1}}return je(L),(Z,E)=>(x(),v("div",Zp,[n("div",Qp,[n("div",Xp,[E[10]||(E[10]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Copilot"),n("p",{class:"text-sm text-textSecondary mt-1"},"Model and bring-your-own-key provider (OpenRouter, DeepSeek, Kimi)")],-1)),n("div",em,[o.value?(x(),v("span",{key:0,class:Y([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(o.value),3)):K("",!0),n("button",{onClick:le,disabled:s.value||t.value||!X.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},y(s.value?"Saving…":"Save"),9,tm)])]),t.value?(x(),v("div",sm,"Loading…")):(x(),v("div",nm,[n("div",om,[E[11]||(E[11]=n("label",{class:"block text-sm font-medium mb-1"},"Copilot Model",-1)),E[12]||(E[12]=n("p",{class:"text-xs text-textSecondary mb-3"},[Q(" Model passed to the Copilot CLI via "),n("span",{class:"font-mono text-accentLight"},"--model"),Q(" / "),n("span",{class:"font-mono text-accentLight"},"COPILOT_MODEL"),Q(". ")],-1)),G(n("input",{"onUpdate:modelValue":E[0]||(E[0]=F=>r.value=F),type:"text",list:"copilot-models",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),[[ee,r.value,void 0,{trim:!0}]]),n("datalist",rm,[(x(!0),v(ne,null,de(C.value,F=>(x(),v("option",{key:F,value:F},null,8,am))),128))]),C.value.length?(x(),v("p",lm,y(C.value.length)+" models loaded from provider — pick one from the dropdown. ",1)):K("",!0)]),n("div",im,[n("div",cm,[E[13]||(E[13]=n("div",null,[n("div",{class:"text-sm font-medium"},"Custom Provider (BYOK)"),n("p",{class:"text-xs text-textSecondary mt-1"}," Route Copilot through an OpenAI-compatible endpoint. GitHub auth is not used while enabled. ")],-1)),n("button",{onClick:E[1]||(E[1]=F=>a.value=!a.value),class:Y(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors shrink-0",a.value?"bg-accent":"bg-gray-700"])},[n("span",{class:Y(["inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform",a.value?"translate-x-6":"translate-x-1"])},null,2)],2)])]),n("div",{class:Y(["space-y-4 transition",a.value?"":"opacity-40 pointer-events-none select-none"])},[n("div",um,[E[15]||(E[15]=n("label",{class:"block text-sm font-medium mb-1"},"Provider Type",-1)),E[16]||(E[16]=n("p",{class:"text-xs text-textSecondary mb-3"},[Q(" Wire protocol of the endpoint ("),n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_TYPE"),Q("). ")],-1)),G(n("select",{"onUpdate:modelValue":E[2]||(E[2]=F=>l.value=F),disabled:!a.value,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"},[...E[14]||(E[14]=[n("option",{value:"openai"},"openai",-1),n("option",{value:"azure"},"azure",-1),n("option",{value:"anthropic"},"anthropic",-1)])],8,dm),[[ht,l.value]])]),n("div",fm,[E[17]||(E[17]=n("label",{class:"block text-sm font-medium mb-1"},"Base URL",-1)),E[18]||(E[18]=n("p",{class:"text-xs text-textSecondary mb-3"},[Q(" e.g. "),n("span",{class:"font-mono text-accentLight"},"https://openrouter.ai/api/v1"),Q(" ("),n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_BASE_URL"),Q("). ")],-1)),G(n("input",{"onUpdate:modelValue":E[3]||(E[3]=F=>c.value=F),type:"text",disabled:!a.value,placeholder:"https://openrouter.ai/api/v1",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,8,pm),[[ee,c.value,void 0,{trim:!0}]])]),n("div",mm,[E[22]||(E[22]=n("label",{class:"block text-sm font-medium mb-1"},"API Key",-1)),n("p",xm,[E[19]||(E[19]=Q(" Stored server-side and never echoed back (",-1)),E[20]||(E[20]=n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_API_KEY",-1)),E[21]||(E[21]=Q("). ",-1)),p.value?(x(),v("span",vm,"A key is currently set — leave blank to keep it.")):(x(),v("span",gm,"No key set."))]),G(n("input",{"onUpdate:modelValue":E[4]||(E[4]=F=>f.value=F),type:"password",disabled:!a.value,placeholder:p.value?"•••••••• (unchanged)":"sk-…",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,8,hm),[[ee,f.value]])]),n("div",bm,[n("button",{type:"button",onClick:E[5]||(E[5]=F=>g.value=!g.value),class:"text-sm font-medium text-textSecondary hover:text-textPrimary transition flex items-center gap-2"},[n("span",null,y(g.value?"▾":"▸"),1),E[23]||(E[23]=Q(" Advanced (model mapping) ",-1))]),g.value?(x(),v("div",ym,[n("div",null,[E[26]||(E[26]=n("label",{class:"block text-sm font-medium mb-1"},"Model ID",-1)),n("p",_m,[E[24]||(E[24]=Q(" Well-known base model for tool config (",-1)),E[25]||(E[25]=n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_MODEL_ID",-1)),Q("). Defaults to Copilot Model. "+y(C.value.length?"Pick from the tested provider models below.":"Run Test to load the provider’s model list."),1)]),G(n("input",{"onUpdate:modelValue":E[6]||(E[6]=F=>d.value=F),type:"text",list:"copilot-models",disabled:!a.value,placeholder:"(defaults to Copilot Model)",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,8,wm),[[ee,d.value,void 0,{trim:!0}]])]),n("div",null,[E[29]||(E[29]=n("label",{class:"block text-sm font-medium mb-1"},"Wire Model",-1)),n("p",km,[E[27]||(E[27]=Q(" Exact model name sent to the provider (",-1)),E[28]||(E[28]=n("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_WIRE_MODEL",-1)),Q("). Defaults to Copilot Model. "+y(C.value.length?"Pick from the tested provider models below.":"Run Test to load the provider’s model list."),1)]),G(n("input",{"onUpdate:modelValue":E[7]||(E[7]=F=>h.value=F),type:"text",list:"copilot-models",disabled:!a.value,placeholder:"(defaults to Copilot Model)",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,8,$m),[[ee,h.value,void 0,{trim:!0}]])])])):K("",!0)]),n("div",Sm,[n("div",Cm,[E[30]||(E[30]=n("div",null,[n("div",{class:"text-sm font-medium"},"Test Connection"),n("p",{class:"text-xs text-textSecondary mt-1"}," Lists models from the endpoint above using the values entered here — no need to save first. Uses the right auth for the selected Provider Type (openai/azure/anthropic). ")],-1)),n("button",{onClick:E[8]||(E[8]=F=>oe()),disabled:$.value||!a.value,class:"px-4 py-2 rounded-xl bg-surface border border-gray-700 hover:border-accent disabled:opacity-50 text-sm font-medium transition whitespace-nowrap"},y($.value?"Testing…":"Test"),9,Tm)]),N.value?(x(),v("div",{key:0,class:Y([N.value.startsWith("Error")?"text-danger":"text-success","text-sm mt-3"])},y(N.value),3)):K("",!0),C.value.length?(x(),v("div",Em,[(x(!0),v(ne,null,de(C.value,F=>(x(),v("div",{key:F,class:"text-xs font-mono text-textSecondary py-0.5"},y(F),1))),128))])):K("",!0)])],2),n("div",Pm,[E[35]||(E[35]=n("label",{class:"block text-sm font-medium mb-1"},"Environment Variables",-1)),E[36]||(E[36]=n("p",{class:"text-xs text-textSecondary mb-3"},[Q(" Variables injected into every Copilot child process. Locked entries are managed by the settings above and are read-only (secrets are masked). Add your own under "),n("span",{class:"font-mono text-accentLight"},"Additional Variables"),Q(". ")],-1)),U.value.length?(x(),v("div",Am,[(x(!0),v(ne,null,de(U.value,F=>(x(),v("div",{key:F.key,class:"flex items-center gap-2"},[n("input",{value:F.key,readonly:"",class:"flex-1 px-3 py-2 rounded-lg bg-surface/50 border border-gray-700/50 text-sm text-textSecondary font-mono cursor-not-allowed"},null,8,Im),E[31]||(E[31]=n("span",{class:"text-muted text-xs"},"=",-1)),n("input",{value:F.value,readonly:"",class:"flex-1 px-3 py-2 rounded-lg bg-surface/50 border border-gray-700/50 text-sm text-textSecondary font-mono cursor-not-allowed"},null,8,Om),E[32]||(E[32]=n("span",{class:"text-muted text-xs px-2",title:"Locked"},"🔒",-1))]))),128))])):K("",!0),n("div",Mm,[E[33]||(E[33]=n("label",{class:"text-xs text-textSecondary"},"Additional Variables",-1)),n("button",{onClick:E[9]||(E[9]=F=>S.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(x(!0),v(ne,null,de(S.value,(F,V)=>(x(),v("div",{key:V,class:"flex items-center gap-2 mb-2"},[G(n("input",{"onUpdate:modelValue":w=>F.k=w,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,Dm),[[ee,F.k]]),E[34]||(E[34]=n("span",{class:"text-muted text-xs"},"=",-1)),G(n("input",{"onUpdate:modelValue":w=>F.v=w,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,Rm),[[ee,F.v]]),n("button",{onClick:w=>S.value.splice(V,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,jm)]))),128)),S.value.length===0?(x(),v("div",Lm,"No additional variables")):K("",!0)]),n("div",Um,[E[39]||(E[39]=n("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),n("div",Nm,[n("div",null,[E[37]||(E[37]=n("div",{class:"text-xs text-muted mb-1"},"Model",-1)),n("span",Vm,y(r.value||"—"),1)]),n("div",null,[E[38]||(E[38]=n("div",{class:"text-xs text-muted mb-1"},"Custom Provider",-1)),n("span",{class:Y(["text-sm font-medium",a.value?"text-success":"text-textSecondary"])},y(a.value?"Enabled":"Disabled"),3)])])])]))])]))}}),Fm={class:"animate-fade-in"},Hm={class:"glass rounded-xl p-6 mb-6"},Km={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},Wm={class:"flex items-center gap-3"},zm=["disabled"],Jm={key:0,class:"text-center py-8 text-textSecondary text-sm"},qm={key:1,class:"space-y-6"},Ym={class:"glass rounded-xl p-4 border border-gray-700/50"},Gm={class:"flex items-center gap-4"},Zm={class:"flex justify-between text-xs text-muted mt-2"},Qm={class:"font-mono"},Xm={key:0,class:"mt-3 px-3 py-2 rounded-lg bg-warn/10 border border-warn/20 text-xs text-warn"},ex={class:"glass rounded-xl p-4 border border-gray-700/50"},tx={class:"flex items-center gap-4"},sx={class:"flex justify-between text-xs text-muted mt-2"},nx={class:"font-mono"},ox={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},rx={class:"grid grid-cols-2 gap-4"},ax={class:"text-sm font-medium text-textSecondary"},lx={class:"mt-3"},ix=Ne({__name:"SettingsTab",setup(e){const t=_(!0),s=_(!1),o=_(""),r=_(50),a=_(50),l=_(1440),c=_(1440),d=Ee(()=>r.value!==a.value||l.value!==c.value);async function h(){t.value=!0;try{const[p,g]=await Promise.all([ve("/api/settings/bootstrap-message-count"),ve("/api/settings/wait-timeout")]);r.value=p.count,a.value=p.count,l.value=g.minutes,c.value=g.minutes}finally{t.value=!1}}async function f(){s.value=!0,o.value="";try{const p={Authorization:`Bearer ${fe()}`,"Content-Type":"application/json"},[g,$]=await Promise.all([fetch("/api/settings/bootstrap-message-count",{method:"POST",headers:p,body:JSON.stringify({count:r.value})}),fetch("/api/settings/wait-timeout",{method:"POST",headers:p,body:JSON.stringify({minutes:l.value})})]);for(const U of[g,$])if(!U.ok){const S=await U.json().catch(()=>({error:U.statusText}));throw new Error(S.error??U.statusText)}const N=await g.json(),C=await $.json();a.value=N.count,r.value=N.count,c.value=C.minutes,l.value=C.minutes,o.value="Saved ✓",setTimeout(()=>{o.value=""},3e3)}catch(p){o.value="Error: "+p.message}finally{s.value=!1}}return je(h),(p,g)=>(x(),v("div",Fm,[n("div",Hm,[n("div",Km,[g[4]||(g[4]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Settings"),n("p",{class:"text-sm text-textSecondary mt-1"},"Configure agent behavior and context injection")],-1)),n("div",Wm,[o.value?(x(),v("span",{key:0,class:Y([o.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},y(o.value),3)):K("",!0),n("button",{onClick:f,disabled:s.value||t.value||!d.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},y(s.value?"Saving…":"Save"),9,zm)])]),t.value?(x(),v("div",Jm,"Loading…")):(x(),v("div",qm,[n("div",Ym,[g[8]||(g[8]=n("label",{class:"block text-sm font-medium mb-1"},"Recent Conversation Buffer",-1)),g[9]||(g[9]=n("p",{class:"text-xs text-textSecondary mb-3"},[Q(" Number of recent messages injected into the agent's bootstrap context. Set to "),n("span",{class:"font-mono text-accentLight"},"0"),Q(" to disable (useful when using VS Code, which maintains its own conversation history). ")],-1)),n("div",Gm,[G(n("input",{"onUpdate:modelValue":g[0]||(g[0]=$=>r.value=$),type:"range",min:"0",max:"100",step:"5",class:"flex-1 accent-accent"},null,512),[[ee,r.value,void 0,{number:!0}]]),G(n("input",{"onUpdate:modelValue":g[1]||(g[1]=$=>r.value=$),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),[[ee,r.value,void 0,{number:!0}]])]),n("div",Zm,[g[5]||(g[5]=n("span",null,"Off",-1)),n("span",Qm,y(r.value)+" messages",1),g[6]||(g[6]=n("span",null,"Max",-1))]),r.value===0?(x(),v("div",Xm,[...g[7]||(g[7]=[Q(" Message buffer injection is ",-1),n("strong",null,"disabled",-1),Q(". 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)])])):K("",!0)]),n("div",ex,[g[12]||(g[12]=n("label",{class:"block text-sm font-medium mb-1"},"Poll Timeout (wait_for_instructions)",-1)),g[13]||(g[13]=n("p",{class:"text-xs text-textSecondary mb-3"},[Q(" Maximum time (in minutes) a single "),n("span",{class:"font-mono text-accentLight"},"wait_for_instructions"),Q(" call will poll before timing out. Claude Code agents use the full value; Copilot agents are capped at 10 min. ")],-1)),n("div",tx,[G(n("input",{"onUpdate:modelValue":g[2]||(g[2]=$=>l.value=$),type:"range",min:"1",max:"1440",step:"10",class:"flex-1 accent-accent"},null,512),[[ee,l.value,void 0,{number:!0}]]),G(n("input",{"onUpdate:modelValue":g[3]||(g[3]=$=>l.value=$),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),[[ee,l.value,void 0,{number:!0}]])]),n("div",sx,[g[10]||(g[10]=n("span",null,"1 min",-1)),n("span",nx,y(l.value>=60?Math.floor(l.value/60)+"h "+l.value%60+"m":l.value+" min"),1),g[11]||(g[11]=n("span",null,"24h",-1))])]),n("div",ox,[g[16]||(g[16]=n("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),n("div",rx,[n("div",null,[g[14]||(g[14]=n("div",{class:"text-xs text-muted mb-1"},"Message Buffer",-1)),n("span",{class:Y(["text-sm font-medium",a.value>0?"text-success":"text-textSecondary"])},y(a.value>0?`${a.value} messages`:"Disabled"),3)]),n("div",null,[g[15]||(g[15]=n("div",{class:"text-xs text-muted mb-1"},"Poll Timeout",-1)),n("span",ax,y(c.value>=60?Math.floor(c.value/60)+"h "+c.value%60+"m":c.value+" min"),1)])]),n("div",lx,[n("span",{class:Y(["text-sm font-medium",d.value?"text-warn":"text-textSecondary"])},y(d.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),cx={class:"animate-fade-in"},ux={class:"glass rounded-xl p-6 mb-6"},dx={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},fx={class:"flex flex-wrap gap-3 items-center"},px=["disabled"],mx={key:0,class:"flex items-center gap-2"},xx={key:1},vx={class:"glass rounded-xl p-6"},gx={key:0,class:"text-center py-8 text-textSecondary text-sm"},hx={key:1,class:"text-center py-12 text-textSecondary text-sm"},bx={key:2,class:"space-y-2"},yx={class:"flex items-center justify-between gap-3"},_x={class:"flex-1 min-w-0"},wx={class:"flex flex-wrap items-center gap-2 mb-1"},kx={class:"font-medium text-sm font-mono"},$x={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},Sx={class:"text-xs text-muted"},Cx={class:"text-xs text-muted"},Tx=["onClick","disabled"],Ex={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/80 backdrop-blur-sm"},Px={class:"glass rounded-2xl p-6 max-w-sm w-full mx-4"},Ax={class:"text-sm text-textSecondary mb-4"},Ix={class:"font-mono text-textPrimary"},Ox=Ne({__name:"SnapshotsTab",setup(e){const t=_([]),s=_(!0),o=_(!1),r=_(null),a=_(""),l=_(""),c=_(!0),d=_(null);function h(S){return S<1024?`${S} B`:S<1024*1024?`${(S/1024).toFixed(1)} KB`:`${(S/(1024*1024)).toFixed(1)} MB`}function f(S){try{return new Date(S).toLocaleString()}catch{return S}}function p(S,P){l.value=S,c.value=P,setTimeout(()=>{l.value=""},4e3)}async function g(){s.value=!0;try{const S=await ve("/api/snapshots");t.value=S.snapshots}catch(S){p("Failed to load snapshots: "+S.message,!1)}finally{s.value=!1}}async function $(){if(!o.value){o.value=!0;try{await ve("/api/snapshots",{method:"POST",body:JSON.stringify({description:a.value})}),a.value="",p("Snapshot created ✓",!0),await g()}catch(S){p("Error: "+S.message,!1)}finally{o.value=!1}}}function N(S){d.value=S}function C(){d.value=null}async function U(){const S=d.value;if(!(!S||r.value)){d.value=null,r.value=S;try{await ve(`/api/snapshots/${encodeURIComponent(S)}`,{method:"DELETE"}),p("Deleted ✓",!0),await g()}catch(P){p("Error: "+P.message,!1)}finally{r.value=null}}}return je(g),(S,P)=>(x(),v("div",cx,[n("div",ux,[n("div",dx,[P[1]||(P[1]=n("div",null,[n("h3",{class:"text-lg font-semibold"},"Snapshots"),n("p",{class:"text-sm text-textSecondary mt-1"},"Create and manage data directory snapshots")],-1)),l.value?(x(),v("span",{key:0,class:Y(["text-sm",c.value?"text-success":"text-danger"])},y(l.value),3)):K("",!0)]),n("div",fx,[G(n("input",{"onUpdate:modelValue":P[0]||(P[0]=L=>a.value=L),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:Xe($,["enter"])},null,544),[[ee,a.value]]),n("button",{onClick:$,disabled:o.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"},[o.value?(x(),v("span",mx,[...P[2]||(P[2]=[n("svg",{class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 12a8 8 0 018-8v8H4z"})],-1),Q(" Creating… ",-1)])])):(x(),v("span",xx,"+ Create Snapshot"))],8,px)])]),n("div",vx,[s.value?(x(),v("div",gx,"Loading…")):t.value.length===0?(x(),v("div",hx,"No snapshots yet")):(x(),v("div",bx,[(x(!0),v(ne,null,de(t.value,L=>(x(),v("div",{key:L.name,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[n("div",yx,[n("div",_x,[n("div",wx,[n("span",kx,y(L.name),1),n("span",$x,"v"+y(L.mcpVersion),1),n("span",Sx,y(h(L.sizeBytes)),1)]),n("div",Cx,[Q(y(f(L.createdAt)),1),L.description?(x(),v(ne,{key:0},[Q(" · "+y(L.description),1)],64)):K("",!0)])]),n("button",{onClick:O=>N(L.name),disabled:r.value===L.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"},y(r.value===L.name?"…":"Delete"),9,Tx)])]))),128))]))]),d.value?(x(),v("div",Ex,[n("div",Px,[P[5]||(P[5]=n("h3",{class:"text-base font-semibold mb-2"},"Delete Snapshot",-1)),n("p",Ax,[P[3]||(P[3]=Q(" Delete ",-1)),n("span",Ix,y(d.value),1),P[4]||(P[4]=Q("? This cannot be undone. ",-1))]),n("div",{class:"flex gap-3"},[n("button",{onClick:U,class:"flex-1 px-4 py-2 rounded-xl bg-danger hover:opacity-80 text-white text-sm font-medium transition"},"Delete"),n("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")])])])):K("",!0)]))}}),Mx={class:"animate-fade-in space-y-6"},Dx={class:"glass rounded-xl p-6"},Rx={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},jx={class:"text-sm text-textSecondary mt-1"},Lx={class:"flex items-center gap-3"},Ux={key:0,class:"text-xs text-accentLight animate-pulse"},Nx={key:0,class:"flex flex-wrap gap-2 mt-3"},Vx=["onClick"],Bx={class:"ml-1 opacity-60"},Fx={key:0,class:"text-center py-12 text-textSecondary"},Hx={key:1,class:"text-center py-8 text-danger text-sm"},Kx={key:2,class:"text-center py-12 text-textSecondary"},Wx={key:3,class:"space-y-3"},zx={class:"flex flex-wrap items-start gap-3"},Jx={class:"flex-1 min-w-0 space-y-2"},qx={class:"flex flex-wrap items-center gap-2"},Yx={class:"font-semibold truncate"},Gx={class:"text-xs text-muted font-mono"},Zx={class:"flex flex-wrap items-center gap-4 text-xs text-textSecondary"},Qx={title:"Created"},Xx={title:"Archived"},ev={key:0,class:"text-muted"},tv={key:0,class:"text-sm text-textSecondary mt-1 leading-relaxed"},sv={key:1,class:"text-sm text-muted mt-1 italic animate-pulse"},nv={class:"flex items-center gap-2 shrink-0"},ov=["onClick","disabled"],rv=3,av=Ne({__name:"ArchivedThreadsTab",setup(e){const t=_([]),s=_(!0),o=_(""),r=_({}),a=_({}),l=_({done:0,total:0}),c=_(null),d=_("all");let h=0;const f={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"}},p=Ee(()=>d.value==="all"?t.value:t.value.filter(P=>P.type===d.value)),g=Ee(()=>{const P={all:t.value.length};for(const L of t.value)P[L.type]=(P[L.type]??0)+1;return P}),$=Ee(()=>Object.values(a.value).some(Boolean));async function N(){s.value=!0,o.value="";try{const P=await ve("/api/threads/archived");t.value=P.threads??[],r.value={},a.value={},t.value.length>0&&C()}catch(P){o.value=P.message||"Failed to load archived threads"}finally{s.value=!1}}async function C(){const P=++h,L=[...t.value];l.value={done:0,total:L.length};async function O(){for(;L.length>0&&P===h;){const le=L.shift();a.value={...a.value,[le.threadId]:!0};try{const oe=await fetch(`/api/threads/${le.threadId}/summary`,{method:"POST",headers:{Authorization:`Bearer ${fe()}`}});if(P!==h)return;if(oe.ok){const Z=await oe.json();Z.summary&&(r.value={...r.value,[le.threadId]:Z.summary})}}catch{}finally{if(P===h){const{[le.threadId]:oe,...Z}=a.value;a.value=Z,l.value={...l.value,done:l.value.done+1}}}}}const X=Array.from({length:Math.min(rv,L.length)},()=>O());await Promise.all(X)}function U(P){if(!P)return"—";const L=new Date(P),X=Date.now()-L.getTime(),le=Math.floor(X/6e4),oe=Math.floor(X/36e5),Z=Math.floor(X/864e5),E=Math.floor(Z/30);return le<1?"just now":le<60?`${le}m ago`:oe<24?`${oe}h ago`:Z<30?`${Z}d ago`:E<12?`${E}mo ago`:`${Math.floor(E/12)}y ago`}async function S(P){if(confirm(`Unarchive thread "${P.name}" (${P.threadId})?`)){c.value=P.threadId;try{const L=await fetch(`/api/threads/${P.threadId}/unarchive`,{method:"POST",headers:{Authorization:`Bearer ${fe()}`}});if(!L.ok){const O=await L.json().catch(()=>({error:L.statusText}));throw new Error(O.error??L.statusText)}await N()}catch(L){o.value="Failed to unarchive: "+L.message}finally{c.value=null}}}return je(N),(P,L)=>(x(),v("div",Mx,[n("div",Dx,[n("div",Rx,[n("div",null,[L[0]||(L[0]=n("h3",{class:"text-lg font-semibold"},"Archived Threads",-1)),n("p",jx,y(t.value.length)+" archived thread"+y(t.value.length!==1?"s":"")+" — auto-purged after 180 days",1)]),n("div",Lx,[$.value?(x(),v("span",Ux," Building summaries… "+y(l.value.done)+"/"+y(l.value.total),1)):K("",!0),n("button",{onClick:N,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),t.value.length>0?(x(),v("div",Nx,[(x(),v(ne,null,de(["all","root","branch","daily"],O=>n("button",{key:O,onClick:X=>d.value=O,class:Y(["px-3 py-1 rounded-full text-xs font-medium border transition",d.value===O?"bg-accent/20 text-accent border-accent/30":"bg-card border-gray-700 text-textSecondary hover:border-gray-600"])},[Q(y(O==="all"?"All":O.charAt(0).toUpperCase()+O.slice(1))+" ",1),n("span",Bx,"("+y(g.value[O]??0)+")",1)],10,Vx)),64))])):K("",!0)]),s.value&&t.value.length===0?(x(),v("div",Fx,"Loading archived threads…")):o.value?(x(),v("div",Hx,y(o.value),1)):t.value.length===0?(x(),v("div",Kx,"No archived threads")):K("",!0),p.value.length>0?(x(),v("div",Wx,[(x(!0),v(ne,null,de(p.value,O=>{var X,le;return x(),v("div",{key:O.id,class:"glass rounded-xl p-4"},[n("div",zx,[n("div",Jx,[n("div",qx,[n("span",{class:Y(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(X=f[O.type])==null?void 0:X.classes])},y((le=f[O.type])==null?void 0:le.emoji)+" "+y(O.type.toUpperCase()),3),n("span",Yx,y(O.name),1),n("span",Gx,"ID: "+y(O.threadId),1)]),n("div",Zx,[n("span",Qx,"Created "+y(U(O.createdAt)),1),n("span",Xx,"Archived "+y(U(O.archivedAt??O.lastActiveAt)),1),O.client?(x(),v("span",ev,y(O.client),1)):K("",!0)]),r.value[O.threadId]?(x(),v("div",tv,y(r.value[O.threadId]),1)):a.value[O.threadId]?(x(),v("div",sv," Generating summary… ")):K("",!0)]),n("div",nv,[n("button",{onClick:oe=>S(O),disabled:c.value===O.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"},y(c.value===O.threadId?"Restoring…":"↩ Unarchive"),9,ov)])])])}),128))])):K("",!0)]))}}),lv={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/95 backdrop-blur-sm"},iv={class:"glass rounded-2xl p-8 max-w-md w-full mx-4 animate-slide-up"},cv=["disabled"],uv={key:0,class:"mt-3 text-sm text-danger"},dv={key:1,class:"min-h-screen font-sans text-textPrimary animate-fade-in"},fv={class:"glass sticky top-0 z-40 border-b border-gray-800/50"},pv={class:"max-w-7xl mx-auto px-4 sm:px-6 py-4 flex items-center justify-between"},mv={class:"flex items-center gap-4"},xv={class:"text-sm text-textSecondary font-mono"},vv={class:"max-w-7xl mx-auto px-4 sm:px-6 py-6"},gv={class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3"},hv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},bv={class:"text-2xl font-bold font-mono"},yv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},_v={class:"text-2xl font-bold font-mono"},wv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},kv={class:"text-2xl font-bold font-mono"},$v={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Sv={class:"flex items-center gap-2 mb-2"},Cv={class:"text-2xl font-bold font-mono"},Tv={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Ev={class:"text-2xl font-bold font-mono"},Pv={class:"max-w-7xl mx-auto px-4 sm:px-6"},Av={class:"flex gap-6 border-b border-gray-800/50 mb-6"},Iv=["onClick"],Ov={class:"max-w-7xl mx-auto px-4 sm:px-6 pb-12"},vs="sensorium_token",Mv=Ne({__name:"App",setup(e){const t=_(!1),s=_(""),o=_(""),r=_(!1),a=_(null),l=_("sessions");let c=null;const d=[{id:"sessions",label:"Sessions"},{id:"notes",label:"Memory Notes"},{id:"templates",label:"Templates"},{id:"skills",label:"Skills"},{id:"agents",label:"Agents"},{id:"threads",label:"Threads"},{id:"archived",label:"Archived"},{id:"mcp",label:"MCP Servers"},{id:"prompts",label:"Prompts"},{id:"snapshots",label:"Snapshots"},{id:"claude",label:"Claude"},{id:"copilot",label:"Copilot"},{id:"settings",label:"Settings"}],h={sessions:ri,notes:ki,templates:nc,skills:Hc,agents:pf,threads:jd,archived:av,mcp:ep,prompts:xp,snapshots:Ox,claude:Gp,copilot:Bm,settings:ix},f=Ee(()=>h[l.value]),p=Ee(()=>{if(!a.value)return"—";const U=Math.floor(a.value.uptime),S=Math.floor(U/86400),P=Math.floor(U%86400/3600),L=Math.floor(U%3600/60);return S>0?`${S}d ${P}h`:P>0?`${P}h ${L}m`:`${L}m`});async function g(){const U=s.value.trim()||"no-auth";r.value=!0,o.value="";try{qt(U),await N(),localStorage.setItem(vs,U),t.value=!0,C()}catch(S){const P=S;P.status===401?o.value="Invalid token":o.value=P.message??"Connection failed",qt("")}finally{r.value=!1}}function $(){localStorage.removeItem(vs),t.value=!1,s.value="",a.value=null,c&&clearInterval(c),qt("")}async function N(){a.value=await ve("/api/status")}function C(){c&&clearInterval(c),c=setInterval(N,3e4)}return je(async()=>{const U=localStorage.getItem(vs);if(U){s.value=U;try{qt(U),await N(),t.value=!0,C()}catch{localStorage.removeItem(vs),qt("")}}}),wn(()=>{c&&clearInterval(c)}),(U,S)=>{var P,L,O,X,le,oe,Z,E,F;return t.value?(x(),v("div",dv,[n("header",fv,[n("div",pv,[S[3]||(S[3]=ut('<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)),n("div",mv,[S[2]||(S[2]=n("div",{class:"flex items-center gap-2 text-sm"},[n("span",{class:"w-2 h-2 rounded-full bg-success animate-pulse-slow"}),n("span",{class:"text-textSecondary"},"Connected")],-1)),n("div",xv,y(p.value),1),n("button",{onClick:$,class:"text-sm text-muted hover:text-textSecondary transition"},"Disconnect")])])]),n("div",vv,[n("div",gv,[n("div",hv,[S[4]||(S[4]=ut('<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)),n("div",bv,y(((P=a.value)==null?void 0:P.activeSessions)??0),1)]),n("div",yv,[S[5]||(S[5]=ut('<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)),n("div",_v,y(((O=(L=a.value)==null?void 0:L.memory)==null?void 0:O.totalSemanticNotes)??0),1)]),n("div",wv,[S[6]||(S[6]=ut('<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)),n("div",kv,y(((le=(X=a.value)==null?void 0:X.memory)==null?void 0:le.totalEpisodes)??0),1)]),n("div",$v,[n("div",Sv,[n("span",{class:Y((((Z=(oe=a.value)==null?void 0:oe.memory)==null?void 0:Z.unconsolidatedEpisodes)??0)>10?"text-danger":"text-success")},[...S[7]||(S[7]=[n("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[n("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),S[8]||(S[8]=n("span",{class:"text-xs text-textSecondary font-medium uppercase tracking-wider"},"Unconsolidated",-1))]),n("div",Cv,y(((F=(E=a.value)==null?void 0:E.memory)==null?void 0:F.unconsolidatedEpisodes)??0),1)]),n("div",Tv,[S[9]||(S[9]=ut('<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)),n("div",Ev,y(p.value),1)])])]),n("div",Pv,[n("nav",Av,[(x(),v(ne,null,de(d,V=>n("button",{key:V.id,onClick:w=>l.value=V.id,class:Y(["pb-3 text-sm font-medium transition",l.value===V.id?"tab-active":"tab-inactive"])},y(V.label),11,Iv)),64))])]),n("div",Ov,[(x(),fr(Pa(f.value),{status:a.value},null,8,["status"]))])])):(x(),v("div",lv,[n("div",iv,[S[1]||(S[1]=ut('<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)),G(n("input",{"onUpdate:modelValue":S[0]||(S[0]=V=>s.value=V),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:Xe(g,["enter"])},null,544),[[ee,s.value]]),n("button",{onClick:g,disabled:r.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"},y(r.value?"Connecting...":"Connect"),9,cv),o.value?(x(),v("p",uv,y(o.value),1)):K("",!0)])]))}}});Fl(Mv).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">