@seatlayer/core 0.99.0 → 0.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-COOPHSHM.js +1 -0
- package/dist/core/inventory/index.d.cts +2 -2
- package/dist/core/inventory/index.d.ts +2 -2
- package/dist/core/layout/index.d.cts +2 -2
- package/dist/core/layout/index.d.ts +2 -2
- package/dist/core/quality/index.d.cts +2 -2
- package/dist/core/quality/index.d.ts +2 -2
- package/dist/core/sections/index.d.cts +1 -1
- package/dist/core/sections/index.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +11 -6
- package/dist/index.d.ts +11 -6
- package/dist/index.js +1 -1
- package/dist/{renderedQuality-Bl1Kq_XO.d.cts → renderedQuality-BZycehrC.d.cts} +1 -1
- package/dist/{renderedQuality-BMSbVkwu.d.ts → renderedQuality-DPElQ3-x.d.ts} +1 -1
- package/dist/{renderer-njHDbIqI.d.ts → renderer-DPKIlnuF.d.ts} +9 -0
- package/dist/{renderer-Ccv8ZDZS.d.cts → renderer-DnsIDiWN.d.cts} +9 -0
- package/dist/{tableSizing-BLtQ-KV0.d.ts → tableSizing-0PwrOWi5.d.ts} +1 -1
- package/dist/{tableSizing-CB8g2Fs0.d.cts → tableSizing-x8ADFtKS.d.cts} +1 -1
- package/dist/{ticketRestrictions-DUjN2bZn.d.ts → ticketRestrictions-C8H-XJha.d.ts} +1 -1
- package/dist/{ticketRestrictions-BvlWLw10.d.cts → ticketRestrictions-O-fv0Os6.d.cts} +1 -1
- package/dist/view3d/index.cjs +79 -47
- package/dist/view3d/index.d.cts +16 -2
- package/dist/view3d/index.d.ts +16 -2
- package/dist/view3d/index.js +77 -45
- package/dist/view3d/scene/scene.worker.cjs +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-K22SISYC.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ke,c as Fe,d as Le}from"./chunk-L34T3APU.js";import{a as Te}from"./chunk-QJXSZT3H.js";import{v as ve}from"./chunk-VWT44HBR.js";import{a as Oe,c as zt,d as dt,f as pt,i as Ce}from"./chunk-D723OZEY.js";import{h as pn}from"./chunk-HYEZPOZU.js";import{e as Ee,l as Be}from"./chunk-4N5CHKHD.js";import{B as Pe,C as nn,Ma as wt,Va as Mn,ba as q,ca as Mt,j as Me,la as xn,na as Wt,oa as bn,qa as Se,sa as Yt,ta as gn,ua as Ie,wa as Hn,xa as Re,ya as _e}from"./chunk-UISTXRO5.js";import{A as St,D as we,b as Ae,d as ot,y as et}from"./chunk-JBOTRSMY.js";import Hr from"earcut";import Ne from"polygon-clipping";var S=q,Xr=.002;function jr(t,n,e){let r=Math.hypot(n[0]-t[0],n[1]-t[1],n[2]-t[2]),o=Math.hypot(e[0]-n[0],e[1]-n[1],e[2]-n[2]),a=Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2]),i=Math.max(r,o,a);if(i<1e-9)return!0;let s=(r+o+a)/2;return 2*Math.sqrt(Math.max(0,s*(s-r)*(s-o)*(s-a)))/i<Xr}var Ht=class{constructor(n=16384){this.len=0;this.buf=new Float32Array(n)}push3(n,e,r){this.len+3>this.buf.length&&this.grow(this.len+3),this.buf[this.len++]=n,this.buf[this.len++]=e,this.buf[this.len++]=r}push1(n){this.len+1>this.buf.length&&this.grow(this.len+1),this.buf[this.len++]=n}grow(n){let e=this.buf.length*2;for(;e<n;)e*=2;let r=new Float32Array(e);r.set(this.buf.subarray(0,this.len)),this.buf=r}get length(){return this.len}toArray(){return this.buf.slice(0,this.len)}},In=class{constructor(){this.pos=new Ht;this.nor=new Ht;this.col=new Ht;this.flr=new Ht;this.mat=new Ht;this.currentFloor=0;this.currentMaterial=0}setFloor(n){this.currentFloor=n}setMaterial(n){this.currentMaterial=n}tri(n,e,r,o,a,i=a,s=a){jr(n,e,r)||(this.pos.push3(n[0],n[1],n[2]),this.pos.push3(e[0],e[1],e[2]),this.pos.push3(r[0],r[1],r[2]),this.nor.push3(o[0],o[1],o[2]),this.nor.push3(o[0],o[1],o[2]),this.nor.push3(o[0],o[1],o[2]),this.col.push3(a[0],a[1],a[2]),this.col.push3(i[0],i[1],i[2]),this.col.push3(s[0],s[1],s[2]),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial))}triN(n,e,r,o,a,i,s,l=s,u=s){[...n,...e,...r].every(Number.isFinite)&&(this.pos.push3(n[0],n[1],n[2]),this.pos.push3(e[0],e[1],e[2]),this.pos.push3(r[0],r[1],r[2]),this.nor.push3(o[0],o[1],o[2]),this.nor.push3(a[0],a[1],a[2]),this.nor.push3(i[0],i[1],i[2]),this.col.push3(s[0],s[1],s[2]),this.col.push3(l[0],l[1],l[2]),this.col.push3(u[0],u[1],u[2]),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial))}get vertexCount(){return this.pos.length/3}build(){return{position:this.pos.toArray(),normal:this.nor.toArray(),color:this.col.toArray(),floor:this.flr.toArray(),material:this.mat.toArray(),count:this.pos.length/3}}};function Ur(t,n,e){let r=n[0]-t[0],o=n[1]-t[1],a=n[2]-t[2],i=e[0]-t[0],s=e[1]-t[1],l=e[2]-t[2],u=o*l-a*s,c=a*i-r*l,f=r*s-o*i,m=Math.hypot(u,c,f)||1;return u/=m,c/=m,f/=m,[u,c,f]}function Wr(t,n){let e=[...t],r=[];for(let i of t)r.push(i.x,i.y);let o=[];if(n){for(let i of n)if(!(i.length<3)){o.push(e.length);for(let s of i)e.push(s),r.push(s.x,s.y)}}let a=Hr(r,o.length?o:void 0,2);return{pts:e,tris:a}}function Et(t){return dt(t)<0?[...t].reverse():t}var Yr=3;function zr(t,n,e,r){let o=r(t),a=r(n),i=r(e),s=(d,y,h,x)=>Math.abs(r({x:(d.x+y.x)/2,y:(d.y+y.y)/2})-(h+x)/2),l=(t.x+n.x+e.x)/3,u=(t.y+n.y+e.y)/3,c=(o+a+i)/3,f=Math.max(s(t,n,o,a),s(n,e,a,i),s(e,t,i,o),Math.abs(r({x:l,y:u})-c)),m=(d,y,h)=>{let x=Math.abs(r({x:(d+l)/2,y:(y+u)/2})-(h+c)/2);x>f&&(f=x)};return m((t.x+n.x)/2,(t.y+n.y)/2,(o+a)/2),m((n.x+e.x)/2,(n.y+e.y)/2,(a+i)/2),m((e.x+t.x)/2,(e.y+t.y)/2,(i+o)/2),f}function en(t,n,e,r,o){if(o<=0)return zr(t,n,e,r);let a={x:(t.x+n.x)/2,y:(t.y+n.y)/2},i={x:(n.x+e.x)/2,y:(n.y+e.y)/2},s={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return Math.max(en(t,a,s,r,o-1),en(a,n,i,r,o-1),en(s,i,e,r,o-1),en(a,i,s,r,o-1))}function on(t,n,e,r,o,a,i,s){if(i>0){let m={x:(n.x+e.x)/2,y:(n.y+e.y)/2},d={x:(e.x+r.x)/2,y:(e.y+r.y)/2},y={x:(r.x+n.x)/2,y:(r.y+n.y)/2};on(t,n,m,y,o,a,i-1,s),on(t,m,e,d,o,a,i-1,s),on(t,y,d,r,o,a,i-1,s),on(t,m,d,y,o,a,i-1,s);return}let l=[n.x*S,o(n),n.y*S],u=[e.x*S,o(e),e.y*S],c=[r.x*S,o(r),r.y*S];if(s){t.triN(l,u,c,s(n),s(e),s(r),a);return}let f=Ur(l,u,c);f[1]<0&&(f=[-f[0],-f[1],-f[2]]),t.tri(l,u,c,f,a)}var Kr=8;function De(t,n,e){if(!Number.isFinite(e))return t;let r=[],o=(a,i,s,l,u)=>{if(u>0){let c={x:(a.x+i.x)/2,y:(a.y+i.y)/2},f=n(c);if(Math.abs(f-(s+l)/2)>e){o(a,c,s,f,u-1),o(c,i,f,l,u-1);return}}r.push(a)};for(let a=0;a<t.length;a++){let i=t[a],s=t[(a+1)%t.length];o(i,s,n(i),n(s),Kr)}return r}function Pn(t,n){if(t.length<3)return t;let e=[];for(let o of t){let a=e[e.length-1];a&&Math.hypot(o.x-a.x,o.y-a.y)<n||e.push(o)}for(;e.length>2&&Math.hypot(e[0].x-e[e.length-1].x,e[0].y-e[e.length-1].y)<n;)e.pop();if(e.length<3)return t;let r=[];for(let o=0;o<e.length;o++){let a=r.length?r[r.length-1]:e[(o-1+e.length)%e.length],i=e[o],s=e[(o+1)%e.length],l=s.x-a.x,u=s.y-a.y,c=Math.hypot(l,u);c>n&&Math.abs((i.x-a.x)*u-(i.y-a.y)*l)/c<n||r.push(i)}return r.length>=3?r:e}var Sn=.001*Mt*.1;function V(t,n,e,r,o,a,i,s,l=1/0,u){if(!n||n.length<3||(l===void 0&&(l=1/0),Math.abs(dt(n))<1e-4))return;let c=Pn(De(Pn(Et(n),Sn),r,l),Sn),f=e?.map(p=>Pn(De(Pn(Et(p),Sn),r,l),Sn)).filter(p=>p.length>=3&&Math.abs(dt(p))>=1e-4),{pts:m,tris:d}=Wr(c,f),y=[a[0]*s.top,a[1]*s.top,a[2]*s.top],h=[a[0]*s.bottomCap,a[1]*s.bottomCap,a[2]*s.bottomCap],x=[i[0]*s.top,i[1]*s.top,i[2]*s.top],g=[i[0]*s.wallBottom,i[1]*s.wallBottom,i[2]*s.wallBottom],b=0;if(Number.isFinite(l))for(;b<Yr;b++){let p=0;for(let _=0;_<d.length;_+=3){let M=en(m[d[_]],m[d[_+1]],m[d[_+2]],r,b);M>p&&(p=M)}if(p<=l)break}for(let p=0;p<d.length;p+=3){let _=m[d[p]],M=m[d[p+1]],R=m[d[p+2]];on(t,_,M,R,r,y,b,u);let E=[_.x*S,o,_.y*S],C=[M.x*S,o,M.y*S],v=[R.x*S,o,R.y*S];t.tri(E,v,C,[0,-1,0],h)}let I=p=>{if(b<=0)return p;let _=1<<b,M=[];for(let R=0;R<p.length;R++){let E=p[R],C=p[(R+1)%p.length];for(let v=0;v<_;v++){let k=v/_;M.push({x:E.x+(C.x-E.x)*k,y:E.y+(C.y-E.y)*k})}}return M},w=Pe(c),P=[{ring:I(c),flip:!1}];if(f)for(let p of f)p.length>=3&&P.push({ring:I(p),flip:!0});for(let{ring:p,flip:_}of P)for(let M=0;M<p.length;M++){let R=p[M],E=p[(M+1)%p.length],C=(E.x-R.x)*S,k=(E.y-R.y)*S,A=-C,B=Math.hypot(k,A)||1;k/=B,A/=B;let T=(R.x+E.x)/2-w.x,F=(R.y+E.y)/2-w.y,O=k*T+A*F;_&&(O=-O),O<0&&(k=-k,A=-A);let L=[k,0,A],D=[R.x*S,r(R),R.y*S],G=[E.x*S,r(E),E.y*S],j=[R.x*S,o,R.y*S],U=[E.x*S,o,E.y*S];t.tri(D,G,U,L,x,x,g),t.tri(D,U,j,L,x,g,g)}}function Ge(t){let n=0;for(let l of t)n+=l.count;let e=new Float32Array(n*3),r=new Float32Array(n*3),o=new Float32Array(n*3),a=new Float32Array(n),i=new Float32Array(n),s=0;for(let l of t)e.set(l.position,s*3),r.set(l.normal,s*3),o.set(l.color,s*3),a.set(l.floor,s),i.set(l.material,s),s+=l.count;return{position:e,normal:r,color:o,floor:a,material:i,count:n}}function It(t,n,e=2.5){if(n<=0||t.length<3)return t;let r=Et(t),o=r.length,a=[];for(let s=0;s<o;s++){let l=r[s],u=r[(s+1)%o],c=u.x-l.x,f=u.y-l.y,m=Math.hypot(c,f)||1;a.push({x:f/m,y:-c/m})}let i=[];for(let s=0;s<o;s++){let l=r[s],u=a[(s-1+o)%o],c=a[s],f=u.x+c.x,m=u.y+c.y,d=Math.hypot(f,m),y=()=>{i.push([l.x+u.x*n,l.y+u.y*n]),i.push([l.x+c.x*n,l.y+c.y*n])};if(d<1e-9){y();continue}f/=d,m/=d;let h=f*u.x+m*u.y,x=1/Math.max(h,1e-6);if(!Number.isFinite(x)||x>e){y();continue}i.push([l.x+f*n*x,l.y+m*n*x])}if(i.length<3)return t;try{let s=Ne.union([[...i,i[0]]]),l=null,u=-1/0;for(let f of s){let m=Math.abs(dt(f[0].map(([d,y])=>({x:d,y}))));m>u&&(u=m,l=f[0])}if(!l)return t;let c=l.map(([f,m])=>({x:f,y:m}));if(c.length>1){let f=c[0],m=c[c.length-1];Math.abs(f.x-m.x)<1e-9&&Math.abs(f.y-m.y)<1e-9&&c.pop()}return c.length>=3?c:t}catch{return t}}function Lt(t,n,e=2.5){if(t.length<3)return[];if(n<=0)return t;let r=Et(t),o=r.length,a=[];for(let l=0;l<o;l++){let u=r[l],c=r[(l+1)%o],f=Math.hypot(c.x-u.x,c.y-u.y)||1;a.push({x:-(c.y-u.y)/f,y:(c.x-u.x)/f})}let i=[],s=[];for(let l=0;l<o;l++){let u=r[l],c=a[(l-1+o)%o],f=a[l],m=c.x+f.x,d=c.y+f.y,y=Math.hypot(m,d),h=y<1e-9?1/0:1/Math.max(m/y*c.x+d/y*c.y,1e-6);if(!Number.isFinite(h)||h>e){i.push({x:u.x+c.x*n,y:u.y+c.y*n},{x:u.x+f.x*n,y:u.y+f.y*n}),s.push(l,l);continue}m/=y,d/=y,i.push({x:u.x+m*n*h,y:u.y+d*n*h}),s.push(l)}for(let l=0;l<i.length;l++){let u=(l+1)%i.length,c=s[l],f=s[u];if(f!==(c+1)%o)continue;let m=r[c],d=r[f];if((i[u].x-i[l].x)*(d.x-m.x)+(i[u].y-i[l].y)*(d.y-m.y)<=0)return[]}try{let l=Ne.intersection([[...i.map(y=>[y.x,y.y]),[i[0].x,i[0].y]]],[[...r.map(y=>[y.x,y.y]),[r[0].x,r[0].y]]]),u=null,c=0;for(let y of l){let h=Math.abs(dt(y[0].map(([x,g])=>({x,y:g}))));h>c&&(c=h,u=y[0])}if(!u)return[];let f=u.map(([y,h])=>({x:y,y:h})),m=f[0],d=f[f.length-1];return f.length>1&&Math.abs(m.x-d.x)<1e-9&&Math.abs(m.y-d.y)<1e-9&&f.pop(),f.length>=3?Et(f):[]}catch{return[]}}function Rn(t,n,e,r,o=28){let a=[];for(let i=0;i<o;i++){let s=i/o*Math.PI*2;a.push({x:t+e*Math.cos(s),y:n+r*Math.sin(s)})}return a}function rn(t,n,e,r){return[{x:t,y:n},{x:t+e,y:n},{x:t+e,y:n+r},{x:t,y:n+r}]}var sn=["available","held","sold","selected","dimmed"];function Xn(t){let n=sn.indexOf(t);return n<0?0:n}var He={available:[.24,.82,.52],held:[.34,.39,.45],sold:[.34,.39,.45],selected:[.24,.74,1],dimmed:[.28,.32,.37]};function Qc(t){let n=.2126*t[0]+.7152*t[1]+.0722*t[2],e=.78,r=.86;return[(n+(t[0]-n)*e)*r,(n+(t[1]-n)*e)*r,(n+(t[2]-n)*e)*r]}var jn={ground:[.07,.085,.11],tierTop:[.24,.28,.34],tierWall:[.17,.2,.25],stageTop:[.94,.7,.38],stageWall:[.48,.33,.18],decorTop:[.22,.25,.29],decorWall:[.15,.17,.2],gaTop:[.24,.28,.33],gaWall:[.16,.19,.23],boothTop:[.3,.33,.38],boothWall:[.2,.23,.27],tableTop:[.38,.34,.29],tableWall:[.24,.21,.18]},Un={top:[.05,.06,.08],bottom:[.1,.12,.15]};function Z(t,n){return[Math.min(1,t[0]*n),Math.min(1,t[1]*n),Math.min(1,t[2]*n)]}var lt={pedestal:0,pad:1,back:2,arm:3,footrest:4,leg:5,body:10,head:11},Vr=.44,Zr=.15,qr=.3,$r=.24;function je(t){return t===void 0||!Number.isFinite(t)||t<=0?$r:Math.min(qr,Math.max(Zr,t*Vr))}var tl=.21,Qr=.05,Wn=.45,Jr=Wn+Qr,ti=.92,Xe=.66,ni=1.205,ei=-.23,oi=.38,ri=[{part:lt.pedestal,min:[-.3,0,-.3],max:[.3,.36,.3]},{part:lt.pad,min:[-1,.36,-.95],max:[1,Wn,1]},{part:lt.back,min:[-1,Jr,-1],max:[1,ti,-.72]},{part:lt.arm,min:[-1,.44,-.82],max:[-.78,.65,.78]},{part:lt.arm,min:[.78,.44,-.82],max:[1,.65,.78]},{part:lt.footrest,min:[-.9,.18,.78],max:[.9,.31,1.34]},{part:lt.leg,min:[-.82,0,-.7],max:[-.62,.37,-.48]},{part:lt.leg,min:[.62,0,-.7],max:[.82,.37,-.48]},{part:lt.leg,min:[-.82,0,.48],max:[-.62,.37,.7]},{part:lt.leg,min:[.62,0,.48],max:[.82,.37,.7]}],ii=[{part:lt.body,min:[-.52,.39,-.08],max:[-.08,.55,.82]},{part:lt.body,min:[.08,.39,-.08],max:[.52,.55,.82]},{part:lt.body,min:[-.47,.05,.58],max:[-.13,.43,.82]},{part:lt.body,min:[.13,.05,.58],max:[.47,.43,.82]},{part:lt.head,min:[-.16,1.04,-.33],max:[.16,1.1,-.13]}],si=[{n:[1,0,0],c:[[1,0,0],[1,1,0],[1,1,1],[1,0,1]]},{n:[-1,0,0],c:[[0,0,1],[0,1,1],[0,1,0],[0,0,0]]},{n:[0,1,0],c:[[0,1,0],[0,1,1],[1,1,1],[1,1,0]]},{n:[0,-1,0],c:[[0,0,1],[0,0,0],[1,0,0],[1,0,1]]},{n:[0,0,1],c:[[0,0,1],[1,0,1],[1,1,1],[0,1,1]]},{n:[0,0,-1],c:[[1,0,0],[0,0,0],[0,1,0],[1,1,0]]}];function nl(){let t=[],n=[],e=[],r=[],o=(T,F,O)=>{let L=e.length,[D,G,j]=T,U=[G[0]-D[0],G[1]-D[1],G[2]-D[2]],X=[j[0]-D[0],j[1]-D[1],j[2]-D[2]],W=U[1]*X[2]-U[2]*X[1],$=U[2]*X[0]-U[0]*X[2],tt=U[0]*X[1]-U[1]*X[0],Q=Math.hypot(W,$,tt);Q>1e-9?(W/=Q,$/=Q,tt/=Q):[W,$,tt]=F,W*F[0]+$*F[1]+tt*F[2]<0&&(W=-W,$=-$,tt=-tt);for(let st of T)t.push(...st),n.push(W,$,tt),e.push(O);r.push(L,L+1,L+2,L,L+2,L+3)},a=T=>{for(let F of si){let O=F.c.map(L=>L.map((D,G)=>D?T.max[G]:T.min[G]));o(O,F.n,T.part)}},i=(T,F)=>{let[O,L,D]=F?[0,1,2]:[0,2,1],G=T.min[O],j=T.max[O],U=T.min[L],X=T.max[L],W=(j-G)*.1,$=(X-U)*.1,tt=F?[[G+W,U],[j-W,U],[j,U+$],[j*.94,X-(X-U)*.23],[j*Xe,X],[G*Xe,X],[G*.94,X-(X-U)*.23],[G,U+$]]:[[G+W,U],[j-W,U],[j,U+$],[j,X-$],[j-W,X],[G+W,X],[G,X-$],[G,U+$]],Q=(nt,N,H)=>{let K=[0,0,0];return K[O]=nt,K[L]=N,K[D]=H,K},st=[T.min[D],T.max[D]].map(nt=>tt.map(([N,H])=>Q(N,H,nt)));for(let nt=0;nt<tt.length;nt++){let N=(nt+1)%tt.length,H=[0,0,0];H[O]=(tt[nt][0]+tt[N][0])/2-(G+j)/2,H[L]=(tt[nt][1]+tt[N][1])/2-(U+X)/2,o([st[0][nt],st[0][N],st[1][N],st[1][nt]],H,T.part)}for(let nt=0;nt<2;nt++){let N=[0,0,0];N[D]=nt?1:-1;let H=st[nt];for(let K=1;K<H.length-1;K++){let at=e.length;for(let ft of[H[0],H[K],H[K+1]])t.push(...ft),n.push(...N),e.push(T.part);r.push(at,at+1,at+2)}}};for(let T of ri)T.part===lt.pad||T.part===lt.back?i(T,T.part===lt.back):a(T);for(let T of ii)a(T);let s=Wn,l=1.08,u=.47,c=.69,f=-.55,m=.08,d=-.48,y=.01,h=[-u,s,f],x=[u,s,f],g=[-u,s,m],b=[u,s,m],I=[-c,l,d],w=[c,l,d],P=[-c,l,y],p=[c,l,y];o([x,w,p,b],[1,0,0],lt.body),o([g,P,I,h],[-1,0,0],lt.body),o([P,p,w,I],[0,1,0],lt.body),o([h,x,b,g],[0,-1,0],lt.body),o([b,p,P,g],[0,0,1],lt.body),o([h,I,w,x],[0,0,-1],lt.body);let _=10,M=8,R=[0,ni,ei],E=[.42,.115,oi],C=e.length;for(let T=0;T<=M;T++){let F=Math.PI*T/M,O=Math.cos(F),L=Math.sin(F);for(let D=0;D<=_;D++){let G=Math.PI*2*D/_,j=L*Math.cos(G),U=L*Math.sin(G);t.push(R[0]+E[0]*j,R[1]+E[1]*O,R[2]+E[2]*U);let X=j/E[0],W=O/E[1],$=U/E[2],tt=Math.hypot(X,W,$)||1;X/=tt,W/=tt,$/=tt,n.push(X,W,$),e.push(lt.head)}}for(let T=0;T<M;T++)for(let F=0;F<_;F++){let O=C+T*(_+1)+F,L=O+_+1;r.push(O,L,O+1,O+1,L,L+1)}let v=new Float32Array(t),k=new Float32Array(n),A=new Float32Array(e),B=new Uint16Array(r);return{position:v,normal:k,part:A,index:B,vertexCount:e.length,indexCount:r.length}}function Ue(t,n,e,r){let o=new Float32Array(n),a=u=>t[u*3],i=u=>t[u*3+2],s=0,l=(u,c)=>{let f=c-u;for(let m=u;m<c;m++){let[d,y]=r(m),h=d-a(m),x=y-i(m);if(f>=2){let g=Math.max(u,m-1),b=Math.min(c-1,m+1),I=a(b)-a(g),w=i(b)-i(g),P=Math.hypot(I,w);if(P>1e-6){let p=-w/P,_=I/P;p*h+_*x<0&&(p=-p,_=-_),h=p,x=_}}o[m]=h===0&&x===0?0:Math.atan2(h,x)}};for(let u=1;u<=n;u++)(u===n||e(u)!==e(s))&&(l(s,u),s=u);return o}var _n=.22;function ul(t,n){let e=sn[t];if(e!=="sold"&&e!=="held")return-1;let r=(n+1)*2654435761;return r^=r>>>15,r=Math.imul(r,2246822519),r^=r>>>13,(r>>>0)%1e5/1e5}var ai=.42;function ci(t){let n=t.length,e=new Float64Array(n);if(n<2)return e.fill(1/0),e;let r=1/0,o=1/0,a=-1/0,i=-1/0;for(let y of t)y.x<r&&(r=y.x),y.y<o&&(o=y.y),y.x>a&&(a=y.x),y.y>i&&(i=y.y);let s=Math.max(a-r,1e-6),l=Math.max(i-o,1e-6),u=Math.max(Math.sqrt(s*l/n),1e-6),c=Math.max(1,Math.ceil(s/u)+1),f=Math.max(1,Math.ceil(l/u)+1),m=new Map,d=(y,h)=>{let x=Math.min(c-1,Math.max(0,Math.floor((y-r)/u)));return Math.min(f-1,Math.max(0,Math.floor((h-o)/u)))*c+x};for(let y=0;y<n;y++){let h=d(t[y].x,t[y].y),x=m.get(h);x?x.push(y):m.set(h,[y])}for(let y=0;y<n;y++){let h=t[y],x=Math.min(c-1,Math.max(0,Math.floor((h.x-r)/u))),g=Math.min(f-1,Math.max(0,Math.floor((h.y-o)/u))),b=1/0;for(let I=1;I<=4;I++){for(let w=g-I;w<=g+I;w++)if(!(w<0||w>=f))for(let P=x-I;P<=x+I;P++){if(P<0||P>=c||I>1&&Math.abs(w-g)<I&&Math.abs(P-x)<I)continue;let p=m.get(w*c+P);if(p)for(let _ of p){if(_===y)continue;let M=Math.hypot(t[_].x-h.x,t[_].y-h.y);M<b&&(b=M)}}if(Number.isFinite(b)&&b<=I*u)break}e[y]=b}return e}function li(t){let n=t.eyeHeightM;return Number.isFinite(n)?Math.max(0,n-xn):0}function We(t,n,e,r,o,a){let i=t.length,s=new Float32Array(i*3),l=new Float32Array(i),u=new Float32Array(i*3),c=new Float32Array(i),f=new Float32Array(i),m=new Float32Array(i),d=new Float32Array(i),y=new Float32Array(i*3),h=new Map,x=ci(t);for(let g=0;g<i;g++){let b=t[g],w=(e?.seatPitchU(g)??x[g])*S;c[g]=Number.isFinite(w)?Math.max(.06,Math.min(_n,w*ai)):_n,f[g]=je(Number.isFinite(w)?w:void 0);let P=Be(b.glyph,{seatGlyph:a?.get(b.categoryKey)});m[g]=Ee.indexOf(P),d[g]=b.wheelchairSpaceType==="no-seat"?0:1,s[g*3]=b.x*S,s[g*3+1]=e?e.seatDeckY(g):li(b),s[g*3+2]=b.y*S,l[g]=Xn(n?n(b):"available");let p=ot(o?.get(b.categoryKey)??"#6e7bff")??[.43,.48,1];if(u[g*3]=p[0],u[g*3+1]=p[1],u[g*3+2]=p[2],b.accessibility?.length){let _=ot(pn(b.accessibility));_&&(y[g*3]=_[0],y[g*3+1]=_[1],y[g*3+2]=_[2])}h.set(b.id,g)}return{count:i,iPosition:s,iState:l,iCategory:u,iMaxRadius:c,iRing:y,idToIndex:h,iChairWidth:f,iGlyph:m,iPhysicalSeat:d,iFloor:r??new Float32Array(i),iSection:new Float32Array(i).fill(-1),iYaw:new Float32Array(i)}}var ui=64;function fl(t,n){let e=[];for(let i of n){let s=t.idToIndex.get(i.seatId);if(s===void 0)continue;let l=Xn(i.state);t.iState[s]!==l&&(t.iState[s]=l,e.push(s))}if(!e.length)return[];e.sort((i,s)=>i-s);let r=[],o=e[0],a=e[0];for(let i=1;i<e.length;i++){let s=e[i];if(s!==a){if(s<=a+ui){a=s;continue}r.push({start:o,length:a-o+1}),o=s,a=s}}return r.push({start:o,length:a-o+1}),r}import Ii from"polygon-clipping";var Y={top:1,wallBottom:.58,bottomCap:.4};function Xt(t,n){if(!t)return n;let e=Z(St(t,.4),.62);return et(n,e,.22)}function Ye(t,n){return t?et(n,Z(St(t,.25),.74),.62):n}function ze(t,n){return t?et(n,Z(St(t,.08),.9),.82):n}function Ke(t,n){let e=new Map;for(let a of t.categories??[])e.set(a.key,a.color);let r=new Map;for(let a of n){if(!a.sectionId)continue;let i=r.get(a.sectionId);i||(i=new Map,r.set(a.sectionId,i)),i.set(a.categoryKey,(i.get(a.categoryKey)??0)+1)}let o=new Map;for(let[a,i]of r){let s=0,l=0,u=0,c=0;for(let[f,m]of i){let d=ot(e.get(f));d&&(s+=d[0]*m,l+=d[1]*m,u+=d[2]*m,c+=m)}c>0&&o.set(a,[s/c,l/c,u/c])}return o}function Ve(t,n){return ot(t.color)??n.get(t.logicalSectionId??t.id)??null}import ao from"polygon-clipping";import Qe from"polygon-clipping";import fi from"earcut";var mi=.58,Ze=.01,Pt=_n*1.5*Mt,hi=.5,yi=.6;function di(t,n){let e=t.length,r=[];for(let i=0;i<e;i++){let s=t[Math.max(0,i-1)],l=t[Math.min(e-1,i+1)],u=l.x-s.x,c=l.y-s.y,f=Math.hypot(u,c);if(f<1e-9){r.push([0,0]);continue}u/=f,c/=f,r.push([-c,u])}let o=0;for(let i=0;i<e;i++)o+=(t[i].x-n.x)*r[i][0]+(t[i].y-n.y)*r[i][1];return o<0?r.map(([i,s])=>[-i,-s]):r}function pi(t,n){if(t.length<2||n<=0)return[...t];let e=[...t],r=(i,s)=>{let l=s.x-i.x,u=s.y-i.y,c=Math.hypot(l,u)||1;return{x:l/c,y:u/c}},o=r(e[1],e[0]),a=r(e[e.length-2],e[e.length-1]);return e.unshift({x:e[0].x+o.x*n,y:e[0].y+o.y*n}),e.push({x:e[e.length-1].x+a.x*n,y:e[e.length-1].y+a.y*n}),e}var qe=Math.PI/12;function xi(t){if(t.length<3)return[...t];let n=[...t].sort((a,i)=>a.x-i.x||a.y-i.y),e=(a,i,s)=>(i.x-a.x)*(s.y-a.y)-(i.y-a.y)*(s.x-a.x),r=a=>{let i=[];for(let s of a){for(;i.length>=2&&e(i[i.length-2],i[i.length-1],s)<=0;)i.pop();i.push(s)}return i.pop(),i},o=[...r(n),...r([...n].reverse())];return o.length>=3?o:[...t]}function Je(t,n){if(!t.length||!(n>0))return[];let e=xi(t),r=(s,l,u,c)=>{let f=u-l;for(;f<0;)f+=Math.PI*2;for(;f>Math.PI*2;)f-=Math.PI*2;let m=Math.max(1,Math.ceil(f/qe)),d=n/Math.cos(f/m/2);for(let y=0;y<=m;y++){let h=l+f*y/m;c.push({x:s.x+Math.cos(h)*d,y:s.y+Math.sin(h)*d})}};if(e.length<3){let s=0,l=0;for(let d of e)s+=d.x,l+=d.y;s/=e.length||1,l/=e.length||1;let u=0;for(let d of e)u=Math.max(u,Math.hypot(d.x-s,d.y-l));let c=[],f=Math.max(3,Math.ceil(Math.PI*2/qe)),m=(u+n)/Math.cos(Math.PI/f);for(let d=0;d<f;d++){let y=d/f*Math.PI*2;c.push({x:s+Math.cos(y)*m,y:l+Math.sin(y)*m})}return c}let o=e.length,a=[];for(let s=0;s<o;s++){let l=e[s],u=e[(s+1)%o];a.push(Math.atan2(-(u.x-l.x),u.y-l.y))}let i=[];for(let s=0;s<o;s++)r(e[s],a[(s+o-1)%o],a[s],i);return ro(i)}function bi(t,n,e){if(t.length===1)return Math.hypot(n-t[0].x,e-t[0].y);let r=1/0;for(let o=0;o+1<t.length;o++){let a=t[o],i=t[o+1],s=i.x-a.x,l=i.y-a.y,u=s*s+l*l,c=u>1e-12?((n-a.x)*s+(e-a.y)*l)/u:0;c<0?c=0:c>1&&(c=1);let f=Math.hypot(n-(a.x+c*s),e-(a.y+c*l));f<r&&(r=f)}return r}function An(t){let n=t.map(o=>{let a=0,i=0;for(let u of o.pts)a+=u.x,i+=u.y;let s=o.pts.length||1;a/=s,i/=s;let l=0;for(let u of o.pts){let c=Math.hypot(u.x-a,u.y-i);c>l&&(l=c)}return{cx:a,cy:i,rad:l}}),e=o=>{let a=o.length;return a<=2?[...o]:[o[Math.floor(a*.25)],o[Math.floor(a*.5)],o[Math.floor(a*.75)]]},r=[];for(let o=0;o<t.length;o++){let a=e(t[o].pts),i=[],s=1/0,l=null;for(let c of a){let f=1/0;for(let m=0;m<t.length;m++){if(m===o||Math.abs(t[m].y-t[o].y)<.001)continue;let d=n[m],y=Math.hypot(c.x-d.cx,c.y-d.cy)-d.rad;if(y>=f&&y>=s)continue;let h=bi(t[m].pts,c.x,c.y);h<f&&(f=h),t[m].depth<t[o].depth&&h<s&&(s=h,l=t[m].y)}Number.isFinite(f)&&f>0&&i.push(f)}i.sort((c,f)=>c-f);let u=i.length?i[Math.floor(i.length/2)]:1;r.push({pitch:u,belowY:l})}return r}function to(t,n,e,r){let o=t[n],a=o.pts.length>=2?[...o.pts]:o.pts.length===1?(()=>{let c=o.pts[0],f=c.x-r.x,m=c.y-r.y,d=Math.hypot(f,m)||1;f/=d,m/=d;let y=Math.max(e[n].pitch,.001)*.5;return[{x:c.x+m*y,y:c.y-f*y},{x:c.x-m*y,y:c.y+f*y}]})():[];if(a.length<2)return null;let i=0,s=0;for(let c=1;c<a.length;c++){let f=Math.hypot(a[c].x-a[c-1].x,a[c].y-a[c-1].y);f>1e-6&&(i+=f,s++)}let l=s>0?i/s:0,u=pi(a,Math.max(l*yi,Pt));return{pts:u,nrm:di(u,r),front:Math.max(e[n].pitch*mi,Pt),back:Math.max(e[n].pitch*hi,Pt)}}var Kt=1.5,no=.3;function Yn(t,n){if(t.length<3)return t;let e=t[0],r=t[t.length-1],o=r.x-e.x,a=r.y-e.y,i=Math.hypot(o,a),s=-1,l=-1;for(let f=1;f<t.length-1;f++){let m=t[f],d=i>1e-12?Math.abs((m.x-e.x)*a-(m.y-e.y)*o)/i:Math.hypot(m.x-e.x,m.y-e.y);d>s&&(s=d,l=f)}if(s<=n||l<0)return[e,r];let u=Yn(t.slice(0,l+1),n),c=Yn(t.slice(l),n);return[...u.slice(0,-1),...c]}function eo(t,n){if(t.length<4)return t;let e=Yn([...t,t[0]],n);return e.pop(),e.length>=3?e:t}function gi(t){let n=t.map((r,o)=>{let a=t[(o+1)%t.length];return{a:r,b:a,i:o,minX:Math.min(r.x,a.x),maxX:Math.max(r.x,a.x),minY:Math.min(r.y,a.y),maxY:Math.max(r.y,a.y)}}).sort((r,o)=>r.minX-o.minX),e=(r,o,a)=>(o.x-r.x)*(a.y-r.y)-(o.y-r.y)*(a.x-r.x);for(let r=0;r<n.length;r++){let o=n[r];for(let a=r+1;a<n.length&&n[a].minX<=o.maxX;a++){let i=n[a];if(!(Math.abs(o.i-i.i)===1||Math.abs(o.i-i.i)===t.length-1||o.maxY<i.minY||i.maxY<o.minY)&&e(o.a,o.b,i.a)*e(o.a,o.b,i.b)<=0&&e(i.a,i.b,o.a)*e(i.a,i.b,o.b)<=0)return!0}}return!1}function oo(t,n,e){if(t.length<2)return[];let r=e??An(t),o=new Map;for(let i=0;i<t.length;i++){let s=o.get(t[i].blockId);s?s.push(i):o.set(t[i].blockId,[i])}let a=[];for(let[,i]of o){let s=[];for(let b of i){let I=t[b].patch;I&&I.length>=3?a.push({outline:[...I],holes:[],topY:t[b].y}):s.push(b)}if(!s.length)continue;s.sort((b,I)=>t[b].depth-t[I].depth);let u=s.map(b=>to(t,b,r,n)).filter(b=>b!==null);if(!u.length)continue;let c=(b,I)=>({x:b.pts[I].x-b.nrm[I][0]*(b.front+Kt),y:b.pts[I].y-b.nrm[I][1]*(b.front+Kt)}),f=(b,I)=>({x:b.pts[I].x+b.nrm[I][0]*(b.back+Kt),y:b.pts[I].y+b.nrm[I][1]*(b.back+Kt)}),m=u[0],d=u[u.length-1],y=[];for(let b=0;b<m.pts.length;b++)y.push(c(m,b));for(let b of u)y.push(f(b,b.pts.length-1));for(let b=d.pts.length-1;b>=0;b--)y.push(f(d,b));for(let b=u.length-1;b>=0;b--)y.push(c(u[b],0));let h=ro(y),x=1/0;for(let b of s)t[b].y<x&&(x=t[b].y);if(!Number.isFinite(x))continue;if(h.length>=3&&Math.abs(dt(h))>1e-6&&u.every(b=>{let I=b.pts[Math.floor(b.pts.length/2)];return pt(h,I.x,I.y)})&&!gi(h)){a.push({outline:eo(h,no),holes:[],topY:x});continue}for(let b of Mi(u))a.push({outline:b,holes:[],topY:x})}return a}function Mi(t){let n=[];for(let e of t){let r=[],o=[],a=e.front+Kt,i=e.back+Kt;for(let l=0;l<e.pts.length;l++){let u=e.pts[l],c=e.nrm[l];r.push([u.x-c[0]*a,u.y-c[1]*a]),o.push([u.x+c[0]*i,u.y+c[1]*i])}let s=[...r,...o.reverse()];s.length<3||(s.push(s[0]),n.push([s]))}if(!n.length)return[];try{let e=Qe.union(n[0],...n.slice(1)),r=[];for(let o of e){if(!o.length||o[0].length<4)continue;let a=o[0].map(([l,u])=>({x:l,y:u})),i=a[0],s=a[a.length-1];a.length>1&&Math.abs(i.x-s.x)<1e-9&&Math.abs(i.y-s.y)<1e-9&&a.pop(),a.length>=3&&r.push(eo(a,no))}return r}catch{return[]}}function ro(t){let n=[];for(let e of t){let r=n[n.length-1];r&&Math.hypot(e.x-r.x,e.y-r.y)<1e-9||n.push(e)}for(;n.length>2&&Math.hypot(n[0].x-n[n.length-1].x,n[0].y-n[n.length-1].y)<1e-9;)n.pop();return n}var zn=class{constructor(n){this.minX=1/0;this.minY=1/0;this.maxX=-1/0;this.maxY=-1/0;this.rings=n;for(let e of n)for(let r of e)r.x<this.minX&&(this.minX=r.x),r.y<this.minY&&(this.minY=r.y),r.x>this.maxX&&(this.maxX=r.x),r.y>this.maxY&&(this.maxY=r.y)}containsAll(n){for(let e of n)if(e.x<this.minX||e.x>this.maxX||e.y<this.minY||e.y>this.maxY)return!1;for(let e of this.rings){let r=!0;for(let o of n)if(!pt(e,o.x,o.y)){r=!1;break}if(r)return!0}return!1}};function $e(t,n,e,r,o,a){if(r.length<3)return;if(e.containsAll(r)){let u=[0,1,0],c=r[0];for(let f=1;f+1<r.length;f++){let m=r[f],d=r[f+1];t.tri([c.x*S,o,c.y*S],[m.x*S,o,m.y*S],[d.x*S,o,d.y*S],u,a)}return}let i=r.map(u=>[u.x,u.y]);i.push(i[0]);let s;try{s=Qe.intersection([i],n)}catch{return}let l=[0,1,0];for(let u of s){if(!u.length||u[0].length<4)continue;let c=u[0],f=[],m=[];for(let y=0;y<c.length-1;y++)f.push(c[y][0],c[y][1]),m.push([c[y][0],c[y][1]]);if(m.length<3)continue;let d=fi(f,void 0,2);for(let y=0;y<d.length;y+=3){let h=m[d[y]],x=m[d[y+1]],g=m[d[y+2]];t.tri([h[0]*S,o,h[1]*S],[x[0]*S,o,x[1]*S],[g[0]*S,o,g[1]*S],l,a)}}}function io(t,n,e,r,o,a,i){if(n.length<2)return;let s=i??An(n),l=[0,1,0],u=a&&a.length>=3?[[...a.map(d=>[d.x,d.y]),[a[0].x,a[0].y]]]:null,c=a&&a.length>=3?new zn([[...a]]):null,f=d=>{t.setMaterial(2),d(),t.setMaterial(0)},m=d=>{t.setMaterial(3),d(),t.setMaterial(0)};for(let d=0;d<n.length;d++){let y=n[d];if(y.patch&&y.patch.length>=3){let P=[...y.patch],p=s[d].belowY??r;if(m(()=>{if(u&&c)$e(t,u,c,P,y.y,o.tread);else{let _=P[0];for(let M=1;M+1<P.length;M++){let R=P[M],E=P[M+1];t.tri([_.x*S,y.y,_.y*S],[R.x*S,y.y,R.y*S],[E.x*S,y.y,E.y*S],l,o.tread)}}}),y.y>p+Ze){let _=0,M=0;for(let R of P)_+=R.x,M+=R.y;_/=P.length,M/=P.length,f(()=>{for(let R=0;R<P.length;R++){let E=P[R],C=P[(R+1)%P.length],v=C.x-E.x,k=C.y-E.y,A=Math.hypot(v,k);if(A<1e-6)continue;let B=k/A,T=-v/A;(E.x-_)*B+(E.y-M)*T<0&&(B=-B,T=-T);let F=[B,0,T],O=[E.x*S,y.y,E.y*S],L=[C.x*S,y.y,C.y*S],D=[E.x*S,p,E.y*S],G=[C.x*S,p,C.y*S];t.tri(O,L,G,F,o.riser),t.tri(O,G,D,F,o.riser)}})}continue}let h=to(n,d,s,e);if(!h)continue;let{pts:x,nrm:g,front:b,back:I}=h,w=s[d].belowY??r;for(let P=0;P+1<x.length;P++){let p=x[P],_=x[P+1],M=g[P],R=g[P+1];if(Math.hypot(_.x-p.x,_.y-p.y)<1e-6||M[0]===0&&M[1]===0||R[0]===0&&R[1]===0)continue;let E=[(p.x-M[0]*b)*S,y.y,(p.y-M[1]*b)*S],C=[(_.x-R[0]*b)*S,y.y,(_.y-R[1]*b)*S],v=[(p.x+M[0]*I)*S,y.y,(p.y+M[1]*I)*S],k=[(_.x+R[0]*I)*S,y.y,(_.y+R[1]*I)*S];if(m(()=>{u&&c?$e(t,u,c,[{x:p.x-M[0]*b,y:p.y-M[1]*b},{x:_.x-R[0]*b,y:_.y-R[1]*b},{x:_.x+R[0]*I,y:_.y+R[1]*I},{x:p.x+M[0]*I,y:p.y+M[1]*I}],y.y,o.tread):(t.tri(E,C,k,l,o.tread),t.tri(E,k,v,l,o.tread))}),y.y>w+Ze){let A=[E[0],w,E[2]],B=[C[0],w,C[2]],T=[-M[0],0,-M[1]];f(()=>{t.tri(E,C,B,T,o.riser),t.tri(E,B,A,T,o.riser)})}}}}function Pi(t,n){let e=t.eventConfigurationIds;return!e?.length||!!n&&e.includes(n)}function so(t,n){return t.filter(e=>e.type!=="shape"||Pi(e,n))}function co(t,n){let e=t.focalPoint??{x:0,y:0};return t.floors?.length?t.floors.map((r,o)=>({objects:so(r.objects,n),focal:{x:(r.focalPoint??e).x,y:(r.focalPoint??e).y},baseHeightM:r.baseHeightM??0,index:o})):[{objects:so(t.objects,n),focal:e,baseHeightM:0,index:0}]}var Si={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};function Tt(t){return Oe(t)??Si}function lo(t,n){let e=It(t.outline,Pt),r=Tt(e),o=n.filter(i=>i!==t&&i.outline&&i.outline.length>=3&&zt(r,Tt(i.outline)));if(!o.length)return[e];let a=i=>{let s=i.map(l=>[l.x,l.y]);return s.push(s[0]),s};try{let i=ao.difference([a(e)],...o.map(l=>[a(l.outline)])),s=[];for(let l of i){if(!l.length)continue;let u=l[0].map(([c,f])=>({x:c,y:f}));if(u.length>1){let c=u[0],f=u[u.length-1];Math.abs(c.x-f.x)<1e-9&&Math.abs(c.y-f.y)<1e-9&&u.pop()}u.length>=3&&s.push(u)}return s.length?s:[e]}catch{return[e]}}function uo(t,n){if(!n.length)return t;let e=a=>{let i=a.map(s=>[s.x,s.y]);return i.push(i[0]),i},r=n.map(a=>[e(a)]),o=[];for(let a of t){let i;try{i=ao.intersection([e(a.outline)],r.flat())}catch{o.push(a);continue}for(let s of i){if(!s.length)continue;let l=s[0].map(([u,c])=>({x:u,y:c}));if(l.length>1){let u=l[0],c=l[l.length-1];Math.abs(u.x-c.x)<1e-9&&Math.abs(u.y-c.y)<1e-9&&l.pop()}l.length>=3&&o.push({outline:l,holes:[],topY:a.topY})}}return o.length?o:t}function Ri(t,n){return t===void 0||n===void 0?!0:Math.abs(t-n)<.001}var wn=class{constructor(){this.rings=[];this.boxes=[];this.levels=[]}subtract(n,e){let r=n.map(l=>[l.x,l.y]);if(r.length<3)return[];r.push(r[0]);let o=Tt(n),a=this.rings.filter((l,u)=>zt(o,this.boxes[u])&&Ri(e,this.levels[u])),i=[[r]];if(a.length)try{i=Ii.difference([r],...a).map(u=>u.map(c=>c.map(([f,m])=>[f,m])))}catch{i=[[r]]}this.rings.push([r]),this.boxes.push(o),this.levels.push(e);let s=[];for(let l of i){if(!l.length)continue;let u=l[0].map(([c,f])=>({x:c,y:f}));if(u.length>1){let c=u[0],f=u[u.length-1];Math.abs(c.x-f.x)<1e-9&&Math.abs(c.y-f.y)<1e-9&&u.pop()}u.length>=3&&s.push(u)}return s}};function En(t,n){if(!n)return t;let e=1/0,r=-1/0,o=1/0,a=-1/0;for(let f of t)e=Math.min(e,f.x),r=Math.max(r,f.x),o=Math.min(o,f.y),a=Math.max(a,f.y);let i=(e+r)/2,s=(o+a)/2,l=n*Math.PI/180,u=Math.cos(l),c=Math.sin(l);return t.map(f=>{let m=f.x-i,d=f.y-s;return{x:i+m*u-d*c,y:s+m*c+d*u}})}function it(t){let n=null;if(t.kind==="polygon"&&t.points&&t.points.length>=3&&(n=t.points),t.kind==="rect"&&t.width&&t.height&&(n=rn(t.x??0,t.y??0,t.width,t.height)),t.kind==="ellipse"&&t.width&&t.height){let e=(t.x??0)+t.width/2,r=(t.y??0)+t.height/2;n=Rn(e,r,t.width/2,t.height/2)}return n?En(n,t.rotation):null}function Rt(t){let n=t.role??"",e={stage:{kind:"stage",heightM:1},entrance:{kind:"portal",heightM:2.7},exit:{kind:"portal",heightM:2.7},screen:{kind:"solid",heightM:6},wall:{kind:"solid",heightM:2.8},rail:{kind:"solid",heightM:1.1},suite:{kind:"suite",heightM:3},obstruction:{kind:"solid",heightM:4.5},sound:{kind:"solid",heightM:1.45},restroom:{kind:"solid",heightM:2.4},bar:{kind:"solid",heightM:1.1},concession:{kind:"solid",heightM:1.1},coat:{kind:"solid",heightM:1.1},goal:{kind:"portal",heightM:1.8}},r=n==="stage"&&Re(t.stageKind)?{kind:"stage",heightM:t.stageKind==="ring-boxing"?Ie:.06}:e[n]??{kind:"plate",heightM:.25};return{...r,heightM:t.heightM??r.heightM}}var _i=.08,Ai=30,wi=.015;function Ei(t,n){let e=!1;for(let r=0,o=n.length-1;r<n.length;o=r++){let a=n[r],i=n[o];a.y>t.y!=i.y>t.y&&t.x<(i.x-a.x)*(t.y-a.y)/(i.y-a.y)+a.x&&(e=!e)}return e}function fo(t,n){let e=it(t)??(t.points?.length?En(t.points,t.rotation):null),r=Rt(t),a=!t.role&&r.kind==="plate"&&t.heightM===void 0&&!!e&&Math.abs(dt(e))*q**2>=Ai?wi:r.heightM;if(!e)return{topOffsetM:a,supportOffsetM:0};if(r.kind!=="plate"&&r.kind!=="stage")return{topOffsetM:a,supportOffsetM:0};let i=1/0,s=1/0,l=-1/0,u=-1/0;for(let d of e)i=Math.min(i,d.x),s=Math.min(s,d.y),l=Math.max(l,d.x),u=Math.max(u,d.y);let c=a,f=0,m=1e-6*Math.max(1,l-i,u-s);for(let d of n)l>d.minX&&i<d.maxX&&u>d.minY&&s<d.maxY&&c<=d.topOffsetM+1e-6&&(c=d.topOffsetM+_i),i>=d.minX-m&&l<=d.maxX+m&&s>=d.minY-m&&u<=d.maxY+m&&(!d.poly||e.every(x=>Ei(x,d.poly)||Bi(x,d.poly,m)))&&(f=Math.max(f,d.topOffsetM));return t.fill&&t.fill!=="none"&&t.fill!=="transparent"&&n.push({minX:i,minY:s,maxX:l,maxY:u,topOffsetM:c,poly:e}),{topOffsetM:c,supportOffsetM:Math.min(f,c)}}function Bi(t,n,e){for(let r=0,o=n.length-1;r<n.length;o=r++){let a=n[o],i=n[r],s=i.x-a.x,l=i.y-a.y,u=s*s+l*l,c=u?Math.max(0,Math.min(1,((t.x-a.x)*s+(t.y-a.y)*l)/u)):0;if(Math.hypot(t.x-(a.x+c*s),t.y-(a.y+c*l))<=e)return!0}return!1}function vt(t,n,e){return{x:t.x+(n.x-t.x)*e,y:t.y+(n.y-t.y)*e}}function xt(t){if(t.length!==4)return t;let n=Math.hypot(t[1].x-t[0].x,t[1].y-t[0].y),e=Math.hypot(t[2].x-t[1].x,t[2].y-t[1].y);return n>=e?t:[t[1],t[2],t[3],t[0]]}function yt(t,n,e){return[vt(t[0],t[1],n),vt(t[0],t[1],e),vt(t[3],t[2],e),vt(t[3],t[2],n)]}function an(t,n,e){return[vt(t[0],t[3],n),vt(t[1],t[2],n),vt(t[1],t[2],e),vt(t[0],t[3],e)]}function J(t,n,e,r,o,a){V(t,n,void 0,()=>e,r,o,a,Y)}function cn(t){if(t.length<3)return t.map(a=>({...a}));let n=[...t].sort((a,i)=>a.x-i.x||a.y-i.y),e=(a,i,s)=>(i.x-a.x)*(s.y-a.y)-(i.y-a.y)*(s.x-a.x),r=a=>{let i=[];for(let s of a){for(;i.length>=2&&e(i[i.length-2],i[i.length-1],s)<=0;)i.pop();i.push(s)}return i.pop(),i},o=[...r(n),...r([...n].reverse())];return o.length>=3?o.map(a=>({...a})):n.map(a=>({...a}))}var Ti=.8,Oi=.6,Ci=2;function Vt(t,n){if(!n.length)return null;let e=[],r=0;for(let i of t.objects){if(i.type!=="shape"||i.role!=="wall")continue;let s=it(i)??[],l=mo(s)/2;!(l>0)||Li(s)/l*S>Ci||(e.push(...s),r+=l)}if(e.length<3)return null;let o=cn(e);if(o.length<3||r<mo(o)*Oi)return null;let a=0;for(let i of n)vi(i,o)&&(a+=1);return a>=n.length*Ti?o:null}var ho=6,ki=5,Fi=8;function yo(t){return Math.max(Fi,(Number.isFinite(t)?t:0)+ki)}function po(t){let n=0,e=0,r=0;for(let o=0;o<t.length;o++){let a=t[o],i=t[(o+1)%t.length],s=a.x*i.y-i.x*a.y;n+=s,e+=(a.x+i.x)*s,r+=(a.y+i.y)*s}if(Math.abs(n)<1e-9){let o=0,a=0;for(let i of t)o+=i.x,a+=i.y;return{x:o/Math.max(1,t.length),y:a/Math.max(1,t.length)}}return{x:e/(3*n),y:r/(3*n)}}function Li(t){let n=0;for(let e=0;e<t.length;e++){let r=t[e],o=t[(e+1)%t.length];n+=r.x*o.y-o.x*r.y}return Math.abs(n)/2}function mo(t){let n=0;for(let e=0;e<t.length;e++){let r=t[e],o=t[(e+1)%t.length];n+=Math.hypot(o.x-r.x,o.y-r.y)}return n}function vi(t,n){let e=!1;for(let r=0,o=n.length-1;r<n.length;o=r++){let a=n[r],i=n[o];a.y>t.y!=i.y>t.y&&t.x<(i.x-a.x)*(t.y-a.y)/(i.y-a.y)+a.x&&(e=!e)}return e}var Di=[[/\b(wc|toilets?|restrooms?|washrooms?|lavatory|loo)\b/i,"restroom"],[/\b(bar|drinks|pub|cocktails?)\b/i,"bar"],[/\b(food|concessions?|snacks?|kiosk|caf[eé]|kitchen|catering)\b/i,"concession"],[/\b(coat ?check|cloak ?room|cloakroom|coats)\b/i,"coat"],[/\b(screen|led wall|projection|video wall)\b/i,"screen"],[/\b(sound|foh|mixing desk|control booth)\b/i,"sound"],[/\b(entrance|entry|way in|gate)\b/i,"entrance"],[/\b(exit|way out)\b/i,"exit"],[/\b(pillar|column|obstruction)\b/i,"obstruction"],[/\b(walls?|outline|boundary|perimeter)\b/i,"wall"]],Ni=1.2,Gi=12;function xo(t){if(t.heightM!==void 0)return!1;let n=it(t);if(!n||n.length<3)return!1;let e=0;for(let o=0;o<n.length;o++){let a=n[o],i=n[(o+1)%n.length];e+=Math.hypot(i.x-a.x,i.y-a.y)}return e*q<Gi*2?!1:2*ln(n)/e*q<=Ni}function Kn(t){if(!t)return null;for(let[n,e]of Di)if(n.test(t))return e;return null}var go="auto-rows-";function Mo(t){return t.id.startsWith(go)&&!t.label}var Hi=1.15,Xi=.09,Po=6,ji=34,Ui=.35,Wi=6,Yi=.35,zi=.75,Ki=12,Vi=2.5,Zi=40,qi=[18,24],$i=[12,16],bo=14,Qi=.8,Ji=.6,ts=5,ns=.3,So=.4,Io=2,es=400,os=2.6,rs=.8,is=4,ss=26,as=.7,cs=.5,ls=.985,us=1.5,fs=1.8,ms=3,hs=25,ys=.985,ds=2,ps=6,xs=3,bs=.1,gs=1.5,Ms=1.6,Ps=6e3,Ss=.6,Is="#c3c7cd",Vn=300,Rs=240;function _s(t,n,e,r){if(!t.fill||!/^#[0-9a-f]{6}$/i.test(t.fill))return null;let o=qn([...n]),a=new Set;for(let c of r)a.add(Math.floor(Math.atan2(c.y-o.y,c.x-o.x)*180/Math.PI/10));if(a.size*10<Rs)return null;let{h:i,s,l}=we(Ae(t.fill));return i<70/360||i>170/360||s<.2||l<.08||l>.75||e.some(c=>c!==t&&c.type==="shape"&&it(c)?.some(f=>Jn(f,n)))?null:t.kind==="ellipse"?"oval-cricket":t.kind==="rect"?"pitch-football":null}var As="Estimated from the drawing; confirm with the venue.",$n=t=>{if(!t.length)return null;let n=[...t].sort((r,o)=>r-o),e=Math.floor(n.length/2);return n.length%2?n[e]:(n[e-1]+n[e])/2},qn=t=>({x:t.reduce((n,e)=>n+e.x,0)/t.length,y:t.reduce((n,e)=>n+e.y,0)/t.length}),ln=t=>{let n=0;for(let e=0;e<t.length;e++){let r=t[e],o=t[(e+1)%t.length];n+=r.x*o.y-o.x*r.y}return Math.abs(n)/2};function ws(t){return t.height!==void 0||t.rake!==void 0||t.elevation!==void 0||t.surfaceKind!==void 0}function Qn(t){let n=new Map;for(let e of t){let r=n.get(e.rowId);r?r.push(e):n.set(e.rowId,[e])}return n}function Jn(t,n){let e=!1;for(let r=0,o=n.length-1;r<n.length;o=r++){let a=n[r],i=n[o];a.y>t.y!=i.y>t.y&&t.x<(i.x-a.x)*(t.y-a.y)/(i.y-a.y)+a.x&&(e=!e)}return e}function te(t,n){let e=n[0],r=1/0;for(let o=0;o<n.length;o++){let a=n[o],i=n[(o+1)%n.length],s=i.x-a.x,l=i.y-a.y,u=s*s+l*l,c=u>0?Math.max(0,Math.min(1,((t.x-a.x)*s+(t.y-a.y)*l)/u)):0,f={x:a.x+s*c,y:a.y+l*c},m=Math.hypot(t.x-f.x,t.y-f.y);m<r&&(r=m,e=f)}return e}function Ro(t,n){let e=0,r=0;for(let o of t.values()){if(o.length<3)continue;let a=o[0],i=o[o.length-1],s=i.x-a.x,l=i.y-a.y,u=Math.hypot(s,l);if(u<1e-6)continue;let c={x:(a.x+i.x)/2,y:(a.y+i.y)/2},f=te(c,n),m=f.x-c.x,d=f.y-c.y,y=Math.hypot(m,d);y<1e-6||(r+=Math.abs((-l*m+s*d)/(u*y))*o.length,e+=o.length)}return e?r/e:0}function Es(t,n,e){let r=t.filter(h=>h.type==="shape"),o=r.find(h=>h.role==="stage");if(o){let h=it(o);return h?{shape:o,centre:qn(h),outline:h,inferred:!1}:null}if(!e.length)return null;let a=1/0,i=-1/0,s=1/0,l=-1/0;for(let h of e)a=Math.min(a,h.x),i=Math.max(i,h.x),s=Math.min(s,h.y),l=Math.max(l,h.y);let u=(i-a)*(l-s),c=[];for(let h of r){if(h.role)continue;let x=it(h);if(!x)continue;let g=ln(x);if(g*q*q<6||g>u)continue;let b=Math.min(...x.map(R=>R.x)),I=Math.max(...x.map(R=>R.x)),w=Math.min(...x.map(R=>R.y)),P=Math.max(...x.map(R=>R.y)),p=0;for(let R of e)R.x>b&&R.x<I&&R.y>w&&R.y<P&&Jn(R,x)&&p++;if(p>e.length*.05)continue;let _=qn(x),M=Ro(n,x);M>=Qi&&c.push({shape:h,centre:_,outline:x,score:M,area:g,box:[b,w,I,P]})}let f=(h,x)=>x!==h&&x.area>h.area&&h.box[0]>=x.box[0]-1e-6&&h.box[1]>=x.box[1]-1e-6&&h.box[2]<=x.box[2]+1e-6&&h.box[3]<=x.box[3]+1e-6,m=c.filter(h=>!c.some(x=>f(h,x))),d=Math.max(0,...m.map(h=>h.score)),y=m.filter(h=>h.score>=d-.03).sort((h,x)=>x.area-h.area)[0]??null;return y?{shape:y.shape,centre:y.centre,outline:y.outline,inferred:!0}:null}function Bs(t,n,e){if(!e||e.length<3)return Math.hypot(t.x-n.x,t.y-n.y);let r=te(t,e);return Math.hypot(t.x-r.x,t.y-r.y)}function _o(t){let n=[...t].sort((a,i)=>a.x-i.x||a.y-i.y);if(n.length<3)return n;let e=(a,i,s)=>(i.x-a.x)*(s.y-a.y)-(i.y-a.y)*(s.x-a.x),r=[];for(let a of n){for(;r.length>=2&&e(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a)}let o=[];for(let a=n.length-1;a>=0;a--){let i=n[a];for(;o.length>=2&&e(o[o.length-2],o[o.length-1],i)<=0;)o.pop();o.push(i)}return[...r.slice(0,-1),...o.slice(0,-1)]}function Ts(t){if(!t.length||t.length>Ps)return[];let n=[...Qn(t).values()],e=n.map((s,l)=>l),r=s=>e[s]===s?s:e[s]=r(e[s]),o=Ms/q,a=n.map(s=>({minX:Math.min(...s.map(l=>l.x))-o,maxX:Math.max(...s.map(l=>l.x))+o,minY:Math.min(...s.map(l=>l.y))-o,maxY:Math.max(...s.map(l=>l.y))+o}));for(let s=0;s<n.length;s++)for(let l=s+1;l<n.length;l++){let u=a[s],c=a[l];if(u.maxX<c.minX||c.maxX<u.minX||u.maxY<c.minY||c.maxY<u.minY)continue;n[s].some(m=>n[l].some(d=>Math.hypot(m.x-d.x,m.y-d.y)<=o))&&(e[r(s)]=r(l))}let i=new Map;return n.forEach((s,l)=>{let u=r(l),c=i.get(u);c?c.push(...s):i.set(u,[...s])}),[...i.values()].filter(s=>new Set(s.map(l=>l.rowId)).size>=2)}function Os(t,n,e){if(!n.length)return null;let r=n.filter(M=>e.tableIds.has(M.rowId)||M.kind==="booth").length>n.length/2,o=Qn(n),a=!e.outline||Ro(o,e.outline)>=Ji,i=0,s=0;for(let M of o.values()){if(M.length<2)continue;let R=M[0],E=M[M.length-1],C=E.x-R.x,v=E.y-R.y,k=Math.hypot(C,v);if(k<1e-6)continue;let A={x:(R.x+E.x)/2,y:(R.y+E.y)/2},B=a?e.outline?te(A,e.outline):e.focal:e.middle,T=-v/k,F=C/k;T*(B.x-A.x)+F*(B.y-A.y)<0&&(T=-T,F=-F),i+=T*M.length,s+=F*M.length}let l={x:n.reduce((M,R)=>M+R.x,0)/n.length,y:n.reduce((M,R)=>M+R.y,0)/n.length};if(Math.hypot(i,s)<1e-9){let M=a?e.focal:e.middle;i=M.x-l.x,s=M.y-l.y}let u=Math.hypot(i,s)||1,c={x:i/u,y:s/u},f=M=>-(M.x*c.x+M.y*c.y),m=M=>-M.x*c.y+M.y*c.x,d=1/0,y=-1/0,h=1/0,x=-1/0,g=1/0,b=new Map;for(let M of n){let R=f(M),E=m(M);d=Math.min(d,R),y=Math.max(y,R),h=Math.min(h,E),x=Math.max(x,E),a&&(g=Math.min(g,Bs(M,e.focal,e.outline)));let C=M.logicalRowId??M.rowId,v=b.get(C);v?v.push(R):b.set(C,[R])}a||(g=Math.max(0,d-f(e.middle)));let I=[...b.values()].map(M=>$n(M)).sort((M,R)=>M-R),w=[];if(!r)for(let M of I)w.length&&M-w[w.length-1]<Yi/q||w.push(M);let P=ws(t),p=Wt(t,{floorBaseHeightM:e.baseHeightM}),_={id:t.id,section:t,authored:P,plane:e,facing:c,facesAction:a,hull:_o(n),sample:n.filter((M,R)=>R%Math.ceil(n.length/es)===0),frontD:d,backD:y,latMin:h,latMax:x,frontDistance:g,rowDepths:w,rowCount:w.length,level:0,height:p.height,rake:P?p.rake:0,backHeight:0};return _.backHeight=_.height+(y-d)*q*Math.tan(_.rake*Math.PI/180),_}function Cs(t,n,e,r){if(t.length<2)return 0;let o=Math.max(1,n*q),a=e+Hi-r,i=0,s=0;for(let u=1;u<t.length;u++){let c=Math.max(zi,(t[u]-t[u-1])*q),f=(a+Xi)*(o+c)/o;i+=f-a,s+=c,a=f,o+=c}let l=Math.atan(i/s)*180/Math.PI;return Math.round(Math.max(Po,Math.min(ji,l))*10)/10}function ks(t,n,e=!1){if(!e&&t.facing.x*n.facing.x+t.facing.y*n.facing.y<ns)return null;let r=-1/0,o=1/0,a=-1/0;for(let m of n.hull){r=Math.max(r,-(m.x*t.facing.x+m.y*t.facing.y));let d=-m.x*t.facing.y+m.y*t.facing.x;o=Math.min(o,d),a=Math.max(a,d)}if(Math.min(t.latMax,a)-Math.max(t.latMin,o)<(e?1e-6:So*(t.latMax-t.latMin)))return null;let s=Io/q,l=new Map,u=new Map;for(let m of t.sample){let d=Math.floor((-m.x*t.facing.y+m.y*t.facing.x)/s),y=-(m.x*t.facing.x+m.y*t.facing.y);l.set(d,Math.min(l.get(d)??1/0,y))}for(let m of n.sample){let d=Math.floor((-m.x*t.facing.y+m.y*t.facing.x)/s),y=-(m.x*t.facing.x+m.y*t.facing.y);u.set(d,Math.max(u.get(d)??-1/0,y))}let c=[];for(let[m,d]of l){let y=u.get(m);y!==void 0&&c.push(d-y)}let f=c.length?$n(c):t.frontD-r;return f<-1/q?null:f}function Fs(t,n){if(n.plane.floorIndex>=t.plane.floorIndex)return!1;let e=-1/0,r=1/0,o=1/0,a=-1/0;for(let l of n.hull){let u=-(l.x*t.facing.x+l.y*t.facing.y);e=Math.max(e,u),r=Math.min(r,u);let c=-l.x*t.facing.y+l.y*t.facing.x;o=Math.min(o,c),a=Math.max(a,c)}let i=Math.min(t.latMax,a)-Math.max(t.latMin,o),s=Math.min(t.backD,e)-Math.max(t.frontD,r);return i>So*(t.latMax-t.latMin)&&s>1/q}function Ls(t,n){let e=new Set;for(let r of t){let o=(Math.atan2(r.y-n.y,r.x-n.x)*180/Math.PI+360)%360;e.add(Math.floor(o/10))}return e.size/36}function vs(t,n){let e=1/0,r=-1/0;for(let a of n.hull){let i=-(a.x*t.facing.x+a.y*t.facing.y);e=Math.min(e,i),r=Math.max(r,i)}let o=Math.max(0,Math.min(r-e,t.frontD-e));return n.height+o*q*Math.tan(n.rake*Math.PI/180)}function Ds(t,n){if(!t.facesAction)return!1;let e={x:-t.facing.y,y:t.facing.x},r=Io/q,o=Math.max(1,Math.ceil((t.backD-t.frontD)/r)),a={left:new Map,right:new Map};for(let s of n)if(!(s===t||s.plane.floorIndex!==t.plane.floorIndex)&&!(s.facing.x*t.facing.x+s.facing.y*t.facing.y>=ls))for(let l of s.sample){let u=-(l.x*t.facing.x+l.y*t.facing.y);if(u<t.frontD||u>t.backD)continue;let c=-l.x*t.facing.y+l.y*t.facing.x,f=c<t.latMin?"left":c>t.latMax?"right":null;if(!f)return!1;let m=Math.min(o-1,Math.floor((u-t.frontD)/r)),d=f==="left"?t.latMin-c:c-t.latMax;d<(a[f].get(m)?.gap??1/0)&&a[f].set(m,{gap:d,other:s})}let i=s=>{let l=s==="left"?t.latMin:t.latMax,u=0;for(let[c,{other:f}]of a[s]){if((f.facing.x*e.x+f.facing.y*e.y)*(s==="left"?1:-1)<as)continue;let d=t.frontD+(c+.5)*r,y={x:-d*t.facing.x+l*e.x,y:-d*t.facing.y+l*e.y},h=-(y.x*f.facing.x+y.y*f.facing.y),x=-y.x*f.facing.y+y.y*f.facing.x;h<f.frontD&&x>=f.latMin&&x<=f.latMax&&u++}return u/o>=cs};return i("left")&&i("right")}function Ns(t,n){if(n.plane.floorIndex!==t.plane.floorIndex||n.facing.x*t.facing.x+n.facing.y*t.facing.y<ys)return!1;let e=1/0,r=-1/0,o=1/0;for(let s of n.hull){let l=-s.x*t.facing.y+s.y*t.facing.x;e=Math.min(e,l),r=Math.max(r,l),o=Math.min(o,-(s.x*t.facing.x+s.y*t.facing.y))}let a=(t.frontD-o)*q;if(a<-ds||a>ps)return!1;let i=Math.max(e-t.latMax,t.latMin-r);return i*q<=xs&&i*q>=-bs}function Gs(t,n=!1,e=!1,r){let o=n?$i:qi,a=new Set(e?[]:t.filter(h=>!h.authored&&Ds(h,t))),i=[...t].sort((h,x)=>h.plane.floorIndex-x.plane.floorIndex||Number(a.has(x))-Number(a.has(h))||h.frontDistance-x.frontDistance);for(let h of a)r?.add(h.id);let s=(h,x,g)=>{let b=new Map,I=[],w=new Map,P=p=>{if(p.plane.floorIndex===0||p.plane.baseHeightM>0)return p.plane.baseHeightM;let _=w.get(p.plane.floorIndex-1);return _===void 0?p.plane.baseHeightM:_+ve};for(let p of i){if(a.has(p))p.height=P(p),p.level=0,p.rake=0,p.backHeight=p.height,b.set(p.id,void 0);else if(!p.authored){let M=P(p),R;for(let A of I){if(A.plane.floorIndex>p.plane.floorIndex)continue;if(Fs(p,A)){let O=vs(p,A)+os;O>M&&(M=O,R=A);continue}let B=ks(p,A,a.has(A));if(B==null)continue;let T=e&&!!p.plane.stageDeck&&A.level===0&&A.plane.floorIndex===p.plane.floorIndex&&Math.max(0,B)*q<=is,F=a.has(A)?A.height+us:T?A.backHeight:A.backHeight+Ui+Math.min(Wi,Math.max(0,B)*q)*Math.tan(A.rake*Math.PI/180);F>M&&(M=F,R=A)}let E=h.get(p);E&&E.height>M+.01?(M=E.height,R=void 0):E=void 0,p.height=Math.round(Math.min(M,p.plane.baseHeightM+Zi)*100)/100;let C=!R&&!E&&p.height>p.plane.baseHeightM;if(p.level=R?R.level+1:E?E.level:C?1:0,p.rake=Cs(p.rowDepths,p.frontDistance,p.height,p.plane.focalHeightM),!p.facesAction&&p.rowCount<ts)p.rake=0;else if(p.level===0){let A=Math.max(1e-6,(p.backD-p.frontD)*q);p.rake=Math.min(p.rake,Ki,Math.round(Math.atan(Vi/A)*1800/Math.PI)/10)}else p.rowCount>=2&&(p.rake=Math.max(p.rake,o[Math.min(p.level,o.length)-1]));let v=(p.backD-p.frontD)*q,k=R&&a.has(R)||E&&g?.has(E.id);if(x!==void 0&&k&&p.rowCount>=2&&(p.rake=x),n&&v>0&&p.height+v*Math.tan(p.rake*Math.PI/180)>p.plane.baseHeightM+bo){let A=Math.max(0,p.plane.baseHeightM+bo-p.height);p.rake=Math.max(Po,Math.round(Math.atan(A/v)*1800/Math.PI)/10)}e&&p.plane.stageDeck&&p.level>0&&(p.rake=Math.min(p.rake,ss)),p.backHeight=p.height+v*Math.tan(p.rake*Math.PI/180),b.set(p.id,R?.id??(E?b.get(E.id):void 0))}let _=p.plane.floorIndex;w.set(_,Math.min(w.get(_)??1/0,p.height)),I.push(p)}return b},l=s(new Map),u=new Map,c=h=>u.get(h)?.height??h.height;for(let h=!0,x=0;h&&x<t.length;x++){h=!1;for(let g of t)if(!(g.authored||a.has(g)))for(let b of t){let I=u.get(b)??b;b===g||I.height-I.plane.baseHeightM<gs||I.height<=c(g)+.01||Ns(g,b)&&(u.set(g,I),h=!0)}}let f=new Map(t.map(h=>[h.id,h])),m=t.filter(h=>!h.authored&&h.rowCount>=2&&a.has(f.get(l.get(h.id)??""))),d=m.length?$n(m.map(h=>h.rake)):void 0;if(!u.size&&d===void 0)return l;let y=new Map([...new Set(u.values())].map(h=>[h,{...h}]));return s(new Map([...u].map(([h,x])=>[h,y.get(x)])),d,new Set(m.map(h=>h.id)))}var Zn=(t,n)=>!!t&&t.x===n.x&&t.y===n.y;function Ao(t,n={x:0,y:-40}){let e=Mn(t),r=new Map;for(let g of e){if(!g.sectionId)continue;let b=r.get(g.sectionId);b?b.push(g):r.set(g.sectionId,[g])}let o={focalInferred:!1,confident:!1,sections:[]},a=t.floors?.length?t.floors.map((g,b)=>({objects:g.objects,floorIndex:b,floorId:g.id,baseHeightM:g.baseHeightM??0,focal:g.focalPoint??t.focalPoint})):[{objects:t.objects,floorIndex:0,floorId:void 0,baseHeightM:0,focal:t.focalPoint}],i=new Set(a.flatMap(g=>g.objects.filter(b=>b.type==="table").map(b=>b.id))),s=[],l,u=new Set,c=a.map(g=>{let b=k=>!t.floors?.length||k.floorId===g.floorId,I=Ts(e.filter(k=>!k.sectionId&&k.kind!=="booth"&&!i.has(k.rowId)&&b(k))),w=[];for(let k of I){let A=It(Et(_o(k)),Ss/q);if(e.some(T=>!b(T)&&Jn(T,A)))continue;let B=`${go}${g.floorIndex}-${w.length}`;u.add(B),r.set(B,k),w.push({type:"section",id:B,label:"",color:Is,outline:A})}let P=w.length?{...g,objects:[...g.objects,...w]}:g,p=new Set(P.objects.filter(k=>k.type==="section").map(k=>k.logicalSectionId??k.id)),_=[...r.entries()].filter(([k])=>p.has(k)).flatMap(([,k])=>k),M=Es(P.objects,Qn(_),_),R=P.focal;(M||P.focal&&!Zn(P.focal,n))&&(o.confident=!0),M&&(o.stage??={id:M.shape.id,inferred:M.inferred,...P.floorId?{floorId:P.floorId}:{}},(M.inferred||Zn(P.focal,n))&&(R=M.centre,o.focalInferred=!0));let E=M&&(!M.inferred||ln(M.outline)*q*q<=Vn),C=M?void 0:l,v={tableIds:i,floorIndex:P.floorIndex,floorId:P.floorId,baseHeightM:P.baseHeightM,focal:C?.focal??R,outline:M?.outline??C?.outline,focalHeightM:C?.focalHeightM??P.baseHeightM+(M&&E?Rt({...M.shape,role:"stage"}).heightM:0),stageDeck:C?.stageDeck??!!(M&&E&&ln(M.outline)*q*q<=Vn),middle:_.length?{x:_.reduce((k,A)=>k+A.x,0)/_.length,y:_.reduce((k,A)=>k+A.y,0)/_.length}:R};for(let k of P.objects){if(k.type!=="section")continue;let A=Os(k,r.get(k.logicalSectionId??k.id)??[],v);A&&s.push(A)}return v.outline&&(l=v),Zn(P.focal,v.focal)||(o.focal??=[]).push({...P.floorId?{floorId:P.floorId}:{},point:{...v.focal}}),{unit:P,plane:v,stage:M,planeSeats:_}}),f=a.flatMap(g=>g.objects).map(g=>g.type==="shape"&&!g.role&&(Kn(g.label)==="wall"||!Kn(g.label)&&xo(g))?{...g,role:"wall"}:g),m=Vt({objects:f},e)!==null;m&&(o.indoor=!0);let d=new Set,y=Gs(s,m,Ls(e,c[0]?.plane.focal??n)<rs,d),h=new Map(s.filter(g=>!g.authored).map(g=>[g.id,g])),x=c.map(({unit:g,plane:b,stage:I,planeSeats:w})=>g.objects.map(P=>{let p=P.type==="shape"&&!P.role&&P.id!==I?.shape.id?Kn(P.label):null;if(P.type==="shape"&&!P.role&&P.id!==I?.shape.id&&(p==="wall"||!p&&xo(P))&&P.type==="shape"){(o.roles??=[]).push({id:P.id,...b.floorId?{floorId:b.floorId}:{},role:"wall"});let{fill:A,...B}=P;return{...B,role:"wall"}}if(p&&P.type==="shape")return(o.roles??=[]).push({id:P.id,...b.floorId?{floorId:b.floorId}:{},role:p}),{...P,role:p};let M=I?.inferred&&P.id===I.shape.id&&P.type==="shape"?_s(P,I.outline,g.objects,w):null;if(M&&P.type==="shape")return o.stage?.id===P.id&&(o.stage.field=M),{...P,role:"stage",stageKind:M};let R=P.type==="shape"&&P.id===I?.shape.id&&P.heightM===void 0&&!P.stageKind&&s.some(A=>A.plane===b&&(d.has(A.id)||A.level===0&&A.facesAction&&A.rake<=ms&&(A.frontDistance+A.backD-A.frontD)*q>=hs)),E=R?{heightM:fs}:{};if(I?.inferred&&P.id===I.shape.id&&P.type==="shape"&&ln(I.outline)*q*q<=Vn)return o.stage?.id===P.id&&(o.stage.deck=!0),{...P,role:"stage",...E};if(R&&P.type==="shape"&&P.role==="stage")return{...P,...E};let C=P.type==="section"?h.get(P.id):void 0;if(!C||P.type!=="section")return P;let v=C.rowCount>=2&&C.rake>0;u.has(C.id)?o.looseRowBlocks=(o.looseRowBlocks??0)+1:o.sections.push({id:C.id,floorId:b.floorId,surfaceKind:v?"rakedRows":"flat",height:C.height,rake:C.rake,stackedOn:y.get(C.id)});let k={status:"inferred",source:"public-2d-topology",note:As};return{...P,height:C.height,rake:C.rake,surfaceKind:v?"rakedRows":"flat",physical3dProvenance:{height:k,rake:k,surfaceKind:k}}}));if(t.floors?.length){let g=t.floors.map((b,I)=>({...b,objects:x[I],focalPoint:c[I].plane.focal}));return{doc:{...t,floors:g,objects:g[0].objects,focalPoint:g[0].focalPoint},report:o}}return{doc:{...t,objects:x[0],focalPoint:c[0].plane.focal},report:o}}function $l(t,n,e){return e<0?n>1?t.filter(r=>r.kind==="floor"):[...t]:t.filter(r=>r.floorIndex===void 0||r.floorIndex===e)}function Ql(t,n){let e=[...t].sort((o,a)=>o.screen.y-a.screen.y),r=[];for(let o of e){let a=r.find(i=>i.some(s=>Math.abs(s.screen.x-o.screen.x)<104&&Math.abs(s.screen.y-o.screen.y)<34));a?a.push(o):r.push([o])}return r.flatMap(o=>o.length<2?o:o.map((a,i)=>({...a,screen:{...a.screen,x:Math.max(54,Math.min(n-54,a.screen.x+(i-(o.length-1)/2)*104))}})))}var Hs=1.15,Xs=2.75,js=4.5,Us=.85,Ws=.5,Ys=.26;function Jl(t,n,e){let r=Math.max(1e-6,n),o=t/r,a=e?.hasZoneLabels??!0,i=new Set(["stage"]);return o>=.75&&i.add("floor"),o>=Hs&&i.add("zone"),o<=(a?Xs:js)&&(i.add("section"),i.add("ga")),o<=Us&&(i.add("annotation"),i.add("booth")),o<=Ws&&i.add("row"),o<=Ys&&i.add("seat"),i}function tu(t,n,e,r,o,a=6){let i=a+n,s=r-a-n,l=a+e,u=o-a-e;return{...t,x:i>s?r/2:Math.max(i,Math.min(s,t.x)),y:l>u?o/2:Math.max(l,Math.min(u,t.y))}}function nu(t,n,e,r){let o=t,a=n[0],i=n[1],s=n[2],l=o[0]*a+o[4]*i+o[8]*s+o[12],u=o[1]*a+o[5]*i+o[9]*s+o[13],c=o[2]*a+o[6]*i+o[10]*s+o[14],f=o[3]*a+o[7]*i+o[11]*s+o[15];if(!(f>1e-6))return{x:0,y:0,depth:1/0,visible:!1};let m=l/f,d=u/f,y=c/f,h=m>=-1.05&&m<=1.05&&d>=-1.05&&d<=1.05&&y<=1;return{x:(m*.5+.5)*e,y:(1-(d*.5+.5))*r,depth:y,visible:h}}function eu(t,n,e=n){let r=[],o=[...t].sort((a,i)=>a.screen.depth-i.screen.depth);for(let a of o){let i=!1;for(let s of r)if(ne(a,s,n,e)){i=!0;break}i||r.push(a)}return r}var zs=6;function ne(t,n,e,r){let o=Math.abs(t.screen.x-n.screen.x),a=Math.abs(t.screen.y-n.screen.y),i=t.halfWidth!=null&&n.halfWidth!=null?Math.max(e,t.halfWidth+n.halfWidth+zs):e;return o<i&&a<r}function ou(t,n,e){return t.length*n*.58+(e?14:0)}var Ks={row:8,seat:14};function ru(t){return t<480?{row:5,seat:8}:t<768?{row:6,seat:10}:Ks}function iu(t,n,e,r){let o=Math.max(1,Math.min(e,r)*.5),a=Math.min(2,Math.hypot(t.x-e/2,t.y-r/2)/o);return n*(1+1.5*a)}function su(t,n,e,r,o=[]){let a=[...t].sort((s,l)=>(l.priority??0)-(s.priority??0)||s.focus-l.focus),i=[];for(let s of a){if(i.length>=r)break;let l=!1;for(let u of o)if(ne(s,u,n,e)){l=!0;break}if(!l){for(let u of i)if(ne(s,u,n,e)){l=!0;break}}l||i.push(s)}return i}function au(t,n,e,r){let o=t[3]*n[0]+t[7]*n[1]+t[11]*n[2]+t[15];return o<=0||!(e>0)?0:e*Math.hypot(t[0],t[4],t[8])*r/(2*o)}function Zt(t,n,e){if(t.length!==4||e<=n)return null;let r=xt(t),o=Math.hypot(r[1].x-r[0].x,r[1].y-r[0].y)*S,a=Math.hypot(r[3].x-r[0].x,r[3].y-r[0].y)*S;if(o<1e-6||a<1e-6)return null;let i=Math.min(.22/o,.16),s=Math.min(.28,(e-n)*.13),l=Math.min(.065/a,.2);return{quad:r,side:i,face:l,opening:yt(r,i,1-i),openingTop:e-s}}function ee(t,n,e){if(t.length!==4||e-n<=.2)return null;let r=xt(t),o=Math.hypot(r[1].x-r[0].x,r[1].y-r[0].y)*S;if(o<=1e-6)return null;let a=Math.min(.14,(e-n)*.08,o*.08),i=a/o,s=yt(r,i,1-i);return{quad:r,side:i,trim:a,inner:s,panel:an(s,.15,.85),bottom:n+a,top:e-a}}function wo(t,n,e,r){let o=ee(t,n,e);if(!o)return;let{panel:a}=o,i=(b,I)=>({x:(b.x+I.x)/2,y:(b.y+I.y)/2}),s=i(a[0],a[1]),l=i(a[3],a[2]),u=Math.hypot(s.x-r.x,s.y-r.y)<=Math.hypot(l.x-r.x,l.y-r.y),[c,f]=u?[a[0],a[1]]:[a[3],a[2]],m=u?{x:s.x-l.x,y:s.y-l.y}:{x:l.x-s.x,y:l.y-s.y},d=Math.hypot(m.x,m.y);if(d<1e-6)return;-(f.y-c.y)*m.x+(f.x-c.x)*m.y<0&&([c,f]=[f,c]);let y=Math.min(.006,d*S*.05),h=m.x/d*y,x=m.y/d*y,g=(b,I)=>[b.x*S+h,I,b.y*S+x];return[g(c,o.bottom),g(f,o.bottom),g(c,o.top),g(f,o.top)]}import Vs from"polygon-clipping";function Ot(t,n,e,r,o,a,i,s={}){let l=Tt(n),u=s.ao??Y,c=o.flatMap(h=>{if(h.role!=="entrance"&&h.role!=="exit")return[];let x=it(h);if(!x||x.length!==4||!zt(l,Tt(x)))return[];let g=s.portalBase??e,b=Zt(x,g,g+Rt(h).heightM);if(!b)return[];let I=Math.min(r,b.openingTop);return I<=e?[]:[{poly:b.opening,height:I}]});if(!c.length)return!1;let f=h=>h.map(x=>[x.x,x.y]),m=[f(n),...(s.holes??[]).map(f)],d=[e,...new Set(c.map(h=>h.height)),r].sort((h,x)=>h-x),y=[];try{for(let h=1;h<d.length;h++){let x=d[h-1],g=d[h];if(g-x<1e-6)continue;let b=c.filter(w=>w.height>x+1e-6).map(w=>[f(w.poly)]),I=b.length?Vs.difference(m,...b):[m];y.push({low:x,high:g,polys:I})}}catch{return!1}for(let h of y)for(let x of h.polys){let[g,...b]=x.map(w=>w.map(([P,p])=>({x:P,y:p}))),I=w=>u.wallBottom+(u.top-u.wallBottom)*(w-e)/(r-e);V(t,g,b,()=>h.high,h.low,a,i,{...u,top:I(h.high),wallBottom:I(h.low)})}return!0}function Eo(t,n,e,r,o,a,i){let s=r-e;if(s<=0)return;let l=s<1.5?[[e,r,1]]:[[e,e+Math.min(.9,s*.18),.82],[e+Math.min(.9,s*.18),r-.1,1],[r-.1,r,1.1]],u=c=>Y.wallBottom+(Y.top-Y.wallBottom)*(c-e)/s;for(let[c,f,m]of l){let d={...Y,top:u(f),wallBottom:u(c)},y=Z(a,m),h=Z(i,m);Ot(t,n,c,f,o,y,h,{portalBase:e,ao:d})||V(t,n,void 0,()=>f,c,y,h,d)}}function un(t,n,e){let r=ot(n.stroke?.color),o=n.stroke?.width??0;if(!r||!Number.isFinite(o)||o<=0)return;let a=n.kind==="line"||n.kind==="polyline",i=a?En(n.points??[],n.rotation):it(n);if(!i||i.length<2)return;let s=a?i.length-1:i.length,l=o*.5;for(let u=0;u<s;u++){let c=i[u],f=i[(u+1)%i.length],m=Math.hypot(f.x-c.x,f.y-c.y);if(m<1e-6)continue;let d=-(f.y-c.y)/m*l,y=(f.x-c.x)/m*l,h=[(c.x+d)*S,e,(c.y+y)*S],x=[(f.x+d)*S,e,(f.y+y)*S],g=[(f.x-d)*S,e,(f.y-y)*S],b=[(c.x-d)*S,e,(c.y-y)*S];t.tri(h,x,g,[0,1,0],r),t.tri(h,g,b,[0,1,0],r)}}function Bo(t){return t==="bar"||t==="concession"||t==="coat"||t==="restroom"}var qt=(t,n,e)=>({x:t.x+(n.x-t.x)*e,y:t.y+(n.y-t.y)*e});function Bn(t,n,e,r){let[o,a,i,s]=n?t:[t[3],t[2],t[1],t[0]];return[qt(o,s,e),qt(a,i,e),qt(a,i,r),qt(o,s,r)]}function To(t,n,e,r,o,a,i,s,l=!1){if(e.length!==4||o-r<.4)return!1;let u=M=>l?Math.min(M,o):M,c=xt(e),f=Math.hypot(c[3].x-c[0].x,c[3].y-c[0].y)*S;if(f<.4)return!1;let m=qt(c[0],c[1],.5),d=qt(c[3],c[2],.5),y=Math.hypot(m.x-s.x,m.y-s.y)<=Math.hypot(d.x-s.x,d.y-s.y),h=et(i,[.92,.9,.86],.35),x=Z(a,.72),g=o-r;if(n==="restroom"){let M=Math.min(.18,g*.08);return J(t,c,o-M,r,i,a),J(t,c,o,o-M,h,h),!0}let b=r+Math.min(1.1,g),I=n==="coat"?1:Math.min(.5,.75/f),w=Bn(c,y,0,I);if(J(t,w,b-.05,r,x,a),J(t,w,b,b-.05,h,h),n==="coat"||f<1.2)return!0;if(n==="bar"){let M=Bn(c,y,Math.max(I+.2,1-.45/f),1),R=u(r+Math.max(Math.min(2.2,g*2),b-r+.6));return J(t,M,R,r,i,x),!0}let P=Bn(c,y,Math.max(I+.25,.55),1),p=u(r+Math.max(2.6,b-r+1.4));if(p-.14<=b)return!0;J(t,P,p-.14,r,i,a),J(t,c,p,p-.14,h,x);let _=Math.min(.08,.1/Math.max(.1,Math.hypot(c[1].x-c[0].x,c[1].y-c[0].y)*S));for(let[M,R]of[[0,_],[1-_,1]])J(t,Bn(yt(c,M,R),y,0,Math.min(.08,.1/f)),p-.14,b,x,x);return!0}var Dt=.06,Zs=.05,Co=.05,Oo=.15,oe=25;function ko(t,n,e){let r=new Map,o=new Array(n.length).fill(null),a=new Float64Array(n.length),i=new Array(n.length).fill(void 0),s=new Array(n.length).fill(void 0),l=new Map,u=[],c=new Set;for(let m=0;m<t.length;m+=1){let d=t[m];for(let y of d.objects){if(y.type==="table"&&c.add(y.id),y.type!=="section"||!y.outline||y.outline.length<3)continue;let h=It(y.outline,Pt);l.set(y.id,{section:y,unit:d,frontU:1/0,hasSeats:!1,rows:new Map,seatIndices:[]}),u.push({id:y.id,floorIndex:m,box:Tt(h),section:y,unit:d,outline:h})}}let f=new Map;for(let m of u){let d=f.get(m.floorIndex);d?d.push(m):f.set(m.floorIndex,[m])}for(let m=0;m<n.length;m++){let d=n[m],y=e?f.get(e[m])??[]:u,h=d.sectionId?y.find(g=>g.id===d.sectionId)??y.find(g=>g.section.logicalSectionId===d.sectionId&&wt({x:d.x,y:d.y},g.outline,g.section.holes)):void 0,x=h?[h]:y;for(let g of x){if(e&&g.floorIndex!==e[m]||!h&&(d.x<g.box.minX||d.x>g.box.maxX||d.y<g.box.minY||d.y>g.box.maxY||!wt({x:d.x,y:d.y},g.outline,g.section.holes)))continue;o[m]=g.id;let b=l.get(g.id);b.hasSeats=!0;let I=d.focalPoint??g.unit.focal,w=Math.hypot(d.x-I.x,d.y-I.y);w<b.frontU&&(b.frontU=w),b.seatIndices.push(m);let P=d.rowId||`__seat-${m}`,p=b.rows.get(P);p?p.push({x:d.x,y:d.y}):b.rows.set(P,[{x:d.x,y:d.y}]);break}}for(let[m,d]of l){let y=Wt(d.section,{floorBaseHeightM:d.unit.baseHeightM}),h=d.unit.baseHeightM,x=y.rake>0?Math.tan(y.rake*Math.PI/180):0,g=y.rake<=.01&&y.height<=h+.001,b=d.section.surfaceKind,I=b==="flat"?!0:b==="rakedRows"&&y.rake>.01?!1:g,w=d.hasSeats?Se(m,n,d.seatIndices,d.unit.focal):{sectionId:m,rows:[],blockCount:0},p=w.rows.length<2?ke([...d.rows.values()].map(O=>({points:O})),d.unit.focal):null,_=1/0;if(p){if(d.hasSeats)for(let O of d.rows.values())for(let L of O){let D=p.depthAt(L.x,L.y);D<_&&(_=D)}if(!d.hasSeats||!Number.isFinite(_)){_=1/0;for(let O of d.section.outline){let L=p.depthAt(O.x,O.y);L<_&&(_=L)}}}let M=h+Zs,R=Math.max(M,y.height),E=O=>{let L=Math.max(0,O-_)*q,D=Math.min(L*x,oe);return Math.max(M,y.height+D)},C=O=>{let L=Math.max(0,O)*q,D=Math.min(L*x,oe);return Math.max(M,y.height+D)},v=I?[]:w.rows.map(O=>({pts:O.pts,y:C(O.blockDepth),depth:O.blockDepth,blockId:O.blockId,...c.has(O.id)?{patch:Je(O.pts,Pt)}:{}})),k=v.length?v[0].y:R,A=v.map(O=>{let L=O.patch&&O.patch.length>=3?O.patch:O.pts,D=0,G=0;for(let X of L)D+=X.x,G+=X.y;let j=L.length||1;D/=j,G/=j;let U=0;for(let X of L){let W=Math.hypot(X.x-D,X.y-G);W>U&&(U=W)}return{cx:D,cy:G,rad:U}}),B=I?()=>R:v.length>=2?(O,L)=>{let D=1/0,G=k;for(let j=0;j<v.length;j++){let U=A[j];if(Math.hypot(O-U.cx,L-U.cy)-U.rad>=D)continue;let X=v[j].patch,W=X&&X.length>=3?pt(X,O,L)?0:bn(X,O,L):bn(v[j].pts,O,L);W<D&&(D=W,G=v[j].y)}return G}:(O,L)=>p?E(p.depthAt(O,L)):R,T=[0,1,0],F=v.length>=2||I?()=>T:(O,L)=>{if(!p)return T;let D=p.depthAt(O,L);if(D<=_)return T;let G=(D-_)*q;if(G*x>=oe||y.height+G*x<=M)return T;let[j,U]=p.gradientAt(O,L);if(j===0&&U===0)return T;let X=1/Math.hypot(x,1);return[-j*x*X,X,-U*x*X]};if(!I)for(let O of w.rows){let L=C(O.blockDepth);for(let D of O.seatIndices)i[D]=L}for(let O of w.rows){let L=[];for(let X=1;X<O.pts.length;X++){let W=Math.hypot(O.pts[X].x-O.pts[X-1].x,O.pts[X].y-O.pts[X-1].y);W>1e-6&&L.push(W)}L.sort((X,W)=>X-W);let D=L.length?L[Math.floor(L.length/2)]:1/0,G=1/0,j=O.pts[Math.floor(O.pts.length/2)];if(j)for(let X of w.rows){if(X===O||X.blockId!==O.blockId)continue;let W=bn(X.pts,j.x,j.y);W>1e-6&&W<G&&(G=W)}let U=Math.min(D,Math.max(G,D*.5));if(Number.isFinite(U)&&U>0)for(let X of O.seatIndices)s[X]=U}r.set(m,{sectionId:m,deckAt:B,normalAt:F,flat:I,bottomY:h,rowLevels:v,landingY:k})}for(let m=0;m<n.length;m++){let d=o[m],y=n[m];if(d){let g=i[m];a[m]=(g??r.get(d).deckAt(y.x,y.y))+Oo;continue}let h=y.eyeHeightM,x=Number.isFinite(h)?Math.max(0,h-xn):0;a[m]=y.kind==="booth"?x+Dt+Oo:x}return{bySection:r,seatOwner:o,seatDeckY:m=>a[m],seatPitchU:m=>s[m]}}var qs=[.12,.38,.16],$s=[.72,.62,.45],Qs=[.88,.93,.96],Fo=[.95,.95,.94],Js=[.66,.29,.22],re={length:20.12,width:3.05},ta=.14,na=9.76,Ct=[.93,.94,.95],Tn=[.1,.11,.13],ea=[.45,.85,1.25],oa=1.45,Lo=.012,vo=.004,ra=1.07,ia=.15;function Qt(t,n,e,r,o,a){t.setMaterial(a),V(t,n,e?[e.slice().reverse()]:void 0,()=>r,r-.004,o,o,Y)}var Do=(t,n)=>Lt(t,n/S);function No(t,n,e){let r=n.x-t.x,o=n.y-t.y,a=Math.hypot(r,o);if(a<1e-9)return null;let i=-o/a*e,s=r/a*e;return[{x:t.x+i,y:t.y+s},{x:n.x+i,y:n.y+s},{x:n.x-i,y:n.y-s},{x:t.x-i,y:t.y-s}]}function sa(t,n,e,r){let o=n.map(a=>[a.x*S,e,a.y*S]);t.tri(o[0],o[1],o[2],[0,1,0],r),t.tri(o[0],o[2],o[3],[0,1,0],r)}function On(t,n,e,r,o,a){let i=e/S,s=[{x:n.x-i,y:n.y-i},{x:n.x+i,y:n.y-i},{x:n.x+i,y:n.y+i},{x:n.x-i,y:n.y+i}];V(t,s,void 0,()=>o,r,a,Z(a,.85),Y)}function $t(t,n,e,r,o,a,i){let s=No(n,e,r/S);s&&V(t,s,void 0,()=>a,o,i,Z(i,.85),Y)}function Cn(t){let n=xt(t),e={x:(n[0].x+n[2].x)/2,y:(n[0].y+n[2].y)/2},r=Math.hypot(n[1].x-n[0].x,n[1].y-n[0].y)||1,o=Math.hypot(n[3].x-n[0].x,n[3].y-n[0].y)||1,a={x:(n[1].x-n[0].x)/r,y:(n[1].y-n[0].y)/r},i={x:(n[3].x-n[0].x)/o,y:(n[3].y-n[0].y)/o};return{at:(l,u)=>({x:e.x+(a.x*l+i.x*u)/S,y:e.y+(a.y*l+i.y*u)/S}),lengthM:r*S,widthM:o*S}}function Go(t,n,e){let r=_e(n);if(!r.length)return;let o=1/0,a=-1/0,i=1/0,s=-1/0;for(let I of n.points??[])o=Math.min(o,I.x),a=Math.max(a,I.x),i=Math.min(i,I.y),s=Math.max(s,I.y);let l=(n.rotation??0)*Math.PI/180,u=Math.cos(l),c=Math.sin(l),f=(o+a)/2,m=(i+s)/2,d=I=>l?{x:f+(I.x-f)*u-(I.y-m)*c,y:m+(I.x-f)*c+(I.y-m)*u}:I,y=Math.min(a-o,s-i)*S,h=Math.max(.04,Math.min(.3,y*.004))/S,x=0;t.setMaterial(0);for(let I of r){if(!I.fill)continue;let w=I.points.map(d);Qt(t,w,null,e+Lo+x*vo,ot(I.fill)??Ct,0),x++}let g=r.filter(I=>!(I.fill&&I.ink===I.fill)),b=[...new Set(g.map(I=>I.ink??Hn))];for(let I of b){let w=e+Lo+x++*vo,P=ot(I)??Ct;for(let p of g){if((p.ink??Hn)!==I)continue;let _=p.points.map(d),M=p.closed?_.length:_.length-1;for(let R=0;R<M;R++){let E=No(_[R],_[(R+1)%_.length],h);E&&sa(t,E,w,P)}}}}function Ho(t,n,e,r,o){if(n.length<3)return!1;let a=r+.006,i=o??qs;if(e==="oval-cricket"){let s=n.reduce((P,p)=>P+p.x,0)/n.length,l=n.reduce((P,p)=>P+p.y,0)/n.length,u=P=>n.map(p=>({x:s+(p.x-s)*P,y:l+(p.y-l)*P})),c=8;for(let P=0;P<c;P++){let p=u(1-P/c),_=P===c-1?null:u(1-(P+1)/c);Qt(t,p,_,a,Z(i,P%2?1.04:.96),4)}let f=n[0];for(let P of n)Math.hypot(P.x-s,P.y-l)>Math.hypot(f.x-s,f.y-l)&&(f=P);let m=Math.hypot(f.x-s,f.y-l)||1,d=(f.x-s)/m,y=(f.y-l)/m,h=-y,x=d,g=Math.min(1,2*m*S*ta/re.length),b=re.length*g/2/S,I=re.width*g/2/S,w=[[-b,-I],[b,-I],[b,I],[-b,I]].map(([P,p])=>({x:s+d*P+h*p,y:l+y*P+x*p}));return Qt(t,w,null,a+.004,$s,0),t.setMaterial(0),!0}if(e==="rink-hockey"){let s=Do(n,ia);return Qt(t,s,null,a,Qs,0),t.setMaterial(0),V(t,n,[s.slice().reverse()],()=>r+ra,r,Fo,Z(Fo,.9),Y),!0}if(e==="ring-boxing"&&n.length===4){let{at:s}=Cn(n),l=[s(-3.05,-3.05),s(3.05,-3.05),s(3.05,3.05),s(-3.05,3.05)],u=[[.77,.19,.19],Ct,[.17,.42,.69],Ct];t.setMaterial(0),l.forEach((c,f)=>On(t,c,.07,r,r+oa,u[f]));for(let c of ea)for(let f=0;f<4;f++)$t(t,l[f],l[(f+1)%4],.025,r+c-.025,r+c+.025,Ct);return!0}if(e==="court-tennis"&&n.length===4){let{at:s}=Cn(n);t.setMaterial(0),$t(t,s(0,-6.4),s(0,6.4),.015,r,r+.95,Tn),$t(t,s(0,-6.4),s(0,6.4),.03,r+.95,r+1,Ct);for(let l of[-1,1])On(t,s(0,l*6.4),.05,r,r+1.07,Tn);return!0}if(e==="court-basketball"&&n.length===4){let{at:s,lengthM:l}=Cn(n),u=Math.min(14,l/2-.5);t.setMaterial(0);for(let c of[-1,1]){let f=s(c*(u+1.2),0),m=s(c*(u-1.2),0);On(t,f,.12,r,r+3.4,Tn),$t(t,f,m,.06,r+3.25,r+3.4,Tn),$t(t,s(c*(u-1.2),-.9),s(c*(u-1.2),.9),.03,r+2.9,r+3.95,Ct)}return!0}if(e==="pitch-rugby"&&n.length===4){let{at:s,lengthM:l}=Cn(n),u=l*(50/120);t.setMaterial(0);for(let c of[-1,1]){for(let f of[-2.8,2.8])On(t,s(c*u,f),.07,r,r+12,Ct);$t(t,s(c*u,-2.8),s(c*u,2.8),.06,r+2.94,r+3.06,Ct)}return!0}if(e==="track-athletics"){let s=Do(n,na);return s.length<3?!1:(Qt(t,n,s,a,Js,0),Qt(t,s,null,a,i,4),t.setMaterial(0),!0)}return!1}var Xo=[.19,.4,.15],aa=.012,Ln=2.4,ca=1,la=.75,ua=.15;function _t(t){if(t.points&&t.points.length>=3)return t.points;let{center:n,width:e,height:r,rotation:o}=t;if(!e||!r)return null;let a=(o??0)*Math.PI/180,i=Math.cos(a),s=Math.sin(a),l=e/2,u=r/2;return[[-l,-u],[l,-u],[l,u],[-l,u]].map(([c,f])=>({x:n.x+c*i-f*s,y:n.y+c*s+f*i}))}function Ko(t,n,e,r,o,a,i=!1){let s=_t(n);if(s){if(i){let l=Xt(r,o.boothTop),u=Et([...s]);V(t,It(u,fa/S),[u.slice().reverse()],()=>e+.03,e,l,Z(l,.8),Y);return}if(!(!n.points&&a&&ha(t,s,e,r,a))){if(!n.points&&a&&s.length===4){ma(t,s,e,r,a);return}V(t,s,void 0,()=>e+Ln,e,Xt(r,o.boothTop),o.boothWall,Y)}}}var ie=1.1,jo=[.9,.9,.88],fa=.1,kn=[.87,.87,.85],Uo=.08;function Vo(t,n){let e=l=>({x:(t[l].x+t[(l+1)%4].x)/2,y:(t[l].y+t[(l+1)%4].y)/2}),r=0,o=1/0;for(let l=0;l<4;l++){let u=e(l),c=Math.hypot(u.x-n.x,u.y-n.y);c<o&&(o=c,r=l)}let a=[0,1,2,3].map(l=>t[(r+l)%4]),i=(l,u,c)=>({x:l.x+(u.x-l.x)*c,y:l.y+(u.y-l.y)*c});return{q:a,part:(l,u,c,f)=>{let m=i(a[0],a[1],l),d=i(a[0],a[1],u),y=i(a[3],a[2],l),h=i(a[3],a[2],u);return[i(m,y,c),i(d,h,c),i(d,h,f),i(m,y,f)]},depthM:Math.hypot(a[3].x-a[0].x,a[3].y-a[0].y)*S,widthM:Math.hypot(a[1].x-a[0].x,a[1].y-a[0].y)*S}}function ma(t,n,e,r,o){let{q:a,part:i}=Vo(n,o),s=r??[.35,.42,.55],l=et(s,[.78,.78,.77],.62),u=et(s,[.95,.95,.94],.45);J(t,a,e+Dt,e,l,Z(l,.8)),J(t,i(.05,.95,.72,.98),e+ie-.05,e+Dt,u,Z(u,.8)),J(t,i(.03,.97,.7,1),e+ie,e+ie-.05,jo,Z(jo,.9))}function ha(t,n,e,r,o){if(n.length!==4)return!1;let{q:a,part:i,depthM:s,widthM:l}=Vo(n,o);if(s<1||l<1)return!1;let u=r??[.35,.42,.55],c=et(u,[.78,.78,.77],.62),f=e+Ln,m=Uo/l,d=Uo/s;J(t,a,e+Dt,e,c,Z(c,.8)),J(t,i(0,1,1-d,1),f,e+Dt,kn,Z(kn,.9));for(let[x,g]of[[0,m],[1-m,1]])J(t,i(x,g,0,1-d),f,e+Dt,kn,Z(kn,.9));J(t,i(m,1-m,0,Math.min(.5,.06/s)),f,f-.3,u,Z(u,.85));let y=Math.min(.4,.6/l),h=Math.min(.12,.3/s);return J(t,i(.5-y,.5+y,.72-h,.72+h),e+ca,e+Dt,et(u,[.95,.95,.94],.7),Z(u,.75)),!0}function vn(t){if(t.shape==="round"){let c=t.radius;return c?Rn(t.center.x,t.center.y,c,c,24):null}let{width:n,height:e,rotation:r,center:o}=t;if(!n||!e)return null;let a=(r??0)*Math.PI/180,i=Math.cos(a),s=Math.sin(a),l=n/2,u=e/2;return[[-l,-u],[l,-u],[l,u],[-l,u]].map(([c,f])=>({x:o.x+c*i-f*s,y:o.y+c*s+f*i}))}function Zo(t,n,e,r,o,a=!0){let i=vn(n);if(!i)return;let s=i.reduce((m,d)=>m+d.x,0)/i.length,l=i.reduce((m,d)=>m+d.y,0)/i.length,u=m=>i.map(d=>({x:s+(d.x-s)*m,y:l+(d.y-l)*m})),c=a&&r?Xt(r,o.tableTop):ya,f=e+la;V(t,i,void 0,()=>f,e+da,c,Z(c,.86),Y),V(t,u(.12),void 0,()=>f+.12,f,Wo,Z(Wo,.8),Y)}var ya=[.93,.92,.89],Wo=[.78,.66,.42],da=.25;function qo(t,n,e,r,o,a,i,s,l=[]){let u=it(n);if(!n.role&&(!n.fill||n.fill==="none"||n.fill==="transparent")||!u){un(t,n,e+r+aa);return}let f=s?s.kind==="stage":n.role==="stage",m=s?s.kind==="screen":n.role==="screen",d=s?{kind:f?"stage":"solid",heightM:s.topY-s.baseY}:Rt(n),y=s?.baseY??e,h=s?.topY??e+r;if(f&&i){let M=1/0,R=-1/0,E=1/0,C=-1/0;for(let v of u)v.x<M&&(M=v.x),v.x>R&&(R=v.x),v.y<E&&(E=v.y),v.y>C&&(C=v.y);i.push({cx:(M+R)/2*S,cz:(E+C)/2*S,y:h,halfX:Math.max((R-M)/2*S,.5),halfZ:Math.max((C-E)/2*S,.5)})}let x=ot(n.fill),g=n.role==="wall"||n.role==="entrance"||n.role==="exit",b=g?x?Z(St(x,.12),.95):o.tierTop:f&&x?et(o.stageTop,Z(St(x,.18),.9),.9):!n.role&&x?x:Xt(x,f?o.stageTop:o.decorTop),I=m?x:null,w=g?x?Z(St(x,.12),.85):o.tierWall:f?x?et(o.stageWall,Z(x,.58),.82):o.stageWall:m?I?et(Z(I,1.42),[.24,.46,.82],.08):[.24,.46,.82]:Xt(ot(n.fill),o.decorWall);if(n.role==="wall"&&!s){Eo(t,u,y,h,l,b,w),un(t,n,h+.012);return}if(m&&u.length===4&&h-y>.2){let M=ee(u,y,h);if(!M)return;let{quad:R,side:E,trim:C,inner:v,panel:k}=M,A=[.12,.15,.18];for(let[B,T]of[[0,E],[1-E,1]])J(t,yt(R,B,T),h,y,A,A);J(t,v,y+C,y,A,A),J(t,v,h,h-C,A,A),J(t,k,h-C,y+C,w,w),un(t,n,h+.012);return}let P=x?Z(St(x,.15),.82):w,p=x?Z(St(x,.1),1.02):b;if(Bo(n.role)&&!s&&To(t,n.role,u,y,h,P,p,a,n.heightM!==void 0))return;if((n.role==="sound"||s?.kind==="sound_desk")&&u.length===4&&h-y>.3){let M=xt(u),R=Math.hypot(M[1].x-M[0].x,M[1].y-M[0].y)*S,E=Math.min(.12,.09/Math.max(R,.001)),C=[.18,.21,.24],v=h-Math.min(.12,(h-y)*.15);for(let[k,A]of[[0,E],[1-E,1]])J(t,yt(M,k,A),v,y,C,C);J(t,M,h,v,b,C);return}if(n.role==="rail"&&u.length===4&&h>y){let M=xt(u),R=Math.hypot(M[1].x-M[0].x,M[1].y-M[0].y)*S,E=Math.max(1,Math.min(128,Math.ceil(R/1.4))),C=Math.min(.08,.055/Math.max(.055,R)),v=[.58,.64,.66];for(let k=0;k<=E;k++){let A=k/E,B=Math.min(1-C,Math.max(0,A-C/2));J(t,yt(M,B,B+C),h,y,v,Z(v,.8))}for(let k of[.52,1]){let A=y+(h-y)*k;J(t,M,A,Math.max(y,A-.055),v,Z(v,.8))}return}if(n.role==="goal"&&u.length===4){let M=xt(u),R=Math.hypot(M[1].x-M[0].x,M[1].y-M[0].y)*S,E=Math.min(.12,.1/Math.max(.1,R)),C=[.9,.94,.94];for(let[v,k]of[[0,E],[1-E,1]])J(t,yt(M,v,k),Math.max(y,h-.1),y,C,C);J(t,M,h,Math.max(y,h-.1),C,C);return}if(d.kind==="portal"&&u.length===4){let M=Zt(u,y,h);if(!M)return;let{quad:R,side:E,face:C,openingTop:v}=M;for(let[k,A,B]of[[0,C,1],[C,1-C,.67],[1-C,1,1]]){let T=an(R,k,A),F=Z(b,B),O=Z(w,B);for(let[L,D]of[[0,E],[1-E,1]])J(t,yt(T,L,D),v,y,F,O);J(t,T,h,v,F,O)}return}if(d.kind==="suite"&&u.length===4){let M=u.map((C,v)=>{let k=u[(v+1)%4],A=(C.x+k.x)/2,B=(C.y+k.y)/2;return Math.hypot(A-a.x,B-a.y)}),R=M.indexOf(Math.min(...M)),E=[0,1,2,3].map(C=>u[(R+C)%4]);J(t,yt(E,0,.08),h,y,b,w),J(t,yt(E,.92,1),h,y,b,w),J(t,an(E,.88,1),h,y,b,w),J(t,E,h,Math.max(y,h-.18),b,w);return}if(f&&!n.stageKind?.startsWith("pitch-")&&h-y>.12){let M=h-Math.min(.06,(h-y)*.15);J(t,u,M,y,b,w),J(t,u,h,M,b,et(b,w,.2))}else J(t,u,h,y,b,w);if((n.stageKind==="pitch-football"||n.stageKind==="pitch-rugby")&&u.length===4){t.setMaterial(4);let M=xt(u),R=et(x??Xo,Xo,x?.45:0);for(let E=0;E<12;E++){let C=yt(M,E/12,(E+1)/12),v=Z(R,E%2?1.09:.91),k=C.map(A=>[A.x*S,h+.006,A.y*S]);t.tri(k[0],k[1],k[2],[0,1,0],v),t.tri(k[0],k[2],k[3],[0,1,0],v)}}n.stageKind&&n.stageKind!=="pitch-football"&&Ho(t,u,n.stageKind,h,x),f&&Yt(n.stageKind)&&Go(t,n,h),t.setMaterial(m?1:0),un(t,n,h+.012)}function Dn(t){let{x:n,y:e,width:r,height:o}=t;if(!r||!o)return null;let a=n+r/2,i=e+o/2,s=(t.rotation??0)*Math.PI/180,l=Math.cos(s),u=Math.sin(s),c=r/2,f=o/2;return[[-c,-f],[c,-f],[c,f],[-c,f]].map(([m,d])=>({x:a+m*l-d*u,y:i+m*u+d*l}))}function pa(t){if(!t||!t.startsWith("data:image/svg+xml"))return null;let n=t.slice(t.indexOf(",")+1);if(/;base64/i.test(t.slice(0,t.indexOf(","))))try{n=atob(n)}catch{return null}else try{n=decodeURIComponent(n)}catch{}let e=n.match(/<(?:rect|path)\b[^>]*\bfill="([^"]+)"/i);if(!e)return null;let r=e[1].trim();if(r==="none"||r==="transparent")return null;let o=r.match(/^url\(#([^)]+)\)$/);if(!o)return ot(r);let a=n.match(new RegExp(`<(?:linear|radial)Gradient\\b[^>]*\\bid="${o[1]}"[^>]*>([\\s\\S]*?)</(?:linear|radial)Gradient>`,"i"));if(!a)return null;let i=[];for(let s of a[1].matchAll(/stop-color="([^"]+)"/gi)){let l=ot(s[1].trim());l&&i.push(l)}return i.length?i.reduce((s,l,u)=>et(s,l,1/(u+1)),i[0]):null}function $o(t,n,e,r){if(n.layer==="foreground")return;let o=Dn(n);if(!o)return;let a=e+ua,i=Xt(pa(n.href),r.decorTop),s=Math.max(0,Math.min(1,n.opacity??1));s<1&&(i=et(r.ground,i,s)),V(t,o,void 0,()=>a,e,i,et(i,r.decorWall,.5),Y)}function Qo(t,n,e,r,o){if(!n.points||n.points.length<3)return;let a=Ye(r,o.gaTop);V(t,n.points,n.holes,()=>e+Yo,e,a,o.gaWall,Y),ga(t,n.points,e+Yo)}var Yo=.15,Fn=[.72,.74,.76],se=1.1,zo=.12,ae=.05,xa=.06,ba=2.4;function ga(t,n,e){let r=Et([...n]),o=Lt(r,zo/S),a=Lt(r,(zo+ae)/S);if(o.length<3||a.length<3)return;for(let s of[e+se,e+se*.5])V(t,o,[a.slice().reverse()],()=>s,s-ae,Fn,Z(Fn,.85),Y);let i=xa/2/S;for(let s=0;s<o.length;s++){let l=o[s],u=o[(s+1)%o.length],c=Math.hypot(u.x-l.x,u.y-l.y)*S,f=Math.max(1,Math.round(c/ba));for(let m=0;m<f;m++){let d=m/f,y=l.x+(u.x-l.x)*d,h=l.y+(u.y-l.y)*d,x=[{x:y-i,y:h-i},{x:y+i,y:h-i},{x:y+i,y:h+i},{x:y-i,y:h+i}];V(t,x,void 0,()=>e+se-ae,e,Fn,Z(Fn,.8),Y)}}}var Ma=6,Pa=2.2,Jo=.1,Sa=new Set(["stage","entrance","exit","screen","suite","obstruction","sound","bar","concession","restroom","coat"]),Ia=.3,Ra=1.8,_a=.9,Aa=.55,wa=1,tr=4e3,Ea=6,nr="#d8a425",Ba="#e8c15a",ce="#1c1608";function er(t){let n=t.accessibility;if(n?.length)return{icon:n.includes("wheelchair")?"wheelchair":n[0],color:pn(n)};let e=t.commercial;return e?.obstructedView?{icon:"obstructedView",color:nr,ink:ce}:e?.restrictedView?{icon:"restrictedView",color:nr,ink:ce}:e?.premium?{icon:"premium",color:Ba,ink:ce}:null}var Ta=6e3;function rr(t){let{doc:n,units:e,seats:r,surfaces:o,focal:a}=t,i=n.zones??[],s=[];if(i.length){let l=new Map;for(let c of e)for(let f of c.objects)f.type==="section"&&f.zone&&l.set(f.id,f.zone);let u=new Map;for(let c=0;c<r.length;c++){let f=r[c],m=o.seatOwner[c],d=f.zoneId??(m?l.get(m):void 0);if(!d)continue;let y=u.get(d);y||(y={n:0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,sumY:0},u.set(d,y)),y.n++,f.x<y.minX&&(y.minX=f.x),f.y<y.minY&&(y.minY=f.y),f.x>y.maxX&&(y.maxX=f.x),f.y>y.maxY&&(y.maxY=f.y),y.sumY+=o.seatDeckY(c)}for(let c of i){let f=u.get(c.id),m=[];for(let[d,y]of l)y===c.id&&m.push(d);if(!f||f.n===0){s.push({id:c.id,label:c.label,color:ot(c.color),sectionIds:m,seatCount:0,center:[0,0,0],radius:0,focalWorld:[(c.focalPoint??a).x*S,1.5,(c.focalPoint??a).y*S]});continue}s.push({id:c.id,label:c.label,color:ot(c.color),sectionIds:m,seatCount:f.n,center:[(f.minX+f.maxX)/2*S,f.sumY/f.n,(f.minY+f.maxY)/2*S],radius:.5*Math.hypot((f.maxX-f.minX)*S,(f.maxY-f.minY)*S)||1,focalWorld:[(c.focalPoint??a).x*S,1.5,(c.focalPoint??a).y*S]})}}return s}function ir(t){let{doc:n,units:e,seats:r,surfaces:o,seatData:a,hintedSeatFloor:i,zones:s,focal:l}=t,u=[],c=[],f=[],m=new Map;for(let d of e)for(let y of d.objects){if(y.type!=="section"||!y.zone)continue;let h=(y.displayLabel||y.label||"").trim().toLocaleLowerCase();if(!h)continue;let x=n.floors?.[d.index]?.name?.trim().toLocaleLowerCase();if(e.length>1&&x===h)continue;let g=m.get(y.zone);g||m.set(y.zone,g=new Set),g.add(h)}for(let d of s)d.seatCount!==0&&(m.get(d.id)?.has(d.label.trim().toLocaleLowerCase())||u.push({id:`zone:${d.id}`,kind:"zone",text:d.label,anchor:[d.center[0],d.center[1]+Ma,d.center[2]],color:n.zones?.find(y=>y.id===d.id)?.color}));{let d=new Map,y=new Map;for(let h=0;h<r.length;h++){let x=o.seatOwner[h];if(!x)continue;let g=d.get(x);g||(g={n:0,x:0,y:0,deck:0},d.set(x,g)),g.n++,g.x+=r[h].x,g.y+=r[h].y,g.deck+=o.seatDeckY(h);let b=y.get(x);b||(b={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0,minDeck:1/0,maxDeck:-1/0},y.set(x,b)),b.minDeck=Math.min(b.minDeck,o.seatDeckY(h)),b.maxDeck=Math.max(b.maxDeck,o.seatDeckY(h)),r[h].x<b.minX&&(b.minX=r[h].x),r[h].x>b.maxX&&(b.maxX=r[h].x),r[h].y<b.minY&&(b.minY=r[h].y),r[h].y>b.maxY&&(b.maxY=r[h].y)}for(let h of e)for(let x of h.objects){if(x.type!=="section"||Mo(x))continue;let g=d.get(x.id);if(!g||g.n===0)continue;let b=y.get(x.id),I=[g.x/g.n*S,g.deck/g.n,g.y/g.n*S],w=x.displayLabel||x.label||x.id;c.push({id:x.id,floorIndex:h.index,label:w,seatCount:g.n,center:I,radius:Math.max(1,Math.hypot(b.maxX-b.minX,b.maxY-b.minY)*.5*S),box:{min:[b.minX*S-.4,b.minDeck,b.minY*S-.4],max:[b.maxX*S+.4,b.maxDeck+1,b.maxY*S+.4]},focalWorld:[h.focal.x*S,h.baseHeightM+1.5,h.focal.y*S]});let P=n.floors?.[h.index]?.name?.trim().toLocaleLowerCase();e.length>1&&P===w.trim().toLocaleLowerCase()||u.push({id:`section:${x.id}`,kind:"section",text:w,anchor:[I[0],I[1]+Pa,I[2]],floorIndex:h.index})}}{for(let P of e)for(let p of P.objects){if(p.type!=="gaArea")continue;let _=nn(p.points);if(!_)continue;let M=p.displayLabel||p.label||p.id;u.push({id:`ga:${p.id}`,kind:"ga",text:p.capacity>0?`${M} \xB7 ${p.capacity.toLocaleString()}`:M,anchor:[_.x*S,P.baseHeightM+Ra,_.y*S],floorIndex:P.index})}let d=new Map,y=new Map;for(let P of e)for(let p of P.objects)if(p.type==="section"&&d.set(p.id,p.displayLabel||p.label||p.id),p.type==="row"){let _=p.displayLabel?.trim()||p.segmentedRow?.displayLabel?.trim();_&&y.set(p.id,_)}let h=new Map;for(let P=0;P<r.length;P++){let p=r[P],_=Math.hypot(p.x-l.x,p.y-l.y),M=h.get(p.rowId);(!M||_>M.far)&&h.set(p.rowId,{seat:p,index:P,far:_})}for(let[P,p]of h){let _=o.seatOwner[p.index]??p.seat.sectionId,M=or(p.seat.label,P,d.get(_??""),y.get(P));M&&u.push({id:`row:${P}`,kind:"row",text:M,anchor:[p.seat.x*S,o.seatDeckY(p.index)+_a,p.seat.y*S],floorIndex:i[p.index]})}let x=new Map;for(let P=0;P<r.length;P++){let p=r[P],_=x.get(p.rowId);_||(_={n:0,x:0,y:0,z:0,minX:1/0,maxX:-1/0,minZ:1/0,maxZ:-1/0,label:or(p.label,p.rowId,d.get(o.seatOwner[P]??p.sectionId??""),y.get(p.rowId)),sectionId:o.seatOwner[P]??p.sectionId},x.set(p.rowId,_));let M=P*3,R=a.iPosition[M],E=a.iPosition[M+1],C=a.iPosition[M+2];_.n++,_.x+=R,_.y+=E,_.z+=C,_.minX=Math.min(_.minX,R),_.maxX=Math.max(_.maxX,R),_.minZ=Math.min(_.minZ,C),_.maxZ=Math.max(_.maxZ,C)}for(let[P,p]of x)f.push({id:P,label:p.label,sectionId:p.sectionId,seatCount:p.n,center:[p.x/p.n,p.y/p.n,p.z/p.n],radius:Math.max(.8,Math.hypot(p.maxX-p.minX,p.maxZ-p.minZ)*.5)});let g=0,b=(P,p)=>{g++,u.push({id:`access:${r[P].id}`,kind:"access",text:"",icon:p.icon,color:p.color,...p.ink?{ink:p.ink}:{},seatWidthM:a.iChairWidth[P]*2,anchor:[r[P].x*S,o.seatDeckY(P)+wa,r[P].y*S],floorIndex:i[P],rowId:r[P].rowId})},I=null,w=()=>{if(I){let P=er(r[I.seats[0]]),p=I.seats.length,_=Math.max(1,Math.round(p/Ea));for(let M=0;M<_&&g<tr;M++)b(I.seats[Math.min(p-1,Math.floor((M+.5)*p/_))],P)}I=null};for(let P=0;P<r.length&&g<tr;P++){let p=er(r[P]);if(p&&r[P].accessibility?.length){w(),b(P,p);continue}if(!p){w();continue}I&&I.rowId===r[P].rowId&&I.icon===p.icon?I.seats.push(P):(w(),I={rowId:r[P].rowId,icon:p.icon,seats:[P]})}if(w(),r.length<=Ta)for(let P=0;P<r.length;P++){let p=r[P],_=Oa(p.displayLabel||p.label);_&&u.push({id:`seat:${p.id}`,kind:"seat",seatWidthM:a.iChairWidth[P]*2,text:_,anchor:[p.x*S,o.seatDeckY(P)+Aa,p.y*S],floorIndex:i[P],rowId:p.rowId})}}for(let d of e)for(let y of d.objects)if(y.type==="shape"&&y.role&&Sa.has(y.role)){let h=it(y),x=h?nn(h):null;if(!x||!y.label)continue;u.push({id:`architecture:${y.id}`,kind:y.role==="stage"?"stage":"annotation",text:y.label,anchor:[x.x*S,d.baseHeightM+Rt(y).heightM+Jo,x.y*S],color:y.fill,floorIndex:d.index})}else if(y.type==="text"){if(!y.text)continue;u.push({id:`text:${y.id}`,kind:"annotation",text:y.text,anchor:[y.position.x*S,d.baseHeightM+Jo,y.position.y*S],color:y.color,rotation:y.rotation,floorIndex:d.index})}else if(y.type==="booth"){let h=_t(y);if(!h)continue;let x=nn(h);if(!x)continue;u.push({id:`booth:${y.id}`,kind:"booth",text:y.displayLabel||y.label||y.id,anchor:[x.x*S,d.baseHeightM+Ln+Ia,x.y*S],floorIndex:d.index})}return{labels:u,sections:c,rows:f}}function sr(t,n){if(n.length>1)for(let e of n)t.push({id:`floor:${e.id}`,kind:"floor",text:e.label,anchor:[e.center[0],e.box.max[1]+1.2,e.center[2]],floorIndex:e.index})}function Oa(t){let n=t.lastIndexOf("-");return n>=0&&n<t.length-1?t.slice(n+1):t}function or(t,n,e,r){if(r?.trim())return r.trim();let o=t?t.lastIndexOf("-"):-1,a=o>0?t.slice(0,o):n;return a&&Te(a,e)}var fn=3,jt=.38,mn=.24;function Ca(t){if(t.length<3)return null;let n=t[0],e=t[Math.floor(t.length/2)],r=t[t.length-1],o=(e.x-n.x)*S,a=(e.y-n.y)*S,i=(r.x-n.x)*S,s=(r.y-n.y)*S,l=2*(o*s-a*i);if(Math.abs(l)<1e-7)return null;let u=o*o+a*a,c=i*i+s*s,f=(u*s-c*a)/l+n.x*S,m=(o*c-i*u)/l+n.y*S,d=Math.hypot(n.x*S-f,n.y*S-m);return d<1||d>200||!Number.isFinite(d)||t.some(y=>Math.abs(Math.hypot(y.x*S-f,y.y*S-m)-d)>.03)?null:{x:f,z:m,radius:d}}function ar(t){let n=[],e=new Map,r=(l,u)=>`${Math.floor(l/fn)},${Math.floor(u/fn)}`;for(let l of t)for(let u of l.rows){for(let f of u.pts){let m=f.x*S,d=f.y*S,y=r(m,d),h=e.get(y)??[];h.push({x:m,z:d,y:u.y,floor:l.floorIndex}),e.set(y,h)}if(u.patch||u.pts.length<2)continue;let c=Ca(u.pts);for(let f of[0,u.pts.length-1]){let m=u.pts[f],d=u.pts[f===0?1:f-1],y=m.x-d.x,h=m.y-d.y,x=Math.hypot(y,h);x<1e-6||n.push({sectionId:l.sectionId,floorIndex:l.floorIndex,curve:c,row:u,point:m,x:m.x*S,z:m.y*S,dx:y/x,dz:h/x})}}let o=new Map;n.forEach((l,u)=>{let c=r(l.x,l.z),f=o.get(c)??[];f.push(u),o.set(c,f)});let a=(l,u)=>{let c=Math.floor(l/fn),f=Math.floor(u/fn);return[-1,0,1].flatMap(m=>[-1,0,1].map(d=>`${c+m},${f+d}`))},i=new Map;n.forEach((l,u)=>{let c=-1,f=1/0,m=!1;for(let d of a(l.x,l.z))for(let y of o.get(d)??[]){let h=n[y];if(l.sectionId===h.sectionId&&l.row.blockId===h.row.blockId||l.floorIndex!==h.floorIndex||Math.abs(l.row.y-h.row.y)>.05)continue;let x=h.x-l.x,g=h.z-l.z,b=Math.hypot(x,g);if(b<jt*2+.45||b>fn)continue;let I=l.curve&&h.curve&&Math.hypot(l.curve.x-h.curve.x,l.curve.z-h.curve.z)<=.05&&Math.abs(l.curve.radius-h.curve.radius)<=.05,w=Math.min((x*l.dx+g*l.dz)/b,(-x*h.dx-g*h.dz)/b);(I?w<.8:w<.98)||!I&&(Math.abs(x*l.dz-g*l.dx)>.15||Math.abs(x*h.dz-g*h.dx)>.15)||(b<f-.02?(c=y,f=b,m=!1):Math.abs(b-f)<=.02&&(m=!0))}c>=0&&!m&&i.set(u,c)});let s=[];for(let[l,u]of i){if(l>=u||i.get(u)!==l)continue;let c=n[l],f=n[u],m=Math.hypot(f.x-c.x,f.z-c.z),d=(f.x-c.x)/m,y=(f.z-c.z)/m,h=!1;for(let g of a((c.x+f.x)/2,(c.z+f.z)/2))for(let b of e.get(g)??[]){if(b.floor!==c.floorIndex||Math.abs(b.y-c.row.y)>.75)continue;let I=(b.x-c.x)*d+(b.z-c.z)*y,w=Math.abs((b.x-c.x)*y-(b.z-c.z)*d);I>.01&&I<m-.01&&w<mn+jt&&(h=!0)}if(h)continue;let x=(g,b)=>({x:(c.x+d*g-y*b)/S,y:(c.z+y*g+d*b)/S});s.push({sections:[c.sectionId,f.sectionId],blocks:[c.row.blockId,f.row.blockId],floorIndex:c.floorIndex,ends:[c.point,f.point],clearWidthM:m-2*jt,heightM:(c.row.y+f.row.y)/2,outline:[x(jt,-mn),x(m-jt,-mn),x(m-jt,mn),x(jt,mn)]})}return s}var ka=.15,Fa=.9,La=1.76;function cr(t){return!!t&&t[0]*.2126+t[1]*.7152+t[2]*.0722>.55?{zenith:[.36,.58,.84],horizon:[.82,.88,.94]}:{zenith:[.05,.08,.15],horizon:[.3,.38,.5]}}function va(){return{background:{top:[...Un.top],bottom:[...Un.bottom]},sky:cr(null),structure:jn,seatStates:{...He},seatScale:1,materials:{seat:null,shell:null,roughness:.78}}}function Da(t){return!!t&&t[0]*.2126+t[1]*.7152+t[2]*.0722>.55?{deck:"#c9ccc8",fascia:"#b4bab8",shell:"#c3c9c8",roughness:.87}:{deck:"#69747b",fascia:"#3e4d58",shell:"#526572",roughness:.87}}function lr(t){let n=va();t??={};let e=ot(t.background);if(e){n.background={top:Z(e,Fa),bottom:Z(e,La)},n.sky=cr(e);let s={};for(let[u,c]of Object.entries(jn))s[u]=et(c,e,ka);e[0]*.2126+e[1]*.7152+e[2]*.0722>.55&&(s.ground=Z(e,.86)),n.structure=s}let r=ot(t.selectionColor)??ot(t.accent);r&&(n.seatStates={...n.seatStates,selected:r});let o=t.seatScale;typeof o=="number"&&Number.isFinite(o)&&(n.seatScale=Ce(o));let a=Object.fromEntries(Object.entries(t.venue3d??{}).filter(([,s])=>s!=null)),i={...Da(e),...a};if(i){let s=ot(i.deck),l=ot(i.fascia);s&&(n.structure={...n.structure,tierTop:s,gaTop:s}),l&&(n.structure={...n.structure,tierWall:l,gaWall:l}),n.materials.seat=ot(i.seat),n.materials.shell=ot(i.shell),typeof i.roughness=="number"&&Number.isFinite(i.roughness)&&(n.materials.roughness=Math.min(1,Math.max(0,i.roughness)))}return n}function ur(t,n){let e=[];for(let r of n)e.push(...t.seatStates[r]);return e}var le=.6,fr=3,Na=.25;function Ga(t,n){if(pt(n,t.x,t.y))return 0;let e=1/0;for(let r=0,o=n.length-1;r<n.length;o=r++){let a=n[o],i=n[r],s=i.x-a.x,l=i.y-a.y,u=s*s+l*l||1,c=Math.max(0,Math.min(1,((t.x-a.x)*s+(t.y-a.y)*l)/u));e=Math.min(e,Math.hypot(t.x-(a.x+c*s),t.y-(a.y+c*l)))}return e}function mr(t,n){let e=t.map(i=>({booth:i,ring:_t(i)})).filter(i=>!!i.ring&&i.ring.length===4&&!i.booth.points),r=e.map(({ring:i})=>({minX:Math.min(...i.map(s=>s.x)),maxX:Math.max(...i.map(s=>s.x)),minY:Math.min(...i.map(s=>s.y)),maxY:Math.max(...i.map(s=>s.y))})),o=(fr+le)/S,a=new Map;return e.forEach(({booth:i,ring:s},l)=>{let u={x:s.reduce((d,y)=>d+y.x,0)/4,y:s.reduce((d,y)=>d+y.y,0)/4},c=[0,1,2,3].map(d=>{let y=s[d],h=s[(d+1)%4],x={x:(y.x+h.x)/2,y:(y.y+h.y)/2},g=x.x-u.x,b=x.y-u.y,I=Math.hypot(g,b)||1,w={x:x.x+g/I*le/S,y:x.y+b/I*le/S},P=fr/S;return r.forEach((p,_)=>{_===l||w.x<p.minX-o||w.x>p.maxX+o||w.y<p.minY-o||w.y>p.maxY+o||(P=Math.min(P,Ga(w,e[_].ring)))}),{open:P*S,toward:{x:x.x+g/I*10/S,y:x.y+b/I*10/S},focal:Math.hypot(x.x-n.x,x.y-n.y)}}),f=Math.max(...c.map(d=>d.open)),m=c.filter(d=>d.open>=f-Na).sort((d,y)=>d.focal-y.focal)[0];a.set(i.id,m.toward)}),a}import Ha from"polygon-clipping";var Xa=.45,ja=1500,Ua=200;function hr(t,n){if(t.role!=="stage"||Yt(t.stageKind))return t;let e=it(t);if(!e||e.length<3||Math.abs(dt(e))*S*S>ja)return t;let r=n.filter(i=>pt(e,i.x,i.y));if(!r.length||r.length>Ua)return t;let o=Xa/S,a=r.map(i=>[[[i.x-o,i.y-o],[i.x+o,i.y-o],[i.x+o,i.y+o],[i.x-o,i.y+o],[i.x-o,i.y-o]]]);try{let i=Ha.difference([[...e.map(u=>[u.x,u.y]),[e[0].x,e[0].y]]],...a),s=null,l=0;for(let u of i){let c=u[0].slice(0,-1).map(([m,d])=>({x:m,y:d})),f=Math.abs(dt(c));f>l&&(l=f,s=c)}return!s||s.length<3?t:{...t,kind:"polygon",points:s,rotation:0}}catch{return t}}function ue(t,n,e,r,o,a,i,s,l,u=[],c=o){if(n.length!==e.length||n.length<2||a-o<1.5)return;let f=(h,x,g)=>{Ot(t,h,x,g,u,i,s,{portalBase:c,ao:l})||V(t,h,void 0,()=>g,x,i,s,l)},m=(h,x,g)=>({x:h.x+(x.x-h.x)*g,y:h.y+(x.y-h.y)*g}),d=r?n.length:n.length-1,y=0;for(let h=0;h<d;h++){let x=(h+1)%n.length,g=Math.hypot(e[x].x-e[h].x,e[x].y-e[h].y)*q;if(g<1e-5)continue;let b=(p,_)=>[m(n[h],n[x],p),m(n[h],n[x],_),m(e[h],e[x],_),m(e[h],e[x],p)];f(b(0,1),o,o+.95),f(b(0,1),a-.22,a);let I=Math.ceil((y-.32)/6)*6,w=!1,P=!1;for(let p=I;p<y+g;p+=6){let _=Math.max(0,(p-y)/g),M=Math.min(1,(p+.32-y)/g);M<=_||(f(b(_,M),o+.95,a-.22),w||=_<1e-6,P||=M>1-1e-6)}if(!r&&(h===0&&!w||h===d-1&&!P)){let p=Math.min(1,.32/g);f(b(h===0?0:1-p,h===0?p:1),o+.95,a-.22)}y+=g}}import Ut from"polygon-clipping";var yn=.65;function fe(t,n){let e=1/0;for(let r of n)for(let o=0;o<r.length;o++){let a=r[o],i=r[(o+1)%r.length],s=i.x-a.x,l=i.y-a.y,u=Math.max(0,Math.min(1,((t.x-a.x)*s+(t.y-a.y)*l)/(s*s+l*l||1)));e=Math.min(e,Math.hypot(t.x-a.x-u*s,t.y-a.y-u*l))}return e}var me=.01;function yr(t,n,e,r,o,a,i,s=[],l=!0,u={bays:[],walls:[]}){if(r-o<=1e-5)return;let c=r-o>=3,f=c?r-yn:o;t.setMaterial(5);let m=c?[]:s.filter(p=>{if(p.role!=="entrance"&&p.role!=="exit")return!1;let _=it(p);if(!_)return!1;let M=Zt(_,o,o+Rt(p).heightM);return M!==null&&M.openingTop<=r-.12});if((!m.length||!Ot(t,n,f,r,m,a,i,{holes:e,portalBase:o}))&&V(t,n,e,()=>r,f,a,i,Y,void 0,()=>[0,1,0]),!c){t.setMaterial(0);return}let d=l&&u.bays.length?Wa(n,e,Lt(n,hn/S),u):null,y=6/S,h=.22/S,x=s.flatMap(p=>{if(p.role!=="entrance"&&p.role!=="exit")return[];let _=it(p);return _?.length?[{minX:Math.min(..._.map(M=>M.x)),maxX:Math.max(..._.map(M=>M.x)),minY:Math.min(..._.map(M=>M.y)),maxY:Math.max(..._.map(M=>M.y))}]:[]}),g=Math.min(...n.map(p=>p.x)),b=Math.max(...n.map(p=>p.x)),I=Math.min(...n.map(p=>p.y)),w=Math.max(...n.map(p=>p.y));for(let p=g+y/2;p<b;p+=y)for(let _=I+y/2;_<w;_+=y){if(x.some(R=>p+h>=R.minX&&p-h<=R.maxX&&_+h>=R.minY&&_-h<=R.maxY))continue;let M=[{x:p-h,y:_-h},{x:p+h,y:_-h},{x:p+h,y:_+h},{x:p-h,y:_+h}];!wt({x:p,y:_},n,e)||fe({x:p,y:_},[n,...e??[]])<h*Math.SQRT2+(l?hn/S:0)||d&&fe({x:p,y:_},d.flat())<h*Math.SQRT2+hn/S||V(t,M,void 0,()=>f,o,a,i,Y)}if(d){for(let[p,..._]of d)V(t,p,_,()=>f,o-me,a,i,Y);t.setMaterial(0);return}let P=Lt(n,hn/S);if(l&&P.length>=3){let p=s.filter(R=>{if(R.role!=="entrance"&&R.role!=="exit")return!1;let E=it(R);return!!E&&E.some(C=>!wt(C,n,void 0)||fe(C,[n])<=hn/S)}),_=[P.slice().reverse()],M=o-me;(!p.length||!Ot(t,n,M,f,p,a,i,{holes:_,portalBase:o+me}))&&V(t,n,_,()=>f,M,a,i,Y)}t.setMaterial(0)}var he=.25,hn=he;function Wa(t,n,e,r){if(e.length<3)return null;let o=i=>{let s=i.map(l=>[l.x,l.y]);return s.push(s[0]),s},a=i=>{let[s,...l]=i.map(u=>[o(u)]);return Ut.union(s,...l)};try{let i=[o(t),...(n??[]).map(o)],s=Ut.difference(i,[o(e)]),l=Ut.intersection(i,a(r.bays));if(!l.length)return null;let u=Ut.difference(Ut.intersection(i,a(r.walls)),l);return Ut.union(Ut.difference(s,l),u).map(f=>f.map(m=>m.slice(0,-1).map(([d,y])=>({x:d,y}))))}catch{return null}}var Ya=.02,za=.25,Ka=1.2,Va=.6,Za=.45,qa=2.3,$a=Math.PI/180,dr=.005;function Bt(t,n,e){let r=e*$a;return{x:t.x+n*Math.sin(r),y:t.y+n*Math.cos(r)}}function Qa(t,n){let e=n.rings[n.rings.length-1];if(!e)return!1;let r=e.outerRMedian*.85;for(let o of t){if(o.role!=="wall")continue;let a=o.points&&o.points.length>=2?o.points:o.x!==void 0&&o.y!==void 0&&o.width!==void 0&&o.height!==void 0?[{x:o.x,y:o.y},{x:o.x+o.width,y:o.y},{x:o.x+o.width,y:o.y+o.height},{x:o.x,y:o.y+o.height}]:[];if(a.length<2)continue;let i=0;for(let s of a)Math.hypot(s.x-n.centre.x,s.y-n.centre.y)>=r&&i++;if(i>=a.length/2)return!0}return!1}var Ja=24,tc=.01;function nc(t,n,e,r,o,a,i,s,l){let u=e.binCount,c=Ja,f=q,m=a+.02,d=a-tc,y=[];for(let A=0;A<u;A++){let B=(e.startBin+A+.5)*n.binStepDeg,T=new Float64Array(c+1);for(let F=0;F<=c;F++){let O=r[A]+(o[A]-r[A])*F/c;T[F]=Math.max(m,Le(n,e,B,O)-za)}y.push(T)}if(l){let A=0;for(let B=0;B+1<u;B++)for(let T=0;T<c;T++){let F=Bt(n.centre,r[B]+(o[B]-r[B])*T/c,(e.startBin+B+.5)*n.binStepDeg),O=Bt(n.centre,r[B+1]+(o[B+1]-r[B+1])*(T+1)/c,(e.startBin+B+1.5)*n.binStepDeg);A=Math.max(A,Math.hypot(O.x-F.x,O.y-F.y))}for(let B=0;B<u;B++){let T=(e.startBin+B+.5)*n.binStepDeg;for(let F=0;F<=c;F++){let O=Bt(n.centre,r[B]+(o[B]-r[B])*F/c,T),L=l(O.x,O.y,A*1.01);L!==null&&(y[B][F]=Math.min(y[B][F],Math.max(d+dr,L-dr)))}}}let h=[i.bandTop[0]*s.top,i.bandTop[1]*s.top,i.bandTop[2]*s.top],x=[i.bandTop[0]*s.bottomCap,i.bandTop[1]*s.bottomCap,i.bandTop[2]*s.bottomCap],g=[i.bandWall[0]*s.top,i.bandWall[1]*s.top,i.bandWall[2]*s.top],b=[i.bandWall[0]*s.wallBottom,i.bandWall[1]*s.wallBottom,i.bandWall[2]*s.wallBottom],I=(A,B)=>{let T=(e.startBin+A+.5)*n.binStepDeg,F=r[A]+(o[A]-r[A])*B/c,O=Bt(n.centre,F,T);return[O.x*f,y[A][B],O.y*f]};{let A=Math.tan(12*Math.PI/180);for(let B=0;B<6;B++){let T=!1;for(let O=0;O<u;O++)for(let L=c-1;L>=0;L--)y[O][L]>y[O][L+1]&&(y[O][L]=y[O][L+1],T=!0);let F=e.closed?u:u-1;for(let O=0;O<F;O++){let L=(O+1)%u;for(let D=0;D<=c;D++){let G=y[L][D]-y[O][D];if(Math.abs(G)>1)continue;let j=r[O]+(o[O]-r[O])*D/c,U=r[L]+(o[L]-r[L])*D/c,X=Bt(n.centre,j,(e.startBin+O+.5)*n.binStepDeg),W=Bt(n.centre,U,(e.startBin+L+.5)*n.binStepDeg),$=A*Math.hypot(W.x-X.x,W.y-X.y)*f;G>$?(y[L][D]=y[O][D]+$,T=!0):-G>$&&(y[O][D]=y[L][D]+$,T=!0)}}if(!T)break}}let w=1,P=(A,B)=>{for(let T=0;T<=c;T+=4)if(Math.abs(y[A][T]-y[B][T])>w)return!0;return Math.abs(y[A][c]-y[B][c])>w},p=Math.tan(38*Math.PI/180),_=A=>(o[A]-r[A])/c*f,M=(A,B)=>y[A][B+1]-y[A][B]>p*Math.max(1e-6,_(A)),R=(A,B)=>{let T=e.closed?(A-1+u)%u:Math.max(0,A-1),F=e.closed?(A+1)%u:Math.min(u-1,A+1);Math.abs(y[T][B]-y[A][B])>w&&(T=A),Math.abs(y[F][B]-y[A][B])>w&&(F=A);let O=Math.max(0,B-1),L=Math.min(c,B+1);O<B&&M(A,O)&&(O=B),L>B&&M(A,B)&&(L=B);let D=I(T,B),G=I(F,B),j=I(A,O),U=I(A,L),X=G[0]-D[0],W=G[1]-D[1],$=G[2]-D[2],tt=U[0]-j[0],Q=U[1]-j[1],st=U[2]-j[2],nt=W*st-$*Q,N=$*tt-X*st,H=X*Q-W*tt,K=Math.hypot(nt,N,H);return K>1e-12?(nt/=K,N/=K,H/=K,N<0&&(nt=-nt,N=-N,H=-H),[nt,N,H]):[0,1,0]},E=(A,B,T=!1)=>{let F=T&&Math.min(A[1],B[1])-a>=3,O=[A[0],F?A[1]-yn:d,A[2]],L=[B[0],F?B[1]-yn:d,B[2]],D=B[0]-A[0],G=B[2]-A[2],j=Math.hypot(D,G);if(!(j>1e-12))return;let U=[G/j,0,-D/j];t.tri(A,B,L,U,g,g,b),t.tri(A,L,O,U,g,b,b)},C=.05*Mt,v=A=>o[A]-r[A]<C,k=e.closed?u:u-1;for(let A=0;A<k;A++){let B=(A+1)%u;if(v(A)||v(B))continue;if(P(A,B)){let G=(e.startBin+A+1)*n.binStepDeg,j=(Q,st)=>{let nt=(r[A]+r[B])/2,N=(o[A]+o[B])/2,H=nt+(N-nt)*st/c,K=Bt(n.centre,H,G);return[K.x*f,y[Q][st],K.y*f]};for(let Q=0;Q<c;Q++){let st=I(A,Q),nt=I(A,Q+1),N=j(A,Q),H=j(A,Q+1),K=R(A,Q),at=R(A,Q+1);t.triN(st,N,H,K,K,at,h),t.triN(st,H,nt,K,at,at,h);let ft=I(B,Q),ht=I(B,Q+1),rt=j(B,Q),ct=j(B,Q+1),At=R(B,Q),z=R(B,Q+1);t.triN(rt,ft,ht,At,At,z,h),t.triN(rt,ht,ct,At,z,z,h);let ut=j(A,Q),mt=j(A,Q+1),Nt=j(B,Q+1),Gt=j(B,Q),kt=mt[0]-ut[0],Ft=mt[2]-ut[2],tn=Math.hypot(kt,Ft);if(tn>1e-12){let dn=[Ft/tn,0,-kt/tn];t.tri(ut,mt,Nt,dn,g),t.tri(ut,Nt,Gt,dn,g)}}let U=I(A,0),X=I(B,0),W=I(B,c),$=I(A,c),tt=Q=>[Q[0],d,Q[2]];Math.min(U[1],X[1])-a<3&&(t.tri(tt(U),tt(W),tt(X),[0,-1,0],x),t.tri(tt(U),tt($),tt(W),[0,-1,0],x)),E(U,X,!0),E($,W,!0);continue}for(let G=0;G<c;G++){let j=R(A,G),U=R(B,G),X=R(B,G+1),W=R(A,G+1);if(M(A,G)||M(B,G)){let nt=(mt,Nt)=>{let Gt=(e.startBin+mt+.5)*n.binStepDeg,kt=r[mt]+(o[mt]-r[mt])*(G+.5)/c,Ft=Bt(n.centre,kt,Gt);return[Ft.x*f,Nt,Ft.y*f]},N=I(A,G),H=I(B,G),K=nt(A,y[A][G]),at=nt(B,y[B][G]);t.triN(N,H,at,j,U,U,h),t.triN(N,at,K,j,U,j,h);let ft=I(B,G+1),ht=I(A,G+1),rt=nt(A,y[A][G+1]),ct=nt(B,y[B][G+1]);t.triN(rt,ct,ft,W,X,X,h),t.triN(rt,ft,ht,W,X,W,h);let At=at[0]-K[0],z=at[2]-K[2],ut=Math.hypot(At,z);if(ut>1e-12){let mt=[-z/ut,0,At/ut];t.tri(K,at,ct,mt,g),t.tri(K,ct,rt,mt,g)}continue}let $=I(A,G),tt=I(B,G),Q=I(B,G+1),st=I(A,G+1);t.triN($,tt,Q,j,U,X,h),t.triN($,Q,st,j,X,W,h)}let T=I(A,0),F=I(B,0),O=I(B,c),L=I(A,c),D=G=>[G[0],d,G[2]];Math.min(T[1],F[1])-a<3&&(t.tri(D(T),D(O),D(F),[0,-1,0],x),t.tri(D(T),D(L),D(O),[0,-1,0],x)),E(T,F,!0),E(L,O,!0)}if(!e.closed)for(let A of[0,u-1])for(let B=0;B<c;B++)E(I(A,B),I(A,B+1))}function pr(t,n,e){let{bottomY:r,colors:o,ao:a}=e,i=new Float64Array(n.binCount).fill(-1/0);for(let c of n.rings)for(let f of c.arcs){let m=new Float64Array(f.binCount),d=new Float64Array(f.binCount);for(let h=0;h<f.binCount;h++){let x=(f.startBin+h)%n.binCount,g=Math.max(0,f.innerR[h]-Pt);m[h]=Math.max(g,i[x]+.001),d[h]=Math.max(m[h]+.001,f.outerR[h]+Pt)}let y=0;for(let h=0;h<f.binCount;h++){let x=f.topLevelM[h]-r;x>y&&(y=x)}y>=Ka&&nc(t,n,f,m,d,r,o,a,e.standTopNear);for(let h=0;h<f.binCount;h++){let x=(f.startBin+h)%n.binCount;d[h]>i[x]&&(i[x]=d[h])}}if(e.deriveShell===!1||Qa(e.shapes,n))return;let s=n.rings[n.rings.length-1],l=Va*Mt,u=Za*Mt;for(let c of s.arcs){let f=[],m=[];for(let R=0;R<c.binCount;R++){let E=(c.startBin+R+.5)*n.binStepDeg,C=c.outerR[R]+Pt+l;f.push(Bt(n.centre,C,E)),m.push(Bt(n.centre,C+u,E))}let d=-1/0;for(let R=0;R<c.binCount;R++)c.topLevelM[R]>d&&(d=c.topLevelM[R]);let y=d+qa,h=c.closed?m:[...m,...f.slice().reverse()],x=c.closed?[f.slice().reverse()]:void 0,g=et(o.shellWall,[.66,.71,.72],.62),b=(R,E,C,v,k)=>{let A=Math.abs(v-d)<1e-6?v-Ya:v;Ot(t,R,C,A,e.shapes,o.shellTop,k,{holes:E,portalBase:r,ao:a})||V(t,R,E,()=>A,C,o.shellTop,k,a)},I=Math.max(1,Math.ceil((d-r)/4.5)),w=(d-r)/I,P=new Set,p=e.tierFrontLevels??n.rings.map(R=>{let E=R.arcs.flatMap(C=>Array.from(C.frontLevelM)).filter(Number.isFinite).sort((C,v)=>C-v);return E[Math.floor(E.length/2)]});for(let R of p)Number.isFinite(R)&&R-r>=3&&R<d&&P.add(Math.max(0,Math.min(I-1,Math.floor((R-r)/w))));let _=Math.min(...p.filter(R=>Number.isFinite(R)&&R-r>=3&&R<d));for(let R=0;R<I;R++)r+(R+1)*w<=_-yn&&Number.isFinite(_)&&P.add(R);for(let R=0;R<I;R++){let E=r+(d-r)*R/I,C=r+(d-r)*(R+1)/I;P.has(R)&&C-E>=3.2?(b(h,x,E,E+.45,g),ue(t,f,m,c.closed,E+.45,C-.16,o.shellTop,g,a,e.shapes,r)):b(h,x,E,C-.16,g),b(h,x,C-.16,C,Z(g,.62))}ue(t,f,m,c.closed,d,y,o.shellTop,g,a,e.shapes,r);let M=8;for(let R=1;R<m.length;R++){if(M+=Math.hypot(m[R].x-m[R-1].x,m[R].y-m[R-1].y)*q,M<8)continue;M=0;let E=m[R],C=m[R-1],v=E.x-C.x,k=E.y-C.y,A=Math.max(1,Math.hypot(v,k)),B=v/A*.16*Mt,T=k/A*.16*Mt,F=Math.max(1,Math.hypot(E.x-n.centre.x,E.y-n.centre.y)),O=(E.x-n.centre.x)/F*.24*Mt,L=(E.y-n.centre.y)/F*.24*Mt,D=[{x:E.x-B,y:E.y-T},{x:E.x+B,y:E.y+T},{x:E.x+B+O,y:E.y+T+L},{x:E.x-B+O,y:E.y-T+L}];b(D,void 0,r,d,Z(g,1.12))}}}var ec=2.5,xr=.65,oc=2,rc=.03;function ic(t,n){let e=()=>{let r=n;for(;t.length>2;){let o=t[0],a=t[1],i=Math.hypot(a.x-o.x,a.y-o.y);if(i>r){t[0]={x:o.x+(a.x-o.x)/i*r,y:o.y+(a.y-o.y)/i*r};return}r-=i,t.shift()}};e(),t.reverse(),e(),t.reverse()}function pe(t,n,e){let r=new Map;for(let a of t){let i=r.get(a.blockId);(!i||a.depth<i.depth)&&r.set(a.blockId,a)}let o=[];for(let[a,i]of r){if(i.y-e<ec||i.pts.length<2)continue;let s=i.pts.map(c=>{let f=c.x-n.x,m=c.y-n.y,d=Math.max(1,Math.hypot(f,m));return{x:c.x-f/d*xr/S,y:c.y-m/d*xr/S}}),l=[],u=[s[0]];for(let c=1;c<s.length;c++){let f=s[c-1],m=s[c];Math.hypot(m.x-f.x,m.y-f.y)*S>oc?(u.length>=2&&l.push(u),u=[m]):u.push(m)}u.length>=2&&l.push(u);for(let c of l)ic(c,rc/S);l.length&&o.push({blockId:a,y:i.y,runs:l})}return o}var br=.1,sc=1.1,ac=.22,ye=.95,de=.05,gr=1.8;function Mr(t,n,e,r){let o=[.72,.72,.69],a=[.48,.55,.57];for(let i of pe(n,e,r)){let s=i.y;for(let l of i.runs){let u=gr;for(let c=1;c<l.length;c++){let f=l[c-1],m=l[c],d=m.x-f.x,y=m.y-f.y,h=Math.hypot(d,y);if(h<1e-5)continue;let x=g=>{let b=-y/h*g/S/2,I=d/h*g/S/2;return[{x:f.x+b,y:f.y+I},{x:m.x+b,y:m.y+I},{x:m.x-b,y:m.y-I},{x:f.x-b,y:f.y-I}]};if(V(t,x(ac),void 0,()=>s+br,s-sc,o,o,Y),V(t,x(de),void 0,()=>s+ye,s+ye-de,a,a,Y),u+=h*S,u>=gr||c===l.length-1){u=0;let g=.028/S,b=[{x:f.x-g,y:f.y-g},{x:f.x+g,y:f.y-g},{x:f.x+g,y:f.y+g},{x:f.x-g,y:f.y+g}];V(t,b,void 0,()=>s+ye-de,s+br,a,a,Y)}}}}}var cc=.9,lc=1.5,uc=.3;function Pr(t,n,e){let r=[],o=[],a=cc/S,i=lc/S,s=uc/S;for(let l of t)for(let u of l.runs){if(u.length<2)continue;let c=u.slice(),f=(x,g)=>{let b=c[x],I=c[g],w=Math.hypot(b.x-I.x,b.y-I.y)||1;c[x]={x:b.x+(b.x-I.x)/w*s,y:b.y+(b.y-I.y)/w*s}};f(0,1),f(c.length-1,c.length-2);let m=c.map((x,g)=>{let b=c[Math.max(0,g-1)],I=c[Math.min(c.length-1,g+1)],w=I.x-b.x,P=I.y-b.y,p=Math.hypot(w,P)||1,_=-P/p,M=w/p;return _*(x.x-n.x)+M*(x.y-n.y)<0&&(_=-_,M=-M),{nx:_,ny:M}}),d=c.map((x,g)=>({x:x.x-m[g].nx*i,y:x.y-m[g].ny*i})),y=c.map((x,g)=>({x:x.x+m[g].nx*a,y:x.y+m[g].ny*a})),h=c.map((x,g)=>({x:x.x+m[g].nx*(a+e/S),y:x.y+m[g].ny*(a+e/S)}));r.push([...d,...y.slice().reverse()]),o.push([...y,...h.reverse()])}return{bays:r,walls:o}}var xe=.88,Nn=.27,fc=1.2,mc=.01;function Sr(t,n,e,r,o){let a=[.67,.71,.68],i=[a[0]*xe,a[1]*xe,a[2]*xe],s=l=>!!o&&o.some((u,c)=>c!==l&&u?.belowY!=null&&Math.abs(u.belowY-n[l].y)<1e-6&&n[c].blockId===n[l].blockId);for(let l=0;l<n.length;l++){let u=n[l];if(!(u.pts.length<2))for(let c of[0,u.pts.length-1]){let f=u.pts[c],m=u.pts[c===0?1:c-1],d=f.x-m.x,y=f.y-m.y,h=Math.hypot(d,y);if(h<1e-5)continue;d/=h,y/=h;let x=1/0;for(let B=0;B<e.length;B++){let T=e[B],F=e[(B+1)%e.length],O=F.x-T.x,L=F.y-T.y,D=d*L-y*O;if(Math.abs(D)<1e-8)continue;let G=T.x-f.x,j=T.y-f.y,U=(G*L-j*O)/D,X=(G*y-j*d)/D;U>0&&X>=0&&X<=1&&(x=Math.min(x,U))}let g=.3/S,b=x-.04/S;if(!Number.isFinite(x)||x*S>2||b-g<.12/S)continue;let I=!!r&&s(l),w=o?.[l]?.pitch,P=I&&w&&Number.isFinite(w)?Math.min(fc/S,Math.max(Nn/S,w-Nn/S-mc/S)):Nn/S,p=-y,_=d;r&&p*(r.x-f.x)+_*(r.y-f.y)<0&&(p=-p,_=-_);let M=Nn/S,R=[{x:f.x+d*g+p*M,y:f.y+y*g+_*M},{x:f.x+d*b+p*M,y:f.y+y*b+_*M},{x:f.x+d*b-p*P,y:f.y+y*b-_*P},{x:f.x+d*g-p*P,y:f.y+y*g-_*P}];if(!R.every(B=>pt(e,B.x,B.y)))continue;let E=o?.[l]?.belowY,C=E==null?0:u.y-E,v=!!r&&C>.03&&C<=.65;if(v&&r){let B=(T,F)=>Math.hypot((T.x+F.x)/2-r.x,(T.y+F.y)/2-r.y);B(R[0],R[1])>B(R[3],R[2])&&(R=[R[3],R[2],R[1],R[0]])}let k=v?Math.ceil((C-1e-8)/.2):1,A=(B,T,F)=>({x:B.x+(T.x-B.x)*F,y:B.y+(T.y-B.y)*F});for(let B=0;B<k;B++){let T=B/k,F=(B+1)/k,O=[A(R[0],R[3],T),A(R[1],R[2],T),A(R[1],R[2],F),A(R[0],R[3],F)],L=u.y+.008-(v?C*(1-F):0);V(t,O,void 0,()=>L,L-(v?C/k+.1:.16),a,i,Y)}}}}function Ir(t,n,e,r,o,a,i,s,l=!1){if(!n.outline||n.outline.length<3)return;let u=e.baseHeightM,c=e.objects.filter(b=>b.type==="shape"&&(b.role==="entrance"||b.role==="exit")),f=ze(r,s.tierTop);if(!o)return;let m=b=>o.deckAt(b.x,b.y),d=lo(n,i),y=d[0]??n.outline;if(o.rowLevels.length>=2){let b=An(o.rowLevels),I=uo(oo(o.rowLevels,e.focal,b),d),w=Pr(pe(o.rowLevels,e.focal,u),e.focal,he);for(let p of I){let _=Math.max(u,p.topY-Rr);for(let M of a.subtract(p.outline,_))yr(t,M,p.holes,_,u,s.tierTop,s.tierWall,c,!l,w)}I.length||V(t,y,n.holes,()=>o.landingY,u,f,s.tierWall,Y);let P={tread:[f[0]*Y.top,f[1]*Y.top,f[2]*Y.top],riser:[f[0]*.72,f[1]*.72,f[2]*.72]};for(let p of d.length?d:[y])io(t,o.rowLevels,e.focal,o.landingY,P,p,b);Mr(t,o.rowLevels,e.focal,u),Sr(t,o.rowLevels,n.outline,e.focal,b);return}let h=o.flat?1/0:Co,x=b=>o.normalAt(b.x,b.y),g=o.flat?o.landingY:void 0;for(let b of a.subtract(y,g))V(t,b,n.holes,m,u,f,s.tierWall,Y,h,x)}function hc(t,n,e){let r=new Set;for(let i of t.objects)i.type==="section"&&r.add(i.id);let o=new Map;for(let i=0;i<n.length;i++){let s=e.seatOwner[i];if(!s||!r.has(s))continue;let l=e.bySection.get(s);if(l&&l.rowLevels.length>=2)continue;let u=n[i];if(u.kind==="booth")continue;let c=o.get(s);c||(c=new Map,o.set(s,c));let f=u.rowId||`__seat-${i}`,m=c.get(f);m||(m={pts:[],levelM:0,n:0},c.set(f,m)),m.pts.push({x:u.x,y:u.y}),m.levelM+=e.seatDeckY(i),m.n++}let a=[];for(let i of t.objects){if(i.type!=="section")continue;let s=e.bySection.get(i.id);if(s&&s.rowLevels.length>=2){let u=s.rowLevels.filter(c=>!c.patch).map(c=>({pts:c.pts,levelM:c.y}));u.length>=2&&a.push({sectionId:i.id,rows:u});continue}let l=o.get(i.id);l&&a.push({sectionId:i.id,rows:[...l.values()].map(u=>({pts:u.pts,levelM:u.levelM/u.n}))})}return a}function yc(t,n){let e=1/0;for(let r=0;r<n.length;r++){let o=n[r],a=n[(r+1)%n.length],i=a.x-o.x,s=a.y-o.y,l=Math.max(0,Math.min(1,((t.x-o.x)*i+(t.y-o.y)*s)/(i*i+s*s||1)));e=Math.min(e,Math.hypot(t.x-o.x-l*i,t.y-o.y-l*s))}return e}var Rr=.02;function dc(t,n){let e=t.objects.filter(r=>r.type==="section"&&!!r.outline&&r.outline.length>=3).flatMap(r=>{let o=n.bySection.get(r.id);if(!o)return[];let a=1/0,i=-1/0,s=1/0,l=-1/0;for(let c of r.outline)c.x<a&&(a=c.x),c.x>i&&(i=c.x),c.y<s&&(s=c.y),c.y>l&&(l=c.y);let u=o.landingY;for(let c of o.rowLevels)u=Math.min(u,c.y-Rr);return[{outline:r.outline,holes:r.holes,surface:o,floorTop:u,minX:a,maxX:i,minY:s,maxY:l}]});return(r,o,a)=>{let i=null;for(let s of e){if(r<s.minX-a||r>s.maxX+a||o<s.minY-a||o>s.maxY+a)continue;let l={x:r,y:o};if(!wt(l,s.outline,s.holes)&&yc(l,s.outline)>a)continue;let u=Math.min(s.surface.deckAt(r,o),s.floorTop);(i===null||u<i)&&(i=u)}return i}}var pc=3,xc=.4;function _r(t,n,e,r,o,a,i=!0){let s=hc(n,e,r);if(s.length<pc)return;let l=Fe(s,n.focal);if(!l)return;let u=Math.max(0,...l.rings.map(c=>c.arcs.reduce((f,m)=>f+m.binCount,0)))/l.binCount;t.setMaterial(5),pr(t,l,{bottomY:n.baseHeightM,tierFrontLevels:s.map(c=>Math.min(...c.rows.map(f=>f.levelM))),colors:{bandTop:Z(o.tierTop,.8),bandWall:o.tierWall,shellTop:a??Z(o.tierWall,1.15),shellWall:a??o.tierWall},ao:Y,shapes:n.objects.filter(c=>c.type==="shape"),deriveShell:i&&u>=xc,standTopNear:dc(n,r)}),t.setMaterial(0)}function Ar(t){let{doc:n,units:e,seats:r,surfaces:o,solids:a,hintedSeatFloor:i,seatFloor:s}=t,l=[];{let u=e.map(()=>({minX:1/0,minY:1/0,minZ:1/0,maxX:-1/0,maxY:-1/0,maxZ:-1/0}));for(let m=0;m<a.floor.length;m+=1){let d=Math.max(0,Math.min(e.length-1,Math.round(a.floor[m]))),y=m*3,h=u[d];h.minX=Math.min(h.minX,a.position[y]),h.minY=Math.min(h.minY,a.position[y+1]),h.minZ=Math.min(h.minZ,a.position[y+2]),h.maxX=Math.max(h.maxX,a.position[y]),h.maxY=Math.max(h.maxY,a.position[y+1]),h.maxZ=Math.max(h.maxZ,a.position[y+2])}let c=new Map;for(let m=0;m<e.length;m++)for(let d of e[m].objects)d.type==="section"&&c.set(d.id,m);let f=e.map(()=>({n:0,minX:1/0,minY:1/0,minDeck:1/0,maxX:-1/0,maxY:-1/0,maxDeck:-1/0,sumX:0,sumDeck:0,sumZ:0}));for(let m=0;m<r.length;m++){let d=o.seatOwner[m],y=(d!==null?c.get(d):void 0)??i[m];if(y===void 0)continue;let h=f[y],x=r[m];h.n++,x.x<h.minX&&(h.minX=x.x),x.y<h.minY&&(h.minY=x.y),x.x>h.maxX&&(h.maxX=x.x),x.y>h.maxY&&(h.maxY=x.y);let g=o.seatDeckY(m);h.sumX+=x.x*S,h.sumDeck+=g,h.sumZ+=x.y*S,h.minDeck=Math.min(h.minDeck,g),h.maxDeck=Math.max(h.maxDeck,g+1.6),s[m]=y}for(let m=0;m<e.length;m++){let d=f[m],y=n.floors?.[m],h=u[m],x=Math.min(d.n?d.minX*S:e[m].focal.x*S-1,Number.isFinite(h.minX)?h.minX:1/0),g=Math.max(d.n?d.maxX*S:e[m].focal.x*S+1,Number.isFinite(h.maxX)?h.maxX:-1/0),b=Math.min(d.n?d.minY*S:e[m].focal.y*S-1,Number.isFinite(h.minZ)?h.minZ:1/0),I=Math.max(d.n?d.maxY*S:e[m].focal.y*S+1,Number.isFinite(h.maxZ)?h.maxZ:-1/0),w=Math.min(d.n?Math.min(e[m].baseHeightM,d.minDeck):e[m].baseHeightM,Number.isFinite(h.minY)?h.minY:1/0),P=Math.max(d.n?Math.max(d.maxDeck,w+.5):w+.5,Number.isFinite(h.maxY)?h.maxY:-1/0),p=[d.n?d.sumX/d.n:(x+g)/2,d.n?d.sumDeck/d.n:(w+P)/2,d.n?d.sumZ/d.n:(b+I)/2],_=Math.max(1,.5*Math.hypot(g-x,P-w,I-b));l.push({index:m,id:y?.id??`floor-${m}`,label:y?.name??(e.length>1?`Floor ${m+1}`:"Venue"),seatCount:d.n,center:p,radius:_,box:{min:[x,w,b],max:[g,P,I]},focalWorld:[e[m].focal.x*S,e[m].baseHeightM+1.5,e[m].focal.y*S]})}}return l}function be(t,n){let e=1/0,r=1/0,o=-1/0,a=-1/0,i=(s,l)=>{s<e&&(e=s),l<r&&(r=l),s>o&&(o=s),l>a&&(a=l)};for(let s of n)i(s.x,s.y);for(let s of t)for(let l of s.objects)if(l.type==="section")for(let u of l.outline)i(u.x,u.y);else if(l.type==="shape"&&l.points)for(let u of l.points)i(u.x,u.y);else if(l.type==="gaArea")for(let u of l.points)i(u.x,u.y);else if(l.type==="booth"){let u=_t(l);if(u)for(let c of u)i(c.x,c.y)}else if(l.type==="table"){let u=vn(l);if(u)for(let c of u)i(c.x,c.y)}else if(l.type==="decorImage"){let u=Dn(l);if(u)for(let c of u)i(c.x,c.y)}return Number.isFinite(e)||(e=-100,r=-100,o=100,a=100),{minX:e,minY:r,maxX:o,maxY:a}}function Cr(t,n,e,r,o,a,i){if(n.length===1){let s=e.map(m=>({x:m.x,y:m.y}));for(let m of n[0].objects)m.type==="section"?s.push(...m.outline):m.type==="shape"?s.push(...it(m)??m.points??[]):m.type==="gaArea"?s.push(...m.points):m.type==="booth"?s.push(..._t(m)??[]):m.type==="table"?s.push(...vn(m)??[]):m.type==="decorImage"&&s.push(...Dn(m)??[]);if(Br(t,n[0],e,a)||Or(t,n[0],e,s,a))return!1;if(i&&Er(t,n[0].baseHeightM,s,a,i))return!0;let l=cn(s),u=(o.minX+o.maxX)/2,c=(o.minY+o.maxY)/2,f=l.length>=3?l.map(m=>{let d=m.x-u,y=m.y-c,h=Math.max(1,Math.hypot(d,y));return{x:m.x+d/h*80,y:m.y+y/h*80}}):rn(o.minX-28,o.minY-28,o.maxX-o.minX+56,o.maxY-o.minY+56);return V(t,f,void 0,()=>-.04,-.22,a.ground,a.ground,Y),!1}else{let s=n.reduce((x,g)=>g.baseHeightM<x.baseHeightM?g:x);t.setFloor(s.index);let l={...s,objects:n.flatMap(x=>x.objects)},u=e.map(x=>({x:x.x,y:x.y}));for(let x of l.objects)x.type==="section"&&u.push(...x.outline);if(Br(t,l,e,a)||Or(t,l,e,u,a))return!1;if(i&&Er(t,s.baseHeightM,u,a,i))return!0;let c=e.filter((x,g)=>r[g]===s.index),f=be([s],c),m=Math.hypot(f.maxX-f.minX,f.maxY-f.minY),d=Math.max(28,Math.min(80,m*.04)),y=rn(f.minX-d,f.minY-d,f.maxX-f.minX+d*2,f.maxY-f.minY+d*2),h=s.baseHeightM-.03;return V(t,y,void 0,()=>h,h-.22,a.ground,a.ground,Y),!1}}function ge(t,n,e,r){let{cx:o,cz:a,radius:i}=e,s=1/0,l=1/0,u=1/0,c=-1/0,f=-1/0,m=-1/0,d=(x,g,b)=>{s=Math.min(s,x),c=Math.max(c,x),l=Math.min(l,g),f=Math.max(f,g),u=Math.min(u,b),m=Math.max(m,b)};for(let x=0;x<t.position.length;x+=3){let g=x/3;r&&g>=r[0]&&g<r[1]||d(t.position[x],t.position[x+1],t.position[x+2])}for(let x=0;x<n.count;x++){let g=x*3,b=n.iPosition[g],I=n.iPosition[g+1],w=n.iPosition[g+2],P=Math.max(.35,n.iMaxRadius[x]??.35);d(b-P,I,w-P),d(b+P,I+1.6,w+P)}Number.isFinite(s)||(s=o-i,c=o+i,l=0,f=i*.16,u=a-i,m=a+i);let y=[(s+c)/2,(l+f)/2,(u+m)/2],h=Math.max(1,.5*Math.hypot(c-s,f-l,m-u));return{center:y,radius:h,minY:l,maxY:f}}var bc=4096;function kr(t,n,e=[]){let r=Math.max(1,Math.ceil(t.count/bc)),o=Math.ceil(t.count/r),a=new Float32Array((o*2+n.length*4+e.length)*3),i=0;for(let s=0;s<t.count;s+=r){let l=t.iPosition[s*3],u=t.iPosition[s*3+1],c=t.iPosition[s*3+2];a[i++]=l,a[i++]=u,a[i++]=c,a[i++]=l,a[i++]=0,a[i++]=c}for(let[s,l,u]of e)a[i++]=s,a[i++]=l,a[i++]=u;for(let s of n)for(let[l,u]of[[-1,-1],[1,-1],[1,1],[-1,1]])a[i++]=s.cx+l*s.halfX,a[i++]=s.y,a[i++]=s.cz+u*s.halfZ;return a.subarray(0,i)}function Fr(t,n,e,r,o,a,i=[]){let s=1/0,l=1/0,u=-1/0,c=-1/0;for(let P=0;P<t.count;P++){let p=P*3,_=t.iPosition[p],M=t.iPosition[p+2];_<s&&(s=_),_>u&&(u=_),M<l&&(l=M),M>c&&(c=M)}for(let[P,,p]of i)P<s&&(s=P),P>u&&(u=P),p<l&&(l=p),p>c&&(c=p);for(let P of n)s=Math.min(s,P.cx-P.halfX),u=Math.max(u,P.cx+P.halfX),l=Math.min(l,P.cz-P.halfZ),c=Math.max(c,P.cz+P.halfZ);let f=e.minX*S,m=e.maxX*S,d=e.minY*S,y=e.maxY*S,h=f,x=m,g=d,b=y;if(Number.isFinite(s)){let P=Math.max(2,.06*Math.hypot(u-s,c-l));h=Math.max(f,s-P),x=Math.min(m,u+P),g=Math.max(d,l-P),b=Math.min(y,c+P)}let I=Math.min(0,r),w=Math.max(o,a*.05);return{min:[h,I,g],max:[x,w,b]}}var wr=12,gc=.6,Mc=40;function Er(t,n,e,r,o){let a=cn([...e]);if(a.length<3)return!1;let i=1/0,s=1/0,l=-1/0,u=-1/0;for(let w of a)i=Math.min(i,w.x),l=Math.max(l,w.x),s=Math.min(s,w.y),u=Math.max(u,w.y);let c=Math.hypot(l-i,u-s)*S,f=It(a,wr/S,1.2),m=Math.max(Mc,c*gc),d=It(a,(wr+m)/S,1.2);if(f.length!==d.length)return!1;let y=et(r.ground,[.78,.76,.72],.35),h=et(r.ground,[.56,.62,.52],.3);V(t,f,void 0,()=>n-.04,n-.22,y,y,Y);let x=n-.05,g=f.map(w=>[w.x*S,x,w.y*S]),b=d.map(w=>[w.x*S,x,w.y*S]),I=[0,1,0];for(let w=0;w<g.length;w++){let P=(w+1)%g.length;t.tri(g[w],b[P],b[w],I,h,o,o),t.tri(g[w],g[P],b[P],I,h,h,o)}return!0}function Br(t,n,e,r){let o=Vt(n,e);if(!o)return!1;let a=n.baseHeightM,i=et(r.ground,[.62,.55,.47],.4);return V(t,o,void 0,()=>a-.04,a-.22,i,i,Y),!0}var Pc=3e3,Sc=20,Tr=1.5,Ic=1.2,Rc=.25;function Or(t,n,e,r,o){if(!e.length||e.length>Pc||r.length<3)return!1;for(let R of n.objects){if(R.type==="shape"&&gn(R.stageKind))return!1;if(R.type==="section"){let{height:E}=Wt(R,{floorBaseHeightM:n.baseHeightM});if(E-n.baseHeightM>Sc)return!1}}let a=0,i=0;for(let R of r)a+=R.x,i+=R.y;a/=r.length,i/=r.length;let s=0,l=0,u=0;for(let R of r){let E=R.x-a,C=R.y-i;s+=E*E,l+=C*C,u+=E*C}let c=.5*Math.atan2(2*u,s-l),f=Math.cos(c),m=Math.sin(c),d=-m,y=f,h=1/0,x=-1/0,g=1/0,b=-1/0;for(let R of r){let E=(R.x-a)*f+(R.y-i)*m,C=(R.x-a)*d+(R.y-i)*y;h=Math.min(h,E),x=Math.max(x,E),g=Math.min(g,C),b=Math.max(b,C)}let I=R=>[[h-R,g-R],[x+R,g-R],[x+R,b+R],[h-R,b+R]].map(([E,C])=>({x:a+f*E+d*C,y:i+m*E+y*C})),w=I(Tr/S),P=I((Tr+Rc)/S),p=n.baseHeightM,_=et(o.ground,[.62,.55,.47],.4),M=et(o.ground,[.86,.86,.84],.55);return V(t,P,void 0,()=>p-.04,p-.22,_,_,Y),V(t,P,[w.slice().reverse()],()=>p+Ic,p-.04,et(M,[1,1,1],.2),M,Y),!0}function Lr(t,n,e){let r=()=>({byObjectId:new Map,elements:[]});if(!n||!t)return r();let o=Me(n);if(!o.ok||o.value.id!==t)return r();let a=new Map;for(let f of e)for(let m of f.objects)m.type==="shape"&&a.set(m.id,{shape:m,unit:f});let i=new Set,s=new Set,l=new Map((n.overlay.productionElements??[]).map(f=>{let m=f.runtimeContentImageUrl;return[f.id,typeof m=="string"&&/^(?:blob:|data:image\/|https:\/\/)/.test(m)?m:void 0]})),u=[];for(let f of o.value.overlay.productionElements??[]){let m=a.get(f.objectId),d=m?it(m.shape):null,y=f.baseElevationM??0;if(!m||!d||d.length<3||!f.id||i.has(f.id)||s.has(f.objectId)||!Number.isFinite(f.heightM)||f.heightM<.05||f.heightM>50||!Number.isFinite(y)||y<-10||y>100)return r();i.add(f.id),s.add(f.objectId);let h=d.map(M=>M.x*S),x=d.map(M=>M.y*S),g=m.unit.baseHeightM+y,b=Math.min(...h),I=Math.max(...h),w=Math.min(...x),P=Math.max(...x),p,_=l.get(f.id)??f.contentImageUrl;if(f.kind==="screen"&&_&&(p=wo(d,g,g+f.heightM,m.unit.focal),!p))if(I-b>=P-w){let M=Math.abs(w-m.unit.focal.y*S)<=Math.abs(P-m.unit.focal.y*S)?w-.006:P+.006;p=[[b,g,M],[I,g,M],[b,g+f.heightM,M],[I,g+f.heightM,M]]}else{let M=Math.abs(b-m.unit.focal.x*S)<=Math.abs(I-m.unit.focal.x*S)?b-.006:I+.006;p=[[M,g,w],[M,g,P],[M,g+f.heightM,w],[M,g+f.heightM,P]]}u.push({id:f.id,objectId:f.objectId,kind:f.kind,floorIndex:m.unit.index,baseY:g,topY:g+f.heightM,bounds:{min:[b,g,w],max:[I,g+f.heightM,P]},occlusion:f.occlusion,..._?{contentImageUrl:_}:{},...p?{contentPlane:p}:{}})}let c=u.sort((f,m)=>f.id.localeCompare(m.id));return{byObjectId:new Map(c.map(f=>[f.objectId,f])),elements:c}}var vr=[.13,.14,.17],Jt=[.4,.43,.47],_c=.18,Ac=.02,wc=2.4,Ec=1500,Bc=240,Tc=.25;function Dr(t,n,e,r){let o=n.stageKind??"";if(Yt(o)||o==="round"||!r.length)return;let a=it(n);if(!a||a.length<3)return;let i={x:a.reduce((T,F)=>T+F.x,0)/a.length,y:a.reduce((T,F)=>T+F.y,0)/a.length},s=0,l=0,u=new Set;for(let T of r)s+=T.x,l+=T.y,u.add(Math.floor(Math.atan2(T.y-i.y,T.x-i.x)*180/Math.PI/10));let c=i.x-s/r.length,f=i.y-l/r.length,m=Math.hypot(c,f);if(m<1e-6)return;let d=r.reduce((T,F)=>T+Math.hypot(F.x-i.x,F.y-i.y),0)/r.length;if(u.size*10>Bc&&m<Tc*d)return;let y=c/m,h=f/m,x=-h,g=y,b=-1/0,I=1/0,w=1/0,P=-1/0;for(let T of a){let F=(T.x-i.x)*y+(T.y-i.y)*h,O=(T.x-i.x)*x+(T.y-i.y)*g;b=Math.max(b,F),I=Math.min(I,F),w=Math.min(w,O),P=Math.max(P,O)}let p=(P-w)*S,_=(b-I)*S;if(p<3||_<1.5||p*_>Ec)return;let M=_c/S,R=(T,F)=>({x:i.x+y*T+x*F,y:i.y+h*T+g*F}),E=(T,F,O,L)=>[R(T,O),R(T,L),R(F,L),R(F,O)],C=e+Math.max(3.5,Math.min(8,p*.35)),v=e+Math.min(wc,C-e-1),k=.2/S,A=I+Math.min(_*.25,1.5)/S,B=Ac/S;V(t,E(b-2*M+B,b-M-B,w+M+k,P-M-k),void 0,()=>v,e,vr,vr,Y);for(let[T,F]of[[w+M,w+M+k],[P-M-k,P-M]])V(t,E(b-2*M,b-M,T,F),void 0,()=>C+.3,e,Jt,Jt,Y),V(t,E(A+k,b-2*M,T,F),void 0,()=>C+.3,C,Jt,Jt,Y);V(t,E(A,A+k,w+M,P-M),void 0,()=>C+.3,C,Jt,Jt,Y)}function gt(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function bt(t){return Array.isArray(t)?t:[]}function Oc(t){let n=[t];for(;n.length;){let e=n.pop();if(Array.isArray(e)){n.push(...e);continue}if(!gt(e))continue;let r=gt(e.extensions)?e.extensions:null;if(r&&Object.prototype.hasOwnProperty.call(r,"KHR_draco_mesh_compression"))return!0;n.push(...Object.values(e))}return!1}function Gn(t,n){return!Array.isArray(t)||t.length!==n||!t.every(e=>typeof e=="number"&&Number.isFinite(e))?null:t}function Cc(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function kc(t,n){let e=new Array(16).fill(0);for(let r=0;r<4;r++)for(let o=0;o<4;o++)for(let a=0;a<4;a++)e[r*4+o]+=t[a*4+o]*n[r*4+a];return e}function Fc(t){let n=Gn(t.matrix,16);if(n)return n;if(t.matrix!==void 0)return null;let e=t.translation===void 0?[0,0,0]:Gn(t.translation,3),r=t.rotation===void 0?[0,0,0,1]:Gn(t.rotation,4),o=t.scale===void 0?[1,1,1]:Gn(t.scale,3);if(!e||!r||!o)return null;let[a,i,s,l]=r,u=Math.hypot(a,i,s,l);if(!(u>1e-8))return null;let c=a/u,f=i/u,m=s/u,d=l/u,y=c+c,h=f+f,x=m+m,g=c*y,b=c*h,I=c*x,w=f*h,P=f*x,p=m*x,_=d*y,M=d*h,R=d*x;return[(1-(w+p))*o[0],(b+R)*o[0],(I-M)*o[0],0,(b-R)*o[1],(1-(g+p))*o[1],(P+_)*o[1],0,(I+M)*o[2],(P-_)*o[2],(1-(g+w))*o[2],0,e[0],e[1],e[2],1]}function Lc(t,n,e,r){return[t[0]*n+t[4]*e+t[8]*r+t[12],t[1]*n+t[5]*e+t[9]*r+t[13],t[2]*n+t[6]*e+t[10]*r+t[14]]}function vc(t){let n=t[0],e=t[4],r=t[8],o=t[1],a=t[5],i=t[9],s=t[2],l=t[6],u=t[10],c=a*u-i*l,f=i*s-o*u,m=o*l-a*s,d=n*c+e*f+r*m;if(Math.abs(d)<1e-12)return null;let y=1/d;return[c*y,f*y,m*y,(r*l-e*u)*y,(n*u-r*s)*y,(e*s-n*l)*y,(e*i-r*a)*y,(r*o-n*i)*y,(n*a-e*o)*y]}function Nr(t,n,e,r){let o=t[0]*n+t[1]*e+t[2]*r,a=t[3]*n+t[4]*e+t[5]*r,i=t[6]*n+t[7]*e+t[8]*r,s=Math.hypot(o,a,i)||1;return o/=s,a/=s,i/=s,[o,a,i]}function Dc(t){if(t.byteLength<20||t.byteLength>8388608)return null;let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(n.getUint32(0,!0)!==1179937895||n.getUint32(4,!0)!==2||n.getUint32(8,!0)!==t.byteLength)return null;let e=12,r=null,o=null;for(;e+8<=t.byteLength;){let a=n.getUint32(e,!0),i=n.getUint32(e+4,!0);if(e+=8,a%4!==0||e+a>t.byteLength)return null;let s=t.subarray(e,e+a);if(i===1313821514&&!r)try{let l=JSON.parse(new TextDecoder().decode(s).replace(/[\u0000 ]+$/g,""));if(!gt(l))return null;r=l}catch{return null}else if(i===5130562&&!o)o=s;else return null;e+=a}return e===t.byteLength&&r&&o?{json:r,bin:o}:null}function Nc(t){return t===5120||t===5121?1:t===5122||t===5123?2:t===5125||t===5126?4:0}function Gc(t){return t==="SCALAR"?1:t==="VEC2"?2:t==="VEC3"?3:t==="VEC4"?4:0}function Hc(t,n,e){return e===5120?t.getInt8(n):e===5121?t.getUint8(n):e===5122?t.getInt16(n,!0):e===5123?t.getUint16(n,!0):e===5125?t.getUint32(n,!0):t.getFloat32(n,!0)}function Xc(t){let n=t instanceof Uint8Array?t:new Uint8Array(t),e=Dc(n);if(!e)return{ok:!1,issue:"invalid_glb"};let{json:r,bin:o}=e;if(!gt(r.asset)||r.asset.version!=="2.0")return{ok:!1,issue:"unsupported_glb"};let a=bt(r.extensionsUsed).filter(w=>typeof w=="string");if(a.includes("KHR_draco_mesh_compression")||Oc(r))return{ok:!1,issue:"draco_not_allowed"};if(a.length||bt(r.extensionsRequired).length)return{ok:!1,issue:"unsupported_glb"};if(bt(r.images).length||bt(r.textures).length)return{ok:!1,issue:"external_resource"};let i=bt(r.buffers);if(i.length!==1||!gt(i[0])||i[0].uri!==void 0||typeof i[0].byteLength!="number"||!Number.isInteger(i[0].byteLength)||i[0].byteLength<0||i[0].byteLength>o.byteLength)return{ok:!1,issue:"external_resource"};let s=bt(r.accessors),l=bt(r.bufferViews),u=bt(r.meshes),c=bt(r.nodes),f=bt(r.scenes),m=typeof r.scene=="number"?r.scene:0;if(!gt(f[m]))return{ok:!1,issue:"unsupported_glb"};let d=new DataView(o.buffer,o.byteOffset,o.byteLength),y=(w,P,p)=>{if(typeof w!="number"||!Number.isInteger(w)||!gt(s[w]))return null;let _=s[w];if(_.type!==P||_.sparse!==void 0||_.normalized===!0||typeof _.count!="number"||!Number.isInteger(_.count)||_.count<1||typeof _.componentType!="number"||!p.includes(_.componentType)||typeof _.bufferView!="number")return null;let M=l[_.bufferView];if(!gt(M)||M.buffer!==0||typeof M.byteLength!="number"||!Number.isInteger(M.byteLength)||M.byteLength<0)return null;let R=Gc(_.type),E=Nc(_.componentType),C=typeof M.byteStride=="number"?M.byteStride:R*E,v=typeof M.byteOffset=="number"?M.byteOffset:0,k=typeof _.byteOffset=="number"?_.byteOffset:0,A=v+k,B=k+(_.count-1)*C+R*E;if(!Number.isInteger(C)||!Number.isInteger(v)||!Number.isInteger(k)||C<R*E||v<0||k<0||v+M.byteLength>o.byteLength||B>M.byteLength)return null;let T=[];for(let F=0;F<_.count;F++){let O=[];for(let L=0;L<R;L++){let D=Hc(d,A+F*C+L*E,_.componentType);if(!Number.isFinite(D))return null;O.push(D)}T.push(O)}return T},h=[],x=[],g=0,b=new Set,I=(w,P)=>{if(typeof w!="number"||!Number.isInteger(w)||!gt(c[w])||b.has(w))return!1;b.add(w);let p=c[w],_=Fc(p);if(!_)return!1;let M=kc(P,_),R=vc(M);if(!R)return!1;if(p.mesh!==void 0){if(typeof p.mesh!="number")return!1;let E=u[p.mesh];if(!gt(E))return!1;for(let C of bt(E.primitives)){if(!gt(C)||C.mode!==void 0&&C.mode!==4||!gt(C.attributes))return!1;let v=y(C.attributes.POSITION,"VEC3",[5126]),k=C.attributes.NORMAL===void 0?null:y(C.attributes.NORMAL,"VEC3",[5126]);if(!v||C.attributes.NORMAL!==void 0&&!k)return!1;let A=v.length;if(C.indices!==void 0){let T=typeof C.indices=="number"?s[C.indices]:null;A=gt(T)?T.count:void 0}if(typeof A!="number"||!Number.isInteger(A)||A%3!==0||(g+=A/3,g>1e5))return!1;let B=C.indices===void 0?v.map((T,F)=>[F]):y(C.indices,"SCALAR",[5121,5123,5125]);if(!B||B.length%3!==0||B.length!==A)return!1;for(let T=0;T<B.length;T+=3){let F=[B[T][0],B[T+1][0],B[T+2][0]];if(F.some(D=>!Number.isInteger(D)||D<0||D>=v.length))return!1;let O=F.map(D=>Lc(M,...v[D])),L=null;if(!k){let D=O[1][0]-O[0][0],G=O[1][1]-O[0][1],j=O[1][2]-O[0][2],U=O[2][0]-O[0][0],X=O[2][1]-O[0][1],W=O[2][2]-O[0][2];L=Nr([1,0,0,0,1,0,0,0,1],G*W-j*X,j*U-D*W,D*X-G*U)}for(let D=0;D<3;D++)h.push(...O[D]),x.push(...k?Nr(R,...k[F[D]]):L)}}}for(let E of bt(p.children))if(!I(E,M))return!1;return b.delete(w),!0};for(let w of bt(f[m].nodes))if(!I(w,Cc()))return{ok:!1,issue:g>1e5?"triangle_limit":"unsupported_glb"};return!g||h.length!==g*9||x.length!==h.length?{ok:!1,issue:"unsupported_glb"}:{ok:!0,triangleCount:g,position:new Float32Array(h),normal:new Float32Array(x)}}function Gr(t){try{return Xc(t)}catch{return{ok:!1,issue:"invalid_glb"}}}function Sh(t){let{doc:n}=t,e=lr(n.theme),r=e.structure,o=co(n,t.eventConfigurationId??n.eventConfigurationId),a=Lr(t.eventConfigurationId,t.eventConfiguration,o),i=t.seats,s=new In,l=null;if(t.registeredShellGlb){let N=Gr(t.registeredShellGlb);if(N.ok){let H=N.position.length/3,K=new Float32Array(N.position.length),at=e.materials.shell??r.tierWall;for(let ft=0;ft<H;ft++){let ht=N.normal[ft*3+1],rt=ht<-.25?.4:.62+.38*Math.max(0,ht);K[ft*3]=at[0]*rt,K[ft*3+1]=at[1]*rt,K[ft*3+2]=at[2]*rt}l={position:N.position,normal:N.normal,color:K,floor:new Float32Array(H).fill(-2),material:new Float32Array(H),count:H}}}let u=new Map;for(let N of o)for(let H of N.objects)u.set(H.id,N.index),H.type==="section"&&u.set(H.logicalSectionId??H.id,N.index);let c=i.map(N=>u.get(N.sectionId??"")??u.get(N.rowId??"")??0),f=be(o,i),m=s.vertexCount,y=Cr(s,o,i,c,f,r,et(e.background.top,e.background.bottom,.5))?s.vertexCount:m,h=Ke(n,i),x=new Map,g=new Map;for(let N of n.categories??[])x.set(N.key,N.color),N.seatGlyph&&g.set(N.key,N.seatGlyph);let b=[],I=ko(o,i,c),w=new Map;i.forEach((N,H)=>{let K=I.seatDeckY(H);Number.isFinite(K)&&w.set(N.rowId,Math.min(w.get(N.rowId)??1/0,K))});let P=new Float32Array(i.length),p=[],_=new Map((n.floors??[]).map((N,H)=>[N.id,H])),M=o.map(()=>[]);for(let N of i){let H=N.floorId?_.get(N.floorId)??0:0;M[Math.min(H,M.length-1)]?.push(N)}let R=(N,H)=>{if(!H||H.length<3)return!1;let K=Math.min(...H.map(rt=>rt.x)),at=Math.max(...H.map(rt=>rt.x)),ft=Math.min(...H.map(rt=>rt.y)),ht=Math.max(...H.map(rt=>rt.y));for(let rt=0;rt<N;rt++)for(let ct of M[rt])if(!(ct.x<K||ct.x>at||ct.y<ft||ct.y>ht)&&wt(ct,H,void 0))return!0;return!1},E=null,C=N=>o.length===1?i:i.filter((H,K)=>c[K]===N),v=(N,H)=>{let K=_t(N);if(!K)return!1;let at=1/0,ft=1/0,ht=-1/0,rt=-1/0;for(let ct of K)at=Math.min(at,ct.x),ht=Math.max(ht,ct.x),ft=Math.min(ft,ct.y),rt=Math.max(rt,ct.y);return i.some((ct,At)=>ct.kind!=="booth"&&(o.length===1||c[At]===H)&&ct.x>at&&ct.x<ht&&ct.y>ft&&ct.y<rt&&pt(K,ct.x,ct.y))},k;for(let N=0;N<o.length;N++){let H=o[N];s.setFloor(N);let K=Vt(H,C(N)),at=0;if(K){let z=0;for(let ut of H.objects)if(ut.type==="section")for(let mt of I.bySection.get(ut.id)?.rowLevels??[])z=Math.max(z,mt.y-H.baseHeightM);if(at=yo(z),!k){let ut=po(K);k={centre:[ut.x*S,ut.y*S]}}}let ft=new wn,ht=[],rt=H.objects.filter(z=>z.type==="shape"&&(z.role==="entrance"||z.role==="exit")),ct=H.objects.filter(z=>z.type==="section"&&!!z.outline&&z.outline.length>=3),At=mr(H.objects.filter(z=>z.type==="booth"),H.focal);for(let z of H.objects)if(z.type==="section"){let ut=s.vertexCount;Ir(s,z,H,Ve(z,h),I.bySection.get(z.id),ft,ct,r,N>0&&R(N,z.outline));let mt=s.vertexCount-ut;mt>0&&p.push({sectionId:z.id,start:ut,count:mt})}else if(z.type==="shape"){let ut=a.byObjectId.get(z.id),mt=b.length,Nt=K!==null&&z.role==="wall"&&!ut;s.setMaterial(Nt?ho:(ut?.kind??z.role)==="screen"?1:0);let Gt=z.role==="stage"&&!ut?hr(z,C(N)):Nt&&z.heightM===void 0?{...z,heightM:at}:z,kt=fo(Gt,ht);if(qo(s,Gt,H.baseHeightM+kt.supportOffsetM,kt.topOffsetM-kt.supportOffsetM,r,H.focal,b,ut,rt),s.setMaterial(0),z.role==="stage"&&!ut&&b.length>mt&&(E??N)===N){E=N;let Ft=n.floors?.[N]?.id,tn=o.length>1&&Ft?i.filter(dn=>dn.floorId===Ft):i;Dr(s,Gt,b[b.length-1].y,tn)}}else z.type==="gaArea"?Qo(s,z,H.baseHeightM,ot(x.get(z.categoryKey)),r):z.type==="booth"?Ko(s,z,H.baseHeightM,ot(x.get(z.categoryKey)),r,At.get(z.id)??H.focal,v(z,N)):z.type==="table"?Zo(s,z,Math.max(H.baseHeightM,w.get(z.id)??H.baseHeightM),ot(z.fill??n.theme?.decorFill??"#232c40"),r,!!(z.fill??n.theme?.decorFill)):z.type==="decorImage"&&$o(s,z,H.baseHeightM,r);_r(s,H,i,I,r,e.materials.shell,!l)}let A=o.length>1?{x:o.reduce((N,H)=>N+H.focal.x,0)/o.length,y:o.reduce((N,H)=>N+H.focal.y,0)/o.length}:n.focalPoint??{x:(f.minX+f.maxX)/2,y:(f.minY+f.maxY)/2},B=Ge(l?[s.build(),l]:[s.build()]),T=We(i,t.initialState,I,P,x,g),F=rr({doc:n,units:o,seats:i,surfaces:I,focal:A}),{labels:O,sections:L,rows:D}=ir({doc:n,units:o,seats:i,surfaces:I,seatData:T,hintedSeatFloor:c,zones:F,focal:A}),G=new Map(L.map((N,H)=>[N.id,H]));I.seatOwner.forEach((N,H)=>{T.iSection[H]=N?G.get(N)??-1:-1});let j=Ar({doc:n,units:o,seats:i,surfaces:I,solids:B,hintedSeatFloor:c,seatFloor:P});sr(O,j),T.iYaw=Ue(T.iPosition,i.length,N=>i[N].rowId,N=>{let H=o[P[N]]?.focal??A;return[H.x*S,H.y*S]});let U=(f.minX+f.maxX)/2*S,X=(f.minY+f.maxY)/2*S,W=.5*Math.hypot((f.maxX-f.minX)*S,(f.maxY-f.minY)*S)||10,$=ge(B,T,{cx:U,cz:X,radius:W},[m,y]),tt=ge(B,T,{cx:U,cz:X,radius:W}),Q=jc(o),st=Fr(T,b,f,$.minY,$.maxY,W,Q);return{sharedAisles:ar(o.flatMap(N=>N.objects.flatMap(H=>{if(H.type!=="section")return[];let K=I.bySection.get(H.id);return K?[{sectionId:H.id,floorIndex:N.index,rows:K.rowLevels}]:[]}))),solids:B,sectionSolidRanges:p,seats:T,seatSectionIds:I.seatOwner,bounds:{center:[(st.min[0]+st.max[0])/2,(st.min[1]+st.max[1])/2,(st.min[2]+st.max[2])/2],radius:W,groundY:0,box:st,fitPoints:kr(T,b,Q)},...k?{room:k}:{},...!k&&o.some(N=>N.objects.some(H=>H.type==="shape"&&gn(H.stageKind)))?{outdoor:!0}:{},renderBounds:{center:$.center,radius:$.radius},clipBounds:{center:tt.center,radius:tt.radius},stateColorLUT:ur(e,sn),theme:e,seatCount:i.length,focalWorld:[A.x*S,1.5,A.y*S],zones:F,stages:b,productionElements:a.elements,sections:L,rows:D,labels:O,floors:j}}function jc(t){let n=[];for(let e of t)for(let r of e.objects){let o=r.type==="gaArea"?r.points:r.type==="booth"?_t(r):null;for(let a of o??[])n.push([a.x*S,e.baseHeightM,a.y*S])}return n}function Uc(t,n){let{doc:e,report:r}=Ao(t),o=r.confident&&(r.sections.length>0||!!r.looseRowBlocks);if(!o&&!r.roles?.length)return null;if(!o){let l=new Map(r.roles.map(d=>[d.id,d.role])),u=d=>d.map(y=>y.type==="shape"&&l.has(y.id)?{...y,role:l.get(y.id)}:y),c=t.floors?.map(d=>({...d,objects:u(d.objects)})),f=new Float64Array(n.length).fill(Number.NaN),m=new Float64Array(n.length*2).fill(Number.NaN);return n.forEach((d,y)=>{d.eyeHeightM!==void 0&&(f[y]=d.eyeHeightM),d.focalPoint&&(m[y*2]=d.focalPoint.x,m[y*2+1]=d.focalPoint.y)}),{doc:{...t,objects:c?.[0]?.objects??u(t.objects),...c?{floors:c}:{}},report:r,eyeHeightM:f,focal:m}}let a=new Map(Mn(e).map(l=>[l.id,l])),i=new Float64Array(n.length).fill(Number.NaN),s=new Float64Array(n.length*2).fill(Number.NaN);return n.forEach((l,u)=>{let c=a.get(l.id)??l;c.eyeHeightM!==void 0&&(i[u]=c.eyeHeightM),c.focalPoint&&(s[u*2]=c.focalPoint.x,s[u*2+1]=c.focalPoint.y)}),{doc:e,report:r,eyeHeightM:i,focal:s}}function Wc(t,n){return t.map((e,r)=>{let o=n.eyeHeightM[r],a=n.focal[r*2],i=n.focal[r*2+1],s={...e};return Number.isNaN(o)?delete s.eyeHeightM:s.eyeHeightM=o,Number.isNaN(a)?delete s.focalPoint:s.focalPoint={x:a,y:i},s})}function Ah(t){let n=t.estimate===!1?null:Uc(t.doc,t.seats);return n?{input:{...t,doc:n.doc,seats:Wc(t.seats,n)},estimate:n}:{input:t}}export{tl as a,Jr as b,ti as c,Xe as d,ni as e,nl as f,sn as g,Xn as h,Qc as i,Un as j,S as k,_n as l,ul as m,fl as n,Ao as o,$l as p,Ql as q,Jl as r,tu as s,nu as t,eu as u,ne as v,ou as w,ru as x,iu as y,su as z,au as A,Oa as B,Sh as C,Uc as D,Wc as E,Ah as F};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { P as Point, A as AccessibilityType, C as ChartDoc, R as RowObject } from '../../types-DWx32xXH.cjs';
|
|
2
|
-
import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-
|
|
2
|
+
import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-DnsIDiWN.cjs';
|
|
3
3
|
export { C as CATEGORY_INVENTORY_FAMILIES, a as CategoryInventoryClone, b as CategoryInventoryConflict, c as CategoryInventoryFamily, d as CategoryInventoryFamilyUsage, e as CategoryInventoryObjectType, f as CategoryInventoryReassignment, g as CategoryInventoryRemediationChange, h as CategoryInventoryRemediationResult, i as CategoryInventoryTarget, j as describeCategoryInventoryConflict, k as effectiveSeatOwnerCategoryCounts, l as inspectCategoryInventoryConflicts, r as remediateCategoryInventoryConflicts } from '../../categoryInventory-DuOez0-4.cjs';
|
|
4
|
-
export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DEFAULT_EVENT_INVENTORY_LIMIT, G as GA_UNIT_LABEL_PREFIX, b as GroupedTableBookingMode, c as GroupedTableInventoryUnit, d as GroupedTableProjectionError, L as LARGE_VENUE_INVENTORY_MODULE, M as MAX_EVENT_INVENTORY, e as MAX_GA_CAPACITY, N as NotForSaleSelectionIssue, R as RestrictionChartDoc, f as RestrictionSeat, T as TicketOptionApplicabilityIssue, g as TicketSelection, h as TicketSelectionIssue, i as TicketSelectionOptions, j as TicketTierResolution, k as applicableTicketTiers, l as companionSelectionIssue, m as eventInventoryLimitFor, n as gaAreasOf, o as gaInventorySegments, p as gaUnitLabel, q as gaUnitLabels, r as groupedTableInventory, s as growJoinedGAInventory, t as isFullChartDoc, u as isGaUnitLabel, v as resolveTicketTierForSeat, w as ticketOptionNotApplicableIssue, x as ticketSelectionIssue, y as ticketTierAppliesToSeat, z as validGAInventorySegments } from '../../ticketRestrictions-
|
|
4
|
+
export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DEFAULT_EVENT_INVENTORY_LIMIT, G as GA_UNIT_LABEL_PREFIX, b as GroupedTableBookingMode, c as GroupedTableInventoryUnit, d as GroupedTableProjectionError, L as LARGE_VENUE_INVENTORY_MODULE, M as MAX_EVENT_INVENTORY, e as MAX_GA_CAPACITY, N as NotForSaleSelectionIssue, R as RestrictionChartDoc, f as RestrictionSeat, T as TicketOptionApplicabilityIssue, g as TicketSelection, h as TicketSelectionIssue, i as TicketSelectionOptions, j as TicketTierResolution, k as applicableTicketTiers, l as companionSelectionIssue, m as eventInventoryLimitFor, n as gaAreasOf, o as gaInventorySegments, p as gaUnitLabel, q as gaUnitLabels, r as groupedTableInventory, s as growJoinedGAInventory, t as isFullChartDoc, u as isGaUnitLabel, v as resolveTicketTierForSeat, w as ticketOptionNotApplicableIssue, x as ticketSelectionIssue, y as ticketTierAppliesToSeat, z as validGAInventorySegments } from '../../ticketRestrictions-O-fv0Os6.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Best-available seat selection — a PURE, fully unit-testable ranking function.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { P as Point, A as AccessibilityType, C as ChartDoc, R as RowObject } from '../../types-DWx32xXH.js';
|
|
2
|
-
import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-
|
|
2
|
+
import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-DPKIlnuF.js';
|
|
3
3
|
export { C as CATEGORY_INVENTORY_FAMILIES, a as CategoryInventoryClone, b as CategoryInventoryConflict, c as CategoryInventoryFamily, d as CategoryInventoryFamilyUsage, e as CategoryInventoryObjectType, f as CategoryInventoryReassignment, g as CategoryInventoryRemediationChange, h as CategoryInventoryRemediationResult, i as CategoryInventoryTarget, j as describeCategoryInventoryConflict, k as effectiveSeatOwnerCategoryCounts, l as inspectCategoryInventoryConflicts, r as remediateCategoryInventoryConflicts } from '../../categoryInventory-DdJdJ4Og.js';
|
|
4
|
-
export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DEFAULT_EVENT_INVENTORY_LIMIT, G as GA_UNIT_LABEL_PREFIX, b as GroupedTableBookingMode, c as GroupedTableInventoryUnit, d as GroupedTableProjectionError, L as LARGE_VENUE_INVENTORY_MODULE, M as MAX_EVENT_INVENTORY, e as MAX_GA_CAPACITY, N as NotForSaleSelectionIssue, R as RestrictionChartDoc, f as RestrictionSeat, T as TicketOptionApplicabilityIssue, g as TicketSelection, h as TicketSelectionIssue, i as TicketSelectionOptions, j as TicketTierResolution, k as applicableTicketTiers, l as companionSelectionIssue, m as eventInventoryLimitFor, n as gaAreasOf, o as gaInventorySegments, p as gaUnitLabel, q as gaUnitLabels, r as groupedTableInventory, s as growJoinedGAInventory, t as isFullChartDoc, u as isGaUnitLabel, v as resolveTicketTierForSeat, w as ticketOptionNotApplicableIssue, x as ticketSelectionIssue, y as ticketTierAppliesToSeat, z as validGAInventorySegments } from '../../ticketRestrictions-
|
|
4
|
+
export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DEFAULT_EVENT_INVENTORY_LIMIT, G as GA_UNIT_LABEL_PREFIX, b as GroupedTableBookingMode, c as GroupedTableInventoryUnit, d as GroupedTableProjectionError, L as LARGE_VENUE_INVENTORY_MODULE, M as MAX_EVENT_INVENTORY, e as MAX_GA_CAPACITY, N as NotForSaleSelectionIssue, R as RestrictionChartDoc, f as RestrictionSeat, T as TicketOptionApplicabilityIssue, g as TicketSelection, h as TicketSelectionIssue, i as TicketSelectionOptions, j as TicketTierResolution, k as applicableTicketTiers, l as companionSelectionIssue, m as eventInventoryLimitFor, n as gaAreasOf, o as gaInventorySegments, p as gaUnitLabel, q as gaUnitLabels, r as groupedTableInventory, s as growJoinedGAInventory, t as isFullChartDoc, u as isGaUnitLabel, v as resolveTicketTierForSeat, w as ticketOptionNotApplicableIssue, x as ticketSelectionIssue, y as ticketTierAppliesToSeat, z as validGAInventorySegments } from '../../ticketRestrictions-C8H-XJha.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Best-available seat selection — a PURE, fully unit-testable ranking function.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { P as Point, t as CubicPath, u as TextObject } from '../../types-DWx32xXH.cjs';
|
|
2
2
|
export { F as FloorLabelStyle } from '../../types-DWx32xXH.cjs';
|
|
3
|
-
export { A as AUTOMATIC_ROUND_TABLE_RADIUS_MAX, a as AUTOMATIC_ROUND_TABLE_RADIUS_MIN, C as ChartBoundsOptions, E as ExpandChartOptions, F as FLOOR_STACK_GAP_RATIO, b as FLOOR_STACK_MIN_SURFACE_PX, c as FloorStackOptions, d as FloorStackPlacement, R as RowSeatSlot, T as TABLE_SEAT_OFFSET, e as TableSeatSlot, f as allObjects, g as automaticRoundTableRadius, h as chartBounds, i as combinedFloorZoneId, j as expandBooth, k as expandChart, l as expandRow, m as expandRowSlots, n as expandTable, o as expandTableSlots, p as floorObjects, q as floorStackPlacements, r as floorsOf, s as initialFloorMode, t as layoutCombinedFloorPlan, u as layoutFloorStack, v as mainFloorId, w as objectCenter, x as owningSectionForObject, y as pointInPolygon, z as pointInPolygonWithHoles, B as polygonLabelPoint, D as rowInventoryCount, G as rowSeatPositions, H as stackFloors, I as tableInventoryCount, J as tableSeatCountsBySide, K as translateObject, L as usableHoles } from '../../tableSizing-
|
|
3
|
+
export { A as AUTOMATIC_ROUND_TABLE_RADIUS_MAX, a as AUTOMATIC_ROUND_TABLE_RADIUS_MIN, C as ChartBoundsOptions, E as ExpandChartOptions, F as FLOOR_STACK_GAP_RATIO, b as FLOOR_STACK_MIN_SURFACE_PX, c as FloorStackOptions, d as FloorStackPlacement, R as RowSeatSlot, T as TABLE_SEAT_OFFSET, e as TableSeatSlot, f as allObjects, g as automaticRoundTableRadius, h as chartBounds, i as combinedFloorZoneId, j as expandBooth, k as expandChart, l as expandRow, m as expandRowSlots, n as expandTable, o as expandTableSlots, p as floorObjects, q as floorStackPlacements, r as floorsOf, s as initialFloorMode, t as layoutCombinedFloorPlan, u as layoutFloorStack, v as mainFloorId, w as objectCenter, x as owningSectionForObject, y as pointInPolygon, z as pointInPolygonWithHoles, B as polygonLabelPoint, D as rowInventoryCount, G as rowSeatPositions, H as stackFloors, I as tableInventoryCount, J as tableSeatCountsBySide, K as translateObject, L as usableHoles } from '../../tableSizing-x8ADFtKS.cjs';
|
|
4
4
|
export { a as SegmentedRowComponent, S as SegmentedRowPlacement, r as resolveSegmentedRowGroups, s as segmentedRowComponentSeats, b as segmentedRowComponents, c as segmentedRowSeatTotal } from '../../segmentedRowModel-CDvvJJ4-.cjs';
|
|
5
|
-
import { E as ExpandedSeat } from '../../renderer-
|
|
5
|
+
import { E as ExpandedSeat } from '../../renderer-DnsIDiWN.cjs';
|
|
6
6
|
|
|
7
7
|
type SectionShellMode = 'auto' | 'rectangle' | 'tapered' | 'bezier';
|
|
8
8
|
declare function cubicPoint(path: CubicPath, t: number): Point;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { P as Point, t as CubicPath, u as TextObject } from '../../types-DWx32xXH.js';
|
|
2
2
|
export { F as FloorLabelStyle } from '../../types-DWx32xXH.js';
|
|
3
|
-
export { A as AUTOMATIC_ROUND_TABLE_RADIUS_MAX, a as AUTOMATIC_ROUND_TABLE_RADIUS_MIN, C as ChartBoundsOptions, E as ExpandChartOptions, F as FLOOR_STACK_GAP_RATIO, b as FLOOR_STACK_MIN_SURFACE_PX, c as FloorStackOptions, d as FloorStackPlacement, R as RowSeatSlot, T as TABLE_SEAT_OFFSET, e as TableSeatSlot, f as allObjects, g as automaticRoundTableRadius, h as chartBounds, i as combinedFloorZoneId, j as expandBooth, k as expandChart, l as expandRow, m as expandRowSlots, n as expandTable, o as expandTableSlots, p as floorObjects, q as floorStackPlacements, r as floorsOf, s as initialFloorMode, t as layoutCombinedFloorPlan, u as layoutFloorStack, v as mainFloorId, w as objectCenter, x as owningSectionForObject, y as pointInPolygon, z as pointInPolygonWithHoles, B as polygonLabelPoint, D as rowInventoryCount, G as rowSeatPositions, H as stackFloors, I as tableInventoryCount, J as tableSeatCountsBySide, K as translateObject, L as usableHoles } from '../../tableSizing-
|
|
3
|
+
export { A as AUTOMATIC_ROUND_TABLE_RADIUS_MAX, a as AUTOMATIC_ROUND_TABLE_RADIUS_MIN, C as ChartBoundsOptions, E as ExpandChartOptions, F as FLOOR_STACK_GAP_RATIO, b as FLOOR_STACK_MIN_SURFACE_PX, c as FloorStackOptions, d as FloorStackPlacement, R as RowSeatSlot, T as TABLE_SEAT_OFFSET, e as TableSeatSlot, f as allObjects, g as automaticRoundTableRadius, h as chartBounds, i as combinedFloorZoneId, j as expandBooth, k as expandChart, l as expandRow, m as expandRowSlots, n as expandTable, o as expandTableSlots, p as floorObjects, q as floorStackPlacements, r as floorsOf, s as initialFloorMode, t as layoutCombinedFloorPlan, u as layoutFloorStack, v as mainFloorId, w as objectCenter, x as owningSectionForObject, y as pointInPolygon, z as pointInPolygonWithHoles, B as polygonLabelPoint, D as rowInventoryCount, G as rowSeatPositions, H as stackFloors, I as tableInventoryCount, J as tableSeatCountsBySide, K as translateObject, L as usableHoles } from '../../tableSizing-0PwrOWi5.js';
|
|
4
4
|
export { a as SegmentedRowComponent, S as SegmentedRowPlacement, r as resolveSegmentedRowGroups, s as segmentedRowComponentSeats, b as segmentedRowComponents, c as segmentedRowSeatTotal } from '../../segmentedRowModel-I8eYUQft.js';
|
|
5
|
-
import { E as ExpandedSeat } from '../../renderer-
|
|
5
|
+
import { E as ExpandedSeat } from '../../renderer-DPKIlnuF.js';
|
|
6
6
|
|
|
7
7
|
type SectionShellMode = 'auto' | 'rectangle' | 'tapered' | 'bezier';
|
|
8
8
|
declare function cubicPoint(path: CubicPath, t: number): Point;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { A as AccessibilityType } from '../../types-DWx32xXH.cjs';
|
|
2
2
|
import { contrastRatioOrNull } from '../color.cjs';
|
|
3
|
-
export { M as MIN_POINTER_TARGET_PX, R as RENDERED_QUALITY_REPORT_VERSION, a as RenderedEvidenceState, b as RenderedQualityFinding, c as RenderedQualityFindingCode, d as RenderedQualityReport, e as RenderedQualitySample, i as inspectRenderedQualityEvidence } from '../../renderedQuality-
|
|
4
|
-
import '../../renderer-
|
|
3
|
+
export { M as MIN_POINTER_TARGET_PX, R as RENDERED_QUALITY_REPORT_VERSION, a as RenderedEvidenceState, b as RenderedQualityFinding, c as RenderedQualityFindingCode, d as RenderedQualityReport, e as RenderedQualitySample, i as inspectRenderedQualityEvidence } from '../../renderedQuality-BZycehrC.cjs';
|
|
4
|
+
import '../../renderer-DnsIDiWN.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Rendering constants that quality inspection must agree with.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { A as AccessibilityType } from '../../types-DWx32xXH.js';
|
|
2
2
|
import { contrastRatioOrNull } from '../color.js';
|
|
3
|
-
export { M as MIN_POINTER_TARGET_PX, R as RENDERED_QUALITY_REPORT_VERSION, a as RenderedEvidenceState, b as RenderedQualityFinding, c as RenderedQualityFindingCode, d as RenderedQualityReport, e as RenderedQualitySample, i as inspectRenderedQualityEvidence } from '../../renderedQuality-
|
|
4
|
-
import '../../renderer-
|
|
3
|
+
export { M as MIN_POINTER_TARGET_PX, R as RENDERED_QUALITY_REPORT_VERSION, a as RenderedEvidenceState, b as RenderedQualityFinding, c as RenderedQualityFindingCode, d as RenderedQualityReport, e as RenderedQualitySample, i as inspectRenderedQualityEvidence } from '../../renderedQuality-DPElQ3-x.js';
|
|
4
|
+
import '../../renderer-DPKIlnuF.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Rendering constants that quality inspection must agree with.
|
|
@@ -3,7 +3,7 @@ export { D as DEFAULT_SECTION_CORNER_SMOOTHING, M as MAX_EDGE_SAGITTA_RATIO, R a
|
|
|
3
3
|
export { SeatConfidenceDisclosure, seatConfidenceDisclosure } from '../seatConfidence.cjs';
|
|
4
4
|
import { S as SegmentedRowPlacement } from '../../segmentedRowModel-CDvvJJ4-.cjs';
|
|
5
5
|
export { A as AvailabilityRule, S as SectionIdentity, a as SectionMembership, b as SectionNode, T as TIER_HEIGHT_M, U as UNGROUPED_ID, c as applyHidden, d as computeSections, e as computeSectionsPerFloor, h as hiddenObjectIds, i as isSectionHidden, s as sectionGeometry, f as sectionIdentitiesById, g as sectionLabelsById, j as sectionOwnersByObject } from '../../sections-DSIfnBJY.cjs';
|
|
6
|
-
import { E as ExpandedSeat } from '../../renderer-
|
|
6
|
+
import { E as ExpandedSeat } from '../../renderer-DnsIDiWN.cjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* THE bowl resolver — whether a floor's stands wrap a centre, and the smooth
|
|
@@ -3,7 +3,7 @@ export { D as DEFAULT_SECTION_CORNER_SMOOTHING, M as MAX_EDGE_SAGITTA_RATIO, R a
|
|
|
3
3
|
export { SeatConfidenceDisclosure, seatConfidenceDisclosure } from '../seatConfidence.js';
|
|
4
4
|
import { S as SegmentedRowPlacement } from '../../segmentedRowModel-I8eYUQft.js';
|
|
5
5
|
export { A as AvailabilityRule, S as SectionIdentity, a as SectionMembership, b as SectionNode, T as TIER_HEIGHT_M, U as UNGROUPED_ID, c as applyHidden, d as computeSections, e as computeSectionsPerFloor, h as hiddenObjectIds, i as isSectionHidden, s as sectionGeometry, f as sectionIdentitiesById, g as sectionLabelsById, j as sectionOwnersByObject } from '../../sections-C8VTe6BN.js';
|
|
6
|
-
import { E as ExpandedSeat } from '../../renderer-
|
|
6
|
+
import { E as ExpandedSeat } from '../../renderer-DPKIlnuF.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* THE bowl resolver — whether a floor's stands wrap a centre, and the smooth
|