/*! 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?"":t===3?"":"",o=I;for(let c=0;c"?(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?"":t===3?"":"")),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.length0){e.textContent=et?et.emptyScript:"";for(let $=0;$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{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`${this.error?d`${this.error}`: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``: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`
ΔT · VL − RL${(i-e).toLocaleString(r.language,{maximumFractionDigits:1})} K
`};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`
${t.icon?.startsWith("mdi:")?d``:t.icon||a} ${t.label}${t.text}${D(r,[t.id],t.label)}
`,P=(r,t,n="Status")=>{let i=m(r,n,t);return i?d`
${n}${i.text}${D(r,[i.id],n)}
`:a};function V(r,t,n){let i=A(r,n);return i.id?d`
${t}${i.feedback?"Ist":"Soll"}${L(r.states[i.id])}${D(r,[i.id],t)}
`: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`
${P(this.hass,t.status,"Anlagenstatus")} ${this.item.type==="heating_manifold"?(t.circuits??[]).map(e=>d`
${Kt(e)} ${Wt(this.hass,e)}
${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}
`):a} ${i.length>1?d`Kaskade · ${i.length} Stationen${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`
${c?.text||"\u2013"}${c?D(this.hass,[c.id],`${xt(e,s)} \xB7 ${c.label}`):a}${P(this.hass,e.status)}
`})}`:i.map(e=>d`
${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}
`)} ${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`

Noch keine Fühler verknüpft

`:a}
`}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`
${t}${V(this.hass,t,n)} ${i?d`
Befehl / Sollwert${L(e)}${D(this.hass,[i],`${t} \xB7 Sollwert`)}
${s?.symcon_variable_type===0?d`
`:[1,2].includes(Number(s?.symcon_variable_type))?d`
`:a} ${this.readOnly?d`

Historische Ansicht · nur Anzeige

`:s?.symcon_has_action?a:d`

Nur Anzeige · keine Symcon-Schaltaktion hinterlegt

`}`:a}
`}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`{this.remove(),x===this&&(x=null)}} @keydown=${e=>e.stopPropagation()}>

${It(this.item)}

${P(this.hass,t.status,"Anlagenstatus")} ${this.item.type==="heating_manifold"?(t.circuits??[]).map(e=>d`

${Kt(e)} ${Wt(this.hass,e)}

${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}
`):a} ${i.map((e,s)=>d`
${xt(e,s)}${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}
`)} ${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`

Die Fühler lassen sich im Editor über den Objektbaum zuweisen.

`:a} ${this.error?d``:a}
`}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 *) */