feat: add outdoor snapping, terrain types and procedural textures

This commit is contained in:
jhartworks committed 2026-11-16 13:02:18 +01:00
1 parent 992c3e18f2
commit d8cf076019
30 files changed
+2251 -1549

No files matched your search

+2
View File
@@ -6,6 +6,8 @@ All notable changes to NextFloor, newest first. Every release lists what is **Ad
### Added
- **Outdoor snapping and surface textures (Symcon 0.2.29):** Snap outdoor outlines to nearby corners and edges when drawing, moving or resizing, preserving whole-area geometry and Alt bypass. Add street, sidewalk, gravel, river and stream surfaces with schema persistence; river/stream areas default to cutting through surrounding surfaces. All outdoor materials use local metre-scaled procedural textures with distance filtering, including paving joints, asphalt grain, pebbles, vegetation, earth, wood and water ripples. Textures compose with floor fading, slopes, transparency and scene themes without external assets.
- **Fresh-water cascades with storage links (Symcon 0.2.28):** Rebuild the 3D station around separate primary and potable-water paths and a plate exchanger. Add up to 16 named parallel units with independent native temperature, power, pump and isolation-valve links; preserve legacy single-station bindings on edit. Share the supply/return, hot/cold-water and optional circulation headers, keep one compact cascade overlay, and open per-station readouts/commands with archive trends and existing read-only guards. Link a placed same-floor buffer through two primary-only pipes that follow placement and floor transforms; removal releases connections and subscriptions. Buffer colour layers interpolate measured probes only. Adding/removing units adjusts width and never sends device commands or invents parent utility totals.
- **Charging station telemetry (Symcon 0.2.25):** Built-in and pack wallboxes expose native object-tree links for SoC, start/end time, charging duration, charged energy and Integer lock status with unchanged Symcon associations. Optional floating cards and room readouts work without a power/switch link, hide unlinked rows, retain zero/live/offline values and offer archive trends. Time/duration formats support native display and explicit numeric units. All telemetry is read-only.
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -1,13 +1,13 @@
/*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */
var w={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",fr:"6312d0f61ebf",hu:"27ba348531dc",it:"1b705e76dd00",nb:"c5ea24fb9ef6",nl:"b64142c67c2e",pl:"8527a4930402",pt:"31857a2d2277",ro:"e3cb5f449f0f",sk:"320611594db0",sl:"8071691ceda3",sv:"711b911ec8da",tr:"7c83ce1c3372",zh:"50518d9f494e"};Array.prototype.at||Object.defineProperty(Array.prototype,"at",{configurable:!0,writable:!0,value:function(e){let t=Math.trunc(e)||0;return this[t<0?this.length+t:t]}});typeof globalThis.structuredClone!="function"&&(globalThis.structuredClone=n=>n===void 0?n:JSON.parse(JSON.stringify(n)));var Un=globalThis,jn=Un.ShadowRoot&&(Un.ShadyCSS===void 0||Un.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,fi=Symbol(),hs=new WeakMap,nn=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==fi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(jn&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=hs.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&hs.set(t,e))}return e}toString(){return this.cssText}},ms=n=>new nn(typeof n=="string"?n:n+"",void 0,fi),J=(n,...e)=>{let t=n.length===1?n[0]:e.reduce((r,i,o)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[o+1],n[0]);return new nn(t,n,fi)},ps=(n,e)=>{if(jn)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),i=Un.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=t.cssText,n.appendChild(r)}},gi=jn?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return ms(t)})(n):n;var{is:fd,defineProperty:gd,getOwnPropertyDescriptor:_d,getOwnPropertyNames:bd,getOwnPropertySymbols:vd,getPrototypeOf:yd}=Object,qn=globalThis,fs=qn.trustedTypes,wd=fs?fs.emptyScript:"",xd=qn.reactiveElementPolyfillSupport,rn=(n,e)=>n,_i={toAttribute(n,e){switch(e){case Boolean:n=n?wd:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},_s=(n,e)=>!fd(n,e),gs={attribute:!0,type:String,converter:_i,reflect:!1,useDefault:!1,hasChanged:_s};Symbol.metadata??=Symbol("metadata"),qn.litPropertyMetadata??=new WeakMap;var Le=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=gs){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),i=this.getPropertyDescriptor(e,r,t);i!==void 0&&gd(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){let{get:i,set:o}=_d(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:i,set(s){let a=i?.call(this);o?.call(this,s),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??gs}static _$Ei(){if(this.hasOwnProperty(rn("elementProperties")))return;let e=yd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(rn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(rn("properties"))){let t=this.properties,r=[...bd(t),...vd(t)];for(let i of r)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,i]of t)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let i=this._$Eu(t,r);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let i of r)t.unshift(gi(i))}else e!==void 0&&t.push(gi(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.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(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadLine truncated
\f\r]`,on=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ys=/-->/g,ws=/>/g,ct=RegExp(`>|${bi}(?:([^\\s"'>=/]+)(${bi}*=${bi}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),xs=/'/g,ks=/"/g,As=/^(?:script|style|textarea|title)$/i,Mi=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),p=Mi(1),ne=Mi(2),fg=Mi(3),mt=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Ss=new WeakMap,dt=ht.createTreeWalker(ht,129);function Es(n,e){if(!$i(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return vs!==void 0?vs.createHTML(e):e}var $d=(n,e)=>{let t=n.length-1,r=[],i,o=e===2?"<svg>":e===3?"<math>":"",s=on;for(let a=0;a<t;a++){let l=n[a],u,c,h=-1,m=0;for(;m<l.length&&(s.lastIndex=m,c=s.exec(l),c!==null);)m=s.lastIndex,s===on?c[1]==="!--"?s=ys:c[1]!==void 0?s=ws:c[2]!==void 0?(As.test(c[2])&&(i=RegExp("</"+c[2],"g")),s=ct):c[3]!==void 0&&(s=ct):s===ct?c[0]===">"?(s=i??on,h=-1):c[1]===void 0?h=-2:(h=s.lastIndex-c[2].length,u=c[1],s=c[3]===void 0?ct:c[3]==='"'?ks:xs):s===ks||s===xs?s=ct:s===ys||s===ws?s=on:(s=ct,i=void 0);let d=s===ct&&n[a+1].startsWith("/>")?" ":"";o+=s===on?l+kd:h>=0?(r.push(u),l.slice(0,h)+$s+l.slice(h)+tt+d):l+tt+(h===-2?a:d)}return[Es(n,o+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},ln=class n{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let o=0,s=0,a=e.length-1,l=this.parts,[u,c]=$d(e,t);if(this.el=n.createElement(u,r),dt.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=dt.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith($s)){let m=c[s++],d=i.getAttribute(h).split(tt),g=/([.?@])?(.*)/.exec(m);l.push({type:1,index:o,name:g[2],strings:d,ctor:g[1]==="."?yi:g[1]==="?"?wi:g[1]==="@"?xi:At}),i.removeAttribute(h)}else h.startsWith(tt)&&(l.push({type:6,index:o}),i.removeAttribute(h));if(As.test(i.tagName)){let h=i.textContent.split(tt),m=h.length-1;if(m>0){i.textContent=Zn?Zn.emptyScript:"";for(let d=0;d<m;d++)i.append(h[d],sn()),dt.nextNode(),l.push({type:2,index:++o});i.append(h[m],sn())}}}else if(i.nodeType===8)if(i.data===Ms)l.push({type:2,index:o});else{let h=-1;for(;(h=i.data.indexOf(tt,h+1))!==-1;)l.push({type:7,index:o}),h+=tt.length-1}o++}}static createElement(e,t){let r=ht.createElement("template");return r.innerHTML=e,r}};function Mt(n,e,t=n,r){if(e===mt)return e;let i=r!==void 0?t._$Co?.[r]:t._$Cl,o=an(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,t,r)),r!==void 0?(t._$Co??=[])[r]=i:t._$Cl=i),i!==void 0&&(e=Mt(n,i._$AS(n,e.values),i,r)),e}var vi=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,i=(e?.creationScope??ht).importNode(t,!0);dt.currentNode=i;let o=dt.nextNode(),s=0,a=0,l=r[0];for(;l!==void 0;){if(s===l.index){let u;l.type===2?u=new un(o,o.nextSibling,this,e):l.type===1?u=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(u=new ki(o,this,e)),this._$AV.push(u),l=r[++a]}s!==l?.index&&(o=dt.nextNode(),s++)}return dt.currentNode=ht,i}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},un=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Mt(this,e,t),an(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==mt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Sd(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==f&&an(this._$AH)?this._$AA.nextSibling.data=e:this.T(ht.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=ln.createElement(Es(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(t);else{let o=new vi(i,this),s=o.u(this.options);o.p(t),this.T(s),this._$AH=o}}_$AC(e){let t=Ss.get(e.strings);return t===void 0&&Ss.set(e.strings,t=new ln(e)),t}k(e){$i(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,i=0;for(let o of e)i===t.length?t.push(r=new n(this.O(sn()),this.O(sn()),this,this.options)):r=t[i],r._$AI(o),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=bs(e).nextSibling;bs(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},At=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,o){this.type=1,this._$AH=f,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this.Line truncated
\f\r"'\`<>=]|("|')|))|$)`,"g"),xs=/'/g,ks=/"/g,As=/^(?:script|style|textarea|title)$/i,Mi=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),p=Mi(1),ne=Mi(2),fg=Mi(3),mt=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Ss=new WeakMap,dt=ht.createTreeWalker(ht,129);function Es(n,e){if(!$i(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return vs!==void 0?vs.createHTML(e):e}var $d=(n,e)=>{let t=n.length-1,r=[],i,o=e===2?"<svg>":e===3?"<math>":"",s=on;for(let a=0;a<t;a++){let l=n[a],u,c,h=-1,m=0;for(;m<l.length&&(s.lastIndex=m,c=s.exec(l),c!==null);)m=s.lastIndex,s===on?c[1]==="!--"?s=ys:c[1]!==void 0?s=ws:c[2]!==void 0?(As.test(c[2])&&(i=RegExp("</"+c[2],"g")),s=ct):c[3]!==void 0&&(s=ct):s===ct?c[0]===">"?(s=i??on,h=-1):c[1]===void 0?h=-2:(h=s.lastIndex-c[2].length,u=c[1],s=c[3]===void 0?ct:c[3]==='"'?ks:xs):s===ks||s===xs?s=ct:s===ys||s===ws?s=on:(s=ct,i=void 0);let d=s===ct&&n[a+1].startsWith("/>")?" ":"";o+=s===on?l+kd:h>=0?(r.push(u),l.slice(0,h)+$s+l.slice(h)+tt+d):l+tt+(h===-2?a:d)}return[Es(n,o+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},ln=class n{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let o=0,s=0,a=e.length-1,l=this.parts,[u,c]=$d(e,t);if(this.el=n.createElement(u,r),dt.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=dt.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith($s)){let m=c[s++],d=i.getAttribute(h).split(tt),g=/([.?@])?(.*)/.exec(m);l.push({type:1,index:o,name:g[2],strings:d,ctor:g[1]==="."?yi:g[1]==="?"?wi:g[1]==="@"?xi:At}),i.removeAttribute(h)}else h.startsWith(tt)&&(l.push({type:6,index:o}),i.removeAttribute(h));if(As.test(i.tagName)){let h=i.textContent.split(tt),m=h.length-1;if(m>0){i.textContent=Zn?Zn.emptyScript:"";for(let d=0;d<m;d++)i.append(h[d],sn()),dt.nextNode(),l.push({type:2,index:++o});i.append(h[m],sn())}}}else if(i.nodeType===8)if(i.data===Ms)l.push({type:2,index:o});else{let h=-1;for(;(h=i.data.indexOf(tt,h+1))!==-1;)l.push({type:7,index:o}),h+=tt.length-1}o++}}static createElement(e,t){let r=ht.createElement("template");return r.innerHTML=e,r}};function Mt(n,e,t=n,r){if(e===mt)return e;let i=r!==void 0?t._$Co?.[r]:t._$Cl,o=an(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,t,r)),r!==void 0?(t._$Co??=[])[r]=i:t._$Cl=i),i!==void 0&&(e=Mt(n,i._$AS(n,e.values),i,r)),e}var vi=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,i=(e?.creationScope??ht).importNode(t,!0);dt.currentNode=i;let o=dt.nextNode(),s=0,a=0,l=r[0];for(;l!==void 0;){if(s===l.index){let u;l.type===2?u=new un(o,o.nextSibling,this,e):l.type===1?u=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(u=new ki(o,this,e)),this._$AV.push(u),l=r[++a]}s!==l?.index&&(o=dt.nextNode(),s++)}return dt.currentNode=ht,i}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},un=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Mt(this,e,t),an(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==mt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Sd(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==f&&an(this._$AH)?this._$AA.nextSibling.data=e:this.T(ht.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=ln.createElement(Es(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(t);else{let o=new vi(i,this),s=o.u(this.options);o.p(t),this.T(s),this._$AH=o}}_$AC(e){let t=Ss.get(e.strings);return t===void 0&&Ss.set(e.strings,t=new ln(e)),t}k(e){$i(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,i=0;for(let o of e)i===t.length?t.push(r=new n(this.O(sn()),this.O(sn()),this,this.options)):r=t[i],r._$AI(o),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=bs(e).nextSibling;bs(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},At=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,o){this.type=1,this._$AH=f,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this.Line truncated
Ein Plugin l\xE4uft mit denselben Rechten wie NextFloor in deinem Browser. Die Datei wurde gepr\xFCft, ihr Inhalt ist festgelegt:
{url}`,manual:"Anleitung",manual_more:"Mehr erfahren",feature_text_energy:"Energieteilchen fliegen in B\xF6gen von den Solarfeldern zum Wechselrichter, zwischen Haus, Akku, Netz und Verbrauchern \u2013 schneller und dichter, je mehr Strom flie\xDFt. Die Module funkeln mit ihrer Produktion, eine Glaskarte \xFCber dem Dach zeigt die Bilanz und wie autark das Haus gerade ist.",live_autarky:"autark",live_fold:"Karte verkleinern",live_unfold:"Karte aufklappen",live_day_hint:"Die letzten 24 Stunden: Solar (Fl\xE4che) und Verbrauch (Linie)",live_week_hint:"Die letzten 7 Tage: Sonne {solar} kWh, Verbrauch {use} kWh (gelb: Sonne, hell: Verbrauch)",live_days:"Tage",live_car_away:"Unterwegs",live_car_charging:"L\xE4dt",live_car_plugged:"Eingesteckt",live_car_lock:"Verriegeln",live_car_unlock:"Entriegeln",live_car_unlock_confirm:"{name} wirklich entriegeln?",live_car_climate:"Klimatisierung",live_car_charge:"Laden starten/stoppen",live_media_prev:"Zur\xFCck",live_media_playpause:"Abspielen/Pause",live_media_next:"Weiter",live_media_volume:"Lautst\xE4rke",live_car_device:"Auto (eine Entit\xE4t des Autos)",live_car_device_hint:"Ladestand, Reichweite, Laden, Stecker, Schloss und Klima findet NextFloor selbst am Ger\xE4t des Autos. Ohne Angabe nimmt es den Anwesenheitssensor des Stellplatzes.",live_car_departure_entity:"Abfahrtszeit (optional)",live_car_departure:"Abfahrt {time}",live_car_open:"Offen: {parts}",printer_printing:"druckt",printer_done:"fertig",printer_paused:"pausiert",printer_error:"Fehler",printer_idle:"bereit",printer_done_at:"fertig um {time}",printer_layer:"Schicht",printer_nozzle:"D\xFCse",printer_bed:"Bett",heatpump_heating:"heizt",heatpump_water:"macht Warmwasser",heatpump_cooling:"k\xFChlt",heatpump_defrost:"taut ab",heatpump_idle:"in Ruhe",heatpump_flow_return:"Vor- \u2192 R\xFCcklauf",heatpump_heat:"W\xE4rme",heatpump_power:"Strom",heatpump_outside:"au\xDFen",pack_missing_item:"M\xF6bel aus entferntem Pack",back_to_room:"Zur\xFCck zu {room}",back_to_floor:"Zur\xFCck zur Etage",hint_furniture:"Raum antippen, dann rechts ein M\xF6belst\xFCck w\xE4hlen \xB7 M\xF6bel ziehen, an den Ecken die Gr\xF6\xDFe \xE4ndern",furniture_into:"Neue M\xF6bel kommen in die Mitte von \u201E{room}\u201C.",furniture_pick_room:"Tipp: Erst einen Raum antippen \u2013 dann landen neue M\xF6bel in seiner Mitte.",flows:"Stromfluss",flows_hint:"Energieb\xF6gen zwischen Solarfeldern, Wechselrichter, Akku, Netz und Verbrauchern ein- oder ausblenden",chk_title:"Einrichtung",chk_hint:"Was der Energiefluss braucht. Antippen springt an die Stelle.",chk_solar:"Solarfeld angelegt",chk_solar_add:"Ein Solarfeld aufs Dach legen",chk_meter:"Stromz\xE4hler mit Netzsensor",chk_meter_sensor:"Stromz\xE4hler: Netzsensor (W) fehlt",chk_meter_add:"Stromz\xE4hler anlegen",chk_inverter:"Wechselrichter mit Leistungssensor",chk_inverter_sensor:"Wechselrichter: Leistungssensor fehlt",chk_inverter_add:"Wechselrichter anlegen",chk_battery:"Stromspeicher mit Leistung und Ladestand",chk_battery_sensor:"Stromspeicher: Leistung oder Ladestand fehlt",chk_battery_opt:"Stromspeicher (optional)",chk_grid:"Netzanschluss gesetzt",chk_grid_opt:"Netzanschluss (optional, sonst automatisch)",energy_sign_grid:"Das Haus zeigt Einspeisung, obwohl die Sonne nichts liefert. Der Netzsensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_battery:"Der Speicher l\xE4dt ohne Sonne und ohne Netzbezug. Sein Sensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_flip:"Vorzeichen umkehren",help_title:"Hilfe und R\xFCckmeldung",help_hint:"Fehler bitte als Issue auf GitHub, W\xFCnsche als Diskussion \u2013 so geht nichts verloren, und alle sehen den Stand.",help_issue:"Problem melden",help_idea:"Idee vorschlagen",furn_name:"Name (optional)",furn_mirror:"Spiegeln",furn_mirror_hint:"Links und rechts vertauschen \u2013 das L-Sofa andersherum, der Schrank mit der T\xFCr auf der anderen Seite, die K\xFCchenzeile gespiegelt.",hint_opening:"Auf eine Wand tippen, um eine T\xFCr oder ein Fenster einzusetzen \u2013 die Art w\xE4hlst du danach rechts",preset_door:"T\xFCr",preset_door_double:"Doppelt\xFCr",preset_window:"Fenster",preset_window_double:"Fenster 2-fl\xFCgelig",preset_terrace:"Terrassent\xFCr",preset_terrace_double:"Terrassent\xFCr 2-fl\xFCgelig",preset_lift_slide:"Hebe-Schiebet\xFCr",preset_garage:"Garagentor",preset_front:"Haust\xFCr",opening_style:"Stil",sidelight_auto:"automatisch",sidelight_hinge:"Seitenteil an der Anschlagseite",sidelight_hinge_hint:"Das Seitenteil sitzt sonst gegen\xFCber dem Anschlag; mit Haken neben den B\xE4ndern.",sidelight_width:"Breite Seitenteil (m)",sidelight_width_left:"Seitenteil links (m)",sidelight_width_right:"Seitenteil rechts (m)",style_auto:"Automatisch ({style})",style_interior:"Zimmert\xFCr",style_front:"Haust\xFCr",style_front_glass:"Haust\xFCr mit Glasausschnitt",style_sidelight:"Haust\xFCr mit Seitenteil",style_sidelights:"Haust\xFCr mit 2 Seitenteilen",style_glass:"Glast\xFCr",style_sliding:"Schiebet\xFCr",style_p Line truncated
{url}`,manual:"Anleitung",manual_more:"Mehr erfahren",feature_text_energy:"Energieteilchen fliegen in B\xF6gen von den Solarfeldern zum Wechselrichter, zwischen Haus, Akku, Netz und Verbrauchern \u2013 schneller und dichter, je mehr Strom flie\xDFt. Die Module funkeln mit ihrer Produktion, eine Glaskarte \xFCber dem Dach zeigt die Bilanz und wie autark das Haus gerade ist.",live_autarky:"autark",live_fold:"Karte verkleinern",live_unfold:"Karte aufklappen",live_day_hint:"Die letzten 24 Stunden: Solar (Fl\xE4che) und Verbrauch (Linie)",live_week_hint:"Die letzten 7 Tage: Sonne {solar} kWh, Verbrauch {use} kWh (gelb: Sonne, hell: Verbrauch)",live_days:"Tage",live_car_away:"Unterwegs",live_car_charging:"L\xE4dt",live_car_plugged:"Eingesteckt",live_car_lock:"Verriegeln",live_car_unlock:"Entriegeln",live_car_unlock_confirm:"{name} wirklich entriegeln?",live_car_climate:"Klimatisierung",live_car_charge:"Laden starten/stoppen",live_media_prev:"Zur\xFCck",live_media_playpause:"Abspielen/Pause",live_media_next:"Weiter",live_media_volume:"Lautst\xE4rke",live_car_device:"Auto (eine Entit\xE4t des Autos)",live_car_device_hint:"Ladestand, Reichweite, Laden, Stecker, Schloss und Klima findet NextFloor selbst am Ger\xE4t des Autos. Ohne Angabe nimmt es den Anwesenheitssensor des Stellplatzes.",live_car_departure_entity:"Abfahrtszeit (optional)",live_car_departure:"Abfahrt {time}",live_car_open:"Offen: {parts}",printer_printing:"druckt",printer_done:"fertig",printer_paused:"pausiert",printer_error:"Fehler",printer_idle:"bereit",printer_done_at:"fertig um {time}",printer_layer:"Schicht",printer_nozzle:"D\xFCse",printer_bed:"Bett",heatpump_heating:"heizt",heatpump_water:"macht Warmwasser",heatpump_cooling:"k\xFChlt",heatpump_defrost:"taut ab",heatpump_idle:"in Ruhe",heatpump_flow_return:"Vor- \u2192 R\xFCcklauf",heatpump_heat:"W\xE4rme",heatpump_power:"Strom",heatpump_outside:"au\xDFen",pack_missing_item:"M\xF6bel aus entferntem Pack",back_to_room:"Zur\xFCck zu {room}",back_to_floor:"Zur\xFCck zur Etage",hint_furniture:"Raum antippen, dann rechts ein M\xF6belst\xFCck w\xE4hlen \xB7 M\xF6bel ziehen, an den Ecken die Gr\xF6\xDFe \xE4ndern",furniture_into:"Neue M\xF6bel kommen in die Mitte von \u201E{room}\u201C.",furniture_pick_room:"Tipp: Erst einen Raum antippen \u2013 dann landen neue M\xF6bel in seiner Mitte.",flows:"Stromfluss",flows_hint:"Energieb\xF6gen zwischen Solarfeldern, Wechselrichter, Akku, Netz und Verbrauchern ein- oder ausblenden",chk_title:"Einrichtung",chk_hint:"Was der Energiefluss braucht. Antippen springt an die Stelle.",chk_solar:"Solarfeld angelegt",chk_solar_add:"Ein Solarfeld aufs Dach legen",chk_meter:"Stromz\xE4hler mit Netzsensor",chk_meter_sensor:"Stromz\xE4hler: Netzsensor (W) fehlt",chk_meter_add:"Stromz\xE4hler anlegen",chk_inverter:"Wechselrichter mit Leistungssensor",chk_inverter_sensor:"Wechselrichter: Leistungssensor fehlt",chk_inverter_add:"Wechselrichter anlegen",chk_battery:"Stromspeicher mit Leistung und Ladestand",chk_battery_sensor:"Stromspeicher: Leistung oder Ladestand fehlt",chk_battery_opt:"Stromspeicher (optional)",chk_grid:"Netzanschluss gesetzt",chk_grid_opt:"Netzanschluss (optional, sonst automatisch)",energy_sign_grid:"Das Haus zeigt Einspeisung, obwohl die Sonne nichts liefert. Der Netzsensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_battery:"Der Speicher l\xE4dt ohne Sonne und ohne Netzbezug. Sein Sensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_flip:"Vorzeichen umkehren",help_title:"Hilfe und R\xFCckmeldung",help_hint:"Fehler bitte als Issue auf GitHub, W\xFCnsche als Diskussion \u2013 so geht nichts verloren, und alle sehen den Stand.",help_issue:"Problem melden",help_idea:"Idee vorschlagen",furn_name:"Name (optional)",furn_mirror:"Spiegeln",furn_mirror_hint:"Links und rechts vertauschen \u2013 das L-Sofa andersherum, der Schrank mit der T\xFCr auf der anderen Seite, die K\xFCchenzeile gespiegelt.",hint_opening:"Auf eine Wand tippen, um eine T\xFCr oder ein Fenster einzusetzen \u2013 die Art w\xE4hlst du danach rechts",preset_door:"T\xFCr",preset_door_double:"Doppelt\xFCr",preset_window:"Fenster",preset_window_double:"Fenster 2-fl\xFCgelig",preset_terrace:"Terrassent\xFCr",preset_terrace_double:"Terrassent\xFCr 2-fl\xFCgelig",preset_lift_slide:"Hebe-Schiebet\xFCr",preset_garage:"Garagentor",preset_front:"Haust\xFCr",opening_style:"Stil",sidelight_auto:"automatisch",sidelight_hinge:"Seitenteil an der Anschlagseite",sidelight_hinge_hint:"Das Seitenteil sitzt sonst gegen\xFCber dem Anschlag; mit Haken neben den B\xE4ndern.",sidelight_width:"Breite Seitenteil (m)",sidelight_width_left:"Seitenteil links (m)",sidelight_width_right:"Seitenteil rechts (m)",style_auto:"Automatisch ({style})",style_interior:"Zimmert\xFCr",style_front:"Haust\xFCr",style_front_glass:"Haust\xFCr mit Glasausschnitt",style_sidelight:"Haust\xFCr mit Seitenteil",style_sidelights:"Haust\xFCr mit 2 Seitenteilen",style_glass:"Glast\xFCr",style_sliding:"Schiebet\xFCr",style_p Line truncated
A plugin runs with the same rights as NextFloor in your browser. The file has been reviewed and its content is fixed:
{url}`,manual:"Manual",manual_more:"Learn more",feature_text_energy:"Energy particles fly in arcs from the solar fields to the inverter, between house, battery, grid and consumers \u2013 faster and denser the more power flows. The modules sparkle with their production, a glass card over the roof shows the balance and how self-sufficient the house is right now.",live_autarky:"self-sufficient",live_fold:"Make the card small",live_unfold:"Open the card",live_day_hint:"The last 24 hours: solar (area) and consumption (line)",live_week_hint:"The last 7 days: sun {solar} kWh, use {use} kWh (yellow: sun, light: use)",live_days:"days",live_car_away:"On the road",live_car_charging:"Charging",live_car_plugged:"Plugged in",live_car_lock:"Lock",live_car_unlock:"Unlock",live_car_unlock_confirm:"Really unlock {name}?",live_car_climate:"Climate",live_car_charge:"Start/stop charging",live_media_prev:"Previous",live_media_playpause:"Play/pause",live_media_next:"Next",live_media_volume:"Volume",live_car_device:"Car (any entity of the car)",live_car_device_hint:"Charge, range, charging, plug, lock and climate are found by NextFloor on the car's device. Without one it takes the spot's presence sensor.",live_car_departure_entity:"Departure time (optional)",live_car_departure:"Departs {time}",live_car_open:"Open: {parts}",printer_printing:"printing",printer_done:"done",printer_paused:"paused",printer_error:"error",printer_idle:"idle",printer_done_at:"done at {time}",printer_layer:"Layer",printer_nozzle:"Nozzle",printer_bed:"Bed",heatpump_heating:"heating",heatpump_water:"making hot water",heatpump_cooling:"cooling",heatpump_defrost:"defrosting",heatpump_idle:"resting",heatpump_flow_return:"Flow \u2192 return",heatpump_heat:"Heat",heatpump_power:"Power",heatpump_outside:"outside",pack_missing_item:"Furniture of a removed pack",back_to_room:"Back to {room}",back_to_floor:"Back to the floor",hint_furniture:"Tap a room, then pick an item on the right \xB7 drag items, resize them by their corners",furniture_into:"New items go into the middle of \u201C{room}\u201D.",furniture_pick_room:"Tip: tap a room first \u2013 new items then land in its middle.",flows:"Power flow",flows_hint:"Show or hide the energy arcs between solar fields, inverter, battery, grid and consumers",chk_title:"Setup",chk_hint:"What the energy flow needs. Tap a row to jump there.",chk_solar:"Solar field in place",chk_solar_add:"Put a solar field on the roof",chk_meter:"Meter with grid sensor",chk_meter_sensor:"Meter: grid sensor (W) missing",chk_meter_add:"Add the meter",chk_inverter:"Inverter with power sensor",chk_inverter_sensor:"Inverter: power sensor missing",chk_inverter_add:"Add an inverter",chk_battery:"Home battery with power and charge",chk_battery_sensor:"Home battery: power or charge missing",chk_battery_opt:"Home battery (optional)",chk_grid:"Grid connection set",chk_grid_opt:"Grid connection (optional, else automatic)",energy_sign_grid:"The house shows export while the sun produces nothing. The grid sensor probably has its sign reversed.",energy_sign_battery:"The battery charges with no sun and no grid draw. Its sensor probably has its sign reversed.",energy_sign_flip:"Flip the sign",help_title:"Help and feedback",help_hint:"Please report problems as a GitHub issue and wishes as a discussion \u2013 nothing gets lost, and everyone sees the state.",help_issue:"Report a problem",help_idea:"Propose an idea",furn_name:"Name (optional)",furn_mirror:"Mirror",furn_mirror_hint:"Swap left and right \u2013 the L-sofa the other way round, the cabinet with its door on the other side, the kitchen run mirrored.",hint_opening:"Tap a wall to add a door or window \u2013 choose its kind on the right afterwards",preset_door:"Door",preset_door_double:"Double door",preset_window:"Window",preset_window_double:"Double window",preset_terrace:"Terrace door",preset_terrace_double:"French doors",preset_lift_slide:"Lift-and-slide door",preset_garage:"Garage door",preset_front:"Front door",opening_style:"Style",sidelight_auto:"automatic",sidelight_hinge:"Sidelight on the hinge side",sidelight_hinge_hint:"The sidelight sits opposite the hinge otherwise; ticked, it sits next to the hinges.",sidelight_width:"Sidelight width (m)",sidelight_width_left:"Left sidelight (m)",sidelight_width_right:"Right sidelight (m)",style_auto:"Automatic ({style})",style_interior:"Room door",style_front:"Front door",style_front_glass:"Front door with glass",style_sidelight:"Front door with sidelight",style_sidelights:"Front door with two sidelights",style_glass:"Glass door",style_sliding:"Sliding door",style_passage:"Opening (no door)",style_standard:"Standard",style_bars:"With glazing bars",style_glass_wall:"Glass wall (fixed)",preset_glass_wall:"Glass wall",glass_panes:"Panes",glass_panes_auto:"automatic (about 0.9 m)",glass_panes_hint:"0 = one single pane without mullions, empty = about every 0.9 m",flip_hinge:"Swap hinge side",flip_main_leaf:"Swap main leaf",flip_hinge_hint:"Hinges to the other side" Line truncated
{url}`,manual:"Manual",manual_more:"Learn more",feature_text_energy:"Energy particles fly in arcs from the solar fields to the inverter, between house, battery, grid and consumers \u2013 faster and denser the more power flows. The modules sparkle with their production, a glass card over the roof shows the balance and how self-sufficient the house is right now.",live_autarky:"self-sufficient",live_fold:"Make the card small",live_unfold:"Open the card",live_day_hint:"The last 24 hours: solar (area) and consumption (line)",live_week_hint:"The last 7 days: sun {solar} kWh, use {use} kWh (yellow: sun, light: use)",live_days:"days",live_car_away:"On the road",live_car_charging:"Charging",live_car_plugged:"Plugged in",live_car_lock:"Lock",live_car_unlock:"Unlock",live_car_unlock_confirm:"Really unlock {name}?",live_car_climate:"Climate",live_car_charge:"Start/stop charging",live_media_prev:"Previous",live_media_playpause:"Play/pause",live_media_next:"Next",live_media_volume:"Volume",live_car_device:"Car (any entity of the car)",live_car_device_hint:"Charge, range, charging, plug, lock and climate are found by NextFloor on the car's device. Without one it takes the spot's presence sensor.",live_car_departure_entity:"Departure time (optional)",live_car_departure:"Departs {time}",live_car_open:"Open: {parts}",printer_printing:"printing",printer_done:"done",printer_paused:"paused",printer_error:"error",printer_idle:"idle",printer_done_at:"done at {time}",printer_layer:"Layer",printer_nozzle:"Nozzle",printer_bed:"Bed",heatpump_heating:"heating",heatpump_water:"making hot water",heatpump_cooling:"cooling",heatpump_defrost:"defrosting",heatpump_idle:"resting",heatpump_flow_return:"Flow \u2192 return",heatpump_heat:"Heat",heatpump_power:"Power",heatpump_outside:"outside",pack_missing_item:"Furniture of a removed pack",back_to_room:"Back to {room}",back_to_floor:"Back to the floor",hint_furniture:"Tap a room, then pick an item on the right \xB7 drag items, resize them by their corners",furniture_into:"New items go into the middle of \u201C{room}\u201D.",furniture_pick_room:"Tip: tap a room first \u2013 new items then land in its middle.",flows:"Power flow",flows_hint:"Show or hide the energy arcs between solar fields, inverter, battery, grid and consumers",chk_title:"Setup",chk_hint:"What the energy flow needs. Tap a row to jump there.",chk_solar:"Solar field in place",chk_solar_add:"Put a solar field on the roof",chk_meter:"Meter with grid sensor",chk_meter_sensor:"Meter: grid sensor (W) missing",chk_meter_add:"Add the meter",chk_inverter:"Inverter with power sensor",chk_inverter_sensor:"Inverter: power sensor missing",chk_inverter_add:"Add an inverter",chk_battery:"Home battery with power and charge",chk_battery_sensor:"Home battery: power or charge missing",chk_battery_opt:"Home battery (optional)",chk_grid:"Grid connection set",chk_grid_opt:"Grid connection (optional, else automatic)",energy_sign_grid:"The house shows export while the sun produces nothing. The grid sensor probably has its sign reversed.",energy_sign_battery:"The battery charges with no sun and no grid draw. Its sensor probably has its sign reversed.",energy_sign_flip:"Flip the sign",help_title:"Help and feedback",help_hint:"Please report problems as a GitHub issue and wishes as a discussion \u2013 nothing gets lost, and everyone sees the state.",help_issue:"Report a problem",help_idea:"Propose an idea",furn_name:"Name (optional)",furn_mirror:"Mirror",furn_mirror_hint:"Swap left and right \u2013 the L-sofa the other way round, the cabinet with its door on the other side, the kitchen run mirrored.",hint_opening:"Tap a wall to add a door or window \u2013 choose its kind on the right afterwards",preset_door:"Door",preset_door_double:"Double door",preset_window:"Window",preset_window_double:"Double window",preset_terrace:"Terrace door",preset_terrace_double:"French doors",preset_lift_slide:"Lift-and-slide door",preset_garage:"Garage door",preset_front:"Front door",opening_style:"Style",sidelight_auto:"automatic",sidelight_hinge:"Sidelight on the hinge side",sidelight_hinge_hint:"The sidelight sits opposite the hinge otherwise; ticked, it sits next to the hinges.",sidelight_width:"Sidelight width (m)",sidelight_width_left:"Left sidelight (m)",sidelight_width_right:"Right sidelight (m)",style_auto:"Automatic ({style})",style_interior:"Room door",style_front:"Front door",style_front_glass:"Front door with glass",style_sidelight:"Front door with sidelight",style_sidelights:"Front door with two sidelights",style_glass:"Glass door",style_sliding:"Sliding door",style_passage:"Opening (no door)",style_standard:"Standard",style_bars:"With glazing bars",style_glass_wall:"Glass wall (fixed)",preset_glass_wall:"Glass wall",glass_panes:"Panes",glass_panes_auto:"automatic (about 0.9 m)",glass_panes_hint:"0 = one single pane without mullions, empty = about every 0.9 m",flip_hinge:"Swap hinge side",flip_main_leaf:"Swap main leaf",flip_hinge_hint:"Hinges to the other side" Line truncated
:host {
--nf-text: var(--primary-text-color, #e1e1e1);
--nf-muted: var(--secondary-text-color, #9b9b9b);
@@ -211,7 +211,7 @@ A plugin runs with the same rights as NextFloor in your browser. The file has be
}
`;function Tr(n){return n?.themes?.darkMode===!1?"light":"dark"}function vn(n,e){let t=new Set;return e.flatMap(r=>{let i=String(n?.states[r]?.attributes.symcon_source_entity||r),o=n?.states[i]?.attributes,s=Number(o?.symcon_id);return!s||!o?.symcon_archive||t.has(s)?[]:(t.add(s),[i])})}var ml,oo=class extends Q{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(e){e.stopPropagation(),this.busy=!0,this.error="";try{let t=new URL("./nextfloor-trend.js?v=84417e0b2573",import.meta.url).href;await(await(ml??=import(t).catch(i=>{throw ml=void 0,i}))).openTrend(this.hass,this.ids,this.label)}catch(t){this.error=t instanceof Error?t.message:String(t)}finally{this.busy=!1}}render(){if(!vn(this.hass,this.ids).length)return f;let e=this.label?`Trend anzeigen: ${this.label}`:"Trend anzeigen";return p`<button type="button" title=${e} aria-label=${e} aria-haspopup="dialog" ?disabled=${this.busy} @pointerdown=${t=>t.stopPropagation()} @click=${t=>{this.open(t)}}>
<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?p`<span role="alert">${this.error}</span>`:f}`}static styles=J`: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",oo);function G(n,e,t=""){let r=vn(n,e);return r.length?p`<nf-trend-button .hass=${n} .ids=${r} .label=${t}></nf-trend-button>`:f}var so=class extends Q{static properties={hass:{attribute:!1},room:{attribute:!1},_pending:{state:!0},_error:{state:!0}};constructor(){super(),this._pending=new Set,this._error=""}async send(e,t,r,i){this._pending=new Set([...this._pending,e]),this._error="";try{await this.hass.callService(t,r,{entity_id:e,...i})}catch(o){this._error=o instanceof Error?o.message:String(o)}finally{this._pending=new Set([...this._pending].filter(o=>o!==e))}}value(e,t,r){let i=this.hass.states[t],o=fe(i),s=i?.attributes,a=r&&!!s?.symcon_has_action&&o!==null&&!this._pending.has(t);return p`<div class="value"><span>${e}</span><b>${Fe(i)}${G(this.hass,[t],e)}</b>
</button>${this.error?p`<span role="alert">${this.error}</span>`:f}`}static styles=J`: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",oo);function G(n,e,t=""){let r=vn(n,e);return r.length?p`<nf-trend-button .hass=${n} .ids=${r} .label=${t}></nf-trend-button>`:f}var so=class extends Q{static properties={hass:{attribute:!1},room:{attribute:!1},_pending:{state:!0},_error:{state:!0}};constructor(){super(),this._pending=new Set,this._error=""}async send(e,t,r,i){this._pending=new Set([...this._pending,e]),this._error="";try{await this.hass.callService(t,r,{entity_id:e,...i})}catch(o){this._error=o instanceof Error?o.message:String(o)}finally{this._pending=new Set([...this._pending].filter(o=>o!==e))}}value(e,t,r){let i=this.hass.states[t],o=fe(i),s=i?.attributes,a=r&&!!s?.symcon_has_action&&o!==null&&!this._pending.has(t);return p`<div class="value"><span>${e}</span><b>${De(i)}${G(this.hass,[t],e)}</b>
${r&&s?.symcon_has_action&&s.symcon_variable_type===0?p`<button class="nf-chip" aria-pressed=${le(i)===!0} ?disabled=${!a} @click=${()=>{this.send(t,"symcon","set_value",{value:!le(i)})}}>${le(i)?"Ein":"Aus"}</button>`:r&&s?.symcon_has_action&&[1,2].includes(Number(s.symcon_variable_type))?p`<input type="number" aria-label=${e} .value=${String(ge(i)??"")} min=${String(s.symcon_min??0)} max=${String(s.symcon_max??100)} step=${String(s.symcon_step||(s.symcon_variable_type===1?1:.1))} ?disabled=${!a}
@change=${l=>{let u=l.target;u.value.trim()&&u.checkValidity()&&this.send(t,"symcon","set_value",{value:Number(u.value)})}} />`:f}
</div>`}schedule(e){let t=this.hass.states[e];if(!t?.attributes.symcon_schedule)return p`<p class="missing">Schaltuhr nicht verfügbar</p>`;let r=t.attributes.actions??[],i=t.attributes.groups??[],o=Number(t.attributes.next_run??0),s=r.find(u=>u.id===t.attributes.next_action),a=["Mo","Di","Mi","Do","Fr","Sa","So"],l=u=>`${String(u.hour).padStart(2,"0")}:${String(u.minute).padStart(2,"0")}${u.second?`:${String(u.second).padStart(2,"0")}`:""}`;return p`<details class="schedule"><summary>${String(t.attributes.friendly_name??"Schaltuhr")}</summary>
@@ -240,7 +240,7 @@ A plugin runs with the same rights as NextFloor in your browser. The file has be
.point time { font-variant-numeric:tabular-nums; }
.dot { width:8px; height:8px; border-radius:50%; }
.error { color:var(--nf-danger,#ff6b7a); font-size:12px; }
`]};customElements.get("nf-room-hvac")||customElements.define("nf-room-hvac",so);var am=new Set(["on","home","open","true","active","playing","heat","heating"]);function Ue(n,e){let t=e.show_when;if(!t?.entity||!n)return!0;let r=n.states[t.entity];if(!r||C(r))return!0;let i=String(r.state).toLowerCase(),o=(t.state??"").split(",").map(a=>a.trim().toLowerCase()).filter(Boolean),s=o.length?o.includes(i):am.has(i)||Number.isFinite(Number(i))&&Number(i)>0;return t.invert?!s:s}function ao(n,e){let t=[];for(let r of e.floors)for(let i of r.furniture)Ue(n,i)||t.push(i.id);return t.sort()}function pl(n,e){if(!e.length)return n;let t=new Set(e);return{...n,floors:n.floors.map(r=>r.furniture.some(i=>t.has(i.id))?{...r,furniture:r.furniture.filter(i=>!t.has(i.id))}:r)}}function ae(n,e){if(!Pi(e))return $(n,`furn_${e}`);let t=X(e);return t?lm(t,e,n?.language??navigator.language):$(n,"pack_missing_item")}function lm(n,e,t){return n.name[t.split("-")[0]]??Za(t,e)??ea(n,t)}var ee=(n,e)=>[n[0]-e[0],n[1]-e[1]],Pe=(n,e)=>[n[0]+e[0],n[1]+e[1]],Se=(n,e)=>[n[0]*e,n[1]*e],ce=(n,e)=>n[0]*e[0]+n[1]*e[1],je=(n,e)=>n[0]*e[1]-n[1]*e[0],qe=n=>Math.hypot(n[0],n[1]),$e=n=>{let e=qe(n)||1;return[n[0]/e,n[1]/e]},lo=n=>[-n[1],n[0]],uo=n=>[n[1],-n[0]];function fl(n){let e=n.heightEnd!==void 0;return{...n,a:n.b,b:n.a,left:n.right,right:n.left,roomLeft:n.roomRight,roomRight:n.roomLeft,height:e?n.heightEnd:n.height,heightEnd:e?n.height:void 0}}function um(n,e){let t=n.map(r=>({...r}));for(let r of e){let i=t.find(o=>o.room_id===r.room_id&&o.edge===r.edge&&(Math.abs(o.t1-r.t0)<1e-6||Math.abs(r.t1-o.t0)<1e-6));i?(i.t0=Math.min(i.t0,r.t0),i.t1=Math.max(i.t1,r.t1)):t.push({...r})}return t}function cm(n,e,t){if(n.a===e.b)return!1;let r=$e(ee(t[n.b],t[n.a])),i=$e(ee(t[e.b],t[e.a]));return Math.abs(je(r,i))>1e-6||ce(r,i)<=0||n.free||e.free||n.heightEnd!==void 0||e.heightEnd!==void 0?!1:n.height===e.height&&n.exterior===e.exterior&&n.roomLeft===e.roomLeft&&n.roomRight===e.roomRight&&Math.abs(n.left-e.left)<=1e-9&&Math.abs(n.right-e.right)<=1e-9}function gl(n,e,t=new Set){let r=n.slice();for(;;){let i=new Map;r.forEach((s,a)=>{for(let l of[s.a,s.b])i.set(l,[...i.get(l)??[],a])});let o=null;for(let[s,a]of i){if(a.length!==2||t.has(s))continue;let l=r[a[0]].b===s?r[a[0]]:fl(r[a[0]]),u=r[a[1]].a===s?r[a[1]]:fl(r[a[1]]);if(!cm(l,u,e))continue;let c={...l,b:u.b,sources:um(l.sources,u.sources)};o=[...r.filter((h,m)=>m!==a[0]&&m!==a[1]),c];break}if(!o)return r;r=o}}function _l(n,e){let t=new Map;n.forEach((i,o)=>{let s=$e(ee(e[i.b],e[i.a])),a=[[i.a,{key:`${o}:a`,d:s,left:i.left,right:i.right,angle:Math.atan2(s[1],s[0])}],[i.b,{key:`${o}:b`,d:Se(s,-1),left:i.right,right:i.left,angle:Math.atan2(-s[1],-s[0])}]];for(let[l,u]of a)t.set(l,[...t.get(l)??[],u])});let r=new Map;for(let[i,o]of t){let s=e[i];o.sort((l,u)=>l.angle-u.angle);for(let l of o)r.set(l.key,{left:Pe(s,Se(lo(l.d),l.left)),right:Pe(s,Se(uo(l.d),l.right))});if(o.length<2)continue;let a=4*Math.max(...o.map(l=>Math.max(l.left,l.right)))+1e-9;o.forEach((l,u)=>{let c=o[(u+1)%o.length],h=Pe(s,Se(lo(l.d),l.left)),m=Pe(s,Se(uo(c.d),c.right)),d=je(l.d,c.d);if(Math.abs(d)<1e-4)return;let g=Pe(h,Se(l.d,je(ee(m,h),c.d)/d));qe(ee(g,s))>a||(r.get(l.key).left=g,r.get(c.key).right=g)})}return r}function bl(n,e){let t=n.filter((r,i)=>qe(ee(r,n[(i+1)%n.length]))>e);for(;;){if(t.length<=3)return t;let r=t.findIndex((i,o)=>{let s=t[(o+t.length-1)%t.length],a=t[(o+1)%t.length],[l,u]=[ee(i,s),ee(a,i)];return Math.abs(je($e(l),$e(u)))<1e-7&&ce(l,u)>0});if(r===-1)return t;t=t.filter((i,o)=>o!==r)}}function dm(n){let e=[];return{points:e,idOf(t){let r=e.findIndex(i=>Math.abs(i[0]-t[0])<=n&&Math.abs(i[1]-t[1])<=n);return r>=0?r:(e.push([t[0],t[1]]),e.length-1)}}}function hm(n,e){let t=[];for(let r of n){let i=r.points;if(i.length<3||Math.abs(gt(i))<1e-6)continue;let o=gt(i)>0,s=i.map(a=>e.idOf(a));s.forEach((a,l)=>{let u=s[(l+1)%s.length];a!==u&&t.push(o?{u:a,v:u,room:r.id,edge:l,forward:!0}:{u,v:a,room:r.id,edge:l,forward:!1})})}return t}function mm(n,e,t){let r=[];for(let i of n){let[o,s]=[e[i.u],e[i.v]],a=ee(s,o),l=qe(a),u=Se(a,1/l),c=e.map((m,d)=>({id:d,rel:ee(m,o)})).filter(({id:m,rel:d})=>m!==i.u&&m!==i.v&&ce(d,u)>t&&ce(d,u)<l-t&&Math.abs(je(u,d))<=t).map(({id:m,rel:d})=>({t:ce(d,u),id:m})).sort((m,d)=>m.t-d.t),h=[{t:0,id:i.u},...c,{t:l,id:i.v}];for(let m=0;m+1<h.length;m++){let[d,g]=[h[m],h[m+1]];r.push({u:d.id,v:g.id,room:i.room,edge:i.edge,t0:i.forward?d.t:l-g.t,t1:i.forward?g.t:l-d.t,forward:i.forward})}}return r}var vl=n=>({room_id:n.room,edge:n.edge,t0:n.t0,t1:n.t1});function pm(n,e){let t=new Map(n.map(a=>[a.id,a])),r=new Map;for(let a of e){let l=`${a.room}:${a.edge}`;r.set(l,[...r.get(l)??[],a.t0].sort((u,c)=>u-c))}let i=a=>{let l=t.get(a.room)?.wall_heights?.[a.edge];return Array.isArray(l)?l[(r.get(`${a.room}:${a.edge}`)??[]).indexOf(a.t0)]??null:l},o=a=>{let l=t.get(a.room),[u,c]=[l?.wall_heights?.[a.edge],l?.wall_slopes?.[a.edge]];if(!l||typeof u!="number"||typeof c!="number"||u<=0||c<=0)return null;le Line truncated
`]};customElements.get("nf-room-hvac")||customElements.define("nf-room-hvac",so);var am=new Set(["on","home","open","true","active","playing","heat","heating"]);function Ue(n,e){let t=e.show_when;if(!t?.entity||!n)return!0;let r=n.states[t.entity];if(!r||C(r))return!0;let i=String(r.state).toLowerCase(),o=(t.state??"").split(",").map(a=>a.trim().toLowerCase()).filter(Boolean),s=o.length?o.includes(i):am.has(i)||Number.isFinite(Number(i))&&Number(i)>0;return t.invert?!s:s}function ao(n,e){let t=[];for(let r of e.floors)for(let i of r.furniture)Ue(n,i)||t.push(i.id);return t.sort()}function pl(n,e){if(!e.length)return n;let t=new Set(e);return{...n,floors:n.floors.map(r=>r.furniture.some(i=>t.has(i.id))?{...r,furniture:r.furniture.filter(i=>!t.has(i.id))}:r)}}function ae(n,e){if(!Pi(e))return $(n,`furn_${e}`);let t=X(e);return t?lm(t,e,n?.language??navigator.language):$(n,"pack_missing_item")}function lm(n,e,t){return n.name[t.split("-")[0]]??Za(t,e)??ea(n,t)}var ee=(n,e)=>[n[0]-e[0],n[1]-e[1]],Pe=(n,e)=>[n[0]+e[0],n[1]+e[1]],Se=(n,e)=>[n[0]*e,n[1]*e],ce=(n,e)=>n[0]*e[0]+n[1]*e[1],je=(n,e)=>n[0]*e[1]-n[1]*e[0],qe=n=>Math.hypot(n[0],n[1]),$e=n=>{let e=qe(n)||1;return[n[0]/e,n[1]/e]},lo=n=>[-n[1],n[0]],uo=n=>[n[1],-n[0]];function fl(n){let e=n.heightEnd!==void 0;return{...n,a:n.b,b:n.a,left:n.right,right:n.left,roomLeft:n.roomRight,roomRight:n.roomLeft,height:e?n.heightEnd:n.height,heightEnd:e?n.height:void 0}}function um(n,e){let t=n.map(r=>({...r}));for(let r of e){let i=t.find(o=>o.room_id===r.room_id&&o.edge===r.edge&&(Math.abs(o.t1-r.t0)<1e-6||Math.abs(r.t1-o.t0)<1e-6));i?(i.t0=Math.min(i.t0,r.t0),i.t1=Math.max(i.t1,r.t1)):t.push({...r})}return t}function cm(n,e,t){if(n.a===e.b)return!1;let r=$e(ee(t[n.b],t[n.a])),i=$e(ee(t[e.b],t[e.a]));return Math.abs(je(r,i))>1e-6||ce(r,i)<=0||n.free||e.free||n.heightEnd!==void 0||e.heightEnd!==void 0?!1:n.height===e.height&&n.exterior===e.exterior&&n.roomLeft===e.roomLeft&&n.roomRight===e.roomRight&&Math.abs(n.left-e.left)<=1e-9&&Math.abs(n.right-e.right)<=1e-9}function gl(n,e,t=new Set){let r=n.slice();for(;;){let i=new Map;r.forEach((s,a)=>{for(let l of[s.a,s.b])i.set(l,[...i.get(l)??[],a])});let o=null;for(let[s,a]of i){if(a.length!==2||t.has(s))continue;let l=r[a[0]].b===s?r[a[0]]:fl(r[a[0]]),u=r[a[1]].a===s?r[a[1]]:fl(r[a[1]]);if(!cm(l,u,e))continue;let c={...l,b:u.b,sources:um(l.sources,u.sources)};o=[...r.filter((h,m)=>m!==a[0]&&m!==a[1]),c];break}if(!o)return r;r=o}}function _l(n,e){let t=new Map;n.forEach((i,o)=>{let s=$e(ee(e[i.b],e[i.a])),a=[[i.a,{key:`${o}:a`,d:s,left:i.left,right:i.right,angle:Math.atan2(s[1],s[0])}],[i.b,{key:`${o}:b`,d:Se(s,-1),left:i.right,right:i.left,angle:Math.atan2(-s[1],-s[0])}]];for(let[l,u]of a)t.set(l,[...t.get(l)??[],u])});let r=new Map;for(let[i,o]of t){let s=e[i];o.sort((l,u)=>l.angle-u.angle);for(let l of o)r.set(l.key,{left:Pe(s,Se(lo(l.d),l.left)),right:Pe(s,Se(uo(l.d),l.right))});if(o.length<2)continue;let a=4*Math.max(...o.map(l=>Math.max(l.left,l.right)))+1e-9;o.forEach((l,u)=>{let c=o[(u+1)%o.length],h=Pe(s,Se(lo(l.d),l.left)),m=Pe(s,Se(uo(c.d),c.right)),d=je(l.d,c.d);if(Math.abs(d)<1e-4)return;let g=Pe(h,Se(l.d,je(ee(m,h),c.d)/d));qe(ee(g,s))>a||(r.get(l.key).left=g,r.get(c.key).right=g)})}return r}function bl(n,e){let t=n.filter((r,i)=>qe(ee(r,n[(i+1)%n.length]))>e);for(;;){if(t.length<=3)return t;let r=t.findIndex((i,o)=>{let s=t[(o+t.length-1)%t.length],a=t[(o+1)%t.length],[l,u]=[ee(i,s),ee(a,i)];return Math.abs(je($e(l),$e(u)))<1e-7&&ce(l,u)>0});if(r===-1)return t;t=t.filter((i,o)=>o!==r)}}function dm(n){let e=[];return{points:e,idOf(t){let r=e.findIndex(i=>Math.abs(i[0]-t[0])<=n&&Math.abs(i[1]-t[1])<=n);return r>=0?r:(e.push([t[0],t[1]]),e.length-1)}}}function hm(n,e){let t=[];for(let r of n){let i=r.points;if(i.length<3||Math.abs(gt(i))<1e-6)continue;let o=gt(i)>0,s=i.map(a=>e.idOf(a));s.forEach((a,l)=>{let u=s[(l+1)%s.length];a!==u&&t.push(o?{u:a,v:u,room:r.id,edge:l,forward:!0}:{u,v:a,room:r.id,edge:l,forward:!1})})}return t}function mm(n,e,t){let r=[];for(let i of n){let[o,s]=[e[i.u],e[i.v]],a=ee(s,o),l=qe(a),u=Se(a,1/l),c=e.map((m,d)=>({id:d,rel:ee(m,o)})).filter(({id:m,rel:d})=>m!==i.u&&m!==i.v&&ce(d,u)>t&&ce(d,u)<l-t&&Math.abs(je(u,d))<=t).map(({id:m,rel:d})=>({t:ce(d,u),id:m})).sort((m,d)=>m.t-d.t),h=[{t:0,id:i.u},...c,{t:l,id:i.v}];for(let m=0;m+1<h.length;m++){let[d,g]=[h[m],h[m+1]];r.push({u:d.id,v:g.id,room:i.room,edge:i.edge,t0:i.forward?d.t:l-g.t,t1:i.forward?g.t:l-d.t,forward:i.forward})}}return r}var vl=n=>({room_id:n.room,edge:n.edge,t0:n.t0,t1:n.t1});function pm(n,e){let t=new Map(n.map(a=>[a.id,a])),r=new Map;for(let a of e){let l=`${a.room}:${a.edge}`;r.set(l,[...r.get(l)??[],a.t0].sort((u,c)=>u-c))}let i=a=>{let l=t.get(a.room)?.wall_heights?.[a.edge];return Array.isArray(l)?l[(r.get(`${a.room}:${a.edge}`)??[]).indexOf(a.t0)]??null:l},o=a=>{let l=t.get(a.room),[u,c]=[l?.wall_heights?.[a.edge],l?.wall_slopes?.[a.edge]];if(!l||typeof u!="number"||typeof c!="number"||u<=0||c<=0)return null;le Line truncated
<h4>${Mn[e]} ${Ie[e]}</h4>
${this.readings.filter(t=>t.kind===e).map(t=>p`<div class="reading" title=${`${t.manual?"Eigener Z\xE4hler":"Bereichsz\xE4hler"}${t.incomplete?" \xB7 Err: Mindestens ein Wert fehlt; angezeigt wird die Summe der verf\xFCgbaren Werte.":""}
${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states[r]?.attributes.friendly_name||r).join(`
@@ -256,7 +256,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
.reading span { color:var(--nf-muted,#aaa); }
b { white-space:nowrap; font-variant-numeric:tabular-nums; }
small { font-size:.85em; }
`};customElements.get("nf-utility-report")||customElements.define("nf-utility-report",_o);var vo=Math.PI/180,Ol=3,Wl=.1,bo=1/6,Bl=(n,e)=>[Math.sin((e+n)*vo),-Math.cos((e+n)*vo)],Dm=["N","NE","E","SE","S","SW","W","NW"];function Fm(n,e,t){return Vl(n,e,t).map(r=>r.normal)}function Vl(n,e,t){let r=[];for(let i of n.openings){if(i.room_id!==e.id||i.type==="garage")continue;let o=xl(i,n.rooms,n.walls??[]),s=o?Sl(t,i,o):null;if(!s||!s.wall.exterior)continue;let{wall:a}=s,l=Math.hypot(a.b[0]-a.a[0],a.b[1]-a.a[1]);if(l<1e-6)continue;let u=[-(a.b[1]-a.a[1])/l,(a.b[0]-a.a[0])/l],c=a.roomLeft===e.id?u:[-u[0],-u[1]];r.push({opening:i,normal:[-c[0],-c[1]]})}return r}function Hm(n,e){let t=((Math.atan2(n[0],-n[1])/vo-e)%360+360)%360;return Dm[Math.round(t/45)%8]}var Nl=new WeakMap;function Kl(n,e){let t=Nl.get(e);return t||(t=Lt(e.rooms,{exterior:n.settings.wall_exterior,interior:n.settings.wall_interior},e.walls??[]).walls,Nl.set(e,t)),t}var Ll=new WeakMap;function Kt(n,e,t,r,i=new Date){let o=`${t.id}|${i.toISOString().slice(0,10)}|${n.settings.north??0}|${r.latitude},${r.longitude},${r.zone??""}`,s=Ll.get(e);s||Ll.set(e,s=new Map);let a=s.get(o);if(a)return a;let l=Pm(n,e,t,r,i);return s.set(o,l),l}function Pm(n,e,t,r,i){let o=n.settings.north??0,s=Fm(e,t,Kl(n,e)),a=[...new Set(s.map(u=>Hm(u,o)))];if(!s.length)return{hours:0,facing:a};let l=0;for(let u=bo/2;u<24;u+=bo){let c=ft(Et(u,r.zone,i),r.latitude,r.longitude);if(c.elevation<Ol)continue;let h=Bl(c.azimuth,o);s.some(m=>m[0]*h[0]+m[1]*h[1]>Wl)&&l++}return{hours:Math.round(l*bo*10)/10,facing:a}}function Gl(n,e,t,r,i=new Date().getFullYear()){return Array.from({length:12},(o,s)=>Kt(n,e,t,r,new Date(Date.UTC(i,s,15,12))).hours)}function Ul(n,e,t,r,i=new Date){let o=ft(i,r.latitude,r.longitude);if(o.elevation<Ol)return[];let s=Bl(o.azimuth,n.settings.north??0);return Vl(e,t,Kl(n,e)).filter(a=>a.normal[0]*s[0]+a.normal[1]*s[1]>Wl).map(a=>a.opening)}var jl=n=>6.112*Math.exp(17.62*n/(243.12+n));function Gt(n,e,t=4){if(n===null||e===null)return null;let r=Math.min(100,e*jl(n)/jl(n-t));return Math.round(Math.min(100,Math.max(0,(r-65)/20*100)))}function Wr(n,e,t){return t!==null&&t>=70?"mould":n!==null&&n>=1e3?"co2":e!==null&&e>=65?"humidity":null}function yt(n=new Date,e=50){let t=n.getMonth(),r=t>=4&&t<=8;return e<0?!r:r}function Br(n,e,t,r=!1){let i=[];if(n!==null){let[s,a]=r?[22,26]:[20,23],l=n<s?s-n:n>a?n-a:0;i.push(Math.max(0,100-l*15))}if(e!==null){let s=e<40?40-e:e>60?e-60:0;i.push(Math.max(0,100-s*4))}if(t!==null&&i.push(Math.max(0,Math.min(100,100-(t-800)/600*100))),!i.length)return null;let o=i.reduce((s,a)=>s+a,0)/i.length;return Math.round(Math.min(o,Math.min(...i)+30))}var Im={temperature:{deviceClass:"temperature",unit:"\xB0C",stops:[[16,[.2,.45,1]],[20,[.15,.85,.75]],[22.5,[.95,.8,.3]],[26,[1,.28,.18]]]},humidity:{deviceClass:"humidity",unit:"%",stops:[[30,[.95,.6,.2]],[45,[.3,.88,.5]],[60,[.2,.78,1]],[75,[.32,.4,.98]]]},co2:{deviceClass:"carbon_dioxide",unit:"ppm",stops:[[450,[.3,.88,.5]],[800,[.98,.84,.3]],[1200,[1,.5,.2]],[1600,[.98,.25,.25]]]},mould:{deviceClass:"",unit:"%",stops:[[0,[.3,.88,.5]],[40,[.98,.84,.3]],[70,[1,.5,.2]],[100,[.75,.2,.55]]]},comfort:{deviceClass:"",unit:"",stops:[[0,[.98,.25,.25]],[40,[1,.5,.2]],[65,[.98,.84,.3]],[85,[.3,.88,.5]],[100,[.2,.8,.7]]]},power:{deviceClass:"power",unit:"W",stops:[[0,[.25,.4,.6]],[100,[.3,.88,.5]],[500,[.98,.84,.3]],[1500,[1,.5,.2]],[3e3,[.98,.25,.25]]]},sun:{deviceClass:"",unit:"h",stops:[[0,[.22,.3,.55]],[2,[.35,.6,.85]],[4,[.98,.84,.3]],[7,[1,.62,.2]],[10,[1,.42,.25]]]}},Cm={deviceClass:"temperature",unit:"\xB0C",stops:[[19,[.2,.45,1]],[22.5,[.15,.85,.75]],[25.5,[.95,.8,.3]],[29,[1,.28,.18]]]};function Vr(n,e=!1){return n==="temperature"&&e?Cm:Im[n]}var Nm=(n,e,t)=>[n[0]+(e[0]-n[0])*t,n[1]+(e[1]-n[1])*t,n[2]+(e[2]-n[2])*t];function ql(n,e,t=!1){let{stops:r}=Vr(n,t),i=r.findIndex(([u])=>e<=u);if(i===-1)return r[r.length-1][1];if(i===0)return r[0][1];let[o,s]=r[i-1],[a,l]=r[i];return Nm(s,l,(e-o)/(a-o))}function yo(n,e,t,r){let i=Wt(n,r,e.floors?.flatMap(s=>s.rooms)??t.rooms).filter(s=>s.kind==="electricity"&&s.metric==="power");if(i.length)return i.find(s=>s.unit==="W")?.value??null;let o=null;for(let s of wo(n,e,t,r)){let a=q(n.states[s]);a!==null&&(o=(o??0)+Math.max(0,a))}return o}function wo(n,e,t,r){let i=Wt(n,r,e.floors?.flatMap(h=>h.rooms)??t.rooms).filter(h=>h.kind==="electricity"&&h.metric==="power");if(i.length)return i.filter(h=>h.unit==="W").flatMap(h=>h.sources);let{grid:o,solar:s,battery:a}=e.energy,l=new Set([o,s,a].filter(Boolean)),u=new Set,c=(h,m)=>r.points.length>=3&&H([h,m],r.points);for(let h of t.placements){let m=c(h.x,h.z)?ye(n,h.entity_id):null;m&&u.add(m)}for(let h of t.furniture){if(!c(h.x,h.z))continue;let m=h.power&&h.power!=="none"?h.power:h.entity&&h.entity!=="none"?ye(n,h.entity):null;m&&u.add(m);for(let d of h.gang_entities??[]){let g=d&&d!=="none"?ye(n,d):null;g&&u.add(g)}}return[...u].filter(h=>!l.has(h))}function Zl(n,e,t){let r=new Map;for(let i of e.floors)for( Line truncated
`};customElements.get("nf-utility-report")||customElements.define("nf-utility-report",_o);var vo=Math.PI/180,Ol=3,Wl=.1,bo=1/6,Bl=(n,e)=>[Math.sin((e+n)*vo),-Math.cos((e+n)*vo)],Fm=["N","NE","E","SE","S","SW","W","NW"];function Dm(n,e,t){return Vl(n,e,t).map(r=>r.normal)}function Vl(n,e,t){let r=[];for(let i of n.openings){if(i.room_id!==e.id||i.type==="garage")continue;let o=xl(i,n.rooms,n.walls??[]),s=o?Sl(t,i,o):null;if(!s||!s.wall.exterior)continue;let{wall:a}=s,l=Math.hypot(a.b[0]-a.a[0],a.b[1]-a.a[1]);if(l<1e-6)continue;let u=[-(a.b[1]-a.a[1])/l,(a.b[0]-a.a[0])/l],c=a.roomLeft===e.id?u:[-u[0],-u[1]];r.push({opening:i,normal:[-c[0],-c[1]]})}return r}function Hm(n,e){let t=((Math.atan2(n[0],-n[1])/vo-e)%360+360)%360;return Fm[Math.round(t/45)%8]}var Nl=new WeakMap;function Kl(n,e){let t=Nl.get(e);return t||(t=Lt(e.rooms,{exterior:n.settings.wall_exterior,interior:n.settings.wall_interior},e.walls??[]).walls,Nl.set(e,t)),t}var Ll=new WeakMap;function Kt(n,e,t,r,i=new Date){let o=`${t.id}|${i.toISOString().slice(0,10)}|${n.settings.north??0}|${r.latitude},${r.longitude},${r.zone??""}`,s=Ll.get(e);s||Ll.set(e,s=new Map);let a=s.get(o);if(a)return a;let l=Pm(n,e,t,r,i);return s.set(o,l),l}function Pm(n,e,t,r,i){let o=n.settings.north??0,s=Dm(e,t,Kl(n,e)),a=[...new Set(s.map(u=>Hm(u,o)))];if(!s.length)return{hours:0,facing:a};let l=0;for(let u=bo/2;u<24;u+=bo){let c=ft(Et(u,r.zone,i),r.latitude,r.longitude);if(c.elevation<Ol)continue;let h=Bl(c.azimuth,o);s.some(m=>m[0]*h[0]+m[1]*h[1]>Wl)&&l++}return{hours:Math.round(l*bo*10)/10,facing:a}}function Gl(n,e,t,r,i=new Date().getFullYear()){return Array.from({length:12},(o,s)=>Kt(n,e,t,r,new Date(Date.UTC(i,s,15,12))).hours)}function Ul(n,e,t,r,i=new Date){let o=ft(i,r.latitude,r.longitude);if(o.elevation<Ol)return[];let s=Bl(o.azimuth,n.settings.north??0);return Vl(e,t,Kl(n,e)).filter(a=>a.normal[0]*s[0]+a.normal[1]*s[1]>Wl).map(a=>a.opening)}var jl=n=>6.112*Math.exp(17.62*n/(243.12+n));function Gt(n,e,t=4){if(n===null||e===null)return null;let r=Math.min(100,e*jl(n)/jl(n-t));return Math.round(Math.min(100,Math.max(0,(r-65)/20*100)))}function Wr(n,e,t){return t!==null&&t>=70?"mould":n!==null&&n>=1e3?"co2":e!==null&&e>=65?"humidity":null}function yt(n=new Date,e=50){let t=n.getMonth(),r=t>=4&&t<=8;return e<0?!r:r}function Br(n,e,t,r=!1){let i=[];if(n!==null){let[s,a]=r?[22,26]:[20,23],l=n<s?s-n:n>a?n-a:0;i.push(Math.max(0,100-l*15))}if(e!==null){let s=e<40?40-e:e>60?e-60:0;i.push(Math.max(0,100-s*4))}if(t!==null&&i.push(Math.max(0,Math.min(100,100-(t-800)/600*100))),!i.length)return null;let o=i.reduce((s,a)=>s+a,0)/i.length;return Math.round(Math.min(o,Math.min(...i)+30))}var Im={temperature:{deviceClass:"temperature",unit:"\xB0C",stops:[[16,[.2,.45,1]],[20,[.15,.85,.75]],[22.5,[.95,.8,.3]],[26,[1,.28,.18]]]},humidity:{deviceClass:"humidity",unit:"%",stops:[[30,[.95,.6,.2]],[45,[.3,.88,.5]],[60,[.2,.78,1]],[75,[.32,.4,.98]]]},co2:{deviceClass:"carbon_dioxide",unit:"ppm",stops:[[450,[.3,.88,.5]],[800,[.98,.84,.3]],[1200,[1,.5,.2]],[1600,[.98,.25,.25]]]},mould:{deviceClass:"",unit:"%",stops:[[0,[.3,.88,.5]],[40,[.98,.84,.3]],[70,[1,.5,.2]],[100,[.75,.2,.55]]]},comfort:{deviceClass:"",unit:"",stops:[[0,[.98,.25,.25]],[40,[1,.5,.2]],[65,[.98,.84,.3]],[85,[.3,.88,.5]],[100,[.2,.8,.7]]]},power:{deviceClass:"power",unit:"W",stops:[[0,[.25,.4,.6]],[100,[.3,.88,.5]],[500,[.98,.84,.3]],[1500,[1,.5,.2]],[3e3,[.98,.25,.25]]]},sun:{deviceClass:"",unit:"h",stops:[[0,[.22,.3,.55]],[2,[.35,.6,.85]],[4,[.98,.84,.3]],[7,[1,.62,.2]],[10,[1,.42,.25]]]}},Cm={deviceClass:"temperature",unit:"\xB0C",stops:[[19,[.2,.45,1]],[22.5,[.15,.85,.75]],[25.5,[.95,.8,.3]],[29,[1,.28,.18]]]};function Vr(n,e=!1){return n==="temperature"&&e?Cm:Im[n]}var Nm=(n,e,t)=>[n[0]+(e[0]-n[0])*t,n[1]+(e[1]-n[1])*t,n[2]+(e[2]-n[2])*t];function ql(n,e,t=!1){let{stops:r}=Vr(n,t),i=r.findIndex(([u])=>e<=u);if(i===-1)return r[r.length-1][1];if(i===0)return r[0][1];let[o,s]=r[i-1],[a,l]=r[i];return Nm(s,l,(e-o)/(a-o))}function yo(n,e,t,r){let i=Wt(n,r,e.floors?.flatMap(s=>s.rooms)??t.rooms).filter(s=>s.kind==="electricity"&&s.metric==="power");if(i.length)return i.find(s=>s.unit==="W")?.value??null;let o=null;for(let s of wo(n,e,t,r)){let a=q(n.states[s]);a!==null&&(o=(o??0)+Math.max(0,a))}return o}function wo(n,e,t,r){let i=Wt(n,r,e.floors?.flatMap(h=>h.rooms)??t.rooms).filter(h=>h.kind==="electricity"&&h.metric==="power");if(i.length)return i.filter(h=>h.unit==="W").flatMap(h=>h.sources);let{grid:o,solar:s,battery:a}=e.energy,l=new Set([o,s,a].filter(Boolean)),u=new Set,c=(h,m)=>r.points.length>=3&&H([h,m],r.points);for(let h of t.placements){let m=c(h.x,h.z)?ye(n,h.entity_id):null;m&&u.add(m)}for(let h of t.furniture){if(!c(h.x,h.z))continue;let m=h.power&&h.power!=="none"?h.power:h.entity&&h.entity!=="none"?ye(n,h.entity):null;m&&u.add(m);for(let d of h.gang_entities??[]){let g=d&&d!=="none"?ye(n,d):null;g&&u.add(g)}}return[...u].filter(h=>!l.has(h))}function Zl(n,e,t){let r=new Map;for(let i of e.floors)for( Line truncated
<path d=${Mr(n)} />
</svg>`,jr={previous:"M6 6h2v12H6zM20 6v12l-10-6z",play:"M8 5v14l11-7z",pause:"M7 5h4v14H7zM13 5h4v14h-4z",next:"M16 6h2v12h-2zM4 6v12l10-6z"},So=n=>p`<svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d=${n} /></svg>`,hp=24,mp=10,$o=class extends Q{static properties={hass:{attribute:!1},room:{attribute:!1},floor:{attribute:!1},confirmEntities:{attribute:!1},phrases:{attribute:!1},outside:{attribute:!1},_showAll:{state:!0},_said:{state:!0},_folded:{state:!0},_curve:{state:!0},_moodName:{state:!0},_undo:{state:!0},_energy:{state:!0},_sunYear:{state:!0},rooms:{attribute:!1},building:{attribute:!1}};saidTimer;memo=null;curveFor="";undoTimer;constructor(){super(),this.room=null,this.floor=null,this.phrases=null,this.outside=null,this._said=null,this._showAll=!1,this._folded=!1,this._curve=null,this._moodName=null,this._undo=null,this._energy=null,this._sunYear=!1,this.rooms=null,this.building=null}fireMoods(e,t){this.dispatchEvent(new CustomEvent("mood-change",{detail:{roomId:e.id,moods:t},bubbles:!0,composed:!0}))}runMood(e){for(let t of Gr(e))this.call("light",t.service,t.data)}renderMoods(e,t){let r=e.moods??[],i=!!this.rooms&&!!this.hass.user?.is_admin;if(!r.length&&!i)return f;let o=(this.rooms??[]).filter(l=>l.id!==e.id&&l.area_id),s=l=>U(this.hass,l).filter(u=>u.startsWith("light.")),a=()=>{let l=(this._moodName??"").trim()||this.t("mood_new");this.fireMoods(e,[...r,{id:`mood_${Date.now().toString(36)}`,name:l,lights:t.map(Kr)}]),this._moodName=null};return p`<div class="nf-rp-moods">
${r.map(l=>p`<span class="nf-rp-mood">
@@ -297,11 +297,11 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
aria-label=${this.name(e.entity_id)}
?disabled=${C(e)}
@click=${i}
></button>`}outsideRoom=null;render(){let e=!this.room&&this.outside?this.outside:null;e&&!this.outsideRoom&&(this.outsideRoom={id:"nf-outside",name:this.t("outside_area"),area_id:null,points:[],floor_material:"grass"});let t=this.room??(e?this.outsideRoom:null);if(!t||!this.hass)return f;let r=e??U(this.hass,t),i=this.memo,{shown:o,more:s}=e?{shown:e,more:[]}:i&&i.entities===this.hass.entities&&i.floor===this.floor&&i.room===t?i:this.memo={entities:this.hass.entities,floor:this.floor,room:t,...this.floor?Pa(this.hass,this.floor,t):{shown:r,more:[]}},a=Gi(this.hass,s).map(R=>R.primary),l=a.length,u=[t.floor_heating,...Object.values(t.hvac??{}).flat()].filter(R=>!!R&&R!=="none"),c=new Set(u.map(R=>this.hass.states[R]?.attributes.symcon_id).filter(Boolean)),h=(this._showAll?[...o,...a]:o).filter(R=>!V(this.hass)||!c.has(this.hass.states[R]?.attributes.symcon_id)),m=R=>h.filter(F=>R.includes(P(F))).map(F=>this.hass.states[F]),d=m(["light"]),g=m(["cover"]),_=m(["climate"]),b=m(["media"]),v=m(["switch","fan","lock"]),S=m(["sensor","binary"]),k=m(["scene","script"]),M=this.facts(_),z=d.filter(R=>R.state==="on");return p`<section class="nf-rp" aria-label=${t.name}>
></button>`}outsideRoom=null;render(){let e=!this.room&&this.outside?this.outside:null;e&&!this.outsideRoom&&(this.outsideRoom={id:"nf-outside",name:this.t("outside_area"),area_id:null,points:[],floor_material:"grass"});let t=this.room??(e?this.outsideRoom:null);if(!t||!this.hass)return f;let r=e??U(this.hass,t),i=this.memo,{shown:o,more:s}=e?{shown:e,more:[]}:i&&i.entities===this.hass.entities&&i.floor===this.floor&&i.room===t?i:this.memo={entities:this.hass.entities,floor:this.floor,room:t,...this.floor?Pa(this.hass,this.floor,t):{shown:r,more:[]}},a=Gi(this.hass,s).map(R=>R.primary),l=a.length,u=[t.floor_heating,...Object.values(t.hvac??{}).flat()].filter(R=>!!R&&R!=="none"),c=new Set(u.map(R=>this.hass.states[R]?.attributes.symcon_id).filter(Boolean)),h=(this._showAll?[...o,...a]:o).filter(R=>!V(this.hass)||!c.has(this.hass.states[R]?.attributes.symcon_id)),m=R=>h.filter(D=>R.includes(P(D))).map(D=>this.hass.states[D]),d=m(["light"]),g=m(["cover"]),_=m(["climate"]),b=m(["media"]),v=m(["switch","fan","lock"]),S=m(["sensor","binary"]),k=m(["scene","script"]),M=this.facts(_),z=d.filter(R=>R.state==="on");return p`<section class="nf-rp" aria-label=${t.name}>
<header class="nf-rp-head">
<div>
<h2>${t.name}</h2>
${M.length?p`<p class="nf-rp-facts">${M.map((R,F)=>p`${F?" \xB7 ":f}${R}`)}</p>`:f} ${this.renderEnergy()} ${this.renderSunYear()} ${this.renderShade()}
${M.length?p`<p class="nf-rp-facts">${M.map((R,D)=>p`${D?" \xB7 ":f}${R}`)}</p>`:f} ${this.renderEnergy()} ${this.renderSunYear()} ${this.renderShade()}
${this.renderOpenWhileHeating(_)} ${this.renderEmptyLights(t,z)}
${this.renderCurve()}
</div>
@@ -348,7 +348,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
${this._showAll?this.t("panel_less"):this.t("panel_more",{n:l})}
</button>`:f}
</div>
</section>`}extraValues(e){if(!this.floor)return f;let t=[...this.floor.placements.filter(r=>!r.outside&&H([r.x,r.z],e.points)).map(r=>({name:r.name||O(this.hass,r.entity_id),rows:Ar(this.hass,r.values)})),...this.floor.furniture.filter(r=>H([r.x,r.z],e.points)).map(r=>({name:r.name||(r.entity&&r.entity!=="none"?O(this.hass,r.entity):ae(this.hass,r.type)),rows:[...Ur(this.hass,r),...Ar(this.hass,r.values)]}))].filter(r=>r.rows.length);return t.length?this.section("device_values",t.map(r=>p`<div class="nf-extra-values"><b>${r.name}</b>${r.rows.map(i=>p`<div class="nf-rp-row"><span class="nf-rp-icon">${i.icon}</span><span class="nf-rp-name">${i.label}</span><b class="nf-rp-state">${i.text}${G(this.hass,[i.entity],i.label)}</b></div>`)}</div>`)):f}facts(e){let t=[],r=this.room;if(!r)return t;let i=(T,E)=>{let A=Z(this.hass,this.floor,r,T);if(A===null)return null;if(T==="temperature")return`${L(this.hass,ue(this.hass,A),1)} ${re(this.hass)}`;let I=be(this.hass,this.floor,r,T)[0],N=this.hass.states[I]?.attributes.unit_of_measurement??E;return`${L(this.hass,A,1)} ${N}`},o=e.find(T=>typeof T.attributes.current_temperature=="number"),s=i("temperature","\xB0C");s?t.push(p`${s}${G(this.hass,be(this.hass,this.floor,r,"temperature"),"Temperatur")}`):o&&r.climate?.temperature!=="none"&&t.push(p`${L(this.hass,o.attributes.current_temperature,1)} ${re(this.hass)}${G(this.hass,[o.entity_id],"Temperatur")}`);let a=i("humidity","%");a&&t.push(p`${a}${G(this.hass,be(this.hass,this.floor,r,"humidity"),"Luftfeuchte")}`);let l=Z(this.hass,this.floor??null,r,"illuminance");l!==null&&t.push(p`☀ ${L(this.hass,l,0)} lx${G(this.hass,be(this.hass,this.floor,r,"illuminance"),"Helligkeit")}`);let u=Wt(this.hass,r,this.building?.floors.flatMap(T=>T.rooms)).find(T=>T.kind==="electricity"&&T.metric==="power"&&T.unit==="W"),c=!u&&this.floor&&this.building?yo(this.hass,this.building,this.floor,r):null;u?t.push(p`⚡ ${Ne(this.hass,u)}${G(this.hass,u.sources,"Leistung")}`):c!==null&&t.push(`\u26A1 ${wt(this.hass,c)}`);let h=this.floor?this.floor.openings.filter(T=>T.room_id===r.id).flatMap(T=>[T.contact,T.contact2,T.tilt,T.tilt2]).map(T=>T&&T!=="none"?this.hass.states[T]:void 0).filter(T=>T?.state==="on").map(T=>Date.parse(String(T.last_changed??""))).filter(Number.isFinite):[];h.length&&t.push(`\u{1FA9F} ${this.t("open_since",{time:xo(Date.now()-Math.min(...h))})}`);let m=U(this.hass,r).map(T=>this.hass.states[T]).filter(T=>!!T&&T.entity_id.startsWith("binary_sensor.")&&["motion","occupancy","presence"].includes(String(T.attributes.device_class)));if(m.length)if(m.some(T=>T.state==="on"))t.push(`\u{1F6B6} ${this.t("presence_now")}`);else{let T=Math.max(...m.map(E=>Date.parse(String(E.last_changed??""))||0));T>0&&t.push(`\u{1F6B6} ${this.t("presence_last",{time:xo(Date.now()-T)})}`)}let d=this.building?ru(this.hass,this.building).filter(T=>T.roomId===r.id&&T.level<nu):[];d.length&&t.push(`\u{1FAAB} ${this.t("battery_low_n",{n:d.length,names:d.map(T=>`${this.name(T.entity)} ${Math.round(T.level)} %`).join(", ")})}`);let g=(this.building?.settings.circuits??[]).filter(T=>T.rooms.includes(r.id)).map(T=>T.name),_=this.building?.settings.room_facts_off??[];g.length&&!_.includes("circuits")&&t.push(`\u{1F50C} ${g.join(", ")}`);let{latitude:b,longitude:v,time_zone:S}=this.hass.config??{};if(this.floor&&b!==void 0&&v!==void 0&&this.building&&!_.includes("sun")){let T=Kt(this.building,this.floor,r,{latitude:b,longitude:v,zone:S});T.facing.length&&t.push(`\u2600 ${this.t("room_sun_hours",{h:L(this.hass,T.hours,1),facing:T.facing.join(", ")})}`)}let k=Z(this.hass,this.floor,r,"temperature"),M=Z(this.hass,this.floor,r,"humidity"),z=Wr(Z(this.hass,this.floor,r,"co2"),M,Gt(k,M));z&&!_.includes("air")&&t.push(`\u{1F4A8} ${this.t(`air_${z}`)}`);let R=Br(k,M,Z(this.hass,this.floor,r,"co2"),yt(new Date,this.hass.config?.latitude)),F=r.hvac?.status;return F&&F!=="none"?t.push(p`${Fe(this.hass.states[F])}${G(this.hass,[F],"Raumstatus")}`):R!==null&&(k!==null||M!==null)&&!_.includes("comfort")&&t.push(`\u{1F60A} ${this.t("comfort_n",{n:R})}`),t}announceSection(e){let t=this.phrases?.length?this.phrases:[1,2,3,4,5].map(o=>this.t(`announce_phrase_${o}`)),r=o=>{let s=o.trim();s&&(clearTimeout(this.saidTimer),this.hass.callService("nextfloor","announce",{message:s,rooms:[e.id],on_screens:!1}).then(()=>this._said={text:this.t("announce_sent",{message:s}),failed:!1},a=>this._said={text:this.t("announce_failed",{error:a?.message??String(a)}),failed:!0}),this.saidTimer=setTimeout(()=>this._said=null,6e3))},i=o=>{o.preventDefault();let s=o.currentTarget.querySelector("input");r(s.value),s.value=""};return this.section("panel_announce",[p`<div class="nf-rp-scenes">${t.map(o=>p`<button class="nf-btn" @click=${()=>r(o)}>${o}</button>`)}</div>
</section>`}extraValues(e){if(!this.floor)return f;let t=[...this.floor.placements.filter(r=>!r.outside&&H([r.x,r.z],e.points)).map(r=>({name:r.name||O(this.hass,r.entity_id),rows:Ar(this.hass,r.values)})),...this.floor.furniture.filter(r=>H([r.x,r.z],e.points)).map(r=>({name:r.name||(r.entity&&r.entity!=="none"?O(this.hass,r.entity):ae(this.hass,r.type)),rows:[...Ur(this.hass,r),...Ar(this.hass,r.values)]}))].filter(r=>r.rows.length);return t.length?this.section("device_values",t.map(r=>p`<div class="nf-extra-values"><b>${r.name}</b>${r.rows.map(i=>p`<div class="nf-rp-row"><span class="nf-rp-icon">${i.icon}</span><span class="nf-rp-name">${i.label}</span><b class="nf-rp-state">${i.text}${G(this.hass,[i.entity],i.label)}</b></div>`)}</div>`)):f}facts(e){let t=[],r=this.room;if(!r)return t;let i=(T,E)=>{let A=Z(this.hass,this.floor,r,T);if(A===null)return null;if(T==="temperature")return`${L(this.hass,ue(this.hass,A),1)} ${re(this.hass)}`;let I=be(this.hass,this.floor,r,T)[0],N=this.hass.states[I]?.attributes.unit_of_measurement??E;return`${L(this.hass,A,1)} ${N}`},o=e.find(T=>typeof T.attributes.current_temperature=="number"),s=i("temperature","\xB0C");s?t.push(p`${s}${G(this.hass,be(this.hass,this.floor,r,"temperature"),"Temperatur")}`):o&&r.climate?.temperature!=="none"&&t.push(p`${L(this.hass,o.attributes.current_temperature,1)} ${re(this.hass)}${G(this.hass,[o.entity_id],"Temperatur")}`);let a=i("humidity","%");a&&t.push(p`${a}${G(this.hass,be(this.hass,this.floor,r,"humidity"),"Luftfeuchte")}`);let l=Z(this.hass,this.floor??null,r,"illuminance");l!==null&&t.push(p`☀ ${L(this.hass,l,0)} lx${G(this.hass,be(this.hass,this.floor,r,"illuminance"),"Helligkeit")}`);let u=Wt(this.hass,r,this.building?.floors.flatMap(T=>T.rooms)).find(T=>T.kind==="electricity"&&T.metric==="power"&&T.unit==="W"),c=!u&&this.floor&&this.building?yo(this.hass,this.building,this.floor,r):null;u?t.push(p`⚡ ${Ne(this.hass,u)}${G(this.hass,u.sources,"Leistung")}`):c!==null&&t.push(`\u26A1 ${wt(this.hass,c)}`);let h=this.floor?this.floor.openings.filter(T=>T.room_id===r.id).flatMap(T=>[T.contact,T.contact2,T.tilt,T.tilt2]).map(T=>T&&T!=="none"?this.hass.states[T]:void 0).filter(T=>T?.state==="on").map(T=>Date.parse(String(T.last_changed??""))).filter(Number.isFinite):[];h.length&&t.push(`\u{1FA9F} ${this.t("open_since",{time:xo(Date.now()-Math.min(...h))})}`);let m=U(this.hass,r).map(T=>this.hass.states[T]).filter(T=>!!T&&T.entity_id.startsWith("binary_sensor.")&&["motion","occupancy","presence"].includes(String(T.attributes.device_class)));if(m.length)if(m.some(T=>T.state==="on"))t.push(`\u{1F6B6} ${this.t("presence_now")}`);else{let T=Math.max(...m.map(E=>Date.parse(String(E.last_changed??""))||0));T>0&&t.push(`\u{1F6B6} ${this.t("presence_last",{time:xo(Date.now()-T)})}`)}let d=this.building?ru(this.hass,this.building).filter(T=>T.roomId===r.id&&T.level<nu):[];d.length&&t.push(`\u{1FAAB} ${this.t("battery_low_n",{n:d.length,names:d.map(T=>`${this.name(T.entity)} ${Math.round(T.level)} %`).join(", ")})}`);let g=(this.building?.settings.circuits??[]).filter(T=>T.rooms.includes(r.id)).map(T=>T.name),_=this.building?.settings.room_facts_off??[];g.length&&!_.includes("circuits")&&t.push(`\u{1F50C} ${g.join(", ")}`);let{latitude:b,longitude:v,time_zone:S}=this.hass.config??{};if(this.floor&&b!==void 0&&v!==void 0&&this.building&&!_.includes("sun")){let T=Kt(this.building,this.floor,r,{latitude:b,longitude:v,zone:S});T.facing.length&&t.push(`\u2600 ${this.t("room_sun_hours",{h:L(this.hass,T.hours,1),facing:T.facing.join(", ")})}`)}let k=Z(this.hass,this.floor,r,"temperature"),M=Z(this.hass,this.floor,r,"humidity"),z=Wr(Z(this.hass,this.floor,r,"co2"),M,Gt(k,M));z&&!_.includes("air")&&t.push(`\u{1F4A8} ${this.t(`air_${z}`)}`);let R=Br(k,M,Z(this.hass,this.floor,r,"co2"),yt(new Date,this.hass.config?.latitude)),D=r.hvac?.status;return D&&D!=="none"?t.push(p`${De(this.hass.states[D])}${G(this.hass,[D],"Raumstatus")}`):R!==null&&(k!==null||M!==null)&&!_.includes("comfort")&&t.push(`\u{1F60A} ${this.t("comfort_n",{n:R})}`),t}announceSection(e){let t=this.phrases?.length?this.phrases:[1,2,3,4,5].map(o=>this.t(`announce_phrase_${o}`)),r=o=>{let s=o.trim();s&&(clearTimeout(this.saidTimer),this.hass.callService("nextfloor","announce",{message:s,rooms:[e.id],on_screens:!1}).then(()=>this._said={text:this.t("announce_sent",{message:s}),failed:!1},a=>this._said={text:this.t("announce_failed",{error:a?.message??String(a)}),failed:!0}),this.saidTimer=setTimeout(()=>this._said=null,6e3))},i=o=>{o.preventDefault();let s=o.currentTarget.querySelector("input");r(s.value),s.value=""};return this.section("panel_announce",[p`<div class="nf-rp-scenes">${t.map(o=>p`<button class="nf-btn" @click=${()=>r(o)}>${o}</button>`)}</div>
<form class="nf-rp-say" @submit=${i}>
<input type="text" maxlength="500" placeholder=${this.t("announce_placeholder")} aria-label=${this.t("announce_placeholder")} />
<button class="nf-btn nf-primary" type="submit">${this.t("announce_send")}</button>
@@ -856,7 +856,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
outline: 2px solid var(--nf-accent);
outline-offset: 2px;
}
`]};customElements.get("nf-room-panel")||customElements.define("nf-room-panel",$o);function bu(n){if(!n)return"";let e=Math.min(.8,Math.max(0,n.dim??.35)),t=n.image&&/^(https:\/\/|\/local\/|\/api\/)[^"'()\\\s]+$/.test(n.image)?n.image:null,r=n.color&&/^#[0-9a-f]{6}$/i.test(n.color)?n.color:null;return t?`;background:linear-gradient(rgba(0,0,0,${e}),rgba(0,0,0,${e})),center / cover no-repeat url("${t}")${r?` ${r}`:""}`:r?`;background:${r}`:""}var pp=[[/spotify/i,[30,215,96]],[/netflix/i,[229,9,20]],[/youtube/i,[255,0,51]],[/prime|amazon/i,[0,168,225]],[/disney/i,[17,60,207]],[/apple ?music|itunes/i,[250,45,72]],[/apple ?tv/i,[200,200,210]],[/plex/i,[229,160,13]],[/tidal/i,[0,255,255]],[/deezer/i,[162,56,255]],[/radio|tunein/i,[255,140,60]]],vu=[34,211,238];function Mo(n){return n?pp.find(([e])=>e.test(n))?.[1]??vu:vu}function Ao(n){if(n.state==="playing"||n.state==="paused")return!0;let e=t=>typeof n.attributes[t]=="string"&&n.attributes[t]!=="";return n.state==="on"&&(e("media_title")||e("media_channel")||e("source")||e("app_name"))}var Eo=n=>n.state==="playing"||n.state==="on"&&Ao(n);function yu(n,e){let t=[],r=new Set;for(let i of e){if(!i.entity.startsWith("media_player.")||r.has(i.entity))continue;r.add(i.entity);let o=n.states[i.entity];if(!o)continue;let s=o.attributes,a=c=>typeof s[c]=="string"?s[c]:"",l=a("app_name")||a("source")||a("app_id")||null,u=typeof s.volume_level=="number"?s.volume_level:null;t.push({entity:i.entity,name:i.name,at:i.at,playing:Eo(o),title:a("media_title")||a("media_channel")||l||"",artist:a("media_artist")||a("media_album_name")||a("media_series_title"),picture:a("entity_picture")||null,volume:u,color:Mo(l),app:l,group:Array.isArray(s.group_members)?s.group_members.filter(c=>typeof c=="string"&&c!==i.entity):[],rings:i.rings??1})}return t}function wu(n){let e=new Map(n.filter(i=>i.playing).map(i=>[i.entity,i])),t=[],r=new Set;for(let i of e.values())for(let o of i.group){let s=e.get(o),a=[i.entity,o].sort().join("|");s&&!r.has(a)&&(r.add(a),t.push([i,s]))}return t}var fp=3;function xu(n,e,t){let r=[];for(let i of e.floors)for(let o of i.furniture){if(!o.type.endsWith(":sprinkler"))continue;let s=t?.get(o.id)?.entity??null;!s||!te(n.states[s])||r.push({id:o.id,at:{floorId:i.id,x:o.x,y:oe(i,o)+o.h,z:o.z},reach:Math.min(15,Math.max(.5,o.spray??fp))})}return r}var qr=n=>n&&n!=="none"?n:null,ku=n=>Math.min(1,Math.max(0,n));function Su(n,e){let t=new Map;for(let r of e.settings.roof?.windows??[]){let i=Ve(n,{cover:qr(r.cover),contact:qr(r.contact),tilt:qr(r.tilt)},"window"),o=qr(r.window),s=o?n.states[o]:void 0,a=i.open;if(s&&!C(s)){let l=s.attributes.current_position;a=typeof l=="number"?ku(l/100):s.state==="open"||s.state==="opening"?1:0}t.set(r.id,{open:a,tilt:i.tilt,cover:i.cover??0})}return t}function gp(n,e){let t=i=>Math.hypot(i.x-e.x,i.z-e.z);return n.placements.filter(i=>i.entity_id.startsWith("media_player.")&&t(i)<Math.max(2,e.w)).sort((i,o)=>t(i)-t(o))[0]?.entity_id??null}var st=(n,e)=>typeof n[e]=="string"?n[e]:"";function $u(n,e,t){let r=[];for(let i of e.floors)for(let o of i.furniture){if(!vr(o.type))continue;let s=t?.get(o.id)?.entity??null,a=s?.startsWith("media_player.")?s:gp(i,o),l=a?n.states[a]:void 0;if(!l||!Ao(l))continue;let u=l.attributes,c=st(u,"app_name")||st(u,"source")||null;r.push({id:o.id,furnitureId:o.id,floorId:i.id,color:Mo(c),title:st(u,"media_title")||st(u,"media_channel")||c||"",subtitle:st(u,"media_artist")||st(u,"media_series_title")||st(u,"media_album_name"),app:c,picture:st(u,"entity_picture")||null,playing:Eo(l),ambilight:o.ambilight??1})}return r}function Mu(n){let e=n.states["sun.sun"]?.attributes;return typeof e?.elevation=="number"&&typeof e.azimuth=="number"?{elevation:e.elevation,azimuth:e.azimuth}:null}function Au(n,e){return(n===null?0:ku((n+4)/16))*(1-.45*e)}function at(n,e){return n.states["weather.nextfloor_symcon"]?"weather.nextfloor_symcon":e&&n.states[e]?e:Object.keys(n.states).filter(t=>t.startsWith("weather.")).sort()[0]??null}var Zr=new Set(["contact_lost","unlocked_night","own"]);function _p(n,e){let t=n.states[e.entity];if(!t||["unavailable","unknown"].includes(t.state))return!1;let r=(e.state??"on").trim(),i=/^([<>])\s*(-?\d+(?:[.,]\d+)?)$/.exec(r);if(i){let o=Number(t.state),s=Number(i[2].replace(",","."));return Number.isFinite(o)&&(i[1]==="<"?o<s:o>s)}return r.split(",").map(o=>o.trim().toLowerCase()).filter(Boolean).includes(String(t.state).toLowerCase())}var bp=600*1e3,vp=new Set(["rainy","pouring","lightning-rainy","hail","snowy-rainy"]),yp=new Map([["smoke","smoke"],["gas","gas"],["carbon_monoxide","co"],["moisture","water"]]),Eu=(n,e)=>{if(e.startsWith("binary_sensor."))return yp.get(String(n.states[e]?.attributes.device_class))};function wp(n,e){let t=new Set,r=[];for(let i of n.floors)for(let o of i.openings){let s=e.get(o.id);for(let a of s?[s.contact,s.contact2,s.tilt,s.tilt2]:[])!a||t.has(a)||(t.add(a),r.push({floorId:i.id,roomId:o.room_id,entity:a}))}return r}function Ru(n,e,t,r){let i=[];for(let a o Line truncated
`]};customElements.get("nf-room-panel")||customElements.define("nf-room-panel",$o);function bu(n){if(!n)return"";let e=Math.min(.8,Math.max(0,n.dim??.35)),t=n.image&&/^(https:\/\/|\/local\/|\/api\/)[^"'()\\\s]+$/.test(n.image)?n.image:null,r=n.color&&/^#[0-9a-f]{6}$/i.test(n.color)?n.color:null;return t?`;background:linear-gradient(rgba(0,0,0,${e}),rgba(0,0,0,${e})),center / cover no-repeat url("${t}")${r?` ${r}`:""}`:r?`;background:${r}`:""}var pp=[[/spotify/i,[30,215,96]],[/netflix/i,[229,9,20]],[/youtube/i,[255,0,51]],[/prime|amazon/i,[0,168,225]],[/disney/i,[17,60,207]],[/apple ?music|itunes/i,[250,45,72]],[/apple ?tv/i,[200,200,210]],[/plex/i,[229,160,13]],[/tidal/i,[0,255,255]],[/deezer/i,[162,56,255]],[/radio|tunein/i,[255,140,60]]],vu=[34,211,238];function Mo(n){return n?pp.find(([e])=>e.test(n))?.[1]??vu:vu}function Ao(n){if(n.state==="playing"||n.state==="paused")return!0;let e=t=>typeof n.attributes[t]=="string"&&n.attributes[t]!=="";return n.state==="on"&&(e("media_title")||e("media_channel")||e("source")||e("app_name"))}var Eo=n=>n.state==="playing"||n.state==="on"&&Ao(n);function yu(n,e){let t=[],r=new Set;for(let i of e){if(!i.entity.startsWith("media_player.")||r.has(i.entity))continue;r.add(i.entity);let o=n.states[i.entity];if(!o)continue;let s=o.attributes,a=c=>typeof s[c]=="string"?s[c]:"",l=a("app_name")||a("source")||a("app_id")||null,u=typeof s.volume_level=="number"?s.volume_level:null;t.push({entity:i.entity,name:i.name,at:i.at,playing:Eo(o),title:a("media_title")||a("media_channel")||l||"",artist:a("media_artist")||a("media_album_name")||a("media_series_title"),picture:a("entity_picture")||null,volume:u,color:Mo(l),app:l,group:Array.isArray(s.group_members)?s.group_members.filter(c=>typeof c=="string"&&c!==i.entity):[],rings:i.rings??1})}return t}function wu(n){let e=new Map(n.filter(i=>i.playing).map(i=>[i.entity,i])),t=[],r=new Set;for(let i of e.values())for(let o of i.group){let s=e.get(o),a=[i.entity,o].sort().join("|");s&&!r.has(a)&&(r.add(a),t.push([i,s]))}return t}var fp=3;function xu(n,e,t){let r=[];for(let i of e.floors)for(let o of i.furniture){if(!o.type.endsWith(":sprinkler"))continue;let s=t?.get(o.id)?.entity??null;!s||!te(n.states[s])||r.push({id:o.id,at:{floorId:i.id,x:o.x,y:oe(i,o)+o.h,z:o.z},reach:Math.min(15,Math.max(.5,o.spray??fp))})}return r}var qr=n=>n&&n!=="none"?n:null,ku=n=>Math.min(1,Math.max(0,n));function Su(n,e){let t=new Map;for(let r of e.settings.roof?.windows??[]){let i=Ve(n,{cover:qr(r.cover),contact:qr(r.contact),tilt:qr(r.tilt)},"window"),o=qr(r.window),s=o?n.states[o]:void 0,a=i.open;if(s&&!C(s)){let l=s.attributes.current_position;a=typeof l=="number"?ku(l/100):s.state==="open"||s.state==="opening"?1:0}t.set(r.id,{open:a,tilt:i.tilt,cover:i.cover??0})}return t}function gp(n,e){let t=i=>Math.hypot(i.x-e.x,i.z-e.z);return n.placements.filter(i=>i.entity_id.startsWith("media_player.")&&t(i)<Math.max(2,e.w)).sort((i,o)=>t(i)-t(o))[0]?.entity_id??null}var st=(n,e)=>typeof n[e]=="string"?n[e]:"";function $u(n,e,t){let r=[];for(let i of e.floors)for(let o of i.furniture){if(!vr(o.type))continue;let s=t?.get(o.id)?.entity??null,a=s?.startsWith("media_player.")?s:gp(i,o),l=a?n.states[a]:void 0;if(!l||!Ao(l))continue;let u=l.attributes,c=st(u,"app_name")||st(u,"source")||null;r.push({id:o.id,furnitureId:o.id,floorId:i.id,color:Mo(c),title:st(u,"media_title")||st(u,"media_channel")||c||"",subtitle:st(u,"media_artist")||st(u,"media_series_title")||st(u,"media_album_name"),app:c,picture:st(u,"entity_picture")||null,playing:Eo(l),ambilight:o.ambilight??1})}return r}function Mu(n){let e=n.states["sun.sun"]?.attributes;return typeof e?.elevation=="number"&&typeof e.azimuth=="number"?{elevation:e.elevation,azimuth:e.azimuth}:null}function Au(n,e){return(n===null?0:ku((n+4)/16))*(1-.45*e)}function at(n,e){return n.states["weather.nextfloor_symcon"]?"weather.nextfloor_symcon":e&&n.states[e]?e:Object.keys(n.states).filter(t=>t.startsWith("weather.")).sort()[0]??null}var Zr=new Set(["contact_lost","unlocked_night","own"]);function _p(n,e){let t=n.states[e.entity];if(!t||["unavailable","unknown"].includes(t.state))return!1;let r=(e.state??"on").trim(),i=/^([<>])\s*(-?\d+(?:[.,]\d+)?)$/.exec(r);if(i){let o=Number(t.state),s=Number(i[2].replace(",","."));return Number.isFinite(o)&&(i[1]==="<"?o<s:o>s)}return r.split(",").map(o=>o.trim().toLowerCase()).filter(Boolean).includes(String(t.state).toLowerCase())}var bp=600*1e3,vp=new Set(["rainy","pouring","lightning-rainy","hail","snowy-rainy"]),yp=new Map([["smoke","smoke"],["gas","gas"],["carbon_monoxide","co"],["moisture","water"]]),Eu=(n,e)=>{if(e.startsWith("binary_sensor."))return yp.get(String(n.states[e]?.attributes.device_class))};function wp(n,e){let t=new Set,r=[];for(let i of n.floors)for(let o of i.openings){let s=e.get(o.id);for(let a of s?[s.contact,s.contact2,s.tilt,s.tilt2]:[])!a||t.has(a)||(t.add(a),r.push({floorId:i.id,roomId:o.room_id,entity:a}))}return r}function Ru(n,e,t,r){let i=[];for(let a o Line truncated
${ne`<circle cx="27" cy="27" r=${22} class="live-ring-bg"></circle>
<circle cx="27" cy="27" r=${22} stroke=${e} stroke-dasharray=${`${(r*Math.max(0,Math.min(1,n))).toFixed(1)} ${r.toFixed(1)}`} transform="rotate(-90 27 27)" class="live-ring-fg"></circle>`}
</svg>`}function Tf(n,e,t,r){let i=e.summary,o=u=>$(n,u),s=e.autarky,a=r?p`<button class="live-fold" title=${o(r.folded?"live_unfold":"live_fold")} aria-label=${o(r.folded?"live_unfold":"live_fold")} aria-expanded=${!r.folded} @click=${r.toggle}>${r.folded?"+":"\u2212"}</button>`:f;if(r?.folded){let u=i.solar!==null?`\u2600 ${ze(n,i.solar)}`:i.consumption!==null?`\u2302 ${ze(n,i.consumption)}`:null;return p`<div class="live-card live-card-house live-folded" data-i=${t}>
@@ -867,13 +867,13 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
${a}
${s!==null?p`<div class="live-own">${On(s,s>.95?"#4ade80":s>.6?"#facc15":"#f87171")}<div class="live-own-text"><b>${Math.round(s*100)} %</b><span>${o("live_autarky")}</span></div></div>`:f}
<div class="live-rows">${l}</div>
${Ff(n,e.curves)} ${Df(n,e.week)}
</div>`}function Df(n,e){if(!e)return f;let t=[...e.solar,...e.use].filter(u=>u!==null&&u>0);if(!t.length)return f;let r=Math.max(...t)*1.1||1,[i,o]=[150,30],s=i/7,a=(u,c,h)=>u===null||u<=0?f:ne`<rect x=${c.toFixed(1)} y=${(o-u/r*o).toFixed(1)} width=${(s*.36).toFixed(1)} height=${(u/r*o).toFixed(1)} class=${h}></rect>`,l=u=>u.reduce((c,h)=>c+(h??0),0);return p`<div class="live-day live-week" title=${$(n,"live_week_hint",{solar:L(n,l(e.solar),0),use:L(n,l(e.use),0)})}>
${Df(n,e.curves)} ${Ff(n,e.week)}
</div>`}function Ff(n,e){if(!e)return f;let t=[...e.solar,...e.use].filter(u=>u!==null&&u>0);if(!t.length)return f;let r=Math.max(...t)*1.1||1,[i,o]=[150,30],s=i/7,a=(u,c,h)=>u===null||u<=0?f:ne`<rect x=${c.toFixed(1)} y=${(o-u/r*o).toFixed(1)} width=${(s*.36).toFixed(1)} height=${(u/r*o).toFixed(1)} class=${h}></rect>`,l=u=>u.reduce((c,h)=>c+(h??0),0);return p`<div class="live-day live-week" title=${$(n,"live_week_hint",{solar:L(n,l(e.solar),0),use:L(n,l(e.use),0)})}>
<svg viewBox=${`0 0 ${i} ${o}`} preserveAspectRatio="none" aria-hidden="true">
${e.days.map((u,c)=>ne`${a(e.solar[c],c*s+s*.1,"live-week-solar")}${a(e.use[c],c*s+s*.5,"live-week-use")}`)}
</svg>
<span>7 ${$(n,"live_days")}</span>
</div>`}function Ff(n,e){if(!e)return f;let t=[...e.solar,...e.use].filter(l=>l!==null);if(t.length<4)return f;let r=Math.max(...t)*1.08||1,[i,o]=[150,34],s=zn(e.solar,i,o,r),a=zn(e.use,i,o,r);return p`<div class="live-day" title=${$(n,"live_day_hint")}>
</div>`}function Df(n,e){if(!e)return f;let t=[...e.solar,...e.use].filter(l=>l!==null);if(t.length<4)return f;let r=Math.max(...t)*1.08||1,[i,o]=[150,34],s=zn(e.solar,i,o,r),a=zn(e.use,i,o,r);return p`<div class="live-day" title=${$(n,"live_day_hint")}>
<svg viewBox=${`0 0 ${i} ${o}`} preserveAspectRatio="none" aria-hidden="true">
${s?ne`<path d=${`${s}L${i},${o}L0,${o}Z`} class="live-day-solar"></path>`:f}
${a?ne`<path d=${a} class="live-day-use"></path>`:f}
@@ -1298,7 +1298,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
text-transform: uppercase;
letter-spacing: 0.04em;
}
`;function Zo(n){switch(n.kind){case"house":return{density:0,priority:100};case"roomclimate":return{density:24,priority:80};case"hydronic":return{density:42,priority:45};case"power":return n.power!==null&&Math.abs(n.power)>1?{density:48,priority:60}:n.readings?.length?{density:56,priority:30}:{density:n.power===null?64:72,priority:20};case"car":return{density:n.car.charging?36:60,priority:n.car.charging?60:20};case"printer":return{density:n.printer.printing?36:60,priority:n.printer.printing?60:20};case"heatpump":return{density:n.pump.mode!=="idle"?36:60,priority:n.pump.mode!=="idle"?60:20};case"media":return{density:48,priority:40}}}function Ac(n,e,t){let r=Zo(n).density;return r?Number.isFinite(e)&&e>=r*(t?.88:1.12):!0}function li(n){return n.toLocaleLowerCase().normalize("NFD").replace(new RegExp("\\p{M}","gu"),"")}var Yo=n=>n.points.length>=3;function Ec(n,e,t){return n.rooms.filter(Yo).find(r=>H([e,t],r.points))}function Of(n,e,t,r){let i=[];for(let a of e.rooms.filter(Yo)){let[l,u]=Te(a.points);i.push({kind:"room",name:a.name,where:r?e.name:"",floorId:e.id,roomId:a.id,entity:null,icon:null,x:l,z:u,y:0})}let o=new Set,s=(a,l,u,c)=>{if(o.has(a)||!(a in n.states))return;o.add(a);let h=Ec(e,l,u),m=[h?.name,r?e.name:void 0].filter(d=>!!d).join(" \xB7 ");i.push({kind:"device",name:O(n,a),where:m,floorId:e.id,roomId:h?.id??null,entity:a,icon:P(a),x:l,z:u,y:c})};for(let a of e.placements){let l=a.y??Ht(P(a.entity_id)??"sensor",xe(e,a.x,a.z),a.mount);s(a.entity_id,a.x,a.z,l)}for(let a of e.furniture){let l=t.get(a.id),u=l?.entity??l?.power;if(!u)continue;let c=xe(e,a.x,a.z)-.3;s(u,a.x,a.z,Math.min(c,Math.max(.5,a.h)))}for(let a of e.notes??[]){if(!a.text)continue;let l=Ec(e,a.x,a.z),u=[l?.name,r?e.name:void 0].filter(c=>!!c).join(" \xB7 ");i.push({kind:"note",name:`\u270E ${a.text.length>60?`${a.text.slice(0,59)}\u2026`:a.text}`,where:u,floorId:e.id,roomId:l?.id??null,entity:null,icon:null,x:a.x,z:a.z,y:1.3})}return i}function Rc(n,e){let t=Ke(n,e.floors),r=e.floors.length>1,i=e.floors.flatMap(o=>Of(n,o,t,r));for(let o of e.settings.circuits??[]){let s=e.floors.flatMap(h=>h.rooms.filter(m=>o.rooms.includes(m.id)&&Yo(m)).map(m=>({f:h,r:m})));if(!s.length)continue;let[{f:a,r:l}]=s,[u,c]=Te(l.points);i.push({kind:"circuit",name:`\u{1F50C} ${o.name}`,where:s.map(h=>h.r.name).join(", "),floorId:a.id,roomId:l.id,entity:null,icon:null,x:u,z:c,y:0})}return i}function Wf(n,e){return(li(n.name).startsWith(e)?0:2)+(n.kind==="room"?0:1)}function zc(n,e,t=8){let r=li(e).split(/\s+/).filter(Boolean);if(r.length===0)return[];let i=li(e.trim());return n.filter(o=>{let s=li([o.name,o.where,o.entity].filter(Boolean).join(" "));return r.every(a=>s.includes(a))}).map(o=>({item:o,cost:Wf(o,i)})).sort((o,s)=>o.cost-s.cost||o.item.name.localeCompare(s.item.name)).slice(0,t).map(o=>o.item)}var Bf=[[255,181,71],[255,236,210],[55,224,255],[91,124,255],[190,90,255],[255,95,210],[255,70,70],[120,255,150]],Vf=[2200,2700,3200,4e3,5e3,6500],Kf=["hs","rgb","rgbw","rgbww","xy"],Gf=4,Tc=16,Dc=32,Uf=128;function Qo(n){let e=n.attributes.supported_color_modes??[],t=e.some(r=>Kf.includes(r));return{dim:e.some(r=>r!=="onoff"),color:t,temp:e.includes("color_temp")}}function Xo(n){return((n.attributes.supported_features??0)&Gf)!==0&&typeof n.attributes.current_position=="number"}var Jo=class extends Q{static properties={hass:{attribute:!1},entity:{attribute:!1},car:{attribute:!1},presets:{attribute:!1},confirmSwitch:{type:Boolean},myPosition:{attribute:!1},tiltEntity:{attribute:!1},low:{type:Boolean,reflect:!0}};t(e,t){return $(this.hass,e,t)}ask(){return!this.confirmSwitch||confirm(this.t("confirm_switch",{name:O(this.hass,this.entity)}))}call(e,t,r={}){this.hass.callService(e,t,{entity_id:this.entity,...r})}close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}details(){ke(this,this.entity),this.close()}ring(e){let t=e.length;return e.map((r,i)=>{let o=i/t*Math.PI*2-Math.PI/2;return p`<div class="qm-at" style="left:${50+Math.cos(o)*39}%;top:${50+Math.sin(o)*39}%">${r}</div>`})}renderLight(e){let t=Qo(e),r=e.state==="on",i=r&&typeof e.attributes.brightness=="number"?Math.round(e.attributes.brightness/2.55):r?100:0,o=t.color?Bf.map(s=>p`<button class="qm-swatch" style="background:rgb(${s.join(",")})" aria-label=${`RGB ${s.join(", ")}`} @click=${()=>this.call("light","turn_on",{rgb_color:s})}></button>`):t.temp?Vf.map(s=>p`<button class="qm-swatch" style="background:${jf(s)}" aria-label=${`${s} K`} @click=${()=>this.call("light","turn_on",{color_temp_kelvin:s})}></button>`):[];return p`<div class="qm-ring ${o.length?"":"qm-ring-small"}">
`;function Zo(n){switch(n.kind){case"house":return{density:0,priority:100};case"roomclimate":return{density:24,priority:80};case"hydronic":return{density:42,priority:45};case"power":return n.power!==null&&Math.abs(n.power)>1?{density:48,priority:60}:n.readings?.length?{density:56,priority:30}:{density:n.power===null?64:72,priority:20};case"car":return{density:n.car.charging?36:60,priority:n.car.charging?60:20};case"printer":return{density:n.printer.printing?36:60,priority:n.printer.printing?60:20};case"heatpump":return{density:n.pump.mode!=="idle"?36:60,priority:n.pump.mode!=="idle"?60:20};case"media":return{density:48,priority:40}}}function Ac(n,e,t){let r=Zo(n).density;return r?Number.isFinite(e)&&e>=r*(t?.88:1.12):!0}function li(n){return n.toLocaleLowerCase().normalize("NFD").replace(new RegExp("\\p{M}","gu"),"")}var Yo=n=>n.points.length>=3;function Ec(n,e,t){return n.rooms.filter(Yo).find(r=>H([e,t],r.points))}function Of(n,e,t,r){let i=[];for(let a of e.rooms.filter(Yo)){let[l,u]=Te(a.points);i.push({kind:"room",name:a.name,where:r?e.name:"",floorId:e.id,roomId:a.id,entity:null,icon:null,x:l,z:u,y:0})}let o=new Set,s=(a,l,u,c)=>{if(o.has(a)||!(a in n.states))return;o.add(a);let h=Ec(e,l,u),m=[h?.name,r?e.name:void 0].filter(d=>!!d).join(" \xB7 ");i.push({kind:"device",name:O(n,a),where:m,floorId:e.id,roomId:h?.id??null,entity:a,icon:P(a),x:l,z:u,y:c})};for(let a of e.placements){let l=a.y??Ht(P(a.entity_id)??"sensor",xe(e,a.x,a.z),a.mount);s(a.entity_id,a.x,a.z,l)}for(let a of e.furniture){let l=t.get(a.id),u=l?.entity??l?.power;if(!u)continue;let c=xe(e,a.x,a.z)-.3;s(u,a.x,a.z,Math.min(c,Math.max(.5,a.h)))}for(let a of e.notes??[]){if(!a.text)continue;let l=Ec(e,a.x,a.z),u=[l?.name,r?e.name:void 0].filter(c=>!!c).join(" \xB7 ");i.push({kind:"note",name:`\u270E ${a.text.length>60?`${a.text.slice(0,59)}\u2026`:a.text}`,where:u,floorId:e.id,roomId:l?.id??null,entity:null,icon:null,x:a.x,z:a.z,y:1.3})}return i}function Rc(n,e){let t=Ke(n,e.floors),r=e.floors.length>1,i=e.floors.flatMap(o=>Of(n,o,t,r));for(let o of e.settings.circuits??[]){let s=e.floors.flatMap(h=>h.rooms.filter(m=>o.rooms.includes(m.id)&&Yo(m)).map(m=>({f:h,r:m})));if(!s.length)continue;let[{f:a,r:l}]=s,[u,c]=Te(l.points);i.push({kind:"circuit",name:`\u{1F50C} ${o.name}`,where:s.map(h=>h.r.name).join(", "),floorId:a.id,roomId:l.id,entity:null,icon:null,x:u,z:c,y:0})}return i}function Wf(n,e){return(li(n.name).startsWith(e)?0:2)+(n.kind==="room"?0:1)}function zc(n,e,t=8){let r=li(e).split(/\s+/).filter(Boolean);if(r.length===0)return[];let i=li(e.trim());return n.filter(o=>{let s=li([o.name,o.where,o.entity].filter(Boolean).join(" "));return r.every(a=>s.includes(a))}).map(o=>({item:o,cost:Wf(o,i)})).sort((o,s)=>o.cost-s.cost||o.item.name.localeCompare(s.item.name)).slice(0,t).map(o=>o.item)}var Bf=[[255,181,71],[255,236,210],[55,224,255],[91,124,255],[190,90,255],[255,95,210],[255,70,70],[120,255,150]],Vf=[2200,2700,3200,4e3,5e3,6500],Kf=["hs","rgb","rgbw","rgbww","xy"],Gf=4,Tc=16,Fc=32,Uf=128;function Qo(n){let e=n.attributes.supported_color_modes??[],t=e.some(r=>Kf.includes(r));return{dim:e.some(r=>r!=="onoff"),color:t,temp:e.includes("color_temp")}}function Xo(n){return((n.attributes.supported_features??0)&Gf)!==0&&typeof n.attributes.current_position=="number"}var Jo=class extends Q{static properties={hass:{attribute:!1},entity:{attribute:!1},car:{attribute:!1},presets:{attribute:!1},confirmSwitch:{type:Boolean},myPosition:{attribute:!1},tiltEntity:{attribute:!1},low:{type:Boolean,reflect:!0}};t(e,t){return $(this.hass,e,t)}ask(){return!this.confirmSwitch||confirm(this.t("confirm_switch",{name:O(this.hass,this.entity)}))}call(e,t,r={}){this.hass.callService(e,t,{entity_id:this.entity,...r})}close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}details(){ke(this,this.entity),this.close()}ring(e){let t=e.length;return e.map((r,i)=>{let o=i/t*Math.PI*2-Math.PI/2;return p`<div class="qm-at" style="left:${50+Math.cos(o)*39}%;top:${50+Math.sin(o)*39}%">${r}</div>`})}renderLight(e){let t=Qo(e),r=e.state==="on",i=r&&typeof e.attributes.brightness=="number"?Math.round(e.attributes.brightness/2.55):r?100:0,o=t.color?Bf.map(s=>p`<button class="qm-swatch" style="background:rgb(${s.join(",")})" aria-label=${`RGB ${s.join(", ")}`} @click=${()=>this.call("light","turn_on",{rgb_color:s})}></button>`):t.temp?Vf.map(s=>p`<button class="qm-swatch" style="background:${jf(s)}" aria-label=${`${s} K`} @click=${()=>this.call("light","turn_on",{color_temp_kelvin:s})}></button>`):[];return p`<div class="qm-ring ${o.length?"":"qm-ring-small"}">
${this.ring(o)}
<button class="qm-power ${r?"qm-on":""}" aria-pressed=${r} @click=${()=>this.ask()&&this.call("light","toggle")}>
<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M12 3v8M6.3 6.8a8 8 0 1 0 11.4 0" /></svg>
@@ -1345,9 +1345,9 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
.value=${String(r)}
aria-label=${this.t("cover_tilt")}
@change=${i=>this.call("cover","set_cover_tilt_position",{entity_id:e.attributes.nf_cover_control?this.entity:this.tiltEntity||this.entity,tilt_position:Number(i.target.value)})}
/></label>`:t&(Tc|Dc)?p`<div class="qm-tilt-buttons">
/></label>`:t&(Tc|Fc)?p`<div class="qm-tilt-buttons">
${t&Tc?p`<button class="qm-swatch qm-slot" @click=${()=>this.call("cover","open_cover_tilt")}>${this.t("cover_tilt_open")}</button>`:f}
${t&Dc?p`<button class="qm-swatch qm-slot" @click=${()=>this.call("cover","close_cover_tilt")}>${this.t("cover_tilt_close")}</button>`:f}
${t&Fc?p`<button class="qm-swatch qm-slot" @click=${()=>this.call("cover","close_cover_tilt")}>${this.t("cover_tilt_close")}</button>`:f}
</div>`:f}renderToggle(e){let t=e.state==="on"||e.state==="unlocked"||e.state==="playing",r=e.entity_id.split(".")[0];return p`<div class="qm-ring qm-ring-small">
<button
class="qm-power ${t?"qm-on":""}"
@@ -1616,7 +1616,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
.qm-note {
color: var(--nf-muted);
}
`]};function jf(n){let e=Math.min(1,Math.max(0,(n-2200)/4300)),t=(r,i)=>Math.round(r+(i-r)*e);return`rgb(${t(255,200)},${t(170,225)},${t(80,255)})`}customElements.get("nf-quick-menu")||customElements.define("nf-quick-menu",Jo);var qf=new URL(import.meta.url),Zf=new URL("./nextfloor-3d.js?v=d2200bd8fd8b",qf).href,Fc;function Hc(){return Fc??=import(Zf),Fc}function Pc(n){if(!n||n.state!=="on")return 0;let e=typeof n.attributes.percentage=="number"?n.attributes.percentage:60;return e<=0?0:.2+.6*Math.min(100,e)/100}var Ic="weather.nextfloor_symcon",Nc={condition:"Wetterzustand",temperature:"Au\xDFentemperatur",humidity:"Au\xDFenluftfeuchte",pressure:"Luftdruck",wind_speed:"Windgeschwindigkeit",wind_gust_speed:"Windb\xF6en",wind_bearing:"Windrichtung",cloud_coverage:"Bew\xF6lkung",precipitation:"Niederschlagsrate",precipitation_total:"Niederschlagsmenge",illuminance:"Au\xDFenhelligkeit",uv_index:"UV-Index",visibility:"Sichtweite",snow:"Schnee",fog:"Nebel",lightning:"Gewitter"},Cc=new WeakMap;function Yf(n){let e=n.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").trim();return["sunny","clear-night","partlycloudy","cloudy","fog","rainy","pouring","lightning-rainy","lightning","hail","snowy","snowy-rainy","windy","windy-variant"].includes(e)?e:/kein regen|trocken|wolkenlos|klar|sonnig/.test(e)?"sunny":/gewitter|blitz/.test(e)?"lightning-rainy":/schneeregen/.test(e)?"snowy-rainy":/schnee/.test(e)?"snowy":/hagel/.test(e)?"hail":/starkregen/.test(e)?"pouring":/regen|niesel/.test(e)?"rainy":/nebel/.test(e)?"fog":/teil.*wolk|heiter|leicht.*wolk/.test(e)?"partlycloudy":/wolk|bedeckt/.test(e)?"cloudy":/wind|sturm/.test(e)?"windy":null}function ui(n,e){if(!V(n))return n;let t=e.weather_variables??{};if(!e.rain_sensor&&!Object.values(t).some(d=>d&&d!=="none"))return n;let r=Cc.get(n)??new WeakMap;Cc.set(n,r);let i=r.get(e);if(i)return i;let o={friendly_name:"Wetter",nf_symcon_weather:!0},s=d=>t[d]&&t[d]!=="none"?n.states[t[d]]:void 0;for(let d of["temperature","humidity","pressure","cloud_coverage","precipitation","precipitation_total","illuminance","uv_index","visibility"]){let g=s(d),_=ge(g);_!==null&&(o[d]=d==="cloud_coverage"&&g?.attributes.symcon_max===1?_*100:_),g?.attributes.unit_of_measurement&&(o[`${d}_unit`]=g.attributes.unit_of_measurement)}for(let d of["wind_speed","wind_gust_speed"]){let g=s(d),_=ge(g);_!==null&&(o[d]=ei(_,g?.attributes.unit_of_measurement))}o.wind_speed_unit="km/h";let a=fe(s("wind_bearing"));a!==null&&(o.wind_bearing=a);let l=Yf(Fe(s("condition"))),u=e.rain_sensor?n.states[e.rain_sensor]:void 0,c=le(u);c!==null&&e.rain_sensor_inverted&&(c=!c),c===null&&typeof o.precipitation=="number"&&(c=o.precipitation>0),le(s("lightning"))?l=c?"lightning-rainy":"lightning":le(s("snow"))?l=c?"snowy-rainy":"snowy":le(s("fog"))?l="fog":c===!0?l=Number(o.precipitation??0)>=8?"pouring":"rainy":c===!1&&l&&/rain|pouring/.test(l)&&(l=null),!l&&typeof o.cloud_coverage=="number"&&(l=o.cloud_coverage>70?"cloudy":o.cloud_coverage>20?"partlycloudy":"sunny"),!l&&c===!1&&(l="sunny");let h={entity_id:Ic,state:l??"unknown",attributes:o},m={...n,states:{...n.states,[Ic]:h}};return r.set(e,m),m}var es=class extends Q{static properties={hass:{attribute:!1},floors:{attribute:!1},floorId:{attribute:!1},inline:{type:Boolean,reflect:!0},compact:{type:Boolean},folded:{state:!0}};constructor(){super(),this.floors=[],this.floorId=null,this.inline=!1,this.compact=!1,this.folded=null}value(e){return e?p`<span class="value" title=${`${Vt(e)}${e.manual?" \xB7 eigener Z\xE4hler":""}`}><b>${Ne(this.hass,e)}</b>${e.period!=="total"?p`<small>${{day:"heute",month:"Monat",year:"Jahr"}[e.period]}</small>`:f}${G(this.hass,e.sources,`${Ie[e.kind]} \xB7 ${Vt(e)}`)}</span>`:f}open(e,t){this.dispatchEvent(new CustomEvent("utility-open",{detail:{floorId:t?this.floorId:e,roomId:t?e:null},bubbles:!0,composed:!0}))}rows(e){return Oe.map(t=>{let r=e.filter(o=>o.kind===t&&o.metric==="power"),i=e.filter(o=>o.kind===t&&o.metric==="energy");return Array.from({length:Math.max(r.length,i.length)},(o,s)=>p`<div class="row"><span class="kind" title=${Ie[t]}>${s?"":`${Mn[t]} ${Ie[t]}`}</span>${r[s]?this.value(r[s]):p`<span></span>`}${i[s]?this.value(i[s]):p`<span></span>`}</div>`)})}render(){if(!this.hass)return f;let e=this.floors.flatMap(s=>s.rooms),t=this.floors.find(s=>s.id===this.floorId);if(this.inline){let s=t?Ce(this.hass,t,e):Il(this.hass,this.floors);return p`${Oe.map(a=>{let l=s.filter(u=>u.kind===a);return l.length?p`<div class="meter" aria-label=${`${t?.name||"Gesamtgeb\xE4ude"} \xB7 ${Ie[a]}`}><span class="medium" title=${t?.name||"Gesamtgeb\xE4ude"}>${Mn[a]} ${Ie[a]}</span><div class="values">${l.map(u=>this.value(u))}</div></div>`:f})}`}let i=(t?Bt(this.hass,t,e,!0).map(s=>({...s,hasDetails:s.rooms.length>0})):[...this.floors].sort((s,a)=>a.elevation-s.elevation).map(s=>({id:s.id,name:s.name,path:"",readings:Ce(this.hass,s,e),rooms:[],hasDetails:Bt(this.hass,s,e,!0).length>0}))).filter(s=>s.readings.length||s.hasDetails);if(!i.lLine truncated
`]};function jf(n){let e=Math.min(1,Math.max(0,(n-2200)/4300)),t=(r,i)=>Math.round(r+(i-r)*e);return`rgb(${t(255,200)},${t(170,225)},${t(80,255)})`}customElements.get("nf-quick-menu")||customElements.define("nf-quick-menu",Jo);var qf=new URL(import.meta.url),Zf=new URL("./nextfloor-3d.js?v=0f70d07bff6e",qf).href,Dc;function Hc(){return Dc??=import(Zf),Dc}function Pc(n){if(!n||n.state!=="on")return 0;let e=typeof n.attributes.percentage=="number"?n.attributes.percentage:60;return e<=0?0:.2+.6*Math.min(100,e)/100}var Ic="weather.nextfloor_symcon",Nc={condition:"Wetterzustand",temperature:"Au\xDFentemperatur",humidity:"Au\xDFenluftfeuchte",pressure:"Luftdruck",wind_speed:"Windgeschwindigkeit",wind_gust_speed:"Windb\xF6en",wind_bearing:"Windrichtung",cloud_coverage:"Bew\xF6lkung",precipitation:"Niederschlagsrate",precipitation_total:"Niederschlagsmenge",illuminance:"Au\xDFenhelligkeit",uv_index:"UV-Index",visibility:"Sichtweite",snow:"Schnee",fog:"Nebel",lightning:"Gewitter"},Cc=new WeakMap;function Yf(n){let e=n.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").trim();return["sunny","clear-night","partlycloudy","cloudy","fog","rainy","pouring","lightning-rainy","lightning","hail","snowy","snowy-rainy","windy","windy-variant"].includes(e)?e:/kein regen|trocken|wolkenlos|klar|sonnig/.test(e)?"sunny":/gewitter|blitz/.test(e)?"lightning-rainy":/schneeregen/.test(e)?"snowy-rainy":/schnee/.test(e)?"snowy":/hagel/.test(e)?"hail":/starkregen/.test(e)?"pouring":/regen|niesel/.test(e)?"rainy":/nebel/.test(e)?"fog":/teil.*wolk|heiter|leicht.*wolk/.test(e)?"partlycloudy":/wolk|bedeckt/.test(e)?"cloudy":/wind|sturm/.test(e)?"windy":null}function ui(n,e){if(!V(n))return n;let t=e.weather_variables??{};if(!e.rain_sensor&&!Object.values(t).some(d=>d&&d!=="none"))return n;let r=Cc.get(n)??new WeakMap;Cc.set(n,r);let i=r.get(e);if(i)return i;let o={friendly_name:"Wetter",nf_symcon_weather:!0},s=d=>t[d]&&t[d]!=="none"?n.states[t[d]]:void 0;for(let d of["temperature","humidity","pressure","cloud_coverage","precipitation","precipitation_total","illuminance","uv_index","visibility"]){let g=s(d),_=ge(g);_!==null&&(o[d]=d==="cloud_coverage"&&g?.attributes.symcon_max===1?_*100:_),g?.attributes.unit_of_measurement&&(o[`${d}_unit`]=g.attributes.unit_of_measurement)}for(let d of["wind_speed","wind_gust_speed"]){let g=s(d),_=ge(g);_!==null&&(o[d]=ei(_,g?.attributes.unit_of_measurement))}o.wind_speed_unit="km/h";let a=fe(s("wind_bearing"));a!==null&&(o.wind_bearing=a);let l=Yf(De(s("condition"))),u=e.rain_sensor?n.states[e.rain_sensor]:void 0,c=le(u);c!==null&&e.rain_sensor_inverted&&(c=!c),c===null&&typeof o.precipitation=="number"&&(c=o.precipitation>0),le(s("lightning"))?l=c?"lightning-rainy":"lightning":le(s("snow"))?l=c?"snowy-rainy":"snowy":le(s("fog"))?l="fog":c===!0?l=Number(o.precipitation??0)>=8?"pouring":"rainy":c===!1&&l&&/rain|pouring/.test(l)&&(l=null),!l&&typeof o.cloud_coverage=="number"&&(l=o.cloud_coverage>70?"cloudy":o.cloud_coverage>20?"partlycloudy":"sunny"),!l&&c===!1&&(l="sunny");let h={entity_id:Ic,state:l??"unknown",attributes:o},m={...n,states:{...n.states,[Ic]:h}};return r.set(e,m),m}var es=class extends Q{static properties={hass:{attribute:!1},floors:{attribute:!1},floorId:{attribute:!1},inline:{type:Boolean,reflect:!0},compact:{type:Boolean},folded:{state:!0}};constructor(){super(),this.floors=[],this.floorId=null,this.inline=!1,this.compact=!1,this.folded=null}value(e){return e?p`<span class="value" title=${`${Vt(e)}${e.manual?" \xB7 eigener Z\xE4hler":""}`}><b>${Ne(this.hass,e)}</b>${e.period!=="total"?p`<small>${{day:"heute",month:"Monat",year:"Jahr"}[e.period]}</small>`:f}${G(this.hass,e.sources,`${Ie[e.kind]} \xB7 ${Vt(e)}`)}</span>`:f}open(e,t){this.dispatchEvent(new CustomEvent("utility-open",{detail:{floorId:t?this.floorId:e,roomId:t?e:null},bubbles:!0,composed:!0}))}rows(e){return Oe.map(t=>{let r=e.filter(o=>o.kind===t&&o.metric==="power"),i=e.filter(o=>o.kind===t&&o.metric==="energy");return Array.from({length:Math.max(r.length,i.length)},(o,s)=>p`<div class="row"><span class="kind" title=${Ie[t]}>${s?"":`${Mn[t]} ${Ie[t]}`}</span>${r[s]?this.value(r[s]):p`<span></span>`}${i[s]?this.value(i[s]):p`<span></span>`}</div>`)})}render(){if(!this.hass)return f;let e=this.floors.flatMap(s=>s.rooms),t=this.floors.find(s=>s.id===this.floorId);if(this.inline){let s=t?Ce(this.hass,t,e):Il(this.hass,this.floors);return p`${Oe.map(a=>{let l=s.filter(u=>u.kind===a);return l.length?p`<div class="meter" aria-label=${`${t?.name||"Gesamtgeb\xE4ude"} \xB7 ${Ie[a]}`}><span class="medium" title=${t?.name||"Gesamtgeb\xE4ude"}>${Mn[a]} ${Ie[a]}</span><div class="values">${l.map(u=>this.value(u))}</div></div>`:f})}`}let i=(t?Bt(this.hass,t,e,!0).map(s=>({...s,hasDetails:s.rooms.length>0})):[...this.floors].sort((s,a)=>a.elevation-s.elevation).map(s=>({id:s.id,name:s.name,path:"",readings:Ce(this.hass,s,e),rooms:[],hasDetails:Bt(this.hass,s,e,!0).length>0}))).filter(s=>s.readings.length||s.hasDetails);if(!i.lLine truncated
<button class="heading" aria-expanded=${!o} @click=${()=>{this.folded=!o}}><span>${t?"Bereiche":"Stockwerke"}<small>${t?.name||"Gesamtgeb\xE4ude"}</small></span><span aria-hidden="true">${o?"+":"\u2212"}</span></button>
${o?f:p`<div class="entries"><div class="columns"><span></span><span title="Leistung bzw. Durchfluss">Leistung</span><span>Energie / Verbrauch</span></div>
${i.map(s=>p`<section class="entry" data-area=${t?s.id:f}>
@@ -1660,9 +1660,9 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
.kind { color:var(--nf-muted); font-size:10px; white-space:nowrap; }
.row .value b { font-size:11px; font-weight:normal; }
@media(max-width:600px) { .entries { max-height:32vh; } }
`};customElements.get("nf-utility-overview")||customElements.define("nf-utility-overview",es);var Lc="image:";function ts(n,e,t){let r=(e??"").trim();if(!r)return null;if(r.startsWith(Lc))return t(r.slice(Lc.length));if(/^(https?:\/\/|\/)/.test(r))return r;if(/^[a-z_]+\.[a-z0-9_]+$/.test(r)){let i=n?.states[r]?.attributes.entity_picture;return typeof i=="string"&&i?i:null}return null}var Wn=n=>Number(n);function Vn(n){if(Array.isArray(n)){let[o,s]=[Wn(n[0]),Wn(n[1])];return Number.isFinite(o)&&Number.isFinite(s)?[o,s]:null}if(!n||typeof n!="object")return null;let{x:e,y:t}=n,[r,i]=[Wn(e),Wn(t)];return Number.isFinite(r)&&Number.isFinite(i)?[r,i]:null}function Oc(n){return n?Vn(n.charger)??Vn(n.charger_position):null}function Wc(n){for(let[e,t]of Object.entries(n.states))if(e.startsWith("camera.")&&(Vn(t.attributes?.vacuum_position)??Oc(t.attributes)))return e;return null}var Jf=n=>Array.isArray(n)?typeof n[0]=="number":!!n&&typeof n=="object",Bn=(n,e)=>e?[n[0],-n[1]]:n;function Qf(n){if(!n)return null;let e=n.mirror===!0,[t,r]=Bn(n.ga,e),[i,o]=Bn(n.gb,e),[s,a]=n.a,[l,u]=n.b,[c,h]=[i-t,o-r],[m,d]=[l-s,u-a],g=Math.hypot(c,h),_=Math.hypot(m,d);if(!(g>1e-6)||!(_>1e-6))return null;let b=_/g,v=Math.atan2(d,m)-Math.atan2(h,c),[S,k]=[Math.cos(v),Math.sin(v)];return M=>{let z=Bn(M,e),[R,F]=[z[0]-t,z[1]-r];return[s+b*(R*S-F*k),a+b*(R*k+F*S)]}}function Xf(n){if(!n)return null;let e=n.mirror===!0,[t,r]=Bn(n.ga,e),[i,o]=Bn(n.gb,e),s=Math.atan2(n.b[1]-n.a[1],n.b[0]-n.a[0])-Math.atan2(o-r,i-t);return Number.isFinite(s)?s:null}function Bc(n,e,t){if(!e)return null;let r=n.states[e]?.attributes;if(!r)return null;let i=Qf(t)??(g=>g),o=Xf(t)??0,s=t?.mirror===!0?-1:1,a=r.vacuum_position,l=Vn(a),u=l?(()=>{let[g,_]=i(l),b=Wn(a?.a)*s;if(!Number.isFinite(b))return{x:g,z:_,heading:0};let v=b*Math.PI/180+o;return{x:g,z:_,heading:Math.atan2(Math.cos(v),Math.sin(v))}})():null,c=Oc(r),h=Array.isArray(r.path)?r.path:[],m=h.length>0&&Jf(h[0])?[h]:h,d=[];for(let g of m){let _=[];for(let b of Array.isArray(g)?g:[]){let v=Vn(b);v&&_.push(i(v))}_.length>1&&d.push(_)}return!u&&!c&&!d.length?null:{pose:u,charger:c?i(c):null,path:d}}var Vc="nextfloor.lock3d",Kc=520,rs=class extends Q{static properties={hass:{attribute:!1},building:{attribute:!1},floorId:{attribute:!1},roomId:{attribute:!1},wallMode:{attribute:!1},solidWalls:{attribute:!1},glassWalls:{attribute:!1},explode:{type:Boolean},keepRoof:{attribute:!1},markerMode:{attribute:!1},markerNames:{attribute:!1},markersOutside:{attribute:!1},tapInRoom:{type:Boolean},roomDoubleTap:{attribute:!1},heatMode:{attribute:!1},theme:{attribute:!1},accent:{attribute:!1},furnitureColors:{attribute:!1},packs:{attribute:!1},showEnergy:{attribute:!1},flows:{attribute:!1},holograms:{attribute:!1},furnish:{type:Boolean},surfaceGrab:{attribute:!1},furnishTypes:{attribute:!1},weather:{type:Boolean},weatherEntityId:{attribute:!1},weatherDensity:{attribute:!1},timeOfDay:{attribute:!1},selectedFurniture:{attribute:!1},selectedDevice:{attribute:!1},_sky:{state:!0},quality:{attribute:!1},showStats:{type:Boolean},_stats:{state:!0},_error:{state:!0},_energy:{state:!0},_flows:{state:!0},_liveEnergy:{state:!0},_liveCards:{state:!0},_liveCardOn:{state:!0},_houseFolded:{state:!0},_utilityOverviewVisible:{state:!0},_swipe:{state:!0},_menu:{state:!0},_pluginWindow:{state:!0},_plate:{state:!0},_blend:{state:!0},_wallBig:{state:!0},_find:{state:!0},_central:{state:!0},_thumbsCompact:{state:!0},_armed:{state:!0},central:{attribute:!1},centralOpen:{attribute:!1},keepCamera:{attribute:!1},plain:{attribute:!1},rightBack:{attribute:!1},templateName:{attribute:!1},readable:{type:Boolean,reflect:!0},today:{attribute:!1},_todayOpen:{state:!0},_todayItems:{state:!0},_forecast:{state:!0},zoom:{attribute:!1},buttons:{attribute:!1},_thumbs:{state:!0},floorThumbs:{attribute:!1},clean:{attribute:!1},cleanButton:{attribute:!1},clock:{attribute:!1},lockButton:{attribute:!1},walkButton:{attribute:!1},travelButton:{attribute:!1},_travel:{state:!0},_walking:{state:!0},_stick:{state:!0},_locked:{state:!0},_now:{state:!0},roomLabels:{attribute:!1},roomNamesButton:{attribute:!1},floorStack:{attribute:!1},panelOpen:{attribute:!1},alerts:{attribute:!1},alertJump:{attribute:!1},scenes:{attribute:!1},announcements:{attribute:!1},sensorBar:{attribute:!1},screenName:{attribute:!1},_announcement:{state:!0},dimmed:{attribute:!1},autoOrbit:{attribute:!1},startView:{attribute:!1},outsideOpen:{attribute:!1},_low:{state:!0},_narrowStage:{state:!0},_shortStage:{state:!0},_phoneStage:{state:!0},_alerts:{state:!0},_sceneFired:{state:!0}};stopAnnouncements=null;announceTimer;get liveCardsOn(){return this.holograms??this._liveCardOn}cloud=0;confirmSet=new Set;shownStartView;placementInfo=new Map;live=null;travelTimer;dayCurves=null;curvesAt=0;clockTimer;stopPlugins=null;pluginsDirty=!1;resizeObs=null;alertSrc=null;alertTimer;contactTimer;seenAlerts=new Set;roomFlash=null;findIndex=null;tintSig="";thumbTimer;thumbSig="";thumbsAt=0;armTimer;forecastAt=0;forecastKey Line truncated
`};customElements.get("nf-utility-overview")||customElements.define("nf-utility-overview",es);var Lc="image:";function ts(n,e,t){let r=(e??"").trim();if(!r)return null;if(r.startsWith(Lc))return t(r.slice(Lc.length));if(/^(https?:\/\/|\/)/.test(r))return r;if(/^[a-z_]+\.[a-z0-9_]+$/.test(r)){let i=n?.states[r]?.attributes.entity_picture;return typeof i=="string"&&i?i:null}return null}var Wn=n=>Number(n);function Vn(n){if(Array.isArray(n)){let[o,s]=[Wn(n[0]),Wn(n[1])];return Number.isFinite(o)&&Number.isFinite(s)?[o,s]:null}if(!n||typeof n!="object")return null;let{x:e,y:t}=n,[r,i]=[Wn(e),Wn(t)];return Number.isFinite(r)&&Number.isFinite(i)?[r,i]:null}function Oc(n){return n?Vn(n.charger)??Vn(n.charger_position):null}function Wc(n){for(let[e,t]of Object.entries(n.states))if(e.startsWith("camera.")&&(Vn(t.attributes?.vacuum_position)??Oc(t.attributes)))return e;return null}var Jf=n=>Array.isArray(n)?typeof n[0]=="number":!!n&&typeof n=="object",Bn=(n,e)=>e?[n[0],-n[1]]:n;function Qf(n){if(!n)return null;let e=n.mirror===!0,[t,r]=Bn(n.ga,e),[i,o]=Bn(n.gb,e),[s,a]=n.a,[l,u]=n.b,[c,h]=[i-t,o-r],[m,d]=[l-s,u-a],g=Math.hypot(c,h),_=Math.hypot(m,d);if(!(g>1e-6)||!(_>1e-6))return null;let b=_/g,v=Math.atan2(d,m)-Math.atan2(h,c),[S,k]=[Math.cos(v),Math.sin(v)];return M=>{let z=Bn(M,e),[R,D]=[z[0]-t,z[1]-r];return[s+b*(R*S-D*k),a+b*(R*k+D*S)]}}function Xf(n){if(!n)return null;let e=n.mirror===!0,[t,r]=Bn(n.ga,e),[i,o]=Bn(n.gb,e),s=Math.atan2(n.b[1]-n.a[1],n.b[0]-n.a[0])-Math.atan2(o-r,i-t);return Number.isFinite(s)?s:null}function Bc(n,e,t){if(!e)return null;let r=n.states[e]?.attributes;if(!r)return null;let i=Qf(t)??(g=>g),o=Xf(t)??0,s=t?.mirror===!0?-1:1,a=r.vacuum_position,l=Vn(a),u=l?(()=>{let[g,_]=i(l),b=Wn(a?.a)*s;if(!Number.isFinite(b))return{x:g,z:_,heading:0};let v=b*Math.PI/180+o;return{x:g,z:_,heading:Math.atan2(Math.cos(v),Math.sin(v))}})():null,c=Oc(r),h=Array.isArray(r.path)?r.path:[],m=h.length>0&&Jf(h[0])?[h]:h,d=[];for(let g of m){let _=[];for(let b of Array.isArray(g)?g:[]){let v=Vn(b);v&&_.push(i(v))}_.length>1&&d.push(_)}return!u&&!c&&!d.length?null:{pose:u,charger:c?i(c):null,path:d}}var Vc="nextfloor.lock3d",Kc=520,rs=class extends Q{static properties={hass:{attribute:!1},building:{attribute:!1},floorId:{attribute:!1},roomId:{attribute:!1},wallMode:{attribute:!1},solidWalls:{attribute:!1},glassWalls:{attribute:!1},explode:{type:Boolean},keepRoof:{attribute:!1},markerMode:{attribute:!1},markerNames:{attribute:!1},markersOutside:{attribute:!1},tapInRoom:{type:Boolean},roomDoubleTap:{attribute:!1},heatMode:{attribute:!1},theme:{attribute:!1},accent:{attribute:!1},furnitureColors:{attribute:!1},packs:{attribute:!1},showEnergy:{attribute:!1},flows:{attribute:!1},holograms:{attribute:!1},furnish:{type:Boolean},surfaceGrab:{attribute:!1},furnishTypes:{attribute:!1},weather:{type:Boolean},weatherEntityId:{attribute:!1},weatherDensity:{attribute:!1},timeOfDay:{attribute:!1},selectedFurniture:{attribute:!1},selectedDevice:{attribute:!1},_sky:{state:!0},quality:{attribute:!1},showStats:{type:Boolean},_stats:{state:!0},_error:{state:!0},_energy:{state:!0},_flows:{state:!0},_liveEnergy:{state:!0},_liveCards:{state:!0},_liveCardOn:{state:!0},_houseFolded:{state:!0},_utilityOverviewVisible:{state:!0},_swipe:{state:!0},_menu:{state:!0},_pluginWindow:{state:!0},_plate:{state:!0},_blend:{state:!0},_wallBig:{state:!0},_find:{state:!0},_central:{state:!0},_thumbsCompact:{state:!0},_armed:{state:!0},central:{attribute:!1},centralOpen:{attribute:!1},keepCamera:{attribute:!1},plain:{attribute:!1},rightBack:{attribute:!1},templateName:{attribute:!1},readable:{type:Boolean,reflect:!0},today:{attribute:!1},_todayOpen:{state:!0},_todayItems:{state:!0},_forecast:{state:!0},zoom:{attribute:!1},buttons:{attribute:!1},_thumbs:{state:!0},floorThumbs:{attribute:!1},clean:{attribute:!1},cleanButton:{attribute:!1},clock:{attribute:!1},lockButton:{attribute:!1},walkButton:{attribute:!1},travelButton:{attribute:!1},_travel:{state:!0},_walking:{state:!0},_stick:{state:!0},_locked:{state:!0},_now:{state:!0},roomLabels:{attribute:!1},roomNamesButton:{attribute:!1},floorStack:{attribute:!1},panelOpen:{attribute:!1},alerts:{attribute:!1},alertJump:{attribute:!1},scenes:{attribute:!1},announcements:{attribute:!1},sensorBar:{attribute:!1},screenName:{attribute:!1},_announcement:{state:!0},dimmed:{attribute:!1},autoOrbit:{attribute:!1},startView:{attribute:!1},outsideOpen:{attribute:!1},_low:{state:!0},_narrowStage:{state:!0},_shortStage:{state:!0},_phoneStage:{state:!0},_alerts:{state:!0},_sceneFired:{state:!0}};stopAnnouncements=null;announceTimer;get liveCardsOn(){return this.holograms??this._liveCardOn}cloud=0;confirmSet=new Set;shownStartView;placementInfo=new Map;live=null;travelTimer;dayCurves=null;curvesAt=0;clockTimer;stopPlugins=null;pluginsDirty=!1;resizeObs=null;alertSrc=null;alertTimer;contactTimer;seenAlerts=new Set;roomFlash=null;findIndex=null;tintSig="";thumbTimer;thumbSig="";thumbsAt=0;armTimer;forecastAt=0;forecastKey Line truncated
${e.map(t=>p`<button class="nf-chip" aria-pressed=${!this.hiddenLayers.has(t.id)} @click=${()=>this.toggleLayer(t.id)}>${this.hiddenLayers.has(t.id)?"\u25CC":"\u{1F441}"} ${t.name}</button>`)}
</div>`}syncDevices(e){let t=this.viewer,r=this.building;if(!t||!r||!this.hass)return;let i=this._travel,o=i&&!i.loading?Ut(this.hass,i.history,i.t):this.hass;if((e||!this.openingLinks||this.linkedRegistry!==o.entities)&&(this.openingLinks=Be(o,r.floors),this.furnitureLinks=Ke(o,r.floors),this.linkedRegistry=o.entities,this.findIndex=null,this.alertSrc=this.alerts?Ru(o,r,this.weatherEntityId,this.openingLinks):null,this.watched=Iu({hass:o,building:r,openingLinks:this.openingLinks,furnitureLinks:this.furnitureLinks,needsRoomSensors:this.heatMode!=="none"||this.roomLabels,alertSources:this.alertSrc,weatherEntityId:this.weatherEntityId}),e=!0),!(e||this.watched.some(y=>this.shownStates.get(y)!==o.states[y])))return;ao(o,r).join(",")!==this.shownFor?.key&&t.setBuilding(this.shownBuilding(o)),this.shownStates=new Map(this.watched.map(y=>[y,o.states[y]])),this.syncHydronics(t,r,o),this.refreshToday(r),this.refreshForecast(r);let a=kn(o,r),l=Xa(o,r.floors.some(y=>y.layer&&this.hiddenLayers.has(y.id))?this.shownBuilding(o):r);this.placementInfo=new Map(l.map(y=>[y.id,{floorId:y.floorId,roomId:y.roomId,x:y.x,z:y.z,y:y.y,rotation:y.rotation??0}]));let u=this.furnitureMarkers(o,r,new Set(l.map(y=>y.id)),new Set(a.map(y=>y.powerEntity)));a.push(...u.consumers);let c=Sn(o,r,a,Ze(r,y=>this.furnitureLinks?.get(y.id)?.power??null)),h=new Map(a.filter(y=>y.id!==y.powerEntity).map(y=>[y.id,y.power]));this.confirmSet=bt(o,r.floors);let m=new Set(this.liveCardsOn?this._liveCards.flatMap(y=>y.kind==="media"?[y.media.entity]:y.kind==="car"?[y.spot]:[]):[]);for(let y of r.floors)for(let x of y.outdoor??[]){if(!x.area_id&&!x.temp_entity&&!x.pump_entity)continue;let B=x.temp_entity?o.states[x.temp_entity]:void 0,D=x.pump_entity?o.states[x.pump_entity]:void 0,[W,_e]=Te(x.points),ut=B&&Number.isFinite(Number(B.state))?`${L(o,ue(o,pr(Number(B.state),B.attributes.unit_of_measurement)),1)} ${re(o)}`:"",$t=!!D&&te(D);l.push({id:x.area_id?`outdoor:${x.id}`:x.pump_entity??x.temp_entity,floorId:y.id,roomId:null,x:W,z:_e,y:lr(y,x,W,_e)+.7,icon:De(x.type==="pool"?"pool":x.type==="terrace"?"table-chair":"tree-outline"),name:x.area_id&&o.areas?.[x.area_id]?.name||$(o,`out_${x.type}`),text:[ut,$t?$(o,"pool_pump_on"):""].filter(Boolean).join(" \xB7 "),active:$t,unavailable:!1,glow:null,show:"always"})}let d=new Map;for(let y of r.floors){for(let x of y.placements)x.pin_offset&&d.set(`${y.id}:${x.entity_id}`,x.pin_offset);for(let x of y.furniture)x.pin_offset&&d.set(`f:${x.id}`,x.pin_offset)}let g=y=>{let x=y.lamp?void 0:(y.furnitureId?d.get(`f:${y.furnitureId}`):void 0)??d.get(`${y.floorId}:${y.id}`);return x?{...y,x:y.x+(x.x??0),z:y.z+(x.z??0),y:y.y+(x.y??0)}:y};t.setDevices([...[...l,...u.markers].map(g).map(y=>{let x=y.show==="no_power"||"energyDevice"in y&&y.energyDevice?null:h.get(y.id)??null,B={...y,power:x,powerText:x===null?void 0:he(o,x),effect:this.dimmed?void 0:y.effect,text:this.subMeterText(o,r,c,y.furnitureId)??y.text},D=y.ownName&&(y.showName||this.markerNames)?y.ownName:"",W=m.has(y.id)||!!y.furnitureId&&m.has(y.furnitureId);return{...B,pin:this.showPin(B)&&!W,full:y.show==="always",caption:D}})]),t.setPickTargets(u.targets,this.openingTargets(),this.secondBlinds()),t.setScreens(u.screens),t.setFridgeDoors(Ha(o,r.floors)),t.setCovers(Ga(o,r)),t.setRobots(this.robotInfos(o,r));let _=new Map;for(let y of r.floors)for(let x of y.furniture)!X(x.type)?.pet||!x.room_sensor||x.room_sensor==="none"||_.set(x.id,qi(o,y.rooms.filter(B=>B.points.length>=3),null,x.room_sensor)?.id??null);_.size&&t.setPetRooms(_),t.setRoofWindows(Su(o,r)),t.setParked(Do(o,r)),t.setGateStates(Bu(o,r));let b=new Map(r.floors.flatMap(y=>y.openings.map(x=>[x.id,x.type]))),v=new Map([...this.openingLinks].map(([y,x])=>[y,Ve(o,x,b.get(y))]));t.setOpeningStates(v),this.setAlerts(this.alertSrc?Ro(o,r,this.alertSrc,this.openingLinks):[]),this.watchLostContacts(o);let S=[...l,...u.markers].map(y=>`${y.id}:${y.glow?`${y.glow.level.toFixed(1)}/${y.glow.color.map(x=>x.toFixed(1)).join("/")}`:0}`).join(";")+"|"+[...v].map(([y,x])=>`${y}:${x.open}:${x.cover===null?"-":x.cover.toFixed(1)}`).join(";");if(S!==this.thumbSig){let y=this.thumbSig==="";this.thumbSig=S,y||this.scheduleThumbs(1500)}let k=nc(o,r,a,r.energy.advanced?y=>this.furnitureLinks?.get(y.id)?.power??null:void 0),M=this.liveCars(o,r);for(let y of M){if(!y.car.home||!y.car.charging&&!y.car.plugged)continue;let x=r.floors.flatMap(W=>W.furniture.filter(_e=>_e.type==="wallbox").map(_e=>({floorId:W.id,x:_e.x,z:_e.z,y:1}))).sort((W,_e)=>Math.hypot(W.x-y.at.x,W.z-y.at.z)-Math.hypot(_e.x-y.at.x,_e.z-y.at.z))[0],B=x&&x.floorId===y.at.floorId&&Math.hypot(x.x-y.at.x,x.z-y.at.z)<9,D=x??Cn(r);!D||!y.car.charging&&!B||k.arcs.push({key:`car:${y.spot}`,from:D,to:{...y.at,y:.8},power:y.car.charging?y.car.chargingW??7e3:0,color:[80,175,255],...B?{via:[{...D,y:.35},{floorId:y.at.floorId,x:(D.x+y.at.x)/2,z:(D.z+y.at.z)/2,y:.08},{...y.at,y:.5}],cable:!0}:{}})}let z=Cn(r);for(let y of this.liveHeatPumps(r)){let x=y.pump.heat??(y.Line truncated
</div>`}syncDevices(e){let t=this.viewer,r=this.building;if(!t||!r||!this.hass)return;let i=this._travel,o=i&&!i.loading?Ut(this.hass,i.history,i.t):this.hass;if((e||!this.openingLinks||this.linkedRegistry!==o.entities)&&(this.openingLinks=Be(o,r.floors),this.furnitureLinks=Ke(o,r.floors),this.linkedRegistry=o.entities,this.findIndex=null,this.alertSrc=this.alerts?Ru(o,r,this.weatherEntityId,this.openingLinks):null,this.watched=Iu({hass:o,building:r,openingLinks:this.openingLinks,furnitureLinks:this.furnitureLinks,needsRoomSensors:this.heatMode!=="none"||this.roomLabels,alertSources:this.alertSrc,weatherEntityId:this.weatherEntityId}),e=!0),!(e||this.watched.some(y=>this.shownStates.get(y)!==o.states[y])))return;ao(o,r).join(",")!==this.shownFor?.key&&t.setBuilding(this.shownBuilding(o)),this.shownStates=new Map(this.watched.map(y=>[y,o.states[y]])),this.syncHydronics(t,r,o),this.refreshToday(r),this.refreshForecast(r);let a=kn(o,r),l=Xa(o,r.floors.some(y=>y.layer&&this.hiddenLayers.has(y.id))?this.shownBuilding(o):r);this.placementInfo=new Map(l.map(y=>[y.id,{floorId:y.floorId,roomId:y.roomId,x:y.x,z:y.z,y:y.y,rotation:y.rotation??0}]));let u=this.furnitureMarkers(o,r,new Set(l.map(y=>y.id)),new Set(a.map(y=>y.powerEntity)));a.push(...u.consumers);let c=Sn(o,r,a,Ze(r,y=>this.furnitureLinks?.get(y.id)?.power??null)),h=new Map(a.filter(y=>y.id!==y.powerEntity).map(y=>[y.id,y.power]));this.confirmSet=bt(o,r.floors);let m=new Set(this.liveCardsOn?this._liveCards.flatMap(y=>y.kind==="media"?[y.media.entity]:y.kind==="car"?[y.spot]:[]):[]);for(let y of r.floors)for(let x of y.outdoor??[]){if(!x.area_id&&!x.temp_entity&&!x.pump_entity)continue;let B=x.temp_entity?o.states[x.temp_entity]:void 0,F=x.pump_entity?o.states[x.pump_entity]:void 0,[W,_e]=Te(x.points),ut=B&&Number.isFinite(Number(B.state))?`${L(o,ue(o,pr(Number(B.state),B.attributes.unit_of_measurement)),1)} ${re(o)}`:"",$t=!!F&&te(F);l.push({id:x.area_id?`outdoor:${x.id}`:x.pump_entity??x.temp_entity,floorId:y.id,roomId:null,x:W,z:_e,y:lr(y,x,W,_e)+.7,icon:Fe(x.type==="pool"?"pool":x.type==="terrace"?"table-chair":"tree-outline"),name:x.area_id&&o.areas?.[x.area_id]?.name||$(o,`out_${x.type}`),text:[ut,$t?$(o,"pool_pump_on"):""].filter(Boolean).join(" \xB7 "),active:$t,unavailable:!1,glow:null,show:"always"})}let d=new Map;for(let y of r.floors){for(let x of y.placements)x.pin_offset&&d.set(`${y.id}:${x.entity_id}`,x.pin_offset);for(let x of y.furniture)x.pin_offset&&d.set(`f:${x.id}`,x.pin_offset)}let g=y=>{let x=y.lamp?void 0:(y.furnitureId?d.get(`f:${y.furnitureId}`):void 0)??d.get(`${y.floorId}:${y.id}`);return x?{...y,x:y.x+(x.x??0),z:y.z+(x.z??0),y:y.y+(x.y??0)}:y};t.setDevices([...[...l,...u.markers].map(g).map(y=>{let x=y.show==="no_power"||"energyDevice"in y&&y.energyDevice?null:h.get(y.id)??null,B={...y,power:x,powerText:x===null?void 0:he(o,x),effect:this.dimmed?void 0:y.effect,text:this.subMeterText(o,r,c,y.furnitureId)??y.text},F=y.ownName&&(y.showName||this.markerNames)?y.ownName:"",W=m.has(y.id)||!!y.furnitureId&&m.has(y.furnitureId);return{...B,pin:this.showPin(B)&&!W,full:y.show==="always",caption:F}})]),t.setPickTargets(u.targets,this.openingTargets(),this.secondBlinds()),t.setScreens(u.screens),t.setFridgeDoors(Ha(o,r.floors)),t.setCovers(Ga(o,r)),t.setRobots(this.robotInfos(o,r));let _=new Map;for(let y of r.floors)for(let x of y.furniture)!X(x.type)?.pet||!x.room_sensor||x.room_sensor==="none"||_.set(x.id,qi(o,y.rooms.filter(B=>B.points.length>=3),null,x.room_sensor)?.id??null);_.size&&t.setPetRooms(_),t.setRoofWindows(Su(o,r)),t.setParked(Fo(o,r)),t.setGateStates(Bu(o,r));let b=new Map(r.floors.flatMap(y=>y.openings.map(x=>[x.id,x.type]))),v=new Map([...this.openingLinks].map(([y,x])=>[y,Ve(o,x,b.get(y))]));t.setOpeningStates(v),this.setAlerts(this.alertSrc?Ro(o,r,this.alertSrc,this.openingLinks):[]),this.watchLostContacts(o);let S=[...l,...u.markers].map(y=>`${y.id}:${y.glow?`${y.glow.level.toFixed(1)}/${y.glow.color.map(x=>x.toFixed(1)).join("/")}`:0}`).join(";")+"|"+[...v].map(([y,x])=>`${y}:${x.open}:${x.cover===null?"-":x.cover.toFixed(1)}`).join(";");if(S!==this.thumbSig){let y=this.thumbSig==="";this.thumbSig=S,y||this.scheduleThumbs(1500)}let k=nc(o,r,a,r.energy.advanced?y=>this.furnitureLinks?.get(y.id)?.power??null:void 0),M=this.liveCars(o,r);for(let y of M){if(!y.car.home||!y.car.charging&&!y.car.plugged)continue;let x=r.floors.flatMap(W=>W.furniture.filter(_e=>_e.type==="wallbox").map(_e=>({floorId:W.id,x:_e.x,z:_e.z,y:1}))).sort((W,_e)=>Math.hypot(W.x-y.at.x,W.z-y.at.z)-Math.hypot(_e.x-y.at.x,_e.z-y.at.z))[0],B=x&&x.floorId===y.at.floorId&&Math.hypot(x.x-y.at.x,x.z-y.at.z)<9,F=x??Cn(r);!F||!y.car.charging&&!B||k.arcs.push({key:`car:${y.spot}`,from:F,to:{...y.at,y:.8},power:y.car.charging?y.car.chargingW??7e3:0,color:[80,175,255],...B?{via:[{...F,y:.35},{floorId:y.at.floorId,x:(F.x+y.at.x)/2,z:(F.z+y.at.z)/2,y:.08},{...y.at,y:.5}],cable:!0}:{}})}let z=Cn(r);for(let y of this.liveHeatPumps(r)){let x=y.pump.heat??(y.Line truncated
<button class="nf-thumbs-fold" title=${$(this.hass,r?"thumbs_show":"thumbs_fold")} aria-label=${$(this.hass,r?"thumbs_show":"thumbs_fold")} @click=${i}>${r?"\u25B8":"\u25C2"}</button>
<button class="nf-thumb nf-thumb-house" aria-pressed=${this.floorId===null} @click=${()=>this.fire("floor-tap",{floorId:null})}>
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"><path d="M3 11l9-7 9 7M5 10v10h14V10" /></svg>
@@ -1821,7 +1821,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
<span>${$(this.hass,"holos")}</span><b>◫</b>
</button>`}utilityOverview(e){let t=this.building;if(!t||!V(this.hass)||!this.showEnergy||this.clean||this.roomId||this.panelOpen||!e&&!this._utilityOverviewVisible)return f;let r=t.floors.flatMap(o=>o.rooms);return(this.floorId?t.floors.filter(o=>o.id===this.floorId):t.floors).some(o=>Ce(this.hass,o,r).length||Bt(this.hass,o,r,!0).length)?p`<nf-utility-overview ?inline=${e} .hass=${this.hass} .floors=${t.floors} .floorId=${this.floorId} .compact=${this._narrowStage}
@utility-open=${o=>{o.stopPropagation(),o.detail.roomId?this.openRoom(o.detail.floorId,o.detail.roomId):this.fire("floor-tap",{floorId:o.detail.floorId})}}></nf-utility-overview>`:f}ownSensors(){let e=this.utilityOverview(!0),t=e===f?f:p`<button class="nf-energy-item nf-flow-toggle nf-utility-overview-toggle" aria-label="Rechte Übersicht" aria-pressed=${this._utilityOverviewVisible} title=${this._utilityOverviewVisible?"Rechte \xDCbersicht ausblenden":"Rechte \xDCbersicht einblenden"} @click=${()=>{this._utilityOverviewVisible=!this._utilityOverviewVisible;try{localStorage.setItem("nextfloor.utility_overview",this._utilityOverviewVisible?"1":"0")}catch{}}}><span>Übersicht</span><b aria-hidden="true"><svg width="18" height="16" viewBox="0 0 20 16" fill="none" stroke="currentColor" stroke-width="1.3"><rect x="1" y="1" width="18" height="14" rx="2"/><path d="M12 1v14m2-10h3m-3 3h3m-3 3h3"/></svg></b></button>`,r=this.sensorBar&&this.hass?this.building?.settings.status_entities??[]:[],i=V(this.hass)?(this.building?.presence??[]).filter(u=>dl(this.hass,u.person,[0])).map(u=>p`<div class="nf-energy-item nf-presence-state"><span>${u.name||O(this.hass,u.person)}</span><b>${le(this.hass.states[u.person])===null?"\u2013":le(this.hass.states[u.person])?"Anwesend":"Abwesend"}${G(this.hass,[u.person],u.name||"Anwesenheit")}</b></div>`):[],o=V(this.hass)?Object.entries(this.building?.settings.weather_variables??{}).filter(u=>!!u[1]&&u[1]!=="none").map(([u,c])=>[Nc[u]||u,c]):[];V(this.hass)&&this.building?.settings.rain_sensor&&this.building.settings.rain_sensor!=="none"&&o.push(["Regensensor",this.building.settings.rain_sensor]);let s=o.length?p`<button class="nf-energy-item nf-flow-toggle nf-weather-values" aria-label="Wetterwerte anzeigen" title="Wetterwerte anzeigen" aria-haspopup="dialog" @click=${()=>this.renderRoot.querySelector(".nf-weather-dialog")?.showModal()}><span>Wetter</span><b aria-hidden="true">⛅</b></button>
<dialog class="nf-weather-dialog" aria-label="Wetterwerte" @keydown=${u=>u.stopPropagation()}><header><b>Wetter</b><button type="button" class="nf-chip" aria-label="Schließen" @click=${()=>this.renderRoot.querySelector(".nf-weather-dialog")?.close()}>×</button></header>${o.map(([u,c])=>p`<p><span>${u}</span><b>${Fe(this.hass.states[c])}${G(this.hass,[c],u)}</b></p>`)}</dialog>`:f,a=V(this.hass)?(this.building?.floors??[]).filter(u=>!this.floorId||u.id===this.floorId).map(u=>({floor:u,readings:Ce(this.hass,u,this.building?.floors.flatMap(c=>c.rooms))})).filter(u=>u.readings.length):[],l=a.length?p`<button class="nf-energy-item nf-flow-toggle nf-utility-toggle" aria-label="Stockwerkszähler anzeigen" title="Stockwerkszähler anzeigen" aria-haspopup="dialog" @click=${()=>this.renderRoot.querySelector(".nf-utility-dialog")?.showModal()}><span>Stockwerkszähler</span><b aria-hidden="true">⚡ 💧</b></button>
<dialog class="nf-weather-dialog" aria-label="Wetterwerte" @keydown=${u=>u.stopPropagation()}><header><b>Wetter</b><button type="button" class="nf-chip" aria-label="Schließen" @click=${()=>this.renderRoot.querySelector(".nf-weather-dialog")?.close()}>×</button></header>${o.map(([u,c])=>p`<p><span>${u}</span><b>${De(this.hass.states[c])}${G(this.hass,[c],u)}</b></p>`)}</dialog>`:f,a=V(this.hass)?(this.building?.floors??[]).filter(u=>!this.floorId||u.id===this.floorId).map(u=>({floor:u,readings:Ce(this.hass,u,this.building?.floors.flatMap(c=>c.rooms))})).filter(u=>u.readings.length):[],l=a.length?p`<button class="nf-energy-item nf-flow-toggle nf-utility-toggle" aria-label="Stockwerkszähler anzeigen" title="Stockwerkszähler anzeigen" aria-haspopup="dialog" @click=${()=>this.renderRoot.querySelector(".nf-utility-dialog")?.showModal()}><span>Stockwerkszähler</span><b aria-hidden="true">⚡ 💧</b></button>
<dialog class="nf-weather-dialog nf-utility-dialog" aria-label="Stockwerkszähler" @keydown=${u=>u.stopPropagation()}><header><b>Stockwerkszähler</b><button type="button" class="nf-chip" aria-label="Schließen" @click=${()=>this.renderRoot.querySelector(".nf-utility-dialog")?.close()}>×</button></header>${a.map(({floor:u,readings:c})=>p`<h3>${u.name}</h3><nf-utility-report .hass=${this.hass} .readings=${c}></nf-utility-report>`)}</dialog>`:f;return[t,e,...i,s,l,...r.filter(u=>this.hass.states[u]).map(u=>p`<button class="nf-energy-item nf-own-sensor" title=${O(this.hass,u)} @click=${()=>ke(this,u)}>
<span>${O(this.hass,u)}</span><b>${se(this.hass,this.hass.states[u])}</b>
</button>${G(this.hass,[u],O(this.hass,u))}`)]}renderMapCredit(){let e=this.building?.settings.map;return Wu(e)?p`<a class="nf-map-credit" href=${Ho(e).href} target="_blank" rel="noopener">${Ho(e).text}</a>`:f}renderLegend(){if(this.heatMode==="wifi")return this.renderWifiLegend();if(this.heatMode==="none"||this.heatMode==="values")return f;let e=yt(new Date,this.hass?.config?.latitude??50),t=Vr(this.heatMode,e),r=this.heatMode==="temperature",i=r?ue(this.hass,t.stops[0][0]):t.stops[0][0],o=r?ue(this.hass,t.stops[t.stops.length-1][0]):t.stops[t.stops.length-1][0],s=r?re(this.hass):t.unit,a=l=>$(this.hass,l);return p`<div class="nf-legend">
@@ -3449,7 +3449,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
inset: auto 16px 16px;
color: var(--nf-danger);
}
`]};customElements.get("nf-view3d")||customElements.define("nf-view3d",rs);function he(n,e){return Math.abs(e)>=1e3?`${L(n,e/1e3,1)} kW`:`${Math.round(e)} W`}function ns(n){return n.type==="tv_board"?n.h+.9:n.type==="tv_wall"||n.type==="kitchen_wall"?n.h+.25:n.h+.35}function tg(n,e){let t=e.attributes.percentage;return e.state==="on"&&typeof t=="number"?`${Math.round(t)} %`:se(n,e)}var Gc;function Uc(){let n=new URL("./nextfloor-editor.js?v=b932c2605f2b",new URL(import.meta.url)).href;return Gc??=import(n),Gc}var ng=.25,jc=n=>Math.round(n*1e3)/1e3,qc=(n,e,t)=>n.rooms.find(r=>r.points.length>=3&&H([e,t],r.points));function os(n,e,t,r,i){let o=qc(n,e,t);if(!o)return[r,i];let s=(a,l)=>H([a,l],o.points);return s(r,i)?[r,i]:s(r,t)?[r,t]:s(e,i)?[e,i]:[e,t]}function rg(n,e,t,r){return n.rooms.some(i=>i.id!==e.id&&i.points.some((o,s)=>{let a=i.points[(s+1)%i.points.length];return Math.abs(ce(ee(o,t),r))<.02&&Math.abs(ce(ee(a,t),r))<.02}))}var is=(n,e)=>Math.abs((n-e+540)%360-180);function Zc(n,e,t,r=ng){let i=qc(n,e.x,e.z);if(!i)return null;let o=i.points,s=gt(o)>=0?1:-1,a=null;return o.forEach((l,u)=>{let c=o[(u+1)%o.length],h=qe(ee(c,l));if(h<.3)return;let m=[(c[0]-l[0])/h,(c[1]-l[1])/h],d=[-m[1]*s,m[0]*s],g=ce(ee([e.x,e.z],l),m);if(g<0||g>h)return;let _=rg(n,i,l,d)?t/2:0,b=ce(ee([e.x,e.z],l),d)-_,v=Math.atan2(-d[0],d[1])*180/Math.PI,k=[{rotation:v,extent:e.d/2},{rotation:v+90,extent:e.w/2},{rotation:v-90,extent:e.w/2}].reduce((z,R)=>is(e.rotation,R.rotation)<is(e.rotation,z.rotation)?R:z);if(is(e.rotation,k.rotation)>50)return;let M=b-k.extent;Math.abs(M)>r||a&&Math.abs(M)>=Math.abs(a.gap)||(a={x:jc(e.x-d[0]*M),z:jc(e.z-d[1]*M),rotation:(Math.round(k.rotation)%360+360)%360,gap:M})}),a&&{x:a.x,z:a.z,rotation:a.rotation}}function ci(n,e,t){let r=structuredClone(n);for(let i of r.floors){let o=i.furniture.find(s=>s.id===e);o&&t(o,i)}return r}function di(n,e,t){let r=structuredClone(n);for(let i of r.floors){let o=i.placements.find(s=>s.entity_id===e);o&&t(o,i)}return r}function Yc(n,e){let t=structuredClone(n);for(let r of t.floors)r.furniture=r.furniture.filter(i=>i.id!==e);return t}function Jc(n,e){let t=structuredClone(n);for(let r of t.floors)r.placements=r.placements.filter(i=>i.entity_id!==e);return t}function Qc(n,e,t,r){return di(n,e,(i,o)=>{[i.x,i.z]=os(o,i.x,i.z,t,r)})}function Xc(n,e,t,r){let i=n.settings.wall_interior??.12;return ci(n,e,(o,s)=>{[o.x,o.z]=os(s,o.x,o.z,t,r);let a=Zc(s,o,i);a&&Object.assign(o,a)})}var ss=(n,e)=>((n+e)%360+360)%360,ed=n=>Number.parseFloat(n.replace(",",".")),Kn=(n,e)=>Math.round(n*10**e)/10**e;function as(n){let{min:e,max:t,accepts:r=()=>!0}=n,i=o=>{let s=ed(o.target.value);!Number.isFinite(s)||!r(s)||n.apply(t===void 0?s:Math.min(t,Math.max(e,s)))};return p`<label class="nf-size" title=${n.title}
`]};customElements.get("nf-view3d")||customElements.define("nf-view3d",rs);function he(n,e){return Math.abs(e)>=1e3?`${L(n,e/1e3,1)} kW`:`${Math.round(e)} W`}function ns(n){return n.type==="tv_board"?n.h+.9:n.type==="tv_wall"||n.type==="kitchen_wall"?n.h+.25:n.h+.35}function tg(n,e){let t=e.attributes.percentage;return e.state==="on"&&typeof t=="number"?`${Math.round(t)} %`:se(n,e)}var Gc;function Uc(){let n=new URL("./nextfloor-editor.js?v=68203eb051b7",new URL(import.meta.url)).href;return Gc??=import(n),Gc}var ng=.25,jc=n=>Math.round(n*1e3)/1e3,qc=(n,e,t)=>n.rooms.find(r=>r.points.length>=3&&H([e,t],r.points));function os(n,e,t,r,i){let o=qc(n,e,t);if(!o)return[r,i];let s=(a,l)=>H([a,l],o.points);return s(r,i)?[r,i]:s(r,t)?[r,t]:s(e,i)?[e,i]:[e,t]}function rg(n,e,t,r){return n.rooms.some(i=>i.id!==e.id&&i.points.some((o,s)=>{let a=i.points[(s+1)%i.points.length];return Math.abs(ce(ee(o,t),r))<.02&&Math.abs(ce(ee(a,t),r))<.02}))}var is=(n,e)=>Math.abs((n-e+540)%360-180);function Zc(n,e,t,r=ng){let i=qc(n,e.x,e.z);if(!i)return null;let o=i.points,s=gt(o)>=0?1:-1,a=null;return o.forEach((l,u)=>{let c=o[(u+1)%o.length],h=qe(ee(c,l));if(h<.3)return;let m=[(c[0]-l[0])/h,(c[1]-l[1])/h],d=[-m[1]*s,m[0]*s],g=ce(ee([e.x,e.z],l),m);if(g<0||g>h)return;let _=rg(n,i,l,d)?t/2:0,b=ce(ee([e.x,e.z],l),d)-_,v=Math.atan2(-d[0],d[1])*180/Math.PI,k=[{rotation:v,extent:e.d/2},{rotation:v+90,extent:e.w/2},{rotation:v-90,extent:e.w/2}].reduce((z,R)=>is(e.rotation,R.rotation)<is(e.rotation,z.rotation)?R:z);if(is(e.rotation,k.rotation)>50)return;let M=b-k.extent;Math.abs(M)>r||a&&Math.abs(M)>=Math.abs(a.gap)||(a={x:jc(e.x-d[0]*M),z:jc(e.z-d[1]*M),rotation:(Math.round(k.rotation)%360+360)%360,gap:M})}),a&&{x:a.x,z:a.z,rotation:a.rotation}}function ci(n,e,t){let r=structuredClone(n);for(let i of r.floors){let o=i.furniture.find(s=>s.id===e);o&&t(o,i)}return r}function di(n,e,t){let r=structuredClone(n);for(let i of r.floors){let o=i.placements.find(s=>s.entity_id===e);o&&t(o,i)}return r}function Yc(n,e){let t=structuredClone(n);for(let r of t.floors)r.furniture=r.furniture.filter(i=>i.id!==e);return t}function Jc(n,e){let t=structuredClone(n);for(let r of t.floors)r.placements=r.placements.filter(i=>i.entity_id!==e);return t}function Qc(n,e,t,r){return di(n,e,(i,o)=>{[i.x,i.z]=os(o,i.x,i.z,t,r)})}function Xc(n,e,t,r){let i=n.settings.wall_interior??.12;return ci(n,e,(o,s)=>{[o.x,o.z]=os(s,o.x,o.z,t,r);let a=Zc(s,o,i);a&&Object.assign(o,a)})}var ss=(n,e)=>((n+e)%360+360)%360,ed=n=>Number.parseFloat(n.replace(",",".")),Kn=(n,e)=>Math.round(n*10**e)/10**e;function as(n){let{min:e,max:t,accepts:r=()=>!0}=n,i=o=>{let s=ed(o.target.value);!Number.isFinite(s)||!r(s)||n.apply(t===void 0?s:Math.min(t,Math.max(e,s)))};return p`<label class="nf-size" title=${n.title}
>${n.label}
<input type="number" inputmode="decimal" step=${n.step} min=${e} max=${t??f} .value=${String(Kn(n.value,2))} @change=${i} />
</label>`}var nd=(n,e)=>p`<button class="nf-chip" @click=${e}>${n.t("height_auto")}</button>`,td=(n,e)=>p`<button class="nf-chip" @click=${()=>e(-n)}>↺ ${n}°</button><button class="nf-chip" @click=${()=>e(n)}>↻ ${n}°</button>`;function ig(n,e){let t=n.building.floors.find(s=>s.furniture.some(a=>a.id===e)),r=t?.furniture.find(s=>s.id===e);if(!t||!r)return f;let i=(s,a)=>as({label:n.t(a),title:n.t(`size_${s}`),value:r[s],step:.05,min:.05,accepts:l=>l>0,apply:l=>n.editFurniture(e,u=>u[s]=Kn(l,3))}),o=aa(r)?p`${as({label:"\u2195",title:n.t("mount_height"),value:r.mount_y??oe(t,r),step:.05,min:0,accepts:s=>s>=0,apply:s=>n.editFurniture(e,a=>a.mount_y=Kn(s,3))})}
@@ -3960,7 +3960,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
gap: 12px;
margin: auto;
}
`;var ld=new WeakMap,ud=new WeakMap;function St(n,e){let t=ud.get(n)??n,r=ld.get(t)??new WeakMap;ld.set(t,r);let i=r.get(e);if(i)return i;let o=new Map;for(let l of e)for(let u of l.placements)u.entity_id.startsWith("cover.")&&o.set(u.entity_id,{tilt:u.cover_tilt==="none"?null:u.cover_tilt,position:u.position});for(let l of Be(t,e).values())l.cover&&!o.has(l.cover)&&o.set(l.cover,{tilt:l.coverTilt,position:l.position}),l.cover2&&!o.has(l.cover2)&&o.set(l.cover2,{tilt:l.cover2Tilt});let s={...t.states};for(let[l,u]of o){let c=t.states[l];if(!c)continue;let h={...c.attributes,nf_cover_control:!0},m=Pt(t,u.position);m===null&&(m=typeof c.attributes.current_position=="number"?c.attributes.current_position:null),m!==null&&(h.current_position=m);let d=u.tilt?t.states[u.tilt]:c,g=typeof d?.attributes.current_tilt_position=="number"?d.attributes.current_tilt_position:u.tilt?Pt(t,u.tilt):null;g!==null&&(h.current_tilt_position=g,h.supported_features=Number(h.supported_features??0)|128);let _=c.state;typeof h.current_position=="number"&&_!=="unavailable"&&_!=="unknown"&&_!=="opening"&&_!=="closing"&&(_=h.current_position>0?"open":"closed"),s[l]={...c,state:_,attributes:h}}let a={...t,states:s,callService:async(l,u,c={})=>{if(l!=="cover")return t.callService(l,u,c);let h=Array.isArray(c.entity_id)?c.entity_id:[c.entity_id],m=async d=>{let g=typeof d=="string"?o.get(d):void 0;if(!g)return t.callService(l,u,{...c,entity_id:d});let _={...c,entity_id:d},b=u;(b==="toggle"||b==="toggle_cover")&&(b=s[String(d)]?.state==="closed"?"open_cover":"close_cover");let v=b.includes("tilt");v&&g.tilt&&(_.entity_id=g.tilt);let S=g.tilt?t.states[g.tilt]:void 0;return v&&g.tilt&&!S?.attributes.symcon_id&&typeof S?.attributes.current_tilt_position!="number"&&(b==="set_cover_tilt_position"?(b="set_cover_position",_.position=_.tilt_position,delete _.tilt_position):b==="open_cover_tilt"?b="open_cover":b==="close_cover_tilt"&&(b="close_cover")),t.callService(l,b,_)};return Array.isArray(c.entity_id)?Promise.all(h.map(m)):m(h[0])}};return ud.set(a,t),r.set(e,a),a}var us=class extends Q{static properties={hass:{attribute:!1},narrow:{type:Boolean},route:{attribute:!1},panel:{attribute:!1},_mode:{state:!0},_editorReady:{state:!0},_floorId:{state:!0},_roomId:{state:!0},_wallMode:{state:!0},_prefs:{state:!0},_furnish:{state:!0},_selFurniture:{state:!0},_selDevice:{state:!0},_optsOpen:{state:!0},_switchesOpen:{state:!0},_timeOfDay:{state:!0},_outside:{state:!0},_timeDrag:{state:!0},_floorUndo:{state:!0},_variablesLoading:{state:!0},_variablesNotice:{state:!0},_variablesError:{state:!0}};outsideMemo=null;floorUndoTimer;data=new Ft(this);store=new hi(mi());constructor(){super(),this.narrow=!1,this._mode="view",this._editorReady=!!customElements.get("nf-editor"),this._floorId=null,this._roomId=null,this._wallMode="auto",this._prefs=this.store.load(location.search),this._furnish=!1,this._selFurniture=null,this._selDevice=null,this._optsOpen=!1,this._switchesOpen=!1,this._timeOfDay=null,this._outside=!1,this._timeDrag=null,this._floorUndo=null,this._variablesLoading=!1,this._variablesNotice="",this._variablesError=!1}toggleTimeSlider(e){this.setPref("timeSlider",e),e||([this._timeOfDay,this._timeDrag]=[null,null])}sunState(){let e=this.hass?.config;return this._timeOfDay===null||e?.latitude===void 0||e.longitude===void 0?this.hass?.states["sun.sun"]?.state:ft(Et(this._timeOfDay,e.time_zone),e.latitude,e.longitude).elevation>0?"above_horizon":"below_horizon"}renderTimeOfDay(){let e=this.t;if(this.hass?.config?.latitude===void 0)return f;let t=this._timeDrag??this._timeOfDay,r=o=>`${String(Math.floor(o)).padStart(2,"0")}:${String(Math.round(o%1*60)).padStart(2,"0")}`,i=()=>{let o=new Date;return Math.round((o.getHours()+o.getMinutes()/60)*4)/4};return p`<button class="nf-chip" aria-pressed=${t!==null} title=${e("time_of_day_hint")} @click=${()=>(this._timeDrag=null,this._timeOfDay=t===null?i():null)}>☀ ${t===null?e("time_of_day"):r(t)}</button>
`;var ld=new WeakMap,ud=new WeakMap;function St(n,e){let t=ud.get(n)??n,r=ld.get(t)??new WeakMap;ld.set(t,r);let i=r.get(e);if(i)return i;let o=new Map;for(let l of e)for(let u of l.placements)u.entity_id.startsWith("cover.")&&o.set(u.entity_id,{tilt:u.cover_tilt==="none"?null:u.cover_tilt,position:u.position});for(let l of Be(t,e).values())l.cover&&!o.has(l.cover)&&o.set(l.cover,{tilt:l.coverTilt,position:l.position}),l.cover2&&!o.has(l.cover2)&&o.set(l.cover2,{tilt:l.cover2Tilt});let s={...t.states};for(let[l,u]of o){let c=t.states[l];if(!c)continue;let h={...c.attributes,nf_cover_control:!0},m=Pt(t,u.position);m===null&&(m=typeof c.attributes.current_position=="number"?c.attributes.current_position:null),m!==null&&(h.current_position=m);let d=u.tilt?t.states[u.tilt]:c,g=typeof d?.attributes.current_tilt_position=="number"?d.attributes.current_tilt_position:u.tilt?Pt(t,u.tilt):null;g!==null&&(h.current_tilt_position=g,h.supported_features=Number(h.supported_features??0)|128);let _=c.state;typeof h.current_position=="number"&&_!=="unavailable"&&_!=="unknown"&&_!=="opening"&&_!=="closing"&&(_=h.current_position>0?"open":"closed"),s[l]={...c,state:_,attributes:h}}let a={...t,states:s,callService:async(l,u,c={})=>{if(l!=="cover")return t.callService(l,u,c);let h=Array.isArray(c.entity_id)?c.entity_id:[c.entity_id],m=async d=>{let g=typeof d=="string"?o.get(d):void 0;if(!g)return t.callService(l,u,{...c,entity_id:d});let _={...c,entity_id:d},b=u;(b==="toggle"||b==="toggle_cover")&&(b=s[String(d)]?.state==="closed"?"open_cover":"close_cover");let v=b.includes("tilt");v&&g.tilt&&(_.entity_id=g.tilt);let S=g.tilt?t.states[g.tilt]:void 0;return v&&g.tilt&&!S?.attributes.symcon_id&&typeof S?.attributes.current_tilt_position!="number"&&(b==="set_cover_tilt_position"?(b="set_cover_position",_.position=_.tilt_position,delete _.tilt_position):b==="open_cover_tilt"?b="open_cover":b==="close_cover_tilt"&&(b="close_cover")),t.callService(l,b,_)};return Array.isArray(c.entity_id)?Promise.all(h.map(m)):m(h[0])}};return ud.set(a,t),r.set(e,a),a}var us=class extends Q{static properties={hass:{attribute:!1},narrow:{type:Boolean},route:{attribute:!1},panel:{attribute:!1},_mode:{state:!0},_editorReady:{state:!0},_floorId:{state:!0},_roomId:{state:!0},_wallMode:{state:!0},_prefs:{state:!0},_furnish:{state:!0},_selFurniture:{state:!0},_selDevice:{state:!0},_optsOpen:{state:!0},_switchesOpen:{state:!0},_timeOfDay:{state:!0},_outside:{state:!0},_timeDrag:{state:!0},_floorUndo:{state:!0},_variablesLoading:{state:!0},_variablesNotice:{state:!0},_variablesError:{state:!0}};outsideMemo=null;floorUndoTimer;data=new Dt(this);store=new hi(mi());constructor(){super(),this.narrow=!1,this._mode="view",this._editorReady=!!customElements.get("nf-editor"),this._floorId=null,this._roomId=null,this._wallMode="auto",this._prefs=this.store.load(location.search),this._furnish=!1,this._selFurniture=null,this._selDevice=null,this._optsOpen=!1,this._switchesOpen=!1,this._timeOfDay=null,this._outside=!1,this._timeDrag=null,this._floorUndo=null,this._variablesLoading=!1,this._variablesNotice="",this._variablesError=!1}toggleTimeSlider(e){this.setPref("timeSlider",e),e||([this._timeOfDay,this._timeDrag]=[null,null])}sunState(){let e=this.hass?.config;return this._timeOfDay===null||e?.latitude===void 0||e.longitude===void 0?this.hass?.states["sun.sun"]?.state:ft(Et(this._timeOfDay,e.time_zone),e.latitude,e.longitude).elevation>0?"above_horizon":"below_horizon"}renderTimeOfDay(){let e=this.t;if(this.hass?.config?.latitude===void 0)return f;let t=this._timeDrag??this._timeOfDay,r=o=>`${String(Math.floor(o)).padStart(2,"0")}:${String(Math.round(o%1*60)).padStart(2,"0")}`,i=()=>{let o=new Date;return Math.round((o.getHours()+o.getMinutes()/60)*4)/4};return p`<button class="nf-chip" aria-pressed=${t!==null} title=${e("time_of_day_hint")} @click=${()=>(this._timeDrag=null,this._timeOfDay=t===null?i():null)}>☀ ${t===null?e("time_of_day"):r(t)}</button>
${t!==null?p`<label class="nf-chip nf-time-slider"
><input type="range" min="0" max="23.75" step="0.25" .value=${String(t)} aria-label=${e("time_of_day")} @input=${o=>this._timeDrag=Number(o.target.value)}
@change=${o=>(this._timeDrag=null,this._timeOfDay=Number(o.target.value))}
@@ -4280,7 +4280,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
justify-content: flex-end;
}
}
`;function cs(n,e){let t=n.template,r=t?e?.[t]:void 0;if(!r)return n;let{type:i,template:o,...s}=r;return{...s,...n}}function md(n,e){let t=new Set(e),r=[];for(let o of n.floors){let s=o.rooms.filter(u=>t.has(u.id));if(!s.length)continue;let a=(u,c)=>s.some(h=>h.points.length>=3&&H([u,c],h.points)),l=new Set(s.map(u=>u.id));r.push({...o,rooms:s,openings:o.openings.filter(u=>l.has(u.room_id)),furniture:o.furniture.filter(u=>a(u.x,u.z)),placements:o.placements.filter(u=>a(u.x,u.z)),walls:(o.walls??[]).filter(u=>a((u.a[0]+u.b[0])/2,(u.a[1]+u.b[1])/2)),outdoor:[]})}let i={...n.settings.roof,type:"none",sections:[],solar:[]};return{...n,floors:r,settings:{...n.settings,roof:i}}}var tn="nf-outside",ds=class extends Q{static properties={hass:{attribute:!1},_config:{state:!0},_roomId:{state:!0},_floorId:{state:!0},_walls:{state:!0},_heat:{state:!0},_explode:{state:!0},_fullscreen:{state:!0},_clean:{state:!0},_night:{state:!0},_orbit:{state:!0},_roomNames:{state:!0}};_own=null;templatesSeen;roomApplied=!1;data=new Ft(this);kiosk=new pi({config:()=>this._config,hass:()=>this.hass,setClean:e=>this._clean=e,isClean:()=>this._clean,setOrbit:e=>this._orbit=e,isOrbit:()=>this._orbit,setNight:e=>this._night=e,goHome:()=>this.returnHome()});constructor(){super(),this._roomId=null,this._floorId=void 0,this._walls=null,this._heat=null,this._explode=null,this._fullscreen=!1,this._clean=!1,this._night=!1,this._orbit=!1,this._roomNames=null}view3d(){return this.shadowRoot?.querySelector("nf-view3d")}returnHome(){this._roomId=this._config?.room??null,this._floorId=void 0,this.view3d()?.resetView(),this._config?.idle_orbit&&(this._orbit=!0)}openDashboard(e){history.pushState(null,"",e),window.dispatchEvent(new CustomEvent("location-changed",{bubbles:!0,composed:!0,detail:{replace:!1}}))}onFullscreen=()=>this._fullscreen=!!document.fullscreenElement&&this.shadowRoot?.contains(document.fullscreenElement)===!0;connectedCallback(){super.connectedCallback(),document.addEventListener("fullscreenchange",this.onFullscreen),this.kiosk.start()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("fullscreenchange",this.onFullscreen),this.kiosk.stop()}toggleFullscreen(){document.fullscreenElement?document.exitFullscreen():this.shadowRoot?.querySelector("ha-card")?.requestFullscreen?.()}static async getConfigElement(){return await Yn(),document.createElement("nextfloor-card-editor")}static getStubConfig(){return{type:"custom:nextfloor-card"}}setConfig(e){if(e.height!==void 0&&!(e.height>100))throw new Error("height must be a number of pixels above 100");this._roomNames=null,this._own=e,this._config=cs(e,this.data.building?.settings.card_templates),this._floorId=void 0,this._walls=null,this._heat=null,this._explode=null,this._orbit=!1,this._night=Gn(e.night,this.hass),this._clean=e.controls_hidden===!0,this.kiosk.armClean(),this.kiosk.armIdle()}getCardSize(){return Math.ceil((this._config?.height??420)/50)}getGridOptions(){return{columns:"full",rows:this._config?.fill?12:Math.ceil((this._config?.height??420)/56),min_rows:4}}willUpdate(e){let t=this.data.building?.settings.card_templates;if(this._own?.template&&t!==this.templatesSeen&&(this.templatesSeen=t,this._config=cs(this._own,t)),this.toggleAttribute("readable",this._config?.readable===!0),e.has("hass")&&(this.style.colorScheme=Tr(this.hass)),!e.has("hass")||!this.hass)return;this.data.setHass(this.hass);let r=Gn(this._config?.night,this.hass);r!==this._night&&(this._night=r)}get canSwitch(){return!this._config?.floor||this.thumbs}get thumbs(){return this._config?.floor_thumbs??!this._config?.floor}back(){this._roomId?this._roomId=null:this.canSwitch&&(this._floorId=null)}roomsMemo=null;plan(){let e=this.data.building??null,t=this._config?.rooms;if(!e||!t?.length)return e;let r=t.join(",");return(!this.roomsMemo||this.roomsMemo.source!==e||this.roomsMemo.ids!==r)&&(this.roomsMemo={source:e,ids:r,result:md(e,t)}),this.roomsMemo.result}t=e=>$(this.hass,e);stage(){let e=this.plan(),t=this._config,r=this._floorId===void 0?t?.floor??null:this._floorId,i=e&&e.floors.length===1?e.floors[0].id:e?.floors.some(a=>a.id===r)?r:null,o=!!this._roomId&&t?.room_panel!==!1,s=!!this._roomId&&t?.room_panel===!1||!this.thumbs&&this.canSwitch&&!this._roomId&&!!i&&(e?.floors.length??0)>1;return{floorId:i,walls:this._walls??t?.walls??"auto",heat:this._heat??t?.heatmap??"none",explode:this._explode??t?.explode??!0,canGoBack:s,showBar:!!e&&!this._clean&&(s||!!t?.controls&&!o)}}shows(e){let t=this._config?.controls;return t===!0||Array.isArray(t)&&t.includes(e)}renderBar(e){let t=this.plan(),r=this.t,i=["temperature","humidity","co2"].filter(s=>this.shows(s)),o=(s,a)=>p`<div class="nf-seg" role=${s?"group":f} aria-label=${s??f}>${a.map(([l,u,c])=>p`<button aria-pressed=${l} @click=${u}>${c}</button>`)}</div>`;return p`<div class="nf-card-controls">
`;function cs(n,e){let t=n.template,r=t?e?.[t]:void 0;if(!r)return n;let{type:i,template:o,...s}=r;return{...s,...n}}function md(n,e){let t=new Set(e),r=[];for(let o of n.floors){let s=o.rooms.filter(u=>t.has(u.id));if(!s.length)continue;let a=(u,c)=>s.some(h=>h.points.length>=3&&H([u,c],h.points)),l=new Set(s.map(u=>u.id));r.push({...o,rooms:s,openings:o.openings.filter(u=>l.has(u.room_id)),furniture:o.furniture.filter(u=>a(u.x,u.z)),placements:o.placements.filter(u=>a(u.x,u.z)),walls:(o.walls??[]).filter(u=>a((u.a[0]+u.b[0])/2,(u.a[1]+u.b[1])/2)),outdoor:[]})}let i={...n.settings.roof,type:"none",sections:[],solar:[]};return{...n,floors:r,settings:{...n.settings,roof:i}}}var tn="nf-outside",ds=class extends Q{static properties={hass:{attribute:!1},_config:{state:!0},_roomId:{state:!0},_floorId:{state:!0},_walls:{state:!0},_heat:{state:!0},_explode:{state:!0},_fullscreen:{state:!0},_clean:{state:!0},_night:{state:!0},_orbit:{state:!0},_roomNames:{state:!0}};_own=null;templatesSeen;roomApplied=!1;data=new Dt(this);kiosk=new pi({config:()=>this._config,hass:()=>this.hass,setClean:e=>this._clean=e,isClean:()=>this._clean,setOrbit:e=>this._orbit=e,isOrbit:()=>this._orbit,setNight:e=>this._night=e,goHome:()=>this.returnHome()});constructor(){super(),this._roomId=null,this._floorId=void 0,this._walls=null,this._heat=null,this._explode=null,this._fullscreen=!1,this._clean=!1,this._night=!1,this._orbit=!1,this._roomNames=null}view3d(){return this.shadowRoot?.querySelector("nf-view3d")}returnHome(){this._roomId=this._config?.room??null,this._floorId=void 0,this.view3d()?.resetView(),this._config?.idle_orbit&&(this._orbit=!0)}openDashboard(e){history.pushState(null,"",e),window.dispatchEvent(new CustomEvent("location-changed",{bubbles:!0,composed:!0,detail:{replace:!1}}))}onFullscreen=()=>this._fullscreen=!!document.fullscreenElement&&this.shadowRoot?.contains(document.fullscreenElement)===!0;connectedCallback(){super.connectedCallback(),document.addEventListener("fullscreenchange",this.onFullscreen),this.kiosk.start()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("fullscreenchange",this.onFullscreen),this.kiosk.stop()}toggleFullscreen(){document.fullscreenElement?document.exitFullscreen():this.shadowRoot?.querySelector("ha-card")?.requestFullscreen?.()}static async getConfigElement(){return await Yn(),document.createElement("nextfloor-card-editor")}static getStubConfig(){return{type:"custom:nextfloor-card"}}setConfig(e){if(e.height!==void 0&&!(e.height>100))throw new Error("height must be a number of pixels above 100");this._roomNames=null,this._own=e,this._config=cs(e,this.data.building?.settings.card_templates),this._floorId=void 0,this._walls=null,this._heat=null,this._explode=null,this._orbit=!1,this._night=Gn(e.night,this.hass),this._clean=e.controls_hidden===!0,this.kiosk.armClean(),this.kiosk.armIdle()}getCardSize(){return Math.ceil((this._config?.height??420)/50)}getGridOptions(){return{columns:"full",rows:this._config?.fill?12:Math.ceil((this._config?.height??420)/56),min_rows:4}}willUpdate(e){let t=this.data.building?.settings.card_templates;if(this._own?.template&&t!==this.templatesSeen&&(this.templatesSeen=t,this._config=cs(this._own,t)),this.toggleAttribute("readable",this._config?.readable===!0),e.has("hass")&&(this.style.colorScheme=Tr(this.hass)),!e.has("hass")||!this.hass)return;this.data.setHass(this.hass);let r=Gn(this._config?.night,this.hass);r!==this._night&&(this._night=r)}get canSwitch(){return!this._config?.floor||this.thumbs}get thumbs(){return this._config?.floor_thumbs??!this._config?.floor}back(){this._roomId?this._roomId=null:this.canSwitch&&(this._floorId=null)}roomsMemo=null;plan(){let e=this.data.building??null,t=this._config?.rooms;if(!e||!t?.length)return e;let r=t.join(",");return(!this.roomsMemo||this.roomsMemo.source!==e||this.roomsMemo.ids!==r)&&(this.roomsMemo={source:e,ids:r,result:md(e,t)}),this.roomsMemo.result}t=e=>$(this.hass,e);stage(){let e=this.plan(),t=this._config,r=this._floorId===void 0?t?.floor??null:this._floorId,i=e&&e.floors.length===1?e.floors[0].id:e?.floors.some(a=>a.id===r)?r:null,o=!!this._roomId&&t?.room_panel!==!1,s=!!this._roomId&&t?.room_panel===!1||!this.thumbs&&this.canSwitch&&!this._roomId&&!!i&&(e?.floors.length??0)>1;return{floorId:i,walls:this._walls??t?.walls??"auto",heat:this._heat??t?.heatmap??"none",explode:this._explode??t?.explode??!0,canGoBack:s,showBar:!!e&&!this._clean&&(s||!!t?.controls&&!o)}}shows(e){let t=this._config?.controls;return t===!0||Array.isArray(t)&&t.includes(e)}renderBar(e){let t=this.plan(),r=this.t,i=["temperature","humidity","co2"].filter(s=>this.shows(s)),o=(s,a)=>p`<div class="nf-seg" role=${s?"group":f} aria-label=${s??f}>${a.map(([l,u,c])=>p`<button aria-pressed=${l} @click=${u}>${c}</button>`)}</div>`;return p`<div class="nf-card-controls">
${e.canGoBack?p`<button class="nf-chip" @click=${()=>this.back()}>${r("back")}</button>`:f}
${this.shows("walls")?o(void 0,[[e.walls==="auto",()=>this._walls="auto",r("walls_auto")],[e.walls==="cut",()=>this._walls="cut",r("walls_cut")],[e.walls==="slope",()=>this._walls="slope",r("walls_slope")]]):f}
${this.shows("floors")&&t.floors.length>1&&!e.floorId?o(void 0,[[e.explode,()=>this._explode=!0,r("floors_apart")],[!e.explode,()=>this._explode=!1,r("floors_stacked")]]):f}
@@ -4376,7 +4376,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
${r.showBar&&e?this.renderBar(r):f}
${this.renderCorners()}
</div>
</ha-card>`}static styles=[ve,He,hd,zr]};if(!customElements.get("nextfloor-card")){customElements.define("nextfloor-card",ds);let n=window;n.customCards=n.customCards??[],n.customCards.push({type:"nextfloor-card",name:$(void 0,"card_name"),description:$(void 0,"card_description"),preview:!1})}Fi();
</ha-card>`}static styles=[ve,He,hd,zr]};if(!customElements.get("nextfloor-card")){customElements.define("nextfloor-card",ds);let n=window;n.customCards=n.customCards??[],n.customCards.push({type:"nextfloor-card",name:$(void 0,"card_name"),description:$(void 0,"card_description"),preview:!1})}Di();
/*! Bundled license information:
@lit/reactive-element/css-tag.js:
+17 -1
View File
@@ -617,7 +617,23 @@ BACKGROUND_SCHEMA = vol.Schema(
extra=vol.ALLOW_EXTRA,
)
OUTDOOR_TYPES = ["lawn", "terrace", "path", "driveway", "pool", "bed", "wild", "hedge", "fence", "pergola"]
OUTDOOR_TYPES = [
"lawn",
"terrace",
"path",
"driveway",
"street",
"sidewalk",
"gravel",
"river",
"stream",
"pool",
"bed",
"wild",
"hedge",
"fence",
"pergola",
]
FENCE_GATE_SCHEMA = vol.Schema(
{
+11 -8
View File
@@ -77,7 +77,7 @@ import { LibraryState, renderLibrary, renderPreview, type LibraryActions } from
import { arcFreeWall, arcRoomEdge, insertCorner } from "./editor/ops/rooms.ts";
import type { ArcActions, ArcEdit } from "./editor/forms/arc.ts";
import { dragStep, facingAngle, gridPositionAfter, hasLeftStart, headingAngle, outlineWithCornerAt, shifted, steppedDelta, straightEnd } from "./editor/ops/drags.ts";
import { snapToPlan } from "./editor/ops/snapping.ts";
import { snapOutdoorMove, snapToPlan, type SnapOptions } from "./editor/ops/snapping.ts";
import { draftLayer, guidesLayer } from "./editor/canvas/draft.ts";
import { devicesLayer, furnitureLayer, notesLayer } from "./editor/canvas/items.ts";
import { dimensionsLayer } from "./editor/canvas/plan.ts";
@@ -1239,10 +1239,10 @@ export class NfEditor extends LitElement {
// ------------------------------------------------------------------ snapping
/** The place in the plan a point lands on: corners and walls of other rooms, then the grid. `free` skips all of that. */
private snap(p: Vec2, skip?: { roomId: string; index?: number }, free = false): Vec2 {
private snap(p: Vec2, skip?: SnapOptions["skip"], free = false, outdoor = false): Vec2 {
this._guides = {};
if (free) return p;
const snapped = snapToPlan(p, { rooms: this.floor?.rooms ?? [], grid: this._doc.settings.grid, reach: SNAP_PX / this._view.scale, skip });
const snapped = snapToPlan(p, { rooms: this.floor?.rooms ?? [], outdoor: outdoor ? this.floor?.outdoor : undefined, grid: this._doc.settings.grid, reach: SNAP_PX / this._view.scale, skip });
this._guides = snapped.guides;
return snapped.point;
}
@@ -1481,7 +1481,7 @@ export class NfEditor extends LitElement {
private pressDrawingTool(press: Press): Gesture | undefined {
const tool = this._tool;
if (tool === "rect" || tool === "outdoor" || tool === "hole" || tool === "stairs") {
const start = this.snap(press.world, undefined, press.fine);
const start = this.snap(press.world, undefined, press.fine, tool === "outdoor");
return { kind: "rect", start, end: start, outdoor: tool === "outdoor", hole: tool === "hole", stairs: tool === "stairs" };
}
if (tool === "polygon" || tool === "measure") return { kind: "tap", startScreen: press.local, last: press.local, panning: false };
@@ -1613,7 +1613,7 @@ export class NfEditor extends LitElement {
const world = this.toWorld(...local);
const drag = this.drag;
if (!drag) {
if (this._tool !== "select" && this._tool !== "furniture" && this.floor) this._cursor = this.snap(world, undefined, e.altKey);
if (this._tool !== "select" && this._tool !== "furniture" && this.floor) this._cursor = this.snap(world, undefined, e.altKey, this._tool === "outdoor");
return;
}
this.moveDrag(drag, { local, world, fine: e.altKey, straight: e.shiftKey });
@@ -1661,7 +1661,7 @@ export class NfEditor extends LitElement {
drag.last = local;
return;
case "rect":
drag.end = this.snap(world, undefined, fine);
drag.end = this.snap(world, undefined, fine, !!drag.outdoor);
this.requestUpdate();
return;
case "freewall":
@@ -1786,13 +1786,16 @@ export class NfEditor extends LitElement {
drag.moved = true;
const area = this.floorOf(drag)?.outdoor.find((o) => o.id === drag.id);
if (!area) return;
const by = steppedDelta(drag.start, world, dragStep(grid, fine));
const initial = this.floorOf(drag)!;
const snapped = fine ? { by: steppedDelta(drag.start, world, dragStep(grid, true)), guides: {} } : snapOutdoorMove(area.points, [world[0] - drag.start[0], world[1] - drag.start[1]], { rooms: initial.rooms, outdoor: initial.outdoor, grid, reach: SNAP_PX / this._view.scale, skip: { outdoorId: drag.id } });
const { by } = snapped;
this._guides = snapped.guides;
this.live(drag, (_, floor) => void (floor.outdoor.find((o) => o.id === drag.id)!.points = area.points.map((p) => shifted(p, by))));
return;
}
case "outvertex": {
drag.moved = true;
const to = this.snap(world, undefined, fine);
const to = this.snap(world, { outdoorId: drag.id }, fine, true);
const area = this.floorOf(drag)?.outdoor.find((o) => o.id === drag.id);
if (!area) return;
this.live(drag, (_, floor) => {
@@ -49,7 +49,7 @@ export function renderOutdoorForm(host: EditorHost, area: OutdoorArea, actions:
${checkField(host, t("outdoor_outline"), area.outline !== false, (on) => set({ outline: on ? undefined : false }), { title: t("outdoor_outline_hint") })}
${area.type === "fence" || area.type === "pergola" ? checkField(host, t("outdoor_open"), !!area.open, (on) => set({ open: on || undefined }), { title: t("outdoor_open_hint") }) : nothing}
${area.type === "pergola" ? checkField(host, t("outdoor_bracing"), !!area.bracing, (on) => set({ bracing: on || undefined })) : nothing}
${checkField(host, t("outdoor_cut"), cutsOut(area), (on) => set({ cut: on === (area.type === "pool") ? undefined : on }), { title: t("outdoor_cut_hint") })}
${checkField(host, t("outdoor_cut"), cutsOut(area), (on) => set({ cut: on === cutsOut({ ...area, cut: undefined }) ? undefined : on }), { title: t("outdoor_cut_hint") })}
</div>
${area.type === "fence" ? fenceGates(host, area, set) : nothing}
${host.admin
@@ -1,7 +1,8 @@
import assert from "node:assert/strict";
import { test } from "node:test";
import { box } from "../../../entities/fixtures.ts";
import { snapToPlan } from "./snapping.ts";
import type { Vec2 } from "../../../model.ts";
import { snapOutdoorMove, snapToPlan } from "./snapping.ts";
const options = (extra = {}) => ({ rooms: [box("a", 0, 0, 4, 3)], grid: 0.1, reach: 0.2, ...extra });
@@ -41,3 +42,47 @@ test("walls along an axis are held to the grid when snapped to", () => {
const snapped = snapToPlan([2.37, 3.12], options({ grid: 0.5, reach: 0.3 }));
assert.deepEqual(snapped.point, [2.5, 3]);
});
const rect = (id: string, x: number, z: number, w: number, d: number) => ({ id, points: [[x, z], [x + w, z], [x + w, z + d], [x, z + d]] as Vec2[] });
const neighbor = rect("neighbor", 4.03, 0.07, 3, 3);
const outside = { rooms: [], outdoor: [neighbor], grid: 0.5, reach: 0.2 };
test("outdoor drawing and corner resizing snap to off-grid corners and edges", () => {
assert.deepEqual(snapToPlan([4.12, 0.14], outside).point, [4.03, 0.07]);
assert.deepEqual(snapToPlan([4.12, 1.2], outside).point, [4.03, 1]);
const self = rect("self", 0, 0, 4, 3);
const o = { ...outside, outdoor: [self, neighbor], skip: { outdoorId: "self" } };
assert.deepEqual(snapToPlan([4.06, 0.08], o).point, [4.03, 0.07]);
assert.deepEqual(snapToPlan([0.04, 0.06], { ...o, outdoor: [self] }).guides, {});
});
test("whole outdoor areas snap corners before rounding the pointer delta to a coarse grid", () => {
const moving = rect("moving", 0, 0, 2, 2);
const result = snapOutdoorMove(moving.points, [2.12, 0.14], { ...outside, outdoor: [moving, neighbor], skip: { outdoorId: "moving" } });
assert.deepEqual(result.by, [2.03, 0.07]);
assert.deepEqual(result.guides, { point: [4.03, 0.07] });
assert.deepEqual(moving.points, rect("moving", 0, 0, 2, 2).points, "never mutate the drag snapshot");
});
test("whole-area edges snap without changing shape, including a long edge covering a shorter target", () => {
const moving = rect("m", 0, -4, 2, 10);
const result = snapOutdoorMove(moving.points, [2.12, 0.32], outside);
assert.deepEqual(result.by, [2.03, 0.5]);
assert.deepEqual(result.guides, { x: 4.03 });
const diagonal = { id: "d", points: [[5, -2], [11, 4], [11, -2]] as Vec2[] };
const atEdge = snapOutdoorMove(rect("m", 0, 0, 1, 1).points, [7.1, 0], { ...outside, outdoor: [diagonal] });
assert.deepEqual(atEdge.by, [7.05, 0.05]);
});
test("distant areas keep grid translation and IDs never collide across rooms and outdoor areas", () => {
assert.deepEqual(snapOutdoorMove(rect("m", 0, 0, 1, 1).points, [10.12, 12.3], outside), { by: [10, 12.5], guides: {} });
const r = rect("same", 4.03, 0.07, 3, 3);
assert.deepEqual(snapToPlan([4.1, 0.1], { ...outside, rooms: [r], outdoor: [r], skip: { outdoorId: "same" } }).point, [4.03, 0.07]);
});
test("an open outdoor outline has no phantom closing edge to snap to", () => {
const o = { ...outside, outdoor: [{ id: "fence", open: true, points: [[0, 0], [4, 0], [4, 4]] as Vec2[] }] };
assert.equal(snapToPlan([2.1, 2.14], o).guides.point, undefined);
const moving = o.outdoor[0];
assert.deepEqual(snapOutdoorMove(moving.points, [0, 0], { ...outside, outdoor: [moving, rect("target", 1.9, 2, 0.2, 0.2)], skip: { outdoorId: moving.id } }).guides, {});
});
+61 -11
View File
@@ -1,19 +1,19 @@
// Where a point drawn in the plan lands: on a corner of another room, on another room's wall (so walls can meet in a T), or on the
// grid, lined up with other corners along each axis.
// Plan snapping: room corners/walls, optional outdoor corners/edges, then the grid and axis guides.
import type { Room, Vec2 } from "../../../model.ts";
import type { OutdoorArea, Room, Vec2 } from "../../../model.ts";
import type { Guides } from "../canvas/draft.ts";
const thousandths = (v: number) => Math.round(v * 1000) / 1000;
export interface SnapOptions {
rooms: readonly Room[];
rooms: readonly Pick<Room, "id" | "points">[];
outdoor?: readonly Pick<OutdoorArea, "id" | "points" | "open">[];
/** The grid step in metres. */
grid: number;
/** How close a point must be to something to snap to it, in metres. */
reach: number;
/** A room (or one corner of it) that is being moved and so is not something to snap to. */
skip?: { roomId: string; index?: number };
/** Exclude the moving outline; rooms can also exclude just one corner. */
skip?: { roomId?: string; outdoorId?: string; index?: number };
}
export interface Snapped {
@@ -23,7 +23,7 @@ export interface Snapped {
const distance = (a: Vec2, b: Vec2) => Math.hypot(a[0] - b[0], a[1] - b[1]);
/** The nearest corner of the other rooms within reach, if any. */
/** The nearest corner within reach, if any. */
function nearestCorner(corners: readonly Vec2[], p: Vec2, reach: number): Vec2 | null {
let best: Vec2 | null = null;
let bestDistance = reach;
@@ -35,12 +35,12 @@ function nearestCorner(corners: readonly Vec2[], p: Vec2, reach: number): Vec2 |
}
/** The point on a wall of another room that is nearest to p, within reach. Walls along an axis are held to the grid. */
function nearestOnWall(rooms: readonly Room[], p: Vec2, o: SnapOptions): Vec2 | null {
function nearestOnWall(rooms: readonly { id: string; points: Vec2[]; open?: boolean }[], p: Vec2, o: SnapOptions): Vec2 | null {
let best: Vec2 | null = null;
let bestDistance = o.reach;
for (const room of rooms) {
if (o.skip && room.id === o.skip.roomId) continue;
room.points.forEach((a, i) => {
if (room.open && i === room.points.length - 1) return;
const b = room.points[(i + 1) % room.points.length];
const [dx, dz] = [b[0] - a[0], b[1] - a[1]];
const squared = dx * dx + dz * dz;
@@ -79,10 +79,60 @@ function gridOrAligned(corners: readonly Vec2[], p: Vec2, o: SnapOptions): Snapp
}
export function snapToPlan(p: Vec2, o: SnapOptions): Snapped {
const corners = o.rooms.flatMap((room) => room.points.filter((_, i) => !(o.skip && room.id === o.skip.roomId && (o.skip.index === undefined || o.skip.index === i))));
// Separate namespaces: imported room and outdoor IDs need not be unique across both collections.
const areas = (o.outdoor ?? []).filter((a) => a.id !== o.skip?.outdoorId);
const corners = [...o.rooms.flatMap((room) => room.points.filter((_, i) => !(o.skip && room.id === o.skip.roomId && (o.skip.index === undefined || o.skip.index === i)))), ...areas.flatMap((a) => a.points)];
const corner = nearestCorner(corners, p, o.reach);
if (corner) return { point: [corner[0], corner[1]], guides: { point: corner } };
const wall = nearestOnWall(o.rooms, p, o);
const wall = nearestOnWall([...o.rooms.filter((r) => r.id !== o.skip?.roomId), ...areas], p, { ...o, skip: undefined });
if (wall) return { point: [thousandths(wall[0]), thousandths(wall[1])], guides: { point: wall } };
return gridOrAligned(corners, p, o);
}
/** Translate an entire outline onto nearby corners/edges, preserving every length and angle. */
export function snapOutdoorMove(points: readonly Vec2[], delta: Vec2, o: SnapOptions): { by: Vec2; guides: Guides } {
const targets = [...o.rooms.filter((r) => r.id !== o.skip?.roomId), ...(o.outdoor ?? []).filter((a) => a.id !== o.skip?.outdoorId)];
const moved = points.map((p): Vec2 => [p[0] + delta[0], p[1] + delta[1]]);
const movingOpen = o.outdoor?.find((a) => a.id === o.skip?.outdoorId)?.open;
const grid: Vec2 = delta.map((v) => thousandths(Math.round(v / o.grid) * o.grid)) as Vec2;
let corner: { by: Vec2; point: Vec2 } | undefined;
let best = o.reach;
for (const p of moved) for (const area of targets) for (const q of area.points) {
const d = distance(p, q);
if (d < best) {
best = d;
corner = { by: [delta[0] + q[0] - p[0], delta[1] + q[1] - p[1]], point: q };
}
}
if (corner) return { by: corner.by.map(thousandths) as Vec2, guides: { point: corner.point } };
let x: { offset: number; at: number } | undefined;
let z: { offset: number; at: number } | undefined;
let diagonal: { correction: Vec2; point: Vec2; d: number } | undefined;
const inspect = (p: Vec2, a: Vec2, b: Vec2, reverse = false) => {
const dx = b[0] - a[0], dz = b[1] - a[1], squared = dx * dx + dz * dz;
if (squared < 1e-9) return;
const t = ((p[0] - a[0]) * dx + (p[1] - a[1]) * dz) / squared;
if (t < 0 || t > 1) return;
const foot: Vec2 = [a[0] + t * dx, a[1] + t * dz];
const d = distance(p, foot);
if (d >= o.reach) return;
const sign = reverse ? -1 : 1;
const correction: Vec2 = [sign * (foot[0] - p[0]), sign * (foot[1] - p[1])];
if (Math.abs(dx) < 1e-9) {
if (!x || d < Math.abs(x.offset)) x = { offset: correction[0], at: reverse ? p[0] : a[0] };
} else if (Math.abs(dz) < 1e-9) {
if (!z || d < Math.abs(z.offset)) z = { offset: correction[1], at: reverse ? p[1] : a[1] };
} else if (!diagonal || d < diagonal.d) diagonal = { correction, point: reverse ? p : foot, d };
};
for (const area of targets) {
const open = "open" in area && area.open;
for (let i = 0; i < area.points.length - (open ? 1 : 0); i++) {
const a = area.points[i], b = area.points[(i + 1) % area.points.length];
for (const p of moved) inspect(p, a, b);
}
// A longer moving edge can cover a shorter stationary edge without either moving corner projecting onto it.
for (const p of area.points) for (let i = 0; i < moved.length - (movingOpen ? 1 : 0); i++) inspect(p, moved[i], moved[(i + 1) % moved.length], true);
}
if (!x && !z && diagonal) return { by: [thousandths(delta[0] + diagonal.correction[0]), thousandths(delta[1] + diagonal.correction[1])], guides: { point: diagonal.point } };
return { by: [x ? thousandths(delta[0] + x.offset) : grid[0], z ? thousandths(delta[1] + z.offset) : grid[1]], guides: { ...(x ? { x: x.at } : {}), ...(z ? { z: z.at } : {}) } };
}
+13 -1
View File
@@ -962,13 +962,25 @@ export const editorStyles = css`
fill: rgba(61, 224, 160, 0.1);
stroke: rgba(61, 224, 160, 0.5);
}
.nf-out-pool polygon {
.nf-out-pool polygon,
.nf-out-river polygon,
.nf-out-stream polygon {
fill: color-mix(in srgb, var(--nf-accent) 18%, transparent);
stroke: var(--nf-accent);
}
.nf-out-terrace polygon {
fill: rgba(150, 130, 255, 0.12);
}
.nf-out-street polygon {
fill: rgba(100, 110, 125, 0.28);
}
.nf-out-sidewalk polygon {
fill: rgba(175, 185, 200, 0.24);
}
.nf-out-gravel polygon {
fill: rgba(184, 163, 130, 0.24);
stroke: rgba(184, 163, 130, 0.65);
}
.nf-free-wall {
cursor: grab;
}
+14 -4
View File
@@ -1127,12 +1127,17 @@ const DE = {
outdoor_opacity_hint: "100 = undurchsichtig. Weniger macht die Fläche durchsichtig, etwa eine Einfahrt über dem Keller; der Umriss bleibt.",
outdoor_outline: "Umrisslinie zeigen",
outdoor_outline_hint: "Ohne Haken zeichnet die Fläche keine Leuchtlinie an ihrem Rand – für große Grundstücke aus mehreren Rasenflächen.",
outdoor_corners_hint: "Ecken: ein + auf einer Kante fügt eine Ecke hinzu, Ziehen formt die Fläche, × entfernt eine Ecke.",
outdoor_corners_hint: "Ecken: ein + auf einer Kante fügt eine Ecke hinzu, Ziehen formt die Fläche, × entfernt eine Ecke. Beim Zeichnen und Verschieben rasten Flächen an benachbarten Ecken und Kanten ein. Alt unterdrückt das Einrasten.",
outdoor_hint: "Außenleuchten (Wegleuchte, Garten-Spot, Wandleuchte außen) beleuchten alle Außenflächen und die Fassade.",
out_lawn: "Rasen",
out_terrace: "Terrasse",
out_path: "Weg",
out_driveway: "Einfahrt",
out_street: "Straße",
out_sidewalk: "Gehweg",
out_gravel: "Schotterfläche",
out_river: "Fluss",
out_stream: "Bach",
out_pool: "Pool",
out_bed: "Beet",
out_hedge: "Hecke",
@@ -1155,7 +1160,7 @@ const DE = {
fence_gates_hint: "Ein Tor ist eine Lücke im Zaun mit Torpfosten und Flügel. Mit einem Antrieb (Cover, Schalter, Hilfsschalter, Schloss) und/oder Kontakt geht es in 3D auf: Garten- und Doppeltor schwingen nach innen, ein Schiebetor fährt hinter den Zaun.",
outdoor_bracing: "X-Verstrebung",
outdoor_cut: "Aus Flächen ausschneiden",
outdoor_cut_hint: "Jede Fläche, in der diese ganz liegt, bekommt hier ein Loch – ein Pool in der Terrasse, ein Teich oder eine Wildfläche im Rasen. Die Reihenfolge beim Zeichnen spielt keine Rolle. Ein Pool schneidet sich von selbst aus.",
outdoor_cut_hint: "Jede Fläche, in der diese ganz liegt, bekommt hier ein Loch – ein Pool in der Terrasse, ein Bach oder eine Wildfläche im Rasen. Die Reihenfolge beim Zeichnen spielt keine Rolle. Pool, Fluss und Bach schneiden sich von selbst aus.",
outdoor_area_hint: "Der Home-Assistant-Bereich dieser Fläche (Garten, Terrasse, Pool): seine Geräte und Sensoren stehen unter Draußen, und ein Pin auf der Fläche öffnet es.",
pool_temp: "Wassertemperatur (optional)",
pool_pump: "Pumpe / Filter (optional)",
@@ -3192,12 +3197,17 @@ const EN: Record<Key, string> = {
outdoor_opacity_hint: "100 = solid. Less makes the area see-through, such as a driveway above a cellar; the outline stays.",
outdoor_outline: "Show the outline",
outdoor_outline_hint: "Unticked, the area draws no glowing line along its edge – for large plots made of several lawns.",
outdoor_corners_hint: "Corners: a + on an edge adds a corner, dragging shapes the area, × removes a corner.",
outdoor_corners_hint: "Corners: a + on an edge adds a corner, dragging shapes the area, × removes a corner. Drawing and moving snap to nearby corners and edges. Hold Alt to bypass snapping.",
outdoor_hint: "Outdoor lights (path light, garden spot, outdoor wall light) light all outdoor areas and the facade.",
out_lawn: "Lawn",
out_terrace: "Terrace",
out_path: "Path",
out_driveway: "Driveway",
out_street: "Street",
out_sidewalk: "Sidewalk",
out_gravel: "Gravel",
out_river: "River",
out_stream: "Stream",
out_pool: "Pool",
out_bed: "Flower bed",
out_hedge: "Hedge",
@@ -3220,7 +3230,7 @@ const EN: Record<Key, string> = {
fence_gates_hint: "A gate is a gap in the fence with gate posts and a leaf. With a motor (cover, switch, input_boolean, lock) and/or a contact it opens in 3D: garden and double gates swing inwards, a sliding gate runs along the fence.",
outdoor_bracing: "X-bracing",
outdoor_cut: "Cut out of surrounding areas",
outdoor_cut_hint: "Every area that contains this one whole gets a hole here – a pool in the terrace, a pond or a wild patch in the lawn. The drawing order does not matter. A pool cuts itself out on its own.",
outdoor_cut_hint: "Every area that contains this one whole gets a hole here – a pool in the terrace, a stream or a wild patch in the lawn. The drawing order does not matter. Pools, rivers and streams cut themselves out by default.",
outdoor_area_hint: "The Home Assistant area of this surface (garden, terrace, pool): its devices and sensors are listed under Outside, and a pin on the surface opens it.",
pool_temp: "Water temperature (optional)",
pool_pump: "Pump / filter (optional)",
+9 -4
View File
@@ -909,7 +909,7 @@ export type WeatherEffect = (typeof WEATHER_EFFECTS)[number];
/** The effects shown when the plan does not say: everything but fog (fog greys the whole scene). */
export const DEFAULT_WEATHER_EFFECTS: WeatherEffect[] = ["rain", "snow", "clouds", "lightning", "sky"];
export const OUTDOOR_TYPES = ["lawn", "terrace", "path", "driveway", "pool", "bed", "wild", "hedge", "fence", "pergola"] as const;
export const OUTDOOR_TYPES = ["lawn", "terrace", "path", "driveway", "street", "sidewalk", "gravel", "river", "stream", "pool", "bed", "wild", "hedge", "fence", "pergola"] as const;
export type OutdoorType = (typeof OUTDOOR_TYPES)[number];
/** Top of each kind of outdoor area above ground level (pool: its water, below). */
@@ -918,6 +918,11 @@ export const OUTDOOR_TOP: Record<OutdoorType, number> = {
terrace: 0.12,
path: 0.02,
driveway: 0.02,
street: 0.02,
sidewalk: 0.12,
gravel: 0.018,
river: 0.008,
stream: 0.006,
pool: -0.25,
bed: 0.15,
wild: 0.03,
@@ -1013,7 +1018,7 @@ export interface OutdoorArea {
open?: boolean;
/** Pergola: diagonal X-bracing on every side. */
bracing?: boolean;
/** This area is cut out of every other area that contains it whole (a wild patch or pond inside a lawn). A pool does this by itself unless this is false. */
/** This area is cut out of every other area that contains it whole. Pools, rivers and streams do this by default unless this is false. */
cut?: boolean;
/** Fences: gates in the fence (gaps with a leaf that follows an entity). */
gates?: FenceGate[];
@@ -1036,8 +1041,8 @@ export interface FenceGate {
open?: boolean;
}
/** Whether an area leaves a hole in the areas around it: set by hand, and on by default for a pool. */
export const cutsOut = (a: OutdoorArea): boolean => a.cut ?? a.type === "pool";
/** Whether an area leaves a hole in the areas around it: water areas default to on. */
export const cutsOut = (a: OutdoorArea): boolean => a.cut ?? (a.type === "pool" || a.type === "river" || a.type === "stream");
/** Energy flow: meter position and power sensors (W). Grid positive = import, battery positive = discharging. */
export interface EnergySettings {
+1
View File
@@ -41,6 +41,7 @@ export function flipWinding(buf: GeoBuffer, from: number): void {
swapped(buf.f, tri * 3, 1);
swapped(buf.uv, tri * 6, 2);
swapped(buf.tile, tri * 6, 2);
swapped(buf.surface, tri * 3, 1);
}
}
+4
View File
@@ -26,6 +26,8 @@ export class GeoBuffer {
uv: number[] | null;
/** The pattern atlas tile per vertex (floors only). */
tile: number[] | null;
/** Outdoor material IDs, allocated only for buffers that contain outdoor geometry. */
surface: number[] | null = null;
constructor(uvs = false, tiles = false) {
this.uv = uvs ? [] : null;
@@ -39,6 +41,7 @@ export class GeoBuffer {
this.f.push(fold, fold, fold);
this.uv?.push(...(uv ?? [0.5, 0.5, 0.5, 0.5, 0.5, 0.5]));
this.tile?.push(...tile, ...tile, ...tile);
this.surface?.push(0, 0, 0);
}
/** The number of triangles. */
@@ -53,6 +56,7 @@ export class GeoBuffer {
geometry.setAttribute("fold", attribute(this.f, 1));
if (this.uv) geometry.setAttribute("uv", attribute(this.uv, 2));
if (this.tile) geometry.setAttribute("tile", attribute(this.tile, 2));
if (this.surface) geometry.setAttribute("surface", attribute(this.surface, 1));
geometry.computeBoundingSphere();
return geometry;
}
+5 -1
View File
@@ -10,6 +10,7 @@ interface Vertex {
c: number[];
uv: number[] | null;
tile: number[] | null;
surface: number;
}
const blend = (a: number[], b: number[], t: number) => a.map((x, i) => x + (b[i] - x) * t);
@@ -17,7 +18,7 @@ const blend = (a: number[], b: number[], t: number) => a.map((x, i) => x + (b[i]
/** The point where an edge crosses the height `cut`; colours and uvs are interpolated. */
function crossing(a: Vertex, b: Vertex, cut: number): Vertex {
const t = (cut - a.p[1]) / (b.p[1] - a.p[1]);
return { p: blend(a.p, b.p, t), c: blend(a.c, b.c, t), uv: a.uv && b.uv ? blend(a.uv, b.uv, t) : null, tile: a.tile };
return { p: blend(a.p, b.p, t), c: blend(a.c, b.c, t), uv: a.uv && b.uv ? blend(a.uv, b.uv, t) : null, tile: a.tile, surface: a.surface };
}
function readVertex(buf: GeoBuffer, v: number): Vertex {
@@ -26,6 +27,7 @@ function readVertex(buf: GeoBuffer, v: number): Vertex {
c: buf.c.slice(v * 3, v * 3 + 3),
uv: buf.uv ? buf.uv.slice(v * 2, v * 2 + 2) : null,
tile: buf.tile ? buf.tile.slice(v * 2, v * 2 + 2) : null,
surface: buf.surface?.[v] ?? 0,
};
}
@@ -37,6 +39,7 @@ function overwriteTriangle(buf: GeoBuffer, tri: number, corners: Vertex[], fold:
if (buf.uv && corner.uv) corner.uv.forEach((x, i) => (buf.uv![v * 2 + i] = x));
if (buf.tile && corner.tile) corner.tile.forEach((x, i) => (buf.tile![v * 2 + i] = x));
buf.f[v] = fold;
if (buf.surface) buf.surface[v] = corner.surface;
});
}
@@ -47,6 +50,7 @@ function appendTriangle(buf: GeoBuffer, corners: Vertex[], fold: number): void {
buf.f.push(fold);
buf.uv?.push(...(corner.uv ?? [0.5, 0.5]));
buf.tile?.push(...(corner.tile ?? [0, 1]));
buf.surface?.push(corner.surface);
}
}
+15
View File
@@ -79,6 +79,21 @@ test("cutAbove keeps colours and uvs along the new edge", () => {
assert.ok(Math.abs(buf.uv![cutVertex * 2 + 1] - 0.5) < 1e-9, "halfway uv");
});
test("cutting geometry retains outdoor surface IDs and appending furniture uses a neutral material", () => {
const buf = new GeoBuffer();
buf.surface = [];
buf.tri([0, 0, 0], [1, 2, 0], [0, 0, 1], grey);
buf.surface.fill(12);
cutAbove(buf, 0, 1, FURN_OFFSET);
assert.equal(buf.surface.length, buf.p.length / 3);
assert.ok(buf.surface.every((id) => id === 12));
buf.tri([4, 0, 0], [5, 2, 0], [4, 0, 1], grey);
assert.deepEqual(buf.surface.slice(-3), [0, 0, 0]);
cutAbove(buf, buf.count - 1, 1, FURN_OFFSET);
assert.equal(buf.surface.length, buf.p.length / 3);
assert.deepEqual(buf.surface.slice(-6), [0, 0, 0, 0, 0, 0]);
});
test("cutAbove only touches triangles from the given one on", () => {
const buf = new GeoBuffer();
buf.tri([0, 2, 0], [1, 2, 0], [1, 3, 0], grey);
+5
View File
@@ -15,6 +15,11 @@ export const LOOKS: Record<OutdoorType, Look> = {
terrace: { color: 0x1c1b30, side: 0x161628, edge: 0x5b7cff, edgeAlpha: 0.32 },
path: { color: 0x1b2234, side: 0x151b29, edge: 0x5b7cff, edgeAlpha: 0.22 },
driveway: { color: 0x171d2c, side: 0x121725, edge: 0x5b7cff, edgeAlpha: 0.18 },
street: { color: 0x24272d, side: 0x15181e, edge: 0x9aa4b2, edgeAlpha: 0.25 },
sidewalk: { color: 0x48505b, side: 0x29313b, edge: 0xaebbc9, edgeAlpha: 0.28 },
gravel: { color: 0x514b3e, side: 0x2a2822, edge: 0xb8a882, edgeAlpha: 0.26 },
river: { color: 0x154350, side: 0x102d36, edge: 0x49afbb, edgeAlpha: 0.3 },
stream: { color: 0x205354, side: 0x173c3e, edge: 0x65c4c4, edgeAlpha: 0.3 },
pool: { color: 0x0b3b5b, side: 0x0d2539, edge: 0x37e0ff, edgeAlpha: 0.6 },
bed: { color: 0x1b1613, side: 0x15110f, edge: 0x3ee2a2, edgeAlpha: 0.2 },
wild: { color: 0x15221b, side: 0x101b15, edge: 0x9ad24f, edgeAlpha: 0.14 },
+30 -1
View File
@@ -1,9 +1,10 @@
import assert from "node:assert/strict";
import { test } from "node:test";
import { newFloor, OUTDOOR_TOP, type Floor, type OutdoorArea, type Vec2 } from "../../model.ts";
import { newFloor, OUTDOOR_TOP, OUTDOOR_TYPES, type Floor, type OutdoorArea, type Vec2 } from "../../model.ts";
import { GeoBuffer, LineBuffer } from "../geo.ts";
import { counterClockwise, pushBeam, pushPost } from "./beams.ts";
import { outdoorHoles, outdoorOpacity, outdoorSurface, pushOutdoor } from "./outdoor.ts";
import { OUTDOOR_MATERIAL } from "./textures.ts";
const square = (x0: number, z0: number, x1: number, z1: number): Vec2[] => [[x0, z0], [x1, z0], [x1, z1], [x0, z1]];
const area = (type: OutdoorArea["type"], points: Vec2[], extra: Partial<OutdoorArea> = {}): OutdoorArea => ({ id: type, type, points, ...extra }) as OutdoorArea;
@@ -43,6 +44,34 @@ test("a lawn is a flat block at ground level with an outline", () => {
assert.ok(Math.abs(top - ground - OUTDOOR_TOP.lawn) < 0.3, "a thin layer on the ground");
});
test("every outdoor type has a texture ID; later furniture stays untextured and buffer lengths agree", () => {
for (const type of OUTDOOR_TYPES) {
const { buf } = build(area(type, square(0, 0, 4, 3)));
assert.ok(buf.p.every(Number.isFinite), type);
assert.equal(buf.surface!.length, buf.p.length / 3, type);
assert.ok(buf.surface!.every((id) => id === OUTDOOR_MATERIAL[type] && id > 0), type);
pushPost(buf, [8, 8], 0.1, 0, 1, 0x555555, 0x777777);
assert.ok(buf.surface!.slice(-30).every((id) => id === 0), "later geometry never inherits the outdoor texture");
const g = buf.geometry();
assert.equal(g.getAttribute("surface").count, g.getAttribute("position").count);
g.dispose();
}
});
test("river and stream cut through a surrounding lawn, can be sloped, and preserve transparency", () => {
for (const type of ["river", "stream"] as const) {
const water = area(type, square(1, 1, 3, 2), { slope: 0.3, offset: 0.2, opacity: 0.4 });
const lawn = area("lawn", square(0, 0, 4, 4));
assert.equal(outdoorHoles([lawn, water], 0).length, 1);
assert.equal(outdoorHoles([lawn, { ...water, cut: false }], 0).length, 0);
const solid = new GeoBuffer(), lines = new LineBuffer(), ghosts = new Map<number, GeoBuffer>();
pushOutdoor(solid, lines, floorWith(lawn, water), ghosts, () => new GeoBuffer());
const ghost = ghosts.get(0.4)!;
assert.ok(ghost.surface!.every((id) => id === OUTDOOR_MATERIAL[type]));
assert.ok(Math.max(...ghost.p.filter((_, i) => i % 3 === 1)) - Math.min(...ghost.p.filter((_, i) => i % 3 === 1)) >= 0.3);
}
});
test("the outline can be switched off", () => {
const { lines } = build(area("lawn", square(0, 0, 4, 3), { outline: false }));
assert.equal(lines.p.length, 0);
+6
View File
@@ -10,6 +10,7 @@ import { ALWAYS, pushPrism, shade, triangulate, type GeoBuffer, type LineBuffer
import { counterClockwise, pushBeam, pushPost } from "./beams.ts";
import { gateLayout, gatesOnEdge } from "./gates.ts";
import { LOOKS } from "./looks.ts";
import { OUTDOOR_MATERIAL } from "./textures.ts";
/** The height of the visible surface of an area (for the lighting layer), at its high edge. */
export function outdoorSurface(floor: Floor, area: OutdoorArea): number {
@@ -191,6 +192,8 @@ export function outdoorOpacity(area: OutdoorArea): number {
* into `buf`; the outlines always stay solid.
*/
export function pushOutdoor(buf: GeoBuffer, lines: LineBuffer, floor: Floor, ghosts?: Map<number, GeoBuffer>, makeBuffer?: () => GeoBuffer): void {
// The shared wall shader also serves floors without outdoor areas: supply a neutral ID there.
buf.surface ??= Array(buf.p.length / 3).fill(0);
const ground = groundLevel(floor);
const areas = floor.outdoor ?? [];
areas.forEach((area, index) => {
@@ -205,6 +208,8 @@ export function pushOutdoor(buf: GeoBuffer, lines: LineBuffer, floor: Floor, gho
if (!ghosts.has(opacity)) ghosts.set(opacity, makeBuffer());
target = ghosts.get(opacity)!;
}
target.surface ??= Array(target.p.length / 3).fill(0);
const firstVertex = target.p.length / 3;
const context: Context = {
buf: target,
lines,
@@ -223,5 +228,6 @@ export function pushOutdoor(buf: GeoBuffer, lines: LineBuffer, floor: Floor, gho
else if (area.type === "fence") buildFence(context);
else if (area.type === "pergola") buildPergola(context);
else buildBlock(context, areas, index);
target.surface.fill(OUTDOOR_MATERIAL[area.type], firstVertex);
});
}
+121
View File
@@ -0,0 +1,121 @@
// Local, metre-scaled procedural textures: no downloads, image seams or geometry subdivisions.
import type { Material } from "three";
import type { OutdoorType } from "../../model.ts";
export const OUTDOOR_MATERIAL: Record<OutdoorType, number> = {
lawn: 1, terrace: 2, path: 3, driveway: 4, pool: 5, bed: 6, wild: 7,
hedge: 8, fence: 9, pergola: 9, street: 10, sidewalk: 11, gravel: 12, river: 13, stream: 14,
};
const TEXTURE = /* glsl */ `
varying vec3 vNfGround;
varying float vNfSurface;
float nfGrain(vec2 p) {
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
}
float nfNoise(vec2 p) {
vec2 cell = floor(p), f = fract(p);
f = f * f * (3.0 - 2.0 * f);
return mix(mix(nfGrain(cell), nfGrain(cell + vec2(1, 0)), f.x),
mix(nfGrain(cell + vec2(0, 1)), nfGrain(cell + vec2(1, 1)), f.x), f.y);
}
// Suppress detail smaller than a pixel rather than letting it shimmer in the building overview.
float nfDetail(vec2 p) { return 1.0 - smoothstep(0.3, 1.2, max(fwidth(p.x), fwidth(p.y))); }
float nfJoint(float v, float width) {
float d = min(fract(v), 1.0 - fract(v));
float aa = max(fwidth(v), 0.001);
return 1.0 - smoothstep(width, width + aa, d);
}
// Keep the material recognizable in the day look: its general theme otherwise maps dark asphalt to near-white.
vec3 nfOutdoorDay(float kind) {
if (kind < 1.5 || (kind > 6.5 && kind < 8.5)) return kind > 7.5 ? vec3(0.055, 0.17, 0.07) : vec3(0.12, 0.28, 0.08);
if (kind < 2.5) return vec3(0.38, 0.32, 0.25);
if (kind < 4.5) return kind < 3.5 ? vec3(0.36, 0.34, 0.30) : vec3(0.23, 0.25, 0.27);
if ((kind > 4.5 && kind < 5.5) || kind > 12.5) return vec3(0.035, 0.22, 0.28);
if (kind < 6.5) return vec3(0.15, 0.09, 0.045);
if (kind < 9.5) return vec3(0.27, 0.15, 0.065);
if (kind < 10.5) return vec3(0.07, 0.075, 0.085);
if (kind < 11.5) return vec3(0.43, 0.43, 0.4);
return vec3(0.32, 0.30, 0.26);
}
vec3 nfPebbles(vec2 p, bool leaves) {
vec2 cell = floor(p), f = fract(p);
float nearest = 8.0, second = 8.0, tint = 0.0;
for (int y = -1; y <= 1; y++) for (int x = -1; x <= 1; x++) {
vec2 offset = vec2(float(x), float(y));
vec2 seed = cell + offset;
vec2 site = offset + 0.2 + 0.6 * vec2(nfGrain(seed), nfGrain(seed + 19.7));
float d = length(site - f);
if (d < nearest) { second = nearest; nearest = d; tint = nfGrain(seed + 4.3); }
else second = min(second, d);
}
float aa = max(length(fwidth(p)), 0.002);
float rim = smoothstep(0.015, 0.07 + aa, second - nearest);
float relief = (0.65 + tint * 0.9) * mix(0.4, 1.0, rim) * (1.15 - nearest * 0.35);
vec3 pebble = leaves ? vec3(0.88 + tint * 0.2, 1.08, 0.85) : mix(vec3(0.86, 0.88, 0.94), vec3(1.13, 1.06, 0.87), tint);
return mix(vec3(1), pebble * relief, nfDetail(p));
}
vec3 nfOutdoorTexture(vec3 position, float kind) {
// Project onto the dominant face, so raised beds, hedge sides and timber have texture too.
vec3 n = abs(cross(dFdx(position), dFdy(position)));
vec2 p = n.y >= max(n.x, n.z) ? position.xz : (n.x > n.z ? position.zy : position.xy);
float broad = nfNoise(p * 1.7);
if (kind < 1.5 || (kind > 6.5 && kind < 8.5)) {
if (kind > 7.5) return nfPebbles(p * 14.0, true);
float blades = nfNoise(p * vec2(65, 24));
float texture = mix(1.0, 0.6 + blades * 0.9, nfDetail(p * 50.0));
return vec3(0.85 + broad * 0.28, 0.9 + broad * 0.5, 0.78 + broad * 0.25) * texture;
}
if ((kind > 1.5 && kind < 4.5) || (kind > 10.5 && kind < 11.5)) {
// Terrace slabs, staggered path/driveway pavers and larger sidewalk slabs.
vec2 size = kind < 2.5 ? vec2(0.6) : (kind > 10.5 ? vec2(0.5) : vec2(0.24, 0.12));
vec2 tile = p / size;
if (kind > 2.5 && kind < 4.5) tile.x += mod(floor(tile.y), 2.0) * 0.5;
float joint = max(nfJoint(tile.x, 0.015), nfJoint(tile.y, 0.015));
float variation = 0.85 + nfGrain(floor(tile)) * 0.3;
float grain = mix(1.0, 0.88 + nfNoise(p * 80.0) * 0.24, nfDetail(p * 80.0));
return vec3(mix(variation, 0.35, joint * nfDetail(tile)) * grain);
}
if ((kind > 4.5 && kind < 5.5) || kind > 12.5) {
// Water: broad ripples and smaller crossing highlights, with a tighter scale in streams.
vec2 water = p * (kind > 13.5 ? 1.8 : 1.0);
float wave = sin(water.x * 8.0 + sin(water.y * 3.0) + broad * 3.0);
float ripple = pow(max(0.0, sin(water.y * 29.0 + water.x * 4.0 + wave)), 10.0) * nfDetail(water * 25.0);
return vec3(0.68, 1.04, 1.12) * (0.88 + wave * 0.12 + ripple * 0.6);
}
if (kind < 6.5) {
float earth = mix(1.0, 0.65 + nfNoise(p * 42.0) * 0.7, nfDetail(p * 42.0));
return vec3(1.08, 0.93, 0.78) * (0.78 + broad * 0.45) * earth;
}
if (kind < 9.5) {
float grain = sin(p.x * 130.0 + nfNoise(p * vec2(4, 0.8)) * 18.0);
float planks = nfJoint(p.x / 0.14, 0.012) * nfDetail(p / 0.14);
return vec3(1.15, 0.98, 0.76) * (0.95 + grain * 0.16 * nfDetail(p * 100.0)) * (1.0 - planks * 0.55);
}
if (kind < 10.5) {
float grit = mix(1.0, 0.58 + nfNoise(p * 110.0) * 0.85, nfDetail(p * 110.0));
return vec3(grit * (0.88 + broad * 0.22));
}
return nfPebbles(p * 22.0, false);
}
`;
/** Compose after the theme/fold patches so textures stay visible in neon, day and blueprint looks. */
export function outdoorTextured<T extends Material>(material: T): T {
const previous = material.onBeforeCompile.bind(material);
const previousKey = material.customProgramCacheKey.bind(material);
material.onBeforeCompile = (shader, renderer) => {
previous(shader, renderer);
shader.vertexShader = shader.vertexShader
.replace("#include <common>", "#include <common>\nattribute float surface;\nvarying vec3 vNfGround;\nvarying float vNfSurface;")
.replace("#include <begin_vertex>", "#include <begin_vertex>\nvNfGround = position;\nvNfSurface = surface;");
shader.fragmentShader = shader.fragmentShader.replace("#include <common>", `#include <common>\n${TEXTURE}`)
.replace("#include <opaque_fragment>", `if (vNfSurface > 0.5) {
if (uTheme == 2) outgoingLight = nfOutdoorDay(vNfSurface) * (0.7 + dot(outgoingLight, vec3(0.299, 0.587, 0.114)) * 0.4);
outgoingLight *= nfOutdoorTexture(vNfGround, vNfSurface);
}
#include <opaque_fragment>`);
};
material.customProgramCacheKey = () => `${previousKey()}-outdoor-textures-1`;
return material;
}
+2 -1
View File
@@ -4,6 +4,7 @@
import { AdditiveBlending, DoubleSide, LineBasicMaterial, MeshBasicMaterial, MultiplyBlending, PointsMaterial, type CanvasTexture, type Material } from "three";
import { makeFoldable, type FoldMasks } from "../fold.ts";
import { lineBlending, themed, type Theme, type ThemeUniform } from "../theme.ts";
import { outdoorTextured } from "../outdoor/textures.ts";
export interface FloorMaterials {
floor: MeshBasicMaterial;
@@ -63,7 +64,7 @@ export function makeFloorMaterials({ mask, look, theme, textures }: MaterialInpu
return {
floor: themed(solid(), look),
pattern: patternMaterial(textures.pattern),
wall: themed(foldable(solid(), "solid"), look),
wall: outdoorTextured(themed(foldable(solid(), "solid"), look)),
glassWall: foldable(solid({ transparent: true, depthWrite: false }), "glass"),
// the result is the floor colour times the vertex colour: white leaves the floor as it is
shadow: solid({ blending: MultiplyBlending, premultipliedAlpha: true, transparent: true, depthWrite: false, side: DoubleSide, polygonOffset: true, polygonOffsetFactor: -1 }),
+2 -1
View File
@@ -74,6 +74,7 @@ import { MapLayer } from "./live-map.ts";
import type { MapSettings } from "../model.ts";
import { applyFurnitureColors, type FurnitureColors } from "./furniture/palette.ts";
import { accentOnUniform, accentUniform, parseAccent, lineBlending, themed, themeIndex, type Theme, type ThemeUniform } from "./theme.ts";
import { outdoorTextured } from "./outdoor/textures.ts";
export type { Theme } from "./theme.ts";
import { ALWAYS, DEG, GeoBuffer, LineBuffer, pushPrism } from "./geo.ts";
@@ -1838,7 +1839,7 @@ export class NextFloorViewer {
);
// outdoor areas drawn see-through (an opacity set on the area), each opacity with a material of its own that fades with the floor
for (const ghost of geo.ghosts) {
const material = themed(new MeshBasicMaterial({ vertexColors: true, transparent: true, opacity: ghost.opacity, depthWrite: false, side: DoubleSide }), this.themeUniform);
const material = outdoorTextured(themed(new MeshBasicMaterial({ vertexColors: true, transparent: true, opacity: ghost.opacity, depthWrite: false, side: DoubleSide }), this.themeUniform));
materials.ghosts.push({ material, base: ghost.opacity });
const mesh = new Mesh(ghost.geometry, material);
mesh.renderOrder = 2;
+124
View File
@@ -0,0 +1,124 @@
// Built UI: actual pointer gestures, native type selection, persisted outlines and GPU texture compilation.
import assert from "node:assert/strict";
import { createServer } from "node:http";
import { existsSync, mkdirSync, readFileSync } from "node:fs";
import { extname, join, relative, resolve } from "node:path";
import puppeteer from "puppeteer-core";
const root = resolve(import.meta.dirname, ".."), out = join(root, "preview/screenshots");
mkdirSync(out, { recursive: true });
const server = createServer((req, res) => {
const file = resolve(root, `.${decodeURIComponent(new URL(req.url, "http://localhost").pathname)}`);
if (relative(root, file).startsWith("..") || !existsSync(file)) return res.writeHead(404).end();
res.writeHead(200, { "content-type": ({ ".html": "text/html", ".js": "text/javascript", ".json": "application/json" })[extname(file)] ?? "application/octet-stream" }).end(readFileSync(file));
});
await new Promise((done) => server.listen(0, "127.0.0.1", done));
let browser;
try {
const executablePath = [process.env.CHROME_PATH, "C:/Program Files/Google/Chrome/Application/chrome.exe", "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"].find((p) => p && existsSync(p));
browser = await puppeteer.launch({ executablePath, headless: true, args: ["--use-angle=swiftshader", "--enable-unsafe-swiftshader"] });
const page = await browser.newPage(), errors = [];
page.on("pageerror", (e) => errors.push(String(e)));
page.on("console", (m) => { if (m.type() === "error" && /THREE|WebGL|shader|GL_INVALID/i.test(m.text())) errors.push(m.text()); });
await page.setViewport({ width: 1440, height: 1000 });
await page.goto(`http://127.0.0.1:${server.address().port}/preview/index.html?noshowcase`, { waitUntil: "networkidle0" });
await page.waitForFunction(() => window.nfPanel?.data.building?.floors.length);
await page.evaluate(async () => {
const p = window.nfPanel, b = structuredClone(p.data.building), f = b.floors[0];
window.outdoorFloor = f.id;
b.floors = [f]; b.settings.grid = 0.5; b.settings.lock_plan = false; b.settings.roof.type = "none";
b.settings.start_view = null; f.start_view = null;
const rect = (id, x, z, w, d) => ({ id, type: "lawn", points: [[x, z], [x + w, z], [x + w, z + d], [x, z + d]] });
Object.assign(f, { rooms: [], openings: [], placements: [], furniture: [], outdoor: [rect("neighbor", 4.03, 0.07, 3, 3), rect("moving", 0, 0, 2, 2)], walls: [], background: null });
p.data.edit(b); p.hass = { ...p.hass, language: "de" }; await p.updateComplete;
[...p.shadowRoot.querySelectorAll("[role=tab]")].find((b) => b.textContent.trim() === "Editor").click();
});
await page.waitForFunction(() => window.nfPanel.shadowRoot.querySelector("nf-editor")?._doc?.floors.length);
await page.evaluate(async () => {
const e = window.outdoorEditor = window.nfPanel.shadowRoot.querySelector("nf-editor");
e._floorId = window.outdoorFloor; e._tool = "select"; e._view = { scale: 65, ox: 65, oy: 90 }; await e.updateComplete;
});
const at = (point) => page.evaluate((p) => {
const e = window.outdoorEditor, box = e.shadowRoot.querySelector("svg.nf-plan").getBoundingClientRect(), [x, y] = e.toScreen(p);
return { x: box.left + x, y: box.top + y };
}, point);
const drag = async (from, to, alt = false) => {
const a = await at(from), b = await at(to);
if (alt) await page.keyboard.down("Alt");
await page.mouse.move(a.x, a.y); await page.mouse.down(); await page.mouse.move(b.x, b.y, { steps: 10 }); await page.mouse.up();
if (alt) await page.keyboard.up("Alt");
await page.evaluate(() => window.outdoorEditor.updateComplete);
};
const polygon = (id) => page.evaluate((id) => window.outdoorEditor._doc.floors[0].outdoor.find((a) => a.id === id).points, id);
await drag([1, 1], [3.1, 1.1]);
assert.deepEqual(await polygon("moving"), [[2.03, 0.07], [4.03, 0.07], [4.03, 2.07], [2.03, 2.07]], "body drag joins exact off-grid corner without stretching");
await drag([4.03, 2.07], [7.12, 3.14]);
assert.deepEqual(await polygon("moving"), [[2.03, 0.07], [7.03, 0.07], [7.03, 3.07], [2.03, 3.07]], "corner handles resize the rectangle onto the neighboring corner");
// Reset the moved rectangle through the normal document edit path for an Alt drag and drawing.
await page.evaluate(async () => {
const e = window.outdoorEditor, b = structuredClone(e._doc);
b.floors[0].outdoor.find((a) => a.id === "moving").points = [[0, 0], [2, 0], [2, 2], [0, 2]];
e.setDoc(b); e.selectItem("outdoor", null); await e.updateComplete;
});
await drag([1, 1], [3.1, 1.1], true);
assert.deepEqual((await polygon("moving"))[0], [2.1, 0.1], "Alt bypasses magnets and the coarse grid");
await page.evaluate(async () => { window.outdoorEditor._tool = "outdoor"; await window.outdoorEditor.updateComplete; });
await drag([7.12, 0.14], [9.1, 2.2]);
const drawn = await page.evaluate(() => window.outdoorEditor._doc.floors[0].outdoor.at(-1));
assert.ok(drawn.points.some(([x, z]) => x === 7.03 && z === 0.07), "new rectangle starts at the adjacent exact corner");
for (const [type, label] of [["street", "Straße"], ["sidewalk", "Gehweg"], ["gravel", "Schotterfläche"], ["river", "Fluss"], ["stream", "Bach"]]) {
const stored = await page.evaluate(async ({ type, label, id }) => {
const e = window.outdoorEditor; e._tool = "select"; e.selectItem("outdoor", id); await e.updateComplete;
const input = [...e.shadowRoot.querySelectorAll("select")].find((s) => [...s.options].some((o) => o.value === type && o.textContent === label));
if (!input) throw new Error(`Missing outdoor type ${type}`);
input.value = type; input.dispatchEvent(new Event("change", { bubbles: true })); await e.updateComplete;
return e._doc.floors[0].outdoor.find((a) => a.id === id).type;
}, { type, label, id: drawn.id });
assert.equal(stored, type);
}
await page.screenshot({ path: join(out, "symcon-outdoor-editor.png") });
await page.evaluate(async () => {
const p = window.nfPanel, b = structuredClone(window.outdoorEditor._doc), f = b.floors[0];
const types = ["lawn", "terrace", "path", "driveway", "street", "sidewalk", "gravel", "river", "stream", "pool", "bed", "wild", "hedge", "fence", "pergola"];
f.outdoor = types.map((type, i) => {
const x = (i % 5) * 5, z = Math.floor(i / 5) * 4;
return { id: type, type, points: [[x, z], [x + 4, z], [x + 4, z + 3], [x, z + 3]], ...(type === "sidewalk" ? { slope: 0.25 } : {}), ...(type === "stream" ? { opacity: 0.6 } : {}) };
});
f.rooms = [{ id: "reference", name: "Referenz", points: [[-2, -2], [-1, -2], [-1, -1], [-2, -1]], area_id: null, floor_material: "plain" }];
f.furniture = []; p.data.edit(b); await p.updateComplete;
[...p.shadowRoot.querySelectorAll("[role=tab]")].find((b) => b.textContent.trim() === "3D").click();
});
await page.waitForFunction(() => window.nfPanel.shadowRoot.querySelector("nf-view3d")?.viewer).catch(async (e) => {
console.log("Viewer initialization", errors, await page.evaluate(() => window.nfPanel.shadowRoot.textContent.slice(-1500))); throw e;
});
await page.evaluate(() => {
window.outdoorView = window.nfPanel.shadowRoot.querySelector("nf-view3d");
window.nfPanel.openFloor(window.outdoorFloor);
window.outdoorView.viewer.showView({ target: { x: 12, y: 0, z: 5.5 }, radius: 25, phi: 0.65, theta: 0.1 }, 0);
});
for (const theme of ["neon", "day", "blueprint"]) {
await page.evaluate((theme) => { const v = window.outdoorView.viewer; v.setTheme(theme); v.invalidate(); }, theme);
await page.evaluate(() => new Promise((done) => requestAnimationFrame(() => requestAnimationFrame(done))));
await page.screenshot({ path: join(out, `symcon-outdoor-${theme}.png`) });
}
for (const [name, x, z] of [["street", 22, 1.5], ["gravel", 7, 5.5], ["lawn", 2, 1.5]]) {
await page.evaluate(({ x, z }) => {
const v = window.outdoorView.viewer; v.setTheme("day"); v.showView({ target: { x, y: 0, z }, radius: 5, phi: 0.65, theta: 0.1 }, 0);
}, { x, z });
await page.evaluate(() => new Promise((done) => requestAnimationFrame(() => requestAnimationFrame(done))));
await page.screenshot({ path: join(out, `symcon-outdoor-${name}-detail.png`) });
}
const gpu = await page.evaluate(() => {
const v = window.outdoorView.viewer;
let textured = 0, neutral = 0;
v.scene.traverse((o) => {
const ids = o.geometry?.getAttribute("surface");
if (ids) { for (const kind of ids.array) kind > 0 ? textured++ : neutral++; }
});
return { textured, neutral, programs: v.renderer.info.programs.map((p) => p.diagnostics?.runnable !== false) };
});
assert.ok(gpu.textured > 0); assert.ok(gpu.programs.every(Boolean)); assert.deepEqual(errors, []);
console.log("OK: pointer drawing/moving/corner snapping, Alt bypass, five persisted surface types, metre-scaled textures compiled in all three themes, sloped and transparent surfaces", gpu);
} finally {
await browser?.close(); await new Promise((done) => server.close(done));
}
+7 -7
View File
@@ -1,11 +1,11 @@
/*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */
var pr=globalThis,mr=pr.ShadowRoot&&(pr.ShadyCSS===void 0||pr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ma=Symbol(),Lc=new WeakMap,hs=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Ma)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(mr&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Lc.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Lc.set(t,e))}return e}toString(){return this.cssText}},Nc=i=>new hs(typeof i=="string"?i:i+"",void 0,Ma),wa=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((n,s,r)=>n+(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.")})(s)+i[r+1],i[0]);return new hs(t,i,Ma)},Dc=(i,e)=>{if(mr)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let n=document.createElement("style"),s=pr.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=t.cssText,i.appendChild(n)}},Ea=mr?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return Nc(t)})(i):i;var{is:wd,defineProperty:Ed,getOwnPropertyDescriptor:Td,getOwnPropertyNames:Ad,getOwnPropertySymbols:Rd,getPrototypeOf:Cd}=Object,gr=globalThis,Uc=gr.trustedTypes,Pd=Uc?Uc.emptyScript:"",Id=gr.reactiveElementPolyfillSupport,us=(i,e)=>i,Ta={toAttribute(i,e){switch(e){case Boolean:i=i?Pd:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Oc=(i,e)=>!wd(i,e),Fc={attribute:!0,type:String,converter:Ta,reflect:!1,useDefault:!1,hasChanged:Oc};Symbol.metadata??=Symbol("metadata"),gr.litPropertyMetadata??=new WeakMap;var En=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Fc){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),s=this.getPropertyDescriptor(e,n,t);s!==void 0&&Ed(this.prototype,e,s)}}static getPropertyDescriptor(e,t,n){let{get:s,set:r}=Td(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){let a=s?.call(this);r?.call(this,o),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Fc}static _$Ei(){if(this.hasOwnProperty(us("elementProperties")))return;let e=Cd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(us("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(us("properties"))){let t=this.properties,n=[...Ad(t),...Rd(t)];for(let s of n)this.createProperty(s,t[s])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,s]of t)this.elementProperties.set(n,s)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let s=this._$Eu(t,n);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let s of n)t.unshift(Ea(s))}else e!==void 0&&t.push(Ea(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.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(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Dc(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,n);if(s!==void 0&&n.reflect===!0){let r=(n.converter?.toAttribute!==void 0?n.converter:Ta).toAttribute(t,n.type);this._$Em=e,r==null?this.removeAttrLine truncated
var pr=globalThis,mr=pr.ShadowRoot&&(pr.ShadyCSS===void 0||pr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ma=Symbol(),Lc=new WeakMap,hs=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Ma)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(mr&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Lc.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Lc.set(t,e))}return e}toString(){return this.cssText}},Nc=i=>new hs(typeof i=="string"?i:i+"",void 0,Ma),wa=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((n,s,r)=>n+(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.")})(s)+i[r+1],i[0]);return new hs(t,i,Ma)},Dc=(i,e)=>{if(mr)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let n=document.createElement("style"),s=pr.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=t.cssText,i.appendChild(n)}},Ea=mr?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return Nc(t)})(i):i;var{is:wd,defineProperty:Ed,getOwnPropertyDescriptor:Td,getOwnPropertyNames:Ad,getOwnPropertySymbols:Rd,getPrototypeOf:Cd}=Object,gr=globalThis,Uc=gr.trustedTypes,Pd=Uc?Uc.emptyScript:"",Id=gr.reactiveElementPolyfillSupport,us=(i,e)=>i,Ta={toAttribute(i,e){switch(e){case Boolean:i=i?Pd:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Oc=(i,e)=>!wd(i,e),Fc={attribute:!0,type:String,converter:Ta,reflect:!1,useDefault:!1,hasChanged:Oc};Symbol.metadata??=Symbol("metadata"),gr.litPropertyMetadata??=new WeakMap;var En=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Fc){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),s=this.getPropertyDescriptor(e,n,t);s!==void 0&&Ed(this.prototype,e,s)}}static getPropertyDescriptor(e,t,n){let{get:s,set:r}=Td(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){let a=s?.call(this);r?.call(this,o),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Fc}static _$Ei(){if(this.hasOwnProperty(us("elementProperties")))return;let e=Cd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(us("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(us("properties"))){let t=this.properties,n=[...Ad(t),...Rd(t)];for(let s of n)this.createProperty(s,t[s])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,s]of t)this.elementProperties.set(n,s)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let s=this._$Eu(t,n);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let s of n)t.unshift(Ea(s))}else e!==void 0&&t.push(Ea(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.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(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Dc(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,n);if(s!==void 0&&n.reflect===!0){let r=(n.converter?.toAttribute!==void 0?n.converter:Ta).toAttribute(t,n.type);this._$Em=e,r==null?this.removeAttrLine truncated
\f\r]`,ds=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,zc=/-->/g,Vc=/>/g,oi=RegExp(`>|${Aa}(?:([^\\s"'>=/]+)(${Aa}*=${Aa}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),Gc=/'/g,Hc=/"/g,qc=/^(?:script|style|textarea|title)$/i,Ua=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),qe=Ua(1),X_=Ua(2),q_=Ua(3),ci=Symbol.for("lit-noChange"),Qe=Symbol.for("lit-nothing"),Wc=new WeakMap,ai=li.createTreeWalker(li,129);function Yc(i,e){if(!Da(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return kc!==void 0?kc.createHTML(e):e}var Dd=(i,e)=>{let t=i.length-1,n=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=ds;for(let a=0;a<t;a++){let l=i[a],c,u,d=-1,f=0;for(;f<l.length&&(o.lastIndex=f,u=o.exec(l),u!==null);)f=o.lastIndex,o===ds?u[1]==="!--"?o=zc:u[1]!==void 0?o=Vc:u[2]!==void 0?(qc.test(u[2])&&(s=RegExp("</"+u[2],"g")),o=oi):u[3]!==void 0&&(o=oi):o===oi?u[0]===">"?(o=s??ds,d=-1):u[1]===void 0?d=-2:(d=o.lastIndex-u[2].length,c=u[1],o=u[3]===void 0?oi:u[3]==='"'?Hc:Gc):o===Hc||o===Gc?o=oi:o===zc||o===Vc?o=ds:(o=oi,s=void 0);let h=o===oi&&i[a+1].startsWith("/>")?" ":"";r+=o===ds?l+Ld:d>=0?(n.push(c),l.slice(0,d)+$c+l.slice(d)+kn+h):l+kn+(d===-2?a:h)}return[Yc(i,r+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},ms=class i{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let r=0,o=0,a=e.length-1,l=this.parts,[c,u]=Dd(e,t);if(this.el=i.createElement(c,n),ai.currentNode=this.el.content,t===2||t===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(s=ai.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let d of s.getAttributeNames())if(d.endsWith($c)){let f=u[o++],h=s.getAttribute(d).split(kn),g=/([.?@])?(.*)/.exec(f);l.push({type:1,index:r,name:g[2],strings:h,ctor:g[1]==="."?Ca:g[1]==="?"?Pa:g[1]==="@"?Ia:Ri}),s.removeAttribute(d)}else d.startsWith(kn)&&(l.push({type:6,index:r}),s.removeAttribute(d));if(qc.test(s.tagName)){let d=s.textContent.split(kn),f=d.length-1;if(f>0){s.textContent=_r?_r.emptyScript:"";for(let h=0;h<f;h++)s.append(d[h],fs()),ai.nextNode(),l.push({type:2,index:++r});s.append(d[f],fs())}}}else if(s.nodeType===8)if(s.data===Xc)l.push({type:2,index:r});else{let d=-1;for(;(d=s.data.indexOf(kn,d+1))!==-1;)l.push({type:7,index:r}),d+=kn.length-1}r++}}static createElement(e,t){let n=li.createElement("template");return n.innerHTML=e,n}};function Ai(i,e,t=i,n){if(e===ci)return e;let s=n!==void 0?t._$Co?.[n]:t._$Cl,r=ps(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),r===void 0?s=void 0:(s=new r(i),s._$AT(i,t,n)),n!==void 0?(t._$Co??=[])[n]=s:t._$Cl=s),s!==void 0&&(e=Ai(i,s._$AS(i,e.values),s,n)),e}var Ra=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,s=(e?.creationScope??li).importNode(t,!0);ai.currentNode=s;let r=ai.nextNode(),o=0,a=0,l=n[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new gs(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new La(r,this,e)),this._$AV.push(c),l=n[++a]}o!==l?.index&&(r=ai.nextNode(),o++)}return ai.currentNode=li,s}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},gs=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,s){this.type=2,this._$AH=Qe,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ai(this,e,t),ps(e)?e===Qe||e==null||e===""?(this._$AH!==Qe&&this._$AR(),this._$AH=Qe):e!==this._$AH&&e!==ci&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Nd(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Qe&&ps(this._$AH)?this._$AA.nextSibling.data=e:this.T(li.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=ms.createElement(Yc(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new Ra(s,this),o=r.u(this.options);r.p(t),this.T(o),this._$AH=r}}_$AC(e){let t=Wc.get(e.strings);return t===void 0&&Wc.set(e.strings,t=new ms(e)),t}k(e){Da(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,s=0;for(let r of e)s===t.length?t.push(n=new i(this.O(fs()),this.O(fs()),this,this.options)):n=t[s],n._$AI(r),s++;s<t.length&&(this._$AR(n&&n._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=Bc(e).nextSibling;Bc(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Ri=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,s,r){this.type=1,this._$AH=Qe,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,n.length>2||n[0]!==""||n[1]!=="Line truncated
\f\r"'\`<>=]|("|')|))|$)`,"g"),Gc=/'/g,Hc=/"/g,qc=/^(?:script|style|textarea|title)$/i,Ua=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),qe=Ua(1),X_=Ua(2),q_=Ua(3),ci=Symbol.for("lit-noChange"),Qe=Symbol.for("lit-nothing"),Wc=new WeakMap,ai=li.createTreeWalker(li,129);function Yc(i,e){if(!Da(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return kc!==void 0?kc.createHTML(e):e}var Dd=(i,e)=>{let t=i.length-1,n=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=ds;for(let a=0;a<t;a++){let l=i[a],c,u,d=-1,f=0;for(;f<l.length&&(o.lastIndex=f,u=o.exec(l),u!==null);)f=o.lastIndex,o===ds?u[1]==="!--"?o=zc:u[1]!==void 0?o=Vc:u[2]!==void 0?(qc.test(u[2])&&(s=RegExp("</"+u[2],"g")),o=oi):u[3]!==void 0&&(o=oi):o===oi?u[0]===">"?(o=s??ds,d=-1):u[1]===void 0?d=-2:(d=o.lastIndex-u[2].length,c=u[1],o=u[3]===void 0?oi:u[3]==='"'?Hc:Gc):o===Hc||o===Gc?o=oi:o===zc||o===Vc?o=ds:(o=oi,s=void 0);let h=o===oi&&i[a+1].startsWith("/>")?" ":"";r+=o===ds?l+Ld:d>=0?(n.push(c),l.slice(0,d)+$c+l.slice(d)+zn+h):l+zn+(d===-2?a:h)}return[Yc(i,r+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},ms=class i{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let r=0,o=0,a=e.length-1,l=this.parts,[c,u]=Dd(e,t);if(this.el=i.createElement(c,n),ai.currentNode=this.el.content,t===2||t===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(s=ai.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let d of s.getAttributeNames())if(d.endsWith($c)){let f=u[o++],h=s.getAttribute(d).split(zn),g=/([.?@])?(.*)/.exec(f);l.push({type:1,index:r,name:g[2],strings:h,ctor:g[1]==="."?Ca:g[1]==="?"?Pa:g[1]==="@"?Ia:Ri}),s.removeAttribute(d)}else d.startsWith(zn)&&(l.push({type:6,index:r}),s.removeAttribute(d));if(qc.test(s.tagName)){let d=s.textContent.split(zn),f=d.length-1;if(f>0){s.textContent=_r?_r.emptyScript:"";for(let h=0;h<f;h++)s.append(d[h],fs()),ai.nextNode(),l.push({type:2,index:++r});s.append(d[f],fs())}}}else if(s.nodeType===8)if(s.data===Xc)l.push({type:2,index:r});else{let d=-1;for(;(d=s.data.indexOf(zn,d+1))!==-1;)l.push({type:7,index:r}),d+=zn.length-1}r++}}static createElement(e,t){let n=li.createElement("template");return n.innerHTML=e,n}};function Ai(i,e,t=i,n){if(e===ci)return e;let s=n!==void 0?t._$Co?.[n]:t._$Cl,r=ps(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),r===void 0?s=void 0:(s=new r(i),s._$AT(i,t,n)),n!==void 0?(t._$Co??=[])[n]=s:t._$Cl=s),s!==void 0&&(e=Ai(i,s._$AS(i,e.values),s,n)),e}var Ra=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,s=(e?.creationScope??li).importNode(t,!0);ai.currentNode=s;let r=ai.nextNode(),o=0,a=0,l=n[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new gs(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new La(r,this,e)),this._$AV.push(c),l=n[++a]}o!==l?.index&&(r=ai.nextNode(),o++)}return ai.currentNode=li,s}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},gs=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,s){this.type=2,this._$AH=Qe,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ai(this,e,t),ps(e)?e===Qe||e==null||e===""?(this._$AH!==Qe&&this._$AR(),this._$AH=Qe):e!==this._$AH&&e!==ci&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Nd(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Qe&&ps(this._$AH)?this._$AA.nextSibling.data=e:this.T(li.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=ms.createElement(Yc(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new Ra(s,this),o=r.u(this.options);r.p(t),this.T(o),this._$AH=r}}_$AC(e){let t=Wc.get(e.strings);return t===void 0&&Wc.set(e.strings,t=new ms(e)),t}k(e){Da(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,s=0;for(let r of e)s===t.length?t.push(n=new i(this.O(fs()),this.O(fs()),this,this.options)):n=t[s],n._$AI(r),s++;s<t.length&&(this._$AR(n&&n._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=Bc(e).nextSibling;Bc(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Ri=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,s,r){this.type=1,this._$AH=Qe,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,n.length>2||n[0]!==""||n[1]!=="Line truncated
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,Af=`void main() {
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`,xn=class extends Zn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Tf,this.fragmentShader=Af,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=wi(e.uniforms),this.uniformsGroups=Ef(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let s in this.uniforms){let o=this.uniforms[s].value;o&&o.isTexture?t.uniforms[s]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[s]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[s]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[s]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[s]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[s]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[s]={type:"m4",value:o.toArray()}:t.uniforms[s]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let s in this.extensions)this.extensions[s]===!0&&(n[s]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}fromJSON(e,t){if(super.fromJSON(e,t),e.uniforms!==void 0)for(let n in e.uniforms){let s=e.uniforms[n];switch(this.uniforms[n]={},s.type){case"t":this.uniforms[n].value=t[s.value]||null;break;case"c":this.uniforms[n].value=new Ie().setHex(s.value);break;case"v2":this.uniforms[n].value=new ze().fromArray(s.value);break;case"v3":this.uniforms[n].value=new B().fromArray(s.value);break;case"v4":this.uniforms[n].value=new ht().fromArray(s.value);break;case"m3":this.uniforms[n].value=new Le().fromArray(s.value);break;case"m4":this.uniforms[n].value=new ot().fromArray(s.value);break;default:this.uniforms[n].value=s.value}}if(e.defines!==void 0&&(this.defines=e.defines),e.vertexShader!==void 0&&(this.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(this.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(this.glslVersion=e.glslVersion),e.extensions!==void 0)for(let n in e.extensions)this.extensions[n]=e.extensions[n];return e.lights!==void 0&&(this.lights=e.lights),e.clipping!==void 0&&(this.clipping=e.clipping),this}},uo=class extends xn{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}};var fo=class extends Zn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=ru,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},po=class extends Zn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};function zi(i,e){return!i||i.constructor===e?i:typeof e.BYTES_PER_ELEMENT=="number"?new e(i):Array.prototype.slice.call(i)}function Vr(i){return i!==void 0&&i.inTangents!==void 0&&i.outTangents!==void 0}var Kn=class{constructor(e,t,n,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,s=t[n],r=t[n-1];n:{e:{let o;t:{i:if(!(e<s)){for(let a=n+2;;){if(s===void 0){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(r=s,s=t[++n],e<s)break e}o=t.length;break t}if(!(e>=r)){let a=t[1];e<a&&(n=2,r=a);for(let l=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleVal Line truncated
}`,xn=class extends Jn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Tf,this.fragmentShader=Af,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=wi(e.uniforms),this.uniformsGroups=Ef(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let s in this.uniforms){let o=this.uniforms[s].value;o&&o.isTexture?t.uniforms[s]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[s]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[s]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[s]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[s]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[s]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[s]={type:"m4",value:o.toArray()}:t.uniforms[s]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let s in this.extensions)this.extensions[s]===!0&&(n[s]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}fromJSON(e,t){if(super.fromJSON(e,t),e.uniforms!==void 0)for(let n in e.uniforms){let s=e.uniforms[n];switch(this.uniforms[n]={},s.type){case"t":this.uniforms[n].value=t[s.value]||null;break;case"c":this.uniforms[n].value=new Ie().setHex(s.value);break;case"v2":this.uniforms[n].value=new ze().fromArray(s.value);break;case"v3":this.uniforms[n].value=new B().fromArray(s.value);break;case"v4":this.uniforms[n].value=new ht().fromArray(s.value);break;case"m3":this.uniforms[n].value=new Le().fromArray(s.value);break;case"m4":this.uniforms[n].value=new ot().fromArray(s.value);break;default:this.uniforms[n].value=s.value}}if(e.defines!==void 0&&(this.defines=e.defines),e.vertexShader!==void 0&&(this.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(this.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(this.glslVersion=e.glslVersion),e.extensions!==void 0)for(let n in e.extensions)this.extensions[n]=e.extensions[n];return e.lights!==void 0&&(this.lights=e.lights),e.clipping!==void 0&&(this.clipping=e.clipping),this}},uo=class extends xn{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}};var fo=class extends Jn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=ru,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},po=class extends Jn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};function zi(i,e){return!i||i.constructor===e?i:typeof e.BYTES_PER_ELEMENT=="number"?new e(i):Array.prototype.slice.call(i)}function Vr(i){return i!==void 0&&i.inTangents!==void 0&&i.outTangents!==void 0}var Qn=class{constructor(e,t,n,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,s=t[n],r=t[n-1];n:{e:{let o;t:{i:if(!(e<s)){for(let a=n+2;;){if(s===void 0){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(r=s,s=t[++n],e<s)break e}o=t.length;break t}if(!(e>=r)){let a=t[1];e<a&&(n=2,r=a);for(let l=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleVal Line truncated
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
#endif`,Gf=`#ifdef USE_ALPHAHASH
const float ALPHA_HASH_SCALE = 0.05;
@@ -3823,7 +3823,7 @@ void main() {
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
}`,ke={alphahash_fragment:Vf,alphahash_pars_fragment:Gf,alphamap_fragment:Hf,alphamap_pars_fragment:Wf,alphatest_fragment:$f,alphatest_pars_fragment:Xf,aomap_fragment:qf,aomap_pars_fragment:Yf,batching_pars_vertex:Zf,batching_vertex:Jf,begin_vertex:Kf,beginnormal_vertex:Qf,bsdfs:jf,iridescence_fragment:ep,bumpmap_pars_fragment:tp,clipping_planes_fragment:np,clipping_planes_pars_fragment:ip,clipping_planes_pars_vertex:sp,clipping_planes_vertex:rp,color_fragment:op,color_pars_fragment:ap,color_pars_vertex:lp,color_vertex:cp,common:hp,defaultnormal_vertex:up,displacementmap_pars_vertex:dp,displacementmap_vertex:fp,emissivemap_fragment:pp,emissivemap_pars_fragment:mp,colorspace_fragment:gp,colorspace_pars_fragment:_p,envmap_fragment:xp,envmap_common_pars_fragment:vp,envmap_pars_fragment:yp,envmap_pars_vertex:bp,envmap_physical_pars_fragment:Lp,envmap_vertex:Sp,fog_vertex:Mp,fog_pars_vertex:wp,fog_fragment:Ep,fog_pars_fragment:Tp,gradientmap_pars_fragment:Ap,lightmap_pars_fragment:Rp,lights_lambert_fragment:Cp,lights_lambert_pars_fragment:Pp,lights_pars_begin:Ip,lights_toon_fragment:Np,lights_toon_pars_fragment:Dp,lights_phong_fragment:Up,lights_phong_pars_fragment:Fp,lights_physical_fragment:Op,lights_physical_pars_fragment:Bp,lights_fragment_begin:kp,lights_fragment_maps:zp,lights_fragment_end:Vp,lightprobes_pars_fragment:Gp,logdepthbuf_fragment:Hp,logdepthbuf_pars_fragment:Wp,logdepthbuf_pars_vertex:$p,logdepthbuf_vertex:Xp,map_fragment:qp,map_pars_fragment:Yp,map_particle_fragment:Zp,map_particle_pars_fragment:Jp,metalnessmap_fragment:Kp,metalnessmap_pars_fragment:Qp,morphinstance_vertex:jp,morphcolor_vertex:em,morphnormal_vertex:tm,morphtarget_pars_vertex:nm,morphtarget_vertex:im,normal_fragment_begin:sm,normal_fragment_maps:rm,normal_pars_fragment:om,normal_pars_vertex:am,normal_vertex:lm,normalmap_pars_fragment:cm,clearcoat_normal_fragment_begin:hm,clearcoat_normal_fragment_maps:um,clearcoat_pars_fragment:dm,iridescence_pars_fragment:fm,opaque_fragment:pm,packing:mm,premultiplied_alpha_fragment:gm,project_vertex:_m,dithering_fragment:xm,dithering_pars_fragment:vm,roughnessmap_fragment:ym,roughnessmap_pars_fragment:bm,shadowmap_pars_fragment:Sm,shadowmap_pars_vertex:Mm,shadowmap_vertex:wm,shadowmask_pars_fragment:Em,skinbase_vertex:Tm,skinning_pars_vertex:Am,skinning_vertex:Rm,skinnormal_vertex:Cm,specularmap_fragment:Pm,specularmap_pars_fragment:Im,tonemapping_fragment:Lm,tonemapping_pars_fragment:Nm,transmission_fragment:Dm,transmission_pars_fragment:Um,uv_pars_fragment:Fm,uv_pars_vertex:Om,uv_vertex:Bm,worldpos_vertex:km,background_vert:zm,background_frag:Vm,backgroundCube_vert:Gm,backgroundCube_frag:Hm,cube_vert:Wm,cube_frag:$m,depth_vert:Xm,depth_frag:qm,distance_vert:Ym,distance_frag:Zm,equirect_vert:Jm,equirect_frag:Km,linedashed_vert:Qm,linedashed_frag:jm,meshbasic_vert:eg,meshbasic_frag:tg,meshlambert_vert:ng,meshlambert_frag:ig,meshmatcap_vert:sg,meshmatcap_frag:rg,meshnormal_vert:og,meshnormal_frag:ag,meshphong_vert:lg,meshphong_frag:cg,meshphysical_vert:hg,meshphysical_frag:ug,meshtoon_vert:dg,meshtoon_frag:fg,points_vert:pg,points_frag:mg,shadow_vert:gg,shadow_frag:_g,sprite_vert:xg,sprite_frag:vg},pe={common:{diffuse:{value:new Ie(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Le},alphaMap:{value:null},alphaMapTransform:{value:new Le},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Le}},envmap:{envMap:{value:null},envMapRotation:{value:new Le},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Le}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Le}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Le},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Le},normalScale:{value:new ze(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Le},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Le}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Le}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Le}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ie(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},sunLights:{value:[],properties:{direction:{},color:{}}},sunLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},sunShadowMatrix:{value:[]},sunShadowCascade:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],pr Line truncated
}`,ke={alphahash_fragment:Vf,alphahash_pars_fragment:Gf,alphamap_fragment:Hf,alphamap_pars_fragment:Wf,alphatest_fragment:$f,alphatest_pars_fragment:Xf,aomap_fragment:qf,aomap_pars_fragment:Yf,batching_pars_vertex:Zf,batching_vertex:Jf,begin_vertex:Kf,beginnormal_vertex:Qf,bsdfs:jf,iridescence_fragment:ep,bumpmap_pars_fragment:tp,clipping_planes_fragment:np,clipping_planes_pars_fragment:ip,clipping_planes_pars_vertex:sp,clipping_planes_vertex:rp,color_fragment:op,color_pars_fragment:ap,color_pars_vertex:lp,color_vertex:cp,common:hp,defaultnormal_vertex:up,displacementmap_pars_vertex:dp,displacementmap_vertex:fp,emissivemap_fragment:pp,emissivemap_pars_fragment:mp,colorspace_fragment:gp,colorspace_pars_fragment:_p,envmap_fragment:xp,envmap_common_pars_fragment:vp,envmap_pars_fragment:yp,envmap_pars_vertex:bp,envmap_physical_pars_fragment:Lp,envmap_vertex:Sp,fog_vertex:Mp,fog_pars_vertex:wp,fog_fragment:Ep,fog_pars_fragment:Tp,gradientmap_pars_fragment:Ap,lightmap_pars_fragment:Rp,lights_lambert_fragment:Cp,lights_lambert_pars_fragment:Pp,lights_pars_begin:Ip,lights_toon_fragment:Np,lights_toon_pars_fragment:Dp,lights_phong_fragment:Up,lights_phong_pars_fragment:Fp,lights_physical_fragment:Op,lights_physical_pars_fragment:Bp,lights_fragment_begin:kp,lights_fragment_maps:zp,lights_fragment_end:Vp,lightprobes_pars_fragment:Gp,logdepthbuf_fragment:Hp,logdepthbuf_pars_fragment:Wp,logdepthbuf_pars_vertex:$p,logdepthbuf_vertex:Xp,map_fragment:qp,map_pars_fragment:Yp,map_particle_fragment:Zp,map_particle_pars_fragment:Jp,metalnessmap_fragment:Kp,metalnessmap_pars_fragment:Qp,morphinstance_vertex:jp,morphcolor_vertex:em,morphnormal_vertex:tm,morphtarget_pars_vertex:nm,morphtarget_vertex:im,normal_fragment_begin:sm,normal_fragment_maps:rm,normal_pars_fragment:om,normal_pars_vertex:am,normal_vertex:lm,normalmap_pars_fragment:cm,clearcoat_normal_fragment_begin:hm,clearcoat_normal_fragment_maps:um,clearcoat_pars_fragment:dm,iridescence_pars_fragment:fm,opaque_fragment:pm,packing:mm,premultiplied_alpha_fragment:gm,project_vertex:_m,dithering_fragment:xm,dithering_pars_fragment:vm,roughnessmap_fragment:ym,roughnessmap_pars_fragment:bm,shadowmap_pars_fragment:Sm,shadowmap_pars_vertex:Mm,shadowmap_vertex:wm,shadowmask_pars_fragment:Em,skinbase_vertex:Tm,skinning_pars_vertex:Am,skinning_vertex:Rm,skinnormal_vertex:Cm,specularmap_fragment:Pm,specularmap_pars_fragment:Im,tonemapping_fragment:Lm,tonemapping_pars_fragment:Nm,transmission_fragment:Dm,transmission_pars_fragment:Um,uv_pars_fragment:Fm,uv_pars_vertex:Om,uv_vertex:Bm,worldpos_vertex:km,background_vert:zm,background_frag:Vm,backgroundCube_vert:Gm,backgroundCube_frag:Hm,cube_vert:Wm,cube_frag:$m,depth_vert:Xm,depth_frag:qm,distance_vert:Ym,distance_frag:Zm,equirect_vert:Jm,equirect_frag:Km,linedashed_vert:Qm,linedashed_frag:jm,meshbasic_vert:eg,meshbasic_frag:tg,meshlambert_vert:ng,meshlambert_frag:ig,meshmatcap_vert:sg,meshmatcap_frag:rg,meshnormal_vert:og,meshnormal_frag:ag,meshphong_vert:lg,meshphong_frag:cg,meshphysical_vert:hg,meshphysical_frag:ug,meshtoon_vert:dg,meshtoon_frag:fg,points_vert:pg,points_frag:mg,shadow_vert:gg,shadow_frag:_g,sprite_vert:xg,sprite_frag:vg},pe={common:{diffuse:{value:new Ie(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Le},alphaMap:{value:null},alphaMapTransform:{value:new Le},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Le}},envmap:{envMap:{value:null},envMapRotation:{value:new Le},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Le}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Le}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Le},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Le},normalScale:{value:new ze(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Le},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Le}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Le}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Le}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ie(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},sunLights:{value:[],properties:{direction:{},color:{}}},sunLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},sunShadowMatrix:{value:[]},sunShadowCascade:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],pr Line truncated
varying vec3 vWorldDirection;
@@ -4174,7 +4174,7 @@ Material Type: `+I.type+`
Program Info Log: `+P+`
`+H+`
`+Q)}else P!==""?Re("WebGLProgram: Program Info Log:",P):(W===""||J==="")&&(te=!1);te&&(I.diagnostics={runnable:V,programLog:P,vertexShader:{log:W,prefix:v},fragmentShader:{log:J,prefix:p}})}s.deleteShader(S),s.deleteShader(A),_=new is(s,g),M=z0(s,g)}let _;this.getUniforms=function(){return _===void 0&&T(this),_};let M;this.getAttributes=function(){return M===void 0&&T(this),M};let U=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return U===!1&&(U=s.getProgramParameter(g,P0)),U},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(g),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=I0++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=S,this.fragmentShader=A,this}var Q0=0,hc=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e,t,n){let s=this._getShaderCacheForMaterial(e);return s.has(t)===!1&&(s.add(t),t.usedTimes++),s.has(n)===!1&&(s.add(n),n.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderStage(e){return this._getShaderStage(e.vertexShader)}getFragmentShaderStage(e){return this._getShaderStage(e.fragmentShader)}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return n===void 0&&(n=new uc(e),t.set(e,n)),n}},uc=class{constructor(e){this.id=Q0++,this.code=e,this.usedTimes=0}};function j0(i){return i===ti||i===Ks||i===Qs}function e_(i,e,t,n,s,r){let o=new qi,a=new hc,l=new Set,c=[],u=new Map,d=n.logarithmicDepthBuffer,f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function h(_){return l.add(_),_===0?"uv":`uv${_}`}function g(_,M,U,I,N,k){let $=I.fog,P=N.geometry,W=_.isMeshStandardMaterial||_.isMeshLambertMaterial||_.isMeshPhongMaterial?I.environment:null,J=_.isMeshStandardMaterial||_.isMeshLambertMaterial&&!_.envMap||_.isMeshPhongMaterial&&!_.envMap,V=e.get(_.envMap||W,J),te=f[_.type],H=n.precision;_.precision!==null&&(H=n.getMaxPrecision(_.precision),H!==_.precision&&Re("WebGLProgram.getParameters:",_.precision,"not supported, using",H,"instead."));let Q=P.morphAttributes.position||P.morphAttributes.normal||P.morphAttributes.color,j=Q!==void 0?Q.length:0,Se=0;P.morphAttributes.position!==void 0&&(Se=1),P.morphAttributes.normal!==void 0&&(Se=2),P.morphAttributes.color!==void 0&&(Se=3);let De,Y,me,ve;if(te){let fe=Sn[te];De=fe.vertexShader,Y=fe.fragmentShader}else{De=_.vertexShader,Y=_.fragmentShader;let fe=a.getVertexShaderStage(_),Ke=a.getFragmentShaderStage(_);a.update(_,fe,Ke),me=fe.id,ve=Ke.id}let Te=i.getRenderTarget(),ge=i.state.buffers.depth.getReversed(),Fe=N.isInstancedMesh===!0,ut=N.isBatchedMesh===!0,Ce=!!_.map,Je=!!_.matcap,et=!!V,Ve=et&&V.isPMREMTexture===!0,Tt=!!_.aoMap,mt=!!_.lightMap,Bt=!!_.bumpMap&&_.wireframe===!1,at=!!_.normalMap,dn=!!_.displacementMap,vt=!!_.emissiveMap,Zt=!!_.metalnessMap,Jt=!!_.roughnessMap,Kt=_.anisotropy>0,L=_.clearcoat>0,Qt=_.diffuseRoughness>0,st=_.dispersion>0,rt=_.retroreflectivity>0,de=_.iridescence>0,gt=_.sheen>0,Ae=_.transmission>0,Ne=Kt&&!!_.anisotropyMap,E=L&&!!_.clearcoatMap,x=L&&!!_.clearcoatNormalMap,F=L&&!!_.clearcoatRoughnessMap,ee=Qt&&!!_.diffuseRoughnessMap,K=de&&!!_.iridescenceMap,re=de&&!!_.iridescenceThicknessMap,he=gt&&!!_.sheenColorMap,X=gt&&!!_.sheenRoughnessMap,q=!!_.specularMap,ae=!!_.specularColorMap,R=!!_.specularIntensityMap,Z=Ae&&!!_.transmissionMap,G=Ae&&!!_.thicknessMap,le=!!_.gradientMap,ie=!!_.alphaMap,oe=_.alphaTest>0,we=!!_.alphaHash,Be=!!_.extensions,ne=yn;_.toneMapped&&(Te===null||Te.isXRRenderTarget===!0)&&(ne=i.toneMapping);let Ee=Ve?V.isCompressedCubeTexture?V.image[0].mipmaps:V.mipmaps:null,Oe={shaderID:te,shaderType:_.type,shaderName:_.name,vertexShader:De,fragmentShader:Y,defines:_.defines,customVertexShaderID:me,customFragmentShaderID:ve,isRawShaderMaterial:_.isRawShaderMaterial===!0,glslVersion:_.glslVersion,precision:H,batching:ut,batchingColor:ut&&N._colorsTexture!==null,instancing:Fe,instancingColor:Fe&&N.instanceColor!==null,instancingMorph:Fe&&N.morphTexture!==null,outputColorSpace:Te===null?i.outputColorSpace:Te.isXRRenderTarget===!0?Te.texture.colorSpace:We.workingColorSpace,alphaToCoverage:!!_.alphaToCoverage,map:Ce,matcap:Je,envMap:et,envMapMode:et&&V.mapping,envMapPMREM:Ve,envMapMaxLod:Ve?Ee.length-1:null,envMapSize:Ve?Ee[0].width:null,aoMap:Tt,lightMap:mt,bumpMap:Bt,normalMap:at,displacementMap:dn,emissiveMap:vt,normalMap Line truncated
`+Q)}else P!==""?Re("WebGLProgram: Program Info Log:",P):(W===""||J==="")&&(te=!1);te&&(I.diagnostics={runnable:V,programLog:P,vertexShader:{log:W,prefix:v},fragmentShader:{log:J,prefix:p}})}s.deleteShader(S),s.deleteShader(A),_=new is(s,g),M=z0(s,g)}let _;this.getUniforms=function(){return _===void 0&&T(this),_};let M;this.getAttributes=function(){return M===void 0&&T(this),M};let U=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return U===!1&&(U=s.getProgramParameter(g,P0)),U},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(g),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=I0++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=S,this.fragmentShader=A,this}var Q0=0,hc=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e,t,n){let s=this._getShaderCacheForMaterial(e);return s.has(t)===!1&&(s.add(t),t.usedTimes++),s.has(n)===!1&&(s.add(n),n.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderStage(e){return this._getShaderStage(e.vertexShader)}getFragmentShaderStage(e){return this._getShaderStage(e.fragmentShader)}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return n===void 0&&(n=new uc(e),t.set(e,n)),n}},uc=class{constructor(e){this.id=Q0++,this.code=e,this.usedTimes=0}};function j0(i){return i===ni||i===Ks||i===Qs}function e_(i,e,t,n,s,r){let o=new qi,a=new hc,l=new Set,c=[],u=new Map,d=n.logarithmicDepthBuffer,f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function h(_){return l.add(_),_===0?"uv":`uv${_}`}function g(_,M,U,I,N,k){let $=I.fog,P=N.geometry,W=_.isMeshStandardMaterial||_.isMeshLambertMaterial||_.isMeshPhongMaterial?I.environment:null,J=_.isMeshStandardMaterial||_.isMeshLambertMaterial&&!_.envMap||_.isMeshPhongMaterial&&!_.envMap,V=e.get(_.envMap||W,J),te=f[_.type],H=n.precision;_.precision!==null&&(H=n.getMaxPrecision(_.precision),H!==_.precision&&Re("WebGLProgram.getParameters:",_.precision,"not supported, using",H,"instead."));let Q=P.morphAttributes.position||P.morphAttributes.normal||P.morphAttributes.color,j=Q!==void 0?Q.length:0,Se=0;P.morphAttributes.position!==void 0&&(Se=1),P.morphAttributes.normal!==void 0&&(Se=2),P.morphAttributes.color!==void 0&&(Se=3);let De,Y,me,ve;if(te){let fe=Sn[te];De=fe.vertexShader,Y=fe.fragmentShader}else{De=_.vertexShader,Y=_.fragmentShader;let fe=a.getVertexShaderStage(_),Ke=a.getFragmentShaderStage(_);a.update(_,fe,Ke),me=fe.id,ve=Ke.id}let Te=i.getRenderTarget(),ge=i.state.buffers.depth.getReversed(),Fe=N.isInstancedMesh===!0,ut=N.isBatchedMesh===!0,Ce=!!_.map,Je=!!_.matcap,et=!!V,Ve=et&&V.isPMREMTexture===!0,Tt=!!_.aoMap,mt=!!_.lightMap,Bt=!!_.bumpMap&&_.wireframe===!1,at=!!_.normalMap,dn=!!_.displacementMap,vt=!!_.emissiveMap,Zt=!!_.metalnessMap,Jt=!!_.roughnessMap,Kt=_.anisotropy>0,L=_.clearcoat>0,Qt=_.diffuseRoughness>0,st=_.dispersion>0,rt=_.retroreflectivity>0,de=_.iridescence>0,gt=_.sheen>0,Ae=_.transmission>0,Ne=Kt&&!!_.anisotropyMap,E=L&&!!_.clearcoatMap,x=L&&!!_.clearcoatNormalMap,F=L&&!!_.clearcoatRoughnessMap,ee=Qt&&!!_.diffuseRoughnessMap,K=de&&!!_.iridescenceMap,re=de&&!!_.iridescenceThicknessMap,he=gt&&!!_.sheenColorMap,X=gt&&!!_.sheenRoughnessMap,q=!!_.specularMap,ae=!!_.specularColorMap,R=!!_.specularIntensityMap,Z=Ae&&!!_.transmissionMap,G=Ae&&!!_.thicknessMap,le=!!_.gradientMap,ie=!!_.alphaMap,oe=_.alphaTest>0,we=!!_.alphaHash,Be=!!_.extensions,ne=yn;_.toneMapped&&(Te===null||Te.isXRRenderTarget===!0)&&(ne=i.toneMapping);let Ee=Ve?V.isCompressedCubeTexture?V.image[0].mipmaps:V.mipmaps:null,Oe={shaderID:te,shaderType:_.type,shaderName:_.name,vertexShader:De,fragmentShader:Y,defines:_.defines,customVertexShaderID:me,customFragmentShaderID:ve,isRawShaderMaterial:_.isRawShaderMaterial===!0,glslVersion:_.glslVersion,precision:H,batching:ut,batchingColor:ut&&N._colorsTexture!==null,instancing:Fe,instancingColor:Fe&&N.instanceColor!==null,instancingMorph:Fe&&N.morphTexture!==null,outputColorSpace:Te===null?i.outputColorSpace:Te.isXRRenderTarget===!0?Te.texture.colorSpace:We.workingColorSpace,alphaToCoverage:!!_.alphaToCoverage,map:Ce,matcap:Je,envMap:et,envMapMode:et&&V.mapping,envMapPMREM:Ve,envMapMaxLod:Ve?Ee.length-1:null,envMapSize:Ve?Ee[0].width:null,aoMap:Tt,lightMap:mt,bumpMap:Bt,normalMap:at,displacementMap:dn,emissiveMap:vt,normalMap Line truncated
gl_Position = vec4( position, 1.0 );
}`,u_=`uniform sampler2D shadow_pass;
uniform vec2 resolution;
@@ -4201,7 +4201,7 @@ void main() {
squared_mean = squared_mean / samples;
float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
}`,d_=[new B(1,0,0),new B(-1,0,0),new B(0,1,0),new B(0,-1,0),new B(0,0,1),new B(0,0,-1)],f_=[new B(0,-1,0),new B(0,-1,0),new B(0,0,1),new B(0,0,-1),new B(0,-1,0),new B(0,-1,0)],qu=new ot,er=new B,rc=new B;function p_(i,e,t){let n=new _i,s=new ze,r=new ze,o=new ht,a=new fo,l=new po,c={},u=t.maxTextureSize,d={[ei]:Ot,[Ot]:ei,[vn]:vn},f=new xn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ze},radius:{value:4}},vertexShader:h_,fragmentShader:u_}),h=f.clone();h.defines.HORIZONTAL_PASS=1;let g=new $t;g.setAttribute("position",new mn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let v=new Xt(g,f),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=$s;let m=this.type;this.render=function(T,_,M){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||T.length===0)return;this.type===Oh&&(Re("WebGLShadowMap: PCFSoftShadowMap has been removed. Using PCFShadowMap instead."),this.type=$s);let U=i.getRenderTarget(),I=i.getActiveCubeFace(),N=i.getActiveMipmapLevel(),k=i.state;k.setBlending(yi),k.buffers.depth.getReversed()===!0?k.buffers.color.setClear(0,0,0,0):k.buffers.color.setClear(1,1,1,1),k.buffers.depth.setTest(!0),k.setScissorTest(!1);let $=m!==this.type;$&&_.traverse(function(P){P.material&&(Array.isArray(P.material)?P.material.forEach(W=>W.needsUpdate=!0):P.material.needsUpdate=!0)});for(let P=0,W=T.length;P<W;P++){let J=T[P],V=J.shadow;if(V===void 0){Re("WebGLShadowMap:",J,"has no shadow.");continue}if(V.autoUpdate===!1&&V.needsUpdate===!1)continue;s.copy(V.mapSize);let te=V.getFrameExtents();s.multiply(te),r.copy(V.mapSize),(s.x>u||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/te.x),s.x=r.x*te.x,V.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/te.y),s.y=r.y*te.y,V.mapSize.y=r.y));let H=i.state.buffers.depth.getReversed();if(V.camera._reversedDepth=H,V.map===null||$===!0){if(V.map!==null&&(V.map.depthTexture!==null&&(V.map.depthTexture.dispose(),V.map.depthTexture=null),V.map.dispose()),this.type===ji){if(J.isPointLight){Re("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}V.map=new Ht(s.x,s.y,{format:ti,type:hn,minFilter:Ft,magFilter:Ft,generateMipmaps:!1}),V.map.texture.name=J.name+".shadowMap",V.map.depthTexture=new Nn(s.x,s.y,cn),V.map.depthTexture.name=J.name+".shadowMapDepth",V.map.depthTexture.format=Ln,V.map.depthTexture.compareFunction=null,V.map.depthTexture.minFilter=wt,V.map.depthTexture.magFilter=wt}else J.isPointLight?(V.map=new nr(s.x),V.map.depthTexture=new Ds(s.x,ln)):(V.map=new Ht(s.x,s.y),V.map.depthTexture=new Nn(s.x,s.y,ln)),V.map.depthTexture.name=J.name+".shadowMap",V.map.depthTexture.format=Ln,this.type===$s?(V.map.depthTexture.compareFunction=H?Wl:Hl,V.map.depthTexture.minFilter=Ft,V.map.depthTexture.magFilter=Ft):(V.map.depthTexture.compareFunction=null,V.map.depthTexture.minFilter=wt,V.map.depthTexture.magFilter=wt);V.camera.updateProjectionMatrix()}V.map.isWebGLCubeRenderTarget!==!0&&(V.map.width!==s.x||V.map.height!==s.y)&&V.map.setSize(s.x,s.y);let Q=V.map.isWebGLCubeRenderTarget?6:V.getViewportCount();J.isPointLight!==!0&&V.updateMatrices(J,M);let j=(V.camera.layers.mask&4294967294)!==0?V.camera.layers:M.layers;for(let Se=0;Se<Q;Se++){let De=V.getCamera(Se);if(J.isPointLight){let Y=V.camera,me=V.matrix,ve=J.distance||Y.far;ve!==Y.far&&(Y.far=ve,Y.updateProjectionMatrix()),er.setFromMatrixPosition(J.matrixWorld),Y.position.copy(er),rc.copy(Y.position),rc.add(d_[Se]),Y.up.copy(f_[Se]),Y.lookAt(rc),Y.updateMatrixWorld(),me.makeTranslation(-er.x,-er.y,-er.z),qu.multiplyMatrices(Y.projectionMatrix,Y.matrixWorldInverse),V._frustum.setFromProjectionMatrix(qu,Y.coordinateSystem,Y.reversedDepth)}if(V.map.isWebGLCubeRenderTarget)i.setRenderTarget(V.map,Se),i.clear();else{Se===0&&(i.setRenderTarget(V.map),i.clear());let Y=V.getViewport(Se);o.set(r.x*Y.x,r.y*Y.y,r.x*Y.z,r.y*Y.w),k.viewport(o)}n=V.getFrustum(Se),S(_,M,De,J,j,this.type)}V.isPointLightShadow!==!0&&this.type===ji&&b(V,M),V.needsUpdate=!1}m=this.type,p.needsUpdate=!1,i.setRenderTarget(U,I,N)};function b(T,_){let M=e.update(v);f.defines.VSM_SAMPLES!==T.blurSamples&&(f.defines.VSM_SAMPLES=T.blurSamples,h.defines.VSM_SAMPLES=T.blurSamples,f.needsUpdate=!0,h.needsUpdate=!0),T.mapPass===null?T.mapPass=new Ht(s.x,s.y,{format:ti,type:hn}):(T.mapPass.width!==T.map.width||T.mapPass.height!==T.map.height)&&T.mapPass.setSize(T.map.width,T.map.height),f.uniforms.shadow_pass.value=T.map.depthTexture,f.uniforms.resolution.value.set(T.map.width,T.map.height),f.uniforms.radius.value=T.radius,i.setRenderTarget(T.mapPass),i.clear(),i.renderBufferDirect(_,null,M,f,v,null),h.uniforms.shadow_pass.value=T.mapPass.texture,h.uniforms.resolution.value.set(T.map.width,T.map.height),h.uniforms.radius.value=T.radius,i.setRenderTarget(T.map),i.clear(),i.renderBufferDirect(_,null,M,h,v,null)}function w(T,_,M,U){let I=null,N=M.isPointLight===!0?T.customDistanceMaterial:T.customDepthMaterial;if(N!==void 0)I=N;else if(I=M.isPointLight===!0?l:a,i.localClipping Line truncated
}`,d_=[new B(1,0,0),new B(-1,0,0),new B(0,1,0),new B(0,-1,0),new B(0,0,1),new B(0,0,-1)],f_=[new B(0,-1,0),new B(0,-1,0),new B(0,0,1),new B(0,0,-1),new B(0,-1,0),new B(0,-1,0)],qu=new ot,er=new B,rc=new B;function p_(i,e,t){let n=new _i,s=new ze,r=new ze,o=new ht,a=new fo,l=new po,c={},u=t.maxTextureSize,d={[ti]:Ot,[Ot]:ti,[vn]:vn},f=new xn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ze},radius:{value:4}},vertexShader:h_,fragmentShader:u_}),h=f.clone();h.defines.HORIZONTAL_PASS=1;let g=new $t;g.setAttribute("position",new mn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let v=new Xt(g,f),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=$s;let m=this.type;this.render=function(T,_,M){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||T.length===0)return;this.type===Oh&&(Re("WebGLShadowMap: PCFSoftShadowMap has been removed. Using PCFShadowMap instead."),this.type=$s);let U=i.getRenderTarget(),I=i.getActiveCubeFace(),N=i.getActiveMipmapLevel(),k=i.state;k.setBlending(yi),k.buffers.depth.getReversed()===!0?k.buffers.color.setClear(0,0,0,0):k.buffers.color.setClear(1,1,1,1),k.buffers.depth.setTest(!0),k.setScissorTest(!1);let $=m!==this.type;$&&_.traverse(function(P){P.material&&(Array.isArray(P.material)?P.material.forEach(W=>W.needsUpdate=!0):P.material.needsUpdate=!0)});for(let P=0,W=T.length;P<W;P++){let J=T[P],V=J.shadow;if(V===void 0){Re("WebGLShadowMap:",J,"has no shadow.");continue}if(V.autoUpdate===!1&&V.needsUpdate===!1)continue;s.copy(V.mapSize);let te=V.getFrameExtents();s.multiply(te),r.copy(V.mapSize),(s.x>u||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/te.x),s.x=r.x*te.x,V.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/te.y),s.y=r.y*te.y,V.mapSize.y=r.y));let H=i.state.buffers.depth.getReversed();if(V.camera._reversedDepth=H,V.map===null||$===!0){if(V.map!==null&&(V.map.depthTexture!==null&&(V.map.depthTexture.dispose(),V.map.depthTexture=null),V.map.dispose()),this.type===ji){if(J.isPointLight){Re("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}V.map=new Ht(s.x,s.y,{format:ni,type:hn,minFilter:Ft,magFilter:Ft,generateMipmaps:!1}),V.map.texture.name=J.name+".shadowMap",V.map.depthTexture=new Nn(s.x,s.y,cn),V.map.depthTexture.name=J.name+".shadowMapDepth",V.map.depthTexture.format=Ln,V.map.depthTexture.compareFunction=null,V.map.depthTexture.minFilter=wt,V.map.depthTexture.magFilter=wt}else J.isPointLight?(V.map=new nr(s.x),V.map.depthTexture=new Ds(s.x,ln)):(V.map=new Ht(s.x,s.y),V.map.depthTexture=new Nn(s.x,s.y,ln)),V.map.depthTexture.name=J.name+".shadowMap",V.map.depthTexture.format=Ln,this.type===$s?(V.map.depthTexture.compareFunction=H?Wl:Hl,V.map.depthTexture.minFilter=Ft,V.map.depthTexture.magFilter=Ft):(V.map.depthTexture.compareFunction=null,V.map.depthTexture.minFilter=wt,V.map.depthTexture.magFilter=wt);V.camera.updateProjectionMatrix()}V.map.isWebGLCubeRenderTarget!==!0&&(V.map.width!==s.x||V.map.height!==s.y)&&V.map.setSize(s.x,s.y);let Q=V.map.isWebGLCubeRenderTarget?6:V.getViewportCount();J.isPointLight!==!0&&V.updateMatrices(J,M);let j=(V.camera.layers.mask&4294967294)!==0?V.camera.layers:M.layers;for(let Se=0;Se<Q;Se++){let De=V.getCamera(Se);if(J.isPointLight){let Y=V.camera,me=V.matrix,ve=J.distance||Y.far;ve!==Y.far&&(Y.far=ve,Y.updateProjectionMatrix()),er.setFromMatrixPosition(J.matrixWorld),Y.position.copy(er),rc.copy(Y.position),rc.add(d_[Se]),Y.up.copy(f_[Se]),Y.lookAt(rc),Y.updateMatrixWorld(),me.makeTranslation(-er.x,-er.y,-er.z),qu.multiplyMatrices(Y.projectionMatrix,Y.matrixWorldInverse),V._frustum.setFromProjectionMatrix(qu,Y.coordinateSystem,Y.reversedDepth)}if(V.map.isWebGLCubeRenderTarget)i.setRenderTarget(V.map,Se),i.clear();else{Se===0&&(i.setRenderTarget(V.map),i.clear());let Y=V.getViewport(Se);o.set(r.x*Y.x,r.y*Y.y,r.x*Y.z,r.y*Y.w),k.viewport(o)}n=V.getFrustum(Se),S(_,M,De,J,j,this.type)}V.isPointLightShadow!==!0&&this.type===ji&&b(V,M),V.needsUpdate=!1}m=this.type,p.needsUpdate=!1,i.setRenderTarget(U,I,N)};function b(T,_){let M=e.update(v);f.defines.VSM_SAMPLES!==T.blurSamples&&(f.defines.VSM_SAMPLES=T.blurSamples,h.defines.VSM_SAMPLES=T.blurSamples,f.needsUpdate=!0,h.needsUpdate=!0),T.mapPass===null?T.mapPass=new Ht(s.x,s.y,{format:ni,type:hn}):(T.mapPass.width!==T.map.width||T.mapPass.height!==T.map.height)&&T.mapPass.setSize(T.map.width,T.map.height),f.uniforms.shadow_pass.value=T.map.depthTexture,f.uniforms.resolution.value.set(T.map.width,T.map.height),f.uniforms.radius.value=T.radius,i.setRenderTarget(T.mapPass),i.clear(),i.renderBufferDirect(_,null,M,f,v,null),h.uniforms.shadow_pass.value=T.mapPass.texture,h.uniforms.resolution.value.set(T.map.width,T.map.height),h.uniforms.radius.value=T.radius,i.setRenderTarget(T.map),i.clear(),i.renderBufferDirect(_,null,M,h,v,null)}function w(T,_,M,U){let I=null,N=M.isPointLight===!0?T.customDistanceMaterial:T.customDepthMaterial;if(N!==void 0)I=N;else if(I=M.isPointLight===!0?l:a,i.localClipping Line truncated
void main() {
gl_Position = vec4( position, 1.0 );
@@ -4225,7 +4225,7 @@ void main() {
}
}`,dc=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){let n=new Us(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new xn({vertexShader:x_,fragmentShader:v_,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Xt(new zs(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},fc=class extends gn{constructor(e,t){super();let n=this,s=null,r=1,o=null,a="local-floor",l=1,c=null,u=null,d=null,f=null,h=null,g=null,v=typeof XRWebGLBinding<"u",p=new dc,m={},b=t.getContextAttributes(),w=null,S=null,A=[],T=[],_=new ze,M=null,U=null,I=new Ut;I.viewport=new ht;let N=new Ut;N.viewport=new ht;let k=[I,N],$=new To,P=null,W=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let me=A[Y];return me===void 0&&(me=new Yi,A[Y]=me),me.getTargetRaySpace()},this.getControllerGrip=function(Y){let me=A[Y];return me===void 0&&(me=new Yi,A[Y]=me),me.getGripSpace()},this.getHand=function(Y){let me=A[Y];return me===void 0&&(me=new Yi,A[Y]=me),me.getHandSpace()};function J(Y){let me=T.indexOf(Y.inputSource);if(me===-1)return;let ve=A[me];ve!==void 0&&(ve.update(Y.inputSource,Y.frame,c||o),ve.dispatchEvent({type:Y.type,data:Y.inputSource}))}function V(){s.removeEventListener("select",J),s.removeEventListener("selectstart",J),s.removeEventListener("selectend",J),s.removeEventListener("squeeze",J),s.removeEventListener("squeezestart",J),s.removeEventListener("squeezeend",J),s.removeEventListener("end",V),s.removeEventListener("inputsourceschange",te);for(let Y=0;Y<A.length;Y++){let me=T[Y];me!==null&&(T[Y]=null,A[Y].disconnect(me))}P=null,W=null,p.reset();for(let Y in m)delete m[Y];if(e.setRenderTarget(w),h=null,f=null,d=null,s=null,S=null,De.stop(),n.isPresenting=!1,e.setPixelRatio(M),e.setSize(_.width,_.height,!1),U!==null){let Y=U.camera;Y.fov=U.fov,Y.zoom=U.zoom,Y.updateProjectionMatrix(),U=null}n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){r=Y,n.isPresenting===!0&&Re("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){a=Y,n.isPresenting===!0&&Re("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(Y){c=Y},this.getBaseLayer=function(){return f!==null?f:h},this.getBinding=function(){return d===null&&v&&(d=new XRWebGLBinding(s,t)),d},this.getFrame=function(){return g},this.getSession=function(){return s},this.setSession=async function(Y){if(s=Y,s!==null){if(w=e.getRenderTarget(),s.addEventListener("select",J),s.addEventListener("selectstart",J),s.addEventListener("selectend",J),s.addEventListener("squeeze",J),s.addEventListener("squeezestart",J),s.addEventListener("squeezeend",J),s.addEventListener("end",V),s.addEventListener("inputsourceschange",te),b.xrCompatible!==!0&&await t.makeXRCompatible(),M=e.getPixelRatio(),e.getSize(_),v&&"createProjectionLayer"in XRWebGLBinding.prototype){let ve=null,Te=null,ge=null;b.depth&&(ge=b.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ve=b.stencil?Un:Ln,Te=b.stencil?Mi:ln);let Fe={colorFormat:t.RGBA8,depthFormat:ge,scaleFactor:r};d=this.getBinding(),f=d.createProjectionLayer(Fe),s.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),S=new Ht(f.textureWidth,f.textureHeight,{format:un,type:Yt,depthTexture:new Nn(f.textureWidth,f.textureHeight,Te,void 0,void 0,void 0,void 0,void 0,void 0,ve),stencilBuffer:b.stencil,colorSpace:e.outputColorSpace,samples:b.antialias?4:0,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1,storeMultisampledDepthBuffer:f.ignoreDepthValues===!1,storeMultisampledStencilBuffer:f.ignoreDepthValues===!1})}else{let ve={antialias:b.antialias,alpha:!0,depth:b.depth,stencil:b.stencil,framebufferScaleFactor:r};h=new XRWebGLLayer(s,t,ve),s.updateRenderState({baseLayer:h}),e.setPixelRatio(1),e.setSize(h.framebufferWidth,h.framebufferHeight,!1),S=new Ht(h.framebufferWidth,h.framebufferHeight,{format:un,type:Yt,colorSpace:e.outputColorSpace,stencilBuffer:b.stencil,resolveDepthBuffer:h.ignoreDepthValues===!1,resolveStencilBuffer:h.ignoreDepthValues===!1,storeMultisampledDepthBuffer:h.ignoreDepthValues===!1,storeMultisampledStencilBuffer:h.ignoreDepthValues===!1})}S.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await s.requestReferenceSpace(a),De.setContext(s),De.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode},this.getDepthTexture=function(){return p.getDepthTexture()};function te(Y){for(let me=0;me<Y.removed.length;me++){let ve=Y.removed[ Line truncated
}`,dc=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){let n=new Us(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new xn({vertexShader:x_,fragmentShader:v_,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Xt(new zs(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},fc=class extends gn{constructor(e,t){super();let n=this,s=null,r=1,o=null,a="local-floor",l=1,c=null,u=null,d=null,f=null,h=null,g=null,v=typeof XRWebGLBinding<"u",p=new dc,m={},b=t.getContextAttributes(),w=null,S=null,A=[],T=[],_=new ze,M=null,U=null,I=new Ut;I.viewport=new ht;let N=new Ut;N.viewport=new ht;let k=[I,N],$=new To,P=null,W=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let me=A[Y];return me===void 0&&(me=new Yi,A[Y]=me),me.getTargetRaySpace()},this.getControllerGrip=function(Y){let me=A[Y];return me===void 0&&(me=new Yi,A[Y]=me),me.getGripSpace()},this.getHand=function(Y){let me=A[Y];return me===void 0&&(me=new Yi,A[Y]=me),me.getHandSpace()};function J(Y){let me=T.indexOf(Y.inputSource);if(me===-1)return;let ve=A[me];ve!==void 0&&(ve.update(Y.inputSource,Y.frame,c||o),ve.dispatchEvent({type:Y.type,data:Y.inputSource}))}function V(){s.removeEventListener("select",J),s.removeEventListener("selectstart",J),s.removeEventListener("selectend",J),s.removeEventListener("squeeze",J),s.removeEventListener("squeezestart",J),s.removeEventListener("squeezeend",J),s.removeEventListener("end",V),s.removeEventListener("inputsourceschange",te);for(let Y=0;Y<A.length;Y++){let me=T[Y];me!==null&&(T[Y]=null,A[Y].disconnect(me))}P=null,W=null,p.reset();for(let Y in m)delete m[Y];if(e.setRenderTarget(w),h=null,f=null,d=null,s=null,S=null,De.stop(),n.isPresenting=!1,e.setPixelRatio(M),e.setSize(_.width,_.height,!1),U!==null){let Y=U.camera;Y.fov=U.fov,Y.zoom=U.zoom,Y.updateProjectionMatrix(),U=null}n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){r=Y,n.isPresenting===!0&&Re("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){a=Y,n.isPresenting===!0&&Re("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(Y){c=Y},this.getBaseLayer=function(){return f!==null?f:h},this.getBinding=function(){return d===null&&v&&(d=new XRWebGLBinding(s,t)),d},this.getFrame=function(){return g},this.getSession=function(){return s},this.setSession=async function(Y){if(s=Y,s!==null){if(w=e.getRenderTarget(),s.addEventListener("select",J),s.addEventListener("selectstart",J),s.addEventListener("selectend",J),s.addEventListener("squeeze",J),s.addEventListener("squeezestart",J),s.addEventListener("squeezeend",J),s.addEventListener("end",V),s.addEventListener("inputsourceschange",te),b.xrCompatible!==!0&&await t.makeXRCompatible(),M=e.getPixelRatio(),e.getSize(_),v&&"createProjectionLayer"in XRWebGLBinding.prototype){let ve=null,Te=null,ge=null;b.depth&&(ge=b.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ve=b.stencil?Un:Ln,Te=b.stencil?Mi:ln);let Fe={colorFormat:t.RGBA8,depthFormat:ge,scaleFactor:r};d=this.getBinding(),f=d.createProjectionLayer(Fe),s.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),S=new Ht(f.textureWidth,f.textureHeight,{format:un,type:Yt,depthTexture:new Nn(f.textureWidth,f.textureHeight,Te,void 0,void 0,void 0,void 0,void 0,void 0,ve),stencilBuffer:b.stencil,colorSpace:e.outputColorSpace,samples:b.antialias?4:0,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1,storeMultisampledDepthBuffer:f.ignoreDepthValues===!1,storeMultisampledStencilBuffer:f.ignoreDepthValues===!1})}else{let ve={antialias:b.antialias,alpha:!0,depth:b.depth,stencil:b.stencil,framebufferScaleFactor:r};h=new XRWebGLLayer(s,t,ve),s.updateRenderState({baseLayer:h}),e.setPixelRatio(1),e.setSize(h.framebufferWidth,h.framebufferHeight,!1),S=new Ht(h.framebufferWidth,h.framebufferHeight,{format:un,type:Yt,colorSpace:e.outputColorSpace,stencilBuffer:b.stencil,resolveDepthBuffer:h.ignoreDepthValues===!1,resolveStencilBuffer:h.ignoreDepthValues===!1,storeMultisampledDepthBuffer:h.ignoreDepthValues===!1,storeMultisampledStencilBuffer:h.ignoreDepthValues===!1})}S.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await s.requestReferenceSpace(a),De.setContext(s),De.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode},this.getDepthTexture=function(){return p.getDepthTexture()};function te(Y){for(let me=0;me<Y.removed.length;me++){let ve=Y.removed[ Line truncated
>${e}
<input type="number" .value=${String(t)} step=${s.step??.5} min=${s.min??Qe} max=${s.max??Qe} @change=${r=>{let o=Number(r.target.value);Number.isFinite(o)&&n(o)}} />
</label>`}text(e,t,n,s={}){return qe`<label class="field wide" title=${s.hint??Qe}
File diff suppressed because it is too large. Load diff
@@ -1,13 +1,13 @@
/*! NextFloor, MIT licence. Includes three.js (MIT) and Lit (BSD-3-Clause); see LICENSE and THIRD_PARTY_NOTICES.md */
var w={cs:"4be67fcd522e",da:"0fe66a82bf2a",es:"bd89dffd1355",fi:"9a17bc084f56",fr:"6312d0f61ebf",hu:"27ba348531dc",it:"1b705e76dd00",nb:"c5ea24fb9ef6",nl:"b64142c67c2e",pl:"8527a4930402",pt:"31857a2d2277",ro:"e3cb5f449f0f",sk:"320611594db0",sl:"8071691ceda3",sv:"711b911ec8da",tr:"7c83ce1c3372",zh:"50518d9f494e"};Array.prototype.at||Object.defineProperty(Array.prototype,"at",{configurable:!0,writable:!0,value:function(e){let t=Math.trunc(e)||0;return this[t<0?this.length+t:t]}});typeof globalThis.structuredClone!="function"&&(globalThis.structuredClone=n=>n===void 0?n:JSON.parse(JSON.stringify(n)));var jn=globalThis,qn=jn.ShadowRoot&&(jn.ShadyCSS===void 0||jn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,_i=Symbol(),gs=new WeakMap,rn=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==_i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(qn&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=gs.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&gs.set(t,e))}return e}toString(){return this.cssText}},_s=n=>new rn(typeof n=="string"?n:n+"",void 0,_i),J=(n,...e)=>{let t=n.length===1?n[0]:e.reduce((r,i,o)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[o+1],n[0]);return new rn(t,n,_i)},bs=(n,e)=>{if(qn)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),i=jn.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=t.cssText,n.appendChild(r)}},bi=qn?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return _s(t)})(n):n;var{is:yd,defineProperty:vd,getOwnPropertyDescriptor:wd,getOwnPropertyNames:xd,getOwnPropertySymbols:kd,getPrototypeOf:Sd}=Object,Zn=globalThis,ys=Zn.trustedTypes,$d=ys?ys.emptyScript:"",Md=Zn.reactiveElementPolyfillSupport,on=(n,e)=>n,yi={toAttribute(n,e){switch(e){case Boolean:n=n?$d:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},ws=(n,e)=>!yd(n,e),vs={attribute:!0,type:String,converter:yi,reflect:!1,useDefault:!1,hasChanged:ws};Symbol.metadata??=Symbol("metadata"),Zn.litPropertyMetadata??=new WeakMap;var Le=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=vs){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),i=this.getPropertyDescriptor(e,r,t);i!==void 0&&vd(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){let{get:i,set:o}=wd(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:i,set(s){let a=i?.call(this);o?.call(this,s),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??vs}static _$Ei(){if(this.hasOwnProperty(on("elementProperties")))return;let e=Sd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(on("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(on("properties"))){let t=this.properties,r=[...xd(t),...kd(t)];for(let i of r)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,i]of t)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let i=this._$Eu(t,r);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let i of r)t.unshift(bi(i))}else e!==void 0&&t.push(bi(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.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(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadLine truncated
\f\r]`,sn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ss=/-->/g,$s=/>/g,ut=RegExp(`>|${vi}(?:([^\\s"'>=/]+)(${vi}*=${vi}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ms=/'/g,As=/"/g,Ts=/^(?:script|style|textarea|title)$/i,Ei=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),p=Ei(1),ne=Ei(2),kg=Ei(3),mt=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Es=new WeakMap,dt=ht.createTreeWalker(ht,129);function Fs(n,e){if(!Ai(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ks!==void 0?ks.createHTML(e):e}var Rd=(n,e)=>{let t=n.length-1,r=[],i,o=e===2?"<svg>":e===3?"<math>":"",s=sn;for(let a=0;a<t;a++){let l=n[a],c,u,h=-1,m=0;for(;m<l.length&&(s.lastIndex=m,u=s.exec(l),u!==null);)m=s.lastIndex,s===sn?u[1]==="!--"?s=Ss:u[1]!==void 0?s=$s:u[2]!==void 0?(Ts.test(u[2])&&(i=RegExp("</"+u[2],"g")),s=ut):u[3]!==void 0&&(s=ut):s===ut?u[0]===">"?(s=i??sn,h=-1):u[1]===void 0?h=-2:(h=s.lastIndex-u[2].length,c=u[1],s=u[3]===void 0?ut:u[3]==='"'?As:Ms):s===As||s===Ms?s=ut:s===Ss||s===$s?s=sn:(s=ut,i=void 0);let d=s===ut&&n[a+1].startsWith("/>")?" ":"";o+=s===sn?l+Ad:h>=0?(r.push(c),l.slice(0,h)+Rs+l.slice(h)+tt+d):l+tt+(h===-2?a:d)}return[Fs(n,o+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},cn=class n{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let o=0,s=0,a=e.length-1,l=this.parts,[c,u]=Rd(e,t);if(this.el=n.createElement(c,r),dt.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=dt.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith(Rs)){let m=u[s++],d=i.getAttribute(h).split(tt),g=/([.?@])?(.*)/.exec(m);l.push({type:1,index:o,name:g[2],strings:d,ctor:g[1]==="."?xi:g[1]==="?"?ki:g[1]==="@"?Si:At}),i.removeAttribute(h)}else h.startsWith(tt)&&(l.push({type:6,index:o}),i.removeAttribute(h));if(Ts.test(i.tagName)){let h=i.textContent.split(tt),m=h.length-1;if(m>0){i.textContent=Yn?Yn.emptyScript:"";for(let d=0;d<m;d++)i.append(h[d],an()),dt.nextNode(),l.push({type:2,index:++o});i.append(h[m],an())}}}else if(i.nodeType===8)if(i.data===zs)l.push({type:2,index:o});else{let h=-1;for(;(h=i.data.indexOf(tt,h+1))!==-1;)l.push({type:7,index:o}),h+=tt.length-1}o++}}static createElement(e,t){let r=ht.createElement("template");return r.innerHTML=e,r}};function Mt(n,e,t=n,r){if(e===mt)return e;let i=r!==void 0?t._$Co?.[r]:t._$Cl,o=ln(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,t,r)),r!==void 0?(t._$Co??=[])[r]=i:t._$Cl=i),i!==void 0&&(e=Mt(n,i._$AS(n,e.values),i,r)),e}var wi=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,i=(e?.creationScope??ht).importNode(t,!0);dt.currentNode=i;let o=dt.nextNode(),s=0,a=0,l=r[0];for(;l!==void 0;){if(s===l.index){let c;l.type===2?c=new un(o,o.nextSibling,this,e):l.type===1?c=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(c=new $i(o,this,e)),this._$AV.push(c),l=r[++a]}s!==l?.index&&(o=dt.nextNode(),s++)}return dt.currentNode=ht,i}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},un=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Mt(this,e,t),ln(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==mt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ed(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==f&&ln(this._$AH)?this._$AA.nextSibling.data=e:this.T(ht.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=cn.createElement(Fs(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(t);else{let o=new wi(i,this),s=o.u(this.options);o.p(t),this.T(s),this._$AH=o}}_$AC(e){let t=Es.get(e.strings);return t===void 0&&Es.set(e.strings,t=new cn(e)),t}k(e){Ai(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,i=0;for(let o of e)i===t.length?t.push(r=new n(this.O(an()),this.O(an()),this,this.options)):r=t[i],r._$AI(o),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=xs(e).nextSibling;xs(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},At=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,o){this.type=1,this._$AH=f,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this.Line truncated
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ms=/'/g,As=/"/g,Ts=/^(?:script|style|textarea|title)$/i,Ei=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),p=Ei(1),ne=Ei(2),kg=Ei(3),mt=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Es=new WeakMap,dt=ht.createTreeWalker(ht,129);function Fs(n,e){if(!Ai(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ks!==void 0?ks.createHTML(e):e}var Rd=(n,e)=>{let t=n.length-1,r=[],i,o=e===2?"<svg>":e===3?"<math>":"",s=sn;for(let a=0;a<t;a++){let l=n[a],c,u,h=-1,m=0;for(;m<l.length&&(s.lastIndex=m,u=s.exec(l),u!==null);)m=s.lastIndex,s===sn?u[1]==="!--"?s=Ss:u[1]!==void 0?s=$s:u[2]!==void 0?(Ts.test(u[2])&&(i=RegExp("</"+u[2],"g")),s=ut):u[3]!==void 0&&(s=ut):s===ut?u[0]===">"?(s=i??sn,h=-1):u[1]===void 0?h=-2:(h=s.lastIndex-u[2].length,c=u[1],s=u[3]===void 0?ut:u[3]==='"'?As:Ms):s===As||s===Ms?s=ut:s===Ss||s===$s?s=sn:(s=ut,i=void 0);let d=s===ut&&n[a+1].startsWith("/>")?" ":"";o+=s===sn?l+Ad:h>=0?(r.push(c),l.slice(0,h)+Rs+l.slice(h)+tt+d):l+tt+(h===-2?a:d)}return[Fs(n,o+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},cn=class n{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let o=0,s=0,a=e.length-1,l=this.parts,[c,u]=Rd(e,t);if(this.el=n.createElement(c,r),dt.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=dt.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith(Rs)){let m=u[s++],d=i.getAttribute(h).split(tt),g=/([.?@])?(.*)/.exec(m);l.push({type:1,index:o,name:g[2],strings:d,ctor:g[1]==="."?xi:g[1]==="?"?ki:g[1]==="@"?Si:At}),i.removeAttribute(h)}else h.startsWith(tt)&&(l.push({type:6,index:o}),i.removeAttribute(h));if(Ts.test(i.tagName)){let h=i.textContent.split(tt),m=h.length-1;if(m>0){i.textContent=Yn?Yn.emptyScript:"";for(let d=0;d<m;d++)i.append(h[d],an()),dt.nextNode(),l.push({type:2,index:++o});i.append(h[m],an())}}}else if(i.nodeType===8)if(i.data===zs)l.push({type:2,index:o});else{let h=-1;for(;(h=i.data.indexOf(tt,h+1))!==-1;)l.push({type:7,index:o}),h+=tt.length-1}o++}}static createElement(e,t){let r=ht.createElement("template");return r.innerHTML=e,r}};function Mt(n,e,t=n,r){if(e===mt)return e;let i=r!==void 0?t._$Co?.[r]:t._$Cl,o=ln(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,t,r)),r!==void 0?(t._$Co??=[])[r]=i:t._$Cl=i),i!==void 0&&(e=Mt(n,i._$AS(n,e.values),i,r)),e}var wi=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,i=(e?.creationScope??ht).importNode(t,!0);dt.currentNode=i;let o=dt.nextNode(),s=0,a=0,l=r[0];for(;l!==void 0;){if(s===l.index){let c;l.type===2?c=new un(o,o.nextSibling,this,e):l.type===1?c=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(c=new $i(o,this,e)),this._$AV.push(c),l=r[++a]}s!==l?.index&&(o=dt.nextNode(),s++)}return dt.currentNode=ht,i}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},un=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Mt(this,e,t),ln(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==mt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ed(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==f&&ln(this._$AH)?this._$AA.nextSibling.data=e:this.T(ht.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=cn.createElement(Fs(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(t);else{let o=new wi(i,this),s=o.u(this.options);o.p(t),this.T(s),this._$AH=o}}_$AC(e){let t=Es.get(e.strings);return t===void 0&&Es.set(e.strings,t=new cn(e)),t}k(e){Ai(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,i=0;for(let o of e)i===t.length?t.push(r=new n(this.O(an()),this.O(an()),this,this.options)):r=t[i],r._$AI(o),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=xs(e).nextSibling;xs(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},At=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,o){this.type=1,this._$AH=f,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this.Line truncated
Ein Plugin l\xE4uft mit denselben Rechten wie NextFloor in deinem Browser. Die Datei wurde gepr\xFCft, ihr Inhalt ist festgelegt:
{url}`,manual:"Anleitung",manual_more:"Mehr erfahren",feature_text_energy:"Energieteilchen fliegen in B\xF6gen von den Solarfeldern zum Wechselrichter, zwischen Haus, Akku, Netz und Verbrauchern \u2013 schneller und dichter, je mehr Strom flie\xDFt. Die Module funkeln mit ihrer Produktion, eine Glaskarte \xFCber dem Dach zeigt die Bilanz und wie autark das Haus gerade ist.",live_autarky:"autark",live_fold:"Karte verkleinern",live_unfold:"Karte aufklappen",live_day_hint:"Die letzten 24 Stunden: Solar (Fl\xE4che) und Verbrauch (Linie)",live_week_hint:"Die letzten 7 Tage: Sonne {solar} kWh, Verbrauch {use} kWh (gelb: Sonne, hell: Verbrauch)",live_days:"Tage",live_car_away:"Unterwegs",live_car_charging:"L\xE4dt",live_car_plugged:"Eingesteckt",live_car_lock:"Verriegeln",live_car_unlock:"Entriegeln",live_car_unlock_confirm:"{name} wirklich entriegeln?",live_car_climate:"Klimatisierung",live_car_charge:"Laden starten/stoppen",live_media_prev:"Zur\xFCck",live_media_playpause:"Abspielen/Pause",live_media_next:"Weiter",live_media_volume:"Lautst\xE4rke",live_car_device:"Auto (eine Entit\xE4t des Autos)",live_car_device_hint:"Ladestand, Reichweite, Laden, Stecker, Schloss und Klima findet NextFloor selbst am Ger\xE4t des Autos. Ohne Angabe nimmt es den Anwesenheitssensor des Stellplatzes.",live_car_departure_entity:"Abfahrtszeit (optional)",live_car_departure:"Abfahrt {time}",live_car_open:"Offen: {parts}",printer_printing:"druckt",printer_done:"fertig",printer_paused:"pausiert",printer_error:"Fehler",printer_idle:"bereit",printer_done_at:"fertig um {time}",printer_layer:"Schicht",printer_nozzle:"D\xFCse",printer_bed:"Bett",heatpump_heating:"heizt",heatpump_water:"macht Warmwasser",heatpump_cooling:"k\xFChlt",heatpump_defrost:"taut ab",heatpump_idle:"in Ruhe",heatpump_flow_return:"Vor- \u2192 R\xFCcklauf",heatpump_heat:"W\xE4rme",heatpump_power:"Strom",heatpump_outside:"au\xDFen",pack_missing_item:"M\xF6bel aus entferntem Pack",back_to_room:"Zur\xFCck zu {room}",back_to_floor:"Zur\xFCck zur Etage",hint_furniture:"Raum antippen, dann rechts ein M\xF6belst\xFCck w\xE4hlen \xB7 M\xF6bel ziehen, an den Ecken die Gr\xF6\xDFe \xE4ndern",furniture_into:"Neue M\xF6bel kommen in die Mitte von \u201E{room}\u201C.",furniture_pick_room:"Tipp: Erst einen Raum antippen \u2013 dann landen neue M\xF6bel in seiner Mitte.",flows:"Stromfluss",flows_hint:"Energieb\xF6gen zwischen Solarfeldern, Wechselrichter, Akku, Netz und Verbrauchern ein- oder ausblenden",chk_title:"Einrichtung",chk_hint:"Was der Energiefluss braucht. Antippen springt an die Stelle.",chk_solar:"Solarfeld angelegt",chk_solar_add:"Ein Solarfeld aufs Dach legen",chk_meter:"Stromz\xE4hler mit Netzsensor",chk_meter_sensor:"Stromz\xE4hler: Netzsensor (W) fehlt",chk_meter_add:"Stromz\xE4hler anlegen",chk_inverter:"Wechselrichter mit Leistungssensor",chk_inverter_sensor:"Wechselrichter: Leistungssensor fehlt",chk_inverter_add:"Wechselrichter anlegen",chk_battery:"Stromspeicher mit Leistung und Ladestand",chk_battery_sensor:"Stromspeicher: Leistung oder Ladestand fehlt",chk_battery_opt:"Stromspeicher (optional)",chk_grid:"Netzanschluss gesetzt",chk_grid_opt:"Netzanschluss (optional, sonst automatisch)",energy_sign_grid:"Das Haus zeigt Einspeisung, obwohl die Sonne nichts liefert. Der Netzsensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_battery:"Der Speicher l\xE4dt ohne Sonne und ohne Netzbezug. Sein Sensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_flip:"Vorzeichen umkehren",help_title:"Hilfe und R\xFCckmeldung",help_hint:"Fehler bitte als Issue auf GitHub, W\xFCnsche als Diskussion \u2013 so geht nichts verloren, und alle sehen den Stand.",help_issue:"Problem melden",help_idea:"Idee vorschlagen",furn_name:"Name (optional)",furn_mirror:"Spiegeln",furn_mirror_hint:"Links und rechts vertauschen \u2013 das L-Sofa andersherum, der Schrank mit der T\xFCr auf der anderen Seite, die K\xFCchenzeile gespiegelt.",hint_opening:"Auf eine Wand tippen, um eine T\xFCr oder ein Fenster einzusetzen \u2013 die Art w\xE4hlst du danach rechts",preset_door:"T\xFCr",preset_door_double:"Doppelt\xFCr",preset_window:"Fenster",preset_window_double:"Fenster 2-fl\xFCgelig",preset_terrace:"Terrassent\xFCr",preset_terrace_double:"Terrassent\xFCr 2-fl\xFCgelig",preset_lift_slide:"Hebe-Schiebet\xFCr",preset_garage:"Garagentor",preset_front:"Haust\xFCr",opening_style:"Stil",sidelight_auto:"automatisch",sidelight_hinge:"Seitenteil an der Anschlagseite",sidelight_hinge_hint:"Das Seitenteil sitzt sonst gegen\xFCber dem Anschlag; mit Haken neben den B\xE4ndern.",sidelight_width:"Breite Seitenteil (m)",sidelight_width_left:"Seitenteil links (m)",sidelight_width_right:"Seitenteil rechts (m)",style_auto:"Automatisch ({style})",style_interior:"Zimmert\xFCr",style_front:"Haust\xFCr",style_front_glass:"Haust\xFCr mit Glasausschnitt",style_sidelight:"Haust\xFCr mit Seitenteil",style_sidelights:"Haust\xFCr mit 2 Seitenteilen",style_glass:"Glast\xFCr",style_sliding:"Schiebet\xFCr",style_p Line truncated
{url}`,manual:"Anleitung",manual_more:"Mehr erfahren",feature_text_energy:"Energieteilchen fliegen in B\xF6gen von den Solarfeldern zum Wechselrichter, zwischen Haus, Akku, Netz und Verbrauchern \u2013 schneller und dichter, je mehr Strom flie\xDFt. Die Module funkeln mit ihrer Produktion, eine Glaskarte \xFCber dem Dach zeigt die Bilanz und wie autark das Haus gerade ist.",live_autarky:"autark",live_fold:"Karte verkleinern",live_unfold:"Karte aufklappen",live_day_hint:"Die letzten 24 Stunden: Solar (Fl\xE4che) und Verbrauch (Linie)",live_week_hint:"Die letzten 7 Tage: Sonne {solar} kWh, Verbrauch {use} kWh (gelb: Sonne, hell: Verbrauch)",live_days:"Tage",live_car_away:"Unterwegs",live_car_charging:"L\xE4dt",live_car_plugged:"Eingesteckt",live_car_lock:"Verriegeln",live_car_unlock:"Entriegeln",live_car_unlock_confirm:"{name} wirklich entriegeln?",live_car_climate:"Klimatisierung",live_car_charge:"Laden starten/stoppen",live_media_prev:"Zur\xFCck",live_media_playpause:"Abspielen/Pause",live_media_next:"Weiter",live_media_volume:"Lautst\xE4rke",live_car_device:"Auto (eine Entit\xE4t des Autos)",live_car_device_hint:"Ladestand, Reichweite, Laden, Stecker, Schloss und Klima findet NextFloor selbst am Ger\xE4t des Autos. Ohne Angabe nimmt es den Anwesenheitssensor des Stellplatzes.",live_car_departure_entity:"Abfahrtszeit (optional)",live_car_departure:"Abfahrt {time}",live_car_open:"Offen: {parts}",printer_printing:"druckt",printer_done:"fertig",printer_paused:"pausiert",printer_error:"Fehler",printer_idle:"bereit",printer_done_at:"fertig um {time}",printer_layer:"Schicht",printer_nozzle:"D\xFCse",printer_bed:"Bett",heatpump_heating:"heizt",heatpump_water:"macht Warmwasser",heatpump_cooling:"k\xFChlt",heatpump_defrost:"taut ab",heatpump_idle:"in Ruhe",heatpump_flow_return:"Vor- \u2192 R\xFCcklauf",heatpump_heat:"W\xE4rme",heatpump_power:"Strom",heatpump_outside:"au\xDFen",pack_missing_item:"M\xF6bel aus entferntem Pack",back_to_room:"Zur\xFCck zu {room}",back_to_floor:"Zur\xFCck zur Etage",hint_furniture:"Raum antippen, dann rechts ein M\xF6belst\xFCck w\xE4hlen \xB7 M\xF6bel ziehen, an den Ecken die Gr\xF6\xDFe \xE4ndern",furniture_into:"Neue M\xF6bel kommen in die Mitte von \u201E{room}\u201C.",furniture_pick_room:"Tipp: Erst einen Raum antippen \u2013 dann landen neue M\xF6bel in seiner Mitte.",flows:"Stromfluss",flows_hint:"Energieb\xF6gen zwischen Solarfeldern, Wechselrichter, Akku, Netz und Verbrauchern ein- oder ausblenden",chk_title:"Einrichtung",chk_hint:"Was der Energiefluss braucht. Antippen springt an die Stelle.",chk_solar:"Solarfeld angelegt",chk_solar_add:"Ein Solarfeld aufs Dach legen",chk_meter:"Stromz\xE4hler mit Netzsensor",chk_meter_sensor:"Stromz\xE4hler: Netzsensor (W) fehlt",chk_meter_add:"Stromz\xE4hler anlegen",chk_inverter:"Wechselrichter mit Leistungssensor",chk_inverter_sensor:"Wechselrichter: Leistungssensor fehlt",chk_inverter_add:"Wechselrichter anlegen",chk_battery:"Stromspeicher mit Leistung und Ladestand",chk_battery_sensor:"Stromspeicher: Leistung oder Ladestand fehlt",chk_battery_opt:"Stromspeicher (optional)",chk_grid:"Netzanschluss gesetzt",chk_grid_opt:"Netzanschluss (optional, sonst automatisch)",energy_sign_grid:"Das Haus zeigt Einspeisung, obwohl die Sonne nichts liefert. Der Netzsensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_battery:"Der Speicher l\xE4dt ohne Sonne und ohne Netzbezug. Sein Sensor hat wahrscheinlich das umgekehrte Vorzeichen.",energy_sign_flip:"Vorzeichen umkehren",help_title:"Hilfe und R\xFCckmeldung",help_hint:"Fehler bitte als Issue auf GitHub, W\xFCnsche als Diskussion \u2013 so geht nichts verloren, und alle sehen den Stand.",help_issue:"Problem melden",help_idea:"Idee vorschlagen",furn_name:"Name (optional)",furn_mirror:"Spiegeln",furn_mirror_hint:"Links und rechts vertauschen \u2013 das L-Sofa andersherum, der Schrank mit der T\xFCr auf der anderen Seite, die K\xFCchenzeile gespiegelt.",hint_opening:"Auf eine Wand tippen, um eine T\xFCr oder ein Fenster einzusetzen \u2013 die Art w\xE4hlst du danach rechts",preset_door:"T\xFCr",preset_door_double:"Doppelt\xFCr",preset_window:"Fenster",preset_window_double:"Fenster 2-fl\xFCgelig",preset_terrace:"Terrassent\xFCr",preset_terrace_double:"Terrassent\xFCr 2-fl\xFCgelig",preset_lift_slide:"Hebe-Schiebet\xFCr",preset_garage:"Garagentor",preset_front:"Haust\xFCr",opening_style:"Stil",sidelight_auto:"automatisch",sidelight_hinge:"Seitenteil an der Anschlagseite",sidelight_hinge_hint:"Das Seitenteil sitzt sonst gegen\xFCber dem Anschlag; mit Haken neben den B\xE4ndern.",sidelight_width:"Breite Seitenteil (m)",sidelight_width_left:"Seitenteil links (m)",sidelight_width_right:"Seitenteil rechts (m)",style_auto:"Automatisch ({style})",style_interior:"Zimmert\xFCr",style_front:"Haust\xFCr",style_front_glass:"Haust\xFCr mit Glasausschnitt",style_sidelight:"Haust\xFCr mit Seitenteil",style_sidelights:"Haust\xFCr mit 2 Seitenteilen",style_glass:"Glast\xFCr",style_sliding:"Schiebet\xFCr",style_p Line truncated
A plugin runs with the same rights as NextFloor in your browser. The file has been reviewed and its content is fixed:
{url}`,manual:"Manual",manual_more:"Learn more",feature_text_energy:"Energy particles fly in arcs from the solar fields to the inverter, between house, battery, grid and consumers \u2013 faster and denser the more power flows. The modules sparkle with their production, a glass card over the roof shows the balance and how self-sufficient the house is right now.",live_autarky:"self-sufficient",live_fold:"Make the card small",live_unfold:"Open the card",live_day_hint:"The last 24 hours: solar (area) and consumption (line)",live_week_hint:"The last 7 days: sun {solar} kWh, use {use} kWh (yellow: sun, light: use)",live_days:"days",live_car_away:"On the road",live_car_charging:"Charging",live_car_plugged:"Plugged in",live_car_lock:"Lock",live_car_unlock:"Unlock",live_car_unlock_confirm:"Really unlock {name}?",live_car_climate:"Climate",live_car_charge:"Start/stop charging",live_media_prev:"Previous",live_media_playpause:"Play/pause",live_media_next:"Next",live_media_volume:"Volume",live_car_device:"Car (any entity of the car)",live_car_device_hint:"Charge, range, charging, plug, lock and climate are found by NextFloor on the car's device. Without one it takes the spot's presence sensor.",live_car_departure_entity:"Departure time (optional)",live_car_departure:"Departs {time}",live_car_open:"Open: {parts}",printer_printing:"printing",printer_done:"done",printer_paused:"paused",printer_error:"error",printer_idle:"idle",printer_done_at:"done at {time}",printer_layer:"Layer",printer_nozzle:"Nozzle",printer_bed:"Bed",heatpump_heating:"heating",heatpump_water:"making hot water",heatpump_cooling:"cooling",heatpump_defrost:"defrosting",heatpump_idle:"resting",heatpump_flow_return:"Flow \u2192 return",heatpump_heat:"Heat",heatpump_power:"Power",heatpump_outside:"outside",pack_missing_item:"Furniture of a removed pack",back_to_room:"Back to {room}",back_to_floor:"Back to the floor",hint_furniture:"Tap a room, then pick an item on the right \xB7 drag items, resize them by their corners",furniture_into:"New items go into the middle of \u201C{room}\u201D.",furniture_pick_room:"Tip: tap a room first \u2013 new items then land in its middle.",flows:"Power flow",flows_hint:"Show or hide the energy arcs between solar fields, inverter, battery, grid and consumers",chk_title:"Setup",chk_hint:"What the energy flow needs. Tap a row to jump there.",chk_solar:"Solar field in place",chk_solar_add:"Put a solar field on the roof",chk_meter:"Meter with grid sensor",chk_meter_sensor:"Meter: grid sensor (W) missing",chk_meter_add:"Add the meter",chk_inverter:"Inverter with power sensor",chk_inverter_sensor:"Inverter: power sensor missing",chk_inverter_add:"Add an inverter",chk_battery:"Home battery with power and charge",chk_battery_sensor:"Home battery: power or charge missing",chk_battery_opt:"Home battery (optional)",chk_grid:"Grid connection set",chk_grid_opt:"Grid connection (optional, else automatic)",energy_sign_grid:"The house shows export while the sun produces nothing. The grid sensor probably has its sign reversed.",energy_sign_battery:"The battery charges with no sun and no grid draw. Its sensor probably has its sign reversed.",energy_sign_flip:"Flip the sign",help_title:"Help and feedback",help_hint:"Please report problems as a GitHub issue and wishes as a discussion \u2013 nothing gets lost, and everyone sees the state.",help_issue:"Report a problem",help_idea:"Propose an idea",furn_name:"Name (optional)",furn_mirror:"Mirror",furn_mirror_hint:"Swap left and right \u2013 the L-sofa the other way round, the cabinet with its door on the other side, the kitchen run mirrored.",hint_opening:"Tap a wall to add a door or window \u2013 choose its kind on the right afterwards",preset_door:"Door",preset_door_double:"Double door",preset_window:"Window",preset_window_double:"Double window",preset_terrace:"Terrace door",preset_terrace_double:"French doors",preset_lift_slide:"Lift-and-slide door",preset_garage:"Garage door",preset_front:"Front door",opening_style:"Style",sidelight_auto:"automatic",sidelight_hinge:"Sidelight on the hinge side",sidelight_hinge_hint:"The sidelight sits opposite the hinge otherwise; ticked, it sits next to the hinges.",sidelight_width:"Sidelight width (m)",sidelight_width_left:"Left sidelight (m)",sidelight_width_right:"Right sidelight (m)",style_auto:"Automatic ({style})",style_interior:"Room door",style_front:"Front door",style_front_glass:"Front door with glass",style_sidelight:"Front door with sidelight",style_sidelights:"Front door with two sidelights",style_glass:"Glass door",style_sliding:"Sliding door",style_passage:"Opening (no door)",style_standard:"Standard",style_bars:"With glazing bars",style_glass_wall:"Glass wall (fixed)",preset_glass_wall:"Glass wall",glass_panes:"Panes",glass_panes_auto:"automatic (about 0.9 m)",glass_panes_hint:"0 = one single pane without mullions, empty = about every 0.9 m",flip_hinge:"Swap hinge side",flip_main_leaf:"Swap main leaf",flip_hinge_hint:"Hinges to the other side" Line truncated
{url}`,manual:"Manual",manual_more:"Learn more",feature_text_energy:"Energy particles fly in arcs from the solar fields to the inverter, between house, battery, grid and consumers \u2013 faster and denser the more power flows. The modules sparkle with their production, a glass card over the roof shows the balance and how self-sufficient the house is right now.",live_autarky:"self-sufficient",live_fold:"Make the card small",live_unfold:"Open the card",live_day_hint:"The last 24 hours: solar (area) and consumption (line)",live_week_hint:"The last 7 days: sun {solar} kWh, use {use} kWh (yellow: sun, light: use)",live_days:"days",live_car_away:"On the road",live_car_charging:"Charging",live_car_plugged:"Plugged in",live_car_lock:"Lock",live_car_unlock:"Unlock",live_car_unlock_confirm:"Really unlock {name}?",live_car_climate:"Climate",live_car_charge:"Start/stop charging",live_media_prev:"Previous",live_media_playpause:"Play/pause",live_media_next:"Next",live_media_volume:"Volume",live_car_device:"Car (any entity of the car)",live_car_device_hint:"Charge, range, charging, plug, lock and climate are found by NextFloor on the car's device. Without one it takes the spot's presence sensor.",live_car_departure_entity:"Departure time (optional)",live_car_departure:"Departs {time}",live_car_open:"Open: {parts}",printer_printing:"printing",printer_done:"done",printer_paused:"paused",printer_error:"error",printer_idle:"idle",printer_done_at:"done at {time}",printer_layer:"Layer",printer_nozzle:"Nozzle",printer_bed:"Bed",heatpump_heating:"heating",heatpump_water:"making hot water",heatpump_cooling:"cooling",heatpump_defrost:"defrosting",heatpump_idle:"resting",heatpump_flow_return:"Flow \u2192 return",heatpump_heat:"Heat",heatpump_power:"Power",heatpump_outside:"outside",pack_missing_item:"Furniture of a removed pack",back_to_room:"Back to {room}",back_to_floor:"Back to the floor",hint_furniture:"Tap a room, then pick an item on the right \xB7 drag items, resize them by their corners",furniture_into:"New items go into the middle of \u201C{room}\u201D.",furniture_pick_room:"Tip: tap a room first \u2013 new items then land in its middle.",flows:"Power flow",flows_hint:"Show or hide the energy arcs between solar fields, inverter, battery, grid and consumers",chk_title:"Setup",chk_hint:"What the energy flow needs. Tap a row to jump there.",chk_solar:"Solar field in place",chk_solar_add:"Put a solar field on the roof",chk_meter:"Meter with grid sensor",chk_meter_sensor:"Meter: grid sensor (W) missing",chk_meter_add:"Add the meter",chk_inverter:"Inverter with power sensor",chk_inverter_sensor:"Inverter: power sensor missing",chk_inverter_add:"Add an inverter",chk_battery:"Home battery with power and charge",chk_battery_sensor:"Home battery: power or charge missing",chk_battery_opt:"Home battery (optional)",chk_grid:"Grid connection set",chk_grid_opt:"Grid connection (optional, else automatic)",energy_sign_grid:"The house shows export while the sun produces nothing. The grid sensor probably has its sign reversed.",energy_sign_battery:"The battery charges with no sun and no grid draw. Its sensor probably has its sign reversed.",energy_sign_flip:"Flip the sign",help_title:"Help and feedback",help_hint:"Please report problems as a GitHub issue and wishes as a discussion \u2013 nothing gets lost, and everyone sees the state.",help_issue:"Report a problem",help_idea:"Propose an idea",furn_name:"Name (optional)",furn_mirror:"Mirror",furn_mirror_hint:"Swap left and right \u2013 the L-sofa the other way round, the cabinet with its door on the other side, the kitchen run mirrored.",hint_opening:"Tap a wall to add a door or window \u2013 choose its kind on the right afterwards",preset_door:"Door",preset_door_double:"Double door",preset_window:"Window",preset_window_double:"Double window",preset_terrace:"Terrace door",preset_terrace_double:"French doors",preset_lift_slide:"Lift-and-slide door",preset_garage:"Garage door",preset_front:"Front door",opening_style:"Style",sidelight_auto:"automatic",sidelight_hinge:"Sidelight on the hinge side",sidelight_hinge_hint:"The sidelight sits opposite the hinge otherwise; ticked, it sits next to the hinges.",sidelight_width:"Sidelight width (m)",sidelight_width_left:"Left sidelight (m)",sidelight_width_right:"Right sidelight (m)",style_auto:"Automatic ({style})",style_interior:"Room door",style_front:"Front door",style_front_glass:"Front door with glass",style_sidelight:"Front door with sidelight",style_sidelights:"Front door with two sidelights",style_glass:"Glass door",style_sliding:"Sliding door",style_passage:"Opening (no door)",style_standard:"Standard",style_bars:"With glazing bars",style_glass_wall:"Glass wall (fixed)",preset_glass_wall:"Glass wall",glass_panes:"Panes",glass_panes_auto:"automatic (about 0.9 m)",glass_panes_hint:"0 = one single pane without mullions, empty = about every 0.9 m",flip_hinge:"Swap hinge side",flip_main_leaf:"Swap main leaf",flip_hinge_hint:"Hinges to the other side" Line truncated
:host {
--nf-text: var(--primary-text-color, #e1e1e1);
--nf-muted: var(--secondary-text-color, #9b9b9b);
@@ -1616,7 +1616,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
.qm-note {
color: var(--nf-muted);
}
`]};function Jf(n){let e=Math.min(1,Math.max(0,(n-2200)/4300)),t=(r,i)=>Math.round(r+(i-r)*e);return`rgb(${t(255,200)},${t(170,225)},${t(80,255)})`}customElements.get("nf-quick-menu")||customElements.define("nf-quick-menu",es);var Qf=new URL(import.meta.url),Xf=new URL("./nextfloor-3d.js?v=d2200bd8fd8b",Qf).href,Cu;function Nu(){return Cu??=import(Xf),Cu}function Lu(n){if(!n||n.state!=="on")return 0;let e=typeof n.attributes.percentage=="number"?n.attributes.percentage:60;return e<=0?0:.2+.6*Math.min(100,e)/100}var Ou="weather.nextfloor_symcon",Bu={condition:"Wetterzustand",temperature:"Au\xDFentemperatur",humidity:"Au\xDFenluftfeuchte",pressure:"Luftdruck",wind_speed:"Windgeschwindigkeit",wind_gust_speed:"Windb\xF6en",wind_bearing:"Windrichtung",cloud_coverage:"Bew\xF6lkung",precipitation:"Niederschlagsrate",precipitation_total:"Niederschlagsmenge",illuminance:"Au\xDFenhelligkeit",uv_index:"UV-Index",visibility:"Sichtweite",snow:"Schnee",fog:"Nebel",lightning:"Gewitter"},Wu=new WeakMap;function eg(n){let e=n.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").trim();return["sunny","clear-night","partlycloudy","cloudy","fog","rainy","pouring","lightning-rainy","lightning","hail","snowy","snowy-rainy","windy","windy-variant"].includes(e)?e:/kein regen|trocken|wolkenlos|klar|sonnig/.test(e)?"sunny":/gewitter|blitz/.test(e)?"lightning-rainy":/schneeregen/.test(e)?"snowy-rainy":/schnee/.test(e)?"snowy":/hagel/.test(e)?"hail":/starkregen/.test(e)?"pouring":/regen|niesel/.test(e)?"rainy":/nebel/.test(e)?"fog":/teil.*wolk|heiter|leicht.*wolk/.test(e)?"partlycloudy":/wolk|bedeckt/.test(e)?"cloudy":/wind|sturm/.test(e)?"windy":null}function ui(n,e){if(!V(n))return n;let t=e.weather_variables??{};if(!e.rain_sensor&&!Object.values(t).some(d=>d&&d!=="none"))return n;let r=Wu.get(n)??new WeakMap;Wu.set(n,r);let i=r.get(e);if(i)return i;let o={friendly_name:"Wetter",nf_symcon_weather:!0},s=d=>t[d]&&t[d]!=="none"?n.states[t[d]]:void 0;for(let d of["temperature","humidity","pressure","cloud_coverage","precipitation","precipitation_total","illuminance","uv_index","visibility"]){let g=s(d),_=ge(g);_!==null&&(o[d]=d==="cloud_coverage"&&g?.attributes.symcon_max===1?_*100:_),g?.attributes.unit_of_measurement&&(o[`${d}_unit`]=g.attributes.unit_of_measurement)}for(let d of["wind_speed","wind_gust_speed"]){let g=s(d),_=ge(g);_!==null&&(o[d]=ti(_,g?.attributes.unit_of_measurement))}o.wind_speed_unit="km/h";let a=fe(s("wind_bearing"));a!==null&&(o.wind_bearing=a);let l=eg(De(s("condition"))),c=e.rain_sensor?n.states[e.rain_sensor]:void 0,u=le(c);u!==null&&e.rain_sensor_inverted&&(u=!u),u===null&&typeof o.precipitation=="number"&&(u=o.precipitation>0),le(s("lightning"))?l=u?"lightning-rainy":"lightning":le(s("snow"))?l=u?"snowy-rainy":"snowy":le(s("fog"))?l="fog":u===!0?l=Number(o.precipitation??0)>=8?"pouring":"rainy":u===!1&&l&&/rain|pouring/.test(l)&&(l=null),!l&&typeof o.cloud_coverage=="number"&&(l=o.cloud_coverage>70?"cloudy":o.cloud_coverage>20?"partlycloudy":"sunny"),!l&&u===!1&&(l="sunny");let h={entity_id:Ou,state:l??"unknown",attributes:o},m={...n,states:{...n.states,[Ou]:h}};return r.set(e,m),m}var rs=class extends Q{static properties={hass:{attribute:!1},floors:{attribute:!1},floorId:{attribute:!1},inline:{type:Boolean,reflect:!0},compact:{type:Boolean},folded:{state:!0}};constructor(){super(),this.floors=[],this.floorId=null,this.inline=!1,this.compact=!1,this.folded=null}value(e){return e?p`<span class="value" title=${`${Vt(e)}${e.manual?" \xB7 eigener Z\xE4hler":""}`}><b>${Ne(this.hass,e)}</b>${e.period!=="total"?p`<small>${{day:"heute",month:"Monat",year:"Jahr"}[e.period]}</small>`:f}${G(this.hass,e.sources,`${Ie[e.kind]} \xB7 ${Vt(e)}`)}</span>`:f}open(e,t){this.dispatchEvent(new CustomEvent("utility-open",{detail:{floorId:t?this.floorId:e,roomId:t?e:null},bubbles:!0,composed:!0}))}rows(e){return Oe.map(t=>{let r=e.filter(o=>o.kind===t&&o.metric==="power"),i=e.filter(o=>o.kind===t&&o.metric==="energy");return Array.from({length:Math.max(r.length,i.length)},(o,s)=>p`<div class="row"><span class="kind" title=${Ie[t]}>${s?"":`${An[t]} ${Ie[t]}`}</span>${r[s]?this.value(r[s]):p`<span></span>`}${i[s]?this.value(i[s]):p`<span></span>`}</div>`)})}render(){if(!this.hass)return f;let e=this.floors.flatMap(s=>s.rooms),t=this.floors.find(s=>s.id===this.floorId);if(this.inline){let s=t?Ce(this.hass,t,e):Ol(this.hass,this.floors);return p`${Oe.map(a=>{let l=s.filter(c=>c.kind===a);return l.length?p`<div class="meter" aria-label=${`${t?.name||"Gesamtgeb\xE4ude"} \xB7 ${Ie[a]}`}><span class="medium" title=${t?.name||"Gesamtgeb\xE4ude"}>${An[a]} ${Ie[a]}</span><div class="values">${l.map(c=>this.value(c))}</div></div>`:f})}`}let i=(t?Bt(this.hass,t,e,!0).map(s=>({...s,hasDetails:s.rooms.length>0})):[...this.floors].sort((s,a)=>a.elevation-s.elevation).map(s=>({id:s.id,name:s.name,path:"",readings:Ce(this.hass,s,e),rooms:[],hasDetails:Bt(this.hass,s,e,!0).length>0}))).filter(s=>s.readings.length||s.hasDetails);if(!i.lLine truncated
`]};function Jf(n){let e=Math.min(1,Math.max(0,(n-2200)/4300)),t=(r,i)=>Math.round(r+(i-r)*e);return`rgb(${t(255,200)},${t(170,225)},${t(80,255)})`}customElements.get("nf-quick-menu")||customElements.define("nf-quick-menu",es);var Qf=new URL(import.meta.url),Xf=new URL("./nextfloor-3d.js?v=0f70d07bff6e",Qf).href,Cu;function Nu(){return Cu??=import(Xf),Cu}function Lu(n){if(!n||n.state!=="on")return 0;let e=typeof n.attributes.percentage=="number"?n.attributes.percentage:60;return e<=0?0:.2+.6*Math.min(100,e)/100}var Ou="weather.nextfloor_symcon",Bu={condition:"Wetterzustand",temperature:"Au\xDFentemperatur",humidity:"Au\xDFenluftfeuchte",pressure:"Luftdruck",wind_speed:"Windgeschwindigkeit",wind_gust_speed:"Windb\xF6en",wind_bearing:"Windrichtung",cloud_coverage:"Bew\xF6lkung",precipitation:"Niederschlagsrate",precipitation_total:"Niederschlagsmenge",illuminance:"Au\xDFenhelligkeit",uv_index:"UV-Index",visibility:"Sichtweite",snow:"Schnee",fog:"Nebel",lightning:"Gewitter"},Wu=new WeakMap;function eg(n){let e=n.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").trim();return["sunny","clear-night","partlycloudy","cloudy","fog","rainy","pouring","lightning-rainy","lightning","hail","snowy","snowy-rainy","windy","windy-variant"].includes(e)?e:/kein regen|trocken|wolkenlos|klar|sonnig/.test(e)?"sunny":/gewitter|blitz/.test(e)?"lightning-rainy":/schneeregen/.test(e)?"snowy-rainy":/schnee/.test(e)?"snowy":/hagel/.test(e)?"hail":/starkregen/.test(e)?"pouring":/regen|niesel/.test(e)?"rainy":/nebel/.test(e)?"fog":/teil.*wolk|heiter|leicht.*wolk/.test(e)?"partlycloudy":/wolk|bedeckt/.test(e)?"cloudy":/wind|sturm/.test(e)?"windy":null}function ui(n,e){if(!V(n))return n;let t=e.weather_variables??{};if(!e.rain_sensor&&!Object.values(t).some(d=>d&&d!=="none"))return n;let r=Wu.get(n)??new WeakMap;Wu.set(n,r);let i=r.get(e);if(i)return i;let o={friendly_name:"Wetter",nf_symcon_weather:!0},s=d=>t[d]&&t[d]!=="none"?n.states[t[d]]:void 0;for(let d of["temperature","humidity","pressure","cloud_coverage","precipitation","precipitation_total","illuminance","uv_index","visibility"]){let g=s(d),_=ge(g);_!==null&&(o[d]=d==="cloud_coverage"&&g?.attributes.symcon_max===1?_*100:_),g?.attributes.unit_of_measurement&&(o[`${d}_unit`]=g.attributes.unit_of_measurement)}for(let d of["wind_speed","wind_gust_speed"]){let g=s(d),_=ge(g);_!==null&&(o[d]=ti(_,g?.attributes.unit_of_measurement))}o.wind_speed_unit="km/h";let a=fe(s("wind_bearing"));a!==null&&(o.wind_bearing=a);let l=eg(De(s("condition"))),c=e.rain_sensor?n.states[e.rain_sensor]:void 0,u=le(c);u!==null&&e.rain_sensor_inverted&&(u=!u),u===null&&typeof o.precipitation=="number"&&(u=o.precipitation>0),le(s("lightning"))?l=u?"lightning-rainy":"lightning":le(s("snow"))?l=u?"snowy-rainy":"snowy":le(s("fog"))?l="fog":u===!0?l=Number(o.precipitation??0)>=8?"pouring":"rainy":u===!1&&l&&/rain|pouring/.test(l)&&(l=null),!l&&typeof o.cloud_coverage=="number"&&(l=o.cloud_coverage>70?"cloudy":o.cloud_coverage>20?"partlycloudy":"sunny"),!l&&u===!1&&(l="sunny");let h={entity_id:Ou,state:l??"unknown",attributes:o},m={...n,states:{...n.states,[Ou]:h}};return r.set(e,m),m}var rs=class extends Q{static properties={hass:{attribute:!1},floors:{attribute:!1},floorId:{attribute:!1},inline:{type:Boolean,reflect:!0},compact:{type:Boolean},folded:{state:!0}};constructor(){super(),this.floors=[],this.floorId=null,this.inline=!1,this.compact=!1,this.folded=null}value(e){return e?p`<span class="value" title=${`${Vt(e)}${e.manual?" \xB7 eigener Z\xE4hler":""}`}><b>${Ne(this.hass,e)}</b>${e.period!=="total"?p`<small>${{day:"heute",month:"Monat",year:"Jahr"}[e.period]}</small>`:f}${G(this.hass,e.sources,`${Ie[e.kind]} \xB7 ${Vt(e)}`)}</span>`:f}open(e,t){this.dispatchEvent(new CustomEvent("utility-open",{detail:{floorId:t?this.floorId:e,roomId:t?e:null},bubbles:!0,composed:!0}))}rows(e){return Oe.map(t=>{let r=e.filter(o=>o.kind===t&&o.metric==="power"),i=e.filter(o=>o.kind===t&&o.metric==="energy");return Array.from({length:Math.max(r.length,i.length)},(o,s)=>p`<div class="row"><span class="kind" title=${Ie[t]}>${s?"":`${An[t]} ${Ie[t]}`}</span>${r[s]?this.value(r[s]):p`<span></span>`}${i[s]?this.value(i[s]):p`<span></span>`}</div>`)})}render(){if(!this.hass)return f;let e=this.floors.flatMap(s=>s.rooms),t=this.floors.find(s=>s.id===this.floorId);if(this.inline){let s=t?Ce(this.hass,t,e):Ol(this.hass,this.floors);return p`${Oe.map(a=>{let l=s.filter(c=>c.kind===a);return l.length?p`<div class="meter" aria-label=${`${t?.name||"Gesamtgeb\xE4ude"} \xB7 ${Ie[a]}`}><span class="medium" title=${t?.name||"Gesamtgeb\xE4ude"}>${An[a]} ${Ie[a]}</span><div class="values">${l.map(c=>this.value(c))}</div></div>`:f})}`}let i=(t?Bt(this.hass,t,e,!0).map(s=>({...s,hasDetails:s.rooms.length>0})):[...this.floors].sort((s,a)=>a.elevation-s.elevation).map(s=>({id:s.id,name:s.name,path:"",readings:Ce(this.hass,s,e),rooms:[],hasDetails:Bt(this.hass,s,e,!0).length>0}))).filter(s=>s.readings.length||s.hasDetails);if(!i.lLine truncated
<button class="heading" aria-expanded=${!o} @click=${()=>{this.folded=!o}}><span>${t?"Bereiche":"Stockwerke"}<small>${t?.name||"Gesamtgeb\xE4ude"}</small></span><span aria-hidden="true">${o?"+":"\u2212"}</span></button>
${o?f:p`<div class="entries"><div class="columns"><span></span><span title="Leistung bzw. Durchfluss">Leistung</span><span>Energie / Verbrauch</span></div>
${i.map(s=>p`<section class="entry" data-area=${t?s.id:f}>
@@ -3449,7 +3449,7 @@ ${t.sources.map(r=>this.hass.states[r]?.attributes.symcon_path||this.hass.states
inset: auto 16px 16px;
color: var(--nf-danger);
}
`]};customElements.get("nf-view3d")||customElements.define("nf-view3d",ss);function he(n,e){return Math.abs(e)>=1e3?`${L(n,e/1e3,1)} kW`:`${Math.round(e)} W`}function os(n){return n.type==="tv_board"?n.h+.9:n.type==="tv_wall"||n.type==="kitchen_wall"?n.h+.25:n.h+.35}function og(n,e){let t=e.attributes.percentage;return e.state==="on"&&typeof t=="number"?`${Math.round(t)} %`:se(n,e)}var Zu;function Yu(){let n=new URL("./nextfloor-editor.js?v=b932c2605f2b",new URL(import.meta.url)).href;return Zu??=import(n),Zu}var sg=.25,Ju=n=>Math.round(n*1e3)/1e3,Qu=(n,e,t)=>n.rooms.find(r=>r.points.length>=3&&H([e,t],r.points));function ls(n,e,t,r,i){let o=Qu(n,e,t);if(!o)return[r,i];let s=(a,l)=>H([a,l],o.points);return s(r,i)?[r,i]:s(r,t)?[r,t]:s(e,i)?[e,i]:[e,t]}function ag(n,e,t,r){return n.rooms.some(i=>i.id!==e.id&&i.points.some((o,s)=>{let a=i.points[(s+1)%i.points.length];return Math.abs(ue(ee(o,t),r))<.02&&Math.abs(ue(ee(a,t),r))<.02}))}var as=(n,e)=>Math.abs((n-e+540)%360-180);function Xu(n,e,t,r=sg){let i=Qu(n,e.x,e.z);if(!i)return null;let o=i.points,s=gt(o)>=0?1:-1,a=null;return o.forEach((l,c)=>{let u=o[(c+1)%o.length],h=qe(ee(u,l));if(h<.3)return;let m=[(u[0]-l[0])/h,(u[1]-l[1])/h],d=[-m[1]*s,m[0]*s],g=ue(ee([e.x,e.z],l),m);if(g<0||g>h)return;let _=ag(n,i,l,d)?t/2:0,b=ue(ee([e.x,e.z],l),d)-_,y=Math.atan2(-d[0],d[1])*180/Math.PI,k=[{rotation:y,extent:e.d/2},{rotation:y+90,extent:e.w/2},{rotation:y-90,extent:e.w/2}].reduce((z,R)=>as(e.rotation,R.rotation)<as(e.rotation,z.rotation)?R:z);if(as(e.rotation,k.rotation)>50)return;let M=b-k.extent;Math.abs(M)>r||a&&Math.abs(M)>=Math.abs(a.gap)||(a={x:Ju(e.x-d[0]*M),z:Ju(e.z-d[1]*M),rotation:(Math.round(k.rotation)%360+360)%360,gap:M})}),a&&{x:a.x,z:a.z,rotation:a.rotation}}function di(n,e,t){let r=structuredClone(n);for(let i of r.floors){let o=i.furniture.find(s=>s.id===e);o&&t(o,i)}return r}function hi(n,e,t){let r=structuredClone(n);for(let i of r.floors){let o=i.placements.find(s=>s.entity_id===e);o&&t(o,i)}return r}function ed(n,e){let t=structuredClone(n);for(let r of t.floors)r.furniture=r.furniture.filter(i=>i.id!==e);return t}function td(n,e){let t=structuredClone(n);for(let r of t.floors)r.placements=r.placements.filter(i=>i.entity_id!==e);return t}function nd(n,e,t,r){return hi(n,e,(i,o)=>{[i.x,i.z]=ls(o,i.x,i.z,t,r)})}function rd(n,e,t,r){let i=n.settings.wall_interior??.12;return di(n,e,(o,s)=>{[o.x,o.z]=ls(s,o.x,o.z,t,r);let a=Xu(s,o,i);a&&Object.assign(o,a)})}var cs=(n,e)=>((n+e)%360+360)%360,id=n=>Number.parseFloat(n.replace(",",".")),Gn=(n,e)=>Math.round(n*10**e)/10**e;function us(n){let{min:e,max:t,accepts:r=()=>!0}=n,i=o=>{let s=id(o.target.value);!Number.isFinite(s)||!r(s)||n.apply(t===void 0?s:Math.min(t,Math.max(e,s)))};return p`<label class="nf-size" title=${n.title}
`]};customElements.get("nf-view3d")||customElements.define("nf-view3d",ss);function he(n,e){return Math.abs(e)>=1e3?`${L(n,e/1e3,1)} kW`:`${Math.round(e)} W`}function os(n){return n.type==="tv_board"?n.h+.9:n.type==="tv_wall"||n.type==="kitchen_wall"?n.h+.25:n.h+.35}function og(n,e){let t=e.attributes.percentage;return e.state==="on"&&typeof t=="number"?`${Math.round(t)} %`:se(n,e)}var Zu;function Yu(){let n=new URL("./nextfloor-editor.js?v=68203eb051b7",new URL(import.meta.url)).href;return Zu??=import(n),Zu}var sg=.25,Ju=n=>Math.round(n*1e3)/1e3,Qu=(n,e,t)=>n.rooms.find(r=>r.points.length>=3&&H([e,t],r.points));function ls(n,e,t,r,i){let o=Qu(n,e,t);if(!o)return[r,i];let s=(a,l)=>H([a,l],o.points);return s(r,i)?[r,i]:s(r,t)?[r,t]:s(e,i)?[e,i]:[e,t]}function ag(n,e,t,r){return n.rooms.some(i=>i.id!==e.id&&i.points.some((o,s)=>{let a=i.points[(s+1)%i.points.length];return Math.abs(ue(ee(o,t),r))<.02&&Math.abs(ue(ee(a,t),r))<.02}))}var as=(n,e)=>Math.abs((n-e+540)%360-180);function Xu(n,e,t,r=sg){let i=Qu(n,e.x,e.z);if(!i)return null;let o=i.points,s=gt(o)>=0?1:-1,a=null;return o.forEach((l,c)=>{let u=o[(c+1)%o.length],h=qe(ee(u,l));if(h<.3)return;let m=[(u[0]-l[0])/h,(u[1]-l[1])/h],d=[-m[1]*s,m[0]*s],g=ue(ee([e.x,e.z],l),m);if(g<0||g>h)return;let _=ag(n,i,l,d)?t/2:0,b=ue(ee([e.x,e.z],l),d)-_,y=Math.atan2(-d[0],d[1])*180/Math.PI,k=[{rotation:y,extent:e.d/2},{rotation:y+90,extent:e.w/2},{rotation:y-90,extent:e.w/2}].reduce((z,R)=>as(e.rotation,R.rotation)<as(e.rotation,z.rotation)?R:z);if(as(e.rotation,k.rotation)>50)return;let M=b-k.extent;Math.abs(M)>r||a&&Math.abs(M)>=Math.abs(a.gap)||(a={x:Ju(e.x-d[0]*M),z:Ju(e.z-d[1]*M),rotation:(Math.round(k.rotation)%360+360)%360,gap:M})}),a&&{x:a.x,z:a.z,rotation:a.rotation}}function di(n,e,t){let r=structuredClone(n);for(let i of r.floors){let o=i.furniture.find(s=>s.id===e);o&&t(o,i)}return r}function hi(n,e,t){let r=structuredClone(n);for(let i of r.floors){let o=i.placements.find(s=>s.entity_id===e);o&&t(o,i)}return r}function ed(n,e){let t=structuredClone(n);for(let r of t.floors)r.furniture=r.furniture.filter(i=>i.id!==e);return t}function td(n,e){let t=structuredClone(n);for(let r of t.floors)r.placements=r.placements.filter(i=>i.entity_id!==e);return t}function nd(n,e,t,r){return hi(n,e,(i,o)=>{[i.x,i.z]=ls(o,i.x,i.z,t,r)})}function rd(n,e,t,r){let i=n.settings.wall_interior??.12;return di(n,e,(o,s)=>{[o.x,o.z]=ls(s,o.x,o.z,t,r);let a=Xu(s,o,i);a&&Object.assign(o,a)})}var cs=(n,e)=>((n+e)%360+360)%360,id=n=>Number.parseFloat(n.replace(",",".")),Gn=(n,e)=>Math.round(n*10**e)/10**e;function us(n){let{min:e,max:t,accepts:r=()=>!0}=n,i=o=>{let s=id(o.target.value);!Number.isFinite(s)||!r(s)||n.apply(t===void 0?s:Math.min(t,Math.max(e,s)))};return p`<label class="nf-size" title=${n.title}
>${n.label}
<input type="number" inputmode="decimal" step=${n.step} min=${e} max=${t??f} .value=${String(Gn(n.value,2))} @change=${i} />
</label>`}var sd=(n,e)=>p`<button class="nf-chip" @click=${e}>${n.t("height_auto")}</button>`,od=(n,e)=>p`<button class="nf-chip" @click=${()=>e(-n)}>↺ ${n}°</button><button class="nf-chip" @click=${()=>e(n)}>↻ ${n}°</button>`;function lg(n,e){let t=n.building.floors.find(s=>s.furniture.some(a=>a.id===e)),r=t?.furniture.find(s=>s.id===e);if(!t||!r)return f;let i=(s,a)=>us({label:n.t(a),title:n.t(`size_${s}`),value:r[s],step:.05,min:.05,accepts:l=>l>0,apply:l=>n.editFurniture(e,c=>c[s]=Gn(l,3))}),o=da(r)?p`${us({label:"\u2195",title:n.t("mount_height"),value:r.mount_y??oe(t,r),step:.05,min:0,accepts:s=>s>=0,apply:s=>n.editFurniture(e,a=>a.mount_y=Gn(s,3))})}
File diff suppressed because it is too large. Load diff
+14 -1
View File
@@ -16,7 +16,7 @@ In **Kerninstanzen → Modules** wird dieses Repository verwendet:
Im Zahnrad des Eintrags den Branch **`symcon`** wählen und auf Aktualisierungen prüfen.
`main` enthält die Quellen für die Entwicklung, `symcon` die installierbare Bibliothek.
Nach der Aktualisierung auf **0.2.28 / Build 31** die Konsole neu laden. Unter
Nach der Aktualisierung auf **0.2.29 / Build 32** die Konsole neu laden. Unter
**Instanz hinzufügen → Hersteller NextFloor** erscheint **„NextFloor Designer und 3D-Kachel“**.
### Für die Entwicklung
@@ -46,6 +46,19 @@ Die Dateien unter `NextFloor/assets/` und `NextFloor/packs/` werden durch
Der Build prüft anschließend die Modulmetadaten und die installierbare Verzeichnisstruktur.
Dieselbe Prüfung lässt sich separat mit `node symcon/tests/validate-package.mjs` ausführen.
## Änderungen in 0.2.29
- **Außenflächen einrasten:** Beim Zeichnen, Verschieben und Bearbeiten der Ecken
rasten Flächen an benachbarten Außenflächen und Hauskanten ein. Ganze Flächen
behalten dabei ihre Form. Mit **Alt** lässt sich das Einrasten unterdrücken.
- **Neue Untergründe:** Straße, Gehweg, Schotterfläche, Fluss und Bach.
Fluss und Bach schneiden sich standardmäßig aus einer umgebenden Fläche aus;
Höhenversatz, Gefälle, Transparenz und die Option für Ausschnitte bleiben einstellbar.
- **3D-Texturen:** Gras, Pflaster/Platten, Asphalt, Schotter, Erde, Wasser, Hecken
und Holz bekommen passende, lokal erzeugte Texturen. Sie folgen dem Metermaß
der Szene statt beim Vergrößern einer Fläche zu verzerren, funktionieren auch
auf geneigten und transparenten Flächen und benötigen keine externen Bilder.
## Änderungen in 0.2.28
- **Frischwasserstation und Kaskade:** Das 3D-Modell zeigt getrennte Primär-
+3 -3
View File
@@ -6,7 +6,7 @@
"compatibility": {
"version": "9.0"
},
"version": "0.2.28",
"build": 31,
"date": 1794441600
"version": "0.2.29",
"build": 32,
"date": 1794787200
}
+9
View File
@@ -399,3 +399,12 @@ def test_outdoor_area_opacity() -> None:
for bad in (0, 0.05, 1.5):
with pytest.raises(vol.Invalid):
OUTDOOR_SCHEMA({**base, "opacity": bad})
@pytest.mark.parametrize("kind", ["street", "sidewalk", "gravel", "river", "stream"])
def test_new_outdoor_surfaces(kind: str) -> None:
from custom_components.nextfloor.schema import OUTDOOR_SCHEMA
data = {"id": "outside", "type": kind, "points": [[0, 0], [4.03, 0], [4, 3]], "slope": 0.2, "opacity": 0.4}
result = OUTDOOR_SCHEMA(data)
assert all(result[key] == value for key, value in data.items())