import{d as z,c as at,a as A,f as q}from"../chunks/8V7BUHOp.js";import{e as et,g as e,b as st,p as C,f as rt,a as F,t as ot,am as nt,c as t,r as a,s as o,n as v,h as m}from"../chunks/CwuLZfOX.js";import{a as it,s as f}from"../chunks/CaaTB9LM.js";import{s as lt,a as K}from"../chunks/BxoYaj6m.js";import{a as ct,S as M,A as P}from"../chunks/CPL3xYsw.js";import"../chunks/Cq4v1K7x.js";import"../chunks/BFDT3n3W.js";import"../chunks/Bquy_oA5.js";import"../chunks/DUxDMF0-.js";import{i as dt}from"../chunks/ChcH33Yj.js";import{p as pt}from"../chunks/CNkT2fMe.js";import{T as vt}from"../chunks/pTX2znib.js";const mt=!1,zt=Object.freeze(Object.defineProperty({__proto__:null,prerender:mt},Symbol.toStringTag,{value:"Module"}));z(["click"]);z(["change"]);z(["change"]);let u=st(!1);const G={get value(){return e(u)},start(){et(u,!e(u)),setTimeout(()=>this.start(),e(u)?600:400)}};G.start();function Y(x,c){C(c,!0);let g=pt(c,"alarm",3,!0);var d=at(),_=rt(d);{var r=s=>{vt(s,{class:"w-16 h-16 mr-1 text-error"})};dt(_,s=>{G.value&&g()&&s(r)})}A(x,d),F()}var ft=q('<meta name="description" content="Varibits process UI"/>'),ut=q('<div class="container mx-auto px-4"><a class="badge badge-lg badge-primary font-semibold"> </a>    <div class="flex items-center gap-2"></div>       <div class="grid gap-0 lg:gap-4 lg:grid-cols-2"><a class="card pt-3 shadow-sm" href="/devices"><div class="card bg-base-200 p-6 text-base-content"><div class="flex items-center justify-between gap-2"><div><h3 class="text-2xl font-semibold">Devices</h3> <p class="mt-2 flex items-baseline"><span> </span> <span class="ml-1 text-xl font-semibold">online</span></p> <p class="mt-4 text-sm text-gray-400">Each module can control up to two dampers.</p></div> <!></div></div></a> <a class="card pt-3 shadow-sm" href="/zones"><div class="card bg-base-200 p-6 text-base-content"><div class="flex items-center justify-between gap-2"><div><h3 class="text-2xl font-semibold">Zones</h3> <p class="mt-2 flex items-baseline"><span> </span> <span class="ml-1 text-xl font-semibold">OK</span></p> <p class="mt-4 text-sm text-gray-400">Each zone is usually one Air Handling Unit.</p></div> <!></div></div></a></div> <div class="flex flex-col items-center pt-3"><p class="text-sm font-bold">Software version: <span class="text-sm font-normal text-gray-400"> </span></p></div></div>');function Ot(x,c){C(c,!0);const g=new ct("$SYS/SoftwareVersion"),d=new M(["Devices/+/Health"]),_=new M(["Zones/+/Status"]);let r=m(()=>{const i=d.getData();let n=0,l=0;for(const[,k]of Object.entries(i))n++,k==="1"&&l++;return{total:n,online:l}}),s=m(()=>{const i=_.getData();let n=0,l=0;for(const[,k]of Object.entries(i))n++,k==="1"&&l++;return{total:n,status:l}});var b=ut();it(i=>{var n=ft();nt.title="Varibits",A(i,n)});var p=t(b),J=t(p);a(p);var h=o(p,4),w=t(h),O=t(w),T=t(O),S=t(T),V=o(t(S),2),y=t(V),L=t(y);a(y),v(2),a(V),v(2),a(S);var N=o(S,2);const Q=m(()=>e(r).total!==e(r).online);Y(N,{get alarm(){return e(Q)}}),a(T),a(O),a(w);var D=o(w,2),I=t(D),U=t(I),$=t(U),H=o(t($),2),j=t(H),R=t(j);a(j),v(2),a(H),v(2),a($);var W=o($,2);const X=m(()=>e(s).total!==e(s).status);Y(W,{get alarm(){return e(X)}}),a(U),a(I),a(D),a(h);var B=o(h,2),E=t(B),Z=o(t(E)),tt=t(Z,!0);a(Z),a(E),a(B),a(b),ot(()=>{lt(p,"href",`/users/${P.userId??""}`),f(J,`User: ${P.username??""}`),K(y,1,`text-5xl font-bold tracking-tight ${e(r).total!==e(r).online?"text-error":""}`),f(L,`${e(r).online??""}/${e(r).total??""}`),K(j,1,`text-5xl font-bold tracking-tight ${e(s).total!==e(s).status?"text-error":""}`),f(R,`${e(s).status??""}/${e(s).total??""}`),f(tt,g.value)}),A(x,b),F()}export{Ot as component,zt as universal};
