(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var e={},t=Symbol(`uninitialized`),n=`http://www.w3.org/1999/xhtml`,r=Array.isArray,i=Array.prototype.indexOf,a=Array.prototype.includes,o=Array.from,s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyDescriptors,u=Object.prototype,d=Array.prototype,f=Object.getPrototypeOf,p=Object.isExtensible,m=()=>{};function h(e){for(var t=0;t{e=n,t=r}),resolve:e,reject:t}}var _=1024,v=2048,y=4096,b=8192,x=16384,S=32768,C=1<<25,w=65536,T=1<<19,ee=1<<20,te=1<<25,ne=65536,re=1<<21,ie=1<<22,ae=1<<23,oe=Symbol(`$state`),se=Symbol(`legacy props`),ce=Symbol(``),le=Symbol(`attributes`),ue=Symbol(`class`),de=Symbol(`style`),fe=Symbol(`text`),pe=Symbol(`form reset`),me=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},he=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function ge(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function _e(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function ve(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function ye(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function be(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function xe(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Se(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Ce(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function we(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Te(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Ee(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function De(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}function Oe(){console.warn(`https://svelte.dev/e/derived_inert`)}function ke(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Ae(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var E=!1;function je(e){E=e}var D;function O(t){if(t===null)throw ke(),e;return D=t}function Me(){return O(on(D))}function k(t){if(E){if(on(D)!==null)throw ke(),e;D=t}}function Ne(e=1){if(E){for(var t=e,n=D;t--;)n=on(n);D=n}}function Pe(e=!0){for(var t=0,n=D;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=on(n);e&&n.remove(),n=i}}function Fe(t){if(!t||t.nodeType!==8)throw ke(),e;return t.data}function Ie(e){return e===this.v}function Le(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Re(e){return!Le(e,this.v)}var ze=!1,Be=!1,A=null;function Ve(e){A=e}function He(e,t=!1,n){A={p:A,i:!1,c:null,e:null,s:e,x:null,r:W,l:Be&&!t?{s:null,u:null,$:[]}:null}}function Ue(e){var t=A,n=t.e;if(n!==null){t.e=null;for(var r of n)Cn(r)}return e!==void 0&&(t.x=e),t.i=!0,A=t.p,e??{}}function We(){return!Be||A!==null&&A.l===null}var Ge=[];function Ke(){var e=Ge;Ge=[],h(e)}function qe(e){if(Ge.length===0&&!Et){var t=Ge;queueMicrotask(()=>{t===Ge&&Ke()})}Ge.push(e)}function Je(){for(;Ge.length>0;)Ke()}function Ye(e){var t=W;if(t===null)return H.f|=ae,e;if(!(t.f&32768)&&!(t.f&4))throw e;Xe(e,t)}function Xe(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}var Ze=~(v|y|_);function j(e,t){e.f=e.f&Ze|t}function Qe(e){e.f&512||e.deps===null?j(e,_):j(e,y)}function $e(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=ne,$e(t.deps))}function et(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),$e(e.deps),j(e,_)}var tt=!1,nt=!1;function rt(e){var t=nt;try{return nt=!1,[e(),nt]}finally{nt=t}}function it(e){let t=0,n=Gt(0),r;return()=>{bn()&&(J(n),Dn(()=>(t===0&&(r=cr(()=>e(()=>Xt(n)))),t+=1,()=>{qe(()=>{--t,t===0&&(r?.(),r=void 0,Xt(n))})})))}}var at=w|T;function ot(e,t,n,r){new st(e,t,n,r)}var st=class{parent;is_pending=!1;transform_error;#e;#t=E?D:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=it(()=>(this.#m=Gt(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=W;t.b=this,t.f|=128,n(e)},this.parent=W.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=On(()=>{if(E){let e=this.#t;Me();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},at),E&&(this.#e=D)}#g(){try{this.#a=B(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=B(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=B(()=>e(this.#e)),qe(()=>{var e=this.#c=document.createDocumentFragment(),t=I();e.append(t),this.#a=this.#x(()=>B(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,Pn(this.#o,()=>{this.#o=null}),this.#b(M))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=B(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Rn(this.#a,e);let t=this.#n.pending;this.#o=B(()=>t(this.#e))}else this.#b(M)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){et(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=W,n=H,r=A;Wn(this.#i),U(this.#i),Ve(this.#i.ctx);try{return Mt.ensure(),e()}catch(e){return Ye(e),null}finally{Wn(t),U(n),Ve(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&Pn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,qe(()=>{this.#d=!1,this.#m&&qt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),J(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;M?.is_fork?(this.#a&&M.skip_effect(this.#a),this.#o&&M.skip_effect(this.#o),this.#s&&M.skip_effect(this.#s),M.oncommit(()=>{this.#C(e)})):this.#C(e)}#C(e){this.#a&&=(V(this.#a),null),this.#o&&=(V(this.#o),null),this.#s&&=(V(this.#s),null),E&&(O(this.#t),Ne(),O(Pe()));var t=this.#n.onerror;let n=this.#n.failed;var r=!1,i=!1;let a=()=>{if(r){Ae();return}r=!0,i&&De(),this.#s!==null&&Pn(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){Xe(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return B(()=>{var t=W;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return Xe(e,this.#i.parent),null}}))};qe(()=>{var t;try{t=this.transform_error(e)}catch(e){Xe(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>Xe(e,this.#i&&this.#i.parent)):o(t)})}};function ct(e,t,n,r){let i=We()?ft:gt;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=W,c=lt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){Xe(e,s)}ut()}}var d=dt();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>mt(e))).then(u).catch(e=>Xe(e,s)).finally(d)}l?l.then(()=>{c(),f(),ut()}):f()}function lt(){var e=W,t=H,n=A,r=M;return function(i=!0){Wn(e),U(t),Ve(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function ut(e=!0){Wn(null),U(null),Ve(null),e&&M?.deactivate()}function dt(){var e=W,t=e.b,n=M,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function ft(e){var n=2|v;return W!==null&&(W.f|=T),{ctx:A,deps:null,effects:null,equals:Ie,f:n,fn:e,reactions:null,rv:0,v:t,wv:0,parent:W,ac:null}}var pt=Symbol(`obsolete`);function mt(e,n,r){let i=W;i===null&&_e();var a=void 0,o=Gt(t),s=!H,c=new Set;return En(()=>{var t=W,n=g();a=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==me&&n.reject(e)}).finally(ut)}catch(e){n.reject(e),ut()}var r=M;if(s){if(t.f&32768)var l=dt();if(i.b?.is_rendered())r.async_deriveds.get(t)?.reject(pt);else for(let e of c.values())e.reject(pt);c.add(n),r.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),c.delete(n),t!==pt&&(r.activate(),t?(o.f|=ae,qt(o,t)):(o.f&8388608&&(o.f^=ae),qt(o,e)),r.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),xn(()=>{for(let e of c)e.reject(pt)}),new Promise(e=>{function t(n){function r(){n===a?e(o):t(a)}n.then(r,r)}t(a)})}function ht(e){let t=ft(e);return ze||Kn(t),t}function gt(e){let t=ft(e);return t.equals=Re,t}function _t(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;nthis.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)j(r,v),t(r);for(r of n.m)j(r,y),t(r)}this.#p.add(e)}#g(){this.#e=!0,At++>1e3&&(this.#S(),Pt());for(let e of this.#u)this.#d.delete(e),j(e,v),this.schedule(e);for(let e of this.#d)j(e,y),this.schedule(e);let t=this.#c;this.#c=[],this.apply();var n=Ot=[],r=[],i=kt=[];for(let e of t)try{this.#_(e,n,r)}catch(t){throw Vt(e),this.#h()||this.discard(),t}if(M=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(Ot=null,kt=null,this.#h()){this.#b(r),this.#b(n);for(let[e,t]of this.#f)Bt(e,t);i.length>0&&M.#g();return}let o=this.#v();if(o){this.#b(r),this.#b(n),o.#y(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),wt=this,It(r),It(n),wt=null,this.#s?.resolve();var s=M;if(this.#a===0&&(this.#c.length===0||s!==null)&&(this.#S(),ze&&(this.#x(),M=s)),this.#c.length>0)if(s!==null){let e=s;e.#c.push(...this.#c.filter(t=>!e.#c.includes(t)))}else s=this;s!==null&&s.#g()}#_(e,t,n){e.f^=_;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=_:i&4?t.push(r):ze&&i&16777224?n.push(r):$n(r)&&(i&16&&this.#d.add(r),ir(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#v(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#y(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null)for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),j(i,v),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),M=this,this.#g()}#b(e){for(var t=0;t!u.current.get(e)[1]);if(!(!u.#e||r.length===0)){var i=r.filter(e=>!this.current.has(e));if(i.length===0)e&&u.discard();else if(t.length>0){if(e)for(let e of this.#p)u.unskip_effect(e,e=>{e.f&4194320?u.schedule(e):u.#b([e])});u.activate();var a=new Set,o=new Map;for(var s of t)Lt(s,i,a,o);o=new Map;var c=[...u.current].filter(([e,t])=>{let n=this.current.get(e);return n?n[0]!==t[0]||n[1]!==t[1]:!0}).map(([e])=>e);if(c.length>0)for(let e of this.#l)!(e.f&155648)&&Rt(e,c,o)&&(e.f&4194320?(j(e,v),u.schedule(e)):u.#u.add(e));if(u.#c.length>0&&!u.#m){u.apply();for(var l of u.#c)u.#_(l,[],[]);u.#c=[]}u.deactivate()}}}}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,qe(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=g()).promise}static ensure(){if(M===null){let t=M=new e;!Dt&&!Et&&qe(()=>{t.#e||t.flush()})}return M}apply(){if(!ze||!this.is_fork&&this.#t===null&&this.#n===null){N=null;return}N=new Map;for(let[e,[t]]of this.current)N.set(e,t);for(let t=St;t!==null;t=t.#n)if(!(t===this||t.is_fork)){var e=!1;if(t.id0)){Ut.clear();for(let e of Ft){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Ft.has(n)&&(Ft.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||ir(n)}}Ft.clear()}}Ft=null}}function Lt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?Lt(i,t,n,r):e&4194320&&!(e&2048)&&Rt(i,t,r)&&(j(i,v),zt(i))}}function Rt(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(a.call(t,r))return!0;if(r.f&2&&Rt(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function zt(e){M.schedule(e)}function Bt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),j(e,_);for(var n=e.first;n!==null;)Bt(n,t),n=n.next}}function Vt(e){j(e,_);for(var t=e.first;t!==null;)Vt(t),t=t.next}var Ht=new Set,Ut=new Map,Wt=!1;function Gt(e,t){return{f:0,v:e,reactions:null,equals:Ie,rv:0,wv:0}}function P(e,t){let n=Gt(e,t);return Kn(n),n}function Kt(e,t=!1,n=!0){let r=Gt(e);return t||(r.equals=Re),Be&&n&&A!==null&&A.l!==null&&(A.l.s??=[]).push(r),r}function F(e,t,n=!1){return H!==null&&(!Un||H.f&131072)&&We()&&H.f&4325394&&(Gn===null||!Gn.has(e))&&Ee(),qt(e,n?Qt(t):t,kt)}function qt(e,t,n=null){if(!e.equals(t)){Ut.set(e,Vn?t:e.v);var r=Mt.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&vt(t),N===null&&Qe(t)}e.wv=Qn(),Zt(e,v,n),We()&&W!==null&&W.f&1024&&!(W.f&96)&&(q===null?qn([e]):q.push(e)),!r.is_fork&&Ht.size>0&&!Wt&&Jt()}return t}function Jt(){Wt=!1;for(let e of Ht){e.f&1024&&j(e,y);let t;try{t=$n(e)}catch{t=!0}t&&ir(e)}Ht.clear()}function Yt(e,t=1){var n=J(e),r=t===1?n++:n--;return F(e,n),r}function Xt(e){F(e,e.v+1)}function Zt(e,t,n){var r=e.reactions;if(r!==null)for(var i=We(),a=r.length,o=0;o{if(Xn===l)return e();var t=H,n=Xn;U(null),Zn(l);var r=e();return U(t),Zn(n),r};return a&&i.set(`length`,P(e.length,s)),new Proxy(e,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&we();var r=i.get(t);return r===void 0?p(()=>{var e=P(n.value,s);return i.set(t,e),e}):F(r,n.value,!0),!0},deleteProperty(e,n){var r=i.get(n);if(r===void 0){if(n in e){let e=p(()=>P(t,s));i.set(n,e),Xt(o)}}else F(r,t),Xt(o);return!0},get(n,r,a){if(r===oe)return e;var o=i.get(r),l=r in n;if(o===void 0&&(!l||c(n,r)?.writable)&&(o=p(()=>P(Qt(l?n[r]:t),s)),i.set(r,o)),o!==void 0){var u=J(o);return u===t?void 0:u}return Reflect.get(n,r,a)},getOwnPropertyDescriptor(e,n){var r=Reflect.getOwnPropertyDescriptor(e,n);if(r&&`value`in r){var a=i.get(n);a&&(r.value=J(a))}else if(r===void 0){var o=i.get(n),s=o?.v;if(o!==void 0&&s!==t)return{enumerable:!0,configurable:!0,value:s,writable:!0}}return r},has(e,n){if(n===oe)return!0;var r=i.get(n),a=r!==void 0&&r.v!==t||Reflect.has(e,n);return(r!==void 0||W!==null&&(!a||c(e,n)?.writable))&&(r===void 0&&(r=p(()=>P(a?Qt(e[n]):t,s)),i.set(n,r)),J(r)===t)?!1:a},set(e,n,r,l){var u=i.get(n),d=n in e;if(a&&n===`length`)for(var f=r;fP(t,s)),i.set(f+``,m)):F(m,t)}if(u===void 0)(!d||c(e,n)?.writable)&&(u=p(()=>P(void 0,s)),F(u,Qt(r)),i.set(n,u));else{d=u.v!==t;var h=p(()=>Qt(r));F(u,h)}var g=Reflect.getOwnPropertyDescriptor(e,n);if(g?.set&&g.set.call(l,r),!d){if(a&&typeof n==`string`){var _=i.get(`length`),v=Number(n);Number.isInteger(v)&&v>=_.v&&F(_,v+1)}Xt(o)}return!0},ownKeys(e){J(o);var n=Reflect.ownKeys(e).filter(e=>{var n=i.get(e);return n===void 0||n.v!==t});for(var[r,a]of i)a.v!==t&&!(r in e)&&n.push(r);return n},setPrototypeOf(){Te()}})}new Set([`copyWithin`,`fill`,`pop`,`push`,`reverse`,`shift`,`sort`,`splice`,`unshift`]);var $t,en,tn,nn;function rn(){if($t===void 0){$t=window,en=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;tn=c(t,`firstChild`).get,nn=c(t,`nextSibling`).get,p(e)&&(e[ue]=void 0,e[le]=null,e[de]=void 0,e.__e=void 0),p(n)&&(n[fe]=void 0)}}function I(e=``){return document.createTextNode(e)}function an(e){return tn.call(e)}function on(e){return nn.call(e)}function L(e,t){if(!E)return an(e);var n=an(D);if(n===null)n=D.appendChild(I());else if(t&&n.nodeType!==3){var r=I();return n?.before(r),O(r),r}return t&&dn(n),O(n),n}function sn(e,t=!1){if(!E){var n=an(e);return n instanceof Comment&&n.data===``?on(n):n}if(t){if(D?.nodeType!==3){var r=I();return D?.before(r),O(r),r}dn(D)}return D}function R(e,t=1,n=!1){let r=E?D:e;for(var i;t--;)i=r,r=on(r);if(!E)return r;if(n){if(r?.nodeType!==3){var a=I();return r===null?i?.after(a):r.before(a),O(a),a}dn(r)}return O(r),r}function cn(e){e.textContent=``}function ln(){return!ze||Ft!==null?!1:(W.f&S)!==0}function un(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function dn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function fn(e){E&&an(e)!==null&&cn(e)}var pn=!1;function mn(){pn||(pn=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[pe]?.()})},{capture:!0}))}function hn(e){var t=H,n=W;U(null),Wn(null);try{return e()}finally{U(t),Wn(n)}}function gn(e,t,n,r=n){e.addEventListener(t,()=>hn(n));let i=e[pe];i?e[pe]=()=>{i(),r(!0)}:e[pe]=()=>r(!0),mn()}function _n(e){W===null&&(H===null&&xe(e),be()),Vn&&ye(e)}function vn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function yn(e,t){var n=W;n!==null&&n.f&8192&&(e|=b);var r={ctx:A,deps:null,nodes:null,f:e|v|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};M?.register_created_effect(r);var i=r;if(e&4)Ot===null?Mt.ensure().schedule(r):Ot.push(r);else if(t!==null){try{ir(r)}catch(e){throw V(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=w))}if(i!==null&&(i.parent=n,n!==null&&vn(i,n),H!==null&&H.f&2&&!(e&64))){var a=H;(a.effects??=[]).push(i)}return r}function bn(){return H!==null&&!Un}function xn(e){let t=yn(8,null);return j(t,_),t.teardown=e,t}function Sn(e){_n(`$effect`);var t=W.f;if(!H&&t&32&&A!==null&&!A.i){var n=A;(n.e??=[]).push(e)}else return Cn(e)}function Cn(e){return yn(4|ee,e)}function wn(e){Mt.ensure();let t=yn(64|T,e);return(e={})=>new Promise(n=>{e.outro?Pn(t,()=>{V(t),n(void 0)}):(V(t),n(void 0))})}function Tn(e){return yn(4,e)}function En(e){return yn(ie|T,e)}function Dn(e,t=0){return yn(8|t,e)}function z(e,t=[],n=[],r=[]){ct(r,t,n,t=>{yn(8,()=>{e(...t.map(J))})})}function On(e,t=0){return yn(16|t,e)}function B(e){return yn(32|T,e)}function kn(e){var t=e.teardown;if(t!==null){let e=Vn,n=H;Hn(!0),U(null);try{t.call(null)}finally{Hn(e),U(n)}}}function An(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&hn(()=>{e.abort(me)});var r=n.next;n.f&64?n.parent=null:V(n,t),n=r}}function jn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||V(t),t=n}}function V(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Mn(e.nodes.start,e.nodes.end),n=!0),e.f|=C,An(e,t&&!n),rr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();kn(e),e.f^=C,e.f|=x;var i=e.parent;i!==null&&i.first!==null&&Nn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Mn(e,t){for(;e!==null;){var n=e===t?null:on(e);e.remove(),e=n}}function Nn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Pn(e,t,n=!0){var r=[];Fn(e,r,!0);var i=()=>{n&&V(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Fn(e,t,n){if(!(e.f&8192)){e.f^=b;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;Fn(i,t,o?n:!1)}i=a}}}function In(e){Ln(e,!0)}function Ln(e,t){if(e.f&8192){e.f^=b,e.f&1024||(j(e,v),Mt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;Ln(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Rn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:on(n);t.append(n),n=i}}var zn=null,Bn=!1,Vn=!1;function Hn(e){Vn=e}var H=null,Un=!1;function U(e){H=e}var W=null;function Wn(e){W=e}var Gn=null;function Kn(e){H!==null&&(!ze||H.f&2)&&(Gn??=new Set).add(e)}var G=null,K=0,q=null;function qn(e){q=e}var Jn=1,Yn=0,Xn=Yn;function Zn(e){Xn=e}function Qn(){return++Jn}function $n(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~ne),t&4096){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}t&512&&N===null&&j(e,_)}return!1}function er(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!ze&&Gn!==null&&Gn.has(e)))for(var i=0;i{e.ac.abort(me)}),e.ac=null);try{e.f|=re;var u=e.fn,d=u();e.f|=S;var f=e.deps,p=M?.is_fork;if(G!==null){var m;if(p||rr(e,K),f!==null&&K>0)for(f.length=K+G.length,m=0;m{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),Nt()}function J(e){var t=(e.f&2)!=0;if(zn?.add(e),H!==null&&!Un&&!(W!==null&&W.f&16384)&&(Gn===null||!Gn.has(e))){var n=H.deps;if(H.f&2097152)e.rvn?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?qe(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function pr(e,t,n,r,i){var a={capture:r,passive:i},o=fr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&xn(()=>{t.removeEventListener(e,o,a)})}function Y(e,t,n){(t[lr]??={})[e]=n}function mr(e){for(var t=0;t{throw e});throw p}}finally{e[lr]=t,delete e.currentTarget,U(d),Wn(f)}}}var _r=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function vr(e){return _r?.createHTML(e)??e}function yr(e){var t=un(`template`);return t.innerHTML=vr(e.replaceAll(``,``)),t.content}function br(e,t){var n=W;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function X(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(``);return()=>{if(E)return br(D,null),D;i===void 0&&(i=yr(a?e:``+e),n||(i=an(i)));var t=r||en?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=an(t),s=t.lastChild;br(o,s)}else br(t,t);return t}}function xr(e=``){if(!E){var t=I(e+``);return br(t,t),t}var n=D;return n.nodeType===3?dn(n):(n.before(n=I()),O(n)),br(n,n),n}function Sr(){if(E)return br(D,null),D;var e=document.createDocumentFragment(),t=document.createComment(``),n=I();return e.append(t,n),br(t,n),e}function Z(e,t){if(E){var n=W;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=D),Me();return}e!==null&&e.before(t)}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var Cr=[`touchstart`,`touchmove`];function wr(e){return Cr.includes(e)}function Q(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[fe]??=e.nodeValue)&&(e[fe]=n,e.nodeValue=`${n}`)}function Tr(e,t){return Dr(e,t)}var Er=new Map;function Dr(t,{target:n,anchor:r,props:i={},events:a,context:s,intro:c=!0,transformError:l}){rn();var u=void 0,d=wn(()=>{var c=r??n.appendChild(I());ot(c,{pending:()=>{}},n=>{He({});var r=A;if(s&&(r.c=s),a&&(i.$$events=a),E&&br(n,null),u=t(n,i)||{},E&&(W.nodes.end=D,D===null||D.nodeType!==8||D.data!==`]`))throw ke(),e;Ue()},l);var d=new Set,f=e=>{for(var t=0;t{for(var e of d)for(let r of[n,document]){var t=Er.get(r),i=t.get(e);--i==0?(r.removeEventListener(e,gr),t.delete(e),t.size===0&&Er.delete(r)):t.set(e,i)}dr.delete(f),c!==r&&c.parentNode?.removeChild(c)}});return Or.set(u,d),u}var Or=new WeakMap,kr=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)In(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(In(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(V(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Rn(r,t),t.append(I()),this.#n.set(e,{effect:r,fragment:t})}else V(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Pn(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(V(n.effect),this.#n.delete(e))};ensure(e,t){var n=M,r=ln();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=I();i.append(a),this.#n.set(e,{effect:B(()=>t(a)),fragment:i})}else this.#t.set(e,B(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else E&&(this.anchor=D),this.#a(n)}};function Ar(e){A===null&&ge(`onMount`),Be&&A.l!==null?Mr(A).m.push(e):Sn(()=>{let t=cr(e);if(typeof t==`function`)return t})}function jr(e){A===null&&ge(`onDestroy`),Ar(()=>()=>cr(e))}function Mr(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}function $(e,t,n=!1){var r;E&&(r=D,Me());var i=new kr(e),a=n?w:0;function o(e,t){if(E){var n=Fe(r);if(e!==parseInt(n.substring(1))){var a=Pe();O(a),i.anchor=a,je(!1),i.ensure(e,t),je(!0);return}}i.ensure(e,t)}On(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function Nr(e,t){return t}function Pr(e,t,n){for(var r=[],i=t.length,a,s=t.length,c=0;c{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;Fr(e,o(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else --s},!1)}if(s===0){var l=r.length===0&&n!==null;if(l){var u=n,d=u.parentNode;cn(d),d.append(u),e.items.clear()}Fr(e,t,!l)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Fr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i{var e=n();return r(e)?e:e==null?[]:o(e)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,zr(v,p,c,t,i),d!==null&&(p.length===0?d.f&33554432?(d.f^=te,Vr(d,null,c)):In(d):Pn(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:On(()=>{p=J(f);var e=p.length;let r=!1;E&&Fe(c)===`[!`!=(e===0)&&(c=Pe(),O(c),je(!1),r=!0);for(var o=new Set,u=M,v=ln(),y=0;ys(c)):(d=B(()=>s(Ir??=I())),d.f|=te)),e>o.size&&ve(``,``,``),E&&e>0&&O(Pe()),!h)if(m.set(u,o),v){for(let[e,t]of l)o.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u);r&&je(!0),J(f)}),flags:t,items:l,pending:m,outrogroups:null,fallback:d};h=!1,E&&(c=D)}function Rr(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function zr(e,t,n,r,i){var a=(r&8)!=0,s=t.length,c=e.items,l=Rr(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(a)for(v=0;v0){var ee=r&4&&s===0?n:null;if(a){for(v=0;v{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function Br(e,t,n,r,i,a,o,s){var c=o&1?o&16?Gt(n):Kt(n,!1,!1):null,l=o&2?Gt(i):null;return{v:c,i:l,e:B(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Vr(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=on(r);if(a.before(r),r===i)return;r=o}}function Hr(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}var Ur=[...` \r\f\xA0\v`];function Wr(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Ur.includes(r[o-1]))&&(s===r.length||Ur.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Gr(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Kr(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function qr(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Kr)),i&&c.push(...Object.keys(i).map(Kr));var l=0,u=-1;let t=e.length;for(var d=0;d{var a=i?e.defaultValue:e.value;if(a=ai(e)?oi(a):a,n(a),M!==null&&r.add(M),await ar(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(E&&e.defaultValue!==e.value||cr(t)==null&&e.value)&&(n(ai(e)?oi(e.value):e.value),M!==null&&r.add(M)),Dn(()=>{var n=t();if(e===document.activeElement){var i=ze?wt:M;if(r.has(i))return}ai(e)&&n===oi(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function ai(e){var t=e.type;return t===`number`||t===`range`}function oi(e){return e===``?null:+e}function si(e,t){return e===t||e?.[oe]===t}function ci(e={},t,n,r){var i=A.r,a=W;return Tn(()=>{var o,s;return Dn(()=>{o=s,s=r?.()||[],cr(()=>{si(n(...s),e)||(t(e,...s),o&&si(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&si(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function li(e,t,n,r){var i=!Be||(n&2)!=0,a=(n&8)!=0,o=(n&16)!=0,s=r,l=!0,u=void 0,d=()=>o&&i?(u??=ft(r),J(u)):(l&&(l=!1,s=o?cr(r):r),s);let f;if(a){var p=oe in e||se in e;f=c(e,t)?.set??(p&&t in e?n=>e[t]=n:void 0)}var m,h=!1;a?[m,h]=rt(()=>e[t]):m=e[t],m===void 0&&r!==void 0&&(m=d(),f&&(i&&Ce(t),f(m)));var g=i?()=>{var n=e[t];return n===void 0?d():(l=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return g;if(f){var _=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||_||h)&&f(t?g():e),e):g()})}var v=!1,y=(n&1?ft:gt)(()=>(v=!1,g()));a&&J(y);var b=W;return(function(e,t){if(arguments.length>0){let n=t?J(y):i&&a?Qt(e):e;return F(y,n),v=!0,s!==void 0&&(s=n),e}return Vn&&v||b.f&16384?y.v:J(y)})}var ui=`breakglass.session_id`;function di(){try{return localStorage.getItem(ui)||``}catch{return``}}function fi(e){try{e?localStorage.setItem(ui,e):localStorage.removeItem(ui)}catch{}}function pi(){fi(``)}async function mi(){let e=await fetch(`/api/session`,{method:`POST`,headers:{"content-type":`application/json`}});if(!e.ok)throw Error(`could not open a session (HTTP ${e.status})`);let t=await e.json();if(!t||typeof t.session_id!=`string`)throw Error(`session response missing session_id`);return t.session_id}function hi(e,{onEvent:t,onCaughtUp:n,onOpen:r,onError:i}){let a=new EventSource(`/api/session/${encodeURIComponent(e)}/stream`);return a.onopen=()=>r?.(),a.onmessage=e=>{if(!e||typeof e.data!=`string`||e.data===``)return;let n;try{n=JSON.parse(e.data)}catch{return}(n.id==null||n.id===``)&&e.lastEventId&&(n.id=e.lastEventId),t(n)},a.addEventListener(`caught-up`,()=>n?.()),a.onerror=e=>{i?.(e)},a}async function gi({session_id:e,prompt:t,model:n}){let r={prompt:t};n&&(r.model=n);let i=await fetch(`/api/session/${encodeURIComponent(e)}/prompt`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(r)});if(i.status===409)return{status:`busy`};if(i.status===404)return{status:`gone`};if(!i.ok)throw Error(`could not start the turn (HTTP ${i.status})`);return{status:`started`}}async function _i(e){let t=await fetch(`/api/session/${encodeURIComponent(e)}/cancel`,{method:`POST`,headers:{"content-type":`application/json`}});if(!t.ok)throw Error(`could not stop the turn (HTTP ${t.status})`);return!!(await t.json().catch(()=>({}))).cancelled}async function vi(){let e=await fetch(`/api/pve/verbs`);if(!e.ok)throw Error(`could not load VM controls (HTTP ${e.status})`);let t=await e.json();return{verbs:Array.isArray(t.verbs)?t.verbs:[],mutating:Array.isArray(t.mutating)?t.mutating:[]}}async function yi(e){let t=await fetch(`/api/pve/${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`}}),n;try{n=await t.json()}catch{throw Error(`VM control '${e}' failed (HTTP ${t.status}, no body)`)}if(t.status===400)throw Error(n?.detail||`'${e}' was rejected by the server`);return{verb:n.verb??e,exit_code:n.exit_code??null,stdout:n.stdout??``,stderr:n.stderr??``,rejected:!!n.rejected}}function bi(e,t){let n=Number(e),r=Number(t);return Number.isFinite(n)&&Number.isFinite(r)&&`${e}`.trim()!==``&&`${t}`.trim()!==``?n>r:String(e)>String(t)}function xi(){return{messages:[],maxId:null,sawId:!1,openAssistant:null,activeUserSeen:!1}}function Si(e,t,n){return t!=null&&`${t}`.trim()!==``?`${e}:${t}`:`${e}:idx:${n}`}function Ci(e,t){return t==null||`${t}`.trim()===``?{apply:!0,maxId:e}:e==null||bi(t,e)?{apply:!0,maxId:t}:{apply:!1,maxId:e}}function wi(e,t){if(!t||typeof t!=`object`)return!1;let{apply:n,maxId:r}=Ci(e.maxId,t.id);if(e.maxId=r,!n)return!1;t.id!=null&&`${t.id}`.trim()!==``&&(e.sawId=!0);let i=()=>{if(!e.openAssistant){let n={role:`assistant`,key:Si(`a`,t.id,e.messages.length),parts:[],ended:!1};e.messages.push(n),e.openAssistant=n}return e.openAssistant};switch(t.kind){case`user`:return e.openAssistant=null,e.messages.push({role:`user`,key:Si(`u`,t.id,e.messages.length),text:typeof t.text==`string`?t.text:``}),e.activeUserSeen=!0,!0;case`session`:return i(),!0;case`text`:{if(typeof t.text!=`string`||t.text===``)return!1;let e=i(),n=e.parts[e.parts.length-1];return n&&n.type===`text`?n.text+=t.text:e.parts.push({type:`text`,text:t.text}),!0}case`tool`:{let e=i(),n=t.input&&typeof t.input.command==`string`?t.input.command:``;return e.parts.push({type:`tool`,name:typeof t.name==`string`&&t.name?t.name:`tool`,command:n,raw:t.input??null}),!0}case`result`:{let e=i();return e.result={is_error:!!t.is_error,text:typeof t.result==`string`?t.result:``,duration_ms:typeof t.duration_ms==`number`?t.duration_ms:null},!0}case`error`:{let e=i();return e.error=typeof t.error==`string`&&t.error?t.error:`unknown error`,!0}case`cancelled`:{let e=i();return e.cancelled=!0,!0}case`turn_end`:return e.openAssistant&&(e.openAssistant.ended=!0),e.openAssistant=null,e.activeUserSeen=!1,!0;default:return!1}}var Ti=X(` `,1),Ei=X(` `);function Di(e,t){let n=li(t,`name`,3,`tool`),r=li(t,`command`,3,``);var i=Ei(),a=R(L(i),2),o=L(a,!0);k(a);var s=R(a,2),c=e=>{var t=Ti(),n=R(sn(t),2),i=L(n,!0);k(n),z(()=>Q(i,r())),Z(e,t)};$(s,e=>{r()&&e(c)}),k(i),z(()=>{ei(i,`title`,r()?`${n()}: ${r()}`:n()),Q(o,n())}),Z(e,i)}var Oi=X(`The cluster or network may be down. You can still power-cycle the VM with ⚡ Direct VM control — it needs no agent.`,1),ki=X(`Tap a preset below or describe the symptom — "devvm unreachable", "disk full", "ssh hangs" — and it will connect over SSH, investigate, and stream its work here. For a hard power action, use ⚡ Direct VM control.`,1),Ai=X(`

`),ji=X(`
`),Mi=X(``),Ni=X(` `),Pi=X(`
error
`),Fi=X(`
stopped turn cancelled
`),Ii=X(` `),Li=X(` `),Ri=X(`
`),zi=X(`
`),Bi=X(``),Vi=X(`
agent working — streaming live
`),Hi=X(``),Ui=X(``),Wi=X(`
Recovery agent SSHes into the devvm to diagnose & repair
`);function Gi(e,t){He(t,!0);let n=li(t,`rev`,3,0),r=li(t,`caughtUp`,3,!1),i=li(t,`turnActive`,3,!1),a=li(t,`sending`,3,!1),o=li(t,`linkState`,3,`connecting`),s=li(t,`onSubmit`,3,e=>{}),c=li(t,`onStop`,3,()=>{}),l=[{label:`Triage`,icon:`◑`,prompt:`Triage the devvm: uptime, load, memory, swap, disk usage, failed systemd units, and the last 30 lines of dmesg. Summarize what's wrong.`},{label:`Memory / OOM`,icon:`▦`,prompt:`Check devvm memory pressure: free -h, top memory consumers, any recent OOM-kills in dmesg/journal, and swap usage. Is it OOMing?`},{label:`Disk`,icon:`▤`,prompt:`What's filling the devvm disk? df -h, then the biggest directories/files under the fullest mount. Anything safe to clear?`},{label:`Services`,icon:`⚙`,prompt:`List failed or stuck systemd units on the devvm (systemctl --failed) and show the status + recent journal lines for any that are down.`},{label:`QEMU wedged?`,icon:`◫`,prompt:`Is the devvm's QEMU wedged (I/O stall)? Check guest responsiveness over SSH, then ssh pve forensics for VM 102's qm status/QMP/guest-agent. Tell me if a cycle is needed.`}],u=P(``),d,f,p=!0,m=ht(()=>n()>=0&&t.tx?t.tx.messages.map(e=>e.role===`assistant`?{...e,parts:e.parts.slice()}:{...e}):[]),h=ht(()=>J(m).length===0),g=ht(()=>o()!==`error`&&!i()&&J(u).trim().length>0),_=ht(()=>!i());function v(){d&&(p=d.scrollHeight-d.scrollTop-d.clientHeight<64)}async function y(e=!1){!e&&!p||(await ar(),d&&(d.scrollTop=d.scrollHeight))}Sn(()=>{n(),y()});function b(e){i()||(p=!0,s()(e),y(!0))}function x(){let e=J(u).trim();!e||i()||(F(u,``),b(e),ar().then(()=>f?.focus()))}function S(e){e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),x())}function C(e){return e==null?``:e<1e3?`${e} ms`:`${(e/1e3).toFixed(+(e<1e4))} s`}function w(e){return r()?Math.min(e,6)*45:0}var T=Wi(),ee=R(L(T),2),te=L(ee),ne=e=>{var t=Ai();let n;var r=R(L(t),2),i=L(r),a=e=>{Z(e,xr(`The agent is unreachable.`))},s=e=>{Z(e,xr(`Attaching to the session…`))},c=e=>{Z(e,xr(`The agent is standing by.`))};$(i,e=>{o()===`error`?e(a):o()===`connecting`?e(s,1):e(c,-1)}),k(r);var l=R(r,2),u=L(l),d=e=>{var t=Oi();Ne(2),Z(e,t)},f=e=>{var t=ki();Ne(2),Z(e,t)};$(u,e=>{o()===`error`?e(d):e(f,-1)}),k(l),k(t),z(()=>n=Jr(t,1,`empty svelte-1bi93vx`,null,n,{dim:o()===`connecting`})),Z(e,t)};$(te,e=>{J(h)&&e(ne)}),Lr(R(te,2),17,()=>J(m),e=>e.key,(e,t)=>{var n=Sr(),r=sn(n),i=e=>{var n=ji(),r=L(n),i=L(r,!0);k(r),k(n),z(e=>{Xr(n,`--d:${e??``}ms`),Q(i,J(t).text)},[()=>w(0)]),Z(e,n)},a=e=>{var n=zi(),r=L(n),i=L(r),a=e=>{Z(e,Mi())};$(i,e=>{J(t).parts.length===0&&!J(t).result&&!J(t).error&&!J(t).cancelled&&e(a)});var o=R(i,2);Lr(o,17,()=>J(t).parts,Nr,(e,t)=>{var n=Sr(),r=sn(n),i=e=>{var n=Ni(),r=L(n,!0);k(n),z(()=>Q(r,J(t).text)),Z(e,n)},a=e=>{Di(e,{get name(){return J(t).name},get command(){return J(t).command}})};$(r,e=>{J(t).type===`text`?e(i):e(a,-1)}),Z(e,n)});var s=R(o,2),c=e=>{var n=Pi(),r=R(L(n),2),i=L(r,!0);k(r),k(n),z(()=>Q(i,J(t).error)),Z(e,n)},l=e=>{Z(e,Fi())},u=e=>{var n=Ri(),r=L(n),i=L(r,!0);k(r);var a=R(r,2),o=e=>{var n=Ii(),r=L(n,!0);k(n),z(()=>Q(r,J(t).result.text)),Z(e,n)};$(a,e=>{J(t).result.text&&e(o)});var s=R(a,2),c=e=>{var n=Li(),r=L(n,!0);k(n),z(e=>Q(r,e),[()=>C(J(t).result.duration_ms)]),Z(e,n)};$(s,e=>{J(t).result.duration_ms!=null&&e(c)}),k(n),z(()=>{Jr(n,1,`turn-note ${J(t).result.is_error?`turn-note--error`:`turn-note--ok`}`,`svelte-1bi93vx`),Q(i,J(t).result.is_error?`failed`:`done`)}),Z(e,n)};$(s,e=>{J(t).error?e(c):J(t).cancelled?e(l,1):J(t).result&&e(u,2)}),k(r),k(n),z(e=>Xr(n,`--d:${e??``}ms`),[()=>w(0)]),Z(e,n)};$(r,e=>{J(t).role===`user`?e(i):e(a,-1)}),Z(e,n)}),k(ee),ci(ee,e=>d=e,()=>d);var re=R(ee,2),ie=L(re);Lr(ie,21,()=>l,e=>e.label,(e,t)=>{var n=Bi(),r=L(n),a=L(r,!0);k(r);var s=R(r,2),c=L(s,!0);k(s),k(n),z(()=>{n.disabled=i()||o()===`error`,ei(n,`title`,J(t).prompt),Q(a,J(t).icon),Q(c,J(t).label)}),Y(`click`,n,()=>b(J(t).prompt)),Z(e,n)}),k(ie);var ae=R(ie,2),oe=L(ae),se=e=>{Z(e,Vi())};$(oe,e=>{i()&&e(se)});var ce=R(oe,2),le=L(ce);fn(le),ci(le,e=>f=e,()=>f);var ue=R(le,2),de=e=>{var t=Hi();Y(`click`,t,function(...e){c()?.apply(this,e)}),Z(e,t)},fe=e=>{var t=Ui(),n=L(t,!0);k(t),z(()=>{t.disabled=!J(g),Q(n,a()?`···`:`Send`)}),Z(e,t)};$(ue,e=>{i()?e(de):e(fe,-1)}),k(ce),k(ae),k(re),k(T),z(()=>{ei(le,`placeholder`,J(_)?`Describe the problem… (Enter to send · Shift+Enter for a new line)`:`A turn is running — Stop it to type, or wait…`),le.disabled=!J(_)}),pr(`scroll`,ee,v),pr(`submit`,ae,e=>{e.preventDefault(),x()}),Y(`keydown`,le,S),ii(le,()=>J(u),e=>F(u,e)),Z(e,T),Ue()}mr([`click`,`keydown`]);var Ki=X(`
Loading controls…
`),qi=X(``),Ji=X(``),Yi=X(``),Xi=X(``),Zi=X(`recovery`),Qi=X(`
Confirm ? This will affect the running VM
`),$i=X(`

`),ea=X(``),ta=X(`rejected`),na=X(` `),ra=X(`
 
`),ia=X(`
stderr
 
`,1),aa=X(`
(no output)
`),oa=X(`
`),sa=X(`
Inspect read-only
Power affects the running VM
`,1),ca=X(`

Direct VM control

No AI in the path — these reach the Proxmox host over a forced-command SSH key and work even when the agent is down.

`);function la(e,t){He(t,!0);let n={status:{label:`status`,blurb:`qm status — is the VM up?`},forensics:{label:`forensics`,blurb:`capture live diagnostic state`},start:{label:`start`,blurb:`power on a stopped VM`},stop:{label:`stop`,blurb:`hard power-off (pulls the plug)`},reset:{label:`reset`,blurb:`warm reboot — reuses the QEMU process`},cycle:{label:`cycle`,blurb:`stop → start; applies staged config; fixes a wedged QEMU`,headline:!0}},r=[`status`,`forensics`,`start`,`stop`,`reset`,`cycle`],i=P(`loading`),a=P(``),o=P(Qt([])),s=P(``),c=P(``),l=P(null),u=P(``),d=ht(()=>J(c)!==``);Ar(async()=>{try{let{verbs:e,mutating:t}=await vi(),a=new Set(t),s=e.filter(e=>n[e]);F(o,[...r.filter(e=>s.includes(e)),...s.filter(e=>!r.includes(e))].map(e=>({name:e,mutating:a.has(e),...n[e]})),!0),F(i,`ready`)}catch(e){F(i,`error`),F(a,e instanceof Error?e.message:String(e),!0)}});let f=ht(()=>J(o).filter(e=>!e.mutating)),p=ht(()=>J(o).filter(e=>e.mutating));function m(e){J(d)||(e.mutating?F(s,J(s)===e.name?``:e.name,!0):g(e.name))}function h(){F(s,``)}async function g(e){F(s,``),F(u,``),F(l,null),F(c,e,!0);try{F(l,await yi(e),!0)}catch(e){F(u,e instanceof Error?e.message:String(e),!0)}finally{F(c,``)}}let _=ht(()=>!!J(l)&&(J(l).rejected||J(l).exit_code!=null&&J(l).exit_code!==0));var v=ca(),y=R(L(v),2),b=e=>{Z(e,Ki())},x=e=>{var t=qi(),n=L(t),r=R(n);k(t),z(()=>Q(n,`Couldn't load the VM controls — ${J(a)??``}. `)),Y(`click`,r,()=>location.reload()),Z(e,t)},S=e=>{var t=sa(),n=sn(t),r=R(L(n),2);Lr(r,21,()=>J(f),e=>e.name,(e,t)=>{var n=Yi(),r=L(n),i=e=>{Z(e,Ji())};$(r,e=>{J(c)===J(t).name&&e(i)});var a=R(r,2),o=L(a,!0);k(a),k(n),z(()=>{n.disabled=J(d),ei(n,`title`,J(t).blurb),Q(o,J(t).label)}),Y(`click`,n,()=>m(J(t))),Z(e,n)}),k(r),k(n);var i=R(n,2),a=R(L(i),2);Lr(a,21,()=>J(p),e=>e.name,(e,t)=>{var n=$i(),r=L(n),i=L(r),a=e=>{Z(e,Xi())};$(i,e=>{J(c)===J(t).name&&e(a)});var o=R(i,2),l=L(o,!0);k(o);var u=R(o,2),f=e=>{Z(e,Zi())};$(u,e=>{J(t).headline&&e(f)}),k(r);var p=R(r,2),_=L(p,!0);k(p);var v=R(p,2),y=e=>{var n=Qi(),r=L(n),i=R(L(r)),a=L(i,!0);k(i),Ne(),k(r);var o=R(r,2),s=L(o),c=R(s,2);k(o),k(n),z(()=>{ei(n,`aria-label`,`Confirm ${J(t).name??``}`),Q(a,J(t).name),s.disabled=J(d),c.disabled=J(d)}),Y(`click`,s,()=>g(J(t).name)),Y(`click`,c,h),Z(e,n)};$(v,e=>{J(s)===J(t).name&&e(y)}),k(n),z(()=>{Jr(n,1,`danger-item ${J(t).headline?`danger-item--headline`:``}`,`svelte-1qihpg4`),Jr(r,1,`vbtn vbtn--danger ${J(t).headline?`vbtn--headline`:``}`,`svelte-1qihpg4`),r.disabled=J(d),ei(r,`aria-expanded`,J(s)===J(t).name),Q(l,J(t).label),Q(_,J(t).blurb)}),Y(`click`,r,()=>m(J(t))),Z(e,n)}),k(a),k(i);var o=R(i,2),v=e=>{var t=ea(),n=L(t);k(t),z(()=>Q(n,`⚠ Command failed to reach the host — ${J(u)??``}`)),Z(e,t)};$(o,e=>{J(u)&&e(v)});var y=R(o,2),b=e=>{var t=oa(),n=L(t),r=L(n),i=L(r,!0);k(r);var a=R(r,2),o=e=>{Z(e,ta())},s=e=>{var t=na(),n=L(t);k(t),z(()=>{Jr(t,1,`out-status ${J(_)?`out-status--fail`:`out-status--ok`}`,`svelte-1qihpg4`),Q(n,`exit ${J(l).exit_code??``}`)}),Z(e,t)};$(a,e=>{J(l).rejected?e(o):e(s,-1)}),k(n);var c=R(n,2),u=e=>{var t=ra(),n=L(t,!0);k(t),z(()=>Q(n,J(l).stdout)),Z(e,t)};$(c,e=>{J(l).stdout&&e(u)});var d=R(c,2),f=e=>{var t=ia(),n=R(sn(t),2),r=L(n,!0);k(n),z(()=>Q(r,J(l).stderr)),Z(e,t)};$(d,e=>{J(l).stderr&&e(f)});var p=R(d,2),m=e=>{Z(e,aa())};$(p,e=>{!J(l).stdout&&!J(l).stderr&&e(m)}),k(t),z(()=>{Jr(t,1,`out ${J(_)?`out--fail`:`out--ok`}`,`svelte-1qihpg4`),Q(i,J(l).verb)}),Z(e,t)};$(y,e=>{J(l)&&e(b)}),Z(e,t)};$(y,e=>{J(i)===`loading`?e(b):J(i)===`error`?e(x,1):e(S,-1)}),k(v),Z(e,v),Ue()}mr([`click`]);var ua=X(` `),da=X(``),fa=X(`
`),pa=X(`

devvmbreakglass

`);function ma(e,t){He(t,!0);let n=P(`connecting`),r=P(``),i=P(``),a=P(!1),o=P(!1),s=P(!1),c=P(xi()),l=P(0),u=null,d=P(!1);function f(){F(c,xi()),Yt(l)}function p(e){wi(J(c),e)&&(F(o,J(c).activeUserSeen,!0),Yt(l))}function m(){u&&=(u.close(),null)}function h(e){m(),F(i,e,!0),F(a,!1),F(n,`connecting`),F(r,``),u=hi(e,{onOpen:()=>{J(n)!==`attached`&&F(n,`attached`),F(r,``)},onCaughtUp:()=>{F(a,!0),F(n,`attached`)},onEvent:p,onError:()=>{u&&u.readyState===EventSource.CLOSED?(F(n,`error`),F(r,`lost the connection to the session — retrying…`),setTimeout(()=>{J(i)===e&&h(e)},1500)):F(n,`connecting`)}})}async function g(){F(n,`connecting`),F(r,``),f();let e=di();if(e){h(e);return}await _()}async function _(){try{F(n,`connecting`);let e=await mi();fi(e),h(e)}catch(e){F(n,`error`),F(r,e instanceof Error?e.message:String(e),!0)}}async function v(){J(o)||J(s)||(m(),pi(),f(),F(o,!1),await _())}async function y(e){let t=(e||``).trim();if(!(!t||J(o)||J(s))&&!(!J(i)&&(await _(),!J(i)))){F(s,!0),F(o,!0);try{let e=await gi({session_id:J(i),prompt:t});e.status===`busy`?F(x,`A turn is already running.`):e.status===`gone`&&(pi(),await _(),J(i)&&await gi({session_id:J(i),prompt:t}))}catch(e){F(x,e instanceof Error?e.message:String(e),!0),F(o,J(c).activeUserSeen,!0)}finally{F(s,!1)}}}async function b(){if(J(i))try{await _i(J(i))}catch(e){F(x,e instanceof Error?e.message:String(e),!0)}}let x=P(``),S;Sn(()=>{J(x)&&(clearTimeout(S),S=setTimeout(()=>F(x,``),4200))}),Ar(g),jr(m);let C=ht(()=>J(n)===`error`?`error`:J(o)?`working`:J(n)===`attached`?`live`:`connecting`),w=ht(()=>({error:`link down`,working:`agent working`,live:`attached`,connecting:`connecting`})[J(C)]),T=ht(()=>J(i)?J(i).slice(0,8):`········`);var ee=pa(),te=L(ee),ne=R(L(te),2),re=L(ne),ie=L(re),ae=R(ie,2),oe=L(ae),se=e=>{Z(e,xr(`link down`))},ce=e=>{Z(e,xr(`working`))},le=e=>{var t=ua(),n=L(t,!0);k(t),z(()=>Q(n,J(T))),Z(e,t)},ue=e=>{Z(e,xr(`connecting`))};$(oe,e=>{J(C)===`error`?e(se):J(C)===`working`?e(ce,1):J(C)===`live`?e(le,2):e(ue,-1)}),k(ae),k(re);var de=R(re,2),fe=R(de,2);k(ne),k(te);var pe=R(te,2),me=e=>{var t=da(),n=L(t),i=L(n,!0);k(n);var a=R(n,4);k(t),z(()=>Q(i,J(r)||`Can't reach the breakglass backend.`)),Y(`click`,a,g),Z(e,t)};$(pe,e=>{J(n)===`error`&&e(me)});var he=R(pe,2),ge=e=>{var t=fa(),n=L(t,!0);k(t),z(()=>Q(n,J(x))),Z(e,t)};$(he,e=>{J(x)&&e(ge)});var _e=R(he,2),ve=L(_e);Gi(L(ve),{get tx(){return J(c)},get rev(){return J(l)},get caughtUp(){return J(a)},get turnActive(){return J(o)},get sending(){return J(s)},get linkState(){return J(n)},onSubmit:y,onStop:b}),k(ve);var ye=R(ve,2);let be;var xe=R(L(ye),2),Se=R(L(xe),2);k(xe),la(R(xe,2),{}),k(ye),k(_e);var Ce=R(_e,2);let we;k(ee),z(()=>{ei(re,`title`,J(w)),Jr(ie,1,`lamp lamp--${J(C)??``}`,`svelte-1n46o8q`),Jr(ae,1,`lamp-text lamp-text--${J(C)??``}`,`svelte-1n46o8q`),fe.disabled=J(o)||J(s)||J(n)===`connecting`,ei(fe,`title`,J(o)?`wait for the current turn to finish`:`archive this session and start fresh`),be=Jr(ye,1,`controls-pane rise-in svelte-1n46o8q`,null,be,{open:J(d)}),we=Jr(Ce,1,`sheet-backdrop svelte-1n46o8q`,null,we,{show:J(d)})}),Y(`click`,de,()=>F(d,!0)),Y(`click`,fe,v),Y(`click`,Se,()=>F(d,!1)),Y(`click`,Ce,()=>F(d,!1)),Z(e,ee),Ue()}mr([`click`]),Tr(ma,{target:document.getElementById(`app`)});