Files
NextFloorSymcon/NextFloor/assets/nextfloor-hydronics.js
T
2026-11-17 12:59:54 +01:00

258 lines
39 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */
var G=globalThis,Q=G.ShadowRoot&&(G.ShadyCSS===void 0||G.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,it=Symbol(),wt=new WeakMap,j=class{constructor(t,n,i){if(this._$cssResult$=!0,i!==it)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}get styleSheet(){let t=this.o,n=this.t;if(Q&&t===void 0){let i=n!==void 0&&n.length===1;i&&(t=wt.get(n)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&wt.set(n,t))}return t}toString(){return this.cssText}},At=r=>new j(typeof r=="string"?r:r+"",void 0,it),y=(r,...t)=>{let n=r.length===1?r[0]:t.reduce((i,e,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(e)+r[s+1],r[0]);return new j(n,r,it)},St=(r,t)=>{if(Q)r.adoptedStyleSheets=t.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(let n of t){let i=document.createElement("style"),e=G.litNonce;e!==void 0&&i.setAttribute("nonce",e),i.textContent=n.cssText,r.appendChild(i)}},rt=Q?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let n="";for(let i of t.cssRules)n+=i.cssText;return At(n)})(r):r;var{is:Xt,defineProperty:Yt,getOwnPropertyDescriptor:Gt,getOwnPropertyNames:Qt,getOwnPropertySymbols:te,getPrototypeOf:ee}=Object,tt=globalThis,Et=tt.trustedTypes,ne=Et?Et.emptyScript:"",ie=tt.reactiveElementPolyfillSupport,B=(r,t)=>r,st={toAttribute(r,t){switch(t){case Boolean:r=r?ne:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let n=r;switch(t){case Boolean:n=r!==null;break;case Number:n=r===null?null:Number(r);break;case Object:case Array:try{n=JSON.parse(r)}catch{n=null}}return n}},kt=(r,t)=>!Xt(r,t),Ht={attribute:!0,type:String,converter:st,reflect:!1,useDefault:!1,hasChanged:kt};Symbol.metadata??=Symbol("metadata"),tt.litPropertyMetadata??=new WeakMap;var w=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,n=Ht){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(t,n),!n.noAccessor){let i=Symbol(),e=this.getPropertyDescriptor(t,i,n);e!==void 0&&Yt(this.prototype,t,e)}}static getPropertyDescriptor(t,n,i){let{get:e,set:s}=Gt(this.prototype,t)??{get(){return this[n]},set(o){this[n]=o}};return{get:e,set(o){let c=e?.call(this);s?.call(this,o),this.requestUpdate(t,c,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Ht}static _$Ei(){if(this.hasOwnProperty(B("elementProperties")))return;let t=ee(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(B("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(B("properties"))){let n=this.properties,i=[...Qt(n),...te(n)];for(let e of i)this.createProperty(e,n[e])}let t=this[Symbol.metadata];if(t!==null){let n=litPropertyMetadata.get(t);if(n!==void 0)for(let[i,e]of n)this.elementProperties.set(i,e)}this._$Eh=new Map;for(let[n,i]of this.elementProperties){let e=this._$Eu(n,i);e!==void 0&&this._$Eh.set(e,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let n=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let e of i)n.unshift(rt(e))}else t!==void 0&&n.push(rt(t));return n}static _$Eu(t,n){let i=n.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,n=this.constructor.elementProperties;for(let i of n.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return St(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,n,i){this._$AK(t,i)}_$ET(t,n){let i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(e!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:st).toAttribute(n,i.type);this._$Em=t,s==null?this.removeAttribute(e):this.setAttribute(e,s),this._$Em=null}}_$AK(t,n){let i=this.constructor,e=i._$Eh.get(t);if(e!==void 0&&this._$Em!==e){let s=i.getPropertyOptions(e),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:st;this._$Em=e;let c=o.fromAttribute(n,s.type);this[e]=c??this._$Ej?.get(e)??c,this._$Em=null}}requestUpdate(t,n,i,e=!1,s){if(t!==void 0){let o=this.constructor;if(e===!1&&(s=this[t]),i??=o.getPropertyOptions(t),!((i.hasChanged??kt)(s,n)||i.useDefault&&i.reflect&&s===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,n,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,n,{useDefault:i,reflect:e,wrapped:s},o){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??n??this[t]),s!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(n=void 0),this._$AL.set(t,n)),e===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,s]of this._$Ep)this[e]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[e,s]of i){let{wrapped:o}=s,c=this[e];o!==!0||this._$AL.has(e)||c===void 0||this.C(e,void 0,s,c)}}let t=!1,n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(n)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(n)}willUpdate(t){}_$AE(t){this._$EO?.forEach(n=>n.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(n=>this._$ET(n,this[n])),this._$EM()}updated(t){}firstUpdated(t){}};w.elementStyles=[],w.shadowRootOptions={mode:"open"},w[B("elementProperties")]=new Map,w[B("finalized")]=new Map,ie?.({ReactiveElement:w}),(tt.reactiveElementVersions??=[]).push("2.1.2");var ht=globalThis,Ct=r=>r,et=ht.trustedTypes,Rt=et?et.createPolicy("lit-html",{createHTML:r=>r}):void 0,Ft="$lit$",S=`lit$${Math.random().toFixed(9).slice(2)}$`,zt="?"+S,re=`<${zt}>`,R=document,K=()=>R.createComment(""),W=r=>r===null||typeof r!="object"&&typeof r!="function",pt=Array.isArray,se=r=>pt(r)||typeof r?.[Symbol.iterator]=="function",ot=`[
\f\r]`,I=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Nt=/-->/g,Pt=/>/g,k=RegExp(`>|${ot}(?:([^\\s"'>=/]+)(${ot}*=${ot}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),Mt=/'/g,Tt=/"/g,Ut=/^(?:script|style|textarea|title)$/i,ft=r=>(t,...n)=>({_$litType$:r,strings:t,values:n}),d=ft(1),ve=ft(2),xe=ft(3),N=Symbol.for("lit-noChange"),a=Symbol.for("lit-nothing"),Ot=new WeakMap,C=R.createTreeWalker(R,129);function Lt(r,t){if(!pt(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Rt!==void 0?Rt.createHTML(t):t}var oe=(r,t)=>{let n=r.length-1,i=[],e,s=t===2?"<svg>":t===3?"<math>":"",o=I;for(let c=0;c<n;c++){let l=r[c],h,p,u=-1,g=0;for(;g<l.length&&(o.lastIndex=g,p=o.exec(l),p!==null);)g=o.lastIndex,o===I?p[1]==="!--"?o=Nt:p[1]!==void 0?o=Pt:p[2]!==void 0?(Ut.test(p[2])&&(e=RegExp("</"+p[2],"g")),o=k):p[3]!==void 0&&(o=k):o===k?p[0]===">"?(o=e??I,u=-1):p[1]===void 0?u=-2:(u=o.lastIndex-p[2].length,h=p[1],o=p[3]===void 0?k:p[3]==='"'?Tt:Mt):o===Tt||o===Mt?o=k:o===Nt||o===Pt?o=I:(o=k,e=void 0);let $=o===k&&r[c+1].startsWith("/>")?" ":"";s+=o===I?l+re:u>=0?(i.push(h),l.slice(0,u)+Ft+l.slice(u)+S+$):l+S+(u===-2?c:$)}return[Lt(r,s+(r[n]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},q=class r{constructor({strings:t,_$litType$:n},i){let e;this.parts=[];let s=0,o=0,c=t.length-1,l=this.parts,[h,p]=oe(t,n);if(this.el=r.createElement(h,i),C.currentNode=this.el.content,n===2||n===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(e=C.nextNode())!==null&&l.length<c;){if(e.nodeType===1){if(e.hasAttributes())for(let u of e.getAttributeNames())if(u.endsWith(Ft)){let g=p[o++],$=e.getAttribute(u).split(S),_=/([.?@])?(.*)/.exec(g);l.push({type:1,index:s,name:_[2],strings:$,ctor:_[1]==="."?lt:_[1]==="?"?ct:_[1]==="@"?ut:T}),e.removeAttribute(u)}else u.startsWith(S)&&(l.push({type:6,index:s}),e.removeAttribute(u));if(Ut.test(e.tagName)){let u=e.textContent.split(S),g=u.length-1;if(g>0){e.textContent=et?et.emptyScript:"";for(let $=0;$<g;$++)e.append(u[$],K()),C.nextNode(),l.push({type:2,index:++s});e.append(u[g],K())}}}else if(e.nodeType===8)if(e.data===zt)l.push({type:2,index:s});else{let u=-1;for(;(u=e.data.indexOf(S,u+1))!==-1;)l.push({type:7,index:s}),u+=S.length-1}s++}}static createElement(t,n){let i=R.createElement("template");return i.innerHTML=t,i}};function M(r,t,n=r,i){if(t===N)return t;let e=i!==void 0?n._$Co?.[i]:n._$Cl,s=W(t)?void 0:t._$litDirective$;return e?.constructor!==s&&(e?._$AO?.(!1),s===void 0?e=void 0:(e=new s(r),e._$AT(r,n,i)),i!==void 0?(n._$Co??=[])[i]=e:n._$Cl=e),e!==void 0&&(t=M(r,e._$AS(r,t.values),e,i)),t}var at=class{constructor(t,n){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:n},parts:i}=this._$AD,e=(t?.creationScope??R).importNode(n,!0);C.currentNode=e;let s=C.nextNode(),o=0,c=0,l=i[0];for(;l!==void 0;){if(o===l.index){let h;l.type===2?h=new Z(s,s.nextSibling,this,t):l.type===1?h=new l.ctor(s,l.name,l.strings,this,t):l.type===6&&(h=new dt(s,this,t)),this._$AV.push(h),l=i[++c]}o!==l?.index&&(s=C.nextNode(),o++)}return C.currentNode=R,e}p(t){let n=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,n),n+=i.strings.length-2):i._$AI(t[n])),n++}},Z=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,n,i,e){this.type=2,this._$AH=a,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=i,this.options=e,this._$Cv=e?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,n=this._$AM;return n!==void 0&&t?.nodeType===11&&(t=n.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,n=this){t=M(this,t,n),W(t)?t===a||t==null||t===""?(this._$AH!==a&&this._$AR(),this._$AH=a):t!==this._$AH&&t!==N&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):se(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==a&&W(this._$AH)?this._$AA.nextSibling.data=t:this.T(R.createTextNode(t)),this._$AH=t}$(t){let{values:n,_$litType$:i}=t,e=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=q.createElement(Lt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===e)this._$AH.p(n);else{let s=new at(e,this),o=s.u(this.options);s.p(n),this.T(o),this._$AH=s}}_$AC(t){let n=Ot.get(t.strings);return n===void 0&&Ot.set(t.strings,n=new q(t)),n}k(t){pt(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,i,e=0;for(let s of t)e===n.length?n.push(i=new r(this.O(K()),this.O(K()),this,this.options)):i=n[e],i._$AI(s),e++;e<n.length&&(this._$AR(i&&i._$AB.nextSibling,e),n.length=e)}_$AR(t=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);t!==this._$AB;){let i=Ct(t).nextSibling;Ct(t).remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},T=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,n,i,e,s){this.type=1,this._$AH=a,this._$AN=void 0,this.element=t,this.name=n,this._$AM=e,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=a}_$AI(t,n=this,i,e){let s=this.strings,o=!1;if(s===void 0)t=M(this,t,n,0),o=!W(t)||t!==this._$AH&&t!==N,o&&(this._$AH=t);else{let c=t,l,h;for(t=s[0],l=0;l<s.length-1;l++)h=M(this,c[i+l],n,l),h===N&&(h=this._$AH[l]),o||=!W(h)||h!==this._$AH[l],h===a?t=a:t!==a&&(t+=(h??"")+s[l+1]),this._$AH[l]=h}o&&!e&&this.j(t)}j(t){t===a?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},lt=class extends T{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===a?void 0:t}},ct=class extends T{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==a)}},ut=class extends T{constructor(t,n,i,e,s){super(t,n,i,e,s),this.type=5}_$AI(t,n=this){if((t=M(this,t,n,0)??a)===N)return;let i=this._$AH,e=t===a&&i!==a||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,s=t!==a&&(i===a||e);e&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},dt=class{constructor(t,n,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){M(this,t)}};var ae=ht.litHtmlPolyfillSupport;ae?.(q,Z),(ht.litHtmlVersions??=[]).push("3.3.3");var Dt=(r,t,n)=>{let i=n?.renderBefore??t,e=i._$litPart$;if(e===void 0){let s=n?.renderBefore??null;i._$litPart$=e=new Z(t.insertBefore(K(),s),s,void 0,n??{})}return e._$AI(r),e};var mt=globalThis,v=class extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Dt(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return N}};v._$litElement$=!0,v.finalized=!0,mt.litElementHydrateSupport?.({LitElement:v});var le=mt.litElementPolyfillSupport;le?.({LitElement:v});(mt.litElementVersions??=[]).push("4.2.2");var ce=(r,t="Station 1")=>({id:r,name:t,has_valve:!0}),O=r=>r.has_valve!==!1;function F(r){let t=r.hydronic??{};return t.stations?.length?t.stations.slice(0,16):[{...ce("station-1"),flow:t.flow,return:t.return,hot_water:t.hot_water,cold_water:t.cold_water,pump:t.pump}]}var ue=["heating_manifold","buffer_tank","freshwater_station"],Vt=r=>ue.includes(r),de=(r,t="Heizkreis")=>({id:r,name:t,kind:"heating",has_pump:!0,has_valve:!0});function he(r){return{card:!0,...r==="heating_manifold"?{circuits:[de("c1","Heizkreis 1")]}:{},...r==="buffer_tank"?{sensors:Array.from({length:7},(t,n)=>({id:`s${n+1}`,name:`F\xFChler ${n+1}`,entity:null,level:1-n/6}))}:{}}}function z(r){return{...he(r.type),...r.hydronic}}var J=r=>r.has_pump!==!1,X=r=>r.kind!=="pump"&&r.has_valve!==!1;var f=r=>!!r&&r!=="none";function b(r){return!r||r.state==="unknown"||r.state==="unavailable"?null:r.attributes.symcon_value??r.attributes.symcon_numeric_value??r.state}function U(r){let t=b(r);if(t===null||typeof t=="boolean"||t==="")return null;let n=Number(t);return Number.isFinite(n)?n:null}function Y(r){let t=b(r);if(t===null)return null;if(typeof t=="boolean")return t;if(typeof t=="number")return t>0;let n=String(t).trim().toLowerCase();if(["on","true","1","home","open","an","ein","ja","regen","rain","wet","nass"].includes(n))return!0;if(["off","false","0","not_home","closed","aus","nein","trocken","dry"].includes(n))return!1;let i=Number(n);return n!==""&&Number.isFinite(i)?i>0:null}function L(r){return b(r)===null?"\u2013":String(r?.attributes.symcon_formatted??b(r))}function A(r,t){let n=f(t?.feedback),i=n?t.feedback:f(t?.command)?t.command:null,e=i?r.states[i]:void 0,s=b(e);if(!e||s===null)return{id:i,value:null,percent:null,running:null,feedback:n};if(e.attributes.symcon_variable_type===0||typeof s=="boolean"){let p=Y(e);return{id:i,value:p,percent:p===null?null:p?100:0,running:p,feedback:n}}let o=U(e),c=Number(e.attributes.symcon_min??0),l=Number(e.attributes.symcon_max??100),h=o===null?null:Math.max(0,Math.min(100,100*(o-c)/(l>c?l-c:100)));return{id:i,value:o,percent:h,running:h===null?null:h>0,feedback:n}}function E(r,t){if(!f(t))return null;let n=r.states[t],i=U(n);if(i===null)return null;let e=String(n?.attributes.unit_of_measurement??"\xB0C").trim();return e==="\xB0F"||e==="\u2109"?(i-32)*5/9:e==="K"?i-273.15:i}function m(r,t,n){if(!f(n))return null;let i=r.states[n],e=U(i),s=L(i),o=i?.attributes.unit_of_measurement;return{id:n,label:t,value:e,text:e!==null&&o&&typeof i?.attributes.symcon_formatted!="string"?`${s} ${o}`:s}}function pe(r,t,n,i){let e=z(t);return{id:t.id,floorId:n,item:t,base:i,circuits:(e.circuits??[]).map(s=>{let o=X(s)?A(r,s.valve).percent:null,c=f(s.mode_entity)?b(r.states[s.mode_entity]):null;return{id:s.id,pump:J(s)?A(r,s.pump).running:null,valve:o===null?null:s.valve?.inverted?100-o:o,cooling:s.kind==="cooling"||s.kind==="changeover"&&c!==null&&Number(c)===(s.cooling_value??1),flow:E(r,s.flow),return:E(r,s.return)}}),probes:(e.sensors??[]).map(s=>({level:s.level,value:E(r,s.entity)})),temperatures:[e.flow,e.return,e.circulation_temperature,e.hot_water].map(s=>E(r,s)),stations:t.type==="freshwater_station"?F(t).map(s=>({id:s.id,pump:A(r,s.pump).running,valve:O(s)?A(r,s.valve).percent:null,temperatures:[s.flow,s.return,s.cold_water,s.hot_water].map(o=>E(r,o))})):[],pump:A(r,e.pump).running,circulation:A(r,e.circulation).running}}var gt=y`
:host {
--nf-text: var(--primary-text-color, #e1e1e1);
--nf-muted: var(--secondary-text-color, #9b9b9b);
--nf-accent: var(--primary-color, #03a9f4);
--nf-accent-text: var(--text-primary-color, #ffffff);
--nf-surface: var(--ha-card-background, var(--card-background-color, #1c1c1c));
--nf-bg: var(--primary-background-color, #111111);
--nf-bg2: var(--secondary-background-color, #1c1c1c);
/* floating bars and cards over the 3D view: the card colour, a little see-through */
--nf-chrome: color-mix(in srgb, var(--nf-surface) var(--nf-chrome-mix, 84%), transparent);
--nf-chrome-solid: var(--nf-surface);
--nf-line: var(--divider-color, rgba(255, 255, 255, 0.12));
/* quiet fills for buttons and fields, and the tonal accent of an active control */
--nf-fill: color-mix(in srgb, var(--nf-text) 7%, transparent);
--nf-fill-strong: color-mix(in srgb, var(--nf-text) 13%, transparent);
--nf-tonal: color-mix(in srgb, var(--nf-accent) 20%, transparent);
--nf-soft: var(--info-color, #4a90e2);
--nf-warm: var(--state-light-active-color, #ffa726);
--nf-danger: var(--error-color, #db4437);
--nf-good: var(--success-color, #43a047);
--nf-radius: var(--ha-card-border-radius, 12px);
--nf-shadow: var(--ha-card-box-shadow, 0 1px 2px rgba(0, 0, 0, 0.18), 0 6px 20px rgba(0, 0, 0, 0.2));
--nf-font: var(--primary-font-family, Roboto, "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif);
--nf-title-font: var(--nf-font);
font-family: var(--nf-font);
color: var(--nf-text);
}
`,je=y`
:host([readable]) {
--secondary-text-color: var(--primary-text-color, #e1e1e1);
--divider-color: color-mix(in srgb, var(--primary-text-color, #e1e1e1) 40%, transparent);
--nf-chrome-mix: 97%;
}
:host([readable]) nf-room-panel,
:host([readable]) .nf-nav,
:host([readable]) .nf-overlay {
zoom: 1.2;
}
`,Be=y`
/* a group of switches: one rounded pill, the active one tinted with the accent */
.nf-seg {
display: inline-flex;
padding: 4px;
gap: 2px;
border-radius: 999px;
background: var(--nf-chrome);
box-shadow: var(--nf-shadow);
backdrop-filter: blur(10px);
}
.nf-seg button,
.nf-chip {
font: inherit;
font-size: 14px;
font-weight: 500;
border: none;
background: none;
color: var(--nf-muted);
padding: 7px 14px;
border-radius: 999px;
cursor: pointer;
white-space: nowrap;
min-height: 36px;
transition:
background 0.15s,
color 0.15s;
}
.nf-seg button:hover:not(:disabled),
.nf-chip:hover {
background: var(--nf-fill);
color: var(--nf-text);
}
/* on a small stage (a small window, a zoomed browser, a dashboard column) the switches at the bottom take less room */
@container nf ((max-width: 1360px) or (max-height: 640px)) {
:is(.nf-overlay, .nf-card-controls) .nf-seg {
padding: 3px;
}
:is(.nf-overlay, .nf-card-controls) :is(.nf-seg button, .nf-chip) {
font-size: 12.5px;
padding: 5px 10px;
}
}
.nf-time-slider {
display: inline-flex;
align-items: center;
padding: 4px 10px;
}
.nf-time-slider input {
width: 160px;
accent-color: var(--nf-accent);
}
.nf-seg button[aria-pressed="true"],
.nf-chip[aria-pressed="true"] {
background: color-mix(in srgb, var(--nf-accent) 24%, var(--nf-chrome-solid));
color: var(--nf-accent);
font-weight: 600;
}
.nf-seg button:disabled {
opacity: 0.4;
cursor: default;
}
/* a single pill, like the chips of the Mushroom cards */
.nf-chip {
background: var(--nf-chrome);
color: var(--nf-text);
box-shadow: var(--nf-shadow);
backdrop-filter: blur(10px);
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
outline: 2px solid var(--nf-accent);
outline-offset: 2px;
}
/* the round icon badge every row and card starts with */
.nf-ico {
display: inline-flex;
align-items: center;
justify-content: center;
flex: none;
width: 38px;
height: 38px;
border-radius: 50%;
background: var(--nf-tonal);
color: var(--nf-accent);
--mdc-icon-size: 20px;
}
.nf-ico.nf-warm {
background: color-mix(in srgb, var(--nf-warm) 22%, transparent);
color: var(--nf-warm);
}
.nf-ico.nf-off {
background: var(--nf-fill);
color: var(--nf-muted);
}
.nf-btn {
font: inherit;
font-size: 14px;
font-weight: 500;
border: none;
background: var(--nf-fill);
color: var(--nf-text);
border-radius: var(--nf-radius);
padding: 7px 14px;
cursor: pointer;
min-height: 36px;
transition: background 0.15s;
}
.nf-btn:hover {
background: var(--nf-fill-strong);
}
.nf-btn.nf-danger {
color: var(--nf-danger);
}
.nf-btn.nf-primary {
background: var(--nf-accent);
color: var(--nf-accent-text);
}
.nf-btn.nf-primary:hover {
background: color-mix(in srgb, var(--nf-accent) 88%, var(--nf-text));
}
.nf-field {
display: grid;
gap: 4px;
font-size: 12px;
color: var(--nf-muted);
}
.nf-field input,
.nf-field select,
.nf-field textarea {
font: inherit;
font-size: 14px;
color: var(--nf-text);
background: var(--nf-fill);
border: none;
border-bottom: 1px solid var(--nf-line);
border-radius: 10px 10px 4px 4px;
padding: 8px 10px;
min-width: 0;
}
.nf-field input:focus,
.nf-field select:focus,
.nf-field textarea:focus {
border-bottom-color: var(--nf-accent);
}
.nf-field input[type="range"] {
padding: 0;
accent-color: var(--nf-accent);
}
.nf-field select option {
background: var(--nf-chrome-solid);
color: var(--nf-text);
}
/* fingers need 40 px */
@media (pointer: coarse) {
.nf-seg button,
.nf-chip,
.nf-btn {
min-height: 40px;
}
}
`;function bt(r,t){let n=new Set;return t.flatMap(i=>{let e=String(r?.states[i]?.attributes.symcon_source_entity||i),s=r?.states[e]?.attributes,o=Number(s?.symcon_id);return!o||!s?.symcon_archive||n.has(o)?[]:(n.add(o),[e])})}var jt,yt=class extends v{static properties={hass:{attribute:!1},ids:{attribute:!1},label:{attribute:!1},busy:{state:!0},error:{state:!0}};constructor(){super(),this.ids=[],this.label="",this.busy=!1,this.error=""}async open(t){t.stopPropagation(),this.busy=!0,this.error="";try{let n=new URL("./nextfloor-trend.js?v=84417e0b2573",import.meta.url).href;await(await(jt??=import(n).catch(e=>{throw jt=void 0,e}))).openTrend(this.hass,this.ids,this.label)}catch(n){this.error=n instanceof Error?n.message:String(n)}finally{this.busy=!1}}render(){if(!bt(this.hass,this.ids).length)return a;let t=this.label?`Trend anzeigen: ${this.label}`:"Trend anzeigen";return d`<button type="button" title=${t} aria-label=${t} aria-haspopup="dialog" ?disabled=${this.busy} @pointerdown=${n=>n.stopPropagation()} @click=${n=>{this.open(n)}}>
<svg width="12" height="12" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M3 2v15h15M5 13l4-5 4 2 4-6"/></svg>
</button>${this.error?d`<span role="alert">${this.error}</span>`:a}`}static styles=y`:host{position:relative;display:inline-flex;flex:0 0 18px;width:18px;height:18px;vertical-align:middle;margin-left:3px;font-weight:normal;line-height:0}button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:18px;height:18px;padding:2px;border:0;border-radius:3px;background:transparent;color:var(--nf-accent,#40c8ff);opacity:.8;cursor:pointer}svg{display:block;flex-shrink:0}button:hover,button:focus-visible{opacity:1;background:#40c8ff18}button:focus-visible{outline:1px solid currentColor;outline-offset:1px}button:disabled{opacity:.4}span{position:absolute;right:0;top:22px;z-index:10;box-sizing:border-box;width:200px;padding:8px;border:1px solid #ff9b9b50;border-radius:6px;background:var(--nf-chrome-solid,#1c1c1c);font:12px/1.4 system-ui;color:#ff9b9b;white-space:normal}`};customElements.get("nf-trend-button")||customElements.define("nf-trend-button",yt);function D(r,t,n=""){let i=bt(r,t);return i.length?d`<nf-trend-button .hass=${r} .ids=${i} .label=${n}></nf-trend-button>`:a}var fe={heating_manifold:"Heiz-/K\xFChlkreisverteiler",buffer_tank:"Pufferspeicher",freshwater_station:"Frischwasserstation"},It=r=>r.name||fe[r.type],Kt=r=>r.name||{heating:"Heizkreis",cooling:"K\xFChlkreis",changeover:"Heizen / K\xFChlen",pump:"Vorschubpumpe"}[r.kind],Wt=(r,t)=>t.kind==="pump"?"Pumpenkreis":t.kind==="cooling"?"K\xFChlen":t.kind==="heating"?"Heizen":f(t.mode_entity)&&b(r.states[t.mode_entity])===null?"Betriebsart \u2013":Number(f(t.mode_entity)?b(r.states[t.mode_entity]):0)===(t.cooling_value??1)?"K\xFChlen":"Heizen",nt=(r,t,n)=>[m(r,"Vorlauf",t),m(r,"R\xFCcklauf",n)].filter(i=>i!==null),vt=(r,t,n)=>{let i=E(r,t),e=E(r,n);return i===null||e===null?a:d`<div class="reading delta"><span>ΔT · VL − RL</span><b>${(i-e).toLocaleString(r.language,{maximumFractionDigits:1})} K</b></div>`};function qt(r,t){let n=z(t),i=t.type==="freshwater_station"?[]:nt(r,n.flow,n.return);if(t.type==="buffer_tank"&&i.unshift(...[...n.sensors??[]].sort((e,s)=>s.level-e.level).flatMap(e=>{let s=m(r,e.name||"F\xFChler",e.entity);return s?[s]:[]})),t.type==="freshwater_station"){let e=m(r,"Zirkulation",n.circulation_temperature);e&&i.push(e)}for(let e of t.values??[]){let s=m(r,e.label||String(e.entity&&r.states[e.entity]?.attributes.friendly_name||"Wert"),e.entity);s&&i.push({...s,icon:e.icon})}return i}function Zt(r,t){return[...nt(r,t.flow,t.return),...[["Kaltwasser",t.cold_water],["Trinkwarmwasser",t.hot_water],["Pumpenleistung",t.power]].flatMap(([n,i])=>{let e=m(r,n,i);return e?[e]:[]})]}var xt=(r,t)=>`K${t+1} \xB7 ${r.name||`Station ${t+1}`}`,H=(r,t)=>d`<div class="reading" data-source=${t.id}><span>${t.icon?.startsWith("mdi:")?d`<ha-icon icon=${t.icon}></ha-icon>`:t.icon||a} ${t.label}</span><b>${t.text}${D(r,[t.id],t.label)}</b></div>`,P=(r,t,n="Status")=>{let i=m(r,n,t);return i?d`<div class="reading status-reading" data-source=${i.id}><span>${n}</span><b><span class="status-text" title=${i.text}>${i.text}</span>${D(r,[i.id],n)}</b></div>`:a};function V(r,t,n){let i=A(r,n);return i.id?d`<div class="reading" data-source=${i.id}><span>${t}<small>${i.feedback?"Ist":"Soll"}</small></span><b><i class="lamp" style=${`background:${i.running===null?"#888":i.running?"#6fe1a2":"#465361"}`}></i>${L(r.states[i.id])}${D(r,[i.id],t)}</b></div>`:a}var Jt=y`
:host{display:block;color:var(--nf-text);font:12px/1.4 system-ui,sans-serif;min-width:170px;max-width:300px}
button{font:inherit;color:inherit;background:var(--nf-fill,#ffffff10);border:1px solid var(--nf-line);border-radius:7px;padding:5px 8px;cursor:pointer}button:disabled,input:disabled{opacity:.45;cursor:default}button:focus-visible,input:focus-visible{outline:2px solid var(--nf-accent);outline-offset:2px}
.title{display:block;width:100%;padding:0 0 5px;border:0;background:none;font-weight:600;text-align:left;white-space:normal}.content{max-height:250px;overflow:auto;overscroll-behavior:contain}.circuit{border-top:1px solid var(--nf-line);padding:5px 0}.circuit-name{font-size:11px;font-weight:600;margin-bottom:3px}.reading{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;min-height:22px}.reading>span{color:var(--nf-muted);white-space:normal}.reading b{display:flex;align-items:center;justify-content:flex-end;white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:500}.reading small{font-size:9px;margin-left:5px;opacity:.75}.delta{font-size:10px}.lamp{display:inline-block;flex:none;width:6px;height:6px;border-radius:50%;margin-right:5px}.empty{color:var(--nf-muted);font-size:11px;white-space:normal;margin:5px 0}nf-trend-button{margin-left:3px}
.status-reading{grid-template-columns:auto minmax(0,1fr)}.status-reading b{min-width:0}.status-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.circuit-name small,h3 small{font-size:10px;color:var(--nf-muted);font-weight:normal;margin-left:5px}
ha-icon{--mdc-icon-size:13px;width:13px;height:13px;vertical-align:middle}
dialog{box-sizing:border-box;width:min(620px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);padding:0;color:var(--nf-text);background:var(--nf-chrome-solid,#1c1c1c);border:1px solid var(--nf-line);border-radius:14px;box-shadow:0 20px 70px #0008;font:13px/1.4 system-ui,sans-serif}dialog::backdrop{background:#050b16a6;backdrop-filter:blur(3px)}header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 18px;border-bottom:1px solid var(--nf-line)}h2{font-size:17px;margin:0}.body{padding:12px 18px;max-height:calc(100dvh - 120px);overflow:auto;overscroll-behavior:contain}h3{font-size:13px;margin:12px 0 7px}fieldset{min-width:0;margin:8px 0;padding:10px;border:1px solid var(--nf-line);border-radius:9px}legend{font-size:12px;color:var(--nf-muted)}.command{display:flex;align-items:center;gap:12px;margin-top:8px}.command input[type=range]{flex:1;min-width:0;accent-color:var(--nf-accent)}.command input[type=number]{width:90px;box-sizing:border-box;background:var(--nf-fill,#ffffff10);border:1px solid var(--nf-line);border-radius:6px;color:inherit;padding:5px}.command output{font-variant-numeric:tabular-nums;min-width:45px;text-align:right}.error{color:#ff9b9b}.readonly{color:var(--nf-muted);font-size:11px;margin:4px 0}.body .reading{padding:4px 0}.body .circuit{padding-bottom:12px}
`,$t=class extends v{static properties={hass:{attribute:!1},item:{attribute:!1},readOnly:{type:Boolean}};render(){if(!this.hass||!this.item)return a;let t=z(this.item),n=qt(this.hass,this.item),i=this.item.type==="freshwater_station"?F(this.item):[];return d`<button class="title" @click=${()=>Bt(this.hass,this.item,this.readOnly)} aria-haspopup="dialog">${It(this.item)} ⚙</button><div class="content">${P(this.hass,t.status,"Anlagenstatus")}
${this.item.type==="heating_manifold"?(t.circuits??[]).map(e=>d`<section class="circuit"><div class="circuit-name">${Kt(e)} <small>${Wt(this.hass,e)}</small></div>${P(this.hass,e.status)}${J(e)?V(this.hass,"Pumpe",e.pump):a}${X(e)?V(this.hass,"Ventil",e.valve):a}${nt(this.hass,e.flow,e.return).map(s=>H(this.hass,s))}${m(this.hass,"Leistung",e.power)?H(this.hass,m(this.hass,"Leistung",e.power)):a}</section>`):a}
${i.length>1?d`<small class="cascade-count">Kaskade · ${i.length} Stationen</small>${i.map((e,s)=>{let o=A(this.hass,e.pump),c=m(this.hass,"Trinkwarmwasser",e.hot_water)||m(this.hass,"Vorlauf",e.flow);return d`<div class="station-summary" data-station=${e.id}><button class="station-name" @click=${()=>Bt(this.hass,this.item,this.readOnly,e.id)}><i class="lamp" title=${`Pumpe: ${o.id?L(this.hass.states[o.id]):"\u2013"}`} style=${`background:${o.running===null?"#888":o.running?"#6fe1a2":"#a82638"}`}></i>${xt(e,s)}</button><b>${c?.text||"\u2013"}</b>${c?D(this.hass,[c.id],`${xt(e,s)} \xB7 ${c.label}`):a}${P(this.hass,e.status)}</div>`})}`:i.map(e=>d`<section class="circuit">${P(this.hass,e.status)}${Zt(this.hass,e).map(s=>H(this.hass,s))}${V(this.hass,"Ladepumpe",e.pump)}${O(e)?V(this.hass,"Kaskadenventil",e.valve):a}</section>`)}
${n.map(e=>H(this.hass,e))}${this.item.type==="freshwater_station"?V(this.hass,"Zirkulationspumpe",t.circulation):a}
${this.item.type!=="heating_manifold"&&this.item.type!=="freshwater_station"&&!n.length&&!f(t.status)?d`<p class="empty">Noch keine Fühler verknüpft</p>`:a}
</div>`}static styles=[gt,Jt,y`.cascade-count{color:var(--nf-muted)}.station-summary{display:grid;grid-template-columns:minmax(0,1fr) auto 18px;align-items:center;gap:6px;width:100%;padding:5px 0;font-size:11px}.station-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0;background:none;border:0;text-align:left}.station-summary>.status-reading{grid-column:1/-1}.station-summary b{white-space:nowrap;font-variant-numeric:tabular-nums}`]},_t=class extends v{static properties={hass:{attribute:!1},item:{attribute:!1},readOnly:{type:Boolean},focusStation:{attribute:!1},pending:{state:!0},error:{state:!0}};constructor(){super(),this.pending=new Set,this.error="",this.readOnly=!1}async show(){await this.updateComplete,this.shadowRoot.querySelector("dialog").showModal(),this.focusStation&&this.shadowRoot.querySelector(`[data-station="${CSS.escape(this.focusStation)}"]`)?.scrollIntoView({block:"start"})}async send(t,n){let i=this.hass.states[t];if(!(this.readOnly||!i?.attributes.symcon_has_action||b(i)===null||this.pending.has(t))){this.pending=new Set([...this.pending,t]),this.error="";try{await this.hass.callService("symcon","set_value",{entity_id:t,value:n})}catch(e){this.error=e instanceof Error?e.message:String(e)}finally{this.pending=new Set([...this.pending].filter(e=>e!==t))}}}control(t,n){if(!f(n?.command)&&!f(n?.feedback))return a;let i=f(n?.command)?n.command:null,e=i?this.hass.states[i]:void 0,s=e?.attributes,o=b(e),c=!!i&&!!s?.symcon_has_action&&o!==null&&!this.readOnly&&!this.pending.has(i),l=Number(s?.symcon_min??0),h=Number(s?.symcon_max??100),p=Number(s?.symcon_step||(s?.symcon_variable_type===1?1:.1)),u=U(e),g=$=>{let _=$.target;i&&_.value.trim()&&_.checkValidity()&&Number.isFinite(_.valueAsNumber)&&this.send(i,_.valueAsNumber)};return d`<fieldset data-control=${t}><legend>${t}</legend>${V(this.hass,t,n)}
${i?d`<div class="reading"><span>Befehl / Sollwert</span><b>${L(e)}${D(this.hass,[i],`${t} \xB7 Sollwert`)}</b></div>
${s?.symcon_variable_type===0?d`<div class="command"><button data-command=${i} ?disabled=${!c} @click=${()=>{this.send(i,!Y(e))}}>${Y(e)?"Ausschalten / Schlie\xDFen":"Einschalten / \xD6ffnen"}</button></div>`:[1,2].includes(Number(s?.symcon_variable_type))?d`<div class="command"><input type="range" aria-label=${`${t} Sollwert`} data-command=${i} min=${l} max=${h} step=${p} .value=${String(u??l)} ?disabled=${!c} @change=${g}/><input type="number" aria-label=${`${t} nativer Sollwert`} min=${l} max=${h} step=${p} .value=${u===null?"":String(u)} ?disabled=${!c} @change=${g}/></div>`:a}
${this.readOnly?d`<p class="readonly">Historische Ansicht · nur Anzeige</p>`:s?.symcon_has_action?a:d`<p class="readonly">Nur Anzeige · keine Symcon-Schaltaktion hinterlegt</p>`}`:a}
</fieldset>`}render(){if(!this.hass||!this.item)return a;let t=z(this.item),n=qt(this.hass,this.item),i=this.item.type==="freshwater_station"?F(this.item):[];return d`<dialog @close=${()=>{this.remove(),x===this&&(x=null)}} @keydown=${e=>e.stopPropagation()}><header><h2>${It(this.item)}</h2><button aria-label="Schließen" @click=${()=>this.shadowRoot.querySelector("dialog").close()}>×</button></header><div class="body">${P(this.hass,t.status,"Anlagenstatus")}
${this.item.type==="heating_manifold"?(t.circuits??[]).map(e=>d`<section class="circuit" data-circuit=${e.id}><h3>${Kt(e)} <small>${Wt(this.hass,e)}</small></h3>${P(this.hass,e.status)}${J(e)?this.control("Pumpe",e.pump):a}${X(e)?this.control("Ventil",e.valve):a}${nt(this.hass,e.flow,e.return).map(s=>H(this.hass,s))}${vt(this.hass,e.flow,e.return)}${m(this.hass,"Pumpenleistung",e.power)?H(this.hass,m(this.hass,"Pumpenleistung",e.power)):a}</section>`):a}
${i.map((e,s)=>d`<details class="freshwater-unit" data-station=${e.id} ?open=${s===0||this.focusStation===e.id}><summary>${xt(e,s)}</summary>${P(this.hass,e.status)}${Zt(this.hass,e).map(o=>H(this.hass,o))}${vt(this.hass,e.flow,e.return)}${this.control("Ladepumpe",e.pump)}${O(e)?this.control("Kaskadenventil",e.valve):a}</details>`)}
${n.map(e=>H(this.hass,e))}${this.item.type==="buffer_tank"?vt(this.hass,t.flow,t.return):a}
${this.item.type==="freshwater_station"?this.control("Zirkulationspumpe",t.circulation):a}
${!n.length&&!f(t.status)&&this.item.type!=="heating_manifold"&&this.item.type!=="freshwater_station"?d`<p class="empty">Die Fühler lassen sich im Editor über den Objektbaum zuweisen.</p>`:a}
${this.error?d`<p class="error" role="alert">${this.error}</p>`:a}
</div></dialog>`}static styles=[gt,Jt,y`:host{max-width:none;min-width:0}.freshwater-unit{border-bottom:1px solid var(--nf-line);padding:8px 0}.freshwater-unit>summary{cursor:pointer;font-weight:600;padding:4px 0}`]},x=null;function nn(){x?.remove(),x=null}async function Bt(r,t,n=!1,i){x?.remove();let e=document.createElement("nf-hydronic-dialog");x=e,Object.assign(e,{hass:r,item:t,readOnly:n,focusStation:i}),document.body.append(e),await e.show()}function rn(r,t,n=!1){if(!x)return;let i=t.floors.flatMap(e=>e.furniture).find(e=>e.id===x.item.id);if(!i||!Vt(i.type)){x.remove(),x=null;return}Object.assign(x,{hass:r,item:i,readOnly:n})}customElements.get("nf-hydronic-card")||customElements.define("nf-hydronic-card",$t);customElements.get("nf-hydronic-dialog")||customElements.define("nf-hydronic-dialog",_t);export{nn as closeHydronic,pe as hydronicVisual,Bt as openHydronic,rn as refreshHydronic};
/*! Bundled license information:
@lit/reactive-element/css-tag.js:
(**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
@lit/reactive-element/reactive-element.js:
lit-html/lit-html.js:
lit-element/lit-element.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
lit-html/is-server.js:
(**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
*/