smart-home-engine 1.53.2 → 1.53.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.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonMode-BRIqcXAV.js","assets/monaco-langs-DKJI_o9J.js","assets/monaco-langs-DyX1CsEw.css","assets/tsMode-DDvVFMm4.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonMode-BRIqcXAV.js","assets/monaco-langs-DKJI_o9J.js","assets/monaco-langs-DyX1CsEw.css","assets/tsMode-CWVhEJ2t.js"])))=>i.map(i=>d[i]);
2
2
  var CF=Object.defineProperty;var I2=r=>{throw TypeError(r)};var yF=(r,e,t)=>e in r?CF(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var cs=(r,e,t)=>yF(r,typeof e!="symbol"?e+"":e,t),Db=(r,e,t)=>e.has(r)||I2("Cannot "+t);var Ut=(r,e,t)=>(Db(r,e,"read from private field"),t?t.call(r):e.get(r)),ts=(r,e,t)=>e.has(r)?I2("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),is=(r,e,t,i)=>(Db(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),Os=(r,e,t)=>(Db(r,e,"access private method"),t);import{_ as o6,m as r6,l as cn,A as pr,C as ai,I as js,D as X0,a as ao,g as a6,M as Xi,b as Bn,E as Qa,c as fe,r as Es,d as ka,e as F,f as wF,h as Ns,R as ns,S as En,i as Yo,j as Da,k as hs,n as Kn,o as Yt,p as ki,K as uo,q as rn,s as Wi,t as xo,u as Xe,v as Jn,O as Bl,w as po,P as hn,x as Ab,y as Q0,z as l6,B as ac,F as Ja,G as oy,H as To,U as As,J as up,L as fn,N as fc,Q as EF,T as cr,V as ry,W as SF,X as c6,$ as on,Y as xs,Z as us,a0 as Ks,a1 as Rn,a2 as $r,a3 as n0,a4 as zi,a5 as Dx,a6 as kF,a7 as DF,a8 as vo,a9 as AF,aa as el,ab as gr,ac as mn,ad as d6,ae as Hs,af as BF,ag as FF,ah as ur,ai as Vp,aj as ho,ak as m1,al as or,am as Pd,an as PS,ao as _1,ap as Bo,aq as hp,ar as Fo,as as b1,at as C1,au as LF,av as J0,aw as $p,ax as Ec,ay as IF,az as qp,aA as PF,aB as TS,aC as TF,aD as MF,aE as P2,aF as ro,aG as lc,aH as rr,aI as jn,aJ as ic,aK as RF,aL as Tl,aM as Wr,aN as Eo,aO as tl,aP as MS,aQ as mo,aR as so,aS as im,aT as Wn,aU as u6,aV as NF,aW as RS,aX as y1,aY as NS,aZ as OS,a_ as du,a$ as OF,b0 as HS,b1 as HF,b2 as zS,b3 as Sc,b4 as kc,b5 as fp,b6 as s0,b7 as Ar,b8 as ev,b9 as nm,ba as Bb,bb as Is,bc as WS,bd as tv,be as w1,bf as zF,bg as h6,bh as o0,bi as pp,bj as r0,bk as iv,bl as E1,bm as ps,bn as Td,bo as nv,bp as WF,bq as jF,br as jS,bs as VF,bt as sm,bu as na,bv as VS,bw as gp,bx as Dc,by as Up,bz as Xn,bA as vp,bB as f6,bC as sv,bD as $F,bE as uu,bF as en,bG as T2,bH as Ax,bI as p6,bJ as Fa,bK as Ka,bL as Ps,bM as xp,bN as _a,bO as mp,bP as Gs,bQ as a0,bR as Dh,bS as ay,bT as g6,bU as v6,bV as x6,bW as $S,bX as yr,bY as ys,bZ as ov,b_ as m6,b$ as cc,c0 as S1,c1 as qF,c2 as bf,c3 as M2,c4 as rv,c5 as _6,c6 as Cf,c7 as UF,c8 as da,c9 as k1,ca as GF,cb as vr,cc as il,cd as av,ce as l0,cf as b6,cg as Jr,ch as lv,ci as D1,cj as KF,ck as ZF,cl as YF,cm as Gp,cn as Ml,co as So,cp as XF,cq as qS,cr as QF,cs as JF,ct as R2,cu as eL,cv,cw as pc,cx as ly,cy as lh,cz as gc,cA as tL,cB as Fl,cC as ba,cD as Or,cE as N2,cF as Qo,cG as dv,cH as wd,cI as Rl,cJ as iL,cK as nl,cL as c0,cM as A1,cN as C6,cO as nL,cP as sL,cQ as US,cR as oL,cS as d0,cT as rL,cU as Qc,cV as u0,cW as O2,cX as aL,cY as lL,cZ as Hl,c_ as cL,c$ as GS,d0 as y6,d1 as w6,d2 as E6,d3 as S6,d4 as dL,d5 as uL,d6 as k6,d7 as D6,d8 as hL,d9 as KS,da as fL,db as pL,dc as Xs,dd as gL,de as ZS,df as vL,dg as yf,dh as H2,di as xL,dj as mL,dk as _L,dl as bL,dm as CL,dn as yL,dp as _p,dq as B1,dr as cy,ds as wL,dt as EL,du as z2,dv as dy,dw as SL,dx as W2,dy as Fb,dz as kL,dA as A6,dB as DL,dC as B6,dD as uy,dE as AL,dF as BL,dG as FL,dH as F6,dI as L6,dJ as LL,dK as om,dL as I6,dM as F1,dN as IL,dO as PL,dP as Ed,dQ as YS,dR as TL,dS as j2,dT as V2,dU as ML,dV as wf,dW as P6,dX as RL,dY as NL,dZ as OL,d_ as HL,d$ as T6,e0 as M6,e1 as R6,e2 as N6,e3 as zL,e4 as Ll,e5 as $2,e6 as WL,e7 as uv,e8 as jL,e9 as bg,ea as O6,eb as q2,ec as h0,ed as H6,ee as rm,ef as VL,eg as z6,eh as $L,ei as W6,ej as qL,ek as UL,el as j6,em as V6,en as vc,eo as L1,ep as GL,eq as $6,er as jr,es as hu,et as q6,eu as KL,ev as ZL,ew as U6,ex as G6,ey as YL,ez as K6,eA as Z6,eB as f0,eC as XL,eD as QL,eE as JL,eF as eI,eG as lg,eH as U2,eI as tI,eJ as iI,eK as nI,eL as am,eM as Oo,eN as sI,eO as hy,eP as Ah,eQ as oI,eR as tc,eS as rI,eT as aI,eU as Y6,eV as lI,eW as Ng,eX as cI,eY as dI,eZ as uI,e_ as hI,e$ as G2,f0 as K2,f1 as Z2,f2 as Bh,f3 as XS,f4 as X6,f5 as fy,f6 as Bx,f7 as Q6,f8 as lm,f9 as fI,fa as pI,fb as gI,fc as vI,fd as QS,fe as J6,ff as xI,fg as cm,fh as e5,fi as t5,fj as mI,fk as _I,fl as bI,fm as CI,fn as yI,fo as wI,fp as EI,fq as SI,fr as i5,fs as kI,ft as dm,fu as n5,fv as DI,fw as s5,fx as AI,fy as o5,fz as r5,fA as BI,fB as Y2,fC as a5,fD as X2,fE as FI,fF as Lb,fG as Q2,fH as LI,fI as II,fJ as PI,fK as wl,fL as Sd,fM as TI,fN as J2,fO as Fx,fP as MI,fQ as nc,fR as I1,fS as py,fT as RI,fU as l5,fV as c5,fW as Jo,fX as e8,fY as Uv,fZ as JS,f_ as NI,f$ as OI,g0 as HI,g1 as zI,g2 as WI,g3 as jI,g4 as VI,g5 as $I,g6 as t8,g7 as qI,g8 as UI,g9 as GI,ga as bp,gb as Og,gc as d5,gd as KI,ge as e9,gf as Lx,gg as Gv,gh as Ib,gi as ZI,gj as YI,gk as u5,gl as XI,gm as t9,gn as QI,go as JI,gp as h5,gq as P1,gr as eP,gs as um,gt as i9,gu as n9,gv as s9,gw as f5,gx as p5,gy as g5,gz as v5,gA as x5,gB as m5,gC as _5,gD as i8,gE as b5,gF as Zh,gG as tP,gH as iP,gI as nP,gJ as sP,gK as C5,gL as oP,gM as rP,gN as n8,gO as gy,gP as sd,gQ as aP,gR as lP,gS as cP,gT as dP,gU as uP,gV as hP,gW as s8,gX as o9,gY as vy,gZ as fP,g_ as xy,g$ as pP,h0 as gP,h1 as vP,h2 as xP,h3 as r9,h4 as y5,h5 as o8,h6 as r8,h7 as mP,h8 as _P,h9 as bP,ha as a8,hb as Pb,hc as CP,hd as yP,he as wP,hf as Tb,hg as w5,hh as E5,hi as S5,hj as k5,hk as xc,hl as D5,hm as a9,hn as l8,ho as EP,hp as A5,hq as SP,hr as kP,hs as T1,ht as M1,hu as Fh,hv as R1,hw as hv,hx as DP,hy as N1,hz as AP,hA as BP,hB as FP,hC as B5,hD as cg,hE as LP,hF as IP,hG as PP,hH as TP,hI as fv,hJ as MP,hK as F5,hL as L5,hM as I5,hN as my,hO as RP,hP as NP,hQ as OP,hR as HP,hS as zP,hT as _y,hU as WP,hV as jP,hW as VP,hX as $P,hY as qP,hZ as UP,h_ as GP,h$ as KP,i0 as P5,i1 as ZP,i2 as YP,i3 as XP,i4 as c8,i5 as QP,i6 as JP,i7 as Ua,i8 as Zo,i9 as by,ia as T5,ib as eT,ic as tT}from"./monaco-langs-DKJI_o9J.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function t(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(n){if(n.ep)return;n.ep=!0;const s=t(n);fetch(n.href,s)}})();const M5=!1;var l9=Array.isArray,iT=Array.prototype.indexOf,hm=Array.prototype.includes,O1=Array.from,nT=Object.defineProperty,Hf=Object.getOwnPropertyDescriptor,sT=Object.getOwnPropertyDescriptors,oT=Object.prototype,rT=Array.prototype,R5=Object.getPrototypeOf,d8=Object.isExtensible;const Vo=()=>{};function aT(r){for(var e=0;e<r.length;e++)r[e]()}function N5(){var r,e,t=new Promise((i,n)=>{r=i,e=n});return{promise:t,resolve:r,reject:e}}function lT(r,e,t=!1){return r===void 0?t?e():e:r}function fm(r,e){if(Array.isArray(r))return r;if(!(Symbol.iterator in r))return Array.from(r);const t=[];for(const i of r)if(t.push(i),t.length===e)break;return t}const nr=2,Cp=4,H1=8,O5=1<<24,Za=16,Xa=32,kd=64,Cy=128,wa=512,Ho=1024,$o=2048,Nl=4096,Er=8192,Ea=16384,Kp=32768,yy=1<<25,yp=65536,pm=1<<17,cT=1<<18,Zp=1<<19,dT=1<<20,Dl=1<<25,ch=65536,gm=1<<21,zf=1<<22,od=1<<23,fu=Symbol("$state"),uT=Symbol("legacy props"),hT=Symbol(""),Ix=Symbol("attributes"),wy=Symbol("class"),Ey=Symbol("style"),Cg=Symbol("text"),Px=Symbol("form reset"),z1=new class extends Error{constructor(){super(...arguments);cs(this,"name","StaleReactionError");cs(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var i6;const fT=!!((i6=globalThis.document)!=null&&i6.contentType)&&globalThis.document.contentType.includes("xml");function H5(r){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function pT(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function gT(r,e,t){throw new Error("https://svelte.dev/e/each_key_duplicate")}function vT(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function xT(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function mT(r){throw new Error("https://svelte.dev/e/effect_orphan")}function _T(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function bT(r){throw new Error("https://svelte.dev/e/props_invalid_value")}function CT(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function yT(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function wT(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function ET(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const ST=1,kT=2,z5=4,DT=8,AT=16,BT=1,FT=4,LT=8,IT=16,W5=1,PT=2,No=Symbol("uninitialized"),j5="http://www.w3.org/1999/xhtml",TT="http://www.w3.org/2000/svg",MT="http://www.w3.org/1998/Math/MathML";function RT(){console.warn("https://svelte.dev/e/derived_inert")}function NT(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function OT(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function V5(r){return r===this.v}function HT(r,e){return r!=r?e==e:r!==e||r!==null&&typeof r=="object"||typeof r=="function"}function $5(r){return!HT(r,this.v)}let zT=!1,ir=null;function wp(r){ir=r}function _s(r,e=!1,t){ir={p:ir,i:!1,c:null,e:null,s:r,x:null,r:ws,l:null}}function bs(r){var e=ir,t=e.e;if(t!==null){e.e=null;for(var i of t)f3(i)}return r!==void 0&&(e.x=r),e.i=!0,ir=e.p,r??{}}function q5(){return!0}let tu=[];function U5(){var r=tu;tu=[],aT(r)}function Il(r){if(tu.length===0&&!zg){var e=tu;queueMicrotask(()=>{e===tu&&U5()})}tu.push(r)}function WT(){for(;tu.length>0;)U5()}function G5(r){var e=ws;if(e===null)return Cs.f|=od,r;if((e.f&Kp)===0&&(e.f&Cp)===0)throw r;Jc(r,e)}function Jc(r,e){for(;e!==null;){if((e.f&Cy)!==0){if((e.f&Kp)===0)throw r;try{e.b.error(r);return}catch(t){r=t}}e=e.parent}throw r}const jT=-7169;function yo(r,e){r.f=r.f&jT|e}function c9(r){(r.f&wa)!==0||r.deps===null?yo(r,Ho):yo(r,Nl)}function K5(r){if(r!==null)for(const e of r)(e.f&nr)===0||(e.f&ch)===0||(e.f^=ch,K5(e.deps))}function Z5(r,e,t){(r.f&$o)!==0?e.add(r):(r.f&Nl)!==0&&t.add(r),K5(r.deps),yo(r,Ho)}let Kv=!1;function VT(r){var e=Kv;try{return Kv=!1,[r(),Kv]}finally{Kv=e}}let Mb=null,Yh=null,Hn=null,Hg=null,Xo=null,Sy=null,zg=!1,Rb=!1,Ef=null,Tx=null;var u8=0;let $T=1;var Gf,Zc,ou,Kf,Zf,Yf,Xl,Xf,Mr,q0,Ql,Na,_l,Qf,ru,Qs,ky,yg,Dy,Y5,X5,pf,qT,wg;const S_=class S_{constructor(){ts(this,Qs);cs(this,"id",$T++);ts(this,Gf,!1);cs(this,"linked",!0);ts(this,Zc,null);ts(this,ou,null);cs(this,"async_deriveds",new Map);cs(this,"current",new Map);cs(this,"previous",new Map);ts(this,Kf,new Set);ts(this,Zf,new Set);ts(this,Yf,0);ts(this,Xl,new Map);ts(this,Xf,null);ts(this,Mr,[]);ts(this,q0,[]);ts(this,Ql,new Set);ts(this,Na,new Set);ts(this,_l,new Map);ts(this,Qf,new Set);cs(this,"is_fork",!1);ts(this,ru,!1);Yh===null?Mb=Yh=this:(is(Yh,ou,this),is(this,Zc,Yh)),Yh=this}skip_effect(e){Ut(this,_l).has(e)||Ut(this,_l).set(e,{d:[],m:[]}),Ut(this,Qf).delete(e)}unskip_effect(e,t=i=>this.schedule(i)){var i=Ut(this,_l).get(e);if(i){Ut(this,_l).delete(e);for(var n of i.d)yo(n,$o),t(n);for(n of i.m)yo(n,Nl),t(n)}Ut(this,Qf).add(e)}capture(e,t,i=!1){e.v!==No&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&od)===0&&(this.current.set(e,[t,i]),Xo==null||Xo.set(e,t)),this.is_fork||(e.v=t)}activate(){Hn=this}deactivate(){Hn=null,Xo=null}flush(){try{Rb=!0,Hn=this,Os(this,Qs,yg).call(this)}finally{u8=0,Sy=null,Ef=null,Tx=null,Rb=!1,Hn=null,Xo=null,pu.clear()}}discard(){var e;for(const t of Ut(this,Zf))t(this);Ut(this,Zf).clear(),Os(this,Qs,wg).call(this),(e=Ut(this,Xf))==null||e.resolve()}register_created_effect(e){Ut(this,q0).push(e)}increment(e,t){if(is(this,Yf,Ut(this,Yf)+1),e){let i=Ut(this,Xl).get(t)??0;Ut(this,Xl).set(t,i+1)}}decrement(e,t){if(is(this,Yf,Ut(this,Yf)-1),e){let i=Ut(this,Xl).get(t)??0;i===1?Ut(this,Xl).delete(t):Ut(this,Xl).set(t,i-1)}Ut(this,ru)||(is(this,ru,!0),Il(()=>{is(this,ru,!1),this.linked&&this.flush()}))}transfer_effects(e,t){for(const i of e)Ut(this,Ql).add(i);for(const i of t)Ut(this,Na).add(i);e.clear(),t.clear()}oncommit(e){Ut(this,Kf).add(e)}ondiscard(e){Ut(this,Zf).add(e)}settled(){return(Ut(this,Xf)??is(this,Xf,N5())).promise}static ensure(){if(Hn===null){const e=Hn=new S_;!Rb&&!zg&&Il(()=>{Ut(e,Gf)||e.flush()})}return Hn}apply(){{Xo=null;return}}schedule(e){var n;if(Sy=e,(n=e.b)!=null&&n.is_pending&&(e.f&(Cp|H1|O5))!==0&&(e.f&Kp)===0){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var i=t.f;if(Ef!==null&&t===ws&&(Cs===null||(Cs.f&nr)===0))return;if((i&(kd|Xa))!==0){if((i&Ho)===0)return;t.f^=Ho}}Ut(this,Mr).push(t)}};Gf=new WeakMap,Zc=new WeakMap,ou=new WeakMap,Kf=new WeakMap,Zf=new WeakMap,Yf=new WeakMap,Xl=new WeakMap,Xf=new WeakMap,Mr=new WeakMap,q0=new WeakMap,Ql=new WeakMap,Na=new WeakMap,_l=new WeakMap,Qf=new WeakMap,ru=new WeakMap,Qs=new WeakSet,ky=function(){if(this.is_fork)return!0;for(const i of Ut(this,Xl).keys()){for(var e=i,t=!1;e.parent!==null;){if(Ut(this,_l).has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1},yg=function(){var d,u,g,x;is(this,Gf,!0),u8++>1e3&&(Os(this,Qs,wg).call(this),GT());for(const m of Ut(this,Ql))Ut(this,Na).delete(m),yo(m,$o),this.schedule(m);for(const m of Ut(this,Na))yo(m,Nl),this.schedule(m);const e=Ut(this,Mr);is(this,Mr,[]),this.apply();var t=Ef=[],i=[],n=Tx=[];for(const m of e)try{Os(this,Qs,Dy).call(this,m,t,i)}catch(b){throw e3(m),Os(this,Qs,ky).call(this)||this.discard(),b}if(Hn=null,n.length>0){var s=S_.ensure();for(const m of n)s.schedule(m)}if(Ef=null,Tx=null,Os(this,Qs,ky).call(this)){Os(this,Qs,pf).call(this,i),Os(this,Qs,pf).call(this,t);for(const[m,b]of Ut(this,_l))J5(m,b);n.length>0&&Os(d=Hn,Qs,yg).call(d);return}const a=Os(this,Qs,Y5).call(this);if(a){Os(this,Qs,pf).call(this,i),Os(this,Qs,pf).call(this,t),Os(u=a,Qs,X5).call(u,this);return}Ut(this,Ql).clear(),Ut(this,Na).clear();for(const m of Ut(this,Kf))m(this);Ut(this,Kf).clear(),Hg=this,h8(i),h8(t),Hg=null,(g=Ut(this,Xf))==null||g.resolve();var l=Hn;if(Ut(this,Yf)===0&&(Ut(this,Mr).length===0||l!==null)&&Os(this,Qs,wg).call(this),Ut(this,Mr).length>0)if(l!==null){const m=l;Ut(m,Mr).push(...Ut(this,Mr).filter(b=>!Ut(m,Mr).includes(b)))}else l=this;l!==null&&Os(x=l,Qs,yg).call(x)},Dy=function(e,t,i){e.f^=Ho;for(var n=e.first;n!==null;){var s=n.f,a=(s&(Xa|kd))!==0,l=a&&(s&Ho)!==0,d=l||(s&Er)!==0||Ut(this,_l).has(n);if(!d&&n.fn!==null){a?n.f^=Ho:(s&Cp)!==0?t.push(n):vv(n)&&((s&Za)!==0&&Ut(this,Na).add(n),Sp(n));var u=n.first;if(u!==null){n=u;continue}}for(;n!==null;){var g=n.next;if(g!==null){n=g;break}n=n.parent}}},Y5=function(){for(var e=Ut(this,Zc);e!==null;){if(!e.is_fork){for(const[t,[,i]]of this.current)if(e.current.has(t)&&!i)return e}e=Ut(e,Zc)}return null},X5=function(e){var i;for(const[n,s]of e.current)!this.previous.has(n)&&e.previous.has(n)&&this.previous.set(n,e.previous.get(n)),this.current.set(n,s);for(const[n,s]of e.async_deriveds){const a=this.async_deriveds.get(n);a&&s.promise.then(a.resolve).catch(a.reject)}this.transfer_effects(Ut(e,Ql),Ut(e,Na));const t=n=>{var s=n.reactions;if(s!==null)for(const d of s){var a=d.f;if((a&nr)!==0)t(d);else{var l=d;a&(zf|Za)&&!this.async_deriveds.has(l)&&(Ut(this,Na).delete(l),yo(l,$o),this.schedule(l))}}};for(const n of this.current.keys())t(n);this.oncommit(()=>e.discard()),Os(i=e,Qs,wg).call(i),Hn=this,Os(this,Qs,yg).call(this)},pf=function(e){for(var t=0;t<e.length;t+=1)Z5(e[t],Ut(this,Ql),Ut(this,Na))},qT=function(){var g;for(let x=Mb;x!==null;x=Ut(x,ou)){var e=x.id<this.id,t=[];for(const[m,[b,_]]of this.current){if(x.current.has(m)){var i=x.current.get(m)[0];if(e&&b!==i)x.current.set(m,[b,_]);else continue}t.push(m)}if(e)for(const[m,b]of this.async_deriveds){const _=x.async_deriveds.get(m);_&&b.promise.then(_.resolve).catch(_.reject)}if(Ut(x,Gf)){var n=[...x.current.keys()].filter(m=>!x.current.get(m)[1]&&!this.current.has(m));if(n.length===0)e&&x.discard();else if(t.length>0){if(e)for(const m of Ut(this,Qf))x.unskip_effect(m,b=>{var _;(b.f&(Za|zf))!==0?x.schedule(b):Os(_=x,Qs,pf).call(_,[b])});x.activate();var s=new Set,a=new Map;for(var l of t)Q5(l,n,s,a);a=new Map;var d=[...x.current].filter(([m,b])=>{const _=this.current.get(m);return _?_[0]!==b[0]||_[1]!==b[1]:!0}).map(([m])=>m);if(d.length>0)for(const m of Ut(this,q0))(m.f&(Ea|Er|pm))===0&&d9(m,d,a)&&((m.f&(zf|Za))!==0?(yo(m,$o),x.schedule(m)):Ut(x,Ql).add(m));if(Ut(x,Mr).length>0&&!Ut(x,ru)){x.apply();for(var u of Ut(x,Mr))Os(g=x,Qs,Dy).call(g,u,[],[]);is(x,Mr,[])}x.deactivate()}}}},wg=function(){if(this.linked){var e=Ut(this,Zc),t=Ut(this,ou);e===null?Mb=t:is(e,ou,t),t===null?Yh=e:is(t,Zc,e),this.linked=!1}};let dh=S_;function UT(r){var e=zg;zg=!0;try{for(var t;;){if(WT(),Hn===null)return t;Hn.flush()}}finally{zg=e}}function GT(){try{_T()}catch(r){Jc(r,Sy)}}let Ta=null;function h8(r){var e=r.length;if(e!==0){for(var t=0;t<e;){var i=r[t++];if((i.f&(Ea|Er))===0&&vv(i)&&(Ta=new Set,Sp(i),i.deps===null&&i.first===null&&i.nodes===null&&i.teardown===null&&i.ac===null&&v3(i),(Ta==null?void 0:Ta.size)>0)){pu.clear();for(const n of Ta){if((n.f&(Ea|Er))!==0)continue;const s=[n];let a=n.parent;for(;a!==null;)Ta.has(a)&&(Ta.delete(a),s.push(a)),a=a.parent;for(let l=s.length-1;l>=0;l--){const d=s[l];(d.f&(Ea|Er))===0&&Sp(d)}}Ta.clear()}}Ta=null}}function Q5(r,e,t,i){if(!t.has(r)&&(t.add(r),r.reactions!==null))for(const n of r.reactions){const s=n.f;(s&nr)!==0?Q5(n,e,t,i):(s&(zf|Za))!==0&&(s&$o)===0&&d9(n,e,i)&&(yo(n,$o),u9(n))}}function d9(r,e,t){const i=t.get(r);if(i!==void 0)return i;if(r.deps!==null)for(const n of r.deps){if(hm.call(e,n))return!0;if((n.f&nr)!==0&&d9(n,e,t))return t.set(n,!0),!0}return t.set(r,!1),!1}function u9(r){Hn.schedule(r)}function J5(r,e){if(!((r.f&Xa)!==0&&(r.f&Ho)!==0)){(r.f&$o)!==0?e.d.push(r):(r.f&Nl)!==0&&e.m.push(r),yo(r,Ho);for(var t=r.first;t!==null;)J5(t,e),t=t.next}}function e3(r){yo(r,Ho);for(var e=r.first;e!==null;)e3(e),e=e.next}function KT(r){let e=0,t=uh(0),i;return()=>{p9()&&(o(t),gv(()=>(e===0&&(i=Lo(()=>r(()=>Wg(t)))),e+=1,()=>{Il(()=>{e-=1,e===0&&(i==null||i(),i=void 0,Wg(t))})})))}}var ZT=yp|Zp;function YT(r,e,t,i){new XT(r,e,t,i)}var ha,IS,fa,au,Rr,pa,br,Zr,Jl,lu,Yc,Jf,U0,G0,ec,k_,wo,QT,JT,eM,Ay,Mx,Rx,By,Fy;class XT{constructor(e,t,i,n){ts(this,wo);cs(this,"parent");cs(this,"is_pending",!1);cs(this,"transform_error");ts(this,ha);ts(this,IS,null);ts(this,fa);ts(this,au);ts(this,Rr);ts(this,pa,null);ts(this,br,null);ts(this,Zr,null);ts(this,Jl,null);ts(this,lu,0);ts(this,Yc,0);ts(this,Jf,!1);ts(this,U0,new Set);ts(this,G0,new Set);ts(this,ec,null);ts(this,k_,KT(()=>(is(this,ec,uh(Ut(this,lu))),()=>{is(this,ec,null)})));var s;is(this,ha,e),is(this,fa,t),is(this,au,a=>{var l=ws;l.b=this,l.f|=Cy,i(a)}),this.parent=ws.b,this.transform_error=n??((s=this.parent)==null?void 0:s.transform_error)??(a=>a),is(this,Rr,$1(()=>{Os(this,wo,Ay).call(this)},ZT))}defer_effect(e){Z5(e,Ut(this,U0),Ut(this,G0))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!Ut(this,fa).pending}update_pending_count(e,t){Os(this,wo,By).call(this,e,t),is(this,lu,Ut(this,lu)+e),!(!Ut(this,ec)||Ut(this,Jf))&&(is(this,Jf,!0),Il(()=>{is(this,Jf,!1),Ut(this,ec)&&Ep(Ut(this,ec),Ut(this,lu))}))}get_effect_pending(){return Ut(this,k_).call(this),o(Ut(this,ec))}error(e){if(!Ut(this,fa).onerror&&!Ut(this,fa).failed)throw e;Hn!=null&&Hn.is_fork?(Ut(this,pa)&&Hn.skip_effect(Ut(this,pa)),Ut(this,br)&&Hn.skip_effect(Ut(this,br)),Ut(this,Zr)&&Hn.skip_effect(Ut(this,Zr)),Hn.oncommit(()=>{Os(this,wo,Fy).call(this,e)})):Os(this,wo,Fy).call(this,e)}}ha=new WeakMap,IS=new WeakMap,fa=new WeakMap,au=new WeakMap,Rr=new WeakMap,pa=new WeakMap,br=new WeakMap,Zr=new WeakMap,Jl=new WeakMap,lu=new WeakMap,Yc=new WeakMap,Jf=new WeakMap,U0=new WeakMap,G0=new WeakMap,ec=new WeakMap,k_=new WeakMap,wo=new WeakSet,QT=function(){try{is(this,pa,ga(()=>Ut(this,au).call(this,Ut(this,ha))))}catch(e){this.error(e)}},JT=function(e){const t=Ut(this,fa).failed;t&&is(this,Zr,ga(()=>{t(Ut(this,ha),()=>e,()=>()=>{})}))},eM=function(){const e=Ut(this,fa).pending;e&&(this.is_pending=!0,is(this,br,ga(()=>e(Ut(this,ha)))),Il(()=>{var t=is(this,Jl,document.createDocumentFragment()),i=dc();t.append(i),is(this,pa,Os(this,wo,Rx).call(this,()=>ga(()=>Ut(this,au).call(this,i)))),Ut(this,Yc)===0&&(Ut(this,ha).before(t),is(this,Jl,null),gu(Ut(this,br),()=>{is(this,br,null)}),Os(this,wo,Mx).call(this,Hn))}))},Ay=function(){try{if(this.is_pending=this.has_pending_snippet(),is(this,Yc,0),is(this,lu,0),is(this,pa,ga(()=>{Ut(this,au).call(this,Ut(this,ha))})),Ut(this,Yc)>0){var e=is(this,Jl,document.createDocumentFragment());x9(Ut(this,pa),e);const t=Ut(this,fa).pending;is(this,br,ga(()=>t(Ut(this,ha))))}else Os(this,wo,Mx).call(this,Hn)}catch(t){this.error(t)}},Mx=function(e){this.is_pending=!1,e.transfer_effects(Ut(this,U0),Ut(this,G0))},Rx=function(e){var t=ws,i=Cs,n=ir;Ol(Ut(this,Rr)),Aa(Ut(this,Rr)),wp(Ut(this,Rr).ctx);try{return dh.ensure(),e()}catch(s){return G5(s),null}finally{Ol(t),Aa(i),wp(n)}},By=function(e,t){var i;if(!this.has_pending_snippet()){this.parent&&Os(i=this.parent,wo,By).call(i,e,t);return}is(this,Yc,Ut(this,Yc)+e),Ut(this,Yc)===0&&(Os(this,wo,Mx).call(this,t),Ut(this,br)&&gu(Ut(this,br),()=>{is(this,br,null)}),Ut(this,Jl)&&(Ut(this,ha).before(Ut(this,Jl)),is(this,Jl,null)))},Fy=function(e){Ut(this,pa)&&(Vr(Ut(this,pa)),is(this,pa,null)),Ut(this,br)&&(Vr(Ut(this,br)),is(this,br,null)),Ut(this,Zr)&&(Vr(Ut(this,Zr)),is(this,Zr,null));var t=Ut(this,fa).onerror;let i=Ut(this,fa).failed;var n=!1,s=!1;const a=()=>{if(n){OT();return}n=!0,s&&ET(),Ut(this,Zr)!==null&&gu(Ut(this,Zr),()=>{is(this,Zr,null)}),Os(this,wo,Rx).call(this,()=>{Os(this,wo,Ay).call(this)})},l=d=>{try{s=!0,t==null||t(d,a),s=!1}catch(u){Jc(u,Ut(this,Rr)&&Ut(this,Rr).parent)}i&&is(this,Zr,Os(this,wo,Rx).call(this,()=>{try{return ga(()=>{var u=ws;u.b=this,u.f|=Cy,i(Ut(this,ha),()=>d,()=>a)})}catch(u){return Jc(u,Ut(this,Rr).parent),null}}))};Il(()=>{var d;try{d=this.transform_error(e)}catch(u){Jc(u,Ut(this,Rr)&&Ut(this,Rr).parent);return}d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(l,u=>Jc(u,Ut(this,Rr)&&Ut(this,Rr).parent)):l(d)})};function tM(r,e,t,i){const n=p0;var s=r.filter(m=>!m.settled);if(t.length===0&&s.length===0){i(e.map(n));return}var a=ws,l=iM(),d=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(m=>m.promise)):null;function u(m){if((a.f&Ea)===0){l();try{i(m)}catch(b){Jc(b,a)}vm()}}var g=t3();if(t.length===0){d.then(()=>u(e.map(n))).finally(g);return}function x(){Promise.all(t.map(m=>nM(m))).then(m=>u([...e.map(n),...m])).catch(m=>Jc(m,a)).finally(g)}d?d.then(()=>{l(),x(),vm()}):x()}function iM(){var r=ws,e=Cs,t=ir,i=Hn;return function(s=!0){Ol(r),Aa(e),wp(t),s&&(r.f&Ea)===0&&(i==null||i.activate(),i==null||i.apply())}}function vm(r=!0){Ol(null),Aa(null),wp(null),r&&(Hn==null||Hn.deactivate())}function t3(){var r=ws,e=r.b,t=Hn,i=!!(e!=null&&e.is_rendered());return e==null||e.update_pending_count(1,t),t.increment(i,r),()=>{e==null||e.update_pending_count(-1,t),t.decrement(i,r)}}function p0(r){var e=nr|$o;return ws!==null&&(ws.f|=Zp),{ctx:ir,deps:null,effects:null,equals:V5,f:e,fn:r,reactions:null,rv:0,v:No,wv:0,parent:ws,ac:null}}const Zv=Symbol("obsolete");function nM(r,e,t){let i=ws;i===null&&pT();var n=void 0,s=uh(No),a=!Cs,l=new Set;return pM(()=>{var b,_;var d=ws,u=N5();n=u.promise;try{Promise.resolve(r()).then(u.resolve,E=>{E!==z1&&u.reject(E)}).finally(vm)}catch(E){u.reject(E),vm()}var g=Hn;if(a){if((d.f&Kp)!==0)var x=t3();if((b=i.b)!=null&&b.is_rendered())(_=g.async_deriveds.get(d))==null||_.reject(Zv);else for(const E of l.values())E.reject(Zv);l.add(u),g.async_deriveds.set(d,u)}const m=(E,k=void 0)=>{x==null||x(),l.delete(u),k!==Zv&&(g.activate(),k?(s.f|=od,Ep(s,k)):((s.f&od)!==0&&(s.f^=od),Ep(s,E)),g.deactivate())};u.promise.then(m,E=>m(null,E||"unknown"))}),V1(()=>{for(const d of l)d.reject(Zv)}),new Promise(d=>{function u(g){function x(){g===n?d(s):u(n)}g.then(x,x)}u(n)})}function st(r){const e=p0(r);return _3(e),e}function h9(r){const e=p0(r);return e.equals=$5,e}function sM(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)Vr(e[t])}}function f9(r){var e,t=ws,i=r.parent;if(!mc&&i!==null&&r.v!==No&&(i.f&(Ea|Er))!==0)return RT(),r.v;Ol(i);try{r.f&=~ch,sM(r),e=w3(r)}finally{Ol(t)}return e}function i3(r){var e=f9(r);if(!r.equals(e)&&(r.wv=C3(),(!(Hn!=null&&Hn.is_fork)||r.deps===null)&&(Hn!==null?(Hn.capture(r,e,!0),Hg==null||Hg.capture(r,e,!0)):r.v=e,r.deps===null))){yo(r,Ho);return}mc||(Xo!==null?(p9()||Hn!=null&&Hn.is_fork)&&Xo.set(r,e):c9(r))}function oM(r){var e,t;if(r.effects!==null)for(const i of r.effects)(i.teardown||i.ac)&&((e=i.teardown)==null||e.call(i),(t=i.ac)==null||t.abort(z1),i.fn!==null&&(i.teardown=Vo),i.ac=null,g0(i,0),v9(i))}function n3(r){if(r.effects!==null)for(const e of r.effects)e.teardown&&e.fn!==null&&Sp(e)}let xm=new Set;const pu=new Map;let s3=!1;function uh(r,e){var t={f:0,v:r,reactions:null,equals:V5,rv:0,wv:0};return t}function A(r,e){const t=uh(r);return _3(t),t}function rM(r,e=!1,t=!0){const i=uh(r);return e||(i.equals=$5),i}function p(r,e,t=!1){Cs!==null&&(!Ya||(Cs.f&pm)!==0)&&q5()&&(Cs.f&(nr|Za|zf|pm))!==0&&(Pl===null||!Pl.has(r))&&wT();let i=t?yi(e):e;return Ep(r,i,Tx)}function Ep(r,e,t=null){if(!r.equals(e)){pu.set(r,mc?e:r.v);var i=dh.ensure();if(i.capture(r,e),(r.f&nr)!==0){const n=r;(r.f&$o)!==0&&f9(n),Xo===null&&c9(n)}r.wv=C3(),o3(r,$o,t),ws!==null&&(ws.f&Ho)!==0&&(ws.f&(Xa|kd))===0&&(ua===null?vM([r]):ua.push(r)),!i.is_fork&&xm.size>0&&!s3&&aM()}return e}function aM(){s3=!1;for(const r of xm){(r.f&Ho)!==0&&yo(r,Nl);let e;try{e=vv(r)}catch{e=!0}e&&Sp(r)}xm.clear()}function Ly(r,e=1){var t=o(r),i=e===1?t++:t--;return p(r,t),i}function Wg(r){p(r,r.v+1)}function o3(r,e,t){var i=r.reactions;if(i!==null)for(var n=i.length,s=0;s<n;s++){var a=i[s],l=a.f,d=(l&$o)===0;if(d&&yo(a,e),(l&pm)!==0)xm.add(a);else if((l&nr)!==0){var u=a;Xo==null||Xo.delete(u),(l&ch)===0&&(l&wa&&(ws===null||(ws.f&gm)===0)&&(a.f|=ch),o3(u,Nl,t))}else if(d){var g=a;(l&Za)!==0&&Ta!==null&&Ta.add(g),t!==null?t.push(g):u9(g)}}}function yi(r){if(typeof r!="object"||r===null||fu in r)return r;const e=R5(r);if(e!==oT&&e!==rT)return r;var t=new Map,i=l9(r),n=A(0),s=vu,a=l=>{if(vu===s)return l();var d=Cs,u=vu;Aa(null),v8(s);var g=l();return Aa(d),v8(u),g};return i&&t.set("length",A(r.length)),new Proxy(r,{defineProperty(l,d,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&CT();var g=t.get(d);return g===void 0?a(()=>{var x=A(u.value);return t.set(d,x),x}):p(g,u.value,!0),!0},deleteProperty(l,d){var u=t.get(d);if(u===void 0){if(d in l){const g=a(()=>A(No));t.set(d,g),Wg(n)}}else p(u,No),Wg(n);return!0},get(l,d,u){var b;if(d===fu)return r;var g=t.get(d),x=d in l;if(g===void 0&&(!x||(b=Hf(l,d))!=null&&b.writable)&&(g=a(()=>{var _=yi(x?l[d]:No),E=A(_);return E}),t.set(d,g)),g!==void 0){var m=o(g);return m===No?void 0:m}return Reflect.get(l,d,u)},getOwnPropertyDescriptor(l,d){var u=Reflect.getOwnPropertyDescriptor(l,d);if(u&&"value"in u){var g=t.get(d);g&&(u.value=o(g))}else if(u===void 0){var x=t.get(d),m=x==null?void 0:x.v;if(x!==void 0&&m!==No)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return u},has(l,d){var m;if(d===fu)return!0;var u=t.get(d),g=u!==void 0&&u.v!==No||Reflect.has(l,d);if(u!==void 0||ws!==null&&(!g||(m=Hf(l,d))!=null&&m.writable)){u===void 0&&(u=a(()=>{var b=g?yi(l[d]):No,_=A(b);return _}),t.set(d,u));var x=o(u);if(x===No)return!1}return g},set(l,d,u,g){var N;var x=t.get(d),m=d in l;if(i&&d==="length")for(var b=u;b<x.v;b+=1){var _=t.get(b+"");_!==void 0?p(_,No):b in l&&(_=a(()=>A(No)),t.set(b+"",_))}if(x===void 0)(!m||(N=Hf(l,d))!=null&&N.writable)&&(x=a(()=>A(void 0)),p(x,yi(u)),t.set(d,x));else{m=x.v!==No;var E=a(()=>yi(u));p(x,E)}var k=Reflect.getOwnPropertyDescriptor(l,d);if(k!=null&&k.set&&k.set.call(g,u),!m){if(i&&typeof d=="string"){var I=t.get("length"),M=Number(d);Number.isInteger(M)&&M>=I.v&&p(I,M+1)}Wg(n)}return!0},ownKeys(l){o(n);var d=Reflect.ownKeys(l).filter(x=>{var m=t.get(x);return m===void 0||m.v!==No});for(var[u,g]of t)g.v!==No&&!(u in l)&&d.push(u);return d},setPrototypeOf(){yT()}})}function f8(r){try{if(r!==null&&typeof r=="object"&&fu in r)return r[fu]}catch{}return r}function r3(r,e){return Object.is(f8(r),f8(e))}var Sa,a3,l3,c3,d3;function lM(){if(Sa===void 0){Sa=window,a3=document,l3=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;c3=Hf(e,"firstChild").get,d3=Hf(e,"nextSibling").get,d8(r)&&(r[wy]=void 0,r[Ix]=null,r[Ey]=void 0,r.__e=void 0),d8(t)&&(t[Cg]=void 0)}}function dc(r=""){return document.createTextNode(r)}function ta(r){return c3.call(r)}function pv(r){return d3.call(r)}function f(r,e){return ta(r)}function yt(r,e=!1){{var t=ta(r);return t instanceof Comment&&t.data===""?pv(t):t}}function h(r,e=1,t=!1){let i=r;for(;e--;)i=pv(i);return i}function cM(r){r.textContent=""}function u3(){return!1}function h3(r,e,t){return e==null||e===j5?t?document.createElement(r,{is:t}):document.createElement(r):t?document.createElementNS(e,r,{is:t}):document.createElementNS(e,r)}let p8=!1;function dM(){p8||(p8=!0,document.addEventListener("reset",r=>{Promise.resolve().then(()=>{var e;if(!r.defaultPrevented)for(const t of r.target.elements)(e=t[Px])==null||e.call(t)})},{capture:!0}))}function W1(r){var e=Cs,t=ws;Aa(null),Ol(null);try{return r()}finally{Aa(e),Ol(t)}}function j1(r,e,t,i=t){r.addEventListener(e,()=>W1(t));const n=r[Px];n?r[Px]=()=>{n(),i(!0)}:r[Px]=()=>i(!0),dM()}function uM(r){ws===null&&(Cs===null&&mT(),xT()),mc&&vT()}function hM(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function Ac(r,e){var t=ws;t!==null&&(t.f&Er)!==0&&(r|=Er);var i={ctx:ir,deps:null,nodes:null,f:r|$o|wa,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};Hn==null||Hn.register_created_effect(i);var n=i;if((r&Cp)!==0)Ef!==null?Ef.push(i):dh.ensure().schedule(i);else if(e!==null){try{Sp(i)}catch(a){throw Vr(i),a}n.deps===null&&n.teardown===null&&n.nodes===null&&n.first===n.last&&(n.f&Zp)===0&&(n=n.first,(r&Za)!==0&&(r&yp)!==0&&n!==null&&(n.f|=yp))}if(n!==null&&(n.parent=t,t!==null&&hM(n,t),Cs!==null&&(Cs.f&nr)!==0&&(r&kd)===0)){var s=Cs;(s.effects??(s.effects=[])).push(n)}return i}function p9(){return Cs!==null&&!Ya}function V1(r){const e=Ac(H1,null);return yo(e,Ho),e.teardown=r,e}function ln(r){uM();var e=ws.f,t=!Cs&&(e&Xa)!==0&&ir!==null&&!ir.i;if(t){var i=ir;(i.e??(i.e=[])).push(r)}else return f3(r)}function f3(r){return Ac(Cp|dT,r)}function fM(r){dh.ensure();const e=Ac(kd|Zp,r);return(t={})=>new Promise(i=>{t.outro?gu(e,()=>{Vr(e),i(void 0)}):(Vr(e),i(void 0))})}function g9(r){return Ac(Cp,r)}function pM(r){return Ac(zf|Zp,r)}function gv(r,e=0){return Ac(H1|e,r)}function T(r,e=[],t=[],i=[]){tM(i,e,t,n=>{Ac(H1,()=>r(...n.map(o)))})}function $1(r,e=0){var t=Ac(Za|e,r);return t}function ga(r){return Ac(Xa|Zp,r)}function p3(r){var e=r.teardown;if(e!==null){const t=mc,i=Cs;g8(!0),Aa(null);try{e.call(null)}finally{g8(t),Aa(i)}}}function v9(r,e=!1){var t=r.first;for(r.first=r.last=null;t!==null;){const n=t.ac;n!==null&&W1(()=>{n.abort(z1)});var i=t.next;(t.f&kd)!==0?t.parent=null:Vr(t,e),t=i}}function gM(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&Xa)===0&&Vr(e),e=t}}function Vr(r,e=!0){var t=!1;(e||(r.f&cT)!==0)&&r.nodes!==null&&r.nodes.end!==null&&(g3(r.nodes.start,r.nodes.end),t=!0),yo(r,yy),v9(r,e&&!t),g0(r,0);var i=r.nodes&&r.nodes.t;if(i!==null)for(const s of i)s.stop();p3(r),r.f^=yy,r.f|=Ea;var n=r.parent;n!==null&&n.first!==null&&v3(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes=r.ac=r.b=null}function g3(r,e){for(;r!==null;){var t=r===e?null:pv(r);r.remove(),r=t}}function v3(r){var e=r.parent,t=r.prev,i=r.next;t!==null&&(t.next=i),i!==null&&(i.prev=t),e!==null&&(e.first===r&&(e.first=i),e.last===r&&(e.last=t))}function gu(r,e,t=!0){var i=[];x3(r,i,!0);var n=()=>{t&&Vr(r),e&&e()},s=i.length;if(s>0){var a=()=>--s||n();for(var l of i)l.out(a)}else n()}function x3(r,e,t){if((r.f&Er)===0){r.f^=Er;var i=r.nodes&&r.nodes.t;if(i!==null)for(const l of i)(l.is_global||t)&&e.push(l);for(var n=r.first;n!==null;){var s=n.next;if((n.f&kd)===0){var a=(n.f&yp)!==0||(n.f&Xa)!==0&&(r.f&Za)!==0;x3(n,e,a?t:!1)}n=s}}}function mm(r){m3(r,!0)}function m3(r,e){if((r.f&Er)!==0){r.f^=Er,(r.f&Ho)===0&&(yo(r,$o),dh.ensure().schedule(r));for(var t=r.first;t!==null;){var i=t.next,n=(t.f&yp)!==0||(t.f&Xa)!==0;m3(t,n?e:!1),t=i}var s=r.nodes&&r.nodes.t;if(s!==null)for(const a of s)(a.is_global||e)&&a.in()}}function x9(r,e){if(r.nodes)for(var t=r.nodes.start,i=r.nodes.end;t!==null;){var n=t===i?null:pv(t);e.append(t),t=n}}let Nx=!1,mc=!1;function g8(r){mc=r}let Cs=null,Ya=!1;function Aa(r){Cs=r}let ws=null;function Ol(r){ws=r}let Pl=null;function _3(r){Cs!==null&&(Pl??(Pl=new Set)).add(r)}let Nr=null,Gr=0,ua=null;function vM(r){ua=r}let b3=1,iu=0,vu=iu;function v8(r){vu=r}function C3(){return++b3}function vv(r){var e=r.f;if((e&$o)!==0)return!0;if(e&nr&&(r.f&=~ch),(e&Nl)!==0){for(var t=r.deps,i=t.length,n=0;n<i;n++){var s=t[n];if(vv(s)&&i3(s),s.wv>r.wv)return!0}(e&wa)!==0&&Xo===null&&yo(r,Ho)}return!1}function y3(r,e,t=!0){var i=r.reactions;if(i!==null&&!(Pl!==null&&Pl.has(r)))for(var n=0;n<i.length;n++){var s=i[n];(s.f&nr)!==0?y3(s,e,!1):e===s&&(t?yo(s,$o):(s.f&Ho)!==0&&yo(s,Nl),u9(s))}}function w3(r){var E;var e=Nr,t=Gr,i=ua,n=Cs,s=Pl,a=ir,l=Ya,d=vu,u=r.f;Nr=null,Gr=0,ua=null,Cs=(u&(Xa|kd))===0?r:null,Pl=null,wp(r.ctx),Ya=!1,vu=++iu,r.ac!==null&&(W1(()=>{r.ac.abort(z1)}),r.ac=null);try{r.f|=gm;var g=r.fn,x=g();r.f|=Kp;var m=r.deps,b=Hn==null?void 0:Hn.is_fork;if(Nr!==null){var _;if(b||g0(r,Gr),m!==null&&Gr>0)for(m.length=Gr+Nr.length,_=0;_<Nr.length;_++)m[Gr+_]=Nr[_];else r.deps=m=Nr;if(p9()&&(r.f&wa)!==0)for(_=Gr;_<m.length;_++)((E=m[_]).reactions??(E.reactions=[])).push(r)}else!b&&m!==null&&Gr<m.length&&(g0(r,Gr),m.length=Gr);if(q5()&&ua!==null&&!Ya&&m!==null&&(r.f&(nr|Nl|$o))===0)for(_=0;_<ua.length;_++)y3(ua[_],r);if(n!==null&&n!==r){if(iu++,n.deps!==null)for(let k=0;k<t;k+=1)n.deps[k].rv=iu;if(e!==null)for(const k of e)k.rv=iu;ua!==null&&(i===null?i=ua:i.push(...ua))}return(r.f&od)!==0&&(r.f^=od),x}catch(k){return G5(k)}finally{r.f^=gm,Nr=e,Gr=t,ua=i,Cs=n,Pl=s,wp(a),Ya=l,vu=d}}function xM(r,e){let t=e.reactions;if(t!==null){var i=iT.call(t,r);if(i!==-1){var n=t.length-1;n===0?t=e.reactions=null:(t[i]=t[n],t.pop())}}if(t===null&&(e.f&nr)!==0&&(Nr===null||!hm.call(Nr,e))){var s=e;(s.f&wa)!==0&&(s.f^=wa,s.f&=~ch),s.v!==No&&c9(s),oM(s),g0(s,0)}}function g0(r,e){var t=r.deps;if(t!==null)for(var i=e;i<t.length;i++)xM(r,t[i])}function Sp(r){var e=r.f;if((e&Ea)===0){yo(r,Ho);var t=ws,i=Nx;ws=r,Nx=!0;try{(e&(Za|O5))!==0?gM(r):v9(r),p3(r);var n=w3(r);r.teardown=typeof n=="function"?n:null,r.wv=b3;var s;M5&&zT&&(r.f&$o)!==0&&r.deps}finally{Nx=i,ws=t}}}async function xa(){await Promise.resolve(),UT()}function o(r){var e=r.f,t=(e&nr)!==0;if(Cs!==null&&!Ya){var i=ws!==null&&(ws.f&Ea)!==0;if(!i&&(Pl===null||!Pl.has(r))){var n=Cs.deps;if((Cs.f&gm)!==0)r.rv<iu&&(r.rv=iu,Nr===null&&n!==null&&n[Gr]===r?Gr++:Nr===null?Nr=[r]:Nr.push(r));else{Cs.deps??(Cs.deps=[]),hm.call(Cs.deps,r)||Cs.deps.push(r);var s=r.reactions;s===null?r.reactions=[Cs]:hm.call(s,Cs)||s.push(Cs)}}}if(mc&&pu.has(r))return pu.get(r);if(t){var a=r;if(mc){var l=a.v;return((a.f&Ho)===0&&a.reactions!==null||S3(a))&&(l=f9(a)),pu.set(a,l),l}var d=(a.f&wa)===0&&!Ya&&Cs!==null&&(Nx||(Cs.f&wa)!==0),u=(a.f&Kp)===0;vv(a)&&(d&&(a.f|=wa),i3(a)),d&&!u&&(n3(a),E3(a))}if(Xo!=null&&Xo.has(r))return Xo.get(r);if((r.f&od)!==0)throw r.v;return r.v}function E3(r){if(r.f|=wa,r.deps!==null)for(const e of r.deps)(e.reactions??(e.reactions=[])).push(r),(e.f&nr)!==0&&(e.f&wa)===0&&(n3(e),E3(e))}function S3(r){if(r.v===No)return!0;if(r.deps===null)return!1;for(const e of r.deps)if(pu.has(e)||(e.f&nr)!==0&&S3(e))return!0;return!1}function Lo(r){var e=Ya;try{return Ya=!0,r()}finally{Ya=e}}const mM=["touchstart","touchmove"];function _M(r){return mM.includes(r)}const nu=Symbol("events"),k3=new Set,Iy=new Set;function bM(r,e,t,i={}){function n(s){if(i.capture||Py.call(e,s),!s.cancelBubble)return W1(()=>t==null?void 0:t.call(this,s))}return r.startsWith("pointer")||r.startsWith("touch")||r==="wheel"?Il(()=>{e.addEventListener(r,n,i)}):e.addEventListener(r,n,i),n}function Fs(r,e,t,i,n){var s={capture:i,passive:n},a=bM(r,e,t,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&V1(()=>{e.removeEventListener(r,a,s)})}function H(r,e,t){(e[nu]??(e[nu]={}))[r]=t}function Ss(r){for(var e=0;e<r.length;e++)k3.add(r[e]);for(var t of Iy)t(r)}let x8=null;function Py(r){var E,k;var e=this,t=e.ownerDocument,i=r.type,n=((E=r.composedPath)==null?void 0:E.call(r))||[],s=n[0]||r.target;x8=r;var a=0,l=x8===r&&r[nu];if(l){var d=n.indexOf(l);if(d!==-1&&(e===document||e===window)){r[nu]=e;return}var u=n.indexOf(e);if(u===-1)return;d<=u&&(a=d)}if(s=n[a]||r.target,s!==e){nT(r,"currentTarget",{configurable:!0,get(){return s||t}});var g=Cs,x=ws;Aa(null),Ol(null);try{for(var m,b=[];s!==null&&s!==e;){try{var _=(k=s[nu])==null?void 0:k[i];_!=null&&(!s.disabled||r.target===s)&&_.call(s,r)}catch(I){m?b.push(I):m=I}if(r.cancelBubble)break;a++,s=a<n.length?n[a]:null}if(m){for(let I of b)queueMicrotask(()=>{throw I});throw m}}finally{r[nu]=e,delete r.currentTarget,Aa(g),Ol(x)}}}var n6;const Nb=((n6=globalThis==null?void 0:globalThis.window)==null?void 0:n6.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:r=>r});function CM(r){return(Nb==null?void 0:Nb.createHTML(r))??r}function D3(r){var e=h3("template");return e.innerHTML=CM(r.replaceAll("<!>","<!---->")),e.content}function Dd(r,e){var t=ws;t.nodes===null&&(t.nodes={start:r,end:e,a:null,t:null})}function S(r,e){var t=(e&W5)!==0,i=(e&PT)!==0,n,s=!r.startsWith("<!>");return()=>{n===void 0&&(n=D3(s?r:"<!>"+r),t||(n=ta(n)));var a=i||l3?document.importNode(n,!0):n.cloneNode(!0);if(t){var l=ta(a),d=a.lastChild;Dd(l,d)}else Dd(a,a);return a}}function yM(r,e,t="svg"){var i=!r.startsWith("<!>"),n=(e&W5)!==0,s=`<${t}>${i?r:"<!>"+r}</${t}>`,a;return()=>{if(!a){var l=D3(s),d=ta(l);if(n)for(a=document.createDocumentFragment();ta(d);)a.appendChild(ta(d));else a=ta(d)}var u=a.cloneNode(!0);if(n){var g=ta(u),x=u.lastChild;Dd(g,x)}else Dd(u,u);return u}}function Go(r,e){return yM(r,e,"svg")}function In(r=""){{var e=dc(r+"");return Dd(e,e),e}}function Ms(){var r=document.createDocumentFragment(),e=document.createComment(""),t=dc();return r.append(e,t),Dd(e,t),r}function y(r,e){r!==null&&r.before(e)}function B(r,e){var t=e==null?"":typeof e=="object"?`${e}`:e;t!==(r[Cg]??(r[Cg]=r.nodeValue))&&(r[Cg]=t,r.nodeValue=`${t}`)}function wM(r,e){return EM(r,e)}const Yv=new Map;function EM(r,{target:e,anchor:t,props:i={},events:n,context:s,intro:a=!0,transformError:l}){lM();var d=void 0,u=fM(()=>{var g=t??e.appendChild(dc());YT(g,{pending:()=>{}},b=>{_s({});var _=ir;s&&(_.c=s),n&&(i.$$events=n),d=r(b,i)||{},bs()},l);var x=new Set,m=b=>{for(var _=0;_<b.length;_++){var E=b[_];if(!x.has(E)){x.add(E);var k=_M(E);for(const N of[e,document]){var I=Yv.get(N);I===void 0&&(I=new Map,Yv.set(N,I));var M=I.get(E);M===void 0?(N.addEventListener(E,Py,{passive:k}),I.set(E,1)):I.set(E,M+1)}}}};return m(O1(k3)),Iy.add(m),()=>{var k;for(var b of x)for(const I of[e,document]){var _=Yv.get(I),E=_.get(b);--E==0?(I.removeEventListener(b,Py),_.delete(b),_.size===0&&Yv.delete(I)):_.set(b,E)}Iy.delete(m),g!==t&&((k=g.parentNode)==null||k.removeChild(g))}});return SM.set(d,u),d}let SM=new WeakMap;var Oa,bl,Yr,cu,K0,Z0,D_;class A3{constructor(e,t=!0){cs(this,"anchor");ts(this,Oa,new Map);ts(this,bl,new Map);ts(this,Yr,new Map);ts(this,cu,new Set);ts(this,K0,!0);ts(this,Z0,e=>{if(Ut(this,Oa).has(e)){var t=Ut(this,Oa).get(e),i=Ut(this,bl).get(t);if(i)mm(i),Ut(this,cu).delete(t);else{var n=Ut(this,Yr).get(t);n&&(mm(n.effect),Ut(this,bl).set(t,n.effect),Ut(this,Yr).delete(t),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(const[s,a]of Ut(this,Oa)){if(Ut(this,Oa).delete(s),s===e)break;const l=Ut(this,Yr).get(a);l&&(Vr(l.effect),Ut(this,Yr).delete(a))}for(const[s,a]of Ut(this,bl)){if(s===t||Ut(this,cu).has(s))continue;const l=()=>{if(Array.from(Ut(this,Oa).values()).includes(s)){var u=document.createDocumentFragment();x9(a,u),u.append(dc()),Ut(this,Yr).set(s,{effect:a,fragment:u})}else Vr(a);Ut(this,cu).delete(s),Ut(this,bl).delete(s)};Ut(this,K0)||!i?(Ut(this,cu).add(s),gu(a,l,!1)):l()}}});ts(this,D_,e=>{Ut(this,Oa).delete(e);const t=Array.from(Ut(this,Oa).values());for(const[i,n]of Ut(this,Yr))t.includes(i)||(Vr(n.effect),Ut(this,Yr).delete(i))});this.anchor=e,is(this,K0,t)}ensure(e,t){var i=Hn,n=u3();if(t&&!Ut(this,bl).has(e)&&!Ut(this,Yr).has(e))if(n){var s=document.createDocumentFragment(),a=dc();s.append(a),Ut(this,Yr).set(e,{effect:ga(()=>t(a)),fragment:s})}else Ut(this,bl).set(e,ga(()=>t(this.anchor)));if(Ut(this,Oa).set(i,e),n){for(const[l,d]of Ut(this,bl))l===e?i.unskip_effect(d):i.skip_effect(d);for(const[l,d]of Ut(this,Yr))l===e?i.unskip_effect(d.effect):i.skip_effect(d.effect);i.oncommit(Ut(this,Z0)),i.ondiscard(Ut(this,D_))}else Ut(this,Z0).call(this,i)}}Oa=new WeakMap,bl=new WeakMap,Yr=new WeakMap,cu=new WeakMap,K0=new WeakMap,Z0=new WeakMap,D_=new WeakMap;function P(r,e,t=!1){var i=new A3(r),n=t?yp:0;function s(a,l){i.ensure(a,l)}$1(()=>{var a=!1;e((l,d=0)=>{a=!0,s(d,l)}),a||s(-1,null)},n)}const kM=Symbol("NaN");function B3(r,e,t){var i=new A3(r);$1(()=>{var n=e();n!==n&&(n=kM),i.ensure(n,t)})}function nn(r,e){return e}function DM(r,e,t){for(var i=[],n=e.length,s,a=e.length,l=0;l<n;l++){let x=e[l];gu(x,()=>{if(s){if(s.pending.delete(x),s.done.add(x),s.pending.size===0){var m=r.outrogroups;Ty(r,O1(s.done)),m.delete(s),m.size===0&&(r.outrogroups=null)}}else a-=1},!1)}if(a===0){var d=i.length===0&&t!==null;if(d){var u=t,g=u.parentNode;cM(g),g.append(u),r.items.clear()}Ty(r,e,!d)}else s={pending:new Set(e),done:new Set},(r.outrogroups??(r.outrogroups=new Set)).add(s)}function Ty(r,e,t=!0){var i;if(r.pending.size>0){i=new Set;for(const a of r.pending.values())for(const l of a)i.add(r.items.get(l).e)}for(var n=0;n<e.length;n++){var s=e[n];if(i!=null&&i.has(s)){s.f|=Dl;const a=document.createDocumentFragment();x9(s,a)}else Vr(e[n],t)}}var m8;function vi(r,e,t,i,n,s=null){var a=r,l=new Map,d=(e&z5)!==0;if(d){var u=r;a=u.appendChild(dc())}var g=null,x=h9(()=>{var N=t();return l9(N)?N:N==null?[]:O1(N)}),m,b=new Map,_=!0;function E(N){(M.effect.f&Ea)===0&&(M.pending.delete(N),M.fallback=g,AM(M,m,a,e,i),g!==null&&(m.length===0?(g.f&Dl)===0?mm(g):(g.f^=Dl,Eg(g,null,a)):gu(g,()=>{g=null})))}function k(N){M.pending.delete(N)}var I=$1(()=>{m=o(x);for(var N=m.length,O=new Set,z=Hn,G=u3(),U=0;U<N;U+=1){var ne=m[U],Ee=i(ne,U),pe=_?null:l.get(Ee);pe?(pe.v&&Ep(pe.v,ne),pe.i&&Ep(pe.i,U),G&&z.unskip_effect(pe.e)):(pe=BM(l,_?a:m8??(m8=dc()),ne,Ee,U,n,e,t),_||(pe.e.f|=Dl),l.set(Ee,pe)),O.add(Ee)}if(N===0&&s&&!g&&(_?g=ga(()=>s(a)):(g=ga(()=>s(m8??(m8=dc()))),g.f|=Dl)),N>O.size&&gT(),!_)if(b.set(z,O),G){for(const[he,qe]of l)O.has(he)||z.skip_effect(qe.e);z.oncommit(E),z.ondiscard(k)}else E(z);o(x)}),M={effect:I,items:l,pending:b,outrogroups:null,fallback:g};_=!1}function dg(r){for(;r!==null&&(r.f&Xa)===0;)r=r.next;return r}function AM(r,e,t,i,n){var pe,he,qe,it,ue,Ue,me,Qe,be;var s=(i&DT)!==0,a=e.length,l=r.items,d=dg(r.effect.first),u,g=null,x,m=[],b=[],_,E,k,I;if(s)for(I=0;I<a;I+=1)_=e[I],E=n(_,I),k=l.get(E).e,(k.f&Dl)===0&&((he=(pe=k.nodes)==null?void 0:pe.a)==null||he.measure(),(x??(x=new Set)).add(k));for(I=0;I<a;I+=1){if(_=e[I],E=n(_,I),k=l.get(E).e,r.outrogroups!==null)for(const Pt of r.outrogroups)Pt.pending.delete(k),Pt.done.delete(k);if((k.f&Er)!==0&&(mm(k),s&&((it=(qe=k.nodes)==null?void 0:qe.a)==null||it.unfix(),(x??(x=new Set)).delete(k))),(k.f&Dl)!==0)if(k.f^=Dl,k===d)Eg(k,null,t);else{var M=g?g.next:d;k===r.effect.last&&(r.effect.last=k.prev),k.prev&&(k.prev.next=k.next),k.next&&(k.next.prev=k.prev),Mc(r,g,k),Mc(r,k,M),Eg(k,M,t),g=k,m=[],b=[],d=dg(g.next);continue}if(k!==d){if(u!==void 0&&u.has(k)){if(m.length<b.length){var N=b[0],O;g=N.prev;var z=m[0],G=m[m.length-1];for(O=0;O<m.length;O+=1)Eg(m[O],N,t);for(O=0;O<b.length;O+=1)u.delete(b[O]);Mc(r,z.prev,G.next),Mc(r,g,z),Mc(r,G,N),d=N,g=G,I-=1,m=[],b=[]}else u.delete(k),Eg(k,d,t),Mc(r,k.prev,k.next),Mc(r,k,g===null?r.effect.first:g.next),Mc(r,g,k),g=k;continue}for(m=[],b=[];d!==null&&d!==k;)(u??(u=new Set)).add(d),b.push(d),d=dg(d.next);if(d===null)continue}(k.f&Dl)===0&&m.push(k),g=k,d=dg(k.next)}if(r.outrogroups!==null){for(const Pt of r.outrogroups)Pt.pending.size===0&&(Ty(r,O1(Pt.done)),(ue=r.outrogroups)==null||ue.delete(Pt));r.outrogroups.size===0&&(r.outrogroups=null)}if(d!==null||u!==void 0){var U=[];if(u!==void 0)for(k of u)(k.f&Er)===0&&U.push(k);for(;d!==null;)(d.f&Er)===0&&d!==r.fallback&&U.push(d),d=dg(d.next);var ne=U.length;if(ne>0){var Ee=(i&z5)!==0&&a===0?t:null;if(s){for(I=0;I<ne;I+=1)(me=(Ue=U[I].nodes)==null?void 0:Ue.a)==null||me.measure();for(I=0;I<ne;I+=1)(be=(Qe=U[I].nodes)==null?void 0:Qe.a)==null||be.fix()}DM(r,U,Ee)}}s&&Il(()=>{var Pt,Ne;if(x!==void 0)for(k of x)(Ne=(Pt=k.nodes)==null?void 0:Pt.a)==null||Ne.apply()})}function BM(r,e,t,i,n,s,a,l){var d=(a&ST)!==0?(a&AT)===0?rM(t,!1,!1):uh(t):null,u=(a&kT)!==0?uh(n):null;return{v:d,i:u,e:ga(()=>(s(e,d??t,u??n,l),()=>{r.delete(i)}))}}function Eg(r,e,t){if(r.nodes)for(var i=r.nodes.start,n=r.nodes.end,s=e&&(e.f&Dl)===0?e.nodes.start:t;i!==null;){var a=pv(i);if(s.before(i),i===n)return;i=a}}function Mc(r,e,t){e===null?r.effect.first=t:e.next=t,t===null?r.effect.last=e:t.prev=e}function ed(r,e,t=!1,i=!1,n=!1,s=!1){var a=r,l="";if(t)var d=r;T(()=>{var u=ws;if(l!==(l=e()??"")){if(t){u.nodes=null,d.innerHTML=l,l!==""&&Dd(ta(d),d.lastChild);return}if(u.nodes!==null&&(g3(u.nodes.start,u.nodes.end),u.nodes=null),l!==""){var g=i?TT:n?MT:void 0,x=h3(i?"svg":n?"math":"template",g);x.innerHTML=l;var m=i||n?x:x.content;if(Dd(ta(m),m.lastChild),i||n)for(;ta(m);)a.before(ta(m));else a.before(m)}}})}function F3(r){var e,t,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var n=r.length;for(e=0;e<n;e++)r[e]&&(t=F3(r[e]))&&(i&&(i+=" "),i+=t)}else for(t in r)r[t]&&(i&&(i+=" "),i+=t);return i}function FM(){for(var r,e,t=0,i="",n=arguments.length;t<n;t++)(r=arguments[t])&&(e=F3(r))&&(i&&(i+=" "),i+=e);return i}function Wf(r){return typeof r=="object"?FM(r):r??""}const _8=[...`
3
3
  \r\f \v\uFEFF`];function LM(r,e,t){var i=r==null?"":""+r;if(e&&(i=i?i+" "+e:e),t){for(var n of Object.keys(t))if(t[n])i=i?i+" "+n:n;else if(i.length)for(var s=n.length,a=0;(a=i.indexOf(n,a))>=0;){var l=a+s;(a===0||_8.includes(i[a-1]))&&(l===i.length||_8.includes(i[l]))?i=(a===0?"":i.substring(0,a))+i.substring(l+1):a=l}}return i===""?null:i}function b8(r,e=!1){var t=e?" !important;":";",i="";for(var n of Object.keys(r)){var s=r[n];s!=null&&s!==""&&(i+=" "+n+": "+s+t)}return i}function Ob(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function IM(r,e){if(e){var t="",i,n;if(Array.isArray(e)?(i=e[0],n=e[1]):i=e,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,a=0,l=!1,d=[];i&&d.push(...Object.keys(i).map(Ob)),n&&d.push(...Object.keys(n).map(Ob));var u=0,g=-1;const E=r.length;for(var x=0;x<E;x++){var m=r[x];if(l?m==="/"&&r[x-1]==="*"&&(l=!1):s?s===m&&(s=!1):m==="/"&&r[x+1]==="*"?l=!0:m==='"'||m==="'"?s=m:m==="("?a++:m===")"&&a--,!l&&s===!1&&a===0){if(m===":"&&g===-1)g=x;else if(m===";"||x===E-1){if(g!==-1){var b=Ob(r.substring(u,g).trim());if(!d.includes(b)){m!==";"&&x++;var _=r.substring(u,x).trim();t+=" "+_+";"}}u=x+1,g=-1}}}}return i&&(t+=b8(i)),n&&(t+=b8(n,!0)),t=t.trim(),t===""?null:t}return r==null?null:String(r)}function zt(r,e,t,i,n,s){var a=r[wy];if(a!==t||a===void 0){var l=LM(t,i,s);l==null?r.removeAttribute("class"):e?r.className=l:r.setAttribute("class",l),r[wy]=t}else if(s&&n!==s)for(var d in s){var u=!!s[d];(n==null||u!==!!n[d])&&r.classList.toggle(d,u)}return s}function Hb(r,e={},t,i){for(var n in t){var s=t[n];e[n]!==s&&(t[n]==null?r.style.removeProperty(n):r.style.setProperty(n,s,i))}}function Po(r,e,t,i){var n=r[Ey];if(n!==e){var s=IM(e,i);s==null?r.removeAttribute("style"):r.style.cssText=s,r[Ey]=e}else i&&(Array.isArray(i)?(Hb(r,t==null?void 0:t[0],i[0]),Hb(r,t==null?void 0:t[1],i[1],"important")):Hb(r,t,i));return i}function hh(r,e,t=!1){if(r.multiple){if(e==null)return;if(!l9(e))return NT();for(var i of r.options)i.selected=e.includes(jg(i));return}for(i of r.options){var n=jg(i);if(r3(n,e)){i.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function kp(r){var e=new MutationObserver(()=>{hh(r,r.__value)});e.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),V1(()=>{e.disconnect()})}function io(r,e,t=e){var i=new WeakSet,n=!0;j1(r,"change",s=>{var a=s?"[selected]":":checked",l;if(r.multiple)l=[].map.call(r.querySelectorAll(a),jg);else{var d=r.querySelector(a)??r.querySelector("option:not([disabled])");l=d&&jg(d)}t(l),r.__value=l,Hn!==null&&i.add(Hn)}),g9(()=>{var s=e();if(r===document.activeElement){var a=Hn;if(i.has(a))return}if(hh(r,s,n),n&&s===void 0){var l=r.querySelector(":checked");l!==null&&(s=jg(l),t(s))}r.__value=s,n=!1}),kp(r)}function jg(r){return"__value"in r?r.__value:r.value}const PM=Symbol("is custom element"),TM=Symbol("is html"),MM=fT?"progress":"PROGRESS";function Ga(r,e){var t=m9(r);t.value===(t.value=e??void 0)||r.value===e&&(e!==0||r.nodeName!==MM)||(r.value=e??"")}function er(r,e){var t=m9(r);t.checked!==(t.checked=e??void 0)&&(r.checked=e)}function xi(r,e,t,i){var n=m9(r);n[e]!==(n[e]=t)&&(e==="loading"&&(r[hT]=t),t==null?r.removeAttribute(e):typeof t!="string"&&RM(r).includes(e)?r[e]=t:r.setAttribute(e,t))}function m9(r){return r[Ix]??(r[Ix]={[PM]:r.nodeName.includes("-"),[TM]:r.namespaceURI===j5})}var C8=new Map;function RM(r){var e=r.getAttribute("is")||r.nodeName,t=C8.get(e);if(t)return t;C8.set(e,t=[]);for(var i,n=r,s=Element.prototype;s!==n;){i=sT(n);for(var a in i)i[a].set&&a!=="innerHTML"&&a!=="textContent"&&a!=="innerText"&&t.push(a);n=R5(n)}return t}function di(r,e,t=e){var i=new WeakSet;j1(r,"input",async n=>{var s=n?r.defaultValue:r.value;if(s=Wb(r)?jb(s):s,t(s),Hn!==null&&i.add(Hn),await xa(),s!==(s=e())){var a=r.selectionStart,l=r.selectionEnd,d=r.value.length;if(r.value=s??"",l!==null){var u=r.value.length;a===l&&l===d&&u>d?(r.selectionStart=u,r.selectionEnd=u):(r.selectionStart=a,r.selectionEnd=Math.min(l,u))}}}),Lo(e)==null&&r.value&&(t(Wb(r)?jb(r.value):r.value),Hn!==null&&i.add(Hn)),gv(()=>{var n=e();if(r===document.activeElement){var s=Hn;if(i.has(s))return}Wb(r)&&n===jb(r.value)||r.type==="date"&&!n&&!r.value||n!==r.value&&(r.value=n??"")})}const zb=new Set;function xu(r,e,t,i,n=i){var s=t.getAttribute("type")==="checkbox",a=r;if(e!==null)for(var l of e)a=a[l]??(a[l]=[]);a.push(t),j1(t,"change",()=>{var d=t.__value;s&&(d=NM(a,d,t.checked)),n(d)},()=>n(s?[]:null)),gv(()=>{var d=i();s?(d=d||[],t.checked=d.includes(t.__value)):t.checked=r3(t.__value,d)}),V1(()=>{var d=a.indexOf(t);d!==-1&&a.splice(d,1)}),zb.has(a)||(zb.add(a),Il(()=>{a.sort((d,u)=>d.compareDocumentPosition(u)===4?-1:1),zb.delete(a)})),Il(()=>{})}function Ds(r,e,t=e){j1(r,"change",i=>{var n=i?r.defaultChecked:r.checked;t(n)}),Lo(e)==null&&t(r.checked),gv(()=>{var i=e();r.checked=!!i})}function NM(r,e,t){for(var i=new Set,n=0;n<r.length;n+=1)r[n].checked&&i.add(r[n].__value);return t||i.delete(e),Array.from(i)}function Wb(r){var e=r.type;return e==="number"||e==="range"}function jb(r){return r===""?null:+r}var Xc,ep,Y0,A_,L3;const B_=class B_{constructor(e){ts(this,A_);ts(this,Xc,new WeakMap);ts(this,ep);ts(this,Y0);is(this,Y0,e)}observe(e,t){var i=Ut(this,Xc).get(e)||new Set;return i.add(t),Ut(this,Xc).set(e,i),Os(this,A_,L3).call(this).observe(e,Ut(this,Y0)),()=>{var n=Ut(this,Xc).get(e);n.delete(t),n.size===0&&(Ut(this,Xc).delete(e),Ut(this,ep).unobserve(e))}}};Xc=new WeakMap,ep=new WeakMap,Y0=new WeakMap,A_=new WeakSet,L3=function(){return Ut(this,ep)??is(this,ep,new ResizeObserver(e=>{for(var t of e){B_.entries.set(t.target,t);for(var i of Ut(this,Xc).get(t.target)||[])i(t)}}))},cs(B_,"entries",new WeakMap);let My=B_;var OM=new My({box:"border-box"});function HM(r,e,t){var i=OM.observe(r,()=>t(r[e]));g9(()=>(Lo(()=>t(r[e])),i))}function Vb(r,e){return r===e||(r==null?void 0:r[fu])===e}function ds(r={},e,t,i){var n=ir.r,s=ws;return g9(()=>{var a,l;return gv(()=>{a=l,l=[],Lo(()=>{Vb(t(...l),r)||(e(r,...l),a&&Vb(t(...a),r)&&e(null,...a))})}),()=>{let d=s;for(;d!==n&&d.parent!==null&&d.parent.f&yy;)d=d.parent;const u=()=>{l&&Vb(t(...l),r)&&e(null,...l)},g=d.teardown;d.teardown=()=>{u(),g==null||g()}}}),r}function Mn(r,e,t,i){var O;var n=!0,s=(t&LT)!==0,a=(t&IT)!==0,l=i,d=!0,u=void 0,g=()=>a&&n?(u??(u=p0(i)),o(u)):(d&&(d=!1,l=a?Lo(i):i),l);let x;if(s){var m=fu in r||uT in r;x=((O=Hf(r,e))==null?void 0:O.set)??(m&&e in r?z=>r[e]=z:void 0)}var b,_=!1;s?[b,_]=VT(()=>r[e]):b=r[e],b===void 0&&i!==void 0&&(b=g(),x&&(bT(),x(b)));var E;if(E=()=>{var z=r[e];return z===void 0?g():(d=!0,z)},(t&FT)===0)return E;if(x){var k=r.$$legacy;return(function(z,G){return arguments.length>0?((!G||k||_)&&x(G?E():z),z):E()})}var I=!1,M=((t&BT)!==0?p0:h9)(()=>(I=!1,E()));s&&o(M);var N=ws;return(function(z,G){if(arguments.length>0){const U=G?o(M):s?yi(z):z;return p(M,U),I=!0,l!==void 0&&(l=U),z}return mc&&I||(N.f&Ea)!==0?M.v:o(M)})}function Ws(r){ir===null&&H5(),ln(()=>{const e=Lo(r);if(typeof e=="function")return e})}function Lh(r){ir===null&&H5(),Ws(()=>()=>Lo(r))}const zM="5";var s6;typeof window<"u"&&((s6=window.__svelte??(window.__svelte={})).v??(s6.v=new Set)).add(zM);/*!-----------------------------------------------------------------------------
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10,7 +10,7 @@ var CF=Object.defineProperty;var I2=r=>{throw TypeError(r)};var yF=(r,e,t)=>e in
10
10
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
11
11
  * Released under the MIT license
12
12
  * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
13
- *-----------------------------------------------------------------------------*/var XM=Object.defineProperty,QM=Object.getOwnPropertyDescriptor,JM=Object.getOwnPropertyNames,eR=Object.prototype.hasOwnProperty,tR=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of JM(e))!eR.call(r,n)&&n!==t&&XM(r,n,{get:()=>e[n],enumerable:!(i=QM(e,n))||i.enumerable});return r},iR=(r,e,t)=>(tR(r,e,"default"),t),nR="5.4.5",Dp={};iR(Dp,r6);var T3=(r=>(r[r.None=0]="None",r[r.CommonJS=1]="CommonJS",r[r.AMD=2]="AMD",r[r.UMD=3]="UMD",r[r.System=4]="System",r[r.ES2015=5]="ES2015",r[r.ESNext=99]="ESNext",r))(T3||{}),M3=(r=>(r[r.None=0]="None",r[r.Preserve=1]="Preserve",r[r.React=2]="React",r[r.ReactNative=3]="ReactNative",r[r.ReactJSX=4]="ReactJSX",r[r.ReactJSXDev=5]="ReactJSXDev",r))(M3||{}),R3=(r=>(r[r.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",r[r.LineFeed=1]="LineFeed",r))(R3||{}),N3=(r=>(r[r.ES3=0]="ES3",r[r.ES5=1]="ES5",r[r.ES2015=2]="ES2015",r[r.ES2016=3]="ES2016",r[r.ES2017=4]="ES2017",r[r.ES2018=5]="ES2018",r[r.ES2019=6]="ES2019",r[r.ES2020=7]="ES2020",r[r.ESNext=99]="ESNext",r[r.JSON=100]="JSON",r[r.Latest=99]="Latest",r))(N3||{}),O3=(r=>(r[r.Classic=1]="Classic",r[r.NodeJs=2]="NodeJs",r))(O3||{}),H3=class{constructor(r,e,t,i,n){this._onDidChange=new Dp.Emitter,this._onDidExtraLibsChange=new Dp.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(r),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(r,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===r)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:r,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(r){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),r&&r.length>0)for(const e of r){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(r){this._compilerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(r){this._diagnosticsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(r){this._workerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(r){this._inlayHintsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(r){}setEagerModelSync(r){this._eagerModelSync=r}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(r){this._modeConfiguration=r||Object.create(null),this._onDidChange.fire(void 0)}},sR=nR,z3={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},W3=new H3({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},z3),j3=new H3({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},z3),oR=()=>q1().then(r=>r.getTypeScriptWorker()),rR=()=>q1().then(r=>r.getJavaScriptWorker());Dp.languages.typescript={ModuleKind:T3,JsxEmit:M3,NewLineKind:R3,ScriptTarget:N3,ModuleResolutionKind:O3,typescriptVersion:sR,typescriptDefaults:W3,javascriptDefaults:j3,getTypeScriptWorker:oR,getJavaScriptWorker:rR};function q1(){return o6(()=>import("./tsMode-DDvVFMm4.js"),__vite__mapDeps([3,1,2]))}Dp.languages.onLanguage("typescript",()=>q1().then(r=>r.setupTypeScript(W3)));Dp.languages.onLanguage("javascript",()=>q1().then(r=>r.setupJavaScript(j3)));class aR extends pr{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:cn("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Bn.map,toggled:ai.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ai.has("isInDiffEditor"),menu:{when:ai.has("isInDiffEditor"),id:Xi.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(js),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class V3 extends pr{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:cn("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:ai.has("isInDiffEditor")})}run(e,...t){const i=e.get(js),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class $3 extends pr{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:cn("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:ai.has("isInDiffEditor")})}run(e,...t){const i=e.get(js),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const mv=cn("diffEditor","Diff Editor");class lR extends Qa{constructor(){super({id:"diffEditor.switchSide",title:cn("switchSide","Switch Side"),icon:Bn.arrowSwap,precondition:ai.has("isInDiffEditor"),f1:!0,category:mv})}runEditorCommand(e,t,i){const n=Yp(e);if(n instanceof X0){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class cR extends Qa{constructor(){super({id:"diffEditor.exitCompareMove",title:cn("exitCompareMove","Exit Compare Move"),icon:Bn.close,precondition:fe.comparingMovedCode,f1:!1,category:mv,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Yp(e);n instanceof X0&&n.exitCompareMove()}}class dR extends Qa{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:cn("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Bn.fold,precondition:ai.has("isInDiffEditor"),f1:!0,category:mv})}runEditorCommand(e,t,...i){const n=Yp(e);n instanceof X0&&n.collapseAllUnchangedRegions()}}class uR extends Qa{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:cn("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Bn.unfold,precondition:ai.has("isInDiffEditor"),f1:!0,category:mv})}runEditorCommand(e,t,...i){const n=Yp(e);n instanceof X0&&n.showAllUnchangedRegions()}}class Ry extends pr{constructor(){super({id:"diffEditor.revert",title:cn("revert","Revert"),f1:!1,category:mv})}run(e,t){const i=hR(e,t.originalUri,t.modifiedUri);i instanceof X0&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const q3=cn("accessibleDiffViewer","Accessible Diff Viewer"),F_=class F_ extends pr{constructor(){super({id:F_.id,title:cn("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:q3,precondition:ai.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Yp(e);t==null||t.accessibleDiffViewerNext()}};F_.id="editor.action.accessibleDiffViewer.next";let v0=F_;const L_=class L_ extends pr{constructor(){super({id:L_.id,title:cn("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:q3,precondition:ai.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Yp(e);t==null||t.accessibleDiffViewerPrev()}};L_.id="editor.action.accessibleDiffViewer.prev";let _m=L_;function hR(r,e,t){return r.get(ao).listDiffEditors().find(s=>{var d,u;const a=s.getModifiedEditor(),l=s.getOriginalEditor();return a&&((d=a.getModel())==null?void 0:d.uri.toString())===t.toString()&&l&&((u=l.getModel())==null?void 0:u.uri.toString())===e.toString()})||null}function Yp(r){const t=r.get(ao).listDiffEditors(),i=a6();if(i)for(const n of t){const s=n.getContainerDomNode();if(fR(s,i))return n}return null}function fR(r,e){let t=e;for(;t;){if(t===r)return!0;t=t.parentElement}return!1}Es(aR);Es(V3);Es($3);ka.appendMenuItem(Xi.EditorTitle,{command:{id:new $3().desc.id,title:F("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ai.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ai.has("isInDiffEditor")},order:11,group:"1_diff",when:ai.and(fe.diffEditorRenderSideBySideInlineBreakpointReached,ai.has("isInDiffEditor"))});ka.appendMenuItem(Xi.EditorTitle,{command:{id:new V3().desc.id,title:F("showMoves","Show Moved Code Blocks"),icon:Bn.move,toggled:wF.create("config.diffEditor.experimental.showMoves",!0),precondition:ai.has("isInDiffEditor")},order:10,group:"1_diff",when:ai.has("isInDiffEditor")});Es(Ry);for(const r of[{icon:Bn.arrowRight,key:fe.diffEditorInlineMode.toNegated()},{icon:Bn.discard,key:fe.diffEditorInlineMode}])ka.appendMenuItem(Xi.DiffEditorHunkToolbar,{command:{id:new Ry().desc.id,title:F("revertHunk","Revert Block"),icon:r.icon},when:ai.and(fe.diffEditorModifiedWritable,r.key),order:5,group:"primary"}),ka.appendMenuItem(Xi.DiffEditorSelectionToolbar,{command:{id:new Ry().desc.id,title:F("revertSelection","Revert Selection"),icon:r.icon},when:ai.and(fe.diffEditorModifiedWritable,r.key),order:5,group:"primary"});Es(lR);Es(cR);Es(dR);Es(uR);ka.appendMenuItem(Xi.EditorTitle,{command:{id:v0.id,title:F("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ai.has("isInDiffEditor")},order:10,group:"2_diff",when:ai.and(fe.accessibleDiffViewerVisible.negate(),ai.has("isInDiffEditor"))});Ns.registerCommandAlias("editor.action.diffReview.next",v0.id);Es(v0);Ns.registerCommandAlias("editor.action.diffReview.prev",_m.id);Es(_m);var pR=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gR=function(r,e){return function(t,i){e(t,i,r)}},Ny;const U1=new ns("selectionAnchorSet",!1);var Cu;let Ad=(Cu=class{static get(e){return e.getContribution(Ny.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=U1.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(En.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Yo().appendText(F("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Da(F("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(En.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},Ny=Cu,Cu.ID="editor.contrib.selectionAnchorController",Cu);Ad=Ny=pR([gR(1,hs)],Ad);class vR extends ki{constructor(){super({id:"editor.action.setSelectionAnchor",label:F("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:fe.editorTextFocus,primary:uo(2089,2080),weight:100}})}async run(e,t){var i;(i=Ad.get(t))==null||i.setSelectionAnchor()}}class xR extends ki{constructor(){super({id:"editor.action.goToSelectionAnchor",label:F("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:U1})}async run(e,t){var i;(i=Ad.get(t))==null||i.goToSelectionAnchor()}}class mR extends ki{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:F("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:U1,kbOpts:{kbExpr:fe.editorTextFocus,primary:uo(2089,2089),weight:100}})}async run(e,t){var i;(i=Ad.get(t))==null||i.selectFromAnchorToCursor()}}class _R extends ki{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:F("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:U1,kbOpts:{kbExpr:fe.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=Ad.get(t))==null||i.cancelSelectionAnchor()}}Kn(Ad.ID,Ad,4);Yt(vR);Yt(xR);Yt(mR);Yt(_R);const bR=rn("editorOverviewRuler.bracketMatchForeground","#A0A0A0",F("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class CR extends ki{constructor(){super({id:"editor.action.jumpToBracket",label:F("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:fe.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=fh.get(t))==null||i.jumpToBracket()}}class yR extends ki{constructor(){super({id:"editor.action.selectToBracket",label:F("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:cn("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var s;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(s=fh.get(t))==null||s.selectToBracket(n)}}class wR extends ki{constructor(){super({id:"editor.action.removeBrackets",label:F("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:fe.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=fh.get(t))==null||i.removeBrackets(this.id)}}class ER{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const Vc=class Vc extends Wi{static get(e){return e.getContribution(Vc.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new xo(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let a=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?a=s[1].getStartPosition():s[1].containsPosition(n)&&(a=s[0].getStartPosition());else{const l=e.bracketPairs.findEnclosingBrackets(n);if(l)a=l[1].getStartPosition();else{const d=e.bracketPairs.findNextBracket(n);d&&d.range&&(a=d.range.getStartPosition())}}return a?new En(a.lineNumber,a.column,a.lineNumber,a.column):new En(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let a=t.bracketPairs.matchBracket(s);if(!a&&(a=t.bracketPairs.findEnclosingBrackets(s),!a)){const u=t.bracketPairs.findNextBracket(s);u&&u.range&&(a=t.bracketPairs.matchBracket(u.range.getStartPosition()))}let l=null,d=null;if(a){a.sort(Xe.compareRangesUsingStarts);const[u,g]=a;if(l=e?u.getStartPosition():u.getEndPosition(),d=e?g.getEndPosition():g.getStartPosition(),g.containsPosition(s)){const x=l;l=d,d=x}}l&&d&&i.push(new En(l.lineNumber,l.column,d.lineNumber,d.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let a=0;for(let x=0,m=e.length;x<m;x++){const b=e[x];b.isEmpty()&&(s[a++]=b.getStartPosition())}s.length>1&&s.sort(hn.compare);const l=[];let d=0,u=0;const g=n.length;for(let x=0,m=s.length;x<m;x++){const b=s[x];for(;u<g&&n[u].position.isBefore(b);)u++;if(u<g&&n[u].position.equals(b))l[d++]=n[u];else{let _=t.bracketPairs.matchBracket(b,20),E=Vc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!_&&this._matchBrackets==="always"&&(_=t.bracketPairs.findEnclosingBrackets(b,20),E=Vc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),l[d++]=new ER(b,_,E)}}this._lastBracketsData=l,this._lastVersionId=i}};Vc.ID="editor.contrib.bracketMatchingController",Vc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Jn.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:po(bR),position:Bl.Center}}),Vc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Jn.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let fh=Vc;Kn(fh.ID,fh,1);Yt(yR);Yt(CR);Yt(wR);ka.appendMenuItem(Xi.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:F({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class SR{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const a=new Xe(i,n-1,i,n),l=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new Xe(i,s,i,s),l)}else{const a=new Xe(i,s,i,s+1),l=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new Xe(i,n,i,n),l)}}computeCursorState(e,t){return this._isMovingLeft?new En(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new En(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class U3 extends ki{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new SR(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class kR extends U3{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:F("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:fe.writable})}}class DR extends U3{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:F("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:fe.writable})}}Yt(kR);Yt(DR);class AR extends ki{constructor(){super({id:"editor.action.transposeLetters",label:F("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:fe.writable,kbOpts:{kbExpr:fe.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const a of s){if(!a.isEmpty())continue;const l=a.startLineNumber,d=a.startColumn,u=i.getLineMaxColumn(l);if(l===1&&(d===1||d===2&&u===2))continue;const g=d===u?a.getPosition():Ab.rightPosition(i,a.getPosition().lineNumber,a.getPosition().column),x=Ab.leftPosition(i,g),m=Ab.leftPosition(i,x),b=i.getValueInRange(Xe.fromPositions(m,x)),_=i.getValueInRange(Xe.fromPositions(x,g)),E=Xe.fromPositions(m,g);n.push(new Q0(E,_+b))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Yt(AR);const G1=(function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let r;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?r=crypto.getRandomValues.bind(crypto):r=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){r(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,s="";return s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s}})();function _9(r){return{asString:async()=>r,asFile:()=>{},value:typeof r=="string"?r:void 0}}function BR(r,e,t){const i={id:G1(),name:r,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class G3{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return ac.some(this,([i,n])=>n.asFile())&&t.push("files"),Z3(bm(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return bm(e)}}function bm(r){return r.toLowerCase()}function K3(r,e){return Z3(bm(r),e.map(bm))}function Z3(r,e){if(r==="*/*")return e.length>0;if(e.includes(r))return!0;const t=r.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(a=>a.startsWith(n+"/")):!1}const K1=Object.freeze({create:r=>l6(r.map(e=>e.toString())).join(`\r
13
+ *-----------------------------------------------------------------------------*/var XM=Object.defineProperty,QM=Object.getOwnPropertyDescriptor,JM=Object.getOwnPropertyNames,eR=Object.prototype.hasOwnProperty,tR=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of JM(e))!eR.call(r,n)&&n!==t&&XM(r,n,{get:()=>e[n],enumerable:!(i=QM(e,n))||i.enumerable});return r},iR=(r,e,t)=>(tR(r,e,"default"),t),nR="5.4.5",Dp={};iR(Dp,r6);var T3=(r=>(r[r.None=0]="None",r[r.CommonJS=1]="CommonJS",r[r.AMD=2]="AMD",r[r.UMD=3]="UMD",r[r.System=4]="System",r[r.ES2015=5]="ES2015",r[r.ESNext=99]="ESNext",r))(T3||{}),M3=(r=>(r[r.None=0]="None",r[r.Preserve=1]="Preserve",r[r.React=2]="React",r[r.ReactNative=3]="ReactNative",r[r.ReactJSX=4]="ReactJSX",r[r.ReactJSXDev=5]="ReactJSXDev",r))(M3||{}),R3=(r=>(r[r.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",r[r.LineFeed=1]="LineFeed",r))(R3||{}),N3=(r=>(r[r.ES3=0]="ES3",r[r.ES5=1]="ES5",r[r.ES2015=2]="ES2015",r[r.ES2016=3]="ES2016",r[r.ES2017=4]="ES2017",r[r.ES2018=5]="ES2018",r[r.ES2019=6]="ES2019",r[r.ES2020=7]="ES2020",r[r.ESNext=99]="ESNext",r[r.JSON=100]="JSON",r[r.Latest=99]="Latest",r))(N3||{}),O3=(r=>(r[r.Classic=1]="Classic",r[r.NodeJs=2]="NodeJs",r))(O3||{}),H3=class{constructor(r,e,t,i,n){this._onDidChange=new Dp.Emitter,this._onDidExtraLibsChange=new Dp.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(r),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(r,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===r)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:r,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(r){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),r&&r.length>0)for(const e of r){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(r){this._compilerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(r){this._diagnosticsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(r){this._workerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(r){this._inlayHintsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(r){}setEagerModelSync(r){this._eagerModelSync=r}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(r){this._modeConfiguration=r||Object.create(null),this._onDidChange.fire(void 0)}},sR=nR,z3={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},W3=new H3({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},z3),j3=new H3({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},z3),oR=()=>q1().then(r=>r.getTypeScriptWorker()),rR=()=>q1().then(r=>r.getJavaScriptWorker());Dp.languages.typescript={ModuleKind:T3,JsxEmit:M3,NewLineKind:R3,ScriptTarget:N3,ModuleResolutionKind:O3,typescriptVersion:sR,typescriptDefaults:W3,javascriptDefaults:j3,getTypeScriptWorker:oR,getJavaScriptWorker:rR};function q1(){return o6(()=>import("./tsMode-CWVhEJ2t.js"),__vite__mapDeps([3,1,2]))}Dp.languages.onLanguage("typescript",()=>q1().then(r=>r.setupTypeScript(W3)));Dp.languages.onLanguage("javascript",()=>q1().then(r=>r.setupJavaScript(j3)));class aR extends pr{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:cn("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Bn.map,toggled:ai.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ai.has("isInDiffEditor"),menu:{when:ai.has("isInDiffEditor"),id:Xi.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(js),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class V3 extends pr{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:cn("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:ai.has("isInDiffEditor")})}run(e,...t){const i=e.get(js),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class $3 extends pr{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:cn("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:ai.has("isInDiffEditor")})}run(e,...t){const i=e.get(js),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const mv=cn("diffEditor","Diff Editor");class lR extends Qa{constructor(){super({id:"diffEditor.switchSide",title:cn("switchSide","Switch Side"),icon:Bn.arrowSwap,precondition:ai.has("isInDiffEditor"),f1:!0,category:mv})}runEditorCommand(e,t,i){const n=Yp(e);if(n instanceof X0){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class cR extends Qa{constructor(){super({id:"diffEditor.exitCompareMove",title:cn("exitCompareMove","Exit Compare Move"),icon:Bn.close,precondition:fe.comparingMovedCode,f1:!1,category:mv,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Yp(e);n instanceof X0&&n.exitCompareMove()}}class dR extends Qa{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:cn("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Bn.fold,precondition:ai.has("isInDiffEditor"),f1:!0,category:mv})}runEditorCommand(e,t,...i){const n=Yp(e);n instanceof X0&&n.collapseAllUnchangedRegions()}}class uR extends Qa{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:cn("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Bn.unfold,precondition:ai.has("isInDiffEditor"),f1:!0,category:mv})}runEditorCommand(e,t,...i){const n=Yp(e);n instanceof X0&&n.showAllUnchangedRegions()}}class Ry extends pr{constructor(){super({id:"diffEditor.revert",title:cn("revert","Revert"),f1:!1,category:mv})}run(e,t){const i=hR(e,t.originalUri,t.modifiedUri);i instanceof X0&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const q3=cn("accessibleDiffViewer","Accessible Diff Viewer"),F_=class F_ extends pr{constructor(){super({id:F_.id,title:cn("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:q3,precondition:ai.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Yp(e);t==null||t.accessibleDiffViewerNext()}};F_.id="editor.action.accessibleDiffViewer.next";let v0=F_;const L_=class L_ extends pr{constructor(){super({id:L_.id,title:cn("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:q3,precondition:ai.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Yp(e);t==null||t.accessibleDiffViewerPrev()}};L_.id="editor.action.accessibleDiffViewer.prev";let _m=L_;function hR(r,e,t){return r.get(ao).listDiffEditors().find(s=>{var d,u;const a=s.getModifiedEditor(),l=s.getOriginalEditor();return a&&((d=a.getModel())==null?void 0:d.uri.toString())===t.toString()&&l&&((u=l.getModel())==null?void 0:u.uri.toString())===e.toString()})||null}function Yp(r){const t=r.get(ao).listDiffEditors(),i=a6();if(i)for(const n of t){const s=n.getContainerDomNode();if(fR(s,i))return n}return null}function fR(r,e){let t=e;for(;t;){if(t===r)return!0;t=t.parentElement}return!1}Es(aR);Es(V3);Es($3);ka.appendMenuItem(Xi.EditorTitle,{command:{id:new $3().desc.id,title:F("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ai.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ai.has("isInDiffEditor")},order:11,group:"1_diff",when:ai.and(fe.diffEditorRenderSideBySideInlineBreakpointReached,ai.has("isInDiffEditor"))});ka.appendMenuItem(Xi.EditorTitle,{command:{id:new V3().desc.id,title:F("showMoves","Show Moved Code Blocks"),icon:Bn.move,toggled:wF.create("config.diffEditor.experimental.showMoves",!0),precondition:ai.has("isInDiffEditor")},order:10,group:"1_diff",when:ai.has("isInDiffEditor")});Es(Ry);for(const r of[{icon:Bn.arrowRight,key:fe.diffEditorInlineMode.toNegated()},{icon:Bn.discard,key:fe.diffEditorInlineMode}])ka.appendMenuItem(Xi.DiffEditorHunkToolbar,{command:{id:new Ry().desc.id,title:F("revertHunk","Revert Block"),icon:r.icon},when:ai.and(fe.diffEditorModifiedWritable,r.key),order:5,group:"primary"}),ka.appendMenuItem(Xi.DiffEditorSelectionToolbar,{command:{id:new Ry().desc.id,title:F("revertSelection","Revert Selection"),icon:r.icon},when:ai.and(fe.diffEditorModifiedWritable,r.key),order:5,group:"primary"});Es(lR);Es(cR);Es(dR);Es(uR);ka.appendMenuItem(Xi.EditorTitle,{command:{id:v0.id,title:F("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ai.has("isInDiffEditor")},order:10,group:"2_diff",when:ai.and(fe.accessibleDiffViewerVisible.negate(),ai.has("isInDiffEditor"))});Ns.registerCommandAlias("editor.action.diffReview.next",v0.id);Es(v0);Ns.registerCommandAlias("editor.action.diffReview.prev",_m.id);Es(_m);var pR=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gR=function(r,e){return function(t,i){e(t,i,r)}},Ny;const U1=new ns("selectionAnchorSet",!1);var Cu;let Ad=(Cu=class{static get(e){return e.getContribution(Ny.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=U1.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(En.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Yo().appendText(F("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Da(F("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(En.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},Ny=Cu,Cu.ID="editor.contrib.selectionAnchorController",Cu);Ad=Ny=pR([gR(1,hs)],Ad);class vR extends ki{constructor(){super({id:"editor.action.setSelectionAnchor",label:F("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:fe.editorTextFocus,primary:uo(2089,2080),weight:100}})}async run(e,t){var i;(i=Ad.get(t))==null||i.setSelectionAnchor()}}class xR extends ki{constructor(){super({id:"editor.action.goToSelectionAnchor",label:F("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:U1})}async run(e,t){var i;(i=Ad.get(t))==null||i.goToSelectionAnchor()}}class mR extends ki{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:F("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:U1,kbOpts:{kbExpr:fe.editorTextFocus,primary:uo(2089,2089),weight:100}})}async run(e,t){var i;(i=Ad.get(t))==null||i.selectFromAnchorToCursor()}}class _R extends ki{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:F("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:U1,kbOpts:{kbExpr:fe.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=Ad.get(t))==null||i.cancelSelectionAnchor()}}Kn(Ad.ID,Ad,4);Yt(vR);Yt(xR);Yt(mR);Yt(_R);const bR=rn("editorOverviewRuler.bracketMatchForeground","#A0A0A0",F("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class CR extends ki{constructor(){super({id:"editor.action.jumpToBracket",label:F("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:fe.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=fh.get(t))==null||i.jumpToBracket()}}class yR extends ki{constructor(){super({id:"editor.action.selectToBracket",label:F("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:cn("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var s;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(s=fh.get(t))==null||s.selectToBracket(n)}}class wR extends ki{constructor(){super({id:"editor.action.removeBrackets",label:F("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:fe.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=fh.get(t))==null||i.removeBrackets(this.id)}}class ER{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const Vc=class Vc extends Wi{static get(e){return e.getContribution(Vc.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new xo(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let a=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?a=s[1].getStartPosition():s[1].containsPosition(n)&&(a=s[0].getStartPosition());else{const l=e.bracketPairs.findEnclosingBrackets(n);if(l)a=l[1].getStartPosition();else{const d=e.bracketPairs.findNextBracket(n);d&&d.range&&(a=d.range.getStartPosition())}}return a?new En(a.lineNumber,a.column,a.lineNumber,a.column):new En(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let a=t.bracketPairs.matchBracket(s);if(!a&&(a=t.bracketPairs.findEnclosingBrackets(s),!a)){const u=t.bracketPairs.findNextBracket(s);u&&u.range&&(a=t.bracketPairs.matchBracket(u.range.getStartPosition()))}let l=null,d=null;if(a){a.sort(Xe.compareRangesUsingStarts);const[u,g]=a;if(l=e?u.getStartPosition():u.getEndPosition(),d=e?g.getEndPosition():g.getStartPosition(),g.containsPosition(s)){const x=l;l=d,d=x}}l&&d&&i.push(new En(l.lineNumber,l.column,d.lineNumber,d.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let a=0;for(let x=0,m=e.length;x<m;x++){const b=e[x];b.isEmpty()&&(s[a++]=b.getStartPosition())}s.length>1&&s.sort(hn.compare);const l=[];let d=0,u=0;const g=n.length;for(let x=0,m=s.length;x<m;x++){const b=s[x];for(;u<g&&n[u].position.isBefore(b);)u++;if(u<g&&n[u].position.equals(b))l[d++]=n[u];else{let _=t.bracketPairs.matchBracket(b,20),E=Vc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!_&&this._matchBrackets==="always"&&(_=t.bracketPairs.findEnclosingBrackets(b,20),E=Vc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),l[d++]=new ER(b,_,E)}}this._lastBracketsData=l,this._lastVersionId=i}};Vc.ID="editor.contrib.bracketMatchingController",Vc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Jn.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:po(bR),position:Bl.Center}}),Vc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Jn.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let fh=Vc;Kn(fh.ID,fh,1);Yt(yR);Yt(CR);Yt(wR);ka.appendMenuItem(Xi.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:F({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class SR{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const a=new Xe(i,n-1,i,n),l=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new Xe(i,s,i,s),l)}else{const a=new Xe(i,s,i,s+1),l=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new Xe(i,n,i,n),l)}}computeCursorState(e,t){return this._isMovingLeft?new En(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new En(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class U3 extends ki{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new SR(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class kR extends U3{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:F("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:fe.writable})}}class DR extends U3{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:F("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:fe.writable})}}Yt(kR);Yt(DR);class AR extends ki{constructor(){super({id:"editor.action.transposeLetters",label:F("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:fe.writable,kbOpts:{kbExpr:fe.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const a of s){if(!a.isEmpty())continue;const l=a.startLineNumber,d=a.startColumn,u=i.getLineMaxColumn(l);if(l===1&&(d===1||d===2&&u===2))continue;const g=d===u?a.getPosition():Ab.rightPosition(i,a.getPosition().lineNumber,a.getPosition().column),x=Ab.leftPosition(i,g),m=Ab.leftPosition(i,x),b=i.getValueInRange(Xe.fromPositions(m,x)),_=i.getValueInRange(Xe.fromPositions(x,g)),E=Xe.fromPositions(m,g);n.push(new Q0(E,_+b))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Yt(AR);const G1=(function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let r;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?r=crypto.getRandomValues.bind(crypto):r=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){r(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,s="";return s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s}})();function _9(r){return{asString:async()=>r,asFile:()=>{},value:typeof r=="string"?r:void 0}}function BR(r,e,t){const i={id:G1(),name:r,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class G3{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return ac.some(this,([i,n])=>n.asFile())&&t.push("files"),Z3(bm(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return bm(e)}}function bm(r){return r.toLowerCase()}function K3(r,e){return Z3(bm(r),e.map(bm))}function Z3(r,e){if(r==="*/*")return e.length>0;if(e.includes(r))return!0;const t=r.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(a=>a.startsWith(n+"/")):!1}const K1=Object.freeze({create:r=>l6(r.map(e=>e.toString())).join(`\r
14
14
  `),split:r=>r.split(`\r
15
15
  `),parse:r=>K1.split(r).filter(e=>!e.startsWith("#"))}),gl=class gl{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+gl.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new gl((this.value?[this.value,...e]:e).join(gl.sep))}};gl.sep=".",gl.None=new gl("@@none@@"),gl.Empty=new gl("");let zs=gl;const y8={EDITORS:"CodeEditors",FILES:"CodeFiles"};class FR{}const LR={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Ja.add(LR.DragAndDropContribution,new FR);const Jg=class Jg{constructor(){}static getInstance(){return Jg.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};Jg.INSTANCE=new Jg;let Oy=Jg;function Y3(r){const e=new G3;for(const t of r.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,_9(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,IR(n))}}return e}function IR(r){const e=r.path?As.parse(r.path):void 0;return BR(r.name,e,async()=>new Uint8Array(await r.arrayBuffer()))}const PR=Object.freeze([y8.EDITORS,y8.FILES,oy.RESOURCES,oy.INTERNAL_URI_LIST]);function X3(r,e=!1){const t=Y3(r),i=t.get(oy.INTERNAL_URI_LIST);if(i)t.replace(To.uriList,i);else if(e||!t.has(To.uriList)){const n=[];for(const s of r.items){const a=s.getAsFile();if(a){const l=a.path;try{l?n.push(As.file(l).toString()):n.push(As.parse(a.name,!0).toString())}catch{}}}n.length&&t.replace(To.uriList,_9(K1.create(n)))}for(const n of PR)t.delete(n);return t}var b9=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},x0=function(r,e){return function(t,i){e(t,i,r)}};class C9{async provideDocumentPasteEdits(e,t,i,n,s){const a=await this.getEdit(i,s);if(a)return{edits:[{insertText:a.insertText,title:a.title,kind:a.kind,handledMimeType:a.handledMimeType,yieldTo:a.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const s=await this.getEdit(i,n);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}}const e0=class e0 extends C9{constructor(){super(...arguments),this.kind=e0.kind,this.dropMimeTypes=[To.text],this.pasteMimeTypes=[To.text]}async getEdit(e,t){const i=e.get(To.text);if(!i||e.has(To.uriList))return;const n=await i.asString();return{handledMimeType:To.text,title:F("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}};e0.id="text",e0.kind=new zs("text.plain");let ph=e0;class Q3 extends C9{constructor(){super(...arguments),this.kind=new zs("uri.absolute"),this.dropMimeTypes=[To.uriList],this.pasteMimeTypes=[To.uriList]}async getEdit(e,t){const i=await J3(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:l,originalText:d})=>l.scheme===cr.file?l.fsPath:(n++,d)).join(" ");let a;return n>0?a=i.length>1?F("defaultDropProvider.uriList.uris","Insert Uris"):F("defaultDropProvider.uriList.uri","Insert Uri"):a=i.length>1?F("defaultDropProvider.uriList.paths","Insert Paths"):F("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:To.uriList,insertText:s,title:a,kind:this.kind}}}let Cm=class extends C9{constructor(e){super(),this._workspaceContextService=e,this.kind=new zs("uri.relative"),this.dropMimeTypes=[To.uriList],this.pasteMimeTypes=[To.uriList]}async getEdit(e,t){const i=await J3(e);if(!i.length||t.isCancellationRequested)return;const n=fc(i.map(({uri:s})=>{const a=this._workspaceContextService.getWorkspaceFolder(s);return a?EF(a.uri,s):void 0}));if(n.length)return{handledMimeType:To.uriList,insertText:n.join(" "),title:i.length>1?F("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):F("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};Cm=b9([x0(0,up)],Cm);class TR{constructor(){this.kind=new zs("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:To.text}]}async provideDocumentPasteEdits(e,t,i,n,s){var d;if(n.triggerKind!==ry.PasteAs&&!((d=n.only)!=null&&d.contains(this.kind)))return;const a=i.get("text/html"),l=await(a==null?void 0:a.asString());if(!(!l||s.isCancellationRequested))return{dispose(){},edits:[{insertText:l,yieldTo:this._yieldTo,title:F("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function J3(r){const e=r.get(To.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of K1.parse(t))try{i.push({uri:As.parse(n),originalText:n})}catch{}return i}let Hy=class extends Wi{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new ph)),this._register(e.documentDropEditProvider.register("*",new Q3)),this._register(e.documentDropEditProvider.register("*",new Cm(t)))}};Hy=b9([x0(0,fn),x0(1,up)],Hy);let zy=class extends Wi{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new ph)),this._register(e.documentPasteEditProvider.register("*",new Q3)),this._register(e.documentPasteEditProvider.register("*",new Cm(t))),this._register(e.documentPasteEditProvider.register("*",new TR))}};zy=b9([x0(0,fn),x0(1,up)],zy);const aa=class aa{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=aa._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(aa.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(aa.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(aa.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(aa.isVariableCharacter(i)||aa.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof aa._table[i]>"u"&&!aa.isDigitCharacter(i)&&!aa.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};aa._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let Wy=aa;class Xp{constructor(){this._children=[]}appendChild(e){return e instanceof wr&&this._children[this._children.length-1]instanceof wr?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),s=i.children.slice(0);s.splice(n,1,...t),i._children=s,(function a(l,d){for(const u of l)u.parent=d,a(u.children,u)})(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof _v)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}let wr=class e4 extends Xp{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new e4(this.value)}};class t4 extends Xp{}class ea extends t4{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Qp?this._children[0]:void 0}clone(){const e=new ea(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Qp extends Xp{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof wr&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new Qp;return this.options.forEach(e.appendChild,e),e}}class y9 extends Xp{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(s=>s instanceof Ha&&!!s.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof Ha){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new y9;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class Ha extends Xp{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,n)=>n===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new Ha(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class m0 extends t4{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new wr(t)],!0):!1}clone(){const e=new m0(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function w8(r,e){const t=[...r];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class _v extends Xp{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof ea&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return w8([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof ea&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof m0&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new _v;return this._children=this.children.map(t=>t.clone()),e}walk(e){w8(this.children,e)}}class gh{constructor(){this._scanner=new Wy,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new _v;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,s=[];t.walk(d=>(d instanceof ea&&(d.isFinalTabstop?n.set(0,void 0):!n.has(d.index)&&d.children.length>0?n.set(d.index,d.children):s.push(d)),!0));const a=(d,u)=>{const g=n.get(d.index);if(!g)return;const x=new ea(d.index);x.transform=d.transform;for(const m of g){const b=m.clone();x.appendChild(b),b instanceof ea&&n.has(b.index)&&!u.has(b.index)&&(u.add(b.index),a(b,u),u.delete(b.index))}t.replace(d,[x])},l=new Set;for(const d of s)a(d,l);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(s=>s.index===0)||e.appendChild(new ea(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const n=this._scanner.next();if(n.type!==0&&n.type!==4&&n.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new wr(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new ea(Number(t)):new m0(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const s=new ea(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new wr("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){const a=new Qp;for(;;){if(this._parseChoiceElement(a)){if(this._accept(2))continue;if(this._accept(7)&&(s.appendChild(a),this._accept(4)))return e.appendChild(s),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new wr(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const s=new m0(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new wr("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseTransform(e){const t=new y9;let i="",n="";for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(6,!0)||s,i+=s;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(5,!0)||this._accept(6,!0)||s,t.appendChild(new wr(s));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new Ha(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Ha(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){const s=this._accept(9,!0);return!s||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Ha(Number(n),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return e.appendChild(new Ha(Number(n),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return e.appendChild(new Ha(Number(n),void 0,void 0,s)),!0}else if(this._accept(13)){const s=this._until(1);if(s){const a=this._until(4);if(a)return e.appendChild(new Ha(Number(n),void 0,s,a)),!0}}else{const s=this._until(4);if(s)return e.appendChild(new Ha(Number(n),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new wr(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function i4(r,e,t){var i,n;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:((i=t.additionalEdit)==null?void 0:i.edits)??[]}:{edits:[...e.map(s=>new SF(r,{range:s,text:typeof t.insertText=="string"?gh.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...((n=t.additionalEdit)==null?void 0:n.edits)??[]]}}function n4(r){function e(a,l){return"mimeType"in a?a.mimeType===l.handledMimeType:!!l.kind&&a.kind.contains(l.kind)}const t=new Map;for(const a of r)for(const l of a.yieldTo??[])for(const d of r)if(d!==a&&e(l,d)){let u=t.get(a);u||(u=[],t.set(a,u)),u.push(d)}if(!t.size)return Array.from(r);const i=new Set,n=[];function s(a){if(!a.length)return[];const l=a[0];if(n.includes(l))return console.warn("Yield to cycle detected",l),a;if(i.has(l))return s(a.slice(1));let d=[];const u=t.get(l);return u&&(n.push(l),d=s(u),n.pop()),i.add(l),[...d,l,...s(a.slice(1))]}return s(Array.from(r))}var MR=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},RR=function(r,e){return function(t,i){e(t,i,r)}};const NR=Jn.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:c6,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),I_=class I_ extends Wi{constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=on(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=on("span.icon");this.domNode.append(t),t.classList.add(...xs.asClassNameArray(Bn.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(67);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(52)||n.hasChanged(67))&&i()})),this._register(us(this.domNode,Ks.CLICK,n=>{this.delegate.cancel()}))}getId(){return I_.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};I_.baseId="editor.widget.inlineProgressWidget";let jy=I_,ym=class extends Wi{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new $r),this._currentWidget=this._register(new $r),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,s){const a=this._operationIdPool++;this._currentOperation=a,this.clear(),this._showPromise.value=n0(()=>{const l=Xe.fromPositions(e);this._currentDecorations.set([{range:l,options:NR}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(jy,this.id,this._editor,l,t,n))},s??this._showDelay);try{return await i}finally{this._currentOperation===a&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};ym=MR([RR(2,Rn)],ym);var OR=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},E8=function(r,e){return function(t,i){e(t,i,r)}},Ox,ad;let Sr=(ad=class{static get(e){return e.getContribution(Ox.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new $r,this._messageListeners=new zi,this._mouseOverMessage=!1,this._editor=e,this._visible=Ox.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)==null||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){Da(Dx(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Dx(e)?kF(e,{actionHandler:{callback:n=>{this.closeMessage(),DF(this._openerService,n,Dx(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new S8(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(vo.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&AF(a6(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(us(this._messageWidget.value.getDomNode(),Ks.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(us(this._messageWidget.value.getDomNode(),Ks.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new Xe(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(S8.fadeOut(this._messageWidget.value))}},Ox=ad,ad.ID="editor.contrib.messageController",ad.MESSAGE_VISIBLE=new ns("messageVisible",!1,F("messageVisible","Whether the editor is currently showing an inline message")),ad);Sr=Ox=OR([E8(1,hs),E8(2,el)],Sr);const HR=gr.bindToContribution(Sr.get);mn(new HR({id:"leaveEditorMessage",precondition:Sr.MESSAGE_VISIBLE,handler:r=>r.closeMessage(),kbOpts:{weight:130,primary:9}}));let S8=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const a=document.createElement("div");typeof n=="string"?(a.classList.add("message"),a.textContent=n):(n.classList.add("message"),a.appendChild(n)),this._domNode.appendChild(a);const l=document.createElement("div");l.classList.add("anchor","below"),this._domNode.appendChild(l),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};Kn(Sr.ID,Sr,4);function $b(r,e){return e&&(r.stack||r.stacktrace)?F("stackTrace.format","{0}: {1}",D8(r),k8(r.stack)||k8(r.stacktrace)):D8(r)}function k8(r){return Array.isArray(r)?r.join(`
16
16
  `):r}function D8(r){return r.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${r.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof r.code=="string"&&typeof r.errno=="number"&&typeof r.syscall=="string"?F("nodeExceptionMessage","A system error occurred ({0})",r.message):r.message||F("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function wm(r=null,e=!1){if(!r)return F("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(r)){const t=fc(r),i=wm(t[0],e);return t.length>1?F("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(d6(r))return r;if(r.detail){const t=r.detail;if(t.error)return $b(t.error,e);if(t.exception)return $b(t.exception,e)}return r.stack?$b(r,e):r.message?r.message:F("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var s4=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},jf=function(r,e){return function(t,i){e(t,i,r)}},Vy,yu;let $y=(yu=class extends Wi{constructor(e,t,i,n,s,a,l,d,u,g){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=a,this.onSelectNewEdit=l,this._contextMenuService=d,this._keybindingService=g,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(u),this.visibleContext.set(!0),this._register(Hs(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Hs((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(x=>{s.containsPosition(x.position)||this.dispose()})),this._register(vo.runAndSubscribe(g.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var t;const e=(t=this._keybindingService.lookupKeybinding(this.showCommand.id))==null?void 0:t.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=on(".post-edit-widget"),this.button=this._register(new BF(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(us(this.domNode,Ks.CLICK,()=>this.showSelector()))}getId(){return Vy.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=ur(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>FF({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},Vy=yu,yu.baseId="editor.widget.postEditWidget",yu);$y=Vy=s4([jf(7,Vp),jf(8,hs),jf(9,ho)],$y);let Em=class extends Wi{constructor(e,t,i,n,s,a,l){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=s,this._bulkEditService=a,this._notificationService=l,this._currentWidget=this._register(new $r),this._register(vo.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,s){const a=this._editor.getModel();if(!a||!e.length)return;const l=t.allEdits.at(t.activeEditIndex);if(!l)return;const d=async k=>{const I=this._editor.getModel();I&&(await I.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:k,allEdits:t.allEdits},i,n,s))},u=(k,I)=>{Pd(k)||(this._notificationService.error(I),i&&this.show(e[0],t,d))};let g;try{g=await n(l,s)}catch(k){return u(k,F("resolveError",`Error resolving edit '{0}':
@@ -295,4 +295,4 @@ ${Pe.length===1?"There is an instance":"There are "+Pe.length+" instances"} of i
295
295
  `)]),y($e,Dt)};P(Qt,$e=>{"error"in o(Bt)&&o(Bt).error&&!("ok"in o(Bt))?$e(bi):"ok"in o(Bt)&&o(Bt).ok?$e(Bi,1):"ok"in o(Bt)&&$e(J,2)})}T(()=>We=zt(wt,1,"deploy-box in-card svelte-ns6riw",null,We,{"deploy-ok":"ok"in o(Bt)&&o(Bt).ok})),y(Ye,wt)};P(le,Ye=>{o(ne)[Q()]&&Ye(ct)})}y(oe,K)};let a=Mn(e,"generation",3,0),l=Mn(e,"origin",3,null),d=A(yi([])),u=A(""),g=A(yi([])),x=A(!0),m=A(!1),b=A(""),_=A(""),E=A(""),k=A(void 0),I=A("list"),M=A(null),N=A(null),O=A(yi({})),z=A(null),G=st(()=>o(g).filter(oe=>oe.ok&&oe.helperOutdated).length);ln(()=>{var oe;(oe=e.onupdates)==null||oe.call(e,o(G))});let U=A(null),ne=A(yi({}));async function Ee(oe){var Q;p(U,oe,!0);try{const K=await ED(oe);p(ne,{...o(ne),[oe]:K},!0),K.ok&&(p(g,(await va(!0)).hosts,!0),(Q=e.onchanged)==null||Q.call(e))}catch(K){p(ne,{...o(ne),[oe]:{error:K.message??String(K)}},!0)}finally{p(U,null)}}let pe=A(!1),he=A(""),qe=st(()=>o(g).filter(oe=>oe.ok&&oe.helperOutdated).map(oe=>oe.name));async function it(){var Q;const oe=o(qe);if(!(oe.length===0||o(pe))){p(pe,!0);try{for(const[K,le]of oe.entries()){p(he,`${K+1} of ${oe.length}: ${le}`);try{p(ne,{...o(ne),[le]:await ED(le)},!0)}catch(ct){p(ne,{...o(ne),[le]:{error:ct.message??String(ct)}},!0)}}p(g,(await va(!0)).hosts,!0),(Q=e.onchanged)==null||Q.call(e)}finally{p(pe,!1),p(he,"")}}}let ue=A(null),Ue=A(yi({})),me=A(null),Qe=A(yi({})),be=A(null);const Pt=[{key:"stable",label:"stable"},{key:"lts",label:"LTS"},{key:"latest",label:"latest"}],Ne=oe=>{var Q,K;return(oe==null?void 0:oe.arch)&&((K=(Q=o(be))==null?void 0:Q.byArch)==null?void 0:K[oe.arch])||o(be)||null},Fe=(oe,Q)=>{const K=Ne(Q);return(oe==="latest"?K==null?void 0:K.latest:K==null?void 0:K.lts)??null};function Pe(oe,Q){if(!oe||!Q)return null;const K=Ye=>Ye.replace(/^v/,"").split(".").map(Bt=>Number(Bt)||0),[le,ct]=[K(oe),K(Q)];for(let Ye=0;Ye<Math.max(le.length,ct.length);Ye++)if((le[Ye]??0)!==(ct[Ye]??0))return(le[Ye]??0)<(ct[Ye]??0)?-1:1;return 0}const It=oe=>oe&&Number(oe.replace(/^v/,"").split(".")[0])||0;let xe=st(()=>o(g).filter(oe=>{if(!oe.ok||!oe.node||!o(be))return!1;const Q=Ne(oe),le=!!(Q!=null&&Q.latest)&&It(oe.node)===It(Q.latest)?Q==null?void 0:Q.latest:Q==null?void 0:Q.lts;return!!le&&Pe(le,oe.node)===1}).length);ln(()=>{var oe;(oe=e.onnodeupdates)==null||oe.call(e,o(xe))});function ke(oe){return Pt.map(Q=>{const K=Fe(Q.key,oe);return{...Q,target:K,current:!!K&&K===oe.node,downgrade:Pe(K,oe.node)===-1}})}async function Te(oe,Q){var Bt,wt;const K=qt(oe)??null,le=(K==null?void 0:K.local)===!0,ct=Fe(Q,K);if(await((Bt=o(k))==null?void 0:Bt.show(`Install Node.js ${ct??`"${Q}"`} on ${oe} with n install ${ct??Q}? This replaces the host's node binary; running adapters keep the current version until they are restarted.`+(le?" she runs on this host too — it keeps the old binary until the daemon itself is restarted.":""),{confirm:"Update Node.js"}))){p(ue,oe,!0),p(Qe,{...o(Qe),[oe]:void 0},!0);try{const We=await eZ(oe,Q,ct);p(Ue,{...o(Ue),[oe]:We},!0),p(g,(await va(!0)).hosts,!0),(wt=e.onchanged)==null||wt.call(e)}catch(We){p(Ue,{...o(Ue),[oe]:{error:We.message??String(We)}},!0)}finally{p(ue,null)}}}async function Je(oe){var Q;p(me,oe,!0);try{p(Qe,{...o(Qe),[oe]:await iZ(oe)},!0),(Q=e.onchanged)==null||Q.call(e)}catch(K){p(Qe,{...o(Qe),[oe]:{error:K.message??String(K)}},!0)}finally{p(me,null)}}let Ge=A(null),vt=A(""),ii=A(!1),Vt=A(!1),He=A(yi({host:"",port:"",user:"",identityFile:"",hostname:""})),at=A(null),Wt=A(!1),Ft=A(yi(location.origin)),oi=A(null),Z=A(null),se=A(""),de=A(!1),lt=A(""),et=A(!1),At=null;const bt=st(()=>JSON.stringify({remotes:o(d)})!==o(u)),qt=oe=>o(g).find(Q=>Q.name===oe)??null,Le=st(()=>o(g).find(oe=>oe.local)??null),Se=(oe,Q)=>(oe.hostname||oe.host).localeCompare(Q.hostname||Q.host,void 0,{numeric:!0,sensitivity:"base"});function tt(oe){const Q=oe.services,K=Array.isArray(Q==null?void 0:Q.hosts)?Q.hosts:null;p(d,(K??[]).filter(le=>le&&le.ssh).map(le=>({host:String(le.ssh.host??""),port:typeof le.ssh.port=="number"?le.ssh.port:"",user:String(le.ssh.user??""),identityFile:String(le.ssh.identityFile??""),hostname:String(le.hostname??"")})).sort(Se),!0),p(u,JSON.stringify({remotes:o(d)}),!0)}async function w(oe=!1){p(x,!0),p(b,"");try{const[Q,K]=await Promise.all([wc(),va(oe).catch(()=>({hosts:[]}))]);tt(Q),p(g,K.hosts,!0)}catch(Q){p(b,Q.message??String(Q),!0)}finally{p(x,!1)}j()}async function j(){try{const oe=await XK();p(Ge,oe.publicKey,!0),p(vt,oe.identityFile,!0)}catch{}try{p(E,(await Kc()).user??"",!0)}catch{}}Ws(()=>w());let ie=0;ln(()=>{const oe=a();oe!==ie&&(ie=oe,Lo(()=>{l()!=="hostsconf"&&(async()=>{if(o(bt))try{p(g,(await va(!0)).hosts,!0)}catch{}else await w(!0)})()}))}),Ws(async()=>{try{p(be,await tZ(),!0)}catch{}}),Lh(()=>St());function _e(oe){p(_,oe,!0),setTimeout(()=>{o(_)===oe&&p(_,"")},3e3)}async function De(){var oe;p(m,!0),p(b,"");try{const Q=[{name:"local"}];for(const K of o(d)){if(!K.host.trim())continue;const le={host:K.host.trim()};K.port!==""&&Number(K.port)>0&&(le.port=Number(K.port)),K.user.trim()&&(le.user=K.user.trim()),K.identityFile.trim()&&(le.identityFile=K.identityFile.trim()),Q.push({...K.hostname.trim()?{hostname:K.hostname.trim()}:{},ssh:le})}await $0("services.hosts",Q),window.dispatchEvent(new CustomEvent("she:config-changed")),p(u,JSON.stringify({remotes:o(d)}),!0),p(M,null),_e("saved"),(oe=e.onchanged)==null||oe.call(e),p(g,(await va(!0)).hosts,!0)}catch(Q){p(b,Q.message??String(Q),!0)}finally{p(m,!1)}}function nt(){const oe=JSON.parse(o(u));p(d,oe.remotes,!0),p(M,null)}async function V(oe){const Q=oe.host;p(z,Q,!0);try{const K=await wD({host:oe.host.trim(),port:oe.port,user:oe.user.trim(),identityFile:oe.identityFile.trim()});p(O,{...o(O),[Q]:K.ok?{ok:!0,msg:`helper v${K.helper??"?"}`}:{ok:!1,msg:`${K.code}: ${K.error}`}},!0)}catch(K){p(O,{...o(O),[Q]:{ok:!1,msg:K.message??String(K)}},!0)}finally{p(z,null)}}async function Ze(){p(z,"local");try{const oe=await JK("local");p(O,{...o(O),local:oe.ok?{ok:!0,msg:`helper v${oe.helper??"?"}`}:{ok:!1,msg:`${oe.code}: ${oe.error}`}},!0)}catch(oe){p(O,{...o(O),local:{ok:!1,msg:oe.message??String(oe)}},!0)}finally{p(z,null)}}async function _t(oe){var K;const Q=o(d)[oe];await((K=o(k))==null?void 0:K.show(`Remove ${Q.hostname||Q.host} from the list? she stops managing it; nothing on the host is changed (use "Remove from host…" for that).`,{confirm:"Remove",danger:!0}))&&(p(d,o(d).filter((le,ct)=>ct!==oe),!0),o(M)===oe&&p(M,null))}function ge(){p(He,{host:"",port:"",user:"",identityFile:"",hostname:""},!0),p(at,null),p(lt,""),p(I,"add")}async function Ke(){if(!o(He).host.trim()){p(at,{ok:!1,msg:"enter a host first"},!0);return}p(Wt,!0);try{const oe=await wD({host:o(He).host.trim(),port:o(He).port,user:o(He).user.trim(),identityFile:o(He).identityFile.trim()});p(at,oe.ok?{ok:!0,msg:`helper v${oe.helper??"?"}`}:{ok:!1,msg:`${oe.code}: ${oe.error}`},!0)}catch(oe){p(at,{ok:!1,msg:oe.message??String(oe)},!0)}finally{p(Wt,!1)}}function ft(){o(He).host.trim()&&(p(d,[...o(d),{...o(He),host:o(He).host.trim(),user:o(He).user.trim(),identityFile:o(He).identityFile.trim(),hostname:o(He).hostname.trim()}].sort(Se),!0),p(I,"list"),_e("host added — Save to keep it"))}function St(){At&&(clearInterval(At),At=null)}async function jt(){p(de,!0),p(lt,""),p(oi,null),p(Z,null),p(se,""),p(et,!1),St();try{p(oi,await nZ(o(Ft).trim().replace(/\/+$/,"")),!0),p(Z,"pending"),j(),At=setInterval(async()=>{var oe;if(!o(oi))return St();try{const Q=await sZ(o(oi).token);p(Z,Q.status,!0),Q.status==="done"?(p(se,Q.host??"",!0),St(),tt(await wc()),p(g,(await va(!0)).hosts,!0),(oe=e.onchanged)==null||oe.call(e)):Q.status==="expired"&&St()}catch{}},3e3)}catch(oe){p(lt,oe.message??String(oe),!0)}finally{p(de,!1)}}async function Be(oe,Q){try{await navigator.clipboard.writeText(oe),Q(!0),setTimeout(()=>Q(!1),2e3)}catch{}}async function gt(){var oe;if(!(o(Ge)&&!await((oe=o(k))==null?void 0:oe.show("Regenerate the services SSH key? Every remote host then needs the new public key (re-run the setup command, or replace it in authorized_keys).",{confirm:"Regenerate",danger:!0})))){p(ii,!0);try{const Q=await QK();p(Ge,Q.publicKey,!0),p(vt,Q.identityFile,!0),_e("key generated")}catch(Q){p(b,Q.message??String(Q),!0)}finally{p(ii,!1)}}}var $=cue(),we=yt($);ds(Fr(we,{}),oe=>p(k,oe,!0),()=>o(k));var ze=h(we,2),xt=f(ze);{var mt=oe=>{var Q=qde(),K=yt(Q),le=f(K),ct=h(K,2),Ye=f(ct),Bt=h(f(Ye),4),wt=h(f(Bt),2),We=h(wt,2),Zt=f(We),Qt=h(Bt,2);{var bi=ye=>{var rt=zde(),dt=f(rt);T(()=>B(dt,o(lt))),y(ye,rt)};P(Qt,ye=>{o(lt)&&ye(bi)})}var Bi=h(Qt,2);{var J=ye=>{var rt=$de(),dt=yt(rt),Tt=f(dt),kt=f(Tt),Lt=h(Tt),Mt=f(Lt),Ht=h(dt,2),Xt=f(Ht),Li=h(Xt),Gi=f(Li),fi=h(Li,2),Ni=f(fi),Ki=h(Ht,2),Me=f(Ki);{var li=Jt=>{var Re=Wde();y(Jt,Re)},Ei=Jt=>{var Re=jde();y(Jt,Re)},Ti=Jt=>{var Re=Vde(),ut=yt(Re),ei=f(ut),Ui=h(ei),ji=f(Ui),Hi=h(ut,2);T(()=>{B(ei,`✓ ${o(se)??""} registered as `),B(ji,o(oi).user)}),H("click",Hi,()=>p(I,"list")),y(Jt,Re)},Ci=Jt=>{var Re=In("command expired — create a new one.");y(Jt,Re)};P(Me,Jt=>{o(Z)==="pending"?Jt(li):o(Z)==="fetched"?Jt(Ei,1):o(Z)==="done"?Jt(Ti,2):o(Z)==="expired"&&Jt(Ci,3)})}T(Jt=>{B(kt,o(oi).command),B(Mt,o(et)?"Copied":"Copy"),B(Xt,`Valid until ${Jt??""}, single use. To read it first: `),B(Gi,`curl -fsSL '${o(oi).scriptUrl??""}' -o she-setup.sh`),B(Ni,o(oi).sha256)},[()=>new Date(o(oi).expires).toLocaleTimeString()]),H("click",Lt,()=>Be(o(oi).command,Jt=>p(et,Jt,!0))),y(ye,rt)};P(Bi,ye=>{o(oi)&&ye(J)})}var $e=h(Ye,2),Dt=h(f($e),4),Nt=f(Dt),X=h(f(Nt)),ae=h(Nt,2),te=h(f(ae)),ve=h(ae,2),Ve=h(f(ve)),Ae=h(ve,2),Et=h(f(Ae)),ce=h(Dt,2),re=f(ce),W=f(re),Y=h(re,2);{var Ce=ye=>{var rt=QA();let dt;var Tt=f(rt);T(()=>{dt=zt(rt,1,"test-mark svelte-ns6riw",null,dt,{ok:o(at).ok,err:!o(at).ok}),B(Tt,o(at).ok?`✓ ${o(at).msg}`:`✗ ${o(at).msg}`)}),y(ye,rt)};P(Y,ye=>{o(at)&&ye(Ce)})}var je=h(Y,4);T(ye=>{We.disabled=o(de),B(Zt,o(de)?"Preparing…":"Create setup command"),xi(Ve,"placeholder",o(E)?`${o(E)} (default)`:"user she runs as"),re.disabled=o(Wt),B(W,o(Wt)?"Testing…":"Test connection"),je.disabled=ye},[()=>!o(He).host.trim()]),H("click",le,()=>p(I,"list")),di(wt,()=>o(Ft),ye=>p(Ft,ye)),H("click",We,jt),di(X,()=>o(He).host,ye=>o(He).host=ye),di(te,()=>o(He).port,ye=>o(He).port=ye),di(Ve,()=>o(He).user,ye=>o(He).user=ye),di(Et,()=>o(He).identityFile,ye=>o(He).identityFile=ye),H("click",re,Ke),H("click",je,ft),y(oe,Q)},Ot=oe=>{var Q=lue(),K=yt(Q),le=f(K),ct=f(le);let Ye;var Bt=h(le,2),wt=h(Bt,2),We=f(wt),Zt=h(wt,2);{var Qt=Jt=>{var Re=Ude();y(Jt,Re)};P(Zt,Jt=>{o(x)&&Jt(Qt)})}var bi=h(Zt,2);{var Bi=Jt=>{var Re=Gde(),ut=f(Re);T(()=>{Re.disabled=o(pe)||o(U)!==null,B(ut,o(pe)?`Updating ${o(he)}…`:`Update all helpers (${o(qe).length})`)}),H("click",Re,it),y(Jt,Re)};P(bi,Jt=>{o(qe).length>1&&Jt(Bi)})}var J=h(bi,4);{var $e=Jt=>{var Re=Kde(),ut=f(Re);T(()=>B(ut,o(_))),y(Jt,Re)};P(J,Jt=>{o(_)&&Jt($e)})}var Dt=h(J,2);{var Nt=Jt=>{var Re=Zde(),ut=h(yt(Re),2),ei=h(ut,2),Ui=f(ei);T(()=>{ut.disabled=o(m),ei.disabled=o(m),B(Ui,o(m)?"Saving…":"Save")}),H("click",ut,nt),H("click",ei,De),y(Jt,Re)};P(Dt,Jt=>{o(bt)&&Jt(Nt)})}var X=h(K,2);{var ae=Jt=>{var Re=Yde(),ut=f(Re);T(()=>B(ut,o(b))),y(Jt,Re)};P(X,Jt=>{o(b)&&Jt(ae)})}var te=h(X,2),ve=f(te),Ve=f(ve),Ae=f(Ve);let Et;var ce=h(Ae,2),re=f(ce),W=h(ce,2);{var Y=Jt=>{XA(Jt,()=>o(Le).arch)};P(W,Jt=>{var Re;(Re=o(Le))!=null&&Re.arch&&Jt(Y)})}var Ce=h(W,6);{var je=Jt=>{i(Jt,()=>"local",()=>o(Le))};P(Ce,Jt=>{var Re;(Re=o(Le))!=null&&Re.ok&&Jt(je)})}var ye=h(Ce,2),rt=h(ye);t(rt,()=>"local");var dt=h(Ve,2);{var Tt=Jt=>{n(Jt,()=>"local",()=>o(Le))};P(dt,Jt=>{var Re;(Re=o(Le))!=null&&Re.ok&&Jt(Tt)})}var kt=h(dt,2);s(kt,()=>"local");var Lt=h(kt,2);{var Mt=Jt=>{var Re=Qde(),ut=f(Re),ei=h(ut);{var Ui=ji=>{var Hi=Xde(),Gt=yt(Hi);Gt.nodeValue=" — run ",y(ji,Hi)};P(ei,ji=>{o(Le).code==="HELPER_MISSING"&&ji(Ui)})}T(()=>B(ut,o(Le).error)),y(Jt,Re)};P(Lt,Jt=>{o(Le)&&!o(Le).ok&&Jt(Mt)})}var Ht=h(ve,2);vi(Ht,17,()=>o(d),nn,(Jt,Re,ut)=>{const ei=st(()=>qt(o(Re).host));var Ui=sue(),ji=f(Ui),Hi=f(ji);let Gt;var ui=h(Hi,2),wi=f(ui),Qi=h(ui,2);{var Oi=Kt=>{XA(Kt,()=>o(ei).arch)};P(Qi,Kt=>{var gi;(gi=o(ei))!=null&&gi.arch&&Kt(Oi)})}var Cn=h(Qi,2),vn=f(Cn),Pn=h(Cn,2);{var pn=Kt=>{var gi=Jde();T(()=>xi(gi,"title",o(Re).identityFile)),y(Kt,gi)};P(Pn,Kt=>{o(Re).identityFile&&Kt(pn)})}var $i=h(Pn,4);{var qn=Kt=>{i(Kt,()=>o(Re).host,()=>o(ei))},ss=Kt=>{var gi=eue(),mi=f(gi);T(()=>{gi.disabled=o(U)!==null,B(mi,o(U)===o(Re).host?"Deploying…":"Deploy helper")}),H("click",gi,()=>Ee(o(Re).host)),y(Kt,gi)};P($i,Kt=>{var gi;(gi=o(ei))!=null&&gi.ok?Kt(qn):o(ei)&&!o(ei).ok&&Kt(ss,1)})}var gs=h($i,2),Zs=h(gs);t(Zs,()=>o(Re).host);var os=h(Zs,2);let no;var Ie=h(os,2);let pt;var ot=h(Ie,2),si=h(ji,2);{var pi=Kt=>{n(Kt,()=>o(Re).host,()=>o(ei))};P(si,Kt=>{var gi;(gi=o(ei))!=null&&gi.ok&&Kt(pi)})}var Ii=h(si,2);s(Ii,()=>o(Re).host);var Ri=h(Ii,2);{var Rt=Kt=>{var gi=tue(),mi=f(gi);T(()=>B(mi,o(ei).error)),y(Kt,gi)};P(Ri,Kt=>{o(ei)&&!o(ei).ok&&Kt(Rt)})}var Di=h(Ri,2);{var hi=Kt=>{var gi=iue(),mi=f(gi),qi=h(f(mi)),sn=h(mi,2),dn=h(f(sn)),xn=h(sn,2),wn=h(f(xn)),an=h(xn,2),Ln=h(f(an)),gn=h(an,2),tn=h(f(gn));T(()=>xi(wn,"placeholder",o(E)?`${o(E)} (default)`:"user she runs as")),di(qi,()=>o(Re).host,Vi=>o(Re).host=Vi),di(dn,()=>o(Re).port,Vi=>o(Re).port=Vi),di(wn,()=>o(Re).user,Vi=>o(Re).user=Vi),di(Ln,()=>o(Re).identityFile,Vi=>o(Re).identityFile=Vi),di(tn,()=>o(Re).hostname,Vi=>o(Re).hostname=Vi),y(Kt,gi)};P(Di,Kt=>{o(M)===ut&&Kt(hi)})}var Si=h(Di,2);{var Fi=Kt=>{var gi=nue(),mi=f(gi);{let qi=st(()=>o(Re).hostname||o(Re).host);yde(mi,{get host(){return o(Re).host},get label(){return o(qi)},onclose:()=>p(N,null),ondone:()=>{var sn;p(N,null),w(!0),(sn=e.onchanged)==null||sn.call(e)}})}y(Kt,gi)};P(Si,Kt=>{o(N)===ut&&Kt(Fi)})}T(Kt=>{var gi,mi;Gt=zt(Hi,1,"dot svelte-ns6riw",null,Gt,{ok:(gi=o(ei))==null?void 0:gi.ok,err:o(ei)&&!o(ei).ok}),B(wi,o(Re).hostname||((mi=o(ei))==null?void 0:mi.hostname)||o(Re).host),B(vn,`${(o(Re).user||o(E)||"?")??""}@${o(Re).host??""}${o(Re).port?`:${o(Re).port}`:""}`),gs.disabled=Kt,no=zt(os,1,"ghost sm svelte-ns6riw",null,no,{active:o(M)===ut}),pt=zt(Ie,1,"ghost sm svelte-ns6riw",null,pt,{active:o(N)===ut})},[()=>o(z)!==null||!o(Re).host.trim()]),H("click",gs,()=>V(o(Re))),H("click",os,()=>p(M,o(M)===ut?null:ut,!0)),H("click",Ie,()=>p(N,o(N)===ut?null:ut,!0)),H("click",ot,()=>_t(ut)),y(Jt,Ui)});var Xt=h(Ht,2);{var Li=Jt=>{var Re=oue();y(Jt,Re)};P(Xt,Jt=>{o(d).length===0&&!o(x)&&Jt(Li)})}var Gi=h(Xt,2),fi=f(Gi),Ni=h(f(fi),6);{var Ki=Jt=>{var Re=rue(),ut=f(Re);T(()=>B(ut,o(Vt)?"Copied":"Copy public key")),H("click",Re,()=>Be(o(Ge),ei=>p(Vt,ei,!0))),y(Jt,Re)};P(Ni,Jt=>{o(Ge)&&Jt(Ki)})}var Me=h(Ni,2),li=f(Me),Ei=h(fi,2);{var Ti=Jt=>{var Re=aue(),ut=yt(Re),ei=f(ut),Ui=h(ut,2),ji=f(Ui);T(()=>{B(ei,o(Ge)),B(ji,o(vt))}),y(Jt,Re)},Ci=Jt=>{var Re=JA(),ut=f(Re);T(()=>B(ut,`No services key yet (${(o(vt)||"data-dir/ssh/services_id_ed25519")??""}) — the setup command creates it.`)),y(Jt,Re)};P(Ei,Jt=>{o(Ge)?Jt(Ti):Jt(Ci,-1)})}T(()=>{var Jt,Re;le.disabled=o(x),Ye=zt(ct,1,"svelte-ns6riw",null,Ye,{spinning:o(x)}),B(We,`${o(d).length+1} host${o(d).length===0?"":"s"}`),Et=zt(Ae,1,"dot svelte-ns6riw",null,Et,{ok:(Jt=o(Le))==null?void 0:Jt.ok,err:o(Le)&&!o(Le).ok}),B(re,((Re=o(Le))==null?void 0:Re.hostname)??"this host"),ye.disabled=o(z)!==null,Me.disabled=o(ii),B(li,o(ii)?"Generating…":o(Ge)?"Regenerate":"Generate key")}),H("click",le,()=>w(!0)),H("click",Bt,ge),H("click",ye,Ze),H("click",Me,gt),y(oe,Q)};P(xt,oe=>{o(I)==="add"?oe(mt):oe(Ot,-1)})}y(r,$),bs()}Ss(["click"]);var e6=S('<span class="tab-dot svelte-ymmv06"></span>'),uue=S('<div class="services-page svelte-ymmv06"><div class="sub-nav svelte-ymmv06"><button>Instances</button> <button>Installations <!></button> <button>Catalog</button> <button>Hosts <!></button></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div></div>');function hue(r,e){_s(e,!0);let t=Mn(e,"active",3,!1),i=Mn(e,"sub",3,null);const n=["instances","hosts","catalog","hostsconf"],s="she-services-tab",a=localStorage.getItem(s);let l=A(yi(a&&n.includes(a)?a:"instances"));ln(()=>{localStorage.setItem(s,o(l))});const d={instances:"instances",hosts:"installations",catalog:"catalog",hostsconf:"hosts"},u=at=>Object.keys(d).find(Wt=>d[Wt]===at)??null;let g;ln(()=>{if(i()===g)return;g=i();const at=u(i());at&&Lo(()=>{at!==o(l)&&p(l,at,!0)})}),ln(()=>{var at;t()&&((at=e.onsub)==null||at.call(e,d[o(l)]))});let x=A(0),m=A(null);function b(at){p(m,at,!0),Ly(x)}let _=A(null),E=0;function k(at,Wt){p(_,{host:at,adapter:Wt,n:++E},!0),b("catalog"),p(l,"hosts")}let I=A(0),M=A(0),N=A(0),O=A("none"),z=A(""),G=st(()=>[o(I)>0?`${o(I)} adapter update${o(I)===1?"":"s"} available`:"",o(M)>0?`${o(M)} host${o(M)===1?"":"s"} with an outdated helper`:"",o(N)>0?`${o(N)} host${o(N)===1?"":"s"} with a newer Node.js`:""].filter(Boolean).join(" · "));ln(()=>{var at,Wt;o(G)?(at=e.onstatus)==null||at.call(e,"warn",o(G)):(Wt=e.onstatus)==null||Wt.call(e,o(O),o(z))});var U=uue(),ne=f(U),Ee=f(ne);let pe;var he=h(Ee,2);let qe;var it=h(f(he));{var ue=at=>{var Wt=e6();T(()=>xi(Wt,"title",`${o(I)??""} adapter update${o(I)===1?"":"s"} available`)),y(at,Wt)};P(it,at=>{o(I)>0&&at(ue)})}var Ue=h(he,2);let me;var Qe=h(Ue,2);let be;var Pt=h(f(Qe));{var Ne=at=>{var Wt=e6();T(Ft=>xi(Wt,"title",Ft),[()=>[o(M)>0?`${o(M)} host${o(M)===1?"":"s"} running an outdated she-servicectl`:"",o(N)>0?`${o(N)} host${o(N)===1?"":"s"} with a newer Node.js available`:""].filter(Boolean).join(" · ")]),y(at,Wt)};P(Pt,at=>{o(M)+o(N)>0&&at(Ne)})}var Fe=h(ne,2);let Pe;var It=f(Fe);Lle(It,{onstatus:(at,Wt)=>{p(O,at,!0),p(z,Wt,!0)},get generation(){return o(x)},get origin(){return o(m)},onchanged:()=>b("instances")});var xe=h(Fe,2);let ke;var Te=f(xe);$ce(Te,{onchanged:()=>b("hosts"),onupdates:at=>p(I,at,!0),get generation(){return o(x)},get origin(){return o(m)},get addPreset(){return o(_)}});var Je=h(xe,2);let Ge;var vt=f(Je);{let at=st(()=>t()&&o(l)==="catalog");xde(vt,{get active(){return o(at)},oninstalled:k,get generation(){return o(x)},get origin(){return o(m)}})}var ii=h(Je,2);let Vt;var He=f(ii);due(He,{onchanged:()=>b("hostsconf"),onupdates:at=>p(M,at,!0),onnodeupdates:at=>p(N,at,!0),get generation(){return o(x)},get origin(){return o(m)}}),T(()=>{pe=zt(Ee,1,"svelte-ymmv06",null,pe,{active:o(l)==="instances"}),qe=zt(he,1,"svelte-ymmv06",null,qe,{active:o(l)==="hosts"}),me=zt(Ue,1,"svelte-ymmv06",null,me,{active:o(l)==="catalog"}),be=zt(Qe,1,"svelte-ymmv06",null,be,{active:o(l)==="hostsconf"}),Pe=zt(Fe,1,"tab-wrap svelte-ymmv06",null,Pe,{hidden:o(l)!=="instances"}),ke=zt(xe,1,"tab-wrap svelte-ymmv06",null,ke,{hidden:o(l)!=="hosts"}),Ge=zt(Je,1,"tab-wrap svelte-ymmv06",null,Ge,{hidden:o(l)!=="catalog"}),Vt=zt(ii,1,"tab-wrap svelte-ymmv06",null,Vt,{hidden:o(l)!=="hostsconf"})}),H("click",Ee,()=>p(l,"instances")),H("click",he,()=>p(l,"hosts")),H("click",Ue,()=>p(l,"catalog")),H("click",Qe,()=>p(l,"hostsconf")),y(r,U),bs()}Ss(["click"]);const sy=(r,e=Vo)=>{var t=gue(),i=h(f(t));{var n=a=>{var l=fue();y(a,l)},s=a=>{var l=pue();y(a,l)};P(i,a=>{e()?a(n):a(s,-1)})}y(r,t)};var fue=Go('<path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2"></path>'),pue=Go('<path d="M5.5 7V5a2.5 2.5 0 0 1 5 0"></path>'),gue=Go('<svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="7" width="10" height="7" rx="1.5"></rect><!></svg>'),vue=S('<span class="ok svelte-1az45ix"> </span>'),xue=S('<span class="muted svelte-1az45ix"> </span>'),mue=S('<div class="err-box svelte-1az45ix"> <button class="ghost sm svelte-1az45ix">×</button></div>'),_ue=S(`<div class="err-box svelte-1az45ix"><b>Secrets store locked:</b> <code class="svelte-1az45ix">SHE_SECRETS_KEY</code> in the daemon's environment or restore <code class="svelte-1az45ix"> </code>, then restart she. Starting over means deleting <code class="svelte-1az45ix"> </code>.</div>`),bue=S('<button><span class="name svelte-1az45ix"> </span> <span class="count svelte-1az45ix"> </span></button>'),Cue=S('<div class="muted empty svelte-1az45ix">No secrets yet.</div>'),yue=S("<!> <!>",1),wue=S('<button type="button" class="lock is-secret svelte-1az45ix" disabled="" title="secret — write-only, never shown again"><!></button> <input placeholder="•••••• (type to replace)" autocomplete="off" spellcheck="false" class="svelte-1az45ix"/>',1),Eue=S('<textarea spellcheck="false" class="svelte-1az45ix"></textarea>'),Sue=S('<input type="text" autocomplete="off" spellcheck="false" class="svelte-1az45ix"/>'),kue=S('<button type="button" class="lock svelte-1az45ix" title="plain — shown in clear; click to mark it secret (never shown again)"><!></button> <!>',1),Due=S('<tr><td class="mono svelte-1az45ix"> </td><td class="svelte-1az45ix"><form class="val svelte-1az45ix"><!> <button type="submit" class="sm svelte-1az45ix">Save</button></form></td><td class="muted svelte-1az45ix"> </td><td class="c-act svelte-1az45ix"><button class="ghost sm svelte-1az45ix" title="Delete">×</button></td></tr>'),Aue=S('<textarea placeholder="value" spellcheck="false" class="svelte-1az45ix"></textarea>'),Bue=S('<input type="password" placeholder="value" autocomplete="off" class="svelte-1az45ix"/>'),Fue=S('<div class="fields-head svelte-1az45ix"><span class="title svelte-1az45ix"> </span> <span class="muted svelte-1az45ix"> </span> <span class="spacer svelte-1az45ix"></span> <label class="reveal check-label svelte-1az45ix"><input type="checkbox" class="svelte-1az45ix"/><span class="checkmark svelte-1az45ix"></span> show while typing</label> <button class="ghost sm danger svelte-1az45ix">Delete group</button></div> <table class="svelte-1az45ix"><colgroup><col class="c-name svelte-1az45ix"/><col class="c-value"/><col class="c-changed svelte-1az45ix"/><col class="c-act svelte-1az45ix"/></colgroup><thead><tr><th class="svelte-1az45ix">field</th><th class="svelte-1az45ix">value</th><th class="svelte-1az45ix">changed</th><th class="svelte-1az45ix"></th></tr></thead><tbody><!><tr class="new svelte-1az45ix"><td class="svelte-1az45ix"><input type="text" placeholder="new field" spellcheck="false" class="svelte-1az45ix"/></td><td class="svelte-1az45ix"><form class="val svelte-1az45ix"><button type="button"><!></button> <!> <button type="submit" class="sm svelte-1az45ix">Add</button></form></td><td class="muted svelte-1az45ix" colspan="2">the lock decides the kind: secret fields are write-only forever, plain fields (user names, hosts) stay readable here. Multi-line values: tick <i>show while typing</i> and paste.</td></tr></tbody></table> <div class="hint svelte-1az45ix"><code class="svelte-1az45ix"> </code> returns the string, <code class="svelte-1az45ix"> </code> the whole group as a frozen object, <code class="svelte-1az45ix">she.secrets.has(…)</code> checks without a warning. Scripts that read a secret at load time keep the old value until they are reloaded.</div>',1),Lue=S('Create a group on the left, then add fields to it — e.g. group <code class="svelte-1az45ix">smtp</code> with <code class="svelte-1az45ix">host</code>, <code class="svelte-1az45ix">user</code>, <code class="svelte-1az45ix">password</code>.',1),Iue=S('<div class="muted empty svelte-1az45ix"><!></div>'),Pue=S(`<!> <div class="sec-shell svelte-1az45ix"><div class="bar svelte-1az45ix"><span class="muted svelte-1az45ix">Values are stored encrypted and never sent back to the browser — scripts read them with <code class="svelte-1az45ix">she.secrets.get('group/field')</code>.</span> <span class="spacer svelte-1az45ix"></span> <!> <!> <button class="ghost svelte-1az45ix" title="Reload">↺</button></div> <!> <!> <div class="body svelte-1az45ix"><div class="groups svelte-1az45ix"><div class="groups-head svelte-1az45ix">Groups</div> <!> <form class="add-group svelte-1az45ix"><input type="text" placeholder="new group" spellcheck="false" class="svelte-1az45ix"/> <button type="submit" class="ghost sm svelte-1az45ix">+</button></form></div> <div class="fields svelte-1az45ix"><!></div></div></div>`,1);function Tue(r,e){_s(e,!0);let t=Mn(e,"active",3,!0),i=Mn(e,"sub",3,null),n=A(null),s=A(null),a=A(""),l=A(""),d=A(!1),u=A(""),g=A(""),x=A(""),m=A(!0),b=A(yi({})),_=A(!1),E=A(void 0),k=!1;const I=/^[A-Za-z0-9_.-]{1,64}$/,M=st(()=>{var Z;return((Z=o(n))==null?void 0:Z.groups.find(se=>se.name===o(s)))??null}),N=st(()=>{var Z,se;return((Z=o(n))==null?void 0:Z.status)==="locked"||((se=o(n))==null?void 0:se.status)==="error"});async function O(){try{p(n,await pG(),!0),p(a,""),o(s)&&!o(n).groups.some(Z=>Z.name===o(s))&&p(s,null),!o(s)&&o(n).groups.length>0&&p(s,o(n).groups[0].name,!0)}catch(Z){p(a,Z.message??String(Z),!0)}}ln(()=>{t()&&!k&&(k=!0,O())});let z;ln(()=>{const Z=i();Z!==z&&(z=Z,Z&&Z!==o(s)&&p(s,Z,!0))}),ln(()=>{var Z;t()&&(z=o(s)??"",(Z=e.onsub)==null||Z.call(e,o(s)??""))});function G(Z){p(l,Z,!0),setTimeout(()=>{o(l)===Z&&p(l,"")},2500)}async function U(Z,se,de,lt=!0){if(de){p(d,!0);try{await gG(Z,se,de,lt),p(b,{...o(b),[`${Z}/${se}`]:""},!0),p(g,""),p(x,""),p(m,!0),G(`saved ${Z}/${se}`),await O(),p(s,Z,!0)}catch(et){p(a,et.message??String(et),!0)}finally{p(d,!1)}}}async function ne(){var se;const Z=o(u).trim();if(!I.test(Z)){p(a,"group name: letters, digits, _ . - (max 64)");return}(se=o(n))!=null&&se.groups.some(de=>de.name===Z)||p(n,o(n)?{...o(n),groups:[...o(n).groups,{name:Z,changed:0,fields:[]}].sort((de,lt)=>de.name.localeCompare(lt.name))}:o(n),!0),p(s,Z,!0),p(u,""),p(a,"")}async function Ee(Z,se){var de;if(await((de=o(E))==null?void 0:de.show(`Mark ${Z}/${se} as secret? Its value will never be shown again — not here, not through the API. Scripts keep reading it. This cannot be undone (delete and re-create to change your mind).`,{confirm:"Mark secret",danger:!0}))){p(d,!0);try{await vG(Z,se),p(b,{...o(b),[`${Z}/${se}`]:""},!0),G(`${Z}/${se} is secret now`),await O()}catch(lt){p(a,lt.message??String(lt),!0)}finally{p(d,!1)}}}async function pe(Z,se){var de;if(await((de=o(E))==null?void 0:de.show(`Delete secret ${Z}/${se}? Scripts reading it get undefined from now on.`,{confirm:"Delete",danger:!0}))){p(d,!0);try{await cD(Z,se),G(`deleted ${Z}/${se}`),await O()}catch(lt){p(a,lt.message??String(lt),!0)}finally{p(d,!1)}}}async function he(Z){var de,lt,et,At;const se=((de=o(M))==null?void 0:de.fields.length)??0;if(se===0){p(n,o(n)?{...o(n),groups:o(n).groups.filter(bt=>bt.name!==Z)}:o(n),!0),p(s,((et=(lt=o(n))==null?void 0:lt.groups[0])==null?void 0:et.name)??null,!0);return}if(await((At=o(E))==null?void 0:At.show(`Delete the group ${Z} with its ${se} secret${se===1?"":"s"}?`,{confirm:"Delete group",danger:!0}))){p(d,!0);try{await cD(Z),G(`deleted ${Z}`),p(s,null),await O()}catch(bt){p(a,bt.message??String(bt),!0)}finally{p(d,!1)}}}function qe(Z){return Z?new Date(Z).toLocaleString():"—"}var it=Pue(),ue=yt(it);ds(Fr(ue,{}),Z=>p(E,Z,!0),()=>o(E));var Ue=h(ue,2),me=f(Ue),Qe=h(f(me),4);{var be=Z=>{var se=vue(),de=f(se);T(()=>B(de,o(l))),y(Z,se)};P(Qe,Z=>{o(l)&&Z(be)})}var Pt=h(Qe,2);{var Ne=Z=>{var se=xue(),de=f(se);T(()=>{xi(se,"title",o(n).file),B(de,`key: ${(o(n).keySource==="env"?"SHE_SECRETS_KEY":o(n).keySource==="file"?o(n).keyFile:"none yet — generated on first save")??""}`)}),y(Z,se)};P(Pt,Z=>{o(n)&&Z(Ne)})}var Fe=h(Pt,2),Pe=h(me,2);{var It=Z=>{var se=mue(),de=f(se),lt=h(de);T(()=>B(de,`${o(a)??""} `)),H("click",lt,()=>p(a,"")),y(Z,se)};P(Pe,Z=>{o(a)&&Z(It)})}var xe=h(Pe,2);{var ke=Z=>{var se=_ue(),de=h(f(se)),lt=h(de,3),et=f(lt),At=h(lt,2),bt=f(At);T(()=>{B(de,` ${o(n).error??""}. Values cannot be read or changed until the key is back — set `),B(et,o(n).keyFile),B(bt,o(n).file)}),y(Z,se)};P(xe,Z=>{o(N)&&o(n)&&Z(ke)})}var Te=h(xe,2),Je=f(Te),Ge=h(f(Je),2);{var vt=Z=>{var se=yue(),de=yt(se);vi(de,17,()=>o(n).groups,At=>At.name,(At,bt)=>{var qt=bue();let Le;var Se=f(qt),tt=f(Se),w=h(Se,2),j=f(w);T(()=>{Le=zt(qt,1,"group svelte-1az45ix",null,Le,{active:o(s)===o(bt).name}),B(tt,o(bt).name),B(j,o(bt).fields.length)}),H("click",qt,()=>p(s,o(bt).name,!0)),y(At,qt)});var lt=h(de,2);{var et=At=>{var bt=Cue();y(At,bt)};P(lt,At=>{o(n).groups.length===0&&At(et)})}y(Z,se)};P(Ge,Z=>{o(n)&&Z(vt)})}var ii=h(Ge,2),Vt=f(ii),He=h(Vt,2),at=h(Je,2),Wt=f(at);{var Ft=Z=>{var se=Fue(),de=yt(se),lt=f(de),et=f(lt),At=h(lt,2),bt=f(At),qt=h(At,4),Le=f(qt),Se=h(qt,2),tt=h(de,2),w=h(f(tt),2),j=f(w);vi(j,17,()=>o(M).fields,mt=>mt.name,(mt,Ot)=>{const oe=st(()=>`${o(M).name}/${o(Ot).name}`),Q=st(()=>o(b)[o(oe)]??(o(Ot).secret?"":o(Ot).value??"")),K=st(()=>o(Ot).secret?o(Q)!=="":o(Q)!==(o(Ot).value??""));var le=Due(),ct=f(le),Ye=f(ct),Bt=h(ct),wt=f(Bt),We=f(wt);{var Zt=Nt=>{var X=wue(),ae=yt(X),te=f(ae);sy(te,()=>!0);var ve=h(ae,2);T(()=>{xi(ve,"type",o(_)?"text":"password"),Ga(ve,o(Q)),ve.disabled=o(N)}),H("input",ve,Ve=>p(b,{...o(b),[o(oe)]:Ve.target.value},!0)),y(Nt,X)},Qt=Nt=>{var X=kue(),ae=yt(X),te=f(ae);sy(te,()=>!1);var ve=h(ae,2);{var Ve=ce=>{var re=Eue();xi(re,"rows",4),T(()=>{Ga(re,o(Q)),re.disabled=o(N)}),H("input",re,W=>p(b,{...o(b),[o(oe)]:W.target.value},!0)),y(ce,re)},Ae=st(()=>o(Q).includes(`
296
296
  `)),Et=ce=>{var re=Sue();T(()=>{Ga(re,o(Q)),re.disabled=o(N)}),H("input",re,W=>p(b,{...o(b),[o(oe)]:W.target.value},!0)),y(ce,re)};P(ve,ce=>{o(Ae)?ce(Ve):ce(Et,-1)})}T(()=>ae.disabled=o(d)||o(N)),H("click",ae,()=>Ee(o(M).name,o(Ot).name)),y(Nt,X)};P(We,Nt=>{o(Ot).secret?Nt(Zt):Nt(Qt,-1)})}var bi=h(We,2),Bi=h(Bt),J=f(Bi),$e=h(Bi),Dt=f($e);T(Nt=>{xi(ct,"title",`she.secrets.get('${o(oe)??""}')`),B(Ye,o(Ot).name),bi.disabled=o(d)||o(N)||!o(K)||!o(Q),B(J,Nt),Dt.disabled=o(d)||o(N)},[()=>qe(o(Ot).changed)]),Fs("submit",wt,Nt=>{Nt.preventDefault(),o(K)&&U(o(M).name,o(Ot).name,o(Q),o(Ot).secret)}),H("click",Dt,()=>pe(o(M).name,o(Ot).name)),y(mt,le)});var ie=h(j),_e=f(ie),De=f(_e),nt=h(_e),V=f(nt),Ze=f(V);let _t;var ge=f(Ze);sy(ge,()=>o(m));var Ke=h(Ze,2);{var ft=mt=>{var Ot=Aue();T(oe=>{xi(Ot,"rows",oe),Ot.disabled=o(N)},[()=>o(x).includes(`
297
297
  `)?4:1]),di(Ot,()=>o(x),oe=>p(x,oe)),y(mt,Ot)},St=st(()=>o(x).includes(`
298
- `)||o(_)||!o(m)),jt=mt=>{var Ot=Bue();T(()=>Ot.disabled=o(N)),di(Ot,()=>o(x),oe=>p(x,oe)),y(mt,Ot)};P(Ke,mt=>{o(St)?mt(ft):mt(jt,-1)})}var Be=h(Ke,2),gt=h(tt,2),$=f(gt),we=f($),ze=h($,2),xt=f(ze);T((mt,Ot)=>{B(et,o(M).name),B(bt,`changed ${mt??""}`),Se.disabled=o(d)||o(N),De.disabled=o(N),_t=zt(Ze,1,"lock svelte-1az45ix",null,_t,{"is-secret":o(m)}),Ze.disabled=o(N),xi(Ze,"title",o(m)?"secret — write-only once saved (click for a plain field, e.g. a user name)":"plain — shown in clear (click for a secret)"),Be.disabled=Ot,B(we,`she.secrets.get('${o(M).name??""}/<field>')`),B(xt,`she.secrets.get('${o(M).name??""}')`)},[()=>qe(o(M).changed),()=>o(d)||o(N)||!o(g).trim()||!o(x)]),Ds(Le,()=>o(_),mt=>p(_,mt)),H("click",Se,()=>he(o(M).name)),di(De,()=>o(g),mt=>p(g,mt)),Fs("submit",V,mt=>{mt.preventDefault(),I.test(o(g).trim())?U(o(M).name,o(g).trim(),o(x),o(m)):p(a,"field name: letters, digits, _ . - (max 64)")}),H("click",Ze,()=>p(m,!o(m))),y(Z,se)},oi=Z=>{var se=Iue(),de=f(se);{var lt=At=>{var bt=Lue();y(At,bt)},et=At=>{var bt=In("Select a group.");y(At,bt)};P(de,At=>{o(n).groups.length===0?At(lt):At(et,-1)})}y(Z,se)};P(Wt,Z=>{o(M)?Z(Ft):o(n)&&!o(N)&&Z(oi,1)})}T(Z=>{Vt.disabled=o(N),He.disabled=Z},[()=>o(N)||!o(u).trim()]),H("click",Fe,O),Fs("submit",ii,Z=>{Z.preventDefault(),ne()}),di(Vt,()=>o(u),Z=>p(u,Z)),y(r,it),bs()}Ss(["click","input"]);var Mue=S('<div class="safe-banner svelte-1n46o8q"><strong class="svelte-1n46o8q">⚠ SAFE MODE</strong> — no user script is running and the script directory is not watched. She was killed instead of stopped last time, which usually means a script blocked the event loop. Edit or delete it, then restart. <button class="safe-restart svelte-1n46o8q">Restart daemon</button></div>'),t6=S('<span class="nav-dot nav-dot--warn svelte-1n46o8q"></span>'),Rue=S('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="MQTT broker not connected"></span>'),Nue=S('<span class="nav-dot nav-dot--warn nav-dot--blink svelte-1n46o8q" title="Waiting for retained MQTT state"></span>'),Oue=S('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="MQTT connected"></span>'),Hue=S('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" class="svelte-1n46o8q"><path d="M8.36,5.73 A2.6,2.6 0 0,1 9.38,10.50" class="svelte-1n46o8q"></path><path d="M7.64,5.73 A2.6,2.6 0 0,0 6.62,10.50" class="svelte-1n46o8q"></path><path d="M9.16,3.95 A4.5,4.5 0 0,1 10.38,12.12" class="svelte-1n46o8q"></path><path d="M6.84,3.95 A4.5,4.5 0 0,0 5.62,12.12" class="svelte-1n46o8q"></path><path d="M10.40,2.37 A6.4,6.4 0 0,1 11.39,13.73" class="svelte-1n46o8q"></path><path d="M5.60,2.37 A6.4,6.4 0 0,0 4.61,13.73" class="svelte-1n46o8q"></path><path d="M7.15,8.3 L8,15.4 L8.85,8.3 Z" fill="currentColor" stroke="none" class="svelte-1n46o8q"></path><circle cx="8" cy="8.3" r="1.45" fill="currentColor" stroke="none" class="svelte-1n46o8q"></circle></svg> Broker</button>'),zue=S('<span class="nav-dot nav-dot--none svelte-1n46o8q"></span>'),Wue=S('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><rect x="2" y="2" width="12" height="4" rx="1" class="svelte-1n46o8q"></rect><rect x="2" y="10" width="12" height="4" rx="1" class="svelte-1n46o8q"></rect><circle cx="4.5" cy="4" r="0.6" fill="currentColor" class="svelte-1n46o8q"></circle><circle cx="4.5" cy="12" r="0.6" fill="currentColor" class="svelte-1n46o8q"></circle></svg> Adapters <!></button>'),jue=S('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="All Matter devices online"></span>'),Vue=S('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Some Matter devices offline"></span>'),$ue=S('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="No Matter devices online"></span>'),que=S('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M8,2 L8,7" class="svelte-1n46o8q"></path><path d="M6,5 L8,7.5 L10,5" class="svelte-1n46o8q"></path><path d="M2.5,14 L6,10" class="svelte-1n46o8q"></path><path d="M6.2,12.8 L6,10 L3.2,10.2" class="svelte-1n46o8q"></path><path d="M13.5,14 L10,10" class="svelte-1n46o8q"></path><path d="M9.8,12.8 L10,10 L12.8,10.2" class="svelte-1n46o8q"></path></svg> Matter <!></button>'),Uue=S('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><ellipse cx="8" cy="4.5" rx="5" ry="1.8" class="svelte-1n46o8q"></ellipse><path d="M3,4.5 v7 a5,1.8 0,0,0 10,0 v-7" class="svelte-1n46o8q"></path><path d="M3,8 a5,1.8 0,0,0 10,0" class="svelte-1n46o8q"></path></svg> DB</button>'),Gue=S('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="Errors in recent logs"></span>'),Kue=S('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Warnings in recent logs"></span>'),Zue=S('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),Yue=S('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),Xue=S('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),Que=S('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> </button>'),Jue=S('<div class="version-popup svelte-1n46o8q"><dl class="svelte-1n46o8q"><dt class="svelte-1n46o8q">Installed</dt><dd class="svelte-1n46o8q"></dd> <!></dl> <div class="version-actions svelte-1n46o8q"><!> <button class="check-btn svelte-1n46o8q" title="Check for updates now"><svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> </button></div></div>'),ehe=S('<dt class="svelte-1n46o8q">Uptime</dt><dd class="svelte-1n46o8q"> </dd>',1),the=S('<dt class="svelte-1n46o8q">Matter nodes</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Matter endpoints</dt><dd class="svelte-1n46o8q"> </dd>',1),ihe=S('<dt class="svelte-1n46o8q">DB docs</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">DB views</dt><dd class="svelte-1n46o8q"> </dd>',1),nhe=S('<dl class="svelte-1n46o8q"><!> <dt class="svelte-1n46o8q">Scripts</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT topics</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT msg/s</dt><dd class="svelte-1n46o8q"> </dd> <!> <!> <dt class="svelte-1n46o8q">Handlers</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Memory</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">CPU</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL util</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL lag mean</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL lag max</dt><dd class="svelte-1n46o8q"> </dd></dl>'),she=S('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),ohe=S('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M18.36 6.64a9 9 0 1 1-12.73 0" class="svelte-1n46o8q"></path><line x1="12" y1="2" x2="12" y2="12" class="svelte-1n46o8q"></line></svg> Restart daemon</button>'),rhe=S('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><!></div></div>'),ahe=S('<button class="nav-logout svelte-1n46o8q" title="Logout"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" class="svelte-1n46o8q"></path><polyline points="16 17 21 12 16 7" class="svelte-1n46o8q"></polyline><line x1="21" y1="12" x2="9" y2="12" class="svelte-1n46o8q"></line></svg></button>'),lhe=S("<div><!></div>"),che=S('<div class="shell svelte-1n46o8q"><!> <nav class="svelte-1n46o8q"><span class="brand svelte-1n46o8q">she</span> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="5,3 1,8 5,13" class="svelte-1n46o8q"></polyline><polyline points="11,3 15,8 11,13" class="svelte-1n46o8q"></polyline></svg> Scripts</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter" class="svelte-1n46o8q"><rect x="0.75" y="0.75" width="14.5" height="14.5" rx="1" class="svelte-1n46o8q"></rect><path d="M2,11 V5 H5 V11" class="svelte-1n46o8q"></path><path d="M6,12 V5 H9 V8 H6" class="svelte-1n46o8q"></path><path d="M10,11 V5 H15 V11" class="svelte-1n46o8q"></path><line x1="12.5" y1="5" x2="12.5" y2="11" class="svelte-1n46o8q"></line></svg> Packages <!></button> <button><svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor" stroke="none" style="vertical-align: middle" class="svelte-1n46o8q"><path fill-rule="evenodd" d="M2,0 H14 A2,2 0 0,1 16,2 V14 A2,2 0 0,1 14,16 H0 V2 A2,2 0 0,1 2,0 Z M0,16 L0,12 A4,4 0 0,1 4,16 Z M0,10.5 A5.5,5.5 0 0,1 5.5,16 L9,16 A9,9 0 0,0 0,7 Z M0,5.5 A10.5,10.5 0 0,1 10.5,16 L13.5,16 A13.5,13.5 0 0,0 0,2.5 Z" class="svelte-1n46o8q"></path></svg> MQTT <!></button> <!> <!> <!> <!> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><rect x="3" y="7" width="10" height="7" rx="1.5" class="svelte-1n46o8q"></rect><path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2" class="svelte-1n46o8q"></path><circle cx="8" cy="9.9" r="1.15" stroke-width="1.1" class="svelte-1n46o8q"></circle><path d="M8 11v1.2" stroke-width="1.1" class="svelte-1n46o8q"></path></svg> Secrets</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" class="svelte-1n46o8q"><line x1="2" y1="5" x2="14" y2="5" class="svelte-1n46o8q"></line><line x1="2" y1="8" x2="14" y2="8" class="svelte-1n46o8q"></line><line x1="2" y1="11" x2="9" y2="11" class="svelte-1n46o8q"></line></svg> Logs <!></button> <div class="nav-spacer svelte-1n46o8q"></div> <div class="nav-right svelte-1n46o8q"><a class="nav-icon svelte-1n46o8q" href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" title="GitHub"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" class="svelte-1n46o8q"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" class="svelte-1n46o8q"></path></svg></a> <div class="version-wrap svelte-1n46o8q"><button class="version svelte-1n46o8q"> <!></button> <!></div> <div class="stats-wrap svelte-1n46o8q"><button class="nav-icon svelte-1n46o8q" title="Daemon status"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><line x1="18" y1="20" x2="18" y2="10" class="svelte-1n46o8q"></line><line x1="12" y1="20" x2="12" y2="4" class="svelte-1n46o8q"></line><line x1="6" y1="20" x2="6" y2="14" class="svelte-1n46o8q"></line></svg></button> <!></div> <button title="Settings"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" class="svelte-1n46o8q"></path><circle cx="12" cy="12" r="3" class="svelte-1n46o8q"></circle></svg></button> <!></div></nav> <main class="svelte-1n46o8q"><!> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <!> <div><!></div> <div><!></div> <div><!></div> <div><!></div></main></div>'),dhe=S('<div class="login-error svelte-1n46o8q"> </div>'),uhe=S('<div class="login-overlay svelte-1n46o8q"><form class="login-box svelte-1n46o8q"><div class="login-brand svelte-1n46o8q">she</div> <h2 class="svelte-1n46o8q">Sign in</h2> <div class="login-field svelte-1n46o8q"><label for="she-password" class="svelte-1n46o8q">Password</label> <input id="she-password" type="password" placeholder="Enter password" autocomplete="current-password" class="svelte-1n46o8q"/></div> <!> <button type="submit" class="login-btn svelte-1n46o8q"> </button></form></div>'),hhe=S('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> Restarting smart-home-engine…</div></div>'),fhe=S('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> Updating smart-home-engine…</div></div>'),phe=S("<!> <!> <!> <!>",1);function ghe(r,e){_s(e,!0);const t=["scripts","mqtt","matter","broker","adapters","secrets","db","logs","config","packages"],i={services:"adapters",security:"broker"};function n(){const et=location.hash.replace(/^#\/?/,""),[At,...bt]=et.split("/"),qt=i[At]??At;if(!t.includes(qt))return{page:"scripts",sub:null};const Le=bt.map(Se=>{try{return decodeURIComponent(Se)}catch{return Se}}).join("/");return{page:qt,sub:Le||null}}let s=A(yi(n().page)),a=A(yi(n().sub)),l=A(null),d=A(!1),u=A(!1),g=A(!1),x=A(!1),m=A("none"),b=A(""),_=A(!1),E=A(""),k=A(""),I=A(!1),M=A(!1);rG(()=>{p(_,!0)});async function N(){p(k,""),p(I,!0);try{await cG(o(E)),p(E,""),p(_,!1)}catch(et){p(k,et.message??"Login failed",!0)}finally{p(I,!1)}}async function O(){if(o(m)==="proxy"&&o(b)){window.location.href=o(b);return}await dG(),p(_,!0)}let z=A(null),G=A(!1),U=A(!1),ne=A(!1),Ee=A(!1),pe=A(yi([])),he=A(0),qe=A(!1),it=A(!1),ue=A("none"),Ue=A(""),me=A(yi([]));const Qe=st(()=>o(me).filter(et=>et.online).length),be=st(()=>o(me).length===0?"none":o(Qe)===o(me).length?"all":o(Qe)>0?"some":"offline");let Pt=A(!1),Ne=A(!1);async function Fe(){if(!await o(z).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))return;p(G,!0);let et;try{et=(await Kc()).startedAt}catch{}try{await CB()}catch{}const At=Date.now()+6e4;for(;Date.now()<At;){await new Promise(bt=>setTimeout(bt,250));try{const bt=await Kc();if(et===void 0||bt.startedAt!==et){location.reload();return}}catch{}}location.reload()}async function Pe(){p(g,!0);try{const et=await mG();o(l)&&p(l,{...o(l),latestVersion:et.latestVersion??void 0},!0)}catch{}finally{p(g,!1)}}async function It(){var bt,qt;if(!await o(z).show(`Update to v${(bt=o(l))==null?void 0:bt.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;p(u,!1),p(x,!0);const et=(qt=o(l))==null?void 0:qt.startedAt;try{await xG()}catch{}const At=Date.now()+18e4;for(;Date.now()<At;){await new Promise(Le=>setTimeout(Le,1e3));try{const Le=await Kc();if(et===void 0||Le.startedAt!==et){location.reload();return}}catch{p(x,!1),p(G,!0)}}location.reload()}let xe=A(void 0),ke=A(0);function Te(){if(!o(xe))return;const et=getComputedStyle(o(xe)),At=parseFloat(et.columnGap)||0,bt=[...o(xe).children];let qt=parseFloat(et.paddingLeft)+parseFloat(et.paddingRight)+At*Math.max(0,bt.length-1);for(const Se of bt)Se.classList.contains("nav-spacer")||(qt+=Se.getBoundingClientRect().width);const Le=Math.ceil(qt)+8;Le>0&&Le!==o(ke)&&p(ke,Le)}let Je=null;function Ge(){if(!(!o(xe)||!Je)){Je.disconnect(),Je.observe(o(xe));for(const et of o(xe).children)Je.observe(et);Te()}}Ws(()=>(Je=new ResizeObserver(()=>Te()),Ge(),()=>{Je==null||Je.disconnect(),Je=null})),ln(()=>{var et,At,bt,qt;o(qe),o(it),(et=o(l))==null||et.matterEnabled,(At=o(l))==null||At.dbEnabled,(bt=o(l))==null||bt.latestVersion,(qt=o(l))==null||qt.docker,xa().then(()=>Lo(Ge))});function vt(et){p(s,et,!0),p(a,null),location.hash=ii(et,null)}function ii(et,At){const bt=At?At.split("/").map(encodeURIComponent).join("/"):"";return`#/${et}${bt?"/"+bt:""}`}function Vt(et,At){const bt=At||null;o(s)!==et||o(a)===bt||(p(a,bt,!0),history.replaceState(null,"",ii(et,bt)))}Ws(async()=>{const et=ii(o(s),o(a));location.hash!==et&&history.replaceState(null,"",et);const At=()=>{const _e=n();p(s,_e.page,!0),p(a,_e.sub,!0)};window.addEventListener("hashchange",At);const bt=()=>{document.visibilityState==="visible"&&(xZ(),Kc().then(_e=>{p(l,_e,!0)}).catch(()=>{}),requestAnimationFrame(()=>{document.body.style.display="none",document.body.offsetHeight,document.body.style.display="",window.dispatchEvent(new Event("she:visible"))}))};document.addEventListener("visibilitychange",bt);try{const _e=await lG();p(m,_e.mode,!0),p(b,_e.proxyLogoutUrl??"",!0),o(m)==="password"&&(await fetch("/she/scripts")).status===401&&p(_,!0)}catch{}p(M,!0);async function qt(){var _e,De,nt,V;try{p(l,await Kc(),!0)}catch{}try{const[Ze,_t]=await Promise.all([EB(),wc()]);p(pe,Array.isArray(_t.pinnedPackages)?_t.pinnedPackages:[],!0),p(he,Object.keys(Ze).filter(ft=>!o(pe).includes(ft)).length,!0);const ge=o(qe);p(qe,((_e=_t.broker)==null?void 0:_e.enabled)===!0),ge&&!o(qe)&&o(s)==="broker"&&vt("scripts");const Ke=o(it);p(it,((De=_t.services)==null?void 0:De.enabled)===!0),Ke&&!o(it)&&o(s)==="adapters"&&vt("scripts")}catch{}!((nt=o(l))!=null&&nt.matterEnabled)&&o(s)==="matter"&&vt("scripts"),!((V=o(l))!=null&&V.dbEnabled)&&o(s)==="db"&&vt("scripts")}qt();const Le=setInterval(qt,5e3),Se=qo("mqtt:status",_e=>{_e.connected===!1?(p(Ee,!0),p(U,!1),p(ne,!1)):(p(Ee,!1),p(U,_e.ready===!1),p(ne,_e.ready===!0))}),tt=qo("matter:deviceList",_e=>{Array.isArray(_e.devices)&&p(me,_e.devices.map(De=>({nodeId:String(De.nodeId),online:!!De.online})),!0)}),w=qo("matter:deviceStatus",_e=>{if(_e.nodeId===void 0)return;const De=String(_e.nodeId),nt=!!_e.online;p(me,o(me).map(V=>V.nodeId===De?{...V,online:nt}:V),!0)}),j=PB();p(Pt,j.some(_e=>_e.level==="error"),!0),p(Ne,!o(Pt)&&j.some(_e=>_e.level==="warn"),!0);const ie=f2(_e=>{_e.level==="error"?(p(Pt,!0),p(Ne,!1)):_e.level==="warn"&&!o(Pt)&&p(Ne,!0)});return()=>{window.removeEventListener("hashchange",At),document.removeEventListener("visibilitychange",bt),clearInterval(Le),Se(),tt(),w(),ie()}});var He=phe();Fs("click",a3,()=>{o(d)&&p(d,!1),o(u)&&p(u,!1)});var at=yt(He);{var Wt=et=>{var At=che(),bt=f(At);{var qt=Re=>{var ut=Mue(),ei=h(f(ut),2);H("click",ei,Fe),y(Re,ut)};P(bt,Re=>{var ut;(ut=o(l))!=null&&ut.safeMode&&Re(qt)})}var Le=h(bt,2),Se=h(f(Le),2);let tt;var w=h(Se,2);let j;var ie=h(f(w),2);{var _e=Re=>{var ut=t6();T(()=>xi(ut,"title",`${o(he)??""} package update${o(he)===1?"":"s"} available`)),y(Re,ut)};P(ie,Re=>{o(he)>0&&Re(_e)})}var De=h(w,2);let nt;var V=h(f(De),2);{var Ze=Re=>{var ut=Rue();y(Re,ut)},_t=Re=>{var ut=Nue();y(Re,ut)},ge=Re=>{var ut=Oue();y(Re,ut)};P(V,Re=>{o(Ee)?Re(Ze):o(U)?Re(_t,1):o(ne)&&Re(ge,2)})}var Ke=h(De,2);{var ft=Re=>{var ut=Hue();let ei;T(()=>ei=zt(ut,1,"svelte-1n46o8q",null,ei,{active:o(s)==="broker"})),H("click",ut,()=>vt("broker")),y(Re,ut)};P(Ke,Re=>{o(qe)&&Re(ft)})}var St=h(Ke,2);{var jt=Re=>{var ut=Wue();let ei;var Ui=h(f(ut),2);{var ji=Gt=>{var ui=t6();T(()=>xi(ui,"title",o(Ue))),y(Gt,ui)},Hi=Gt=>{var ui=zue();y(Gt,ui)};P(Ui,Gt=>{o(ue)==="warn"?Gt(ji):Gt(Hi,-1)})}T(()=>ei=zt(ut,1,"svelte-1n46o8q",null,ei,{active:o(s)==="adapters"})),H("click",ut,()=>vt("adapters")),y(Re,ut)};P(St,Re=>{o(it)&&Re(jt)})}var Be=h(St,2);{var gt=Re=>{var ut=que();let ei;var Ui=h(f(ut),2);{var ji=ui=>{var wi=jue();y(ui,wi)},Hi=ui=>{var wi=Vue();y(ui,wi)},Gt=ui=>{var wi=$ue();y(ui,wi)};P(Ui,ui=>{o(be)==="all"?ui(ji):o(be)==="some"?ui(Hi,1):o(be)==="offline"&&ui(Gt,2)})}T(()=>ei=zt(ut,1,"svelte-1n46o8q",null,ei,{active:o(s)==="matter"})),H("click",ut,()=>vt("matter")),y(Re,ut)};P(Be,Re=>{var ut;(ut=o(l))!=null&&ut.matterEnabled&&Re(gt)})}var $=h(Be,2);{var we=Re=>{var ut=Uue();let ei;T(()=>ei=zt(ut,1,"svelte-1n46o8q",null,ei,{active:o(s)==="db"})),H("click",ut,()=>vt("db")),y(Re,ut)};P($,Re=>{var ut;(ut=o(l))!=null&&ut.dbEnabled&&Re(we)})}var ze=h($,2);let xt;var mt=h(ze,2);let Ot;var oe=h(f(mt),2);{var Q=Re=>{var ut=Gue();y(Re,ut)},K=Re=>{var ut=Kue();y(Re,ut)};P(oe,Re=>{o(Pt)?Re(Q):o(Ne)&&Re(K,1)})}var le=h(mt,4),ct=h(f(le),2),Ye=f(ct),Bt=f(Ye);Bt.nodeValue="v1.53.2 ";var wt=h(Bt);{var We=Re=>{var ut=Zue();y(Re,ut)};P(wt,Re=>{var ut,ei;(ut=o(l))!=null&&ut.latestVersion&&!((ei=o(l))!=null&&ei.docker)&&Re(We)})}var Zt=h(Ye,2);{var Qt=Re=>{var ut=Jue(),ei=f(ut),Ui=h(f(ei));Ui.textContent="v1.53.2";var ji=h(Ui,2);{var Hi=pn=>{var $i=Yue(),qn=h(yt($i)),ss=f(qn);T(()=>B(ss,`v${o(l).latestVersion??""}`)),y(pn,$i)},Gt=pn=>{var $i=Xue();y(pn,$i)};P(ji,pn=>{var $i;($i=o(l))!=null&&$i.latestVersion?pn(Hi):pn(Gt,-1)})}var ui=h(ei,2),wi=f(ui);{var Qi=pn=>{var $i=Que(),qn=h(f($i));T(()=>B(qn,` Update to v${o(l).latestVersion??""}`)),H("click",$i,It),y(pn,$i)};P(wi,pn=>{var $i;($i=o(l))!=null&&$i.latestVersion&&pn(Qi)})}var Oi=h(wi,2),Cn=f(Oi);let vn;var Pn=h(Cn);T(()=>{Oi.disabled=o(g),vn=zt(Cn,0,"svelte-1n46o8q",null,vn,{spinning:o(g)}),B(Pn,` ${o(g)?"Checking…":"Check for updates"}`)}),H("click",ut,pn=>pn.stopPropagation()),H("click",Oi,Pe),y(Re,ut)};P(Zt,Re=>{var ut;o(u)&&!((ut=o(l))!=null&&ut.docker)&&Re(Qt)})}var bi=h(ct,2),Bi=f(bi),J=h(Bi,2);{var $e=Re=>{var ut=rhe(),ei=f(ut);{var Ui=wi=>{var Qi=nhe(),Oi=f(Qi);{var Cn=Kt=>{const gi=st(()=>Math.floor((Date.now()-o(l).startedAt)/1e3)),mi=st(()=>Math.floor(o(gi)/86400)),qi=st(()=>Math.floor(o(gi)%86400/3600)),sn=st(()=>Math.floor(o(gi)%3600/60));var dn=ehe(),xn=h(yt(dn)),wn=f(xn);T(()=>B(wn,`${o(mi)>0?o(mi)+"d ":""}${o(qi)>0||o(mi)>0?o(qi)+"h ":""}${o(sn)??""}m`)),y(Kt,dn)};P(Oi,Kt=>{o(l).startedAt&&Kt(Cn)})}var vn=h(Oi,3),Pn=f(vn),pn=h(vn,3),$i=f(pn),qn=h(pn,3),ss=f(qn),gs=h(qn,2);{var Zs=Kt=>{var gi=the(),mi=h(yt(gi)),qi=f(mi),sn=h(mi,3),dn=f(sn);T(()=>{B(qi,o(l).matterNodes??0),B(dn,o(l).matterEndpoints??0)}),y(Kt,gi)};P(gs,Kt=>{o(l).matterEnabled&&Kt(Zs)})}var os=h(gs,2);{var no=Kt=>{var gi=ihe(),mi=h(yt(gi)),qi=f(mi),sn=h(mi,3),dn=f(sn);T(()=>{B(qi,o(l).dbDocs??"—"),B(dn,o(l).dbViews??"—")}),y(Kt,gi)};P(os,Kt=>{o(l).dbEnabled&&Kt(no)})}var Ie=h(os,3),pt=f(Ie),ot=h(Ie,3),si=f(ot),pi=h(ot,3),Ii=f(pi),Ri=h(pi,3),Rt=f(Ri),Di=h(Ri,3),hi=f(Di),Si=h(Di,3),Fi=f(Si);T(()=>{B(Pn,o(l).scripts),B($i,o(l).topics),B(ss,o(l).mqttMsgPerSec??"—"),B(pt,o(l).handlers??"—"),B(si,o(l).memMb!=null?o(l).memMb+" MB":"—"),B(Ii,o(l).cpuPercent!=null?o(l).cpuPercent+" %":"—"),B(Rt,o(l).eluPercent!=null?o(l).eluPercent+" %":"—"),B(hi,o(l).elMeanMs!=null?o(l).elMeanMs+" ms":"—"),B(Fi,o(l).elMaxMs!=null?o(l).elMaxMs+" ms":"—")}),y(wi,Qi)},ji=wi=>{var Qi=she();y(wi,Qi)};P(ei,wi=>{o(l)?wi(Ui):wi(ji,-1)})}var Hi=h(ei,2),Gt=f(Hi);{var ui=wi=>{var Qi=ohe();H("click",Qi,()=>{p(d,!1),Fe()}),y(wi,Qi)};P(Gt,wi=>{var Qi;(Qi=o(l))!=null&&Qi.docker||wi(ui)})}H("click",ut,wi=>wi.stopPropagation()),y(Re,ut)};P(J,Re=>{o(d)&&Re($e)})}var Dt=h(bi,2);let Nt;var X=h(Dt,2);{var ae=Re=>{var ut=ahe();H("click",ut,O),y(Re,ut)};P(X,Re=>{o(m)==="password"&&Re(ae)})}ds(Le,Re=>p(xe,Re),()=>o(xe));var te=h(Le,2),ve=f(te);ds(Fr(ve,{}),Re=>p(z,Re,!0),()=>o(z));var Ve=h(ve,2);let Ae;var Et=f(Ve);{let Re=st(()=>o(s)==="scripts"),ut=st(()=>o(s)==="scripts"?o(a):null);rJ(Et,{get active(){return o(Re)},get sub(){return o(ut)},onsub:ei=>Vt("scripts",ei)})}var ce=h(Ve,2);let re;var W=f(ce);Nne(W,{});var Y=h(ce,2);let Ce;var je=f(Y);{let Re=st(()=>o(s)==="mqtt"),ut=st(()=>o(s)==="mqtt"?o(a):null);mne(je,{get active(){return o(Re)},get sub(){return o(ut)},onsub:ei=>Vt("mqtt",ei)})}var ye=h(Y,2);let rt;var dt=f(ye);{let Re=st(()=>o(s)==="matter"),ut=st(()=>o(s)==="matter"?o(a):null);uie(dt,{get active(){return o(Re)},get sub(){return o(ut)},onsub:ei=>Vt("matter",ei)})}var Tt=h(ye,2);let kt;var Lt=f(Tt);{let Re=st(()=>o(s)==="broker"),ut=st(()=>o(s)==="broker"?o(a):null);gre(Lt,{get active(){return o(Re)},get sub(){return o(ut)},onsub:ei=>Vt("broker",ei)})}var Mt=h(Tt,2);{var Ht=Re=>{var ut=lhe();let ei;var Ui=f(ut);{let ji=st(()=>o(s)==="adapters"),Hi=st(()=>o(s)==="adapters"?o(a):null);hue(Ui,{onstatus:(Gt,ui)=>{p(ue,Gt,!0),p(Ue,ui,!0)},get active(){return o(ji)},get sub(){return o(Hi)},onsub:Gt=>Vt("adapters",Gt)})}T(()=>ei=zt(ut,1,"page-wrap svelte-1n46o8q",null,ei,{hidden:o(s)!=="adapters"})),y(Re,ut)};P(Mt,Re=>{o(it)&&Re(Ht)})}var Xt=h(Mt,2);let Li;var Gi=f(Xt);{let Re=st(()=>o(s)==="secrets"),ut=st(()=>o(s)==="secrets"?o(a):null);Tue(Gi,{get active(){return o(Re)},get sub(){return o(ut)},onsub:ei=>Vt("secrets",ei)})}var fi=h(Xt,2);let Ni;var Ki=f(fi);{let Re=st(()=>o(s)==="db"),ut=st(()=>o(s)==="db"?o(a):null);hte(Ki,{get active(){return o(Re)},get sub(){return o(ut)},onsub:ei=>Vt("db",ei)})}var Me=h(fi,2);let li;var Ei=f(Me);eee(Ei,{});var Ti=h(Me,2);let Ci;var Jt=f(Ti);ree(Jt,{}),T(()=>{Po(At,o(ke)?`min-width: ${o(ke)}px`:void 0),tt=zt(Se,1,"svelte-1n46o8q",null,tt,{active:o(s)==="scripts"}),j=zt(w,1,"svelte-1n46o8q",null,j,{active:o(s)==="packages"}),nt=zt(De,1,"svelte-1n46o8q",null,nt,{active:o(s)==="mqtt"}),xt=zt(ze,1,"svelte-1n46o8q",null,xt,{active:o(s)==="secrets"}),Ot=zt(mt,1,"svelte-1n46o8q",null,Ot,{active:o(s)==="logs"}),Nt=zt(Dt,1,"nav-settings svelte-1n46o8q",null,Nt,{active:o(s)==="config"}),Ae=zt(Ve,1,"page-wrap svelte-1n46o8q",null,Ae,{hidden:o(s)!=="scripts"}),re=zt(ce,1,"page-wrap svelte-1n46o8q",null,re,{hidden:o(s)!=="packages"}),Ce=zt(Y,1,"page-wrap svelte-1n46o8q",null,Ce,{hidden:o(s)!=="mqtt"}),rt=zt(ye,1,"page-wrap svelte-1n46o8q",null,rt,{hidden:o(s)!=="matter"}),kt=zt(Tt,1,"page-wrap svelte-1n46o8q",null,kt,{hidden:o(s)!=="broker"}),Li=zt(Xt,1,"page-wrap svelte-1n46o8q",null,Li,{hidden:o(s)!=="secrets"}),Ni=zt(fi,1,"page-wrap svelte-1n46o8q",null,Ni,{hidden:o(s)!=="db"}),li=zt(Me,1,"page-wrap svelte-1n46o8q",null,li,{hidden:o(s)!=="config"}),Ci=zt(Ti,1,"page-wrap svelte-1n46o8q",null,Ci,{hidden:o(s)!=="logs"})}),H("click",Se,()=>vt("scripts")),H("click",w,()=>vt("packages")),H("click",De,()=>vt("mqtt")),H("click",ze,()=>vt("secrets")),H("click",mt,()=>{vt("logs"),p(Pt,!1),p(Ne,!1)}),H("click",Ye,Re=>{Re.stopPropagation(),p(u,!o(u)),p(d,!1)}),H("click",Bi,Re=>{Re.stopPropagation(),p(d,!o(d)),p(u,!1)}),H("click",Dt,()=>vt("config")),y(et,At)};P(at,et=>{o(M)&&!o(_)&&et(Wt)})}var Ft=h(at,2);{var oi=et=>{var At=uhe(),bt=f(At),qt=h(f(bt),4),Le=h(f(qt),2),Se=h(qt,2);{var tt=ie=>{var _e=dhe(),De=f(_e);T(()=>B(De,o(k))),y(ie,_e)};P(Se,ie=>{o(k)&&ie(tt)})}var w=h(Se,2),j=f(w);T(()=>{Le.disabled=o(I),w.disabled=o(I)||!o(E),B(j,o(I)?"Signing in…":"Sign in")}),Fs("submit",bt,ie=>{ie.preventDefault(),N()}),di(Le,()=>o(E),ie=>p(E,ie)),y(et,At)};P(Ft,et=>{o(_)&&et(oi)})}var Z=h(Ft,2);{var se=et=>{var At=hhe();y(et,At)};P(Z,et=>{o(G)&&et(se)})}var de=h(Z,2);{var lt=et=>{var At=fhe();y(et,At)};P(de,et=>{o(x)&&et(lt)})}y(r,He),bs()}Ss(["click"]);wM(ghe,{target:document.getElementById("app")});export{W3 as t};
298
+ `)||o(_)||!o(m)),jt=mt=>{var Ot=Bue();T(()=>Ot.disabled=o(N)),di(Ot,()=>o(x),oe=>p(x,oe)),y(mt,Ot)};P(Ke,mt=>{o(St)?mt(ft):mt(jt,-1)})}var Be=h(Ke,2),gt=h(tt,2),$=f(gt),we=f($),ze=h($,2),xt=f(ze);T((mt,Ot)=>{B(et,o(M).name),B(bt,`changed ${mt??""}`),Se.disabled=o(d)||o(N),De.disabled=o(N),_t=zt(Ze,1,"lock svelte-1az45ix",null,_t,{"is-secret":o(m)}),Ze.disabled=o(N),xi(Ze,"title",o(m)?"secret — write-only once saved (click for a plain field, e.g. a user name)":"plain — shown in clear (click for a secret)"),Be.disabled=Ot,B(we,`she.secrets.get('${o(M).name??""}/<field>')`),B(xt,`she.secrets.get('${o(M).name??""}')`)},[()=>qe(o(M).changed),()=>o(d)||o(N)||!o(g).trim()||!o(x)]),Ds(Le,()=>o(_),mt=>p(_,mt)),H("click",Se,()=>he(o(M).name)),di(De,()=>o(g),mt=>p(g,mt)),Fs("submit",V,mt=>{mt.preventDefault(),I.test(o(g).trim())?U(o(M).name,o(g).trim(),o(x),o(m)):p(a,"field name: letters, digits, _ . - (max 64)")}),H("click",Ze,()=>p(m,!o(m))),y(Z,se)},oi=Z=>{var se=Iue(),de=f(se);{var lt=At=>{var bt=Lue();y(At,bt)},et=At=>{var bt=In("Select a group.");y(At,bt)};P(de,At=>{o(n).groups.length===0?At(lt):At(et,-1)})}y(Z,se)};P(Wt,Z=>{o(M)?Z(Ft):o(n)&&!o(N)&&Z(oi,1)})}T(Z=>{Vt.disabled=o(N),He.disabled=Z},[()=>o(N)||!o(u).trim()]),H("click",Fe,O),Fs("submit",ii,Z=>{Z.preventDefault(),ne()}),di(Vt,()=>o(u),Z=>p(u,Z)),y(r,it),bs()}Ss(["click","input"]);var Mue=S('<div class="safe-banner svelte-1n46o8q"><strong class="svelte-1n46o8q">⚠ SAFE MODE</strong> — no user script is running and the script directory is not watched. She was killed instead of stopped last time, which usually means a script blocked the event loop. Edit or delete it, then restart. <button class="safe-restart svelte-1n46o8q">Restart daemon</button></div>'),t6=S('<span class="nav-dot nav-dot--warn svelte-1n46o8q"></span>'),Rue=S('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="MQTT broker not connected"></span>'),Nue=S('<span class="nav-dot nav-dot--warn nav-dot--blink svelte-1n46o8q" title="Waiting for retained MQTT state"></span>'),Oue=S('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="MQTT connected"></span>'),Hue=S('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" class="svelte-1n46o8q"><path d="M8.36,5.73 A2.6,2.6 0 0,1 9.38,10.50" class="svelte-1n46o8q"></path><path d="M7.64,5.73 A2.6,2.6 0 0,0 6.62,10.50" class="svelte-1n46o8q"></path><path d="M9.16,3.95 A4.5,4.5 0 0,1 10.38,12.12" class="svelte-1n46o8q"></path><path d="M6.84,3.95 A4.5,4.5 0 0,0 5.62,12.12" class="svelte-1n46o8q"></path><path d="M10.40,2.37 A6.4,6.4 0 0,1 11.39,13.73" class="svelte-1n46o8q"></path><path d="M5.60,2.37 A6.4,6.4 0 0,0 4.61,13.73" class="svelte-1n46o8q"></path><path d="M7.15,8.3 L8,15.4 L8.85,8.3 Z" fill="currentColor" stroke="none" class="svelte-1n46o8q"></path><circle cx="8" cy="8.3" r="1.45" fill="currentColor" stroke="none" class="svelte-1n46o8q"></circle></svg> Broker</button>'),zue=S('<span class="nav-dot nav-dot--none svelte-1n46o8q"></span>'),Wue=S('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><rect x="2" y="2" width="12" height="4" rx="1" class="svelte-1n46o8q"></rect><rect x="2" y="10" width="12" height="4" rx="1" class="svelte-1n46o8q"></rect><circle cx="4.5" cy="4" r="0.6" fill="currentColor" class="svelte-1n46o8q"></circle><circle cx="4.5" cy="12" r="0.6" fill="currentColor" class="svelte-1n46o8q"></circle></svg> Adapters <!></button>'),jue=S('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="All Matter devices online"></span>'),Vue=S('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Some Matter devices offline"></span>'),$ue=S('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="No Matter devices online"></span>'),que=S('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M8,2 L8,7" class="svelte-1n46o8q"></path><path d="M6,5 L8,7.5 L10,5" class="svelte-1n46o8q"></path><path d="M2.5,14 L6,10" class="svelte-1n46o8q"></path><path d="M6.2,12.8 L6,10 L3.2,10.2" class="svelte-1n46o8q"></path><path d="M13.5,14 L10,10" class="svelte-1n46o8q"></path><path d="M9.8,12.8 L10,10 L12.8,10.2" class="svelte-1n46o8q"></path></svg> Matter <!></button>'),Uue=S('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><ellipse cx="8" cy="4.5" rx="5" ry="1.8" class="svelte-1n46o8q"></ellipse><path d="M3,4.5 v7 a5,1.8 0,0,0 10,0 v-7" class="svelte-1n46o8q"></path><path d="M3,8 a5,1.8 0,0,0 10,0" class="svelte-1n46o8q"></path></svg> DB</button>'),Gue=S('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="Errors in recent logs"></span>'),Kue=S('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Warnings in recent logs"></span>'),Zue=S('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),Yue=S('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),Xue=S('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),Que=S('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> </button>'),Jue=S('<div class="version-popup svelte-1n46o8q"><dl class="svelte-1n46o8q"><dt class="svelte-1n46o8q">Installed</dt><dd class="svelte-1n46o8q"></dd> <!></dl> <div class="version-actions svelte-1n46o8q"><!> <button class="check-btn svelte-1n46o8q" title="Check for updates now"><svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> </button></div></div>'),ehe=S('<dt class="svelte-1n46o8q">Uptime</dt><dd class="svelte-1n46o8q"> </dd>',1),the=S('<dt class="svelte-1n46o8q">Matter nodes</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Matter endpoints</dt><dd class="svelte-1n46o8q"> </dd>',1),ihe=S('<dt class="svelte-1n46o8q">DB docs</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">DB views</dt><dd class="svelte-1n46o8q"> </dd>',1),nhe=S('<dl class="svelte-1n46o8q"><!> <dt class="svelte-1n46o8q">Scripts</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT topics</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT msg/s</dt><dd class="svelte-1n46o8q"> </dd> <!> <!> <dt class="svelte-1n46o8q">Handlers</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Memory</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">CPU</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL util</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL lag mean</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL lag max</dt><dd class="svelte-1n46o8q"> </dd></dl>'),she=S('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),ohe=S('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M18.36 6.64a9 9 0 1 1-12.73 0" class="svelte-1n46o8q"></path><line x1="12" y1="2" x2="12" y2="12" class="svelte-1n46o8q"></line></svg> Restart daemon</button>'),rhe=S('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><!></div></div>'),ahe=S('<button class="nav-logout svelte-1n46o8q" title="Logout"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" class="svelte-1n46o8q"></path><polyline points="16 17 21 12 16 7" class="svelte-1n46o8q"></polyline><line x1="21" y1="12" x2="9" y2="12" class="svelte-1n46o8q"></line></svg></button>'),lhe=S("<div><!></div>"),che=S('<div class="shell svelte-1n46o8q"><!> <nav class="svelte-1n46o8q"><span class="brand svelte-1n46o8q">she</span> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="5,3 1,8 5,13" class="svelte-1n46o8q"></polyline><polyline points="11,3 15,8 11,13" class="svelte-1n46o8q"></polyline></svg> Scripts</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter" class="svelte-1n46o8q"><rect x="0.75" y="0.75" width="14.5" height="14.5" rx="1" class="svelte-1n46o8q"></rect><path d="M2,11 V5 H5 V11" class="svelte-1n46o8q"></path><path d="M6,12 V5 H9 V8 H6" class="svelte-1n46o8q"></path><path d="M10,11 V5 H15 V11" class="svelte-1n46o8q"></path><line x1="12.5" y1="5" x2="12.5" y2="11" class="svelte-1n46o8q"></line></svg> Packages <!></button> <button><svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor" stroke="none" style="vertical-align: middle" class="svelte-1n46o8q"><path fill-rule="evenodd" d="M2,0 H14 A2,2 0 0,1 16,2 V14 A2,2 0 0,1 14,16 H0 V2 A2,2 0 0,1 2,0 Z M0,16 L0,12 A4,4 0 0,1 4,16 Z M0,10.5 A5.5,5.5 0 0,1 5.5,16 L9,16 A9,9 0 0,0 0,7 Z M0,5.5 A10.5,10.5 0 0,1 10.5,16 L13.5,16 A13.5,13.5 0 0,0 0,2.5 Z" class="svelte-1n46o8q"></path></svg> MQTT <!></button> <!> <!> <!> <!> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><rect x="3" y="7" width="10" height="7" rx="1.5" class="svelte-1n46o8q"></rect><path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2" class="svelte-1n46o8q"></path><circle cx="8" cy="9.9" r="1.15" stroke-width="1.1" class="svelte-1n46o8q"></circle><path d="M8 11v1.2" stroke-width="1.1" class="svelte-1n46o8q"></path></svg> Secrets</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" class="svelte-1n46o8q"><line x1="2" y1="5" x2="14" y2="5" class="svelte-1n46o8q"></line><line x1="2" y1="8" x2="14" y2="8" class="svelte-1n46o8q"></line><line x1="2" y1="11" x2="9" y2="11" class="svelte-1n46o8q"></line></svg> Logs <!></button> <div class="nav-spacer svelte-1n46o8q"></div> <div class="nav-right svelte-1n46o8q"><a class="nav-icon svelte-1n46o8q" href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" title="GitHub"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" class="svelte-1n46o8q"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" class="svelte-1n46o8q"></path></svg></a> <div class="version-wrap svelte-1n46o8q"><button class="version svelte-1n46o8q"> <!></button> <!></div> <div class="stats-wrap svelte-1n46o8q"><button class="nav-icon svelte-1n46o8q" title="Daemon status"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><line x1="18" y1="20" x2="18" y2="10" class="svelte-1n46o8q"></line><line x1="12" y1="20" x2="12" y2="4" class="svelte-1n46o8q"></line><line x1="6" y1="20" x2="6" y2="14" class="svelte-1n46o8q"></line></svg></button> <!></div> <button title="Settings"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" class="svelte-1n46o8q"></path><circle cx="12" cy="12" r="3" class="svelte-1n46o8q"></circle></svg></button> <!></div></nav> <main class="svelte-1n46o8q"><!> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <!> <div><!></div> <div><!></div> <div><!></div> <div><!></div></main></div>'),dhe=S('<div class="login-error svelte-1n46o8q"> </div>'),uhe=S('<div class="login-overlay svelte-1n46o8q"><form class="login-box svelte-1n46o8q"><div class="login-brand svelte-1n46o8q">she</div> <h2 class="svelte-1n46o8q">Sign in</h2> <div class="login-field svelte-1n46o8q"><label for="she-password" class="svelte-1n46o8q">Password</label> <input id="she-password" type="password" placeholder="Enter password" autocomplete="current-password" class="svelte-1n46o8q"/></div> <!> <button type="submit" class="login-btn svelte-1n46o8q"> </button></form></div>'),hhe=S('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> Restarting smart-home-engine…</div></div>'),fhe=S('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> Updating smart-home-engine…</div></div>'),phe=S("<!> <!> <!> <!>",1);function ghe(r,e){_s(e,!0);const t=["scripts","mqtt","matter","broker","adapters","secrets","db","logs","config","packages"],i={services:"adapters",security:"broker"};function n(){const et=location.hash.replace(/^#\/?/,""),[At,...bt]=et.split("/"),qt=i[At]??At;if(!t.includes(qt))return{page:"scripts",sub:null};const Le=bt.map(Se=>{try{return decodeURIComponent(Se)}catch{return Se}}).join("/");return{page:qt,sub:Le||null}}let s=A(yi(n().page)),a=A(yi(n().sub)),l=A(null),d=A(!1),u=A(!1),g=A(!1),x=A(!1),m=A("none"),b=A(""),_=A(!1),E=A(""),k=A(""),I=A(!1),M=A(!1);rG(()=>{p(_,!0)});async function N(){p(k,""),p(I,!0);try{await cG(o(E)),p(E,""),p(_,!1)}catch(et){p(k,et.message??"Login failed",!0)}finally{p(I,!1)}}async function O(){if(o(m)==="proxy"&&o(b)){window.location.href=o(b);return}await dG(),p(_,!0)}let z=A(null),G=A(!1),U=A(!1),ne=A(!1),Ee=A(!1),pe=A(yi([])),he=A(0),qe=A(!1),it=A(!1),ue=A("none"),Ue=A(""),me=A(yi([]));const Qe=st(()=>o(me).filter(et=>et.online).length),be=st(()=>o(me).length===0?"none":o(Qe)===o(me).length?"all":o(Qe)>0?"some":"offline");let Pt=A(!1),Ne=A(!1);async function Fe(){if(!await o(z).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))return;p(G,!0);let et;try{et=(await Kc()).startedAt}catch{}try{await CB()}catch{}const At=Date.now()+6e4;for(;Date.now()<At;){await new Promise(bt=>setTimeout(bt,250));try{const bt=await Kc();if(et===void 0||bt.startedAt!==et){location.reload();return}}catch{}}location.reload()}async function Pe(){p(g,!0);try{const et=await mG();o(l)&&p(l,{...o(l),latestVersion:et.latestVersion??void 0},!0)}catch{}finally{p(g,!1)}}async function It(){var bt,qt;if(!await o(z).show(`Update to v${(bt=o(l))==null?void 0:bt.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;p(u,!1),p(x,!0);const et=(qt=o(l))==null?void 0:qt.startedAt;try{await xG()}catch{}const At=Date.now()+18e4;for(;Date.now()<At;){await new Promise(Le=>setTimeout(Le,1e3));try{const Le=await Kc();if(et===void 0||Le.startedAt!==et){location.reload();return}}catch{p(x,!1),p(G,!0)}}location.reload()}let xe=A(void 0),ke=A(0);function Te(){if(!o(xe))return;const et=getComputedStyle(o(xe)),At=parseFloat(et.columnGap)||0,bt=[...o(xe).children];let qt=parseFloat(et.paddingLeft)+parseFloat(et.paddingRight)+At*Math.max(0,bt.length-1);for(const Se of bt)Se.classList.contains("nav-spacer")||(qt+=Se.getBoundingClientRect().width);const Le=Math.ceil(qt)+8;Le>0&&Le!==o(ke)&&p(ke,Le)}let Je=null;function Ge(){if(!(!o(xe)||!Je)){Je.disconnect(),Je.observe(o(xe));for(const et of o(xe).children)Je.observe(et);Te()}}Ws(()=>(Je=new ResizeObserver(()=>Te()),Ge(),()=>{Je==null||Je.disconnect(),Je=null})),ln(()=>{var et,At,bt,qt;o(qe),o(it),(et=o(l))==null||et.matterEnabled,(At=o(l))==null||At.dbEnabled,(bt=o(l))==null||bt.latestVersion,(qt=o(l))==null||qt.docker,xa().then(()=>Lo(Ge))});function vt(et){p(s,et,!0),p(a,null),location.hash=ii(et,null)}function ii(et,At){const bt=At?At.split("/").map(encodeURIComponent).join("/"):"";return`#/${et}${bt?"/"+bt:""}`}function Vt(et,At){const bt=At||null;o(s)!==et||o(a)===bt||(p(a,bt,!0),history.replaceState(null,"",ii(et,bt)))}Ws(async()=>{const et=ii(o(s),o(a));location.hash!==et&&history.replaceState(null,"",et);const At=()=>{const _e=n();p(s,_e.page,!0),p(a,_e.sub,!0)};window.addEventListener("hashchange",At);const bt=()=>{document.visibilityState==="visible"&&(xZ(),Kc().then(_e=>{p(l,_e,!0)}).catch(()=>{}),requestAnimationFrame(()=>{document.body.style.display="none",document.body.offsetHeight,document.body.style.display="",window.dispatchEvent(new Event("she:visible"))}))};document.addEventListener("visibilitychange",bt);try{const _e=await lG();p(m,_e.mode,!0),p(b,_e.proxyLogoutUrl??"",!0),o(m)==="password"&&(await fetch("/she/scripts")).status===401&&p(_,!0)}catch{}p(M,!0);async function qt(){var _e,De,nt,V;try{p(l,await Kc(),!0)}catch{}try{const[Ze,_t]=await Promise.all([EB(),wc()]);p(pe,Array.isArray(_t.pinnedPackages)?_t.pinnedPackages:[],!0),p(he,Object.keys(Ze).filter(ft=>!o(pe).includes(ft)).length,!0);const ge=o(qe);p(qe,((_e=_t.broker)==null?void 0:_e.enabled)===!0),ge&&!o(qe)&&o(s)==="broker"&&vt("scripts");const Ke=o(it);p(it,((De=_t.services)==null?void 0:De.enabled)===!0),Ke&&!o(it)&&o(s)==="adapters"&&vt("scripts")}catch{}!((nt=o(l))!=null&&nt.matterEnabled)&&o(s)==="matter"&&vt("scripts"),!((V=o(l))!=null&&V.dbEnabled)&&o(s)==="db"&&vt("scripts")}qt();const Le=setInterval(qt,5e3),Se=qo("mqtt:status",_e=>{_e.connected===!1?(p(Ee,!0),p(U,!1),p(ne,!1)):(p(Ee,!1),p(U,_e.ready===!1),p(ne,_e.ready===!0))}),tt=qo("matter:deviceList",_e=>{Array.isArray(_e.devices)&&p(me,_e.devices.map(De=>({nodeId:String(De.nodeId),online:!!De.online})),!0)}),w=qo("matter:deviceStatus",_e=>{if(_e.nodeId===void 0)return;const De=String(_e.nodeId),nt=!!_e.online;p(me,o(me).map(V=>V.nodeId===De?{...V,online:nt}:V),!0)}),j=PB();p(Pt,j.some(_e=>_e.level==="error"),!0),p(Ne,!o(Pt)&&j.some(_e=>_e.level==="warn"),!0);const ie=f2(_e=>{_e.level==="error"?(p(Pt,!0),p(Ne,!1)):_e.level==="warn"&&!o(Pt)&&p(Ne,!0)});return()=>{window.removeEventListener("hashchange",At),document.removeEventListener("visibilitychange",bt),clearInterval(Le),Se(),tt(),w(),ie()}});var He=phe();Fs("click",a3,()=>{o(d)&&p(d,!1),o(u)&&p(u,!1)});var at=yt(He);{var Wt=et=>{var At=che(),bt=f(At);{var qt=Re=>{var ut=Mue(),ei=h(f(ut),2);H("click",ei,Fe),y(Re,ut)};P(bt,Re=>{var ut;(ut=o(l))!=null&&ut.safeMode&&Re(qt)})}var Le=h(bt,2),Se=h(f(Le),2);let tt;var w=h(Se,2);let j;var ie=h(f(w),2);{var _e=Re=>{var ut=t6();T(()=>xi(ut,"title",`${o(he)??""} package update${o(he)===1?"":"s"} available`)),y(Re,ut)};P(ie,Re=>{o(he)>0&&Re(_e)})}var De=h(w,2);let nt;var V=h(f(De),2);{var Ze=Re=>{var ut=Rue();y(Re,ut)},_t=Re=>{var ut=Nue();y(Re,ut)},ge=Re=>{var ut=Oue();y(Re,ut)};P(V,Re=>{o(Ee)?Re(Ze):o(U)?Re(_t,1):o(ne)&&Re(ge,2)})}var Ke=h(De,2);{var ft=Re=>{var ut=Hue();let ei;T(()=>ei=zt(ut,1,"svelte-1n46o8q",null,ei,{active:o(s)==="broker"})),H("click",ut,()=>vt("broker")),y(Re,ut)};P(Ke,Re=>{o(qe)&&Re(ft)})}var St=h(Ke,2);{var jt=Re=>{var ut=Wue();let ei;var Ui=h(f(ut),2);{var ji=Gt=>{var ui=t6();T(()=>xi(ui,"title",o(Ue))),y(Gt,ui)},Hi=Gt=>{var ui=zue();y(Gt,ui)};P(Ui,Gt=>{o(ue)==="warn"?Gt(ji):Gt(Hi,-1)})}T(()=>ei=zt(ut,1,"svelte-1n46o8q",null,ei,{active:o(s)==="adapters"})),H("click",ut,()=>vt("adapters")),y(Re,ut)};P(St,Re=>{o(it)&&Re(jt)})}var Be=h(St,2);{var gt=Re=>{var ut=que();let ei;var Ui=h(f(ut),2);{var ji=ui=>{var wi=jue();y(ui,wi)},Hi=ui=>{var wi=Vue();y(ui,wi)},Gt=ui=>{var wi=$ue();y(ui,wi)};P(Ui,ui=>{o(be)==="all"?ui(ji):o(be)==="some"?ui(Hi,1):o(be)==="offline"&&ui(Gt,2)})}T(()=>ei=zt(ut,1,"svelte-1n46o8q",null,ei,{active:o(s)==="matter"})),H("click",ut,()=>vt("matter")),y(Re,ut)};P(Be,Re=>{var ut;(ut=o(l))!=null&&ut.matterEnabled&&Re(gt)})}var $=h(Be,2);{var we=Re=>{var ut=Uue();let ei;T(()=>ei=zt(ut,1,"svelte-1n46o8q",null,ei,{active:o(s)==="db"})),H("click",ut,()=>vt("db")),y(Re,ut)};P($,Re=>{var ut;(ut=o(l))!=null&&ut.dbEnabled&&Re(we)})}var ze=h($,2);let xt;var mt=h(ze,2);let Ot;var oe=h(f(mt),2);{var Q=Re=>{var ut=Gue();y(Re,ut)},K=Re=>{var ut=Kue();y(Re,ut)};P(oe,Re=>{o(Pt)?Re(Q):o(Ne)&&Re(K,1)})}var le=h(mt,4),ct=h(f(le),2),Ye=f(ct),Bt=f(Ye);Bt.nodeValue="v1.53.3 ";var wt=h(Bt);{var We=Re=>{var ut=Zue();y(Re,ut)};P(wt,Re=>{var ut,ei;(ut=o(l))!=null&&ut.latestVersion&&!((ei=o(l))!=null&&ei.docker)&&Re(We)})}var Zt=h(Ye,2);{var Qt=Re=>{var ut=Jue(),ei=f(ut),Ui=h(f(ei));Ui.textContent="v1.53.3";var ji=h(Ui,2);{var Hi=pn=>{var $i=Yue(),qn=h(yt($i)),ss=f(qn);T(()=>B(ss,`v${o(l).latestVersion??""}`)),y(pn,$i)},Gt=pn=>{var $i=Xue();y(pn,$i)};P(ji,pn=>{var $i;($i=o(l))!=null&&$i.latestVersion?pn(Hi):pn(Gt,-1)})}var ui=h(ei,2),wi=f(ui);{var Qi=pn=>{var $i=Que(),qn=h(f($i));T(()=>B(qn,` Update to v${o(l).latestVersion??""}`)),H("click",$i,It),y(pn,$i)};P(wi,pn=>{var $i;($i=o(l))!=null&&$i.latestVersion&&pn(Qi)})}var Oi=h(wi,2),Cn=f(Oi);let vn;var Pn=h(Cn);T(()=>{Oi.disabled=o(g),vn=zt(Cn,0,"svelte-1n46o8q",null,vn,{spinning:o(g)}),B(Pn,` ${o(g)?"Checking…":"Check for updates"}`)}),H("click",ut,pn=>pn.stopPropagation()),H("click",Oi,Pe),y(Re,ut)};P(Zt,Re=>{var ut;o(u)&&!((ut=o(l))!=null&&ut.docker)&&Re(Qt)})}var bi=h(ct,2),Bi=f(bi),J=h(Bi,2);{var $e=Re=>{var ut=rhe(),ei=f(ut);{var Ui=wi=>{var Qi=nhe(),Oi=f(Qi);{var Cn=Kt=>{const gi=st(()=>Math.floor((Date.now()-o(l).startedAt)/1e3)),mi=st(()=>Math.floor(o(gi)/86400)),qi=st(()=>Math.floor(o(gi)%86400/3600)),sn=st(()=>Math.floor(o(gi)%3600/60));var dn=ehe(),xn=h(yt(dn)),wn=f(xn);T(()=>B(wn,`${o(mi)>0?o(mi)+"d ":""}${o(qi)>0||o(mi)>0?o(qi)+"h ":""}${o(sn)??""}m`)),y(Kt,dn)};P(Oi,Kt=>{o(l).startedAt&&Kt(Cn)})}var vn=h(Oi,3),Pn=f(vn),pn=h(vn,3),$i=f(pn),qn=h(pn,3),ss=f(qn),gs=h(qn,2);{var Zs=Kt=>{var gi=the(),mi=h(yt(gi)),qi=f(mi),sn=h(mi,3),dn=f(sn);T(()=>{B(qi,o(l).matterNodes??0),B(dn,o(l).matterEndpoints??0)}),y(Kt,gi)};P(gs,Kt=>{o(l).matterEnabled&&Kt(Zs)})}var os=h(gs,2);{var no=Kt=>{var gi=ihe(),mi=h(yt(gi)),qi=f(mi),sn=h(mi,3),dn=f(sn);T(()=>{B(qi,o(l).dbDocs??"—"),B(dn,o(l).dbViews??"—")}),y(Kt,gi)};P(os,Kt=>{o(l).dbEnabled&&Kt(no)})}var Ie=h(os,3),pt=f(Ie),ot=h(Ie,3),si=f(ot),pi=h(ot,3),Ii=f(pi),Ri=h(pi,3),Rt=f(Ri),Di=h(Ri,3),hi=f(Di),Si=h(Di,3),Fi=f(Si);T(()=>{B(Pn,o(l).scripts),B($i,o(l).topics),B(ss,o(l).mqttMsgPerSec??"—"),B(pt,o(l).handlers??"—"),B(si,o(l).memMb!=null?o(l).memMb+" MB":"—"),B(Ii,o(l).cpuPercent!=null?o(l).cpuPercent+" %":"—"),B(Rt,o(l).eluPercent!=null?o(l).eluPercent+" %":"—"),B(hi,o(l).elMeanMs!=null?o(l).elMeanMs+" ms":"—"),B(Fi,o(l).elMaxMs!=null?o(l).elMaxMs+" ms":"—")}),y(wi,Qi)},ji=wi=>{var Qi=she();y(wi,Qi)};P(ei,wi=>{o(l)?wi(Ui):wi(ji,-1)})}var Hi=h(ei,2),Gt=f(Hi);{var ui=wi=>{var Qi=ohe();H("click",Qi,()=>{p(d,!1),Fe()}),y(wi,Qi)};P(Gt,wi=>{var Qi;(Qi=o(l))!=null&&Qi.docker||wi(ui)})}H("click",ut,wi=>wi.stopPropagation()),y(Re,ut)};P(J,Re=>{o(d)&&Re($e)})}var Dt=h(bi,2);let Nt;var X=h(Dt,2);{var ae=Re=>{var ut=ahe();H("click",ut,O),y(Re,ut)};P(X,Re=>{o(m)==="password"&&Re(ae)})}ds(Le,Re=>p(xe,Re),()=>o(xe));var te=h(Le,2),ve=f(te);ds(Fr(ve,{}),Re=>p(z,Re,!0),()=>o(z));var Ve=h(ve,2);let Ae;var Et=f(Ve);{let Re=st(()=>o(s)==="scripts"),ut=st(()=>o(s)==="scripts"?o(a):null);rJ(Et,{get active(){return o(Re)},get sub(){return o(ut)},onsub:ei=>Vt("scripts",ei)})}var ce=h(Ve,2);let re;var W=f(ce);Nne(W,{});var Y=h(ce,2);let Ce;var je=f(Y);{let Re=st(()=>o(s)==="mqtt"),ut=st(()=>o(s)==="mqtt"?o(a):null);mne(je,{get active(){return o(Re)},get sub(){return o(ut)},onsub:ei=>Vt("mqtt",ei)})}var ye=h(Y,2);let rt;var dt=f(ye);{let Re=st(()=>o(s)==="matter"),ut=st(()=>o(s)==="matter"?o(a):null);uie(dt,{get active(){return o(Re)},get sub(){return o(ut)},onsub:ei=>Vt("matter",ei)})}var Tt=h(ye,2);let kt;var Lt=f(Tt);{let Re=st(()=>o(s)==="broker"),ut=st(()=>o(s)==="broker"?o(a):null);gre(Lt,{get active(){return o(Re)},get sub(){return o(ut)},onsub:ei=>Vt("broker",ei)})}var Mt=h(Tt,2);{var Ht=Re=>{var ut=lhe();let ei;var Ui=f(ut);{let ji=st(()=>o(s)==="adapters"),Hi=st(()=>o(s)==="adapters"?o(a):null);hue(Ui,{onstatus:(Gt,ui)=>{p(ue,Gt,!0),p(Ue,ui,!0)},get active(){return o(ji)},get sub(){return o(Hi)},onsub:Gt=>Vt("adapters",Gt)})}T(()=>ei=zt(ut,1,"page-wrap svelte-1n46o8q",null,ei,{hidden:o(s)!=="adapters"})),y(Re,ut)};P(Mt,Re=>{o(it)&&Re(Ht)})}var Xt=h(Mt,2);let Li;var Gi=f(Xt);{let Re=st(()=>o(s)==="secrets"),ut=st(()=>o(s)==="secrets"?o(a):null);Tue(Gi,{get active(){return o(Re)},get sub(){return o(ut)},onsub:ei=>Vt("secrets",ei)})}var fi=h(Xt,2);let Ni;var Ki=f(fi);{let Re=st(()=>o(s)==="db"),ut=st(()=>o(s)==="db"?o(a):null);hte(Ki,{get active(){return o(Re)},get sub(){return o(ut)},onsub:ei=>Vt("db",ei)})}var Me=h(fi,2);let li;var Ei=f(Me);eee(Ei,{});var Ti=h(Me,2);let Ci;var Jt=f(Ti);ree(Jt,{}),T(()=>{Po(At,o(ke)?`min-width: ${o(ke)}px`:void 0),tt=zt(Se,1,"svelte-1n46o8q",null,tt,{active:o(s)==="scripts"}),j=zt(w,1,"svelte-1n46o8q",null,j,{active:o(s)==="packages"}),nt=zt(De,1,"svelte-1n46o8q",null,nt,{active:o(s)==="mqtt"}),xt=zt(ze,1,"svelte-1n46o8q",null,xt,{active:o(s)==="secrets"}),Ot=zt(mt,1,"svelte-1n46o8q",null,Ot,{active:o(s)==="logs"}),Nt=zt(Dt,1,"nav-settings svelte-1n46o8q",null,Nt,{active:o(s)==="config"}),Ae=zt(Ve,1,"page-wrap svelte-1n46o8q",null,Ae,{hidden:o(s)!=="scripts"}),re=zt(ce,1,"page-wrap svelte-1n46o8q",null,re,{hidden:o(s)!=="packages"}),Ce=zt(Y,1,"page-wrap svelte-1n46o8q",null,Ce,{hidden:o(s)!=="mqtt"}),rt=zt(ye,1,"page-wrap svelte-1n46o8q",null,rt,{hidden:o(s)!=="matter"}),kt=zt(Tt,1,"page-wrap svelte-1n46o8q",null,kt,{hidden:o(s)!=="broker"}),Li=zt(Xt,1,"page-wrap svelte-1n46o8q",null,Li,{hidden:o(s)!=="secrets"}),Ni=zt(fi,1,"page-wrap svelte-1n46o8q",null,Ni,{hidden:o(s)!=="db"}),li=zt(Me,1,"page-wrap svelte-1n46o8q",null,li,{hidden:o(s)!=="config"}),Ci=zt(Ti,1,"page-wrap svelte-1n46o8q",null,Ci,{hidden:o(s)!=="logs"})}),H("click",Se,()=>vt("scripts")),H("click",w,()=>vt("packages")),H("click",De,()=>vt("mqtt")),H("click",ze,()=>vt("secrets")),H("click",mt,()=>{vt("logs"),p(Pt,!1),p(Ne,!1)}),H("click",Ye,Re=>{Re.stopPropagation(),p(u,!o(u)),p(d,!1)}),H("click",Bi,Re=>{Re.stopPropagation(),p(d,!o(d)),p(u,!1)}),H("click",Dt,()=>vt("config")),y(et,At)};P(at,et=>{o(M)&&!o(_)&&et(Wt)})}var Ft=h(at,2);{var oi=et=>{var At=uhe(),bt=f(At),qt=h(f(bt),4),Le=h(f(qt),2),Se=h(qt,2);{var tt=ie=>{var _e=dhe(),De=f(_e);T(()=>B(De,o(k))),y(ie,_e)};P(Se,ie=>{o(k)&&ie(tt)})}var w=h(Se,2),j=f(w);T(()=>{Le.disabled=o(I),w.disabled=o(I)||!o(E),B(j,o(I)?"Signing in…":"Sign in")}),Fs("submit",bt,ie=>{ie.preventDefault(),N()}),di(Le,()=>o(E),ie=>p(E,ie)),y(et,At)};P(Ft,et=>{o(_)&&et(oi)})}var Z=h(Ft,2);{var se=et=>{var At=hhe();y(et,At)};P(Z,et=>{o(G)&&et(se)})}var de=h(Z,2);{var lt=et=>{var At=fhe();y(et,At)};P(de,et=>{o(x)&&et(lt)})}y(r,He),bs()}Ss(["click"]);wM(ghe,{target:document.getElementById("app")});export{W3 as t};
@@ -1,4 +1,4 @@
1
- import{m as O}from"./monaco-langs-DKJI_o9J.js";import{t as I}from"./index-lCqN_GjH.js";/*!-----------------------------------------------------------------------------
1
+ import{m as O}from"./monaco-langs-DKJI_o9J.js";import{t as I}from"./index-D2gZU7ce.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -175,7 +175,7 @@
175
175
  }
176
176
  })();
177
177
  </script>
178
- <script type="module" crossorigin src="/assets/index-lCqN_GjH.js"></script>
178
+ <script type="module" crossorigin src="/assets/index-D2gZU7ce.js"></script>
179
179
  <link rel="modulepreload" crossorigin href="/assets/monaco-langs-DKJI_o9J.js">
180
180
  <link rel="stylesheet" crossorigin href="/assets/monaco-langs-DyX1CsEw.css">
181
181
  <link rel="stylesheet" crossorigin href="/assets/index-BsO7OQRT.css">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smart-home-engine",
3
- "version": "1.53.2",
3
+ "version": "1.53.3",
4
4
  "description": "Node.js based script runner for use in MQTT based Smart Home environments",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -361,7 +361,18 @@ async function commission(options) {
361
361
  }
362
362
 
363
363
  async function _commissionInner(options) {
364
- const { discoveryAddress, ...commissionOpts } = options;
364
+ const { discoveryAddress, ...rest } = options;
365
+ // matter.js (0.17.0 … 0.17.9) passes an absent regulatory location and country through
366
+ // CommissioningClient as `undefined`, which overrides the commissioner's own default "XX":
367
+ // every Thread or Wi-Fi device then fails at SetRegulatoryConfig ("Missing mandatory field
368
+ // countryCode"). "XX" (unknown country) is always valid; IndoorOutdoor is used only when the
369
+ // device reports that capability, otherwise the device keeps its own location.
370
+ const { GeneralCommissioning } = require('@matter/main/clusters');
371
+ const commissionOpts = {
372
+ regulatoryLocation: GeneralCommissioning.RegulatoryLocationType.IndoorOutdoor,
373
+ regulatoryCountryCode: 'XX',
374
+ ...rest,
375
+ };
365
376
  let clientNode;
366
377
  if (discoveryAddress) {
367
378
  const colonIdx = discoveryAddress.lastIndexOf(':');