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 Nt=(n,r,i)=>be(n,typeof r!="symbol"?r+"":r,i);import{c as st,a as x,d as Zt,f as M}from"../chunks/8V7BUHOp.js";import{i as ie}from"../chunks/BLDNKSPL.js";import{f as W,p as Bt,b as nt,d as qt,u as ye,J as $e,t as N,a as Qt,s as a,c as t,e as O,r as e,g as s,n as we}from"../chunks/CwuLZfOX.js";import{S as Se,m as Jt,a as $}from"../chunks/2g4Ae8I6.js";import{s as c}from"../chunks/CaaTB9LM.js";import{i as G}from"../chunks/ChcH33Yj.js";import{I as lt,f as ot,e as et,i as at,r as Ft,a as gt}from"../chunks/4pZKM2WK.js";import{a as Me,b as Gt}from"../chunks/CR2j1Dvc.js";import{l as ct,s as pt}from"../chunks/CNkT2fMe.js";import{P as ke,T as Ae}from"../chunks/CAqXl9ve.js";import{X as Pe}from"../chunks/DXPdQ2Nj.js";import"../chunks/CamjYNJ6.js";import{G as Te}from"../chunks/UUw5XUkC.js";function Ce(n,r){const i=ct(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"}]];lt(n,pt({name:"computer"},()=>i,{get iconNode(){return d},children:(m,P)=>{var u=st(),l=W(u);ot(l,r,"default",{}),x(m,u)},$$slots:{default:!0}}))}function Ne(n,r){const i=ct(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"}]];lt(n,pt({name:"cpu"},()=>i,{get iconNode(){return d},children:(m,P)=>{var u=st(),l=W(u);ot(l,r,"default",{}),x(m,u)},$$slots:{default:!0}}))}function Fe(n,r){const i=ct(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"}]];lt(n,pt({name:"database"},()=>i,{get iconNode(){return d},children:(m,P)=>{var u=st(),l=W(u);ot(l,r,"default",{}),x(m,u)},$$slots:{default:!0}}))}function Ue(n,r){const i=ct(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"}]];lt(n,pt({name:"ethernet-port"},()=>i,{get iconNode(){return d},children:(m,P)=>{var u=st(),l=W(u);ot(l,r,"default",{}),x(m,u)},$$slots:{default:!0}}))}function De(n,r){const i=ct(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"}]];lt(n,pt({name:"hard-drive"},()=>i,{get iconNode(){return d},children:(m,P)=>{var u=st(),l=W(u);ot(l,r,"default",{}),x(m,u)},$$slots:{default:!0}}))}function Ie(n,r){const i=ct(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"}]];lt(n,pt({name:"library"},()=>i,{get iconNode(){return d},children:(m,P)=>{var u=st(),l=W(u);ot(l,r,"default",{}),x(m,u)},$$slots:{default:!0}}))}function Ye(n,r){const i=ct(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"}]];lt(n,pt({name:"microchip"},()=>i,{get iconNode(){return d},children:(m,P)=>{var u=st(),l=W(u);ot(l,r,"default",{}),x(m,u)},$$slots:{default:!0}}))}class ze{constructor(){Nt(this,"errors",{});Nt(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]))$"));Nt(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],m=i[1];return this.ipv6Pattern.test(d)?m&&!/^(?:[a-zA-Z][a-zA-Z0-9]{0,14}|\d+)$/.test(m)?(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 F=new ze;function Ee(n,r,i,d,m){r()&&s(i)&&(Jt.publish("Config/Network",JSON.stringify({interface:s(i),ips:s(d).ips,subnets:s(d).subnets,gateways:s(d).gateways,dns:s(d).dns}),!1),O(m,!1))}var Le=(n,r,i)=>r(s(i)),He=(n,r,i)=>(n.key==="Enter"||n.key===" ")&&r(s(i)),Ve=(n,r,i,d)=>{n.preventDefault(),n.stopPropagation(),r(s(i),s(d)[s(i)])},Oe=M('<span class="badge badge-primary"> </span>'),Re=M('<div class="mt-2 flex flex-wrap items-center gap-x-2 gap-y-1"><span class="text-md">IP:</span> <!></div>'),je=M('<span class="badge badge-secondary"> </span>'),qe=M('<div class="flex flex-wrap items-center gap-x-2 gap-y-1 mt-2"><span class="text-md">Subnet Mask:</span> <!></div>'),Ge=M('<span class="badge badge-secondary"> </span>'),Ze=M('<div class="flex flex-wrap items-center gap-x-2 gap-y-1 mt-2"><span class="text-md">Gateway:</span> <!></div>'),Be=M('<span class="badge badge-secondary"> </span>'),Qe=M('<div class="flex flex-wrap items-center gap-x-2 gap-y-1 mt-2"><span class="text-md">DNS:</span> <!></div>'),Je=M('<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=M('<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)=>O(r,!1),We=(n,r)=>r(),ta=M('<p class="text-error text-sm mt-1"> </p>'),ea=M('<div class="mt-1"><input type="text"/> <!></div>'),aa=(n,r)=>r(),sa=M('<p class="text-error text-sm mt-1"> </p>'),ra=M('<div class="mt-1"><input type="text"/> <!></div>'),da=(n,r)=>r(),ia=M('<p class="text-error text-sm mt-1"> </p>'),va=M('<div class="mt-1"><input type="text"/> <!></div>'),na=(n,r)=>O(r,!1),la=M('<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-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>'),oa=M('<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 ca(n,r){Bt(r,!0);const i=new Se(["$SYS/Network/#"]);let d=nt(qt({})),m=nt("Unknown"),P=nt(!1),u=nt(null),l=nt(qt({ips:[],subnets:[],gateways:[],dns:[]})),T=nt(qt({ips:[],subnets:[],gateways:[],dns:[]}));function ut(){const h=i.getData();let v="Unknown",U=new Set,p={};for(const[z,_]of Object.entries(h)){const I=z.split("/"),o=I[2],w=I.slice(3).join("/");if(o){if(o==="HostName"){v=_;continue}U.add(o),p[o]||(p[o]={name:o,status:"",description:"",mac:"",ips:[],subnets:[],gateways:[],dns:[],dhcp:"false",expanded:!1,hadLinkStatus:!1,hadMAC:!1}),w.includes("DHCP")?p[o].dhcp=_.toLowerCase()==="true"?"true":"false":w.includes("Status")?(p[o].status=_,(_==="Up"||_==="Down")&&(p[o].hadLinkStatus=!0),_==="Up"&&(p[o].expanded=!0)):w.includes("Description")?p[o].description=_:w.includes("MAC")?(p[o].mac=_,_!==""&&_!==null&&(p[o].hadMAC=!0)):w.includes("IPV4/1/IP")||w.includes("IPV6/1/IP")?p[o].ips.includes(_)||(p[o].ips=_.includes(".")?[_,...p[o].ips]:[...p[o].ips,_]):w.includes("SubnetMask")?p[o].subnets.includes(_)||p[o].subnets.push(_):w.includes("Gateway")?p[o].gateways.includes(_)||p[o].gateways.push(_):w.includes("DNS")&&(p[o].dns.includes(_)||p[o].dns.push(_))}}O(d,Object.keys(p).length?p:{},!0),O(m,v,!0)}ye(()=>{ut()});function _t(h,v){O(u,h,!0),O(l,{ips:[...v.ips],subnets:[...v.subnets],gateways:[...v.gateways],dns:[...v.dns]},!0),R(),O(P,!0)}function R(){F.resetErrors();let h={ips:[],subnets:[],gateways:[],dns:[]};return h.ips=s(l).ips.map(v=>F.ipv4(v)||F.ipv6(v)?"":F.getErrors().ipv4||F.getErrors().ipv6),h.gateways=s(l).gateways.map(v=>F.ipv4(v)||F.ipv6(v)?"":F.getErrors().ipv4||F.getErrors().ipv6),h.dns=s(l).dns.map(v=>F.ipv4(v)||F.ipv6(v)?"":F.getErrors().ipv4||F.getErrors().ipv6),O(T,h,!0),!F.hasErrors()}function rt(h){O(d,{...s(d),[h]:{...s(d)[h],expanded:!s(d)[h].expanded}},!0)}function dt(){return Object.keys(s(d)).sort((h,v)=>{const U=s(d)[h].status==="Up"?0:1,p=s(d)[v].status==="Up"?0:1;return U-p})}let xt=nt(!1);$e(()=>{O(xt,"ontouchstart"in window||navigator.maxTouchPoints>0,!0)});var mt=oa(),bt=W(mt),Mt=t(bt),kt=t(Mt),yt=t(kt),Ut=a(t(yt));Ue(Ut,{}),e(yt);var $t=a(yt,2),ht=a(t($t),2),At=t(ht,!0);e(ht),e($t);var Pt=a($t,2);et(Pt,17,dt,at,(h,v)=>{var U=st(),p=W(U);{var z=_=>{var I=Xe(),o=t(I);Ft(o);var w=a(o,2);w.__click=[Le,rt,v],w.__keydown=[He,rt,v];var Z=t(w),it=t(Z,!0);e(Z);var B=a(Z,2),Q=t(B);Q.__click=[Ve,_t,v,d];var J=t(Q);ke(J,{class:"text-gray-500 hover:text-gray-700",tabindex:-1}),e(Q);var tt=a(Q,2),ft=t(tt,!0);e(tt),e(B),e(w);var X=a(w,2),vt=t(X),E=t(vt,!0);e(vt);var j=a(vt,2),S=t(j,!0);e(j);var k=a(j,2);{var y=g=>{var b=Re(),D=a(t(b),2);et(D,17,()=>s(d)[s(v)].ips,at,(H,V)=>{var A=Oe(),K=t(A,!0);e(A),N(()=>c(K,s(V))),x(H,A)}),e(b),x(g,b)};G(k,g=>{s(d)[s(v)].ips.length>0&&g(y)})}var q=a(k,2);{var L=g=>{var b=qe(),D=a(t(b),2);et(D,17,()=>s(d)[s(v)].subnets,at,(H,V)=>{var A=je(),K=t(A,!0);e(A),N(()=>c(K,s(V))),x(H,A)}),e(b),x(g,b)};G(q,g=>{s(d)[s(v)].subnets.length>0&&g(L)})}var f=a(q,2);{var C=g=>{var b=Ze(),D=a(t(b),2);et(D,17,()=>s(d)[s(v)].gateways,at,(H,V)=>{var A=Ge(),K=t(A,!0);e(A),N(()=>c(K,s(V))),x(H,A)}),e(b),x(g,b)};G(f,g=>{s(d)[s(v)].gateways.length>0&&g(C)})}var Y=a(f,2);{var Ct=g=>{var b=Qe(),D=a(t(b),2);et(D,17,()=>s(d)[s(v)].dns,at,(H,V)=>{var A=Be(),K=t(A,!0);e(A),N(()=>c(K,s(V))),x(H,A)}),e(b),x(g,b)};G(Y,g=>{s(d)[s(v)].dns.length>0&&g(Ct)})}var Dt=a(Y,2);{var St=g=>{var b=Je(),D=a(t(b),2),H=t(D,!0);e(D),e(b),N(()=>c(H,s(d)[s(v)].mac)),x(g,b)};G(Dt,g=>{s(d)[s(v)].mac&&g(St)})}e(X),e(I),N(()=>{c(it,s(d)[s(v)].name),gt(Q,1,`cursor-pointer transition-opacity duration-200 focus:outline-none ${s(xt)?"opacity-100":"opacity-0 group-hover:opacity-100"}`),gt(tt,1,`badge ${s(d)[s(v)].status==="Up"?"badge-success":"badge-secondary"}`),c(ft,s(d)[s(v)].status),c(E,s(d)[s(v)].description),gt(j,1,`badge ${s(d)[s(v)].dhcp==="true"?"badge-success":"badge-secondary"}`),c(S,s(d)[s(v)].dhcp==="true"?"DHCP":"Static IP")}),Me(o,()=>s(d)[s(v)].expanded,g=>s(d)[s(v)].expanded=g),x(_,I)};G(p,_=>{s(d)[s(v)].status.length&&s(d)[s(v)].hadLinkStatus&&_(z)})}x(h,U)}),e(kt),e(Mt),e(bt);var Tt=a(bt,2);{var wt=h=>{var v=la(),U=t(v),p=t(U),z=t(p),_=t(z);e(z);var I=a(z,2);I.__click=[Ke,P];var o=t(I);Pe(o,{class:"w-5 h-5"}),e(I),e(p);var w=a(p,2),Z=t(w),it=a(t(Z),2);et(it,17,()=>s(l).ips,at,(E,j,S)=>{var k=ea(),y=t(k);Ft(y),y.__input=[We,R];var q=a(y,2);{var L=f=>{var C=ta(),Y=t(C,!0);e(C),N(()=>c(Y,s(T).ips[S])),x(f,C)};G(q,f=>{s(T).ips[S]&&f(L)})}e(k),N(()=>gt(y,1,`input input-bordered w-full ${s(T).ips[S]?"input-error":""}`)),Gt(y,()=>s(l).ips[S],f=>s(l).ips[S]=f),x(E,k)}),e(Z);var B=a(Z,2),Q=a(t(B),2);et(Q,17,()=>s(l).gateways,at,(E,j,S)=>{var k=ra(),y=t(k);Ft(y),y.__input=[aa,R];var q=a(y,2);{var L=f=>{var C=sa(),Y=t(C,!0);e(C),N(()=>c(Y,s(T).gateways[S])),x(f,C)};G(q,f=>{s(T).gateways[S]&&f(L)})}e(k),N(()=>gt(y,1,`input input-bordered w-full ${s(T).gateways[S]?"input-error":""}`)),Gt(y,()=>s(l).gateways[S],f=>s(l).gateways[S]=f),x(E,k)}),e(B);var J=a(B,2),tt=a(t(J),2);et(tt,17,()=>s(l).dns,at,(E,j,S)=>{var k=va(),y=t(k);Ft(y),y.__input=[da,R];var q=a(y,2);{var L=f=>{var C=ia(),Y=t(C,!0);e(C),N(()=>c(Y,s(T).dns[S])),x(f,C)};G(q,f=>{s(T).dns[S]&&f(L)})}e(k),N(()=>gt(y,1,`input input-bordered w-full ${s(T).dns[S]?"input-error":""}`)),Gt(y,()=>s(l).dns[S],f=>s(l).dns[S]=f),x(E,k)}),e(J);var ft=a(J,2),X=t(ft);X.__click=[na,P];var vt=a(X,2);vt.__click=[Ee,R,u,l,P],e(ft),e(w),e(U),e(v),N(()=>c(_,`${s(u)??""} Settings`)),x(h,v)};G(Tt,h=>{s(P)&&h(wt)})}N(()=>c(At,s(m))),x(n,mt),Qt()}Zt(["click","keydown","input"]);Zt(["click","mousedown"]);var pa=M('<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 ua(n,r){Bt(r,!1);let i=new $("$SYS/OS/Name"),d=new $("$SYS/OS/Version");new $("$SYS/OS/BootTime");let m=new $("App/Uptime");new $("$SYS/OS/Uptime");let P=new $("$SYS/LocalTime"),u=new $("$SYS/CPU/Type"),l=new $("$SYS/CPU/Arch"),T=new $("$SYS/CPU/Load"),ut=new $("$SYS/CPU/Cores"),_t=new $("$SYS/CPU/Threads"),R=new $("$SYS/CPU/MaxClock"),rt=new $("$SYS/RAM/Total"),dt=new $("$SYS/RAM/Free"),xt=new $("$SYS/RAM/Used"),mt=new $("$SYS/Disk/Total"),bt=new $("$SYS/Disk/Free"),Mt=new $("$SYS/Disk/Used"),kt=new $("$SYS/MQTT/TotalClients"),yt=new $("$SYS/MQTT/TotalTopics"),Ut=new $("$SYS/AppDb/Size"),$t=new $("$SYS/HistoryDb/Size");ie();var ht=pa(),At=t(ht),Pt=t(At),Tt=t(Pt),wt=t(Tt),h=t(wt),v=t(h),U=t(v),p=a(t(U));Ce(p,{}),e(U);var z=a(U,2),_=a(t(z),2),I=t(_,!0);e(_),e(z);var o=a(z,2),w=a(t(o),2),Z=t(w,!0);e(w),e(o);var it=a(o,2),B=a(t(it),2),Q=t(B,!0);e(B),e(it);var J=a(it,2),tt=a(t(J),2),ft=t(tt,!0);e(tt),e(J);var X=a(J,4),vt=a(t(X));Ne(vt,{}),e(X);var E=a(X,2),j=a(t(E),2),S=t(j,!0);e(j),e(E);var k=a(E,2),y=a(t(k),2),q=t(y);e(y),e(k);var L=a(k,2),f=a(t(L),2),C=t(f,!0);e(f),e(L);var Y=a(L,2),Ct=a(t(Y),2),Dt=t(Ct,!0);e(Ct),e(Y);var St=a(Y,4),g=a(t(St));Ye(g,{}),e(St);var b=a(St,2),D=a(t(b),2),H=t(D,!0);e(D),e(b);var V=a(b,2),A=a(t(V),2),K=t(A,!0);e(A),e(V);var It=a(V,2),Xt=a(t(It),2),ve=t(Xt,!0);e(Xt),e(It);var Yt=a(It,4),ne=a(t(Yt));De(ne,{}),e(Yt);var zt=a(Yt,2),Kt=a(t(zt),2),le=t(Kt,!0);e(Kt),e(zt);var Et=a(zt,2),Wt=a(t(Et),2),oe=t(Wt,!0);e(Wt),e(Et);var Lt=a(Et,2),te=a(t(Lt),2),ce=t(te,!0);e(te),e(Lt);var Ht=a(Lt,4),pe=a(t(Ht));Fe(pe,{}),e(Ht);var Vt=a(Ht,2),ee=a(t(Vt),2),ue=t(ee,!0);e(ee),e(Vt);var Ot=a(Vt,2),ae=a(t(Ot),2),_e=t(ae,!0);e(ae),e(Ot);var Rt=a(Ot,4),xe=a(t(Rt));Ie(xe,{}),e(Rt);var jt=a(Rt,2),se=a(t(jt),2),me=t(se,!0);e(se),e(jt);var re=a(jt,2),de=a(t(re),2),he=t(de,!0);e(de),e(re),we(2),e(v),e(h),e(wt);var fe=a(wt,2);ca(fe,{}),e(Tt),e(Pt),e(At),e(ht),N(()=>{c(I,i.value),c(Z,d.value),c(Q,m.value),c(ft,P.value),c(S,u.value),c(q,`${ut.value??""} Cores/${_t.value??""} Threads @${R.value??""}MHz Max Clock`),c(C,l.value),c(Dt,T.value),c(H,rt.value),c(K,dt.value),c(ve,xt.value),c(le,mt.value),c(oe,bt.value),c(ce,Mt.value),c(ue,Ut.value),c(_e,$t.value),c(me,yt.value),c(he,kt.value)}),x(n,ht),Qt()}function _a(){Jt.publish("App/Save","",!1),console.log("Saving app state.")}function xa(){Jt.publish("App/Restart","",!1),console.log("Restart command sent.")}var ma=M('<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=ma(),d=t(i),m=t(d);Te(m,{});var P=a(m,4);ua(P,{});var u=a(P,2),l=a(t(u),2),T=t(l),ut=a(t(T),2),_t=t(ut),R=t(_t),rt=t(R);rt.__click=[_a];var dt=a(rt,2),xt=a(t(dt),2);Ae(xt,{topic:"App/SaveInterval",unit:"min"}),e(dt);var mt=a(dt,2);mt.__click=[xa],e(R),e(_t),e(ut),e(T),e(l),e(u),e(d),e(i),x(n,i),Qt()}Zt(["click"]);export{Na as component};
