mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
43 lines
51 KiB
JavaScript
43 lines
51 KiB
JavaScript
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="7d666f118b3321f5eca092f330ca7f1a3985cf7ab65ea69a2247c9064d4d2e7d";import{dI as e,dJ as t,bs as n,dK as o,dL as i,dM as a,ax as r,dN as s,dO as l,dP as c,dQ as f,aW as d,dR as u,U as h,cj as p,ci as m,dS as g,V as w,J as M,dT as y,d8 as b,dU as S,A as x,as as v,dV as $,dW as k,dX as z,dY as P,dZ as C}from"./houseplan-card-CY6xhpFf.js";const I=e=>`${Number(e[0].toFixed(4))} ${Number(e[1].toFixed(4))}`;function T(e){let t=0;for(let n=0;n<e.length;n++){const o=e[n],i=e[(n+1)%e.length];t+=o[0]*i[1]-i[0]*o[1]}return t/2}function j(e,t){const n=function(e){const t=(Array.isArray(e)?e:[]).filter(e=>Array.isArray(e)&&Number.isFinite(e[0])&&Number.isFinite(e[1])).map(e=>[Number(e[0]),Number(e[1])]),n=t[t.length-1];return t.length>1&&t[0][0]===n[0]&&t[0][1]===n[1]&&t.pop(),t}(e);if(n.length<3)return[];const o=!t;return T(n)>0===o?n:[...n].reverse()}function H(e,t,o){return e.length?`M ${e.map(e=>I(n(e,o,t))).join(" L ")} Z`:""}function O(e,t,n){const o=t[1]-e[1],i=-(t[0]-e[0]),a=n.rotDeg*Math.PI/180;return o*Math.sin(a)+i*Math.cos(a)}function N(t,o,i=e){if(!Number.isFinite(o)||o<0)throw new Error("invalid floor edge height");const a=(t||[]).map(e=>(e||[]).map((e,t)=>function(e,t){const n=j(e,t);if(!n.length)return n;let o=0;for(let e=1;e<n.length;e++)(n[e][0]<n[o][0]||n[e][0]===n[o][0]&&n[e][1]<n[o][1])&&(o=e);return[...n.slice(o),...n.slice(0,o)]}(e,t>0)).filter(e=>e.length>=3&&Math.abs(T(e))>=1e-9)).filter(e=>e.length&&T(e[0])>0);a.sort((e,t)=>{const n=e[0][0],o=t[0][0];return n[0]-o[0]||n[1]-o[1]||Math.abs(T(t[0]))-Math.abs(T(e[0]))});const r=[],s=[];let l=0;for(let e=0;e<a.length;e++){const t=a[e];for(const e of t)r.push(H(e,i,0));const c=t[0];l+=c.length;for(let t=0;t<c.length;t++){const a=c[t],r=c[(t+1)%c.length];if(O(a,r,i)<=1e-9)continue;const l=n(a,0,i),f=n(r,0,i),d=n(r,-o,i),u=n(a,-o,i);s.push({d:`M ${I(l)} L ${I(f)} L ${I(d)} L ${I(u)} Z`,depth:Math.max(u[1],d[1]),component:e,edge:t,planEdge:[a,r]})}}return s.sort((e,t)=>e.depth-t.depth||e.component-t.component||e.edge-t.edge),{footprintPath:r.join(" "),sides:s,componentCount:a.length,edgeCount:l}}function B(e,t){return e^=Math.round(64*(Number.isFinite(t)?t:0)),Math.imul(e,16777619)>>>0}const A=Object.freeze({revision:3,leafThicknessRatio:.04,frameThicknessRatio:.05,doorTurnDeg:50,windowTurnDeg:65,gateTurnDeg:10,gateTopRatio:.88,windowFrameBottomRatio:.38,windowFrameTopRatio:1,windowSashBottomRatio:.4,windowSashTopRatio:.98,windowGlassBottomRatio:.45,windowGlassTopRatio:.93,doorTopRatio:.92});A.leafThicknessRatio,A.frameThicknessRatio;const R=e=>e.every(Number.isFinite);function F(e,t){return Object.freeze([Object.is(e,-0)?0:e,Object.is(t,-0)?0:t])}function V(e,t){return[e[0]+t[0],e[1]+t[1]]}function L(e,t){return[e[0]-t[0],e[1]-t[1]]}function D(e,t){return[e[0]*t,e[1]*t]}function G(e,t,n,o){const i=e[0]*n,a=e[1]*o,r=t*Math.PI/180;return[i*Math.cos(r)-a*Math.sin(r),i*Math.sin(r)+a*Math.cos(r)]}function W(e,t,n,i,a,r,s){const l=e.flipH?-1:1,c="gate"===e.type?1:e.flipV?-1:1,f="door"===e.type||"gate"===e.type?e.face:o(e.type,e.flipV,e.angle,e.face);return{leaf:t,hinge:V([e.x+f.ox,e.y+f.oy],G(n,e.angle,l,c)),closedVector:G(i,e.angle,l,c),quarterVector:G([-i[1],i[0]],e.angle,l,c),turnDeg:a,bottom:r,top:s}}const E=e=>`${Number(e[0].toFixed(4))} ${Number(e[1].toFixed(4))}`;function q(e,t,o,i,a={}){const r=o.map(e=>n(e.point,e.z,i)),s=i.rotDeg*Math.PI/180,l=i.tiltDeg*Math.PI/180,c=o.reduce((e,t)=>e+(t.point[0]*Math.sin(s)+t.point[1]*Math.cos(s))*Math.sin(l)+t.z*Math.cos(l),0)/o.length;return Object.freeze({kind:e,material:t,d:`M ${r.map(E).join(" L ")} Z`,cameraDepth:c,depth:Math.max(...r.map(e=>e[1])),...a})}function _(e,t,n,o,i,a,r,s={}){return q(e,t,[{point:n,z:i},{point:o,z:i},{point:o,z:a},{point:n,z:a}],r,s)}function U(t,o,i=e){const a=Math.max(0,Math.min(1,Number.isFinite(o)?o:0));return t.leaves.map(e=>{const o=function(e,t){const n=e.turnDeg*t*Math.PI/180;return[e.hinge[0]+e.closedVector[0]*Math.cos(n)+e.quarterVector[0]*Math.sin(n),e.hinge[1]+e.closedVector[1]*Math.cos(n)+e.quarterVector[1]*Math.sin(n)]}(e,a),r=n(e.hinge,e.bottom,i),s=n(o,e.bottom,i),l=n(o,e.top,i),c=n(e.hinge,e.top,i),f="window"===t.type?"light-window":"matte-leaf",d="window"===t.type?function(e,t,n,o){const i=e.windowProfile;if(!i)throw new Error("missing isometric window profile");const a=L(n,t.hinge),r=Math.hypot(a[0],a[1]);if(!(r>1e-9))return Object.freeze([]);const s=F(a[0]/r,a[1]/r),l=Math.min(i.member,r/4,(i.sashTop-i.sashBottom)/4),c=V(t.hinge,D(s,l)),f=L(n,D(s,l)),d=Math.min(.35*e.frameThickness,.02*r),u=F(-s[1]*d/2,s[0]*d/2),h=V(c,u),p=V(f,u),m=L(c,u),g=L(f,u),w=[_("window-sash-side","light-frame",t.hinge,c,i.sashBottom,i.sashTop,o,{edge:"hinge"}),_("window-sash-side","light-frame",f,n,i.sashBottom,i.sashTop,o,{edge:"tip"}),_("window-sash-bottom","light-frame",t.hinge,n,i.sashBottom,i.sashBottom+l,o),_("window-sash-top","light-frame",t.hinge,n,i.sashTop-l,i.sashTop,o),_("window-glass","glass-side",h,p,i.glassBottom,i.glassTop,o),_("window-glass","glass-side",g,m,i.glassBottom,i.glassTop,o),q("window-glass-top","glass-top",[{point:h,z:i.glassTop},{point:p,z:i.glassTop},{point:g,z:i.glassTop},{point:m,z:i.glassTop}],o)];return Object.freeze(w.sort((e,t)=>e.depth-t.depth||e.kind.localeCompare(t.kind)||String(e.edge||"").localeCompare(String(t.edge||""))))}(t,e,o,i):function(e,t,n,o){const i=L(t,e.hinge),a=Math.hypot(i[0],i[1]);if(!(a>1e-9&&n>0))return Object.freeze([]);const r=F(-i[1]*n/(2*a),i[0]*n/(2*a)),s=V(e.hinge,r),l=V(t,r),c=L(e.hinge,r),f=L(t,r),d=[_("leaf-back","matte-leaf",f,c,e.bottom,e.top,o),_("leaf-front","matte-leaf",s,l,e.bottom,e.top,o),_("leaf-edge","matte-leaf",c,s,e.bottom,e.top,o,{edge:"hinge"}),_("leaf-edge","matte-leaf",l,f,e.bottom,e.top,o,{edge:"tip"}),q("leaf-top","matte-leaf",[{point:s,z:e.top},{point:c,z:e.top},{point:f,z:e.top},{point:l,z:e.top}],o)];return Object.freeze(d.sort((e,t)=>e.depth-t.depth||e.kind.localeCompare(t.kind)||String(e.edge||"").localeCompare(String(t.edge||""))))}(e,o,t.leafThickness,i);return Object.freeze({id:t.id,sourceIndex:t.sourceIndex,type:t.type,leaf:e.leaf,d:`M ${E(r)} L ${E(s)} L ${E(l)} L ${E(c)} Z`,shadowD:`M ${E(n(e.hinge,0,i))} L ${E(n(o,0,i))}`,depth:Math.max(r[1],s[1]),material:f,thickness:"window"===t.type?0:t.leafThickness,surfaces:d})})}const K=1e-9,Z=(e,t)=>`${e}\0${t}`,J=e=>e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1]);function Q(e){let t=0;for(let n=0;n<e.length;n++){const o=e[n],i=e[(n+1)%e.length];t+=o[0]*i[1]-i[0]*o[1]}return t/2}function X(e){return e.length>=3&&e.every(J)&&Math.abs(Q(e))>K}function Y(e,t,n){const o=n[0]-t[0],i=n[1]-t[1],a=o*o+i*i,r=a?Math.max(0,Math.min(1,((e[0]-t[0])*o+(e[1]-t[1])*i)/a)):0;return Math.hypot(e[0]-t[0]-r*o,e[1]-t[1]-r*i)}function ee(e,t,n=1e-7){for(let o=0;o<t.length;o++)if(Y(e,t[o],t[(o+1)%t.length])<=n)return!0;return!1}function te(e,t){let n=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const a=t[o],r=t[i];a[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-a[0])*(e[1]-a[1])/(r[1]-a[1])+a[0]&&(n=!n)}return n}function ne(e){return Math.max(0,Math.abs(Q(e.outer))-(e.holes||[]).reduce((e,t)=>e+Math.abs(Q(t)),0))}function oe(e){return!!e.id&&X(e.outer)&&(e.holes||[]).every(X)&&ne(e)>K}function ie(e,t){if(ee(e,t.outer)||!te(e,t.outer))return!1;for(const n of t.holes||[])if(ee(e,n)||te(e,n))return!1;return!0}function ae(e,t){return oe(t)&&ie(e,t)}function re(e){if(!oe(e))return null;if(e.safePoint&&ae(e.safePoint,e))return[e.safePoint[0],e.safePoint[1]];const t=e.outer.map(e=>e[0]),n=e.outer.map(e=>e[1]),o=Math.min(...t),i=Math.max(...t),a=Math.min(...n),r=Math.max(...n),s=[[(o+i)/2,(a+r)/2],[t.reduce((e,t)=>e+t,0)/t.length,n.reduce((e,t)=>e+t,0)/n.length]];for(let t=0;t<e.outer.length;t++){const n=e.outer[(t+e.outer.length-1)%e.outer.length],o=e.outer[t],i=e.outer[(t+1)%e.outer.length];s.push([(n[0]+o[0]+i[0])/3,(n[1]+o[1]+i[1])/3])}let l=null,c=-1/0;const f=t=>{if(!ae(t,e))return;const n=function(e,t){let n=1/0;for(const o of[t.outer,...t.holes||[]])for(let t=0;t<o.length;t++)n=Math.min(n,Y(e,o[t],o[(t+1)%o.length]));return n}(t,e);n>c+K&&(l=t,c=n)};s.forEach(f);for(let e=1;e<16;e++)for(let t=1;t<16;t++)f([o+(i-o)*e/16,a+(r-a)*t/16]);return l}function se(e){if(!J(e.floorAnchor))return null;const t=e.roomsValidated?e.rooms:e.rooms.filter(oe),n=e.preferredRoomId&&t.find(t=>t.id===e.preferredRoomId)||null;let o=null;return"device"===e.kind?(n&&ae(e.floorAnchor,n)&&(o=n),o||(o=t.filter(t=>ae(e.floorAnchor,t)).sort((e,t)=>ne(e)-ne(t)||((e,t)=>e<t?-1:e>t?1:0)(e.id,t.id))[0]||null)):o=n,o?{id:o.id,area:ne(o),safePoint:e.roomsValidated&&o.safePoint?[o.safePoint[0],o.safePoint[1]]:re(o)}:null}function le(t,o,i,a=e,r=[0,0]){if(!J(t)||!J(o)||o[0]<0||o[1]<0||!Number.isFinite(i)||!J(r))throw new Error("invalid isometric overlay footprint");return[[t[0]-o[0],t[1]-o[1]],[t[0]+o[0],t[1]-o[1]],[t[0]+o[0],t[1]+o[1]],[t[0]-o[0],t[1]+o[1]]].map(e=>{const t=n(e,i,a);return[t[0]+r[0],t[1]+r[1]]})}function ce(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function fe(e,t,n,o){const i=ce(e,t,n),a=ce(e,t,o),r=ce(n,o,e),s=ce(n,o,t);return(i>K&&a<-K||i<-K&&a>K)&&(r>K&&s<-K||r<-K&&s>K)||(Math.abs(i)<=K&&Y(n,e,t)<=K||Math.abs(a)<=K&&Y(o,e,t)<=K||Math.abs(r)<=K&&Y(e,n,o)<=K||Math.abs(s)<=K&&Y(t,n,o)<=K)}function de(e,t,n,o){return fe(e,t,n,o)?0:Math.min(Y(e,n,o),Y(t,n,o),Y(n,e,t),Y(o,e,t))}const ue=new WeakMap;function he(e){if(!e.length)return null;let t=1/0,n=1/0,o=-1/0,i=-1/0;for(const a of e){if(!J(a))return null;t=Math.min(t,a[0]),n=Math.min(n,a[1]),o=Math.max(o,a[0]),i=Math.max(i,a[1])}return[t,n,o,i]}function pe(e,t){if(!t)return he(e.outer);if(ue.has(e))return ue.get(e)??null;const n=he(e.outer);return ue.set(e,n),n}function me(e,t,n){return e[0]<=t[2]+n&&e[2]>=t[0]-n&&e[1]<=t[3]+n&&e[3]>=t[1]-n}function ge(e,t,n,o){return Math.min(t[0],n[0])<=e[2]+o&&Math.max(t[0],n[0])>=e[0]-o&&Math.min(t[1],n[1])<=e[3]+o&&Math.max(t[1],n[1])>=e[1]-o}function we(e,t,n,o,i){const a=pe(n,i);if(!a||!me(t,a,o))return!1;if(e.some(e=>function(e,t){return!!te(e,t.outer)&&!(t.holes||[]).some(t=>te(e,t))}(e,n)))return!0;if(n.outer.some(n=>n[0]>=t[0]&&n[0]<=t[2]&&n[1]>=t[1]&&n[1]<=t[3]&&te(n,e)))return!0;for(const i of[n.outer,...n.holes||[]])for(let n=0;n<e.length;n++){const a=(n+1)%e.length;for(let r=0;r<i.length;r++){const s=(r+1)%i.length;if(ge(t,i[r],i[s],o)&&de(e[n],e[a],i[r],i[s])<=o+K)return!0}}return!1}function Me(e){return X(e.outer)&&(e.holes||[]).every(X)}function ye(e,t,n){return!(!ae(e,n)||!ae(t,n))&&be(e,t,n)}function be(e,t,n){for(const o of[n.outer,...n.holes||[]])for(let n=0;n<o.length;n++)if(fe(e,t,o[n],o[(n+1)%o.length]))return!1;return!0}function Se(e,t,n){const o=t[0]-e[0],i=t[1]-e[1];return{from:e,to:t,visible:n,length:Math.hypot(o,i),angleDeg:180*Math.atan2(i,o)/Math.PI}}function xe(){return{points:new Map,pending:[]}}function ve(e,t){return Number.isInteger(e)&&Number.isInteger(t)&&e>=-32768&&e<=32767&&t>=-32768&&t<=32767?65536*(e+32768)+t+32768:`${e}:${t}`}function $e(e,t,n){const o=e=>{const t=Math.floor(e),n=Math.ceil(e);return t===n?[t-1,t,t+1]:[t,n]},i=o(t[0]),a=o(t[1]);for(const t of a)for(const o of i){if(o*o+t*t>n*n+K)continue;const i=ve(o,t);if(!e.points.has(i)){const n=[o,t];e.points.set(i,n),e.pending.push(n)}}}function ke(e,t,n){const o=t[0]-e[0],i=t[1]-e[1];let a=0,r=1;const s=(e,t)=>{if(Math.abs(e)<=K)return t>=0;const n=t/e;if(e<0){if(n>r)return!1;n>a&&(a=n)}else{if(n<a)return!1;n<r&&(r=n)}return!0};return s(-o,e[0]+n)&&s(o,n-e[0])&&s(-i,e[1]+n)&&s(i,n-e[1])?[[e[0]+o*a,e[1]+i*a],[e[0]+o*r,e[1]+i*r]]:null}function ze(e,t,n){$e(e,[t[0],Math.max(t[1],Math.min(0,t[3]))],n),$e(e,[t[2],Math.max(t[1],Math.min(0,t[3]))],n),$e(e,[Math.max(t[0],Math.min(0,t[2])),t[1]],n),$e(e,[Math.max(t[0],Math.min(0,t[2])),t[3]],n),$e(e,[t[0],t[1]],n),$e(e,[t[2],t[1]],n),$e(e,[t[2],t[3]],n),$e(e,[t[0],t[3]],n)}function Pe(e,t,n,o){const i=(t,n)=>{for(const i of[t[0],t[2]])if(!(i<n[0]-K||i>n[2]+K))for(const a of[n[1],n[3]])a>=t[1]-K&&a<=t[3]+K&&$e(e,[i,a],o)};i(t,n),i(n,t)}function Ce(e,t,n){for(const o of t)ze(e,o,n);for(let o=0;o<t.length;o++)for(let i=o+1;i<t.length;i++)Pe(e,t[o],t[i],n)}function Ie(e,t,n,o){const i=ke(t,n,o+2);if(!i)return;const a=i[1][0]-i[0][0],r=i[1][1]-i[0][1],s=a*a+r*r,l=s>K?Math.max(0,Math.min(1,-(i[0][0]*a+i[0][1]*r)/s)):0;$e(e,i[0],o),$e(e,i[1],o),$e(e,[i[0][0]+a*l,i[0][1]+r*l],o)}function Te(e,t,n){const o=[[t[0],t[1]],[t[2],t[1]],[t[2],t[3]],[t[0],t[3]]];for(let t=0;t<o.length;t++)Ie(e,o[t],o[(t+1)%o.length],n)}function je(e,t,n,o){const[i,a]=t,r=a[0]-i[0],s=a[1]-i[1];if(Math.abs(r)>K)for(const t of[n[0],n[2]]){const a=(t-i[0])/r;if(a<-K||a>1+K)continue;const l=i[1]+s*a;l>=n[1]-K&&l<=n[3]+K&&$e(e,[t,l],o)}if(Math.abs(s)>K)for(const t of[n[1],n[3]]){const a=(t-i[1])/s;if(a<-K||a>1+K)continue;const l=i[0]+r*a;l>=n[0]-K&&l<=n[2]+K&&$e(e,[l,t],o)}}function He(e,t,n,o){for(const i of n)je(e,t,i,o)}function Oe(e,t,n,o){const[i,a]=t,[r,s]=n,l=[a[0]-i[0],a[1]-i[1]],c=[s[0]-r[0],s[1]-r[1]],f=l[0]*c[1]-l[1]*c[0];if(Math.abs(f)<=K)return;const d=[r[0]-i[0],r[1]-i[1]],u=(d[0]*c[1]-d[1]*c[0])/f,h=(d[0]*l[1]-d[1]*l[0])/f;if(u<-K||u>1+K||h<-K||h>1+K)return;const p=[i[0]+l[0]*u,i[1]+l[1]*u];Math.hypot(p[0],p[1])<=o+2&&$e(e,p,o)}const Ne=new WeakMap;function Be(e,t,n,o,i,a,r,s){for(const l of function(e){const t=Ne.get(e);if(t)return t;const n=[];for(const t of[e.outer,...e.holes||[]])for(let e=0;e<t.length;e++){const o=t[e],i=t[(e+1)%t.length],a=i[0]-o[0],r=i[1]-o[1],s=Math.hypot(a,r);if(s<=K)continue;const l=[a/s,r/s],c=[-l[1],l[0]],f=o[0]*l[0]+o[1]*l[1],d=i[0]*l[0]+i[1]*l[1];n.push({tangent:l,normal:c,tangentMin:Math.min(f,d),tangentMax:Math.max(f,d),normalOffset:o[0]*c[0]+o[1]*c[1]})}return Ne.set(e,n),n}(t)){const{tangent:t,normal:c}=l,f=(e,t)=>e[0]*t[0]+e[1]*t[1];let d=1/0,u=-1/0,h=1/0,p=-1/0;for(const e of n){const n=f(e,t),o=f(e,c);d=Math.min(d,n),u=Math.max(u,n),h=Math.min(h,o),p=Math.max(p,o)}const m=l.tangentMin-u-o,g=l.tangentMax-d+o,w=[l.normalOffset-o-p,l.normalOffset+o-h];for(const n of w){const o=e=>[(t[0]*e+c[0]*n)/i,(t[1]*e+c[1]*n)/i],l=ke(o(m),o(g),a+2);l&&(s?.push(l),Ie(e,l[0],l[1],a),He(e,l,r,a))}}}function Ae(e,t){if(t<=K)$e(e,[0,0],t);else for(let n=Math.ceil(-t);n<=Math.floor(t);n++){const o=Math.sqrt(Math.max(0,t*t-n*n));$e(e,[n,o],t),$e(e,[n,-o],t)}}function Re(e,t,n=4){const o=[];for(let i=Math.floor(e[1]-n);i<=Math.ceil(e[1]+n);i++)for(let a=Math.floor(e[0]-n);a<=Math.ceil(e[0]+n);a++){const e=Math.hypot(a,i);e<=t+K&&o.push({offset:[a,i],distance:e})}return o.sort((e,t)=>e.distance-t.distance||e.offset[1]-t.offset[1]||e.offset[0]-t.offset[0]),o}function Fe(e,t){return[t[0]-e.screenHalfSize[0],t[1]-e.screenHalfSize[1],t[0]+e.screenHalfSize[0],t[1]+e.screenHalfSize[1]]}function Ve(e,t){return[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function Le(e,t,n){const o=Math.min(e[2],t[2])-Math.max(e[0],t[0])+n,i=Math.min(e[3],t[3])-Math.max(e[1],t[1])+n;return o>K&&i>K?o*i:0}function De(e,t,n){const o=n.tiltDeg*Math.PI/180;return a([e[0],e[1]+t*n.zScale*Math.sin(o)],n)}function Ge(e,t,n,o){const i=[t[0]*n,t[1]*n];if(!o&&Math.abs(i[0]-e.nudgeScene[0])<=K&&Math.abs(i[1]-e.nudgeScene[1])<=K)return e;const a=[i[0]-e.nudgeScene[0],i[1]-e.nudgeScene[1]],r=[e.raisedScene[0]+i[0],e.raisedScene[1]+i[1]],s=Math.hypot(t[0],t[1]);return{...e,visualScene:r,footprint:e.footprint.map(e=>[e[0]+a[0],e[1]+a[1]]),nudgeScene:i,nudgeCss:t,nudgeDistanceCss:s,nudged:s>K,capped:e.capped||o,status:o?"degraded":e.status,reason:o?"overlay-collision":e.reason,tether:Se(e.floorScene,r,!1)}}function We(t){const o=t.sceneUnitsPerCssPixel,a=t.maxNudgeCssPx??48,r=t.safetyGapCssPx??4,s=t.visualOffset??i,l=t.camera||e;if(!(o>0&&Number.isFinite(o)&&a>=0&&Number.isFinite(a)&&r>=0&&Number.isFinite(r)))throw new Error("invalid isometric overlay collision input");const c=r*o,f=64*o,d=new Map(t.rooms.filter(oe).map(e=>[e.id,e])),u=new Map([...d].map(([e,t])=>[e,he(t.outer)])),h=new Map([...d].flatMap(([e,t])=>{const n=function(e){if(4!==e.outer.length||0!==(e.holes?.length||0))return null;const t=he(e.outer);if(!t)return null;const n=new Set(e.outer.map(e=>{const n=Math.abs(e[0]-t[0])<=K?0:Math.abs(e[0]-t[2])<=K?1:-1,o=Math.abs(e[1]-t[1])<=K?0:Math.abs(e[1]-t[3])<=K?1:-1;return n<0||o<0?"":`${n}:${o}`}));return 4!==n.size||n.has("")?null:t}(t);return n?[[e,n]]:[]})),p=t.wallSilhouettes.every(Me),m=t.wallSilhouettes.map(e=>({wall:e,bounds:pe(e,!0)})),g=[],w=new Map,M=new Map,y=[],b=[...t.items].sort((e,t)=>e.placement.nudgeDistanceCss-t.placement.nudgeDistanceCss||Z(e.kind,e.id).localeCompare(Z(t.kind,t.id))),S=l.rotDeg*Math.PI/180,x=l.tiltDeg*Math.PI/180,v=1/l.xyScale,$=1/(l.xyScale*Math.cos(x)),k=Math.cos(S),z=Math.sin(S),P=e=>[Math.floor(e[0]/f),Math.floor(e[1]/f),Math.floor(e[2]/f),Math.floor(e[3]/f)],C=e=>{const[t,n,o,i]=P(Ve(e,c)),a=new Set;for(let e=n;e<=i;e++)for(let n=t;n<=o;n++)for(const t of w.get(ve(n,e))||[])a.add(t);return[...a].sort((e,t)=>e-t)},I=e=>{const t=g.push(e)-1,[n,o,i,a]=P(e.bounds);for(let e=o;e<=a;e++)for(let o=n;o<=i;o++){const n=ve(o,e),i=w.get(n)||[];i.push(t),w.set(n,i)}};for(const e of b){const t=Z(e.kind,e.id),i=e.placement,r=[i.nudgeScene[0]/o,i.nudgeScene[1]/o],w=i.footprint.map(e=>[e[0]-i.nudgeScene[0],e[1]-i.nudgeScene[1]]),b=i.owner&&d.get(i.owner.id)||null,S=De(i.visualScene,s,l),x=he(w),T=p&&w.length?m.filter(({bounds:e})=>{if(!e)return!1;return!!x&&me(Ve(x,a*o),e,c)}):m,j=C(Ve(Fe(e,i.raisedScene),a*o)),H=e=>{const t=[];let n=0;for(const o of j){const i=Le(e,g[o].bounds,c);i>K&&(t.push(o),n+=i)}return{conflicts:t,penalty:n}},O=t=>{if(Math.hypot(t[0],t[1])>a+K)return null;const n=[t[0]*o,t[1]*o],r=Math.abs(n[0]-i.nudgeScene[0])<=K&&Math.abs(n[1]-i.nudgeScene[1])<=K,s=[i.raisedScene[0]+n[0],i.raisedScene[1]+n[1]],l=Fe(e,s),{conflicts:c,penalty:f}=H(l);return{offsetScene:n,sameAsBase:r,visualScene:s,bounds:l,conflicts:c,penalty:f}},N=b&&u.get(b.id)||null,B=b&&h.get(b.id)||null,A=!!b&&(B?S[0]>B[0]+K&&S[0]<B[2]-K&&S[1]>B[1]+K&&S[1]<B[3]-K:ie(S,b)),R=new Map;for(let e=0;e<T.length;e++){const t=T[e].bounds;if(!t)continue;const[n,o,i,a]=P(Ve(t,c));for(let t=o;t<=a;t++)for(let o=n;o<=i;o++){const n=ve(o,t),i=R.get(n)||[];i.push(e),R.set(n,i)}}const F=new Int32Array(T.length);let V=0;const L=w.map(()=>[0,0]),D=e=>{for(let t=0;t<w.length;t++)L[t][0]=w[t][0]+e[0],L[t][1]=w[t][1]+e[1];return L},G=(e,t)=>{const n=Math.floor((e[0]-c)/f),o=Math.floor((e[1]-c)/f),i=Math.floor((e[2]+c)/f),a=Math.floor((e[3]+c)/f);V+=1;for(let r=o;r<=a;r++)for(let o=n;o<=i;o++)for(const n of R.get(ve(o,r))||[])if(F[n]!==V&&(F[n]=V,we(t(),e,T[n].wall,c,!0)))return n},W=-2,E=-1,q=e=>{if(e.sameAsBase)return W;if(!p||!b)return E;const t=e.visualScene[0]-i.visualScene[0],n=e.visualScene[1]-i.visualScene[1],o=t*v,a=n*$,r=S[0]+o*k+a*z,s=S[1]-o*z+a*k;if(N&&(r<N[0]||r>N[2]||s<N[1]||s>N[3]))return E;if(B){if(!(r>B[0]+K&&r<B[2]-K&&s>B[1]+K&&s<B[3]-K))return E}else{const e=[r,s];if(!ie(e,b))return E;if(A&&!be(S,e,b))return E}if(!x)return E;const l=[x[0]+e.offsetScene[0],x[1]+e.offsetScene[1],x[2]+e.offsetScene[0],x[3]+e.offsetScene[1]];let c=null;const f=G(l,()=>c||=D(e.offsetScene));return void 0===f?W:f},_=e=>q(e)===W,U=e=>{const t=O(e);return t&&_(t)?{placement:Ge(i,e,o,!1),bounds:t.bounds,conflicts:t.conflicts,penalty:t.penalty}:null},J=U(r);let Q=J,X=!1;if(!Q||Q.conflicts.length){const t=e.nudgeHintCss?U(e.nudgeHintCss):null;t&&!t.conflicts.length&&(Q=t,X=!0)}if(!J||J.conflicts.length){const t=xe(),f=[],d=[],u=[],h=new Set,p=new Set(J?.conflicts||[]),m=t=>{if(h.has(t))return;h.add(t);const n=g[t].bounds,a=[(n[0]-e.screenHalfSize[0]-c-i.raisedScene[0])/o,(n[1]-e.screenHalfSize[1]-c-i.raisedScene[1])/o,(n[2]+e.screenHalfSize[0]+c-i.raisedScene[0])/o,(n[3]+e.screenHalfSize[1]+c-i.raisedScene[1])/o];f.push(a),d.push(a)},M=x,y=new Set,S=new Set,v=e=>{if(y.has(e)||!M)return;y.add(e);const{wall:n,bounds:i}=T[e];if(i){const e=[(i[0]-c-M[2])/o,(i[1]-c-M[3])/o,(i[2]+c-M[0])/o,(i[3]+c-M[1])/o];d.push(e),Te(t,e,a)}Be(t,n,w,c,o,a,f,u)};let $=!1,k=!1;const z=()=>{if(!$&&($=!0,Ae(t,a),b))for(const e of[b.outer,...b.holes||[]])for(let r=0;r<e.length;r++){const c=n(e[r],s,l),f=n(e[(r+1)%e.length],s,l),d=[[(c[0]-i.raisedScene[0])/o,(c[1]-i.raisedScene[1])/o],[(f[0]-i.raisedScene[0])/o,(f[1]-i.raisedScene[1])/o]];Ie(t,d[0],d[1],a);const h=ke(d[0],d[1],a+2);h&&u.push(h)}};let P=0,C=0,I=0;const j=()=>{for(let e=P;e<d.length;e++){Ce(t,[d[e]],a);for(let n=0;n<e;n++)Pe(t,d[n],d[e],a)}for(let e=I;e<u.length;e++)for(let n=0;n<e;n++)Oe(t,u[n],u[e],a);for(let e=C;e<f.length;e++)for(let n=0;n<I;n++)je(t,u[n],f[e],a);for(let e=I;e<u.length;e++)He(t,u[e],f,a);P=d.length,C=f.length,I=u.length},H=()=>{const e=t.pending.splice(0).map(e=>({offset:e,distance:Math.hypot(e[0],e[1])})).sort((e,t)=>e.distance-t.distance||e.offset[1]-t.offset[1]||e.offset[0]-t.offset[0]);let n=null;for(const t of e){const e=Q&&!Q.conflicts.length?Q.placement.nudgeDistanceCss:1/0;if(t.distance>a+K||t.distance>e+K)break;const s=t.offset;if(Math.abs(s[0]-r[0])<=K&&Math.abs(s[1]-r[1])<=K)continue;const l=O(s);if(!l)continue;for(const e of l.conflicts)h.has(e)||p.add(e);if(!(!Q||!l.conflicts.length||Q.conflicts.length&&l.penalty<Q.penalty-K))continue;const c=q(l);if(c!==W){if(c>=0){const e=c;if(y.has(e))continue;const o={index:e,freePriority:l.conflicts.length?1:0,score:l.conflicts.length?l.penalty:t.distance,distance:t.distance};(!n||o.freePriority<n.freePriority||o.freePriority===n.freePriority&&(o.score<n.score-K||Math.abs(o.score-n.score)<=K&&(o.distance<n.distance-K||Math.abs(o.distance-n.distance)<=K&&o.index<n.index)))&&(n=o)}else c===E&&(k=!0);continue}if(l.conflicts.length){(!Q||Q.conflicts.length&&l.penalty<Q.penalty-K)&&(Q={placement:Ge(i,s,o,!1),bounds:l.bounds,conflicts:l.conflicts,penalty:l.penalty},X=!1);continue}const f=Q?.placement.nudgeCss;(!Q||Q.conflicts.length||t.distance<Q.placement.nudgeDistanceCss-K||Math.abs(t.distance-Q.placement.nudgeDistanceCss)<=K&&!!f&&(s[1]<f[1]-K||Math.abs(s[1]-f[1])<=K&&s[0]<f[0]-K))&&(Q={placement:Ge(i,s,o,!1),bounds:l.bounds,conflicts:l.conflicts,penalty:l.penalty},X=!1)}n&&S.add(n.index)};for(;;){let e=!1;if(p.size){const t=[...p].sort((e,t)=>e-t);p.clear(),t.forEach(m),e=!0}if(S.size){const t=[...S].sort((e,t)=>e-t);S.clear(),t.forEach(v),e=!0}if(!e&&Q&&!Q.conflicts.length&&(!X||$||!k))break;if(e||$||(z(),e=!0),!e)break;j(),H()}if(Q&&!Q.conflicts.length){const e=Q.placement.nudgeCss;for(const t of Re(e,a)){if(t.distance>=Q.placement.nudgeDistanceCss-K)break;const e=O(t.offset);e&&!e.conflicts.length&&_(e)&&(Q={placement:Ge(i,t.offset,o,!1),bounds:e.bounds,conflicts:e.conflicts,penalty:e.penalty})}}}if(Q)Q.conflicts.length&&(Q={...Q,placement:Ge(i,Q.placement.nudgeCss,o,!0)});else{const t=Ge(i,r,o,!0),n=Fe(e,t.visualScene);Q={placement:t,bounds:n,conflicts:C(n),penalty:1/0}}for(const e of Q.conflicts)Le(Q.bounds,g[e].bounds,c)>K&&y.push(Object.freeze([g[e].key,t]));M.set(t,Q.placement),I({key:t,bounds:Q.bounds})}return{placements:M,residualPairs:Object.freeze(y)}}const Ee="7d666f118b3321f5eca092f330ca7f1a3985cf7ab65ea69a2247c9064d4d2e7d",qe=e=>"wall-side"===e.layer?0:"wall-top"===e.layer?1:2,_e=e=>{if("wall-side"===e.layer)return`${e.face.polygon}:${e.face.ring}:${e.face.edge}`;if("wall-top"===e.layer)return String(e.face.component);const t=e.surface;return`${t.sourceIndex}:${t.leaf??-1}:${t.kind}:${t.jamb??-1}:${t.edge??""}:${t.id}:${t.material}`};function Ue(e,t){const n=[...e.sides.map(e=>({layer:"wall-side",depth:e.depth,face:e})),...e.topFaces.map(e=>({layer:"wall-top",depth:e.depth,face:e})),...t.map(e=>({layer:"opening",depth:e.depth,surface:e}))];n.sort((e,t)=>e.depth-t.depth||qe(e)-qe(t)||_e(e).localeCompare(_e(t)));const o=new Map;for(const e of n){if("opening"!==e.layer)continue;const t=`${e.surface.type}\0${e.surface.id}`,n=o.get(t)||[];n.push(e),o.set(t,n)}for(const e of o.values())e.sort((e,t)=>{const n="opening"===e.layer?e.surface:null,o="opening"===t.layer?t.surface:null;return(n?.cameraDepth??n?.depth??0)-(o?.cameraDepth??o?.depth??0)||_e(e).localeCompare(_e(t))});const i=new Map;return Object.freeze(n.map(e=>{if("opening"!==e.layer)return e;const t=`${e.surface.type}\0${e.surface.id}`,n=i.get(t)||0;return i.set(t,n+1),o.get(t)?.[n]||e}))}const Ke=Object.freeze({textLatinAdvance:.72,textWideAsciiAdvance:1,textWideAdvance:1.1,textSpaceAdvance:.4,textWidthSafety:1.08,deviceShellInset:.134375,deviceShellGap:.1,deviceSectionGap:.08,deviceBadgeMinWidth:.7875,deviceBadgeHeight:.7875,deviceBadgeInlinePadding:.28,deviceValueInlinePadding:.32,deviceAuxiliaryExtent:.7,deviceLqiFontSize:.38,deviceLqiTop:.734375,deviceLqiBelowBottomBadgeTop:1.571875,devicePadding:.08,roomNameLineHeight:1.25,roomAreaLinkWidth:1.1,roomMetricsTopGap:.15,roomMetricFontSize:.75,roomMetricLineHeight:1.25,roomMetricIconWidth:1.05,roomMetricInnerGap:.12,roomMetricRowGap:.55,roomMetricMinWidth:11,roomPadding:.4,openingLockHalfSize:.62,roomMetricTextCharacters:Object.freeze({temperature:10,humidity:8,lqi:6,light:24})});function Ze(e){return[...String(e)].reduce((e,t)=>/\s/.test(t)?e+Ke.textSpaceAdvance:/[MW@#%&]/.test(t)?e+Ke.textWideAsciiAdvance:e+(t.codePointAt(0)>255?Ke.textWideAdvance:Ke.textLatinAdvance),0)*Ke.textWidthSafety}function Je(e,t){return Ze(e)*P(t||e)}function Qe(e,t){return[Math.max(Math.abs(e.left),Math.abs(e.right))+t,Math.max(Math.abs(e.top),Math.abs(e.bottom))+t]}function Xe(e){if("opening-lock"===e.kind){const t=(Number.isFinite(e.size)&&e.size>0?e.size:0)*Ke.openingLockHalfSize;return[t,t]}if("room-label"===e.kind){const t=Number.isFinite(e.font)&&e.font>0?e.font:0,n=b(e.room.settings?.name_scale),o=b(e.room.settings?.label_scale),i=(Ze(e.room.name||"")+(e.room.area?Ke.roomAreaLinkWidth:0))*n,a=Ke.roomNameLineHeight*n,r=[e.display.labelTemp?Ke.roomMetricTextCharacters.temperature:0,e.display.labelHum?Ke.roomMetricTextCharacters.humidity:0,e.display.labelLqi&&e.room.area?Ke.roomMetricTextCharacters.lqi:0,e.display.labelLight?Ke.roomMetricTextCharacters.light:0].filter(e=>e>0),s=Ke.roomMetricFontSize*o,l=r.length?Math.max(Ke.roomMetricMinWidth,r.reduce((e,t)=>e+Ke.roomMetricIconWidth+Ke.roomMetricInnerGap+t*Ke.textLatinAdvance*Ke.textWidthSafety,0)+(r.length-1)*Ke.roomMetricRowGap)*s:0,c=r.length?s*Ke.roomMetricLineHeight:0,f=Qe({left:-Math.max(i,l)/2,right:Math.max(i,l)/2,top:-a/2,bottom:r.length?a/2+Ke.roomMetricsTopGap+c:a/2},Ke.roomPadding);return[f[0]*t,f[1]*t]}const t=Number.isFinite(e.core)&&e.core>0?e.core:0,n=e.presentation,o=null==n.valueText?1:Math.max(1,Je(n.valueText,n.valueFullText||n.valueText)+Ke.deviceValueInlinePadding),i=[];n.valueBadge&&i.push(Math.max(Ke.deviceBadgeMinWidth,Je(n.valueBadge.text,n.valueBadge.fullText||n.valueBadge.text)+Ke.deviceBadgeInlinePadding));for(const e of S(n)){const t=e.text+e.suffix;i.push(Math.max(Ke.deviceBadgeMinWidth,Je(t,t)+Ke.deviceBadgeInlinePadding))}const a=n.valueBadge?.position||"right";let r;if(!i.length||"left"!==a&&"right"!==a)if(i.length){const e=i.reduce((e,t)=>e+t,0)+(i.length-1)*Ke.deviceSectionGap,t=Math.max(o,e),n=1+Ke.deviceShellGap+Ke.deviceBadgeHeight;r="bottom"===a?{left:-t/2-Ke.deviceShellInset,right:t/2+Ke.deviceShellInset,top:-.5-Ke.deviceShellInset,bottom:-.5+n+Ke.deviceShellInset}:{left:-t/2-Ke.deviceShellInset,right:t/2+Ke.deviceShellInset,top:.5-n-Ke.deviceShellInset,bottom:.5+Ke.deviceShellInset}}else r={left:-.5-Ke.deviceShellInset,right:-.5+o+Ke.deviceShellInset,top:-.5-Ke.deviceShellInset,bottom:.5+Ke.deviceShellInset};else{const e=Math.max(...i),t=i.length*Ke.deviceBadgeHeight+(i.length-1)*Ke.deviceSectionGap,n=o+Ke.deviceShellGap+e,s=Math.max(1,t);r="right"===a?{left:-.5-Ke.deviceShellInset,right:-.5+n+Ke.deviceShellInset,top:-s/2-Ke.deviceShellInset,bottom:s/2+Ke.deviceShellInset}:{left:.5-n-Ke.deviceShellInset,right:.5+Ke.deviceShellInset,top:-s/2-Ke.deviceShellInset,bottom:s/2+Ke.deviceShellInset}}const s=Ke.deviceAuxiliaryExtent;if(r.left=Math.min(r.left,-s),r.right=Math.max(r.right,s),r.top=Math.min(r.top,-s),r.bottom=Math.max(r.bottom,s),n.pulse.animated){const e=Math.max(1,n.pulse.diameterScale)/2;r.left=Math.min(r.left,-e),r.right=Math.max(r.right,e),r.top=Math.min(r.top,-e),r.bottom=Math.max(r.bottom,e)}if(null!=n.lqiText){const e="bottom"===n.valueBadge?.position?Ke.deviceLqiBelowBottomBadgeTop:Ke.deviceLqiTop,t=Ze(n.lqiText)*Ke.deviceLqiFontSize/2;r.left=Math.min(r.left,-t),r.right=Math.max(r.right,t),r.bottom=Math.max(r.bottom,e+Ke.deviceLqiFontSize)}const l=Qe(r,Ke.devicePadding);return[l[0]*t,l[1]*t]}function Ye(e,t){return e.flatMap((e,n)=>e.orphanReason?[]:[{id:String(e.id||n),sourceIndex:n,type:e.type,x:e.rx,y:e.ry,angle:Number(e.angle)||0,length:e.rlen>0?e.rlen:.9*t,flipH:!!e.flip_h,flipV:!!e.flip_v}])}function et(e){return{id:e.id,x:e.x,y:e.y,w:e.w,h:e.h,poly:e.poly,wall_ids:e.wall_ids}}function tt(e,t){const n=e?.partitionHost;if(!n)return null;const o="gate"===t.type?!t.flipV:t.flipV;return{sourceIndex:t.sourceIndex,hostId:n.host.id,t:n.t,depth:n.depth,face:m(n,o)}}function nt(n,o=A){const i=Ye(n.openings,n.coordinateScale),a=i.map(e=>tt(n.openings[e.sourceIndex],e)),s=r(t,n.cellCm),m=r(l,n.cellCm),g=r(c,n.cellCm);return{key:`${n.space.id}|${function(e){let t=2166136261;const n=e=>{if("number"!=typeof e)if("string"!=typeof e)if("boolean"!=typeof e)if(Array.isArray(e)){t=B(t,e.length);for(const t of e)n(t)}else{if(e&&"object"==typeof e){const t=e;for(const e of Object.keys(t).sort())n(e),n(t[e]);return}t=B(t,-1)}else t=B(t,e?1:0);else for(const n of e)t=B(t,n.codePointAt(0)||0);else t=B(t,e)};return n(e),t.toString(36)}({rooms:n.space.rooms.map(et),walls:n.walls,openCuts:n.openCuts,openings:i,openingHosts:a,openingGeometryPolicy:o,partitions:n.space.partitions,columns:n.space.wall_columns,cellCm:n.cellCm,gridPitch:n.gridPitch,wallKeyPitch:n.wallKeyPitch,camera:e,wallHeight:s,raisedHeight:g,floorEdgeHeight:m,algorithm:5})}`,build:()=>{n.onBuild();const r=f(n.space,n.cellCm,n.gridPitch,2e-4*n.gridPitch,n.partitionCuts()).all,l=n.roomOpenings(),c=n.walls.length||r.length?d(n.space.rooms,n.walls,n.openCuts,l,n.wallKeyPitch,n.cellCm,n.gridPitch,n.coordinateScale,r):null;if(c&&("failed-core"===c.status||"not-applicable"===c.status))throw new Error("wall boolean geometry failed");const m=c?.paperGeom??u(n.space.rooms,n.walls,n.openCuts,n.wallKeyPitch,n.cellCm,n.gridPitch,n.coordinateScale);if(!m)throw new Error("floor boolean geometry failed");const g=c?.openingIndex||h(n.space.rooms,n.walls,n.openCuts,n.wallKeyPitch,n.cellCm,n.gridPitch,n.coordinateScale),w=i.map((e,i)=>{const r=a[i],l="gate"===e.type?!e.flipV:e.flipV,c=r?r.face:n.walls.length||"gate"===e.type?p(g,{x:e.x,y:e.y,angle:e.angle,length:e.length,flip_v:l}):{ox:0,oy:0,cm:0,side:-1};return function(e,n=t,o=A){const i=e.face.cm??0;if(!R([e.x,e.y,e.angle,e.length,e.face.ox,e.face.oy,i,n])||!(e.length>0)||!(n>0)||-1!==e.face.side&&1!==e.face.side||i<0)throw new Error("invalid isometric opening input");const a=e.length/2,r=e.angle*Math.PI/180,s=F(Math.cos(r),Math.sin(r)),l=F(-Math.sin(r),Math.cos(r)),c=F(e.x,e.y),f=F(e.x-s[0]*a,e.y-s[1]*a),d=F(e.x+s[0]*a,e.y+s[1]*a),u=F(e.face.ox,e.face.oy),h=F(f[0]+u[0],f[1]+u[1]),p=F(d[0]+u[0],d[1]+u[1]),m=F(f[0]-u[0],f[1]-u[1]),g=F(d[0]-u[0],d[1]-u[1]),w=Object.freeze({center:c,tangent:s,normal:l,start:f,end:d}),M=Object.freeze({side:e.face.side,cm:i,depth:2*Math.hypot(e.face.ox,e.face.oy),offset:u,selectedStart:h,selectedEnd:p,oppositeStart:m,oppositeEnd:g}),y="passage"===e.type?[]:[Object.freeze({jamb:0,center:f,selected:h,opposite:m}),Object.freeze({jamb:1,center:d,selected:p,opposite:g})];let b;if("passage"===e.type)b=[];else if("gate"===e.type){const t=e.face.side*o.gateTurnDeg;b=[W(e,0,[-a,0],[a,0],t,0,n*o.gateTopRatio),W(e,1,[a,0],[-a,0],-t,0,n*o.gateTopRatio)]}else b="window"===e.type?[W(e,0,[-a,0],[a,0],-o.windowTurnDeg,n*o.windowSashBottomRatio,n*o.windowSashTopRatio),W(e,1,[a,0],[-a,0],o.windowTurnDeg,n*o.windowSashBottomRatio,n*o.windowSashTopRatio)]:[W(e,0,[-a,0],[e.length,0],-o.doorTurnDeg,0,n*o.doorTopRatio)];const S="window"===e.type?Object.freeze({frameBottom:n*o.windowFrameBottomRatio,frameTop:n*o.windowFrameTopRatio,sashBottom:n*o.windowSashBottomRatio,sashTop:n*o.windowSashTopRatio,glassBottom:n*o.windowGlassBottomRatio,glassTop:n*o.windowGlassTopRatio,member:n*o.frameThicknessRatio}):null;return Object.freeze({id:e.id,sourceIndex:e.sourceIndex,type:e.type,wallHeight:n,leafThickness:n*o.leafThicknessRatio,frameThickness:n*o.frameThicknessRatio,windowProfile:S,axis:w,face:M,reveals:Object.freeze(y),leaves:Object.freeze(b.map(e=>Object.freeze({...e,hinge:F(e.hinge[0],e.hinge[1]),closedVector:F(e.closedVector[0],e.closedVector[1]),quarterVector:F(e.quarterVector[0],e.quarterVector[1])})))})}({...e,face:c},s,o)}),M=Object.freeze(w);return{walls:c?.components.flatMap(e=>e.geom)||[],floor:m,openings:M,openingSurfaces:Object.freeze(M.flatMap(t=>function(t,n=e){if("passage"===t.type)return Object.freeze([]);const o=[];if(t.face.depth>1e-9)for(const e of t.reveals)o.push(_("jamb-reveal","reveal",e.selected,e.opposite,0,t.wallHeight,n,{jamb:e.jamb}));if("window"!==t.type||!t.leaves.length)return Object.freeze(o.sort((e,t)=>e.depth-t.depth||e.kind.localeCompare(t.kind)||(e.jamb??0)-(t.jamb??0)));const i=t.windowProfile;if(!i)throw new Error("missing isometric window profile");const a=i.frameBottom,r=i.frameTop,s=Math.min(t.frameThickness,Math.hypot(t.axis.end[0]-t.axis.start[0],t.axis.end[1]-t.axis.start[1])/4,(r-a)/4),l=V(t.axis.start,D(t.axis.tangent,s)),c=L(t.axis.end,D(t.axis.tangent,s)),f=t.face.depth>1e-9?[t.face.offset,F(-t.face.offset[0],-t.face.offset[1])]:[t.face.offset];for(const e of f){const i=V(t.axis.start,e),f=V(t.axis.end,e),d=V(l,e),u=V(c,e);o.push(_("window-frame-side","light-frame",i,d,a,r,n,{jamb:0}),_("window-frame-side","light-frame",u,f,a,r,n,{jamb:1}),_("window-frame-top","light-frame",d,u,Math.max(a,r-s),r,n))}return t.face.depth>1e-9&&o.push(q("window-sill","light-sill",[{point:t.face.selectedStart,z:a},{point:t.face.selectedEnd,z:a},{point:t.face.oppositeEnd,z:a},{point:t.face.oppositeStart,z:a}],n)),Object.freeze(o.sort((e,t)=>e.depth-t.depth||e.kind.localeCompare(t.kind)||(e.jamb??0)-(t.jamb??0)))}(t).map(e=>Object.freeze({...e,id:t.id,sourceIndex:t.sourceIndex,type:t.type}))))}}}}const ot=e=>Array.isArray(e)?e:[];function it(e,t){const o=e=>ot(e).flatMap(e=>Array.isArray(e)&&Number.isFinite(e[0])&&Number.isFinite(e[1])?[n([Number(e[0]),Number(e[1])],t)]:[]);return ot(e).flatMap(e=>{const t=ot(e);if(!t.length)return[];const n=o(t[0]);if(n.length<3)return[];return[{outer:n,holes:t.slice(1).map(o).filter(e=>e.length>=3)}]})}function at(o){const i=r(t,o.cellCm),a=r(l,o.cellCm),s=r(c,o.cellCm),f=$(o.cache,o.source.key);let d=f.hit?f.value:void 0;if(!d){const r=o.source.build(),s=function(o,i=e,a=t){if(!Number.isFinite(a)||a<0)throw new Error("invalid wall height");const r=[],s=[],l=[],c=[];let f=0;for(let e=0;e<(o||[]).length;e++){const t=o[e],d=[];let u=-1/0;for(let o=0;o<(t||[]).length;o++){const s=j(t[o],o>0);if(s.length<3||Math.abs(T(s))<1e-9)continue;const h=H(s,i,a);r.push(h),d.push(h),u=Math.max(u,...s.map(e=>n(e,a,i)[1])),f+=s.length;for(let t=0;t<s.length;t++){const r=s[t],f=s[(t+1)%s.length],d=n(r,0,i),u=n(f,0,i);if(c.push(`M ${I(d)} L ${I(u)}`),O(r,f,i)<=1e-9)continue;const h=n(f,a,i),p=n(r,a,i),m=Object.freeze([d,u,h,p]);l.push({d:`M ${m.map(I).join(" L ")} Z`,points:m,depth:Math.max(d[1],u[1]),polygon:e,ring:o,edge:t})}}d.length&&s.push({d:d.join(" "),depth:u,component:e})}return l.sort((e,t)=>e.depth-t.depth||e.polygon-t.polygon||e.ring-t.ring||e.edge-t.edge),s.sort((e,t)=>e.depth-t.depth||e.component-t.component),{topPath:r.join(" "),topFaces:s,sides:l,contactPath:c.join(" "),edgeCount:f}}(r.walls,e,i),l=it(r.walls,i);d={geometry:s,floor:N(r.floor,a),wallSilhouettes:Object.freeze([...l,...s.sides.map(e=>({outer:e.points}))]),openings:r.openings,openingSurfaces:r.openingSurfaces},k(o.cache,o.source.key,d,8)}const u=function(e){let t=1/0,n=1/0,o=-1/0,i=-1/0;const a=(e,a=0)=>{t=Math.min(t,e[0]-a),n=Math.min(n,e[1]-a),o=Math.max(o,e[0]+a),i=Math.max(i,e[1]+a)};for(const t of e)if("passage"!==t.type){a(t.axis.start),a(t.axis.end),a(t.face.selectedStart),a(t.face.selectedEnd),a(t.face.oppositeStart),a(t.face.oppositeEnd);for(const e of t.leaves){const n=Math.hypot(e.closedVector[0],e.closedVector[1])+t.leafThickness/2;a(e.hinge,n)}}return R([t,n,o,i])?{x:t,y:n,w:o-t,h:i-n}:null}(d.openings),h=u?rt(o.liveFrame,u):o.liveFrame,p=z({rect:h,wallHeight:i,openingHeight:i,floorDepth:a,raisedHeight:s});return{key:o.source.key,...d,frame:p}}const rt=(e,t)=>{const n=Math.min(e.x,t.x),o=Math.min(e.y,t.y);return{x:n,y:o,w:Math.max(e.x+e.w,t.x+t.w)-n,h:Math.max(e.y+e.h,t.y+t.h)-o}},st=e=>{if(!e.length||!e.every(e=>Number.isFinite(e[0])&&Number.isFinite(e[1])))return null;const t=e.map(e=>e[0]),n=e.map(e=>e[1]),o=Math.min(...t),i=Math.min(...n);return{x:o,y:i,w:Math.max(...t)-o,h:Math.max(...n)-i}},lt=(e,t)=>{const n=e.placement,o=t?n.visualScene:n.raisedScene,[i,a]=e.screenHalfSize,r=t?n.footprint:n.footprint.map(e=>[e[0]-n.nudgeScene[0],e[1]-n.nudgeScene[1]]);return[n.floorScene,...r,[o[0]-i,o[1]-a],[o[0]+i,o[1]-a],[o[0]+i,o[1]+a],[o[0]-i,o[1]+a]]},ct=(e,t)=>void 0===t?e:e.filter(e=>e.placement.owner?.id===t);function ft(e,t){return e?st(ct(e.entries,t).flatMap(e=>lt(e,!0))):null}function dt(e){const t=ct(e.entries,e.ownerId),n=st(t.flatMap(e=>lt(e,!1))),o=n?rt(e.baseBounds,n):e.baseBounds,i=e.targetView(o);if(!(i&&i.w>0&&i.h>0&&[i.x,i.y,i.w,i.h].every(Number.isFinite)))return null;const a=e.stageSize;if(!(n&&a&&a.width>0&&a.height>0))return{bounds:o,view:i};const r=e=>Math.max(e.w/a.width,e.h/a.height),s=t=>{const o=48*t,i={x:n.x-o,y:n.y-o,w:n.w+2*o,h:n.h+2*o},a=rt(e.baseBounds,i),r=e.targetView(a);return r&&[r.x,r.y,r.w,r.h].every(Number.isFinite)&&r.w>0&&r.h>0?{bounds:a,view:r}:null};let l=0,c=Math.max(r(i),Number.EPSILON),f=s(c);for(let e=0;f&&r(f.view)>c*(1+1e-10)&&e<24;e++)l=c,c*=2,f=s(c);if(!f)return null;for(let e=0;e<40;e++){const e=(l+c)/2,t=s(e);if(!t)return null;r(t.view)<=e?(c=e,f=t):l=e}return f}const ut=new WeakMap,ht=2048,pt=new WeakMap,mt=new WeakMap,gt=new WeakMap;function wt(e,t){if(e.size!==t.size)return!1;for(const[n,o]of t)if(e.get(n)!==o)return!1;return!0}function Mt(e){const t=ut.get(e.rooms);if(t)return t;const n=e.rooms.flatMap((e,t)=>{const n=M(e);return n&&n.length>=3?[{room:e,index:t,poly:n}]:[]}),o=Object.freeze(n.map(({room:e,index:t,poly:o})=>{const i=y(o,n.filter(e=>e.index!==t).map(e=>e.poly)),a={id:e.id||`room-index-${t}`,outer:o.map(e=>[e[0],e[1]]),holes:i.map(e=>e.map(e=>[e[0],e[1]]))};return{room:e,overlayRoom:{...a,safePoint:re(a)||void 0}}}));return ut.set(e.rooms,o),o}function yt(o){const a=o.stageSize&&o.stageSize.width>0&&o.stageSize.height>0?Math.max(o.view.w/o.stageSize.width,o.view.h/o.stageSize.height):Math.max(o.view.w,o.view.h)/1e3,l=Mt(o.space),c=l.map(e=>e.overlayRoom),f=r(t,o.cellCm),d=r(i,o.cellCm),u=new Map,h=new Map,p=new Map,m=[];let g=pt.get(o.wallSilhouettes);g||(g=new Map,pt.set(o.wallSilhouettes,g));let w=mt.get(l);w||(w=new Map,mt.set(l,w));const M=o.iconPct*s(o.space)*o.kioskIconScale/100,y=o.deviceBasePct*s(o.space)*o.kioskIconScale/100,b=(r,s,l,u,h)=>{const p=`${!1===o.resolveCollisions?"fit":"live"}\0${r}\0${s}`,m=[l[0],l[1],u[0],u[1],h||"",f,d].join("|"),M=`${m}|${a}`,y=$(g,p);if(y.hit&&y.value.signature===M)return y.value.placement;if(y.hit&&y.value.shapeSignature===m&&a<=y.value.unitsPerPixel){const e=y.value.placement,t=e.nudgeDistanceCss*y.value.unitsPerPixel/a;if(!e.nearWallBefore||e.cleared&&t<=48)return e}const b=`${r}\0${s}`,S=[l[0],l[1],h||""].join("|"),x=$(w,b),v=x.hit&&x.value.signature===S?x.value.owner:se({kind:r,floorAnchor:l,rooms:c,roomsValidated:!0,preferredRoomId:h});x.hit&&x.value.signature===S||k(w,b,{signature:S,owner:v},ht);const z=function(o){const a=o.camera||e,r=o.wallHeight??t,s=o.visualOffset??i,l=o.sceneUnitsPerCssPixel??1,c=o.safetyGapCssPx??4,f=o.maxNudgeCssPx??48;if(!J(o.floorAnchor)||!J(o.footprintHalfSize)||o.footprintHalfSize[0]<0||o.footprintHalfSize[1]<0||!Number.isFinite(r)||r<0||!Number.isFinite(s)||s<0||!Number.isFinite(l)||l<=0||!Number.isFinite(c)||c<0||!Number.isFinite(f)||f<0)throw new Error("invalid isometric overlay input");const d=[o.floorAnchor[0],o.floorAnchor[1]],u=n(d,0,a),h=(p=o.kind,!o.showBorders||"device"!==p&&"room-label"!==p&&"opening-lock"!==p?"floor":"raised");var p;if("floor"===h)return{plane:h,owner:null,floorAnchor:d,floorScene:u,raisedScene:u,visualScene:u,footprint:[],nudgeScene:[0,0],nudgeCss:[0,0],nudgeDistanceCss:0,nudged:!1,nearWallBefore:!1,nearWallAfter:!1,cleared:!0,capped:!1,grounding:{center:u,visible:!1},tether:Se(u,u,!1),status:"ok",reason:null};const m=s,g=n(d,m,a),w=o.ownerAlreadyResolved?o.resolvedOwner??null:se(o),M=o.wallGeometryValidated??o.wallSilhouettes.every(Me),y=c*l,b=le(d,o.footprintHalfSize,m,a),S=e=>{const t=he(e);return!!t&&o.wallSilhouettes.some(n=>we(e,t,n,y,!0===o.wallGeometryValidated))},x=!M||S(b);let v=0,$=[0,0],k=null,z=!1,P=M?"ok":"degraded",C=M?null:"invalid-wall-geometry";if(M&&x)if(w)if(w.safePoint){const e=o.rooms.find(e=>e.id===w.id)||null,t=n(w.safePoint,m,a),i=t[0]-g[0],r=t[1]-g[1],s=Math.hypot(i,r);if(s<=K)P="degraded",C="invalid-safe-point";else{const t=i/s,n=r/s,a=Math.min(f,s/l),c=a*l/s,u=[d[0]+(w.safePoint[0]-d[0])*c,d[1]+(w.safePoint[1]-d[1])*c],h=[t*a*l,n*a*l],p=he([...b,...b.map(e=>[e[0]+h[0],e[1]+h[1]])]),m=p?o.wallSilhouettes.filter(e=>{const t=pe(e,!0===o.wallGeometryValidated);return!!t&&me(p,t,y)}):o.wallSilhouettes,g=!!e&&ye(d,u,e),M=e=>{const i=[t*e*l,n*e*l],a=b.map(e=>[e[0]+i[0],e[1]+i[1]]),r=he(a);return!!r&&m.some(e=>we(a,r,e,y,!0===o.wallGeometryValidated))},S=o.nudgeHintCss;if(Number.isFinite(S)&&S>=0&&S<=a){const t=S*l/s,n=[d[0]+(w.safePoint[0]-d[0])*t,d[1]+(w.safePoint[1]-d[1])*t];(g||e&&ye(d,n,e))&&!M(S)&&(v=S,k=!1)}if(null===k){let t=null,n=0,o=!1;const i=Math.ceil(a);for(let r=1;r<=i;r++){const i=Math.min(a,r),c=i*l/s,f=[d[0]+(w.safePoint[0]-d[0])*c,d[1]+(w.safePoint[1]-d[1])*c];if(!(g||e&&ye(d,f,e))){o=!0;break}if(!M(i)){t=i;break}n=i}if(null!==t){let e=n,o=t;for(let t=0;t<14;t++){const t=(e+o)/2;M(t)?e=t:o=t}v=o}else v=n,z=!0,P="degraded",C=o?"owner-boundary":"nudge-cap"}$=[t*v*l,n*v*l]}}else P="degraded",C="invalid-safe-point";else P="degraded",C="missing-owner";const I=[g[0]+$[0],g[1]+$[1]],T=le(d,o.footprintHalfSize,m,a,$),j=!M||(k??S(T)),H=v>K;return{plane:h,owner:w,floorAnchor:d,floorScene:u,raisedScene:g,visualScene:I,footprint:T,nudgeScene:$,nudgeCss:[$[0]/l,$[1]/l],nudgeDistanceCss:v,nudged:H,nearWallBefore:x,nearWallAfter:j,cleared:!j,capped:z,grounding:{center:u,visible:!1},tether:Se(u,I,!1),status:P,reason:C}}({kind:r,floorAnchor:l,rooms:c,roomsValidated:!0,preferredRoomId:h,ownerAlreadyResolved:!0,resolvedOwner:v,nudgeHintCss:y.hit&&y.value.shapeSignature===m?y.value.placement.nudgeDistanceCss*y.value.unitsPerPixel/a:void 0,showBorders:!0,wallSilhouettes:!1===o.resolveCollisions?[]:o.wallSilhouettes,wallGeometryValidated:!0,footprintHalfSize:u,wallHeight:f,visualOffset:d,sceneUnitsPerCssPixel:a});return k(g,p,{signature:M,shapeSignature:m,unitsPerPixel:a,placement:z},ht),z};for(const e of o.devices){const t=o.positionOf(e),n=o.presentationOf(e,o.showLqi),i=y*n.scale,a=Xe({kind:"device",core:i,presentation:n}),r=e.marker?.room_id||l.find(t=>!!e.area&&t.room.area===e.area)?.overlayRoom.id||null,s=b("device",e.id,[t.x,t.y],a,r);u.set(e.id,s),m.push({id:e.id,kind:"device",placement:s,groundRadius:Math.max(.32*i,2),screenHalfSize:a})}for(const{room:e,overlayRoom:t}of l){if(!o.display.showNames||!e.name)continue;const n=o.labelPositionOf(e,o.space.id),i=.5*M*(o.labelScaleOf(e)*o.kioskFontScale*o.display.cardFontScale),a=Xe({kind:"room-label",font:i,room:e,display:o.display}),r=b("room-label",t.id,[n.x,n.y],a,t.id);h.set(e,r),m.push({id:t.id,kind:"room-label",placement:r,groundRadius:Math.max(.75*i,2),screenHalfSize:a})}const S=o.openings.filter(e=>!e.orphanReason&&("door"===e.type||"gate"===e.type)&&"string"==typeof e.lock&&!!e.lock&&o.openingEntityAvailable(e.lock));if(S.length){const e=o.openingWallIndex();for(const t of S){const n=St(t,e,o.cellCm),i=n.floorAnchor,a=.62*M,r=Xe({kind:"opening-lock",size:a}),s=b("opening-lock",String(t.id),i,r,n.preferredRoomId);p.set(String(t.id),s),m.push({id:String(t.id),kind:"opening-lock",placement:s,groundRadius:Math.max(.28*a,2),screenHalfSize:r})}}const x=!1===o.resolveCollisions?"fit":"live";let v=gt.get(o.wallSilhouettes);v||(v=new Map,gt.set(o.wallSilhouettes,v));const z=v.get(x),P=m.map(e=>{const t=e.placement;return[e.kind,e.id,t.floorAnchor[0],t.floorAnchor[1],t.raisedScene[0],t.raisedScene[1],t.nudgeScene[0],t.nudgeScene[1],t.owner?.id||"",t.status,t.reason||"",e.screenHalfSize[0],e.screenHalfSize[1],a].join("|")}).sort().join("");if(z?.collisionSignature===P&&wt(z.rooms,h))return z;const C=new Map(z?.entries.map(e=>[`${e.kind}\0${e.id}`,e])||[]),I="live"===x?We({items:m.flatMap(e=>{if("room-label"===e.kind)return[];const t=C.get(`${e.kind}\0${e.id}`),n=!!t&&t.screenHalfSize[0]===e.screenHalfSize[0]&&t.screenHalfSize[1]===e.screenHalfSize[1]&&t.placement.floorAnchor[0]===e.placement.floorAnchor[0]&&t.placement.floorAnchor[1]===e.placement.floorAnchor[1]&&(t.placement.owner?.id||"")===(e.placement.owner?.id||"");return[{id:e.id,kind:e.kind,placement:e.placement,screenHalfSize:e.screenHalfSize,...n?{nudgeHintCss:[t.placement.nudgeScene[0]/a,t.placement.nudgeScene[1]/a]}:{}}]}),rooms:c,wallSilhouettes:o.wallSilhouettes,sceneUnitsPerCssPixel:a,visualOffset:d}):{placements:new Map,residualPairs:[]},T=Object.freeze(m.map(e=>{if("room-label"===e.kind)return e;const t=I.placements.get(Z(e.kind,e.id))||e.placement;return t===e.placement?e:{...e,placement:t}})),j=new Map,H=new Map;for(const e of T)"device"===e.kind?j.set(e.id,e.placement):"opening-lock"===e.kind&&H.set(e.id,e.placement);const O={devices:j,rooms:h,locks:H,entries:T,collisionSignature:P,residualPairs:Object.freeze([...I.residualPairs])};return z&&function(e,t){return e.length===t.length&&t.every((t,n)=>{const o=e[n];return o.id===t.id&&o.kind===t.kind&&o.placement===t.placement&&o.groundRadius===t.groundRadius&&o.screenHalfSize[0]===t.screenHalfSize[0]&&o.screenHalfSize[1]===t.screenHalfSize[1]})}(z.entries,O.entries)&&wt(z.devices,O.devices)&&wt(z.rooms,O.rooms)&&wt(z.locks,O.locks)?z:(v.set(x,O),O)}function bt(e,t,n){return St(e,t,n).floorAnchor}function St(e,t,n){const o=!e.flip_v,i="gate"===e.type?e.partitionHost?m(e.partitionHost,o):p(t,{x:e.rx,y:e.ry,angle:e.angle,length:e.rlen,flip_v:o}):null,[a,r]=g({x:e.rx,y:e.ry,angle:e.angle,flipV:!!e.flip_v,gateFace:i},n);if(e.partitionHost)return{floorAnchor:a,preferredRoomId:null};const s=w(t,{x:e.rx,y:e.ry,angle:e.angle,length:e.rlen},!0),l=r?"negative":"positive";return{floorAnchor:a,preferredRoomId:s[l]?.roomId||null}}function xt(e){let t=!1;try{t="undefined"!=typeof CSS&&"function"==typeof CSS.supports&&CSS.supports("filter","blur(1px)")}catch{t=!1}let n=!1;try{n="function"==typeof matchMedia&&matchMedia("(forced-colors: active)").matches}catch{n=!0}return function(e){const t=!!e.showBorders;return{structural:t,panels:t&&!e.hideOpenings,shadows:t&&e.filtersSupported&&!e.forcedColors,materialNuance:t&&e.filtersSupported&&!e.forcedColors,floorSymbols:!e.hideOpenings&&!t}}({showBorders:e.showBorders,hideOpenings:e.hideOpenings,filtersSupported:t,forcedColors:n})}function vt(e,t,n,o){if(!e.panels||!t)return[];return t.openings.flatMap(e=>{const t=n[e.sourceIndex];return t?U(e,o(t)):[]}).sort((e,t)=>e.depth-t.depth||e.sourceIndex-t.sourceIndex||e.leaf-t.leaf)}function $t(e){const t=xt(e.display),n=t.panels?vt(t,e.scene,e.openings,e.amountOf):[],o=e.overlays(t),i=t=>({layers:t,panels:n,overlays:o,underlay:Tt(t,e.scene?.floor,e.cellCm),shadows:jt(t,n,e.scene?.geometry,e.cellCm),walls:Ht(e.projection,t,e.scene,n,e.cellCm),grounds:Ct(o,t,e.cellCm),raised:It()});try{return i(t)}catch(e){if(!t.shadows&&!t.materialNuance)throw e;return i({...t,shadows:!1,materialNuance:!1})}}const kt=()=>v``;function zt(e){return`translate(${r(4,e)} ${r(8,e)})`}function Pt(e,t,n){const o=C(n);return v`<defs>
|
|
${"walls"===t&&e.materialNuance?v`
|
|
<linearGradient id="hp-iso-wall-side" data-hp-iso-material-def x1="0" y1="0" x2="0" y2="1">
|
|
<stop offset="0" class="iso-side-hi"></stop><stop offset="1" class="iso-side-lo"></stop>
|
|
</linearGradient>
|
|
<linearGradient id="hp-iso-wall-top" data-hp-iso-material-def x1="0" y1="0" x2="1" y2="1">
|
|
<stop offset="0" class="iso-top-hi"></stop><stop offset="1" class="iso-top-lo"></stop>
|
|
</linearGradient>
|
|
<pattern id="hp-iso-wall-texture" data-hp-iso-material-def patternUnits="userSpaceOnUse"
|
|
width="${12*o}" height="${12*o}">
|
|
<circle class="iso-texture-mark" cx="${2*o}" cy="${2*o}"
|
|
r="${.55*o}"></circle>
|
|
<path class="iso-texture-line" d="M ${5*o} ${10*o}
|
|
l ${5*o} ${-5*o}"></path>
|
|
</pattern>`:x}
|
|
${"underlay"===t&&e.materialNuance?v`
|
|
<pattern id="hp-iso-floor-texture" data-hp-iso-material-def patternUnits="userSpaceOnUse"
|
|
width="${14*o}" height="${14*o}">
|
|
<circle class="iso-texture-mark" cx="${3*o}" cy="${3*o}"
|
|
r="${.5*o}"></circle>
|
|
</pattern>`:x}
|
|
${"underlay"===t&&e.shadows?v`
|
|
<filter id="hp-iso-ambient-shadow" data-hp-iso-material-def x="-12%" y="-12%" width="124%" height="130%">
|
|
<feGaussianBlur stdDeviation="${7*o}"></feGaussianBlur>
|
|
</filter>`:x}
|
|
</defs>`}function Ct(e,t,n){return kt()}function It(e){return kt()}function Tt(e,t,n){return e.structural&&t?v`<g class="iso-underlay" data-hp="iso-underlay" aria-hidden="true" pointer-events="none">
|
|
${Pt(e,"underlay",n)}
|
|
${e.shadows&&t.footprintPath?v`<path class="iso-ambient-shadow" d=${t.footprintPath}
|
|
transform=${zt(n)}></path>`:x}
|
|
<g class="iso-floor-edge">${t.sides.map(t=>v`<path class="iso-floor-side" d=${t.d} data-component=${t.component}
|
|
data-edge=${t.edge}></path>${e.materialNuance?v`<path class="iso-material-texture iso-floor-texture" d=${t.d}></path>`:x}`)}</g>
|
|
</g>`:kt()}function jt(e,t,n,o){return kt()}function Ht(e,t,n,o,i){if("iso"!==e||!t.structural||!n)return kt();const a=t.panels?[...n.openingSurfaces,...o.flatMap(e=>e.surfaces.map(t=>({...t,id:e.id,sourceIndex:e.sourceIndex,type:e.type,leaf:e.leaf})))]:[],r=Ue(n.geometry,a);return v`<g class="iso-walls" data-hp="iso-walls" data-fingerprint=${n.key}>
|
|
${Pt(t,"walls",i)}
|
|
<g class=${t.panels?"iso-wall-depth-queue iso-openings":"iso-wall-depth-queue"}
|
|
data-hp=${t.panels?"iso-openings":x}
|
|
aria-hidden="true" pointer-events="none">${r.map(e=>{if("wall-side"===e.layer){const n=e.face;return v`<path class="iso-wall-side" d=${n.d} data-edge=${n.edge}></path>${t.materialNuance?v`<path class="iso-material-texture iso-wall-texture" d=${n.d}></path>`:x}`}if("wall-top"===e.layer){const n=e.face;return v`<path class="iso-wall-top" d=${n.d} data-component=${n.component}
|
|
fill-rule="evenodd"></path>${t.materialNuance?v`<path class="iso-material-texture iso-wall-texture" d=${n.d}
|
|
fill-rule="evenodd"></path>`:x}`}const n=e.surface;return v`<path class="iso-opening-panel iso-${n.type} iso-opening-${n.kind} iso-material-${n.material}"
|
|
d=${n.d} data-id=${n.id} data-kind=${n.type}
|
|
data-surface=${n.kind} data-leaf=${n.leaf??x}></path>${t.materialNuance?v`<path class="iso-material-texture iso-wall-texture iso-opening-texture"
|
|
d=${n.d}></path>`:x}`})}</g>
|
|
</g>`}export{ht as ISO_OVERLAY_PLACEMENT_CACHE_LIMIT,Ke as ISO_RAISED_FOOTPRINT,Ee as ISO_SCENE_RUNTIME_FINGERPRINT,yt as buildIsoOverlayRenderScene,Ue as buildIsoWallDepthQueue,nt as createIsoStructuralSource,zt as isoFixedLightTransform,bt as isoOpeningLockAnchor,St as isoOpeningLockPlacement,Mt as isoOverlayRooms,ft as isoOverlaySceneBounds,Xe as isoRaisedOverlayHalfSize,Ye as isoSourceOpenings,tt as isoStructuralOpeningHost,et as isoStructuralRoomGeometry,it as isoWallSilhouettesOf,Ct as renderIsoOverlayGrounds,It as renderIsoRaisedOverlays,jt as renderIsoShadows,Tt as renderIsoUnderlay,Ht as renderIsoWalls,xt as resolveIsoDecorationLayers,$t as resolveIsoFramePresentation,vt as resolveIsoOpeningPanels,dt as resolveIsoOverlayFitEnvelope,at as resolveIsoScene};
|