var ge=Object.defineProperty;var be=(n,r,i)=>r in n?ge(n,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[r]=i;var zt=(n,r,i)=>be(n,typeof r!="symbol"?r+"":r,i);import{c as it,a as x,d as Gt,f as S,s as p}from"../chunks/DktbhmWA.js";import{i as ie}from"../chunks/CvCfPjaJ.js";import{f as X,p as Bt,d as ot,e as Zt,u as ye,o as $e,t as N,a as Qt,s,c as t,b as Y,r as e,g as a,n as we}from"../chunks/CPWcrcMP.js";import{I as pt,h as ut,S as Se,e as rt,i as dt,r as At,a as ct,m as Jt,c as $}from"../chunks/CNDZS43m.js";import{i as j}from"../chunks/0jvM7PZf.js";import{a as Me,b as It}from"../chunks/CFyEX9sq.js";import{l as _t,s as mt}from"../chunks/DBypTyp2.js";import{P as ke,T as Ae}from"../chunks/1Qdbf8Yb.js";import{X as Pe}from"../chunks/DeZd3Jxh.js";import"../chunks/DyeZe3S9.js";import{G as Te}from"../chunks/hnRDlRMB.js";function Ce(n,r){const i=_t(r,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.511.0 - ISC
 *
 * ISC License
 *
 * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 */const d=[["rect",{width:"14",height:"8",x:"5",y:"2",rx:"2"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2"}],["path",{d:"M6 18h2"}],["path",{d:"M12 18h6"}]];pt(n,mt({name:"computer"},()=>i,{get iconNode(){return d},children:(_,k)=>{var m=it(),o=X(m);ut(o,r,"default",{}),x(_,m)},$$slots:{default:!0}}))}function Ne(n,r){const i=_t(r,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.511.0 - ISC
 *
 * ISC License
 *
 * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 */const d=[["path",{d:"M12 20v2"}],["path",{d:"M12 2v2"}],["path",{d:"M17 20v2"}],["path",{d:"M17 2v2"}],["path",{d:"M2 12h2"}],["path",{d:"M2 17h2"}],["path",{d:"M2 7h2"}],["path",{d:"M20 12h2"}],["path",{d:"M20 17h2"}],["path",{d:"M20 7h2"}],["path",{d:"M7 20v2"}],["path",{d:"M7 2v2"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1"}]];pt(n,mt({name:"cpu"},()=>i,{get iconNode(){return d},children:(_,k)=>{var m=it(),o=X(m);ut(o,r,"default",{}),x(_,m)},$$slots:{default:!0}}))}function Fe(n,r){const i=_t(r,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.511.0 - ISC
 *
 * ISC License
 *
 * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 */const d=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5"}],["path",{d:"M3 12A9 3 0 0 0 21 12"}]];pt(n,mt({name:"database"},()=>i,{get iconNode(){return d},children:(_,k)=>{var m=it(),o=X(m);ut(o,r,"default",{}),x(_,m)},$$slots:{default:!0}}))}function Ue(n,r){const i=_t(r,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.511.0 - ISC
 *
 * ISC License
 *
 * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 */const d=[["path",{d:"m15 20 3-3h2a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h2l3 3z"}],["path",{d:"M6 8v1"}],["path",{d:"M10 8v1"}],["path",{d:"M14 8v1"}],["path",{d:"M18 8v1"}]];pt(n,mt({name:"ethernet-port"},()=>i,{get iconNode(){return d},children:(_,k)=>{var m=it(),o=X(m);ut(o,r,"default",{}),x(_,m)},$$slots:{default:!0}}))}function ze(n,r){const i=_t(r,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.511.0 - ISC
 *
 * ISC License
 *
 * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 */const d=[["line",{x1:"22",x2:"2",y1:"12",y2:"12"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16"}]];pt(n,mt({name:"hard-drive"},()=>i,{get iconNode(){return d},children:(_,k)=>{var m=it(),o=X(m);ut(o,r,"default",{}),x(_,m)},$$slots:{default:!0}}))}function Ie(n,r){const i=_t(r,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.511.0 - ISC
 *
 * ISC License
 *
 * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 */const d=[["path",{d:"m16 6 4 14"}],["path",{d:"M12 6v14"}],["path",{d:"M8 8v12"}],["path",{d:"M4 4v16"}]];pt(n,mt({name:"library"},()=>i,{get iconNode(){return d},children:(_,k)=>{var m=it(),o=X(m);ut(o,r,"default",{}),x(_,m)},$$slots:{default:!0}}))}function De(n,r){const i=_t(r,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.511.0 - ISC
 *
 * ISC License
 *
 * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 */const d=[["path",{d:"M18 12h2"}],["path",{d:"M18 16h2"}],["path",{d:"M18 20h2"}],["path",{d:"M18 4h2"}],["path",{d:"M18 8h2"}],["path",{d:"M4 12h2"}],["path",{d:"M4 16h2"}],["path",{d:"M4 20h2"}],["path",{d:"M4 4h2"}],["path",{d:"M4 8h2"}],["path",{d:"M8 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-1.5c-.276 0-.494.227-.562.495a2 2 0 0 1-3.876 0C9.994 2.227 9.776 2 9.5 2z"}]];pt(n,mt({name:"microchip"},()=>i,{get iconNode(){return d},children:(_,k)=>{var m=it(),o=X(m);ut(o,r,"default",{}),x(_,m)},$$slots:{default:!0}}))}class Ye{constructor(){zt(this,"errors",{});zt(this,"ipv6Pattern",new RegExp("^(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|([0-9A-Fa-f]{1,4}:){1,7}:|([0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}|([0-9A-Fa-f]{1,4}:){1,5}(:[0-9A-Fa-f]{1,4}){1,2}|([0-9A-Fa-f]{1,4}:){1,4}(:[0-9A-Fa-f]{1,4}){1,3}|([0-9A-Fa-f]{1,4}:){1,3}(:[0-9A-Fa-f]{1,4}){1,4}|([0-9A-Fa-f]{1,4}:){1,2}(:[0-9A-Fa-f]{1,4}){1,5}|[0-9A-Fa-f]{1,4}:((:[0-9A-Fa-f]{1,4}){1,6})|:((:[0-9A-Fa-f]{1,4}){1,7}|:)|fe80:(:[0-9A-Fa-f]{0,4}){0,4}%(?:[a-zA-Z][a-zA-Z0-9]{0,14}|\\d+)|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.){3,3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])|([0-9A-Fa-f]{1,4}:){1,4}:((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.){3,3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9]))$"));zt(this,"ipv4Pattern",/^(\d{1,3}\.){3}\d{1,3}$/)}ipv6(r){const i=r.split("%");if(i.length>2)return this.errors.ipv6="Invalid IPv6 address.",!1;const d=i[0],_=i[1];return this.ipv6Pattern.test(d)?_&&!/^(?:[a-zA-Z][a-zA-Z0-9]{0,14}|\d+)$/.test(_)?(this.errors.ipv6="Invalid IPv6 zone index.",!1):!0:(this.errors.ipv6="Invalid IPv6 format.",!1)}ipv4(r){const i=this.ipv4Pattern.test(r);return i||(this.errors.ipv4="Invalid IPv4 address."),i}email(r){const i=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r);return i||(this.errors.email="Invalid email format."),i}required(r){const i=r.trim().length>0;return i||(this.errors.required="This field is required."),i}minLength(r,i){const d=r.trim().length>=i;return d||(this.errors.minLength=`Must be at least ${i} characters.`),d}maxLength(r,i){const d=r.trim().length<=i;return d||(this.errors.maxLength=`Must be at most ${i} characters.`),d}getErrors(){return this.errors}hasErrors(){return Object.values(this.errors).some(r=>r!=="")}resetErrors(){this.errors={}}}const U=new Ye;function Ee(n,r,i,d,_,k){r()&&a(i)&&(Jt.publish("Config/Network",JSON.stringify({interface:a(i),ips:a(d).ips,subnets:a(d).subnets,gateways:a(d).gateways,dns:a(d).dns,hostname:a(d).hostname.trim()}),!1),Y(_,a(d).hostname.trim(),!0),Y(k,!1))}var He=(n,r,i)=>r(a(i)),Le=(n,r,i)=>(n.key==="Enter"||n.key===" ")&&r(a(i)),Ve=(n,r,i,d)=>{n.preventDefault(),n.stopPropagation(),r(a(i),a(d)[a(i)])},Oe=S('<span class="badge badge-primary"> </span>'),Re=S('<div class="mt-2 flex flex-wrap items-center gap-x-2 gap-y-1"><span class="text-md">IP:</span> <!></div>'),je=S('<span class="badge badge-secondary"> </span>'),qe=S('<div class="flex flex-wrap items-center gap-x-2 gap-y-1 mt-2"><span class="text-md">Subnet Mask:</span> <!></div>'),Ze=S('<span class="badge badge-secondary"> </span>'),Ge=S('<div class="flex flex-wrap items-center gap-x-2 gap-y-1 mt-2"><span class="text-md">Gateway:</span> <!></div>'),Be=S('<span class="badge badge-secondary"> </span>'),Qe=S('<div class="flex flex-wrap items-center gap-x-2 gap-y-1 mt-2"><span class="text-md">DNS:</span> <!></div>'),Je=S('<div class="flex flex-wrap items-center gap-x-2 gap-y-1 mt-2"><span class="text-md">MAC:</span> <span class="badge badge-secondary"> </span></div>'),Xe=S('<div class="collapse collapse-arrow border border-base-content/10 group"><input type="checkbox" class="peer hidden"/> <div class="collapse-title text-xl font-medium bg-base-300 flex justify-between items-center cursor-pointer" tabindex="0" role="button"><span> </span> <div class="flex items-center gap-2"><button type="button" aria-label="Edit network settings"><!></button> <span> </span></div></div> <div class="collapse-content py-4 peer-checked:block hidden bg-base-300"><p class="text-md text-gray-500"> </p> <span> </span> <!> <!> <!> <!> <!></div></div>'),Ke=(n,r)=>Y(r,!1),We=(n,r)=>r(),ta=S('<p class="text-error text-sm mt-1"> </p>'),ea=(n,r)=>r(),aa=S('<p class="text-error text-sm mt-1"> </p>'),sa=S('<div class="mt-1"><input type="text"/> <!></div>'),ra=(n,r)=>r(),da=S('<p class="text-error text-sm mt-1"> </p>'),ia=S('<div class="mt-1"><input type="text"/> <!></div>'),va=(n,r)=>r(),na=S('<p class="text-error text-sm mt-1"> </p>'),la=S('<div class="mt-1"><input type="text"/> <!></div>'),oa=(n,r)=>Y(r,!1),ca=S('<div class="modal modal-open"><div class="modal-box rounded-lg border border-gray-700 transition-all duration-200 p-0"><div class="bg-base-300 px-5 py-3 flex justify-between items-center"><h3 class="font-semibold text-lg"> </h3> <button type="button" class="p-1 hover:bg-base-300 rounded text-primary hover:text-error" aria-label="Close modal"><!></button></div> <div class="p-5"><div class="mt-1"><div class="block text-sm font-medium text-gray-300">Hostname</div> <div class="mt-1"><input type="text"/> <!></div></div> <div class="mt-3"><div class="block text-sm font-medium text-gray-300">IP Addresses</div> <!></div> <div class="mt-3"><div class="block text-sm font-medium text-gray-300">Gateway</div> <!></div> <div class="mt-3"><div class="block text-sm font-medium text-gray-300">DNS Servers</div> <!></div> <div class="modal-action"><button class="btn btn-outline">Cancel</button> <button class="btn btn-primary">Save</button></div></div></div></div>'),pa=S('<div class="card bg-base-200 shadow-md w-full"><div class="card-body w-full"><div class="mt-4 w-full"><div class="flex text-2xl items-center gap-2">Network <!></div> <div class="flex gap-1 py-1"><h3 class="text-md">Hostname:</h3> <div class="text-gray-500 text-md"> </div></div> <!></div></div></div> <!>',1);function ua(n,r){Bt(r,!0);const i=new Se(["$SYS/Network/#"]);let d=ot(Zt({})),_=ot("Unknown"),k=ot(!1),m=ot(null),o=ot(Zt({ips:[],subnets:[],gateways:[],dns:[],hostname:""})),A=ot(Zt({ips:[],subnets:[],gateways:[],dns:[],hostname:""}));function xt(){const g=i.getData();let v="Unknown",I=new Set,c={};for(const[q,h]of Object.entries(g)){const F=q.split("/"),u=F[2],M=F.slice(3).join("/");if(u){if(u==="Hostname"){v=h;continue}I.add(u),c[u]||(c[u]={name:u,status:"",description:"",mac:"",ips:[],subnets:[],gateways:[],dns:[],dhcp:"false",expanded:!1,hadLinkStatus:!1,hadMAC:!1}),M.includes("DHCP")?c[u].dhcp=h.toLowerCase()==="true"?"true":"false":M.includes("Status")?(c[u].status=h,(h==="Up"||h==="Down")&&(c[u].hadLinkStatus=!0),h==="Up"&&(c[u].expanded=!0)):M.includes("Description")?c[u].description=h:M.includes("MAC")?(c[u].mac=h,h!==""&&h!==null&&(c[u].hadMAC=!0)):M.includes("IPV4/1/IP")||M.includes("IPV6/1/IP")?c[u].ips.includes(h)||(c[u].ips=h.includes(".")?[h,...c[u].ips]:[...c[u].ips,h]):M.includes("SubnetMask")?c[u].subnets.includes(h)||c[u].subnets.push(h):M.includes("Gateway")?c[u].gateways.includes(h)||c[u].gateways.push(h):M.includes("DNS")&&(c[u].dns.includes(h)||c[u].dns.push(h))}}Y(d,Object.keys(c).length?c:{},!0),Y(_,v,!0)}ye(()=>{xt()});function ht(g,v){Y(m,g,!0),Y(o,{ips:[...v.ips],subnets:[...v.subnets],gateways:[...v.gateways],dns:[...v.dns],hostname:a(_)==="Unknown"?"":a(_)},!0),E(),Y(k,!0)}function E(){U.resetErrors();let g={ips:[],subnets:[],gateways:[],dns:[],hostname:""};return g.ips=a(o).ips.map(v=>U.ipv4(v)||U.ipv6(v)?"":U.getErrors().ipv4||U.getErrors().ipv6),g.gateways=a(o).gateways.map(v=>U.ipv4(v)||U.ipv6(v)?"":U.getErrors().ipv4||U.getErrors().ipv6),g.dns=a(o).dns.map(v=>U.ipv4(v)||U.ipv6(v)?"":U.getErrors().ipv4||U.getErrors().ipv6),g.hostname=ft(a(o).hostname),Y(A,g,!0),!U.hasErrors()&&!g.hostname}function ft(g){const v=g.trim();return v?v.length>63?"Hostname must be at most 63 characters.":/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?$/.test(v)?"":"Invalid hostname. Use letters, numbers and hyphens.":"Hostname is required."}function K(g){Y(d,{...a(d),[g]:{...a(d)[g],expanded:!a(d)[g].expanded}},!0)}function yt(){return Object.keys(a(d)).sort((g,v)=>{const I=a(d)[g].status==="Up"?0:1,c=a(d)[v].status==="Up"?0:1;return I-c})}let gt=ot(!1);$e(()=>{Y(gt,"ontouchstart"in window||navigator.maxTouchPoints>0,!0)});var Pt=pa(),$t=X(Pt),Tt=t($t),Ct=t(Tt),wt=t(Ct),Dt=s(t(wt));Ue(Dt,{}),e(wt);var vt=s(wt,2),St=s(t(vt),2),Nt=t(St,!0);e(St),e(vt);var Ft=s(vt,2);rt(Ft,17,yt,dt,(g,v)=>{var I=it(),c=X(I);{var q=h=>{var F=Xe(),u=t(F);At(u);var M=s(u,2);M.__click=[He,K,v],M.__keydown=[Le,K,v];var H=t(M),nt=t(H,!0);e(H);var Z=s(H,2),L=t(Z);L.__click=[Ve,ht,v,d];var bt=t(L);ke(bt,{class:"text-gray-500 hover:text-gray-700",tabindex:-1}),e(L);var B=s(L,2),lt=t(B,!0);e(B),e(Z),e(M);var W=s(M,2),Q=t(W),tt=t(Q,!0);e(Q);var et=s(Q,2),at=t(et,!0);e(et);var st=s(et,2);{var kt=l=>{var f=Re(),D=s(t(f),2);rt(D,17,()=>a(d)[a(v)].ips,dt,(z,G)=>{var C=Oe(),R=t(C,!0);e(C),N(()=>p(R,a(G))),x(z,C)}),e(f),x(l,f)};j(st,l=>{a(d)[a(v)].ips.length>0&&l(kt)})}var P=s(st,2);{var V=l=>{var f=qe(),D=s(t(f),2);rt(D,17,()=>a(d)[a(v)].subnets,dt,(z,G)=>{var C=je(),R=t(C,!0);e(C),N(()=>p(R,a(G))),x(z,C)}),e(f),x(l,f)};j(P,l=>{a(d)[a(v)].subnets.length>0&&l(V)})}var b=s(P,2);{var T=l=>{var f=Ge(),D=s(t(f),2);rt(D,17,()=>a(d)[a(v)].gateways,dt,(z,G)=>{var C=Ze(),R=t(C,!0);e(C),N(()=>p(R,a(G))),x(z,C)}),e(f),x(l,f)};j(b,l=>{a(d)[a(v)].gateways.length>0&&l(T)})}var y=s(b,2);{var J=l=>{var f=Qe(),D=s(t(f),2);rt(D,17,()=>a(d)[a(v)].dns,dt,(z,G)=>{var C=Be(),R=t(C,!0);e(C),N(()=>p(R,a(G))),x(z,C)}),e(f),x(l,f)};j(y,l=>{a(d)[a(v)].dns.length>0&&l(J)})}var O=s(y,2);{var w=l=>{var f=Je(),D=s(t(f),2),z=t(D,!0);e(D),e(f),N(()=>p(z,a(d)[a(v)].mac)),x(l,f)};j(O,l=>{a(d)[a(v)].mac&&l(w)})}e(W),e(F),N(()=>{p(nt,a(d)[a(v)].name),ct(L,1,`cursor-pointer transition-opacity duration-200 focus:outline-none ${a(gt)?"opacity-100":"opacity-0 group-hover:opacity-100"}`),ct(B,1,`badge ${a(d)[a(v)].status==="Up"?"badge-success":"badge-secondary"}`),p(lt,a(d)[a(v)].status),p(tt,a(d)[a(v)].description),ct(et,1,`badge ${a(d)[a(v)].dhcp==="true"?"badge-success":"badge-secondary"}`),p(at,a(d)[a(v)].dhcp==="true"?"DHCP":"Static IP")}),Me(u,()=>a(d)[a(v)].expanded,l=>a(d)[a(v)].expanded=l),x(h,F)};j(c,h=>{a(d)[a(v)].status.length&&a(d)[a(v)].hadLinkStatus&&h(q)})}x(g,I)}),e(Ct),e(Tt),e($t);var Mt=s($t,2);{var Ut=g=>{var v=ca(),I=t(v),c=t(I),q=t(c),h=t(q);e(q);var F=s(q,2);F.__click=[Ke,k];var u=t(F);Pe(u,{class:"w-5 h-5"}),e(F),e(c);var M=s(c,2),H=t(M),nt=s(t(H),2),Z=t(nt);At(Z),Z.__input=[We,E];var L=s(Z,2);{var bt=P=>{var V=ta(),b=t(V,!0);e(V),N(()=>p(b,a(A).hostname)),x(P,V)};j(L,P=>{a(A).hostname&&P(bt)})}e(nt),e(H);var B=s(H,2),lt=s(t(B),2);rt(lt,17,()=>a(o).ips,dt,(P,V,b)=>{var T=sa(),y=t(T);At(y),y.__input=[ea,E];var J=s(y,2);{var O=w=>{var l=aa(),f=t(l,!0);e(l),N(()=>p(f,a(A).ips[b])),x(w,l)};j(J,w=>{a(A).ips[b]&&w(O)})}e(T),N(()=>ct(y,1,`input input-bordered w-full ${a(A).ips[b]?"input-error":""}`)),It(y,()=>a(o).ips[b],w=>a(o).ips[b]=w),x(P,T)}),e(B);var W=s(B,2),Q=s(t(W),2);rt(Q,17,()=>a(o).gateways,dt,(P,V,b)=>{var T=ia(),y=t(T);At(y),y.__input=[ra,E];var J=s(y,2);{var O=w=>{var l=da(),f=t(l,!0);e(l),N(()=>p(f,a(A).gateways[b])),x(w,l)};j(J,w=>{a(A).gateways[b]&&w(O)})}e(T),N(()=>ct(y,1,`input input-bordered w-full ${a(A).gateways[b]?"input-error":""}`)),It(y,()=>a(o).gateways[b],w=>a(o).gateways[b]=w),x(P,T)}),e(W);var tt=s(W,2),et=s(t(tt),2);rt(et,17,()=>a(o).dns,dt,(P,V,b)=>{var T=la(),y=t(T);At(y),y.__input=[va,E];var J=s(y,2);{var O=w=>{var l=na(),f=t(l,!0);e(l),N(()=>p(f,a(A).dns[b])),x(w,l)};j(J,w=>{a(A).dns[b]&&w(O)})}e(T),N(()=>ct(y,1,`input input-bordered w-full ${a(A).dns[b]?"input-error":""}`)),It(y,()=>a(o).dns[b],w=>a(o).dns[b]=w),x(P,T)}),e(tt);var at=s(tt,2),st=t(at);st.__click=[oa,k];var kt=s(st,2);kt.__click=[Ee,E,m,o,_,k],e(at),e(M),e(I),e(v),N(()=>{p(h,`${a(m)??""} Settings`),ct(Z,1,`input input-bordered w-full ${a(A).hostname?"input-error":""}`)}),It(Z,()=>a(o).hostname,P=>a(o).hostname=P),x(g,v)};j(Mt,g=>{a(k)&&g(Ut)})}N(()=>p(Nt,a(_))),x(n,Pt),Qt()}Gt(["click","keydown","input"]);Gt(["click","mousedown"]);var _a=S('<div class="card bg-base-300 shadow-xl"><div class="card-body"><div class="mb-4"><div class="grid grid-cols-1 lg:grid-cols-2 gap-4"><div class="card bg-base-200 shadow-md "><div class="card-body flex flex-row"><div class="bg-base-200"><div class="flex text-2xl items-center gap-2">System <!></div> <div class="flex gap-1"><h3 class="text-md">OS Name:</h3> <div class="text-gray-500 text-md"> </div></div> <div class="flex gap-1"><h3 class="text-md">OS Version:</h3> <div class="text-gray-500 text-md"> </div></div>  <div class="flex gap-1"><h3 class="text-md">Uptime:</h3> <div class="text-gray-500 text-md"> </div></div>  <div class="flex gap-1"><h3 class="text-md">Local Time:</h3> <div class="text-gray-500 text-md"> </div></div> <div class="mb-2"></div> <div class="flex text-2xl items-center gap-2">CPU <!></div> <div class="flex gap-1"><h3 class="text-md">Type:</h3> <div class="text-gray-500 text-md"> </div></div> <div class="flex gap-1"><h3 class="text-md">Spec:</h3> <div class="text-gray-500 text-md"> </div></div> <div class="flex gap-1"><h3 class="text-md">Arch:</h3> <div class="text-gray-500 text-md"> </div></div> <div class="flex gap-1"><h3 class="text-md">Load:</h3> <div class="text-gray-500 text-md"> </div></div> <div class="mb-2"></div> <div class="flex text-2xl items-center gap-2">RAM <!></div> <div class="flex gap-1"><h3 class="text-md">Total:</h3> <div class="text-gray-500 text-md"> </div></div> <div class="flex gap-1"><h3 class="text-md">Free:</h3> <div class="text-gray-500 text-md"> </div></div> <div class="flex gap-1"><h3 class="text-md">Used:</h3> <div class="text-gray-500 text-md"> </div></div> <div class="mb-2"></div> <div class="flex text-2xl items-center gap-2">Storage <!></div> <div class="flex gap-1"><h3 class="text-md">Total:</h3> <div class="text-gray-500 text-md"> </div></div> <div class="flex gap-1"><h3 class="text-md">Free:</h3> <div class="text-gray-500 text-md"> </div></div> <div class="flex gap-1"><h3 class="text-md">Used:</h3> <div class="text-gray-500 text-md"> </div></div> <div class="mb-2"></div> <div class="flex text-2xl items-center gap-2">Databases <!></div> <div class="flex gap-1"><h3 class="text-md">App:</h3> <div class="text-gray-500 text-md"> </div></div> <div class="flex gap-1"><h3 class="text-md">History:</h3> <div class="text-gray-500 text-md"> </div></div> <div class="mb-2"></div> <div class="flex text-2xl items-center gap-2">MQTT <!></div> <div class="flex gap-1"><h3 class="text-md">Total Topics:</h3> <div class="text-gray-500 text-md"> </div></div> <div class="flex gap-1"><h3 class="text-md">Clients Connected:</h3> <div class="text-gray-500 text-md"> </div></div> <div class="mb-2"></div></div></div></div> <!></div></div></div></div>');function ma(n,r){Bt(r,!1);let i=new $("$SYS/OS/Name"),d=new $("$SYS/OS/Version");new $("$SYS/OS/BootTime");let _=new $("App/Uptime");new $("$SYS/OS/Uptime");let k=new $("$SYS/LocalTime"),m=new $("$SYS/CPU/Type"),o=new $("$SYS/CPU/Arch"),A=new $("$SYS/CPU/Load"),xt=new $("$SYS/CPU/Cores"),ht=new $("$SYS/CPU/Threads"),E=new $("$SYS/CPU/MaxClock"),ft=new $("$SYS/RAM/Total"),K=new $("$SYS/RAM/Free"),yt=new $("$SYS/RAM/Used"),gt=new $("$SYS/Disk/Total"),Pt=new $("$SYS/Disk/Free"),$t=new $("$SYS/Disk/Used"),Tt=new $("$SYS/MQTT/TotalClients"),Ct=new $("$SYS/MQTT/TotalTopics"),wt=new $("$SYS/AppDb/Size"),Dt=new $("$SYS/HistoryDb/Size");ie();var vt=_a(),St=t(vt),Nt=t(St),Ft=t(Nt),Mt=t(Ft),Ut=t(Mt),g=t(Ut),v=t(g),I=s(t(v));Ce(I,{}),e(v);var c=s(v,2),q=s(t(c),2),h=t(q,!0);e(q),e(c);var F=s(c,2),u=s(t(F),2),M=t(u,!0);e(u),e(F);var H=s(F,2),nt=s(t(H),2),Z=t(nt,!0);e(nt),e(H);var L=s(H,2),bt=s(t(L),2),B=t(bt,!0);e(bt),e(L);var lt=s(L,4),W=s(t(lt));Ne(W,{}),e(lt);var Q=s(lt,2),tt=s(t(Q),2),et=t(tt,!0);e(tt),e(Q);var at=s(Q,2),st=s(t(at),2),kt=t(st);e(st),e(at);var P=s(at,2),V=s(t(P),2),b=t(V,!0);e(V),e(P);var T=s(P,2),y=s(t(T),2),J=t(y,!0);e(y),e(T);var O=s(T,4),w=s(t(O));De(w,{}),e(O);var l=s(O,2),f=s(t(l),2),D=t(f,!0);e(f),e(l);var z=s(l,2),G=s(t(z),2),C=t(G,!0);e(G),e(z);var R=s(z,2),Xt=s(t(R),2),ve=t(Xt,!0);e(Xt),e(R);var Yt=s(R,4),ne=s(t(Yt));ze(ne,{}),e(Yt);var Et=s(Yt,2),Kt=s(t(Et),2),le=t(Kt,!0);e(Kt),e(Et);var Ht=s(Et,2),Wt=s(t(Ht),2),oe=t(Wt,!0);e(Wt),e(Ht);var Lt=s(Ht,2),te=s(t(Lt),2),ce=t(te,!0);e(te),e(Lt);var Vt=s(Lt,4),pe=s(t(Vt));Fe(pe,{}),e(Vt);var Ot=s(Vt,2),ee=s(t(Ot),2),ue=t(ee,!0);e(ee),e(Ot);var Rt=s(Ot,2),ae=s(t(Rt),2),_e=t(ae,!0);e(ae),e(Rt);var jt=s(Rt,4),me=s(t(jt));Ie(me,{}),e(jt);var qt=s(jt,2),se=s(t(qt),2),xe=t(se,!0);e(se),e(qt);var re=s(qt,2),de=s(t(re),2),he=t(de,!0);e(de),e(re),we(2),e(g),e(Ut),e(Mt);var fe=s(Mt,2);ua(fe,{}),e(Ft),e(Nt),e(St),e(vt),N(()=>{p(h,i.value),p(M,d.value),p(Z,_.value),p(B,k.value),p(et,m.value),p(kt,`${xt.value??""} Cores/${ht.value??""} Threads @${E.value??""}MHz Max Clock`),p(b,o.value),p(J,A.value),p(D,ft.value),p(C,K.value),p(ve,yt.value),p(le,gt.value),p(oe,Pt.value),p(ce,$t.value),p(ue,wt.value),p(_e,Dt.value),p(xe,Ct.value),p(he,Tt.value)}),x(n,vt),Qt()}function xa(){Jt.publish("App/Save","",!1),console.log("Saving app state.")}function ha(){Jt.publish("App/Restart","",!1),console.log("Restart command sent.")}var fa=S('<section><div class="container"><!> <div class="py-2"></div> <!> <div class="bg-base-300 mt-4 p-6 rounded-lg shadow"><h1 class="text-2xl font-bold mb-4">Actions</h1> <div class="flex flex-wrap gap-6 sm:flex-col lg:flex-row"><div class="flex flex-col"><h2 class="text-lg font-semibold mb-2">App</h2> <div class="flex flex-col lg:flex-row items-center gap-4"><div class="card bg-base-100 shadow-md p-4"><div class="card-body flex flex-col lg:flex-row items-center gap-4"><button class="btn btn-primary w-full sm:w-auto">Save app</button> <div class="flex flex-col sm:flex-row items-center gap-2"><span>Save Interval</span> <!></div> <button class="btn btn-warning w-full sm:w-auto">Restart app</button></div></div></div></div></div></div></div></section>');function Na(n,r){Bt(r,!1),ie();var i=fa(),d=t(i),_=t(d);Te(_,{});var k=s(_,4);ma(k,{});var m=s(k,2),o=s(t(m),2),A=t(o),xt=s(t(A),2),ht=t(xt),E=t(ht),ft=t(E);ft.__click=[xa];var K=s(ft,2),yt=s(t(K),2);Ae(yt,{topic:"App/SaveInterval",unit:"min"}),e(K);var gt=s(K,2);gt.__click=[ha],e(E),e(ht),e(xt),e(A),e(o),e(m),e(d),e(i),x(n,i),Qt()}Gt(["click"]);export{Na as component};
