@ganglion/xacpx-relay 0.2.2 → 0.2.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 +1 @@
1
- import{d as p,u as m,c as r,a as e,b as g,w as v,v as x,e as n,f as i,t as l,g as y,h,r as c,i as _,o as d}from"./index-DE2bTqBl.js";import{_ as w}from"./BrandLogo.vue_vue_type_script_setup_true_lang-CSPZDDtK.js";const k={class:"flex h-screen items-center justify-center bg-bg"},V={class:"mb-2 flex justify-center"},S=["disabled"],N={key:0,class:"text-sm text-danger"},A=["disabled"],M=p({__name:"LoginView",setup(B){const o=m(),u=_(),a=c(""),t=c(!1);async function f(){if(!t.value){t.value=!0;try{await o.login(a.value)&&u.replace("/")}finally{t.value=!1}}}return(j,s)=>(d(),r("div",k,[e("form",{class:"w-80 space-y-3 rounded-lg border border-border bg-surface p-6 shadow-xl",onSubmit:h(f,["prevent"])},[e("div",V,[g(w)]),s[1]||(s[1]=e("label",{for:"access-token",class:"sr-only"},"Access token",-1)),v(e("input",{id:"access-token","onUpdate:modelValue":s[0]||(s[0]=b=>a.value=b),type:"password",autocomplete:"off","aria-describedby":"token-hint",class:"w-full rounded border border-border bg-bg px-3 py-2 text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50",placeholder:"Access token",disabled:t.value},null,8,S),[[x,a.value]]),s[2]||(s[2]=e("p",{id:"token-hint",class:"text-sm text-fg-muted"},[n("Paste the access token from "),e("code",null,"xacpx-relay user new"),n(".")],-1)),i(o).error?(d(),r("p",N,l(i(o).error),1)):y("",!0),e("button",{class:"w-full rounded bg-accent px-3 py-2 text-white hover:bg-accent-hover disabled:opacity-50",type:"submit",disabled:t.value},l(t.value?"Signing in…":"Sign in"),9,A)],32)]))}});export{M as default};
1
+ import{d as p,u as m,c as r,a as e,b as g,w as v,v as x,e as n,f as i,t as l,g as y,h,r as c,i as _,o as d}from"./index-BHLOc9dP.js";import{_ as w}from"./BrandLogo.vue_vue_type_script_setup_true_lang-BxgiIE4H.js";const k={class:"flex h-screen items-center justify-center bg-bg"},V={class:"mb-2 flex justify-center"},S=["disabled"],N={key:0,class:"text-sm text-danger"},A=["disabled"],M=p({__name:"LoginView",setup(B){const o=m(),u=_(),a=c(""),t=c(!1);async function f(){if(!t.value){t.value=!0;try{await o.login(a.value)&&u.replace("/")}finally{t.value=!1}}}return(j,s)=>(d(),r("div",k,[e("form",{class:"w-80 space-y-3 rounded-lg border border-border bg-surface p-6 shadow-xl",onSubmit:h(f,["prevent"])},[e("div",V,[g(w)]),s[1]||(s[1]=e("label",{for:"access-token",class:"sr-only"},"Access token",-1)),v(e("input",{id:"access-token","onUpdate:modelValue":s[0]||(s[0]=b=>a.value=b),type:"password",autocomplete:"off","aria-describedby":"token-hint",class:"w-full rounded border border-border bg-bg px-3 py-2 text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50",placeholder:"Access token",disabled:t.value},null,8,S),[[x,a.value]]),s[2]||(s[2]=e("p",{id:"token-hint",class:"text-sm text-fg-muted"},[n("Paste the access token from "),e("code",null,"xacpx-relay user new"),n(".")],-1)),i(o).error?(d(),r("p",N,l(i(o).error),1)):y("",!0),e("button",{class:"w-full rounded bg-accent px-3 py-2 text-white hover:bg-accent-hover disabled:opacity-50",type:"submit",disabled:t.value},l(t.value?"Signing in…":"Sign in"),9,A)],32)]))}});export{M as default};
@@ -1,6 +1,6 @@
1
- import{j as S,d as _,u as V,n as N,l as p,c as x,a as e,b,J as L,f as o,q as f,w as A,v as B,t as u,g as M,e as n,r as g,C as j,N as D,i as H,o as v}from"./index-DE2bTqBl.js";import{u as R}from"./theme-CaepIjgl.js";/**
1
+ import{j as S,d as _,u as V,n as N,l as p,c as x,a as e,b,K as L,f as o,q as f,w as A,v as B,t as u,g as D,e as n,r as g,D as M,N as j,i as H,o as v}from"./index-BHLOc9dP.js";import{u as R}from"./theme-Bb1qY_pR.js";/**
2
2
  * @license lucide-vue-next v1.0.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const T=S("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]),z={class:"mx-auto max-w-2xl p-6"},P={class:"mb-6 flex items-center justify-between"},$={"data-test":"theme-setting",class:"mb-8"},q={class:"inline-flex gap-1 rounded-lg border border-border bg-bg p-1"},E={class:"mb-8"},G={class:"flex gap-2"},I={key:0,class:"mt-2 rounded bg-bg border border-border p-2 text-xs text-fg"},J={class:"block break-all"},K={class:"mb-8"},O={class:"text-sm text-fg-muted"},U={class:"text-fg"},Y={class:"text-fg"},X=_({__name:"SettingsView",setup(F){const h=V(),a=R(),k=H(),r=g(null),i=g(""),d=g("");N(async()=>{try{const s=await p.get("/api/config");r.value=s.historyRetention}catch{}});async function y(){const s=await p.post("/api/instances/pairing-token",{name:d.value});i.value=s.token}async function w(){await j({title:"Sign out?",message:"You'll need to sign in again to access the dashboard.",confirmLabel:"Sign out",tone:"default"})&&(await h.logout(),k.push({name:"login"}))}return(s,t)=>{var m,c;const C=D("router-link");return v(),x("div",z,[e("header",P,[t[4]||(t[4]=e("h1",{class:"text-lg font-semibold text-fg"},"Settings",-1)),b(C,{to:"/",class:"text-sm text-fg-muted hover:underline"},{default:L(()=>[...t[3]||(t[3]=[n("← Back",-1)])]),_:1})]),e("section",$,[t[5]||(t[5]=e("h2",{class:"mb-2 text-sm font-semibold uppercase text-fg-muted"},"Appearance",-1)),e("div",q,[e("button",{"data-test":"theme-dark",class:f(["rounded-md px-3 py-1 text-sm",o(a).mode==="dark"?"bg-accent/10 text-accent":"text-fg-muted hover:bg-fg/5"]),onClick:t[0]||(t[0]=l=>o(a).set("dark"))},"Dark",2),e("button",{"data-test":"theme-light",class:f(["rounded-md px-3 py-1 text-sm",o(a).mode==="light"?"bg-accent/10 text-accent":"text-fg-muted hover:bg-fg/5"]),onClick:t[1]||(t[1]=l=>o(a).set("light"))},"Light",2)])]),e("section",E,[t[7]||(t[7]=e("h2",{class:"mb-2 text-sm font-semibold uppercase text-fg-muted"},"Add an instance",-1)),e("div",G,[A(e("input",{"onUpdate:modelValue":t[2]||(t[2]=l=>d.value=l),placeholder:"instance name (optional)",class:"flex-1 rounded border border-border bg-bg px-2 py-1 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},null,512),[[B,d.value]]),e("button",{"data-test":"gen-pairing",class:"rounded bg-accent px-3 py-1 text-sm text-white hover:bg-accent-hover",onClick:y},"Generate token")]),i.value?(v(),x("div",I,[t[6]||(t[6]=e("div",null,"Run on the xacpx host:",-1)),e("code",J,"xacpx channel add relay --url <this-relay-ws-url> --token "+u(i.value),1)])):M("",!0)]),e("section",K,[t[11]||(t[11]=e("h2",{class:"mb-2 text-sm font-semibold uppercase text-fg-muted"},"History retention",-1)),e("p",O,[t[8]||(t[8]=n(" Keeps the newest ",-1)),e("strong",U,u(((m=r.value)==null?void 0:m.maxPerSession)??"—"),1),t[9]||(t[9]=n(" messages per session, for up to ",-1)),e("strong",Y,u(((c=r.value)==null?void 0:c.days)??"—"),1),t[10]||(t[10]=n(" days. Configured server-side. ",-1))])]),e("section",null,[t[13]||(t[13]=e("h2",{class:"mb-2 text-sm font-semibold uppercase text-fg-muted"},"Account",-1)),e("button",{"data-test":"logout",class:"inline-flex items-center gap-2 rounded-lg border border-border px-3 py-1.5 text-sm text-fg-muted transition-colors hover:border-danger/40 hover:bg-danger/10 hover:text-danger",onClick:w},[b(o(T),{size:15}),t[12]||(t[12]=n("Sign out ",-1))])])])}}});export{X as default};
6
+ */const T=S("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]),z={class:"mx-auto max-w-2xl p-6"},K={class:"mb-6 flex items-center justify-between"},P={"data-test":"theme-setting",class:"mb-8"},$={class:"inline-flex gap-1 rounded-lg border border-border bg-bg p-1"},q={class:"mb-8"},E={class:"flex gap-2"},G={key:0,class:"mt-2 rounded bg-bg border border-border p-2 text-xs text-fg"},I={class:"block break-all"},O={class:"mb-8"},U={class:"text-sm text-fg-muted"},Y={class:"text-fg"},F={class:"text-fg"},X=_({__name:"SettingsView",setup(J){const h=V(),a=R(),k=H(),r=g(null),i=g(""),d=g("");N(async()=>{try{const s=await p.get("/api/config");r.value=s.historyRetention}catch{}});async function y(){const s=await p.post("/api/instances/pairing-token",{name:d.value});i.value=s.token}async function w(){await M({title:"Sign out?",message:"You'll need to sign in again to access the dashboard.",confirmLabel:"Sign out",tone:"default"})&&(await h.logout(),k.push({name:"login"}))}return(s,t)=>{var m,c;const C=j("router-link");return v(),x("div",z,[e("header",K,[t[4]||(t[4]=e("h1",{class:"text-lg font-semibold text-fg"},"Settings",-1)),b(C,{to:"/",class:"text-sm text-fg-muted hover:underline"},{default:L(()=>[...t[3]||(t[3]=[n("← Back",-1)])]),_:1})]),e("section",P,[t[5]||(t[5]=e("h2",{class:"mb-2 text-sm font-semibold uppercase text-fg-muted"},"Appearance",-1)),e("div",$,[e("button",{"data-test":"theme-dark",class:f(["rounded-md px-3 py-1 text-sm",o(a).mode==="dark"?"bg-accent/10 text-accent":"text-fg-muted hover:bg-fg/5"]),onClick:t[0]||(t[0]=l=>o(a).set("dark"))},"Dark",2),e("button",{"data-test":"theme-light",class:f(["rounded-md px-3 py-1 text-sm",o(a).mode==="light"?"bg-accent/10 text-accent":"text-fg-muted hover:bg-fg/5"]),onClick:t[1]||(t[1]=l=>o(a).set("light"))},"Light",2)])]),e("section",q,[t[7]||(t[7]=e("h2",{class:"mb-2 text-sm font-semibold uppercase text-fg-muted"},"Add an instance",-1)),e("div",E,[A(e("input",{"onUpdate:modelValue":t[2]||(t[2]=l=>d.value=l),placeholder:"instance name (optional)",class:"flex-1 rounded border border-border bg-bg px-2 py-1 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},null,512),[[B,d.value]]),e("button",{"data-test":"gen-pairing",class:"rounded bg-accent px-3 py-1 text-sm text-white hover:bg-accent-hover",onClick:y},"Generate token")]),i.value?(v(),x("div",G,[t[6]||(t[6]=e("div",null,"Run on the xacpx host:",-1)),e("code",I,"xacpx channel add relay --url <this-relay-ws-url> --token "+u(i.value),1)])):D("",!0)]),e("section",O,[t[11]||(t[11]=e("h2",{class:"mb-2 text-sm font-semibold uppercase text-fg-muted"},"History retention",-1)),e("p",U,[t[8]||(t[8]=n(" Keeps the newest ",-1)),e("strong",Y,u(((m=r.value)==null?void 0:m.maxPerSession)??"—"),1),t[9]||(t[9]=n(" messages per session, for up to ",-1)),e("strong",F,u(((c=r.value)==null?void 0:c.days)??"—"),1),t[10]||(t[10]=n(" days. Configured server-side. ",-1))])]),e("section",null,[t[13]||(t[13]=e("h2",{class:"mb-2 text-sm font-semibold uppercase text-fg-muted"},"Account",-1)),e("button",{"data-test":"logout",class:"inline-flex items-center gap-2 rounded-lg border border-border px-3 py-1.5 text-sm text-fg-muted transition-colors hover:border-danger/40 hover:bg-danger/10 hover:text-danger",onClick:w},[b(o(T),{size:15}),t[12]||(t[12]=n("Sign out ",-1))])])])}}});export{X as default};
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginView-CYhQnBi-.js","assets/BrandLogo.vue_vue_type_script_setup_true_lang-CSPZDDtK.js","assets/DashboardView-Bhx2FJSv.js","assets/theme-CaepIjgl.js","assets/DashboardView-AMivJ-D8.css","assets/SettingsView-hmSvIsKD.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginView-DK70PqWR.js","assets/BrandLogo.vue_vue_type_script_setup_true_lang-BxgiIE4H.js","assets/DashboardView-B7i6MIlg.js","assets/theme-Bb1qY_pR.js","assets/DashboardView-AMivJ-D8.css","assets/SettingsView-CmskD9oN.js"])))=>i.map(i=>d[i]);
2
2
  (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();/**
3
3
  * @vue/shared v3.5.35
4
4
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
@@ -77,4 +77,4 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginView-CYhQn
77
77
  * vue-router v4.6.4
78
78
  * (c) 2025 Eduardo San Martin Morote
79
79
  * @license MIT
80
- */let aa=()=>location.protocol+"//"+location.host;function vl(e,t){const{pathname:n,search:s,hash:r}=t,i=e.indexOf("#");if(i>-1){let o=r.includes(e.slice(i))?e.slice(i).length:1,l=r.slice(o);return l[0]!=="/"&&(l="/"+l),Ci(l,"")}return Ci(n,e)+s+r}function da(e,t,n,s){let r=[],i=[],o=null;const l=({state:p})=>{const m=vl(e,location),A=n.value,S=t.value;let M=0;if(p){if(n.value=m,t.value=p,o&&o===A){o=null;return}M=S?p.position-S.position:0}else s(m);r.forEach(F=>{F(n.value,A,{delta:M,type:lr.pop,direction:M?M>0?Hs.forward:Hs.back:Hs.unknown})})};function c(){o=n.value}function f(p){r.push(p);const m=()=>{const A=r.indexOf(p);A>-1&&r.splice(A,1)};return i.push(m),m}function u(){if(document.visibilityState==="hidden"){const{history:p}=window;if(!p.state)return;p.replaceState(te({},p.state,{scroll:Ss()}),"")}}function a(){for(const p of i)p();i=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:c,listen:f,destroy:a}}function Pi(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?Ss():null}}function ha(e){const{history:t,location:n}=window,s={value:vl(e,n)},r={value:t.state};r.value||i(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(c,f,u){const a=e.indexOf("#"),p=a>-1?(n.host&&document.querySelector("base")?e:e.slice(a))+c:aa()+e+c;try{t[u?"replaceState":"pushState"](f,"",p),r.value=f}catch(m){console.error(m),n[u?"replace":"assign"](p)}}function o(c,f){i(c,te({},t.state,Pi(r.value.back,c,r.value.forward,!0),f,{position:r.value.position}),!0),s.value=c}function l(c,f){const u=te({},r.value,t.state,{forward:c,scroll:Ss()});i(u.current,u,!0),i(c,te({},Pi(s.value,c,null),{position:u.position+1},f),!1),s.value=c}return{location:s,state:r,push:l,replace:o}}function pa(e){e=Yf(e);const t=ha(e),n=da(e,t.state,t.location,t.replace);function s(i,o=!0){o||n.pauseListeners(),history.go(i)}const r=te({location:"",base:e,go:s,createHref:Zf.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let Mt=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var ge=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(ge||{});const ga={type:Mt.Static,value:""},ma=/[a-zA-Z0-9_]/;function _a(e){if(!e)return[[]];if(e==="/")return[[ga]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(m){throw new Error(`ERR (${n})/"${f}": ${m}`)}let n=ge.Static,s=n;const r=[];let i;function o(){i&&r.push(i),i=[]}let l=0,c,f="",u="";function a(){f&&(n===ge.Static?i.push({type:Mt.Static,value:f}):n===ge.Param||n===ge.ParamRegExp||n===ge.ParamRegExpEnd?(i.length>1&&(c==="*"||c==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),i.push({type:Mt.Param,value:f,regexp:u,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):t("Invalid state to consume buffer"),f="")}function p(){f+=c}for(;l<e.length;){if(c=e[l++],c==="\\"&&n!==ge.ParamRegExp){s=n,n=ge.EscapeNext;continue}switch(n){case ge.Static:c==="/"?(f&&a(),o()):c===":"?(a(),n=ge.Param):p();break;case ge.EscapeNext:p(),n=s;break;case ge.Param:c==="("?n=ge.ParamRegExp:ma.test(c)?p():(a(),n=ge.Static,c!=="*"&&c!=="?"&&c!=="+"&&l--);break;case ge.ParamRegExp:c===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+c:n=ge.ParamRegExpEnd:u+=c;break;case ge.ParamRegExpEnd:a(),n=ge.Static,c!=="*"&&c!=="?"&&c!=="+"&&l--,u="";break;default:t("Unknown state");break}}return n===ge.ParamRegExp&&t(`Unfinished custom RegExp for param "${f}"`),a(),o(),r}const Ii="[^/]+?",ya={sensitive:!1,strict:!1,start:!0,end:!0};var Re=function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e}(Re||{});const va=/[.+*?^${}()[\]/\\]/g;function ba(e,t){const n=te({},ya,t),s=[];let r=n.start?"^":"";const i=[];for(const f of e){const u=f.length?[]:[Re.Root];n.strict&&!f.length&&(r+="/");for(let a=0;a<f.length;a++){const p=f[a];let m=Re.Segment+(n.sensitive?Re.BonusCaseSensitive:0);if(p.type===Mt.Static)a||(r+="/"),r+=p.value.replace(va,"\\$&"),m+=Re.Static;else if(p.type===Mt.Param){const{value:A,repeatable:S,optional:M,regexp:F}=p;i.push({name:A,repeatable:S,optional:M});const C=F||Ii;if(C!==Ii){m+=Re.BonusCustomRegExp;try{`${C}`}catch(I){throw new Error(`Invalid custom RegExp for param "${A}" (${C}): `+I.message)}}let L=S?`((?:${C})(?:/(?:${C}))*)`:`(${C})`;a||(L=M&&f.length<2?`(?:/${L})`:"/"+L),M&&(L+="?"),r+=L,m+=Re.Dynamic,M&&(m+=Re.BonusOptional),S&&(m+=Re.BonusRepeatable),C===".*"&&(m+=Re.BonusWildcard)}u.push(m)}s.push(u)}if(n.strict&&n.end){const f=s.length-1;s[f][s[f].length-1]+=Re.BonusStrict}n.strict||(r+="/?"),n.end?r+="$":n.strict&&!r.endsWith("/")&&(r+="(?:/|$)");const o=new RegExp(r,n.sensitive?"":"i");function l(f){const u=f.match(o),a={};if(!u)return null;for(let p=1;p<u.length;p++){const m=u[p]||"",A=i[p-1];a[A.name]=m&&A.repeatable?m.split("/"):m}return a}function c(f){let u="",a=!1;for(const p of e){(!a||!u.endsWith("/"))&&(u+="/"),a=!1;for(const m of p)if(m.type===Mt.Static)u+=m.value;else if(m.type===Mt.Param){const{value:A,repeatable:S,optional:M}=m,F=A in f?f[A]:"";if($e(F)&&!S)throw new Error(`Provided param "${A}" is an array but it is not repeatable (* or + modifiers)`);const C=$e(F)?F.join("/"):F;if(!C)if(M)p.length<2&&(u.endsWith("/")?u=u.slice(0,-1):a=!0);else throw new Error(`Missing required param "${A}"`);u+=C}}return u||"/"}return{re:o,score:s,keys:i,parse:l,stringify:c}}function Ea(e,t){let n=0;for(;n<e.length&&n<t.length;){const s=t[n]-e[n];if(s)return s;n++}return e.length<t.length?e.length===1&&e[0]===Re.Static+Re.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Re.Static+Re.Segment?1:-1:0}function bl(e,t){let n=0;const s=e.score,r=t.score;for(;n<s.length&&n<r.length;){const i=Ea(s[n],r[n]);if(i)return i;n++}if(Math.abs(r.length-s.length)===1){if(Ni(s))return 1;if(Ni(r))return-1}return r.length-s.length}function Ni(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Aa={strict:!1,end:!0,sensitive:!1};function Sa(e,t,n){const s=ba(_a(e.path),n),r=te(s,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function wa(e,t){const n=[],s=new Map;t=wi(Aa,t);function r(a){return s.get(a)}function i(a,p,m){const A=!m,S=Li(a);S.aliasOf=m&&m.record;const M=wi(t,a),F=[S];if("alias"in a){const I=typeof a.alias=="string"?[a.alias]:a.alias;for(const K of I)F.push(Li(te({},S,{components:m?m.record.components:S.components,path:K,aliasOf:m?m.record:S})))}let C,L;for(const I of F){const{path:K}=I;if(p&&K[0]!=="/"){const Z=p.record.path,V=Z[Z.length-1]==="/"?"":"/";I.path=p.record.path+(K&&V+K)}if(C=Sa(I,p,M),m?m.alias.push(C):(L=L||C,L!==C&&L.alias.push(C),A&&a.name&&!Di(C)&&o(a.name)),El(C)&&c(C),S.children){const Z=S.children;for(let V=0;V<Z.length;V++)i(Z[V],C,m&&m.children[V])}m=m||C}return L?()=>{o(L)}:vn}function o(a){if(ml(a)){const p=s.get(a);p&&(s.delete(a),n.splice(n.indexOf(p),1),p.children.forEach(o),p.alias.forEach(o))}else{const p=n.indexOf(a);p>-1&&(n.splice(p,1),a.record.name&&s.delete(a.record.name),a.children.forEach(o),a.alias.forEach(o))}}function l(){return n}function c(a){const p=Ra(a,n);n.splice(p,0,a),a.record.name&&!Di(a)&&s.set(a.record.name,a)}function f(a,p){let m,A={},S,M;if("name"in a&&a.name){if(m=s.get(a.name),!m)throw Yt(ae.MATCHER_NOT_FOUND,{location:a});M=m.record.name,A=te(Mi(p.params,m.keys.filter(L=>!L.optional).concat(m.parent?m.parent.keys.filter(L=>L.optional):[]).map(L=>L.name)),a.params&&Mi(a.params,m.keys.map(L=>L.name))),S=m.stringify(A)}else if(a.path!=null)S=a.path,m=n.find(L=>L.re.test(S)),m&&(A=m.parse(S),M=m.record.name);else{if(m=p.name?s.get(p.name):n.find(L=>L.re.test(p.path)),!m)throw Yt(ae.MATCHER_NOT_FOUND,{location:a,currentLocation:p});M=m.record.name,A=te({},p.params,a.params),S=m.stringify(A)}const F=[];let C=m;for(;C;)F.unshift(C.record),C=C.parent;return{name:M,path:S,params:A,matched:F,meta:xa(F)}}e.forEach(a=>i(a));function u(){n.length=0,s.clear()}return{addRoute:i,resolve:f,removeRoute:o,clearRoutes:u,getRoutes:l,getRecordMatcher:r}}function Mi(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function Li(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Ca(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Ca(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function Di(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function xa(e){return e.reduce((t,n)=>te(t,n.meta),{})}function Ra(e,t){let n=0,s=t.length;for(;n!==s;){const i=n+s>>1;bl(e,t[i])<0?s=i:n=i+1}const r=Ta(e);return r&&(s=t.lastIndexOf(r,s-1)),s}function Ta(e){let t=e;for(;t=t.parent;)if(El(t)&&bl(e,t)===0)return t}function El({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Fi(e){const t=Ke(ws),n=Ke(yl),s=Be(()=>{const c=pe(e.to);return t.resolve(c)}),r=Be(()=>{const{matched:c}=s.value,{length:f}=c,u=c[f-1],a=n.matched;if(!u||!a.length)return-1;const p=a.findIndex(Qt.bind(null,u));if(p>-1)return p;const m=Vi(c[f-2]);return f>1&&Vi(u)===m&&a[a.length-1].path!==m?a.findIndex(Qt.bind(null,c[f-2])):p}),i=Be(()=>r.value>-1&&Ma(n.params,s.value.params)),o=Be(()=>r.value>-1&&r.value===n.matched.length-1&&gl(n.params,s.value.params));function l(c={}){if(Na(c)){const f=t[pe(e.replace)?"replace":"push"](pe(e.to)).catch(vn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>f),f}return Promise.resolve()}return{route:s,href:Be(()=>s.value.href),isActive:i,isExactActive:o,navigate:l}}function Oa(e){return e.length===1?e[0]:e}const Pa=ms({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Fi,setup(e,{slots:t}){const n=Ln(Fi(e)),{options:s}=Ke(ws),r=Be(()=>({[ji(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[ji(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&Oa(t.default(n));return e.custom?i:zt("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),Ia=Pa;function Na(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Ma(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!$e(r)||r.length!==s.length||s.some((i,o)=>i.valueOf()!==r[o].valueOf()))return!1}return!0}function Vi(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const ji=(e,t,n)=>e??t??n,La=ms({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=Ke(ur),r=Be(()=>e.route||s.value),i=Ke(Oi,0),o=Be(()=>{let f=pe(i);const{matched:u}=r.value;let a;for(;(a=u[f])&&!a.components;)f++;return f}),l=Be(()=>r.value.matched[o.value]);Kn(Oi,Be(()=>o.value+1)),Kn(ua,l),Kn(ur,r);const c=Sn();return pn(()=>[c.value,l.value,e.name],([f,u,a],[p,m,A])=>{u&&(u.instances[a]=f,m&&m!==u&&f&&f===p&&(u.leaveGuards.size||(u.leaveGuards=m.leaveGuards),u.updateGuards.size||(u.updateGuards=m.updateGuards))),f&&u&&(!m||!Qt(u,m)||!p)&&(u.enterCallbacks[a]||[]).forEach(S=>S(f))},{flush:"post"}),()=>{const f=r.value,u=e.name,a=l.value,p=a&&a.components[u];if(!p)return Bi(n.default,{Component:p,route:f});const m=a.props[u],A=m?m===!0?f.params:typeof m=="function"?m(f):m:null,M=zt(p,te({},A,t,{onVnodeUnmounted:F=>{F.component.isUnmounted&&(a.instances[u]=null)},ref:c}));return Bi(n.default,{Component:M,route:f})||M}}});function Bi(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Da=La;function Fa(e){const t=wa(e.routes,e),n=e.parseQuery||la,s=e.stringifyQuery||Ti,r=e.history,i=on(),o=on(),l=on(),c=nc(_t);let f=_t;Ut&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=js.bind(null,v=>""+v),a=js.bind(null,Gf),p=js.bind(null,In);function m(v,D){let P,B;return ml(v)?(P=t.getRecordMatcher(v),B=D):B=v,t.addRoute(B,P)}function A(v){const D=t.getRecordMatcher(v);D&&t.removeRoute(D)}function S(){return t.getRoutes().map(v=>v.record)}function M(v){return!!t.getRecordMatcher(v)}function F(v,D){if(D=te({},D||c.value),typeof v=="string"){const g=Bs(n,v,D.path),y=t.resolve({path:g.path},D),b=r.createHref(g.fullPath);return te(g,y,{params:p(y.params),hash:In(g.hash),redirectedFrom:void 0,href:b})}let P;if(v.path!=null)P=te({},v,{path:Bs(n,v.path,D.path).path});else{const g=te({},v.params);for(const y in g)g[y]==null&&delete g[y];P=te({},v,{params:a(g)}),D.params=a(D.params)}const B=t.resolve(P,D),Q=v.hash||"";B.params=u(p(B.params));const d=qf(s,te({},v,{hash:kf(Q),path:B.path})),h=r.createHref(d);return te({fullPath:d,hash:Q,query:s===Ti?ca(v.query):v.query||{}},B,{redirectedFrom:void 0,href:h})}function C(v){return typeof v=="string"?Bs(n,v,c.value.path):te({},v)}function L(v,D){if(f!==v)return Yt(ae.NAVIGATION_CANCELLED,{from:D,to:v})}function I(v){return V(v)}function K(v){return I(te(C(v),{replace:!0}))}function Z(v,D){const P=v.matched[v.matched.length-1];if(P&&P.redirect){const{redirect:B}=P;let Q=typeof B=="function"?B(v,D):B;return typeof Q=="string"&&(Q=Q.includes("?")||Q.includes("#")?Q=C(Q):{path:Q},Q.params={}),te({query:v.query,hash:v.hash,params:Q.path!=null?{}:v.params},Q)}}function V(v,D){const P=f=F(v),B=c.value,Q=v.state,d=v.force,h=v.replace===!0,g=Z(P,B);if(g)return V(te(C(g),{state:typeof g=="object"?te({},Q,g.state):Q,force:d,replace:h}),D||P);const y=P;y.redirectedFrom=D;let b;return!d&&Jf(s,B,P)&&(b=Yt(ae.NAVIGATION_DUPLICATED,{to:y,from:B}),We(B,B,!0,!1)),(b?Promise.resolve(b):G(y,B)).catch(_=>it(_)?it(_,ae.NAVIGATION_GUARD_REDIRECT)?_:gt(_):ee(_,y,B)).then(_=>{if(_){if(it(_,ae.NAVIGATION_GUARD_REDIRECT))return V(te({replace:h},C(_.to),{state:typeof _.to=="object"?te({},Q,_.to.state):Q,force:d}),D||y)}else _=T(y,B,!0,h,Q);return J(y,B,_),_})}function j(v,D){const P=L(v,D);return P?Promise.reject(P):Promise.resolve()}function w(v){const D=jt.values().next().value;return D&&typeof D.runWithContext=="function"?D.runWithContext(v):v()}function G(v,D){let P;const[B,Q,d]=fa(v,D);P=ks(B.reverse(),"beforeRouteLeave",v,D);for(const g of B)g.leaveGuards.forEach(y=>{P.push(Et(y,v,D))});const h=j.bind(null,v,D);return P.push(h),Fe(P).then(()=>{P=[];for(const g of i.list())P.push(Et(g,v,D));return P.push(h),Fe(P)}).then(()=>{P=ks(Q,"beforeRouteUpdate",v,D);for(const g of Q)g.updateGuards.forEach(y=>{P.push(Et(y,v,D))});return P.push(h),Fe(P)}).then(()=>{P=[];for(const g of d)if(g.beforeEnter)if($e(g.beforeEnter))for(const y of g.beforeEnter)P.push(Et(y,v,D));else P.push(Et(g.beforeEnter,v,D));return P.push(h),Fe(P)}).then(()=>(v.matched.forEach(g=>g.enterCallbacks={}),P=ks(d,"beforeRouteEnter",v,D,w),P.push(h),Fe(P))).then(()=>{P=[];for(const g of o.list())P.push(Et(g,v,D));return P.push(h),Fe(P)}).catch(g=>it(g,ae.NAVIGATION_CANCELLED)?g:Promise.reject(g))}function J(v,D,P){l.list().forEach(B=>w(()=>B(v,D,P)))}function T(v,D,P,B,Q){const d=L(v,D);if(d)return d;const h=D===_t,g=Ut?history.state:{};P&&(B||h?r.replace(v.fullPath,te({scroll:h&&g&&g.scroll},Q)):r.push(v.fullPath,Q)),c.value=v,We(v,D,P,h),gt()}let z;function fe(){z||(z=r.listen((v,D,P)=>{if(!wt.listening)return;const B=F(v),Q=Z(B,wt.currentRoute.value);if(Q){V(te(Q,{replace:!0,force:!0}),B).catch(vn);return}f=B;const d=c.value;Ut&&na(Ri(d.fullPath,P.delta),Ss()),G(B,d).catch(h=>it(h,ae.NAVIGATION_ABORTED|ae.NAVIGATION_CANCELLED)?h:it(h,ae.NAVIGATION_GUARD_REDIRECT)?(V(te(C(h.to),{force:!0}),B).then(g=>{it(g,ae.NAVIGATION_ABORTED|ae.NAVIGATION_DUPLICATED)&&!P.delta&&P.type===lr.pop&&r.go(-1,!1)}).catch(vn),Promise.reject()):(P.delta&&r.go(-P.delta,!1),ee(h,B,d))).then(h=>{h=h||T(B,d,!1),h&&(P.delta&&!it(h,ae.NAVIGATION_CANCELLED)?r.go(-P.delta,!1):P.type===lr.pop&&it(h,ae.NAVIGATION_ABORTED|ae.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),J(B,d,h)}).catch(vn)}))}let we=on(),ie=on(),q;function ee(v,D,P){gt(v);const B=ie.list();return B.length?B.forEach(Q=>Q(v,D,P)):console.error(v),Promise.reject(v)}function nt(){return q&&c.value!==_t?Promise.resolve():new Promise((v,D)=>{we.add([v,D])})}function gt(v){return q||(q=!v,fe(),we.list().forEach(([D,P])=>v?P(v):D()),we.reset()),v}function We(v,D,P,B){const{scrollBehavior:Q}=e;if(!Ut||!Q)return Promise.resolve();const d=!P&&sa(Ri(v.fullPath,0))||(B||!P)&&history.state&&history.state.scroll||null;return gs().then(()=>Q(v,D,d)).then(h=>h&&ta(h)).catch(h=>ee(h,v,D))}const Pe=v=>r.go(v);let Vt;const jt=new Set,wt={currentRoute:c,listening:!0,addRoute:m,removeRoute:A,clearRoutes:t.clearRoutes,hasRoute:M,getRoutes:S,resolve:F,options:e,push:I,replace:K,go:Pe,back:()=>Pe(-1),forward:()=>Pe(1),beforeEach:i.add,beforeResolve:o.add,afterEach:l.add,onError:ie.add,isReady:nt,install(v){v.component("RouterLink",Ia),v.component("RouterView",Da),v.config.globalProperties.$router=wt,Object.defineProperty(v.config.globalProperties,"$route",{enumerable:!0,get:()=>pe(c)}),Ut&&!Vt&&c.value===_t&&(Vt=!0,I(r.location).catch(B=>{}));const D={};for(const B in _t)Object.defineProperty(D,B,{get:()=>c.value[B],enumerable:!0});v.provide(ws,wt),v.provide(yl,ao(D)),v.provide(ur,c);const P=v.unmount;jt.add(v),v.unmount=function(){jt.delete(v),jt.size<1&&(f=_t,z&&z(),z=null,c.value=_t,Vt=!1,q=!1),P()}}};function Fe(v){return v.reduce((D,P)=>D.then(()=>w(P)),Promise.resolve())}return wt}function Ya(){return Ke(ws)}class Al extends Error{constructor(t,n){super(t),this.code=t,this.status=n}}async function kn(e,t,n){const r=await fetch(t,{method:e,credentials:"include",headers:e==="GET"?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}),i=r.status===204?void 0:await r.json().catch(()=>{});if(!r.ok)throw new Al((i==null?void 0:i.error)??"request-failed",r.status);return i}const Us={get:e=>kn("GET",e),post:(e,t)=>kn("POST",e,t),del:e=>kn("DELETE",e),rpc:(e,t,n={})=>kn("POST",`/api/instances/${e}/rpc`,{type:t,payload:n}).then(s=>s.result)},Va=af("auth",()=>{const e=Sn(null),t=Sn("");async function n(i){t.value="";try{return e.value=await Us.post("/api/login",{token:i}),!0}catch(o){return t.value=o instanceof Al?o.code:"request-failed",e.value=null,!1}}async function s(){try{return e.value=await Us.get("/api/me"),!0}catch{return e.value=null,!1}}async function r(){await Us.post("/api/logout").catch(()=>{}),e.value=null}return{account:e,error:t,login:n,fetchMe:s,logout:r}}),ja=[{path:"/login",name:"login",component:()=>Vs(()=>import("./LoginView-CYhQnBi-.js"),__vite__mapDeps([0,1]))},{path:"/",name:"dashboard",component:()=>Vs(()=>import("./DashboardView-Bhx2FJSv.js"),__vite__mapDeps([2,1,3,4]))},{path:"/settings",name:"settings",component:()=>Vs(()=>import("./SettingsView-hmSvIsKD.js"),__vite__mapDeps([5,3]))}],Sl=Fa({history:pa(),routes:ja});Sl.beforeEach(async e=>{if(e.name==="login")return!0;const t=Va();return t.account||await t.fetchMe()?!0:{name:"login"}});tf(Tf).use(rf()).use(Sl).mount("#app");export{Al as A,dr as B,Qa as C,qa as D,Io as E,Ie as F,gs as G,Ua as H,Ha as I,gc as J,Sc as K,$a as L,Ga as M,Vc as N,Ka as O,yf as T,ke as a,ye as b,er as c,ms as d,hu as e,pe as f,tr as g,Ja as h,Ya as i,_f as j,af as k,Us as l,Be as m,Er as n,Ft as o,Ar as p,bn as q,Sn as r,ka as s,ln as t,Va as u,Wa as v,Ba as w,Zn as x,pn as y,za as z};
80
+ */let aa=()=>location.protocol+"//"+location.host;function vl(e,t){const{pathname:n,search:s,hash:r}=t,i=e.indexOf("#");if(i>-1){let o=r.includes(e.slice(i))?e.slice(i).length:1,l=r.slice(o);return l[0]!=="/"&&(l="/"+l),Ci(l,"")}return Ci(n,e)+s+r}function da(e,t,n,s){let r=[],i=[],o=null;const l=({state:p})=>{const m=vl(e,location),A=n.value,S=t.value;let M=0;if(p){if(n.value=m,t.value=p,o&&o===A){o=null;return}M=S?p.position-S.position:0}else s(m);r.forEach(F=>{F(n.value,A,{delta:M,type:lr.pop,direction:M?M>0?Hs.forward:Hs.back:Hs.unknown})})};function c(){o=n.value}function f(p){r.push(p);const m=()=>{const A=r.indexOf(p);A>-1&&r.splice(A,1)};return i.push(m),m}function u(){if(document.visibilityState==="hidden"){const{history:p}=window;if(!p.state)return;p.replaceState(te({},p.state,{scroll:Ss()}),"")}}function a(){for(const p of i)p();i=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:c,listen:f,destroy:a}}function Pi(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?Ss():null}}function ha(e){const{history:t,location:n}=window,s={value:vl(e,n)},r={value:t.state};r.value||i(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(c,f,u){const a=e.indexOf("#"),p=a>-1?(n.host&&document.querySelector("base")?e:e.slice(a))+c:aa()+e+c;try{t[u?"replaceState":"pushState"](f,"",p),r.value=f}catch(m){console.error(m),n[u?"replace":"assign"](p)}}function o(c,f){i(c,te({},t.state,Pi(r.value.back,c,r.value.forward,!0),f,{position:r.value.position}),!0),s.value=c}function l(c,f){const u=te({},r.value,t.state,{forward:c,scroll:Ss()});i(u.current,u,!0),i(c,te({},Pi(s.value,c,null),{position:u.position+1},f),!1),s.value=c}return{location:s,state:r,push:l,replace:o}}function pa(e){e=Yf(e);const t=ha(e),n=da(e,t.state,t.location,t.replace);function s(i,o=!0){o||n.pauseListeners(),history.go(i)}const r=te({location:"",base:e,go:s,createHref:Zf.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let Mt=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var ge=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(ge||{});const ga={type:Mt.Static,value:""},ma=/[a-zA-Z0-9_]/;function _a(e){if(!e)return[[]];if(e==="/")return[[ga]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(m){throw new Error(`ERR (${n})/"${f}": ${m}`)}let n=ge.Static,s=n;const r=[];let i;function o(){i&&r.push(i),i=[]}let l=0,c,f="",u="";function a(){f&&(n===ge.Static?i.push({type:Mt.Static,value:f}):n===ge.Param||n===ge.ParamRegExp||n===ge.ParamRegExpEnd?(i.length>1&&(c==="*"||c==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),i.push({type:Mt.Param,value:f,regexp:u,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):t("Invalid state to consume buffer"),f="")}function p(){f+=c}for(;l<e.length;){if(c=e[l++],c==="\\"&&n!==ge.ParamRegExp){s=n,n=ge.EscapeNext;continue}switch(n){case ge.Static:c==="/"?(f&&a(),o()):c===":"?(a(),n=ge.Param):p();break;case ge.EscapeNext:p(),n=s;break;case ge.Param:c==="("?n=ge.ParamRegExp:ma.test(c)?p():(a(),n=ge.Static,c!=="*"&&c!=="?"&&c!=="+"&&l--);break;case ge.ParamRegExp:c===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+c:n=ge.ParamRegExpEnd:u+=c;break;case ge.ParamRegExpEnd:a(),n=ge.Static,c!=="*"&&c!=="?"&&c!=="+"&&l--,u="";break;default:t("Unknown state");break}}return n===ge.ParamRegExp&&t(`Unfinished custom RegExp for param "${f}"`),a(),o(),r}const Ii="[^/]+?",ya={sensitive:!1,strict:!1,start:!0,end:!0};var Re=function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e}(Re||{});const va=/[.+*?^${}()[\]/\\]/g;function ba(e,t){const n=te({},ya,t),s=[];let r=n.start?"^":"";const i=[];for(const f of e){const u=f.length?[]:[Re.Root];n.strict&&!f.length&&(r+="/");for(let a=0;a<f.length;a++){const p=f[a];let m=Re.Segment+(n.sensitive?Re.BonusCaseSensitive:0);if(p.type===Mt.Static)a||(r+="/"),r+=p.value.replace(va,"\\$&"),m+=Re.Static;else if(p.type===Mt.Param){const{value:A,repeatable:S,optional:M,regexp:F}=p;i.push({name:A,repeatable:S,optional:M});const C=F||Ii;if(C!==Ii){m+=Re.BonusCustomRegExp;try{`${C}`}catch(I){throw new Error(`Invalid custom RegExp for param "${A}" (${C}): `+I.message)}}let L=S?`((?:${C})(?:/(?:${C}))*)`:`(${C})`;a||(L=M&&f.length<2?`(?:/${L})`:"/"+L),M&&(L+="?"),r+=L,m+=Re.Dynamic,M&&(m+=Re.BonusOptional),S&&(m+=Re.BonusRepeatable),C===".*"&&(m+=Re.BonusWildcard)}u.push(m)}s.push(u)}if(n.strict&&n.end){const f=s.length-1;s[f][s[f].length-1]+=Re.BonusStrict}n.strict||(r+="/?"),n.end?r+="$":n.strict&&!r.endsWith("/")&&(r+="(?:/|$)");const o=new RegExp(r,n.sensitive?"":"i");function l(f){const u=f.match(o),a={};if(!u)return null;for(let p=1;p<u.length;p++){const m=u[p]||"",A=i[p-1];a[A.name]=m&&A.repeatable?m.split("/"):m}return a}function c(f){let u="",a=!1;for(const p of e){(!a||!u.endsWith("/"))&&(u+="/"),a=!1;for(const m of p)if(m.type===Mt.Static)u+=m.value;else if(m.type===Mt.Param){const{value:A,repeatable:S,optional:M}=m,F=A in f?f[A]:"";if($e(F)&&!S)throw new Error(`Provided param "${A}" is an array but it is not repeatable (* or + modifiers)`);const C=$e(F)?F.join("/"):F;if(!C)if(M)p.length<2&&(u.endsWith("/")?u=u.slice(0,-1):a=!0);else throw new Error(`Missing required param "${A}"`);u+=C}}return u||"/"}return{re:o,score:s,keys:i,parse:l,stringify:c}}function Ea(e,t){let n=0;for(;n<e.length&&n<t.length;){const s=t[n]-e[n];if(s)return s;n++}return e.length<t.length?e.length===1&&e[0]===Re.Static+Re.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Re.Static+Re.Segment?1:-1:0}function bl(e,t){let n=0;const s=e.score,r=t.score;for(;n<s.length&&n<r.length;){const i=Ea(s[n],r[n]);if(i)return i;n++}if(Math.abs(r.length-s.length)===1){if(Ni(s))return 1;if(Ni(r))return-1}return r.length-s.length}function Ni(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Aa={strict:!1,end:!0,sensitive:!1};function Sa(e,t,n){const s=ba(_a(e.path),n),r=te(s,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function wa(e,t){const n=[],s=new Map;t=wi(Aa,t);function r(a){return s.get(a)}function i(a,p,m){const A=!m,S=Li(a);S.aliasOf=m&&m.record;const M=wi(t,a),F=[S];if("alias"in a){const I=typeof a.alias=="string"?[a.alias]:a.alias;for(const K of I)F.push(Li(te({},S,{components:m?m.record.components:S.components,path:K,aliasOf:m?m.record:S})))}let C,L;for(const I of F){const{path:K}=I;if(p&&K[0]!=="/"){const Z=p.record.path,V=Z[Z.length-1]==="/"?"":"/";I.path=p.record.path+(K&&V+K)}if(C=Sa(I,p,M),m?m.alias.push(C):(L=L||C,L!==C&&L.alias.push(C),A&&a.name&&!Di(C)&&o(a.name)),El(C)&&c(C),S.children){const Z=S.children;for(let V=0;V<Z.length;V++)i(Z[V],C,m&&m.children[V])}m=m||C}return L?()=>{o(L)}:vn}function o(a){if(ml(a)){const p=s.get(a);p&&(s.delete(a),n.splice(n.indexOf(p),1),p.children.forEach(o),p.alias.forEach(o))}else{const p=n.indexOf(a);p>-1&&(n.splice(p,1),a.record.name&&s.delete(a.record.name),a.children.forEach(o),a.alias.forEach(o))}}function l(){return n}function c(a){const p=Ra(a,n);n.splice(p,0,a),a.record.name&&!Di(a)&&s.set(a.record.name,a)}function f(a,p){let m,A={},S,M;if("name"in a&&a.name){if(m=s.get(a.name),!m)throw Yt(ae.MATCHER_NOT_FOUND,{location:a});M=m.record.name,A=te(Mi(p.params,m.keys.filter(L=>!L.optional).concat(m.parent?m.parent.keys.filter(L=>L.optional):[]).map(L=>L.name)),a.params&&Mi(a.params,m.keys.map(L=>L.name))),S=m.stringify(A)}else if(a.path!=null)S=a.path,m=n.find(L=>L.re.test(S)),m&&(A=m.parse(S),M=m.record.name);else{if(m=p.name?s.get(p.name):n.find(L=>L.re.test(p.path)),!m)throw Yt(ae.MATCHER_NOT_FOUND,{location:a,currentLocation:p});M=m.record.name,A=te({},p.params,a.params),S=m.stringify(A)}const F=[];let C=m;for(;C;)F.unshift(C.record),C=C.parent;return{name:M,path:S,params:A,matched:F,meta:xa(F)}}e.forEach(a=>i(a));function u(){n.length=0,s.clear()}return{addRoute:i,resolve:f,removeRoute:o,clearRoutes:u,getRoutes:l,getRecordMatcher:r}}function Mi(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function Li(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Ca(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Ca(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function Di(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function xa(e){return e.reduce((t,n)=>te(t,n.meta),{})}function Ra(e,t){let n=0,s=t.length;for(;n!==s;){const i=n+s>>1;bl(e,t[i])<0?s=i:n=i+1}const r=Ta(e);return r&&(s=t.lastIndexOf(r,s-1)),s}function Ta(e){let t=e;for(;t=t.parent;)if(El(t)&&bl(e,t)===0)return t}function El({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Fi(e){const t=Ke(ws),n=Ke(yl),s=Be(()=>{const c=pe(e.to);return t.resolve(c)}),r=Be(()=>{const{matched:c}=s.value,{length:f}=c,u=c[f-1],a=n.matched;if(!u||!a.length)return-1;const p=a.findIndex(Qt.bind(null,u));if(p>-1)return p;const m=Vi(c[f-2]);return f>1&&Vi(u)===m&&a[a.length-1].path!==m?a.findIndex(Qt.bind(null,c[f-2])):p}),i=Be(()=>r.value>-1&&Ma(n.params,s.value.params)),o=Be(()=>r.value>-1&&r.value===n.matched.length-1&&gl(n.params,s.value.params));function l(c={}){if(Na(c)){const f=t[pe(e.replace)?"replace":"push"](pe(e.to)).catch(vn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>f),f}return Promise.resolve()}return{route:s,href:Be(()=>s.value.href),isActive:i,isExactActive:o,navigate:l}}function Oa(e){return e.length===1?e[0]:e}const Pa=ms({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Fi,setup(e,{slots:t}){const n=Ln(Fi(e)),{options:s}=Ke(ws),r=Be(()=>({[ji(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[ji(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&Oa(t.default(n));return e.custom?i:zt("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),Ia=Pa;function Na(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Ma(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!$e(r)||r.length!==s.length||s.some((i,o)=>i.valueOf()!==r[o].valueOf()))return!1}return!0}function Vi(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const ji=(e,t,n)=>e??t??n,La=ms({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=Ke(ur),r=Be(()=>e.route||s.value),i=Ke(Oi,0),o=Be(()=>{let f=pe(i);const{matched:u}=r.value;let a;for(;(a=u[f])&&!a.components;)f++;return f}),l=Be(()=>r.value.matched[o.value]);Kn(Oi,Be(()=>o.value+1)),Kn(ua,l),Kn(ur,r);const c=Sn();return pn(()=>[c.value,l.value,e.name],([f,u,a],[p,m,A])=>{u&&(u.instances[a]=f,m&&m!==u&&f&&f===p&&(u.leaveGuards.size||(u.leaveGuards=m.leaveGuards),u.updateGuards.size||(u.updateGuards=m.updateGuards))),f&&u&&(!m||!Qt(u,m)||!p)&&(u.enterCallbacks[a]||[]).forEach(S=>S(f))},{flush:"post"}),()=>{const f=r.value,u=e.name,a=l.value,p=a&&a.components[u];if(!p)return Bi(n.default,{Component:p,route:f});const m=a.props[u],A=m?m===!0?f.params:typeof m=="function"?m(f):m:null,M=zt(p,te({},A,t,{onVnodeUnmounted:F=>{F.component.isUnmounted&&(a.instances[u]=null)},ref:c}));return Bi(n.default,{Component:M,route:f})||M}}});function Bi(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Da=La;function Fa(e){const t=wa(e.routes,e),n=e.parseQuery||la,s=e.stringifyQuery||Ti,r=e.history,i=on(),o=on(),l=on(),c=nc(_t);let f=_t;Ut&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=js.bind(null,v=>""+v),a=js.bind(null,Gf),p=js.bind(null,In);function m(v,D){let P,B;return ml(v)?(P=t.getRecordMatcher(v),B=D):B=v,t.addRoute(B,P)}function A(v){const D=t.getRecordMatcher(v);D&&t.removeRoute(D)}function S(){return t.getRoutes().map(v=>v.record)}function M(v){return!!t.getRecordMatcher(v)}function F(v,D){if(D=te({},D||c.value),typeof v=="string"){const g=Bs(n,v,D.path),y=t.resolve({path:g.path},D),b=r.createHref(g.fullPath);return te(g,y,{params:p(y.params),hash:In(g.hash),redirectedFrom:void 0,href:b})}let P;if(v.path!=null)P=te({},v,{path:Bs(n,v.path,D.path).path});else{const g=te({},v.params);for(const y in g)g[y]==null&&delete g[y];P=te({},v,{params:a(g)}),D.params=a(D.params)}const B=t.resolve(P,D),Q=v.hash||"";B.params=u(p(B.params));const d=qf(s,te({},v,{hash:kf(Q),path:B.path})),h=r.createHref(d);return te({fullPath:d,hash:Q,query:s===Ti?ca(v.query):v.query||{}},B,{redirectedFrom:void 0,href:h})}function C(v){return typeof v=="string"?Bs(n,v,c.value.path):te({},v)}function L(v,D){if(f!==v)return Yt(ae.NAVIGATION_CANCELLED,{from:D,to:v})}function I(v){return V(v)}function K(v){return I(te(C(v),{replace:!0}))}function Z(v,D){const P=v.matched[v.matched.length-1];if(P&&P.redirect){const{redirect:B}=P;let Q=typeof B=="function"?B(v,D):B;return typeof Q=="string"&&(Q=Q.includes("?")||Q.includes("#")?Q=C(Q):{path:Q},Q.params={}),te({query:v.query,hash:v.hash,params:Q.path!=null?{}:v.params},Q)}}function V(v,D){const P=f=F(v),B=c.value,Q=v.state,d=v.force,h=v.replace===!0,g=Z(P,B);if(g)return V(te(C(g),{state:typeof g=="object"?te({},Q,g.state):Q,force:d,replace:h}),D||P);const y=P;y.redirectedFrom=D;let b;return!d&&Jf(s,B,P)&&(b=Yt(ae.NAVIGATION_DUPLICATED,{to:y,from:B}),We(B,B,!0,!1)),(b?Promise.resolve(b):G(y,B)).catch(_=>it(_)?it(_,ae.NAVIGATION_GUARD_REDIRECT)?_:gt(_):ee(_,y,B)).then(_=>{if(_){if(it(_,ae.NAVIGATION_GUARD_REDIRECT))return V(te({replace:h},C(_.to),{state:typeof _.to=="object"?te({},Q,_.to.state):Q,force:d}),D||y)}else _=T(y,B,!0,h,Q);return J(y,B,_),_})}function j(v,D){const P=L(v,D);return P?Promise.reject(P):Promise.resolve()}function w(v){const D=jt.values().next().value;return D&&typeof D.runWithContext=="function"?D.runWithContext(v):v()}function G(v,D){let P;const[B,Q,d]=fa(v,D);P=ks(B.reverse(),"beforeRouteLeave",v,D);for(const g of B)g.leaveGuards.forEach(y=>{P.push(Et(y,v,D))});const h=j.bind(null,v,D);return P.push(h),Fe(P).then(()=>{P=[];for(const g of i.list())P.push(Et(g,v,D));return P.push(h),Fe(P)}).then(()=>{P=ks(Q,"beforeRouteUpdate",v,D);for(const g of Q)g.updateGuards.forEach(y=>{P.push(Et(y,v,D))});return P.push(h),Fe(P)}).then(()=>{P=[];for(const g of d)if(g.beforeEnter)if($e(g.beforeEnter))for(const y of g.beforeEnter)P.push(Et(y,v,D));else P.push(Et(g.beforeEnter,v,D));return P.push(h),Fe(P)}).then(()=>(v.matched.forEach(g=>g.enterCallbacks={}),P=ks(d,"beforeRouteEnter",v,D,w),P.push(h),Fe(P))).then(()=>{P=[];for(const g of o.list())P.push(Et(g,v,D));return P.push(h),Fe(P)}).catch(g=>it(g,ae.NAVIGATION_CANCELLED)?g:Promise.reject(g))}function J(v,D,P){l.list().forEach(B=>w(()=>B(v,D,P)))}function T(v,D,P,B,Q){const d=L(v,D);if(d)return d;const h=D===_t,g=Ut?history.state:{};P&&(B||h?r.replace(v.fullPath,te({scroll:h&&g&&g.scroll},Q)):r.push(v.fullPath,Q)),c.value=v,We(v,D,P,h),gt()}let z;function fe(){z||(z=r.listen((v,D,P)=>{if(!wt.listening)return;const B=F(v),Q=Z(B,wt.currentRoute.value);if(Q){V(te(Q,{replace:!0,force:!0}),B).catch(vn);return}f=B;const d=c.value;Ut&&na(Ri(d.fullPath,P.delta),Ss()),G(B,d).catch(h=>it(h,ae.NAVIGATION_ABORTED|ae.NAVIGATION_CANCELLED)?h:it(h,ae.NAVIGATION_GUARD_REDIRECT)?(V(te(C(h.to),{force:!0}),B).then(g=>{it(g,ae.NAVIGATION_ABORTED|ae.NAVIGATION_DUPLICATED)&&!P.delta&&P.type===lr.pop&&r.go(-1,!1)}).catch(vn),Promise.reject()):(P.delta&&r.go(-P.delta,!1),ee(h,B,d))).then(h=>{h=h||T(B,d,!1),h&&(P.delta&&!it(h,ae.NAVIGATION_CANCELLED)?r.go(-P.delta,!1):P.type===lr.pop&&it(h,ae.NAVIGATION_ABORTED|ae.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),J(B,d,h)}).catch(vn)}))}let we=on(),ie=on(),q;function ee(v,D,P){gt(v);const B=ie.list();return B.length?B.forEach(Q=>Q(v,D,P)):console.error(v),Promise.reject(v)}function nt(){return q&&c.value!==_t?Promise.resolve():new Promise((v,D)=>{we.add([v,D])})}function gt(v){return q||(q=!v,fe(),we.list().forEach(([D,P])=>v?P(v):D()),we.reset()),v}function We(v,D,P,B){const{scrollBehavior:Q}=e;if(!Ut||!Q)return Promise.resolve();const d=!P&&sa(Ri(v.fullPath,0))||(B||!P)&&history.state&&history.state.scroll||null;return gs().then(()=>Q(v,D,d)).then(h=>h&&ta(h)).catch(h=>ee(h,v,D))}const Pe=v=>r.go(v);let Vt;const jt=new Set,wt={currentRoute:c,listening:!0,addRoute:m,removeRoute:A,clearRoutes:t.clearRoutes,hasRoute:M,getRoutes:S,resolve:F,options:e,push:I,replace:K,go:Pe,back:()=>Pe(-1),forward:()=>Pe(1),beforeEach:i.add,beforeResolve:o.add,afterEach:l.add,onError:ie.add,isReady:nt,install(v){v.component("RouterLink",Ia),v.component("RouterView",Da),v.config.globalProperties.$router=wt,Object.defineProperty(v.config.globalProperties,"$route",{enumerable:!0,get:()=>pe(c)}),Ut&&!Vt&&c.value===_t&&(Vt=!0,I(r.location).catch(B=>{}));const D={};for(const B in _t)Object.defineProperty(D,B,{get:()=>c.value[B],enumerable:!0});v.provide(ws,wt),v.provide(yl,ao(D)),v.provide(ur,c);const P=v.unmount;jt.add(v),v.unmount=function(){jt.delete(v),jt.size<1&&(f=_t,z&&z(),z=null,c.value=_t,Vt=!1,q=!1),P()}}};function Fe(v){return v.reduce((D,P)=>D.then(()=>w(P)),Promise.resolve())}return wt}function Ya(){return Ke(ws)}class Al extends Error{constructor(t,n){super(t),this.code=t,this.status=n}}async function kn(e,t,n){const r=await fetch(t,{method:e,credentials:"include",headers:e==="GET"?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}),i=r.status===204?void 0:await r.json().catch(()=>{});if(!r.ok)throw new Al((i==null?void 0:i.error)??"request-failed",r.status);return i}const Us={get:e=>kn("GET",e),post:(e,t)=>kn("POST",e,t),del:e=>kn("DELETE",e),rpc:(e,t,n={})=>kn("POST",`/api/instances/${e}/rpc`,{type:t,payload:n}).then(s=>s.result)},Va=af("auth",()=>{const e=Sn(null),t=Sn("");async function n(i){t.value="";try{return e.value=await Us.post("/api/login",{token:i}),!0}catch(o){return t.value=o instanceof Al?o.code:"request-failed",e.value=null,!1}}async function s(){try{return e.value=await Us.get("/api/me"),!0}catch{return e.value=null,!1}}async function r(){await Us.post("/api/logout").catch(()=>{}),e.value=null}return{account:e,error:t,login:n,fetchMe:s,logout:r}}),ja=[{path:"/login",name:"login",component:()=>Vs(()=>import("./LoginView-DK70PqWR.js"),__vite__mapDeps([0,1]))},{path:"/",name:"dashboard",component:()=>Vs(()=>import("./DashboardView-B7i6MIlg.js"),__vite__mapDeps([2,1,3,4]))},{path:"/settings",name:"settings",component:()=>Vs(()=>import("./SettingsView-CmskD9oN.js"),__vite__mapDeps([5,3]))}],Sl=Fa({history:pa(),routes:ja});Sl.beforeEach(async e=>{if(e.name==="login")return!0;const t=Va();return t.account||await t.fetchMe()?!0:{name:"login"}});tf(Tf).use(rf()).use(Sl).mount("#app");export{Al as A,dr as B,yf as C,Qa as D,qa as E,Ie as F,Io as G,gs as H,Ua as I,Ha as J,gc as K,$a as L,Ga as M,Vc as N,Ka as O,Sc as T,ke as a,ye as b,er as c,ms as d,hu as e,pe as f,tr as g,Ja as h,Ya as i,_f as j,af as k,Us as l,Be as m,Er as n,Ft as o,Ar as p,bn as q,Sn as r,ka as s,ln as t,Va as u,Wa as v,Ba as w,Zn as x,pn as y,za as z};
@@ -1 +1 @@
1
- import{k as n,r as c}from"./index-DE2bTqBl.js";const a="relay-theme";function m(){var t;const e=localStorage.getItem(a);return e==="dark"||e==="light"?e:(t=window.matchMedia)!=null&&t.call(window,"(prefers-color-scheme: light)").matches?"light":"dark"}const i=n("theme",()=>{const e=c(m());function t(){document.documentElement.classList.toggle("dark",e.value==="dark"),document.documentElement.style.colorScheme=e.value}function o(r){e.value=r,localStorage.setItem(a,r),t()}function l(){o(e.value==="dark"?"light":"dark")}return t(),{mode:e,set:o,toggle:l,apply:t}});export{i as u};
1
+ import{k as n,r as c}from"./index-BHLOc9dP.js";const a="relay-theme";function m(){var t;const e=localStorage.getItem(a);return e==="dark"||e==="light"?e:(t=window.matchMedia)!=null&&t.call(window,"(prefers-color-scheme: light)").matches?"light":"dark"}const i=n("theme",()=>{const e=c(m());function t(){document.documentElement.classList.toggle("dark",e.value==="dark"),document.documentElement.style.colorScheme=e.value}function o(r){e.value=r,localStorage.setItem(a,r),t()}function l(){o(e.value==="dark"?"light":"dark")}return t(),{mode:e,set:o,toggle:l,apply:t}});export{i as u};
@@ -19,7 +19,7 @@
19
19
  }
20
20
  })();
21
21
  </script>
22
- <script type="module" crossorigin src="/assets/index-DE2bTqBl.js"></script>
22
+ <script type="module" crossorigin src="/assets/index-BHLOc9dP.js"></script>
23
23
  <link rel="stylesheet" crossorigin href="/assets/index-DC1zO5jV.css">
24
24
  </head>
25
25
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ganglion/xacpx-relay",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Self-hosted relay hub for xacpx: instance gateway, accounts, and web API.",
5
5
  "license": "MIT",
6
6
  "keywords": ["xacpx", "relay", "hub"],