watchyourlan/backend/internal/web/public/assets/index.js

2 lines
43 KiB
JavaScript

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/History.js","assets/MacHistory.js","assets/HostPage.js"])))=>i.map(i=>d[i]);
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();const w={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return it(this.context.count)},getNextContextId(){return it(this.context.count++)}};function it(e){const t=String(e),n=t.length-1;return w.context.id+(n?String.fromCharCode(96+n):"")+t}function ie(e){w.context=e}const wt=!1,Wt=(e,t)=>e===t,W=Symbol("solid-proxy"),qt=typeof Proxy=="function",Ve=Symbol("solid-track"),be={equals:Wt};let yt=xt;const Y=1,ve=2,bt={owned:null,cleanups:null,context:null,owner:null},De={};var v=null;let je=null,Gt=null,$=null,j=null,X=null,Ie=0;function ae(e,t){const n=$,r=v,s=e.length===0,o=t===void 0?r:t,i=s?bt:{owned:null,cleanups:null,context:o?o.context:null,owner:o},l=s?e:()=>e(()=>H(()=>ue(i)));v=i,$=null;try{return q(l,!0)}finally{$=n,v=r}}function I(e,t){t=t?Object.assign({},be,t):be;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=s=>(typeof s=="function"&&(s=s(n.value)),_t(n,s));return[Ct.bind(n),r]}function Xt(e,t,n){const r=Le(e,t,!0,Y);re(r)}function D(e,t,n){const r=Le(e,t,!1,Y);re(r)}function Yt(e,t,n){yt=nn;const r=Le(e,t,!1,Y);r.user=!0,X?X.push(r):re(r)}function T(e,t,n){n=n?Object.assign({},be,n):be;const r=Le(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,re(r),Ct.bind(r)}function Jt(e){return e&&typeof e=="object"&&"then"in e}function zt(e,t,n){let r,s,o;r=!0,s=e,o={};let i=null,l=De,a=null,c=!1,f="initialValue"in o,u=typeof r=="function"&&T(r);const g=new Set,[p,b]=(o.storage||I)(o.initialValue),[d,h]=I(void 0),[y,m]=I(void 0,{equals:!1}),[A,S]=I(f?"ready":"unresolved");w.context&&(a=w.getNextContextId(),o.ssrLoadFrom==="initial"?l=o.initialValue:w.load&&w.has(a)&&(l=w.load(a)));function P(E,k,L,J){return i===E&&(i=null,J!==void 0&&(f=!0),(E===l||k===l)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(J,{value:k})),l=De,F(k,L)),k}function F(E,k){q(()=>{k===void 0&&b(()=>E),S(k!==void 0?"errored":f?"ready":"unresolved"),h(k);for(const L of g.keys())L.decrement();g.clear()},!1)}function K(){const E=Zt,k=p(),L=d();if(L!==void 0&&!i)throw L;return $&&$.user,k}function x(E=!0){if(E!==!1&&c)return;c=!1;const k=u?u():r;if(k==null||k===!1){P(i,H(p));return}const L=l!==De?l:H(()=>s(k,{value:p(),refetching:E}));return Jt(L)?(i=L,"value"in L?(L.status==="success"?P(i,L.value,void 0,k):P(i,void 0,qe(L.value),k),L):(c=!0,queueMicrotask(()=>c=!1),q(()=>{S(f?"refreshing":"pending"),m()},!1),L.then(J=>P(L,J,void 0,k),J=>P(L,void 0,qe(J),k)))):(P(i,L,void 0,k),L)}return Object.defineProperties(K,{state:{get:()=>A()},error:{get:()=>d()},loading:{get(){const E=A();return E==="pending"||E==="refreshing"}},latest:{get(){if(!f)return K();const E=d();if(E&&!i)throw E;return p()}}}),u?Xt(()=>x(!1)):x(!1),[K,{refetch:x,mutate:b}]}function vt(e){return q(e,!1)}function H(e){if($===null)return e();const t=$;$=null;try{return e()}finally{$=t}}function Qe(e,t,n){const r=Array.isArray(e);let s,o=n&&n.defer;return i=>{let l;if(r){l=Array(e.length);for(let c=0;c<e.length;c++)l[c]=e[c]()}else l=e();if(o)return o=!1,i;const a=H(()=>t(l,s,i));return s=l,a}}function $t(e){Yt(()=>H(e))}function ke(e){return v===null||(v.cleanups===null?v.cleanups=[e]:v.cleanups.push(e)),e}function We(){return $}function Ze(){return v}function St(e,t){const n=v,r=$;v=e,$=null;try{return q(t,!0)}catch(s){tt(s)}finally{v=n,$=r}}function Qt(e){const t=$,n=v;return Promise.resolve().then(()=>{$=t,v=n;let r;return q(e,!1),$=v=null,r?r.done:void 0})}const[Kr,Br]=I(!1);function At(e,t){const n=Symbol("context");return{id:n,Provider:rn(n),defaultValue:e}}function Pt(e){let t;return v&&v.context&&(t=v.context[e.id])!==void 0?t:e.defaultValue}function et(e){const t=T(e),n=T(()=>Ge(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let Zt;function Ct(){if(this.sources&&this.state)if(this.state===Y)re(this);else{const e=j;j=null,q(()=>Se(this),!1),j=e}if($){const e=this.observers?this.observers.length:0;$.sources?($.sources.push(this),$.sourceSlots.push(e)):($.sources=[this],$.sourceSlots=[e]),this.observers?(this.observers.push($),this.observerSlots.push($.sources.length-1)):(this.observers=[$],this.observerSlots=[$.sources.length-1])}return this.value}function _t(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&q(()=>{for(let s=0;s<e.observers.length;s+=1){const o=e.observers[s],i=je&&je.running;i&&je.disposed.has(o),(i?!o.tState:!o.state)&&(o.pure?j.push(o):X.push(o),o.observers&&Et(o)),i||(o.state=Y)}if(j.length>1e6)throw j=[],new Error},!1)),t}function re(e){if(!e.fn)return;ue(e);const t=Ie;en(e,e.value,t)}function en(e,t,n){let r;const s=v,o=$;$=v=e;try{r=e.fn(t)}catch(i){return e.pure&&(e.state=Y,e.owned&&e.owned.forEach(ue),e.owned=null),e.updatedAt=n+1,tt(i)}finally{$=o,v=s}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?_t(e,r):e.value=r,e.updatedAt=n)}function Le(e,t,n,r=Y,s){const o={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:v,context:v?v.context:null,pure:n};return v===null||v!==bt&&(v.owned?v.owned.push(o):v.owned=[o]),o}function $e(e){if(e.state===0)return;if(e.state===ve)return Se(e);if(e.suspense&&H(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Ie);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Y)re(e);else if(e.state===ve){const r=j;j=null,q(()=>Se(e,t[0]),!1),j=r}}function q(e,t){if(j)return e();let n=!1;t||(j=[]),X?n=!0:X=[],Ie++;try{const r=e();return tn(n),r}catch(r){n||(X=null),j=null,tt(r)}}function tn(e){if(j&&(xt(j),j=null),e)return;const t=X;X=null,t.length&&q(()=>yt(t),!1)}function xt(e){for(let t=0;t<e.length;t++)$e(e[t])}function nn(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:$e(r)}if(w.context){if(w.count){w.effects||(w.effects=[]),w.effects.push(...e.slice(0,n));return}ie()}for(w.effects&&(w.done||!w.count)&&(e=[...w.effects,...e],n+=w.effects.length,delete w.effects),t=0;t<n;t++)$e(e[t])}function Se(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const s=r.state;s===Y?r!==t&&(!r.updatedAt||r.updatedAt<Ie)&&$e(r):s===ve&&Se(r,t)}}}function Et(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=ve,n.pure?j.push(n):X.push(n),n.observers&&Et(n))}}function ue(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),s=n.observers;if(s&&s.length){const o=s.pop(),i=n.observerSlots.pop();r<s.length&&(o.sourceSlots[i]=r,s[r]=o,n.observerSlots[r]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)ue(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)ue(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function qe(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function tt(e,t=v){throw qe(e)}function Ge(e){if(typeof e=="function"&&!e.length)return Ge(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Ge(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function rn(e,t){return function(r){let s;return D(()=>s=H(()=>(v.context={...v.context,[e]:r.value},et(()=>r.children))),void 0),s}}const sn=Symbol("fallback");function lt(e){for(let t=0;t<e.length;t++)e[t]()}function on(e,t,n={}){let r=[],s=[],o=[],i=0,l=t.length>1?[]:null;return ke(()=>lt(o)),()=>{let a=e()||[],c=a.length,f,u;return a[Ve],H(()=>{let p,b,d,h,y,m,A,S,P;if(c===0)i!==0&&(lt(o),o=[],r=[],s=[],i=0,l&&(l=[])),n.fallback&&(r=[sn],s[0]=ae(F=>(o[0]=F,n.fallback())),i=1);else if(i===0){for(s=new Array(c),u=0;u<c;u++)r[u]=a[u],s[u]=ae(g);i=c}else{for(d=new Array(c),h=new Array(c),l&&(y=new Array(c)),m=0,A=Math.min(i,c);m<A&&r[m]===a[m];m++);for(A=i-1,S=c-1;A>=m&&S>=m&&r[A]===a[S];A--,S--)d[S]=s[A],h[S]=o[A],l&&(y[S]=l[A]);for(p=new Map,b=new Array(S+1),u=S;u>=m;u--)P=a[u],f=p.get(P),b[u]=f===void 0?-1:f,p.set(P,u);for(f=m;f<=A;f++)P=r[f],u=p.get(P),u!==void 0&&u!==-1?(d[u]=s[f],h[u]=o[f],l&&(y[u]=l[f]),u=b[u],p.set(P,u)):o[f]();for(u=m;u<c;u++)u in d?(s[u]=d[u],o[u]=h[u],l&&(l[u]=y[u],l[u](u))):s[u]=ae(g);s=s.slice(0,i=c),r=a.slice(0)}return s});function g(p){if(o[u]=p,l){const[b,d]=I(u);return l[u]=d,t(a[u],b)}return t(a[u])}}}function _(e,t){return H(()=>e(t||{}))}function me(){return!0}const ln={get(e,t,n){return t===W?n:e.get(t)},has(e,t){return t===W?!0:e.has(t)},set:me,deleteProperty:me,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:me,deleteProperty:me}},ownKeys(e){return e.keys()}};function Fe(e){return(e=typeof e=="function"?e():e)?e:{}}function an(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function cn(...e){let t=!1;for(let i=0;i<e.length;i++){const l=e[i];t=t||!!l&&W in l,e[i]=typeof l=="function"?(t=!0,T(l)):l}if(qt&&t)return new Proxy({get(i){for(let l=e.length-1;l>=0;l--){const a=Fe(e[l])[i];if(a!==void 0)return a}},has(i){for(let l=e.length-1;l>=0;l--)if(i in Fe(e[l]))return!0;return!1},keys(){const i=[];for(let l=0;l<e.length;l++)i.push(...Object.keys(Fe(e[l])));return[...new Set(i)]}},ln);const n={},r=Object.create(null);for(let i=e.length-1;i>=0;i--){const l=e[i];if(!l)continue;const a=Object.getOwnPropertyNames(l);for(let c=a.length-1;c>=0;c--){const f=a[c];if(f==="__proto__"||f==="constructor")continue;const u=Object.getOwnPropertyDescriptor(l,f);if(!r[f])r[f]=u.get?{enumerable:!0,configurable:!0,get:an.bind(n[f]=[u.get.bind(l)])}:u.value!==void 0?u:void 0;else{const g=n[f];g&&(u.get?g.push(u.get.bind(l)):u.value!==void 0&&g.push(()=>u.value))}}}const s={},o=Object.keys(r);for(let i=o.length-1;i>=0;i--){const l=o[i],a=r[l];a&&a.get?Object.defineProperty(s,l,a):s[l]=a?a.value:void 0}return s}function He(e){let t,n;const r=s=>{const o=w.context;if(o){const[l,a]=I();w.count||(w.count=0),w.count++,(n||(n=e())).then(c=>{!w.done&&ie(o),w.count--,a(()=>c.default),ie()}),t=l}else if(!t){const[l]=zt(()=>(n||(n=e())).then(a=>a.default));t=l}let i;return T(()=>(i=t())?H(()=>{if(!o||w.done)return i(s);const l=w.context;ie(o);const a=i(s);return ie(l),a}):"")};return r.preload=()=>n||((n=e()).then(s=>t=()=>s.default),n),r}const un=e=>`Stale read from <${e}>.`;function nt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return T(on(()=>e.each,e.children,t||void 0))}function fe(e){const t=e.keyed,n=T(()=>e.when,void 0,void 0),r=t?n:T(n,void 0,{equals:(s,o)=>!s==!o});return T(()=>{const s=r();if(s){const o=e.children;return typeof o=="function"&&o.length>0?H(()=>o(t?s:()=>{if(!H(r))throw un("Show");return n()})):o}return e.fallback},void 0,void 0)}function fn(e,t,n){let r=n.length,s=t.length,o=r,i=0,l=0,a=t[s-1].nextSibling,c=null;for(;i<s||l<o;){if(t[i]===n[l]){i++,l++;continue}for(;t[s-1]===n[o-1];)s--,o--;if(s===i){const f=o<r?l?n[l-1].nextSibling:n[o-l]:a;for(;l<o;)e.insertBefore(n[l++],f)}else if(o===l)for(;i<s;)(!c||!c.has(t[i]))&&t[i].remove(),i++;else if(t[i]===n[o-1]&&n[l]===t[s-1]){const f=t[--s].nextSibling;e.insertBefore(n[l++],t[i++].nextSibling),e.insertBefore(n[--o],f),t[s]=n[o]}else{if(!c){c=new Map;let u=l;for(;u<o;)c.set(n[u],u++)}const f=c.get(t[i]);if(f!=null)if(l<f&&f<o){let u=i,g=1,p;for(;++u<s&&u<o&&!((p=c.get(t[u]))==null||p!==f+g);)g++;if(g>f-l){const b=t[i];for(;l<f;)e.insertBefore(n[l++],b)}else e.replaceChild(n[l++],t[i++])}else i++;else t[i++].remove()}}}const at="_$DX_DELEGATE";function dn(e,t,n,r={}){let s;return ae(o=>{s=o,t===document?e():R(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{s(),t.textContent=""}}function N(e,t,n,r){let s;const o=()=>{const l=document.createElement("template");return l.innerHTML=e,l.content.firstChild},i=()=>(s||(s=o())).cloneNode(!0);return i.cloneNode=i,i}function se(e,t=window.document){const n=t[at]||(t[at]=new Set);for(let r=0,s=e.length;r<s;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,gn))}}function B(e,t,n){rt(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Mr(e,t){rt(e)||(t==null?e.removeAttribute("class"):e.className=t)}function hn(e,t,n){if(!t)return n?B(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let s,o;for(o in n)t[o]==null&&r.removeProperty(o),delete n[o];for(o in t)s=t[o],s!==n[o]&&(r.setProperty(o,s),n[o]=s);return n}function R(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Ae(e,t,r,n);D(s=>Ae(e,t(),s,n),r)}function rt(e){return!!w.context&&!w.done&&(!e||e.isConnected)}function gn(e){if(w.registry&&w.events&&w.events.find(([a,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,s=e.currentTarget,o=a=>Object.defineProperty(e,"target",{configurable:!0,value:a}),i=()=>{const a=t[n];if(a&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?a.call(t,c,e):a.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&o(t.host),!0},l=()=>{for(;i()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),w.registry&&!w.done&&(w.done=_$HY.done=!0),e.composedPath){const a=e.composedPath();o(a[0]);for(let c=0;c<a.length-2&&(t=a[c],!!i());c++){if(t._$host){t=t._$host,l();break}if(t.parentNode===s)break}}else l();o(r)}function Ae(e,t,n,r,s){const o=rt(e);if(o){!n&&(n=[...e.childNodes]);let a=[];for(let c=0;c<n.length;c++){const f=n[c];f.nodeType===8&&f.data.slice(0,2)==="!$"?f.remove():a.push(f)}n=a}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,l=r!==void 0;if(e=l&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(o||i==="number"&&(t=t.toString(),t===n))return n;if(l){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=te(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(o)return n;n=te(e,n,r)}else{if(i==="function")return D(()=>{let a=t();for(;typeof a=="function";)a=a();n=Ae(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],c=n&&Array.isArray(n);if(Xe(a,t,n,s))return D(()=>n=Ae(e,a,n,r,!0)),()=>n;if(o){if(!a.length)return n;if(r===void 0)return n=[...e.childNodes];let f=a[0];if(f.parentNode!==e)return n;const u=[f];for(;(f=f.nextSibling)!==r;)u.push(f);return n=u}if(a.length===0){if(n=te(e,n,r),l)return n}else c?n.length===0?ct(e,a,r):fn(e,n,a):(n&&te(e),ct(e,a));n=a}else if(t.nodeType){if(o&&t.parentNode)return n=l?[t]:t;if(Array.isArray(n)){if(l)return n=te(e,n,r,t);te(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Xe(e,t,n,r){let s=!1;for(let o=0,i=t.length;o<i;o++){let l=t[o],a=n&&n[e.length],c;if(!(l==null||l===!0||l===!1))if((c=typeof l)=="object"&&l.nodeType)e.push(l);else if(Array.isArray(l))s=Xe(e,l,a)||s;else if(c==="function")if(r){for(;typeof l=="function";)l=l();s=Xe(e,Array.isArray(l)?l:[l],Array.isArray(a)?a:[a])||s}else e.push(l),s=!0;else{const f=String(l);a&&a.nodeType===3&&a.data===f?e.push(a):e.push(document.createTextNode(f))}}return s}function ct(e,t,n=null){for(let r=0,s=t.length;r<s;r++)e.insertBefore(t[r],n)}function te(e,t,n,r){if(n===void 0)return e.textContent="";const s=r||document.createTextNode("");if(t.length){let o=!1;for(let i=t.length-1;i>=0;i--){const l=t[i];if(s!==l){const a=l.parentNode===e;!o&&!i?a?e.replaceChild(s,l):e.insertBefore(s,n):a&&l.remove()}else o=!0}}else e.insertBefore(s,n);return[s]}const pn=!1,mn="modulepreload",wn=function(e){return"/"+e},ut={},Ue=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));s=Promise.allSettled(n.map(a=>{if(a=wn(a),a in ut)return;ut[a]=!0;const c=a.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${f}`))return;const u=document.createElement("link");if(u.rel=c?"stylesheet":mn,c||(u.as="script"),u.crossOrigin="",u.href=a,l&&u.setAttribute("nonce",l),document.head.appendChild(u),c)return new Promise((g,p)=>{u.addEventListener("load",g),u.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})}))}function o(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return s.then(i=>{for(const l of i||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})};function Ot(){let e=new Set;function t(s){return e.add(s),()=>e.delete(s)}let n=!1;function r(s,o){if(n)return!(n=!1);const i={to:s,options:o,defaultPrevented:!1,preventDefault:()=>i.defaultPrevented=!0};for(const l of e)l.listener({...i,from:l.location,retry:a=>{a&&(n=!0),l.navigate(s,{...o,resolve:!1})}});return!i.defaultPrevented}return{subscribe:t,confirm:r}}let Ye;function st(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),Ye=window.history.state._depth}st();function yn(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function bn(e,t){let n=!1;return()=>{const r=Ye;st();const s=r==null?null:Ye-r;if(n){n=!1;return}s&&t(s)?(n=!0,window.history.go(-s)):e()}}const vn=/^(?:[a-z0-9]+:)?\/\//i,$n=/^\/+|(\/)\/+$/g,It="http://sr";function ce(e,t=!1){const n=e.replace($n,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function ye(e,t,n){if(vn.test(t))return;const r=ce(e),s=n&&ce(n);let o="";return!s||t.startsWith("/")?o=r:s.toLowerCase().indexOf(r.toLowerCase())!==0?o=r+s:o=s,(o||"/")+ce(t,!o)}function Sn(e,t){if(e==null)throw new Error(t);return e}function An(e,t){return ce(e).replace(/\/*(\*.*)?$/g,"")+ce(t)}function kt(e){const t={};return e.searchParams.forEach((n,r)=>{r in t?Array.isArray(t[r])?t[r].push(n):t[r]=[t[r],n]:t[r]=n}),t}function Pn(e,t,n){const[r,s]=e.split("/*",2),o=r.split("/").filter(Boolean),i=o.length;return l=>{const a=l.split("/").filter(Boolean),c=a.length-i;if(c<0||c>0&&s===void 0&&!t)return null;const f={path:i?"":"/",params:{}},u=g=>n===void 0?void 0:n[g];for(let g=0;g<i;g++){const p=o[g],b=p[0]===":",d=b?a[g]:a[g].toLowerCase(),h=b?p.slice(1):p.toLowerCase();if(b&&Ke(d,u(h)))f.params[h]=d;else if(b||!Ke(d,h))return null;f.path+=`/${d}`}if(s){const g=c?a.slice(-c).join("/"):"";if(Ke(g,u(s)))f.params[s]=g;else return null}return f}}function Ke(e,t){const n=r=>r===e;return t===void 0?!0:typeof t=="string"?n(t):typeof t=="function"?t(e):Array.isArray(t)?t.some(n):t instanceof RegExp?t.test(e):!1}function Cn(e){const[t,n]=e.pattern.split("/*",2),r=t.split("/").filter(Boolean);return r.reduce((s,o)=>s+(o.startsWith(":")?2:3),r.length-(n===void 0?0:1))}function Lt(e){const t=new Map,n=Ze();return new Proxy({},{get(r,s){return t.has(s)||St(n,()=>t.set(s,T(()=>e()[s]))),t.get(s)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())}})}function Rt(e){let t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];let n=e.slice(0,t.index),r=e.slice(t.index+t[0].length);const s=[n,n+=t[1]];for(;t=/^(\/\:[^\/]+)\?/.exec(r);)s.push(n+=t[1]),r=r.slice(t[0].length);return Rt(r).reduce((o,i)=>[...o,...s.map(l=>l+i)],[])}const _n=100,Tt=At(),Nt=At(),xn=()=>Sn(Pt(Tt),"<A> and 'use' router primitives can be only used inside a Route."),Vr=()=>xn().params;function En(e,t=""){const{component:n,preload:r,load:s,children:o,info:i}=e,l=!o||Array.isArray(o)&&!o.length,a={key:e,component:n,preload:r||s,info:i};return Dt(e.path).reduce((c,f)=>{for(const u of Rt(f)){const g=An(t,u);let p=l?g:g.split("/*",1)[0];p=p.split("/").map(b=>b.startsWith(":")||b.startsWith("*")?b:encodeURIComponent(b)).join("/"),c.push({...a,originalPath:f,pattern:p,matcher:Pn(p,!l,e.matchFilters)})}return c},[])}function On(e,t=0){return{routes:e,score:Cn(e[e.length-1])*1e4-t,matcher(n){const r=[];for(let s=e.length-1;s>=0;s--){const o=e[s],i=o.matcher(n);if(!i)return null;r.unshift({...i,route:o})}return r}}}function Dt(e){return Array.isArray(e)?e:[e]}function jt(e,t="",n=[],r=[]){const s=Dt(e);for(let o=0,i=s.length;o<i;o++){const l=s[o];if(l&&typeof l=="object"){l.hasOwnProperty("path")||(l.path="");const a=En(l,t);for(const c of a){n.push(c);const f=Array.isArray(l.children)&&l.children.length===0;if(l.children&&!f)jt(l.children,c.pattern,n,r);else{const u=On([...n],r.length);r.push(u)}n.pop()}}}return n.length?r:r.sort((o,i)=>i.score-o.score)}function Be(e,t){for(let n=0,r=e.length;n<r;n++){const s=e[n].matcher(t);if(s)return s}return[]}function In(e,t,n){const r=new URL(It),s=T(f=>{const u=e();try{return new URL(u,r)}catch{return console.error(`Invalid path ${u}`),f}},r,{equals:(f,u)=>f.href===u.href}),o=T(()=>s().pathname),i=T(()=>s().search,!0),l=T(()=>s().hash),a=()=>"",c=Qe(i,()=>kt(s()));return{get pathname(){return o()},get search(){return i()},get hash(){return l()},get state(){return t()},get key(){return a()},query:n?n(c):Lt(c)}}let Q;function kn(){return Q}function Ln(e,t,n,r={}){const{signal:[s,o],utils:i={}}=e,l=i.parsePath||(C=>C),a=i.renderPath||(C=>C),c=i.beforeLeave||Ot(),f=ye("",r.base||"");if(f===void 0)throw new Error(`${f} is not a valid base path`);f&&!s().value&&o({value:f,replace:!0,scroll:!1});const[u,g]=I(!1);let p;const b=(C,O)=>{O.value===d()&&O.state===y()||(p===void 0&&g(!0),Q=C,p=O,Qt(()=>{p===O&&(h(p.value),m(p.state),P[1](U=>U.filter(Z=>Z.pending)))}).finally(()=>{p===O&&vt(()=>{Q=void 0,C==="navigate"&&J(p),g(!1),p=void 0})}))},[d,h]=I(s().value),[y,m]=I(s().state),A=In(d,y,i.queryWrapper),S=[],P=I([]),F=T(()=>typeof r.transformUrl=="function"?Be(t(),r.transformUrl(A.pathname)):Be(t(),A.pathname)),K=()=>{const C=F(),O={};for(let U=0;U<C.length;U++)Object.assign(O,C[U].params);return O},x=i.paramsWrapper?i.paramsWrapper(K,t):Lt(K),E={pattern:f,path:()=>f,outlet:()=>null,resolvePath(C){return ye(f,C)}};return D(Qe(s,C=>b("native",C),{defer:!0})),{base:E,location:A,params:x,isRouting:u,renderPath:a,parsePath:l,navigatorFactory:L,matches:F,beforeLeave:c,preloadRoute:Vt,singleFlight:r.singleFlight===void 0?!0:r.singleFlight,submissions:P};function k(C,O,U){H(()=>{if(typeof O=="number"){O&&(i.go?i.go(O):console.warn("Router integration does not support relative routing"));return}const Z=!O||O[0]==="?",{replace:Te,resolve:ee,scroll:Ne,state:oe}={replace:!1,resolve:!Z,scroll:!0,...U},pe=ee?C.resolvePath(O):ye(Z&&A.pathname||"",O);if(pe===void 0)throw new Error(`Path '${O}' is not a routable path`);if(S.length>=_n)throw new Error("Too many redirects");const ot=d();(pe!==ot||oe!==y())&&(pn||c.confirm(pe,U)&&(S.push({value:ot,replace:Te,scroll:Ne,state:y()}),b("navigate",{value:pe,state:oe})))})}function L(C){return C=C||Pt(Nt)||E,(O,U)=>k(C,O,U)}function J(C){const O=S[0];O&&(o({...C,replace:O.replace,scroll:O.scroll}),S.length=0)}function Vt(C,O){const U=Be(t(),C.pathname),Z=Q;Q="preload";for(let Te in U){const{route:ee,params:Ne}=U[Te];ee.component&&ee.component.preload&&ee.component.preload();const{preload:oe}=ee;O&&oe&&St(n(),()=>oe({params:Ne,location:{pathname:C.pathname,search:C.search,hash:C.hash,query:kt(C),state:null,key:""},intent:"preload"}))}Q=Z}}function Rn(e,t,n,r){const{base:s,location:o,params:i}=e,{pattern:l,component:a,preload:c}=r().route,f=T(()=>r().path);a&&a.preload&&a.preload();const u=c?c({params:i,location:o,intent:Q||"initial"}):void 0;return{parent:t,pattern:l,path:f,outlet:()=>a?_(a,{params:i,location:o,data:u,get children(){return n()}}):n(),resolvePath(p){return ye(s.path(),p,f())}}}const Tn=e=>t=>{const{base:n}=t,r=et(()=>t.children),s=T(()=>jt(r(),t.base||""));let o;const i=Ln(e,s,()=>o,{base:n,singleFlight:t.singleFlight,transformUrl:t.transformUrl});return e.create&&e.create(i),_(Tt.Provider,{value:i,get children(){return _(Nn,{routerState:i,get root(){return t.root},get preload(){return t.rootPreload||t.rootLoad},get children(){return[T(()=>(o=Ze())&&null),_(Dn,{routerState:i,get branches(){return s()}})]}})}})};function Nn(e){const t=e.routerState.location,n=e.routerState.params,r=T(()=>e.preload&&H(()=>{e.preload({params:n,location:t,intent:kn()||"initial"})}));return _(fe,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:s=>_(s,{params:n,location:t,get data(){return r()},get children(){return e.children}})})}function Dn(e){const t=[];let n;const r=T(Qe(e.routerState.matches,(s,o,i)=>{let l=o&&s.length===o.length;const a=[];for(let c=0,f=s.length;c<f;c++){const u=o&&o[c],g=s[c];i&&u&&g.route.key===u.route.key?a[c]=i[c]:(l=!1,t[c]&&t[c](),ae(p=>{t[c]=p,a[c]=Rn(e.routerState,a[c-1]||e.routerState.base,ft(()=>r()[c+1]),()=>e.routerState.matches()[c])}))}return t.splice(s.length).forEach(c=>c()),i&&l?i:(n=a[0],a)}));return ft(()=>r()&&n)()}const ft=e=>()=>_(fe,{get when(){return e()},keyed:!0,children:t=>_(Nt.Provider,{value:t,get children(){return t.outlet()}})}),we=e=>{const t=et(()=>e.children);return cn(e,{get children(){return t()}})};function jn([e,t],n,r){return[e,r?s=>t(r(s)):t]}function Fn(e){let t=!1;const n=s=>typeof s=="string"?{value:s}:s,r=jn(I(n(e.get()),{equals:(s,o)=>s.value===o.value&&s.state===o.state}),void 0,s=>(!t&&e.set(s),w.registry&&!w.done&&(w.done=!0),s));return e.init&&ke(e.init((s=e.get())=>{t=!0,r[1](n(s)),t=!1})),Tn({signal:r,create:e.create,utils:e.utils})}function Hn(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function Un(e,t){const n=e&&document.getElementById(e);n?n.scrollIntoView():t&&window.scrollTo(0,0)}const Kn=new Map;function Bn(e=!0,t=!1,n="/_server",r){return s=>{const o=s.base.path(),i=s.navigatorFactory(s.base);let l,a;function c(d){return d.namespaceURI==="http://www.w3.org/2000/svg"}function f(d){if(d.defaultPrevented||d.button!==0||d.metaKey||d.altKey||d.ctrlKey||d.shiftKey)return;const h=d.composedPath().find(F=>F instanceof Node&&F.nodeName.toUpperCase()==="A");if(!h||t&&!h.hasAttribute("link"))return;const y=c(h),m=y?h.href.baseVal:h.href;if((y?h.target.baseVal:h.target)||!m&&!h.hasAttribute("state"))return;const S=(h.getAttribute("rel")||"").split(/\s+/);if(h.hasAttribute("download")||S&&S.includes("external"))return;const P=y?new URL(m,document.baseURI):new URL(m);if(!(P.origin!==window.location.origin||o&&P.pathname&&!P.pathname.toLowerCase().startsWith(o.toLowerCase())))return[h,P]}function u(d){const h=f(d);if(!h)return;const[y,m]=h,A=s.parsePath(m.pathname+m.search+m.hash),S=y.getAttribute("state");d.preventDefault(),i(A,{resolve:!1,replace:y.hasAttribute("replace"),scroll:!y.hasAttribute("noscroll"),state:S?JSON.parse(S):void 0})}function g(d){const h=f(d);if(!h)return;const[y,m]=h;r&&(m.pathname=r(m.pathname)),s.preloadRoute(m,y.getAttribute("preload")!=="false")}function p(d){clearTimeout(l);const h=f(d);if(!h)return a=null;const[y,m]=h;a!==y&&(r&&(m.pathname=r(m.pathname)),l=setTimeout(()=>{s.preloadRoute(m,y.getAttribute("preload")!=="false"),a=y},20))}function b(d){if(d.defaultPrevented)return;let h=d.submitter&&d.submitter.hasAttribute("formaction")?d.submitter.getAttribute("formaction"):d.target.getAttribute("action");if(!h)return;if(!h.startsWith("https://action/")){const m=new URL(h,It);if(h=s.parsePath(m.pathname+m.search),!h.startsWith(n))return}if(d.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const y=Kn.get(h);if(y){d.preventDefault();const m=new FormData(d.target,d.submitter);y.call({r:s,f:d.target},d.target.enctype==="multipart/form-data"?m:new URLSearchParams(m))}}se(["click","submit"]),document.addEventListener("click",u),e&&(document.addEventListener("mousemove",p,{passive:!0}),document.addEventListener("focusin",g,{passive:!0}),document.addEventListener("touchstart",g,{passive:!0})),document.addEventListener("submit",b),ke(()=>{document.removeEventListener("click",u),e&&(document.removeEventListener("mousemove",p),document.removeEventListener("focusin",g),document.removeEventListener("touchstart",g)),document.removeEventListener("submit",b)})}}function Mn(e){const t=()=>{const r=window.location.pathname.replace(/^\/+/,"/")+window.location.search,s=window.history.state&&window.history.state._depth&&Object.keys(window.history.state).length===1?void 0:window.history.state;return{value:r+window.location.hash,state:s}},n=Ot();return Fn({get:t,set({value:r,replace:s,scroll:o,state:i}){s?window.history.replaceState(yn(i),"",r):window.history.pushState(i,"",r),Un(decodeURIComponent(window.location.hash.slice(1)),o),st()},init:r=>Hn(window,"popstate",bn(r,s=>{if(s&&s<0)return!n.confirm(s);{const o=t();return!n.confirm(o.value,{state:o.state})}})),create:Bn(e.preload,e.explicitLinks,e.actionBase,e.transformUrl),utils:{go:r=>window.history.go(r),beforeLeave:n}})(e)}const Je=Symbol("store-raw"),ne=Symbol("store-node"),G=Symbol("store-has"),Ft=Symbol("store-self");function Ht(e){let t=e[W];if(!t&&(Object.defineProperty(e,W,{value:t=new Proxy(e,qn)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let s=0,o=n.length;s<o;s++){const i=n[s];r[i].get&&Object.defineProperty(e,i,{enumerable:r[i].enumerable,get:r[i].get.bind(t)})}}return t}function Pe(e){let t;return e!=null&&typeof e=="object"&&(e[W]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function de(e,t=new Set){let n,r,s,o;if(n=e!=null&&e[Je])return n;if(!Pe(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let i=0,l=e.length;i<l;i++)s=e[i],(r=de(s,t))!==s&&(e[i]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const i=Object.keys(e),l=Object.getOwnPropertyDescriptors(e);for(let a=0,c=i.length;a<c;a++)o=i[a],!l[o].get&&(s=e[o],(r=de(s,t))!==s&&(e[o]=r))}return e}function Ce(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function he(e,t,n){if(e[t])return e[t];const[r,s]=I(n,{equals:!1,internal:!0});return r.$=s,e[t]=r}function Vn(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===W||t===ne||(delete n.value,delete n.writable,n.get=()=>e[W][t]),n}function Ut(e){We()&&he(Ce(e,ne),Ft)()}function Wn(e){return Ut(e),Reflect.ownKeys(e)}const qn={get(e,t,n){if(t===Je)return e;if(t===W)return n;if(t===Ve)return Ut(e),n;const r=Ce(e,ne),s=r[t];let o=s?s():e[t];if(t===ne||t===G||t==="__proto__")return o;if(!s){const i=Object.getOwnPropertyDescriptor(e,t);We()&&(typeof o!="function"||e.hasOwnProperty(t))&&!(i&&i.get)&&(o=he(r,t,o)())}return Pe(o)?Ht(o):o},has(e,t){return t===Je||t===W||t===Ve||t===ne||t===G||t==="__proto__"?!0:(We()&&he(Ce(e,G),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Wn,getOwnPropertyDescriptor:Vn};function _e(e,t,n,r=!1){if(!r&&e[t]===n)return;const s=e[t],o=e.length;n===void 0?(delete e[t],e[G]&&e[G][t]&&s!==void 0&&e[G][t].$()):(e[t]=n,e[G]&&e[G][t]&&s===void 0&&e[G][t].$());let i=Ce(e,ne),l;if((l=he(i,t,s))&&l.$(()=>n),Array.isArray(e)&&e.length!==o){for(let a=e.length;a<o;a++)(l=i[a])&&l.$();(l=he(i,"length",o))&&l.$(e.length)}(l=i[Ft])&&l.$()}function Kt(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const s=n[r];_e(e,s,t[s])}}function Gn(e,t){if(typeof t=="function"&&(t=t(e)),t=de(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const s=t[n];e[n]!==s&&_e(e,n,s)}_e(e,"length",r)}else Kt(e,t)}function le(e,t,n=[]){let r,s=e;if(t.length>1){r=t.shift();const i=typeof r,l=Array.isArray(e);if(Array.isArray(r)){for(let a=0;a<r.length;a++)le(e,[r[a]].concat(t),n);return}else if(l&&i==="function"){for(let a=0;a<e.length;a++)r(e[a],a)&&le(e,[a].concat(t),n);return}else if(l&&i==="object"){const{from:a=0,to:c=e.length-1,by:f=1}=r;for(let u=a;u<=c;u+=f)le(e,[u].concat(t),n);return}else if(t.length>1){le(e[r],t,[r].concat(n));return}s=e[r],n=[r].concat(n)}let o=t[0];typeof o=="function"&&(o=o(s,n),o===s)||r===void 0&&o==null||(o=de(o),r===void 0||Pe(s)&&Pe(o)&&!Array.isArray(o)?Kt(s,o):_e(e,r,o))}function Xn(...[e,t]){const n=de(e||{}),r=Array.isArray(n),s=Ht(n);function o(...i){vt(()=>{r&&i.length===1?Gn(n,i[0]):le(n,i)})}return[s,o]}const M=()=>{var e;return"http://localhost:8840"+(((e=window.appConfig)==null?void 0:e.basePath)??"")},Yn=async()=>{const e=M()+"/api/all";return await(await fetch(e)).json()},Jn=async()=>{const e=M()+"/api/config";return await(await fetch(e)).json()},Wr=async()=>{const e=M()+"/api/version";return await(await fetch(e)).json()},qr=async()=>{const e=M()+"/api/notify_test";await fetch(e)},dt=async(e,t,n)=>{const r=M()+"/api/edit/"+e+"/"+t+"/"+n;return await(await fetch(r)).json()},Gr=async e=>{const t=M()+"/api/host/"+e;return await(await fetch(t)).json()},zn=async e=>{const t=M()+"/api/host/del/"+e;return await(await fetch(t)).json()},Xr=async(e,t)=>{const n=M()+"/api/port/"+e+"/"+t;return await(await fetch(n)).json()},Yr=async e=>{const t=M()+"/api/history/"+e+"/?num=210";return await(await fetch(t)).json()},Jr=async(e,t)=>{const n=M()+"/api/history/"+e+"/"+t;return await(await fetch(n)).json()},zr=async e=>{const t=M()+"/api/wol/"+e;return await(await fetch(t)).json()},Qr={ID:0,Name:"",DNS:"",Iface:"",IP:"",Mac:"",Hw:"",Date:"",Known:0,Now:0},Qn={Host:"",Port:"",Theme:"",Color:"",DirPath:"",Timeout:120,NodePath:"",LogLevel:"",Ifaces:"",ArpArgs:"",ArpStrs:[],TrimHist:48,ShoutURL:"",UseDB:"",PGConnect:"",InfluxEnable:!1,InfluxAddr:"",InfluxToken:"",InfluxOrg:"",InfluxBucket:"",InfluxSkipTLS:!1,PrometheusEnable:!1},[Re,ge]=Xn([]),[xe,Zn]=I([]),[er,tr]=I([]),[z,nr]=I(Qn),[ze,rr]=I(!1),[Zr,es]=I(200),[ts,ht]=I(!1),[Bt,sr]=I([]);let gt="ID";function or(){const e=localStorage.getItem("filterField"),t=localStorage.getItem("filterValue");Ee(e,t)}function Ee(e,t){let n=Re;switch(gt==e&&(n=xe()),gt=e,localStorage.setItem("filterField",e),localStorage.setItem("filterValue",t),e){case"Iface":n=n.filter(r=>r.Iface==t);break;case"Known":n=n.filter(r=>r.Known==t);break;case"Now":n=n.filter(r=>r.Now==t);break;default:n=xe()}ge(n)}let V=!1,Me="";function ir(){const e=localStorage.getItem("sortField");V=JSON.parse(localStorage.getItem("sortDown")),V=!V,Mt(e)}function Mt(e){e!=Me?(Me=e,V=!V):(Me="",V=!V),localStorage.setItem("sortDown",V.toString()),localStorage.setItem("sortField",e);let t=xe();e=="IP"?t.sort((n,r)=>ar(n,r,V)):t.sort((n,r)=>lr(n,r,e,V)),ge(t)}function lr(e,t,n,r){return e[n]>t[n]?r?1:-1:r?-1:1}function ar(e,t,n){const r=pt(e),s=pt(t);return n?r-s:s-r}function pt(e){return Number(e.IP.split(".").map(t=>`000${t}`.slice(-3)).join(""))}function cr(){Oe(),Ee("ID",0),setInterval(()=>{Oe()},6e4)}async function Oe(){const e=await Yn();e!==null&&e.length>0&&(ge(e),Zn(e),ur(),ir(),or())}function ur(){let e=[];for(let t of Re)e.includes(t.Iface)||e.push(t.Iface);tr(e)}const fr=(e,t)=>{let n;const r=()=>clearTimeout(n);return Ze()&&ke(r),Object.assign((...o)=>{n!==void 0&&r(),n=setTimeout(()=>e(...o),t)},{clear:r})};var dr=N('<i class="bi bi-circle-fill"style=color:var(--bs-gray-500);>'),hr=N('<i class="bi bi-check-circle-fill"style=color:var(--bs-success);>'),gr=N("<input type=text class=form-control>"),pr=N("<input type=checkbox class=form-check-input>"),mr=N('<tr><td class=opacity-50>.</td><td></td><td></td><td><a target=_blank></a></td><td></td><td></td><td></td><td><div class="form-check form-switch"><input class=form-check-input type=checkbox></div></td><td></td><td>'),wr=N('<a><i class="bi bi-three-dots-vertical my-btn p-2"title=More>');function yr(e){const[t,n]=I(e.host.Name);let r=dr();e.host.Now==1&&(r=hr());let s;e.host.Known===1?s=!0:s=!1;const o=fr(async c=>{await dt(e.host.ID,c,"")},300),i=async c=>{n(c),o(c)},l=async()=>{await dt(e.host.ID,t(),"toggle")},a=c=>{const f=e.host.ID;sr(u=>c?u.includes(f)?u:[...u,f]:u.filter(g=>g!==f))};return(()=>{var c=mr(),f=c.firstChild,u=f.firstChild,g=f.nextSibling,p=g.nextSibling,b=p.nextSibling,d=b.firstChild,h=b.nextSibling,y=h.nextSibling,m=y.nextSibling,A=m.nextSibling,S=A.firstChild,P=S.firstChild,F=A.nextSibling,K=F.nextSibling;return R(f,()=>e.index,u),R(g,_(fe,{get when(){return ze()},get fallback(){return t()},get children(){var x=gr();return x.$$input=E=>i(E.target.value),D(()=>x.value=t()),x}})),R(p,()=>e.host.Iface),R(d,()=>e.host.IP),R(h,()=>e.host.Mac),R(y,()=>e.host.Hw.slice(0,12)+".."),R(m,()=>e.host.Date),P.$$click=l,P.checked=s,R(F,r),R(K,_(fe,{get when(){return ze()},get fallback(){return(()=>{var x=wr();return D(()=>B(x,"href","/host/"+e.host.ID)),x})()},get children(){var x=pr();return x.addEventListener("change",E=>a(E.target.checked)),D(()=>x.checked=Bt().includes(e.host.ID)),x}})),D(x=>{var E="http://"+e.host.IP,k=e.host.Hw;return E!==x.e&&B(d,"href",x.e=E),k!==x.t&&B(y,"title",x.t=k),x},{e:void 0,t:void 0}),c})()}se(["input","click"]);var br=N('<thead><tr><th style=width:2em;></th><th style=width:2em; title=Edit><i class="bi bi-pencil-fill">'),vr=N('<th> <i class="bi bi-sort-down-alt my-btn">');function $r(){const[e,t]=I("");(()=>{let s=localStorage.getItem("sortField");s==="Mac"&&(s="MAC"),s==="Hw"&&(s="Hardware"),s==="Now"&&(s="On"),t(s)})();const r=s=>{t(s),s==="MAC"&&(s="Mac"),s==="Hardware"&&(s="Hw"),s==="On"&&(s="Now"),Mt(s)};return(()=>{var s=br(),o=s.firstChild,i=o.firstChild,l=i.nextSibling;return R(o,_(nt,{each:["Name","Iface","IP","MAC","Hardware","Date","Known","On"],children:a=>(()=>{var c=vr(),f=c.firstChild,u=f.nextSibling;return R(c,a,f),u.$$click=r,u.$$clickData=a,B(u,"title","Sort by "+a),D(g=>hn(c,a===e()?"color: var(--bs-primary);":"",g)),c})()}),l),s})()}se(["click"]);var Sr=N('<div class=row><div class="col input-group"><select class=form-select title="Filter by Iface"><option value selected disabled>Iface</option></select><select class=form-select title="Filter by Known"><option value selected disabled>Known</option><option value=1>Known</option><option value=0>Unknown</option></select><select class=form-select title="Filter by Online"><option value selected disabled>Online</option><option value=1>On</option><option value=0>Off</option></select><button class="btn btn-outline-primary"title="Reset filter">Reset filter'),Ar=N("<option>");function Pr(){const[e,t]=I(""),n=(s,o)=>{const i=o.target?o.target.value:0;Ee(s,i),ht(!0)},r=()=>{Ee("ID",0),t("something"),t(""),ht(!0)};return(()=>{var s=Sr(),o=s.firstChild,i=o.firstChild;i.firstChild;var l=i.nextSibling,a=l.nextSibling,c=a.nextSibling;return i.addEventListener("change",f=>{n("Iface",f)}),R(i,_(nt,{get each(){return er()},children:f=>(()=>{var u=Ar();return u.value=f,R(u,f),u})()}),null),l.addEventListener("change",f=>{n("Known",f)}),a.addEventListener("change",f=>{n("Now",f)}),c.$$click=r,D(()=>i.value=e()),D(()=>l.value=e()),D(()=>a.value=e()),s})()}se(["click"]);function Cr(e){if(e!=""){const t=e.toLowerCase();let n=[];for(let r of Re)_r(r,t)&&n.push(r);ge(n)}else ge(xe())}function _r(e,t){const n=e.Name.toLowerCase(),r=e.Hw.toLowerCase(),s=e.Mac.toLowerCase();return!!(n.includes(t)||e.Iface.includes(t)||e.IP.includes(t)||s.includes(t)||r.includes(t)||e.Date.includes(t))}var xr=N("<input class=form-control placeholder=Search style=max-width:10em; title=Search>");function Er(){const e=t=>{Cr(t)};return(()=>{var t=xr();return t.$$input=n=>e(n.target.value),t})()}se(["input"]);var Or=N('<button type=button title="Delete selected hosts"class="btn btn-outline-danger">Delete selected'),Ir=N('<button class="btn btn-primary"title="Toggle edit">Edit'),kr=N('<div class=row><div class="col-md mt-1 mb-1"><div class="d-flex justify-left"></div></div><div class="col-md mt-1 mb-1"><div class="d-flex justify-content-between">'),Lr=N('<button class="btn btn-outline-primary"title="Toggle edit">Edit');function Rr(){const e=n=>{n||Oe(),rr(n)},t=async()=>{const n=Bt();for(let r of n)await zn(r);window.location.href="/"};return(()=>{var n=kr(),r=n.firstChild,s=r.firstChild,o=r.nextSibling,i=o.firstChild;return R(s,_(Pr,{})),R(i,_(Er,{}),null),R(i,_(fe,{get when(){return ze()},get fallback(){return(()=>{var l=Lr();return l.$$click=e,l.$$clickData=!0,l})()},get children(){return[(()=>{var l=Or();return l.$$click=t,l})(),(()=>{var l=Ir();return l.$$click=e,l.$$clickData=!1,l})()]}}),null),n})()}se(["click"]);var Tr=N('<div class="card border-primary"><div class=card-header></div><div class="card-body table-responsive"><table class="table table-striped table-hover"><tbody></tbody>');function Nr(){return $t(()=>{Oe()}),(()=>{var e=Tr(),t=e.firstChild,n=t.nextSibling,r=n.firstChild,s=r.firstChild;return R(t,_(Rr,{})),R(r,_($r,{}),s),R(s,_(nt,{each:Re,children:(o,i)=>_(yr,{host:o,get index(){return i()+1}})})),e})()}var mt=N("<link rel=stylesheet>"),Dr=N('<nav class="navbar navbar-expand-md navbar-dark bg-primary"><div class=container-lg><a class=navbar-brand href=/><img style=width:2em></a><ul class="navbar-nav me-auto mb-2 mb-md-0"><li class=nav-item><a class="nav-link active"title=Home>Home</a></li><li class=nav-item><a class="nav-link active"title=Config>Config</a></li><li class=nav-item><a class="nav-link active"title=History>History</a></li></ul><ul class=navbar-nav><li class=nav-item><a class="nav-link active fs-3 ms-md-2"target=_blank href=https://github.com/aceberg/WatchYourLAN title=Github><i class="bi bi-github">');function jr(){const[e,t]=I(""),[n,r]=I("");return(async()=>{nr(await Jn());const o=z().Theme?z().Theme:"sand",i=z().Color?z().Color:"dark";z().NodePath==""?(t("https://cdn.jsdelivr.net/npm/aceberg-bootswatch-fork@v5.3.3-2/dist/"+o+"/bootstrap.min.css"),r("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css")):(t(z().NodePath+"/node_modules/bootswatch/dist/"+o+"/bootstrap.min.css"),r(z().NodePath+"/node_modules/bootstrap-icons/font/bootstrap-icons.css")),document.documentElement.setAttribute("data-bs-theme",i),i==="dark"?document.documentElement.style.setProperty("--transparent-light","#ffffff15"):document.documentElement.style.setProperty("--transparent-light","#00000015")})(),[(()=>{var o=mt();return D(()=>B(o,"href",n())),o})()," ",(()=>{var o=mt();return D(()=>B(o,"href",e())),o})()," ",(()=>{var o=Dr(),i=o.firstChild,l=i.firstChild,a=l.firstChild,c=l.nextSibling,f=c.firstChild,u=f.firstChild,g=f.nextSibling,p=g.firstChild,b=g.nextSibling,d=b.firstChild;return D(h=>{var P,F,K,x;var y=((P=window.appConfig)==null?void 0:P.basePath)+"/fs/public/favicon.png",m=((F=window.appConfig)==null?void 0:F.basePath)+"/",A=((K=window.appConfig)==null?void 0:K.basePath)+"/config/",S=((x=window.appConfig)==null?void 0:x.basePath)+"/history/";return y!==h.e&&B(a,"src",h.e=y),m!==h.t&&B(u,"href",h.t=m),A!==h.a&&B(p,"href",h.a=A),S!==h.o&&B(d,"href",h.o=S),h},{e:void 0,t:void 0,a:void 0,o:void 0}),o})()]}var Fr=N('<div class=container-lg><div class=row><div class="col-md mt-4 mb-4">');function Hr(){$t(()=>{cr()});const e=He(()=>Ue(()=>import("./Config.js"),[])),t=He(()=>Ue(()=>import("./History.js"),__vite__mapDeps([0,1]))),n=He(()=>Ue(()=>import("./HostPage.js"),__vite__mapDeps([2,1])));return[_(jr,{}),(()=>{var r=Fr(),s=r.firstChild,o=s.firstChild;return R(o,_(Mn,{get base(){var i;return((i=window.appConfig)==null?void 0:i.basePath)||""},get children(){return[_(we,{path:"/",component:Nr}),_(we,{path:"/config",component:e}),_(we,{path:"/history",component:t}),_(we,{path:"/host/:id",component:n})]}})),r})()]}const Ur=document.getElementById("root");dn(()=>_(Hr,{}),Ur);export{Vr as A,Gr as B,Yr as C,Jr as D,Xn as E,nt as F,ke as G,Mr as H,fe as S,Wr as a,D as b,I as c,M as d,_ as e,z as f,qr as g,se as h,R as i,T as j,es as k,Zr as l,Re as m,Yt as n,$t as o,ts as p,ht as q,Pr as r,B as s,N as t,fr as u,dt as v,zr as w,zn as x,Xr as y,Qr as z};