@seatlayer/core 0.106.1 → 0.106.2
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-C5GKFG36.js → chunk-45W3GKPP.js} +1 -1
- package/dist/{chunk-UGMXII72.js → chunk-6DZ2EVH2.js} +1 -1
- package/dist/{chunk-TAKLS47V.js → chunk-IFQFHR6Q.js} +1 -1
- package/dist/chunk-J33DNOMI.js +1 -0
- package/dist/{chunk-MLPJTJFE.js → chunk-N562FZPD.js} +1 -1
- package/dist/{chunk-3YNO3XCY.js → chunk-NXZ2GLII.js} +1 -1
- package/dist/{chunk-M4J7U2E2.js → chunk-QXJEN5LV.js} +1 -1
- package/dist/{chunk-V65VJE6F.js → chunk-RI4LNRP4.js} +1 -1
- package/dist/{chunk-FQTSVDD4.js → chunk-T7DQX3MB.js} +1 -1
- package/dist/chunk-WGRLTDLW.js +1 -0
- package/dist/{chunk-INCPWAWP.js → chunk-YGRBCSUI.js} +1 -1
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/inventory/index.cjs +1 -1
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.js +1 -1
- package/dist/core/sections/index.cjs +1 -1
- package/dist/core/sections/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1 -1
- package/dist/view3d/index.cjs +44 -44
- package/dist/view3d/index.js +1 -1
- 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-3DHQYZ47.js +0 -1
- package/dist/chunk-5R6I2XL7.js +0 -1
package/dist/view3d/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Hf=Object.create;var Po=Object.defineProperty;var zf=Object.getOwnPropertyDescriptor;var jf=Object.getOwnPropertyNames;var Uf=Object.getPrototypeOf,Wf=Object.prototype.hasOwnProperty;var Vn=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(o){throw n=[o],o}};var Da=(e,t)=>{for(var n in t)Po(e,n,{get:t[n],enumerable:!0})},Na=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of jf(t))!Wf.call(e,r)&&r!==n&&Po(e,r,{get:()=>t[r],enumerable:!(o=zf(t,r))||o.enumerable});return e};var dt=(e,t,n)=>(n=e!=null?Hf(Uf(e)):{},Na(t||!e||!e.__esModule?Po(n,"default",{value:e,enumerable:!0}):n,e)),Xf=e=>Na(Po({},"__esModule",{value:!0}),e);function xx(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?0:Math.ceil(e*t*4*(4/3))}function Mx(e){return(e!==void 0&&e<=2?32:e!==void 0&&e>=8?192:96)*1024*1024}function vr(e){let t=typeof navigator>"u"?void 0:navigator;return{saveData:t?.connection?.saveData===!0,maxTextureSize:e,maxDecodedBytes:Mx(t?.deviceMemory)}}function Sr(e,t={}){let n=e.previewUrl?.trim();if(!n||n===e.url)return{initialUrl:e.url,initialWidth:e.sourceWidth,initialHeight:e.sourceHeight,reason:"full-only"};let o={initialUrl:n,initialWidth:e.previewWidth,initialHeight:e.previewHeight};if(t.saveData)return{...o,reason:"save-data"};let r=[...e.variants??[],...e.sourceWidth!==void 0&&e.sourceHeight!==void 0?[{url:e.url,width:e.sourceWidth,height:e.sourceHeight}]:[]].filter(c=>c.url.trim()&&c.url!==n&&Number.isFinite(c.width)&&c.width>0&&Number.isFinite(c.height)&&c.height>0).sort((c,l)=>c.width*c.height-l.width*l.height);if(!r.length)return{...o,upgradeUrl:e.url,reason:"progressive"};let i=r.filter(c=>t.maxTextureSize===void 0||Math.max(c.width,c.height)<=t.maxTextureSize);if(!i.length)return{...o,reason:"texture-limit"};let a=i.filter(c=>t.maxDecodedBytes===void 0||xx(c.width,c.height)<=t.maxDecodedBytes);if(!a.length)return{...o,reason:"memory-limit"};let s=a[a.length-1];return{...o,upgradeUrl:s.url,reason:"progressive"}}function tf(){return new DOMException("Panorama image load aborted","AbortError")}function xo(e,t){return new Promise((n,o)=>{if(t?.aborted){o(tf());return}let r=new Image;r.crossOrigin="anonymous";let i=!1,a=()=>{r.onload=null,r.onerror=null,t?.removeEventListener("abort",c)},s=l=>{i||(i=!0,a(),l?o(l):n(r))},c=()=>{r.src="",s(tf())};r.onload=()=>{(typeof r.decode=="function"?r.decode():Promise.resolve()).then(()=>s(),()=>s())},r.onerror=()=>s(new Error("panorama_image_failed")),t?.addEventListener("abort",c,{once:!0}),r.src=e})}function wr(e){let t=globalThis;if(t.requestIdleCallback){let o=t.requestIdleCallback(e,{timeout:1200});return()=>t.cancelIdleCallback?.(o)}let n=globalThis.setTimeout(e,32);return()=>globalThis.clearTimeout(n)}var ha=Vn(()=>{"use strict"});function of(e){if(e.generated||e.mediaKind==="model")return"built from the chart";let t=e.mediaKind==="demo-render",n=t?e.coverage==="exact-seat"?"AI-generated exact-seat demo":e.coverage==="row-representative"?"AI-generated representative row demo":e.coverage==="section-representative"?"AI-generated representative section demo":e.coverage==="floor-representative"?"AI-generated representative floor demo":"AI-generated illustrative venue demo":e.coverage==="exact-seat"?"Exact seat photo":e.coverage==="row-representative"?"Representative row view":e.coverage==="section-representative"?"Representative section view":e.coverage==="floor-representative"?"Representative floor view":e.coverage==="venue-representative"?"Representative venue view":"Venue photo",o=e.capturedAt&&/^\d{4}/.test(e.capturedAt)?e.capturedAt.slice(0,4):"";return[n,o?`${t?"created":"captured"} ${o}`:"",e.sourceLabel??""].filter(Boolean).join(" \xB7 ")}function pa(e){return Math.max(vx,Math.min(Sx,e))}function wx(e,t,n){let o=(.5+e/360)*n;return t/2-o}function Px(e,t=Ar){return e*(180/t)}function nf(e,t,n){return(e-t)/2+Pr(n,t)}function Pr(e,t){let n=vt/180*t;return Math.max(-n,Math.min(n,e))}function Ax(){if(typeof window>"u")return!1;try{if(typeof window.matchMedia=="function"&&window.matchMedia("(pointer: coarse)").matches)return!0}catch{}return"ontouchstart"in window}function ba(e){return e||(Ax()?"Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close":"Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function rf(e,t,n={}){let o=n.fadeMs??400,r=t.initialBearingDeg??0,i=Sr(t,vr()),a=new AbortController,s=()=>a.abort();n.signal?.addEventListener("abort",s,{once:!0});let c=document.createElement("div"),l=document.activeElement instanceof HTMLElement?document.activeElement:null;c.setAttribute("role","dialog"),c.setAttribute("aria-modal","true"),c.setAttribute("aria-label",n.seatLabel?`View from ${n.seatLabel}`:"View from seat"),c.tabIndex=-1,Object.assign(c.style,{position:"absolute",inset:"0",zIndex:"10",opacity:"0",transition:`opacity ${o}ms ease`,background:"#05070c",overflow:"hidden",touchAction:"none"});let u=document.createElement("div");Object.assign(u.style,{position:"absolute",inset:"0",backgroundImage:`url("${i.initialUrl}")`,backgroundRepeat:"repeat-x",cursor:"grab"}),c.appendChild(u);let m=document.createElement("button");if(m.type="button",m.setAttribute("aria-label","Close"),m.textContent="\u2715",Object.assign(m.style,{position:"absolute",top:"12px",right:"12px",zIndex:"2",width:"44px",height:"44px",borderRadius:"999px",cursor:"pointer",border:"1px solid rgba(255,255,255,0.25)",background:"rgba(8,12,18,0.6)",color:"#e6edf3",fontSize:"15px",lineHeight:"1"}),c.appendChild(m),n.disclosure){let G=document.createElement("div");G.textContent=`${n.disclosurePrefix??"360\xB0 panorama"} \xB7 ${n.disclosure}`,Object.assign(G.style,{position:"absolute",top:"calc(12px + var(--sl-3d-top-inset, 0px))",left:"12px",zIndex:"2",maxWidth:"calc(100% - 88px)",padding:"8px 11px",borderRadius:"999px",overflow:"hidden",color:"#dce6f8",background:"rgba(8,12,18,0.68)",font:"600 11px/1.2 ui-sans-serif, system-ui, sans-serif",textOverflow:"ellipsis",whiteSpace:"nowrap",pointerEvents:"none",backdropFilter:"blur(6px)"}),c.appendChild(G)}let f=document.createElement("div");f.textContent=ba(n.lookAroundHint),Object.assign(f.style,{position:"absolute",bottom:"12px",left:"0",right:"0",textAlign:"center",color:"rgba(230,237,243,0.7)",font:"12px ui-sans-serif, system-ui, sans-serif",pointerEvents:"none"}),c.appendChild(f),e.appendChild(c),m.focus({preventScroll:!0});let d=0,h=0,p=0,b=0,y=Ar,M=()=>{let G=c.clientHeight||1,j=c.clientWidth||1,Z=x.naturalWidth||j*2,$=x.naturalHeight||G,ee=d>0?(j/2-p)/d:0,Q=h>0?b/h:0;h=Px(G,y),d=h*(Z/$),u.style.backgroundSize=`${d}px ${h}px`,v?p=j/2-ee*d:(p=wx(r,j,d),b=Pr((t.initialPitchDeg??0)/180*h,h),v=!0),b=Pr(Q*h,h),u.style.backgroundPosition=`${p}px ${nf(G,h,b)}px`},v=!1,A=()=>{let G=c.clientHeight||1;b=Pr(b,h),u.style.backgroundPosition=`${p}px ${nf(G,h,b)}px`},x=new Image;x.onload=M,x.src=i.initialUrl;let g=()=>{};i.upgradeUrl&&(g=wr(()=>{(t.resolveUrl?t.resolveUrl(i.upgradeUrl):Promise.resolve(i.upgradeUrl)).then(j=>!j||a.signal.aborted?null:xo(j,a.signal).then(Z=>({full:Z,url:j}))).then(j=>{j&&(H||a.signal.aborted||(x=j.full,u.style.backgroundImage=`url("${j.url}")`,M()))}).catch(()=>{})})),requestAnimationFrame(M);let P=!1,S=0,w=0,E=0,T=new Map,F=()=>{let[G,j]=[...T.values()];return G&&j?Math.hypot(G.x-j.x,G.y-j.y):0},R=G=>{let j=pa(G);j!==y&&(y=j,M())},I=G=>{T.set(G.pointerId,{x:G.clientX,y:G.clientY}),P=T.size===1,S=G.clientX,w=G.clientY,T.size===2&&(E=F()),u.style.cursor="grabbing";try{u.setPointerCapture?.(G.pointerId)}catch{}},_=G=>{if(T.has(G.pointerId)){if(T.set(G.pointerId,{x:G.clientX,y:G.clientY}),T.size>=2){let j=F();E>0&&j>0&&R(y*(E/j)),E=j,P=!1;return}P&&(p+=G.clientX-S,b+=G.clientY-w,S=G.clientX,w=G.clientY,A())}},k=G=>{T.delete(G.pointerId),E=T.size===2?F():0;let j=T.values().next().value;P=T.size===1,j?(S=j.x,w=j.y):u.style.cursor="grab";try{u.releasePointerCapture?.(G.pointerId)}catch{}},V=G=>{G.preventDefault(),R(y+G.deltaY*.04)};u.addEventListener("pointerdown",I),u.addEventListener("pointermove",_),u.addEventListener("pointerup",k),u.addEventListener("pointercancel",k),u.addEventListener("wheel",V,{passive:!1});let O=!1,H=!1,U=0,N=()=>{u.removeEventListener("pointerdown",I),u.removeEventListener("pointermove",_),u.removeEventListener("pointerup",k),u.removeEventListener("pointercancel",k),u.removeEventListener("wheel",V),window.removeEventListener("keydown",D)},L=()=>{g(),a.abort(),n.signal?.removeEventListener("abort",s),U&&(window.clearTimeout(U),U=0),N(),c.parentNode&&c.parentNode.removeChild(c),l?.isConnected&&l.focus({preventScroll:!0})},B=()=>{if(O)return;O=!0,c.style.opacity="0";let G=()=>{U=0,!H&&(L(),n.onClose?.())};U=window.setTimeout(G,o)},D=G=>{if(G.key==="Tab"){G.preventDefault(),m.focus({preventScroll:!0});return}if(G.key==="Escape"){G.stopPropagation(),B();return}if(G.key==="ArrowLeft"||G.key==="ArrowRight")p+=G.key==="ArrowLeft"?-32:32;else if(G.key==="ArrowUp"||G.key==="ArrowDown")b+=(G.key==="ArrowUp"?4:-4)*(h/180);else if(G.key==="+"||G.key==="="){R(y-5),G.preventDefault();return}else if(G.key==="-"){R(y+5),G.preventDefault();return}else return;G.preventDefault(),A()};return window.addEventListener("keydown",D),m.addEventListener("click",B),requestAnimationFrame(()=>{c.style.opacity="1"}),{close:B,dispose(){O=!0,H=!0,L()}}}var Ar,vx,Sx,vt,Ir=Vn(()=>{"use strict";ha();Ar=70,vx=35,Sx=90;vt=35});function Cx(e=Ix,t=Ex,n=Rx){let o=e+1,r=t+1,i=o*r,a=new Float32Array(i*3),s=new Float32Array(i*2);for(let u=0;u<r;u++){let m=u/t,f=m*Math.PI,d=Math.sin(f),h=Math.cos(f);for(let p=0;p<o;p++){let b=p/e,y=(b-.5)*Math.PI*2,M=u*o+p;a[M*3]=n*d*Math.sin(y),a[M*3+1]=n*h,a[M*3+2]=-n*d*Math.cos(y),s[M*2]=b,s[M*2+1]=m}}let c=new Uint16Array(e*t*6),l=0;for(let u=0;u<t;u++)for(let m=0;m<e;m++){let f=u*o+m,d=f+o;c[l++]=f,c[l++]=d,c[l++]=f+1,c[l++]=f+1,c[l++]=d,c[l++]=d+1}return{position:a,uv:s,index:c}}function af(e,t){let n=e*Math.PI/180,o=t*Math.PI/180,r=Math.cos(o);return[r*Math.sin(n),Math.sin(o),-r*Math.cos(n)]}function sf(e,t){let{position:n,uv:o,index:r}=Cx(),i=new Gt.Geometry(e,{position:{size:3,data:n},uv:{size:2,data:o},index:{data:r}}),a=new Gt.Texture(e,{image:t,wrapS:e.CLAMP_TO_EDGE,wrapT:e.CLAMP_TO_EDGE,generateMipmaps:!0,flipY:!1}),s=new Gt.Program(e,{vertex:_x,fragment:Tx,uniforms:{uPano:{value:a},uOpacity:{value:0}},transparent:!0,depthTest:!1,depthWrite:!1}),c=new Gt.Mesh(e,{geometry:i,program:s});return{mesh:c,setOpacity(l){s.uniforms.uOpacity.value=Math.max(0,Math.min(1,l))},setImage(l){a.image=l,a.needsUpdate=!0},dispose(){c.setParent(null),i.remove(),a.texture&&e.deleteTexture(a.texture),s.remove()}}}var Gt,Ix,Ex,Rx,_x,Tx,cf=Vn(()=>{"use strict";Gt=require("ogl"),Ix=64,Ex=32,Rx=500;_x=`#version 300 es
|
|
1
|
+
"use strict";var zf=Object.create;var Po=Object.defineProperty;var jf=Object.getOwnPropertyDescriptor;var Uf=Object.getOwnPropertyNames;var Wf=Object.getPrototypeOf,Xf=Object.prototype.hasOwnProperty;var Vn=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(o){throw n=[o],o}};var Na=(e,t)=>{for(var n in t)Po(e,n,{get:t[n],enumerable:!0})},Ba=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Uf(t))!Xf.call(e,r)&&r!==n&&Po(e,r,{get:()=>t[r],enumerable:!(o=jf(t,r))||o.enumerable});return e};var dt=(e,t,n)=>(n=e!=null?zf(Wf(e)):{},Ba(t||!e||!e.__esModule?Po(n,"default",{value:e,enumerable:!0}):n,e)),Yf=e=>Ba(Po({},"__esModule",{value:!0}),e);function Mx(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?0:Math.ceil(e*t*4*(4/3))}function vx(e){return(e!==void 0&&e<=2?32:e!==void 0&&e>=8?192:96)*1024*1024}function Sr(e){let t=typeof navigator>"u"?void 0:navigator;return{saveData:t?.connection?.saveData===!0,maxTextureSize:e,maxDecodedBytes:vx(t?.deviceMemory)}}function wr(e,t={}){let n=e.previewUrl?.trim();if(!n||n===e.url)return{initialUrl:e.url,initialWidth:e.sourceWidth,initialHeight:e.sourceHeight,reason:"full-only"};let o={initialUrl:n,initialWidth:e.previewWidth,initialHeight:e.previewHeight};if(t.saveData)return{...o,reason:"save-data"};let r=[...e.variants??[],...e.sourceWidth!==void 0&&e.sourceHeight!==void 0?[{url:e.url,width:e.sourceWidth,height:e.sourceHeight}]:[]].filter(c=>c.url.trim()&&c.url!==n&&Number.isFinite(c.width)&&c.width>0&&Number.isFinite(c.height)&&c.height>0).sort((c,l)=>c.width*c.height-l.width*l.height);if(!r.length)return{...o,upgradeUrl:e.url,reason:"progressive"};let i=r.filter(c=>t.maxTextureSize===void 0||Math.max(c.width,c.height)<=t.maxTextureSize);if(!i.length)return{...o,reason:"texture-limit"};let a=i.filter(c=>t.maxDecodedBytes===void 0||Mx(c.width,c.height)<=t.maxDecodedBytes);if(!a.length)return{...o,reason:"memory-limit"};let s=a[a.length-1];return{...o,upgradeUrl:s.url,reason:"progressive"}}function nf(){return new DOMException("Panorama image load aborted","AbortError")}function xo(e,t){return new Promise((n,o)=>{if(t?.aborted){o(nf());return}let r=new Image;r.crossOrigin="anonymous";let i=!1,a=()=>{r.onload=null,r.onerror=null,t?.removeEventListener("abort",c)},s=l=>{i||(i=!0,a(),l?o(l):n(r))},c=()=>{r.src="",s(nf())};r.onload=()=>{(typeof r.decode=="function"?r.decode():Promise.resolve()).then(()=>s(),()=>s())},r.onerror=()=>s(new Error("panorama_image_failed")),t?.addEventListener("abort",c,{once:!0}),r.src=e})}function Pr(e){let t=globalThis;if(t.requestIdleCallback){let o=t.requestIdleCallback(e,{timeout:1200});return()=>t.cancelIdleCallback?.(o)}let n=globalThis.setTimeout(e,32);return()=>globalThis.clearTimeout(n)}var pa=Vn(()=>{"use strict"});function rf(e){if(e.generated||e.mediaKind==="model")return"built from the chart";let t=e.mediaKind==="demo-render",n=t?e.coverage==="exact-seat"?"AI-generated exact-seat demo":e.coverage==="row-representative"?"AI-generated representative row demo":e.coverage==="section-representative"?"AI-generated representative section demo":e.coverage==="floor-representative"?"AI-generated representative floor demo":"AI-generated illustrative venue demo":e.coverage==="exact-seat"?"Exact seat photo":e.coverage==="row-representative"?"Representative row view":e.coverage==="section-representative"?"Representative section view":e.coverage==="floor-representative"?"Representative floor view":e.coverage==="venue-representative"?"Representative venue view":"Venue photo",o=e.capturedAt&&/^\d{4}/.test(e.capturedAt)?e.capturedAt.slice(0,4):"";return[n,o?`${t?"created":"captured"} ${o}`:"",e.sourceLabel??""].filter(Boolean).join(" \xB7 ")}function ba(e){return Math.max(Sx,Math.min(wx,e))}function Px(e,t,n){let o=(.5+e/360)*n;return t/2-o}function Ax(e,t=Ir){return e*(180/t)}function of(e,t,n){return(e-t)/2+Ar(n,t)}function Ar(e,t){let n=vt/180*t;return Math.max(-n,Math.min(n,e))}function Ix(){if(typeof window>"u")return!1;try{if(typeof window.matchMedia=="function"&&window.matchMedia("(pointer: coarse)").matches)return!0}catch{}return"ontouchstart"in window}function ya(e){return e||(Ix()?"Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close":"Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function af(e,t,n={}){let o=n.fadeMs??400,r=t.initialBearingDeg??0,i=wr(t,Sr()),a=new AbortController,s=()=>a.abort();n.signal?.addEventListener("abort",s,{once:!0});let c=document.createElement("div"),l=document.activeElement instanceof HTMLElement?document.activeElement:null;c.setAttribute("role","dialog"),c.setAttribute("aria-modal","true"),c.setAttribute("aria-label",n.seatLabel?`View from ${n.seatLabel}`:"View from seat"),c.tabIndex=-1,Object.assign(c.style,{position:"absolute",inset:"0",zIndex:"10",opacity:"0",transition:`opacity ${o}ms ease`,background:"#05070c",overflow:"hidden",touchAction:"none"});let u=document.createElement("div");Object.assign(u.style,{position:"absolute",inset:"0",backgroundImage:`url("${i.initialUrl}")`,backgroundRepeat:"repeat-x",cursor:"grab"}),c.appendChild(u);let m=document.createElement("button");if(m.type="button",m.setAttribute("aria-label","Close"),m.textContent="\u2715",Object.assign(m.style,{position:"absolute",top:"12px",right:"12px",zIndex:"2",width:"44px",height:"44px",borderRadius:"999px",cursor:"pointer",border:"1px solid rgba(255,255,255,0.25)",background:"rgba(8,12,18,0.6)",color:"#e6edf3",fontSize:"15px",lineHeight:"1"}),c.appendChild(m),n.disclosure){let G=document.createElement("div");G.textContent=`${n.disclosurePrefix??"360\xB0 panorama"} \xB7 ${n.disclosure}`,Object.assign(G.style,{position:"absolute",top:"calc(12px + var(--sl-3d-top-inset, 0px))",left:"12px",zIndex:"2",maxWidth:"calc(100% - 88px)",padding:"8px 11px",borderRadius:"999px",overflow:"hidden",color:"#dce6f8",background:"rgba(8,12,18,0.68)",font:"600 11px/1.2 ui-sans-serif, system-ui, sans-serif",textOverflow:"ellipsis",whiteSpace:"nowrap",pointerEvents:"none",backdropFilter:"blur(6px)"}),c.appendChild(G)}let f=document.createElement("div");f.textContent=ya(n.lookAroundHint),Object.assign(f.style,{position:"absolute",bottom:"12px",left:"0",right:"0",textAlign:"center",color:"rgba(230,237,243,0.7)",font:"12px ui-sans-serif, system-ui, sans-serif",pointerEvents:"none"}),c.appendChild(f),e.appendChild(c),m.focus({preventScroll:!0});let d=0,h=0,p=0,b=0,y=Ir,M=()=>{let G=c.clientHeight||1,j=c.clientWidth||1,Z=x.naturalWidth||j*2,$=x.naturalHeight||G,ee=d>0?(j/2-p)/d:0,Q=h>0?b/h:0;h=Ax(G,y),d=h*(Z/$),u.style.backgroundSize=`${d}px ${h}px`,v?p=j/2-ee*d:(p=Px(r,j,d),b=Ar((t.initialPitchDeg??0)/180*h,h),v=!0),b=Ar(Q*h,h),u.style.backgroundPosition=`${p}px ${of(G,h,b)}px`},v=!1,A=()=>{let G=c.clientHeight||1;b=Ar(b,h),u.style.backgroundPosition=`${p}px ${of(G,h,b)}px`},x=new Image;x.onload=M,x.src=i.initialUrl;let g=()=>{};i.upgradeUrl&&(g=Pr(()=>{(t.resolveUrl?t.resolveUrl(i.upgradeUrl):Promise.resolve(i.upgradeUrl)).then(j=>!j||a.signal.aborted?null:xo(j,a.signal).then(Z=>({full:Z,url:j}))).then(j=>{j&&(H||a.signal.aborted||(x=j.full,u.style.backgroundImage=`url("${j.url}")`,M()))}).catch(()=>{})})),requestAnimationFrame(M);let P=!1,S=0,w=0,E=0,T=new Map,F=()=>{let[G,j]=[...T.values()];return G&&j?Math.hypot(G.x-j.x,G.y-j.y):0},R=G=>{let j=ba(G);j!==y&&(y=j,M())},I=G=>{T.set(G.pointerId,{x:G.clientX,y:G.clientY}),P=T.size===1,S=G.clientX,w=G.clientY,T.size===2&&(E=F()),u.style.cursor="grabbing";try{u.setPointerCapture?.(G.pointerId)}catch{}},_=G=>{if(T.has(G.pointerId)){if(T.set(G.pointerId,{x:G.clientX,y:G.clientY}),T.size>=2){let j=F();E>0&&j>0&&R(y*(E/j)),E=j,P=!1;return}P&&(p+=G.clientX-S,b+=G.clientY-w,S=G.clientX,w=G.clientY,A())}},k=G=>{T.delete(G.pointerId),E=T.size===2?F():0;let j=T.values().next().value;P=T.size===1,j?(S=j.x,w=j.y):u.style.cursor="grab";try{u.releasePointerCapture?.(G.pointerId)}catch{}},V=G=>{G.preventDefault(),R(y+G.deltaY*.04)};u.addEventListener("pointerdown",I),u.addEventListener("pointermove",_),u.addEventListener("pointerup",k),u.addEventListener("pointercancel",k),u.addEventListener("wheel",V,{passive:!1});let O=!1,H=!1,U=0,N=()=>{u.removeEventListener("pointerdown",I),u.removeEventListener("pointermove",_),u.removeEventListener("pointerup",k),u.removeEventListener("pointercancel",k),u.removeEventListener("wheel",V),window.removeEventListener("keydown",D)},L=()=>{g(),a.abort(),n.signal?.removeEventListener("abort",s),U&&(window.clearTimeout(U),U=0),N(),c.parentNode&&c.parentNode.removeChild(c),l?.isConnected&&l.focus({preventScroll:!0})},B=()=>{if(O)return;O=!0,c.style.opacity="0";let G=()=>{U=0,!H&&(L(),n.onClose?.())};U=window.setTimeout(G,o)},D=G=>{if(G.key==="Tab"){G.preventDefault(),m.focus({preventScroll:!0});return}if(G.key==="Escape"){G.stopPropagation(),B();return}if(G.key==="ArrowLeft"||G.key==="ArrowRight")p+=G.key==="ArrowLeft"?-32:32;else if(G.key==="ArrowUp"||G.key==="ArrowDown")b+=(G.key==="ArrowUp"?4:-4)*(h/180);else if(G.key==="+"||G.key==="="){R(y-5),G.preventDefault();return}else if(G.key==="-"){R(y+5),G.preventDefault();return}else return;G.preventDefault(),A()};return window.addEventListener("keydown",D),m.addEventListener("click",B),requestAnimationFrame(()=>{c.style.opacity="1"}),{close:B,dispose(){O=!0,H=!0,L()}}}var Ir,Sx,wx,vt,Er=Vn(()=>{"use strict";pa();Ir=70,Sx=35,wx=90;vt=35});function _x(e=Ex,t=Rx,n=Cx){let o=e+1,r=t+1,i=o*r,a=new Float32Array(i*3),s=new Float32Array(i*2);for(let u=0;u<r;u++){let m=u/t,f=m*Math.PI,d=Math.sin(f),h=Math.cos(f);for(let p=0;p<o;p++){let b=p/e,y=(b-.5)*Math.PI*2,M=u*o+p;a[M*3]=n*d*Math.sin(y),a[M*3+1]=n*h,a[M*3+2]=-n*d*Math.cos(y),s[M*2]=b,s[M*2+1]=m}}let c=new Uint16Array(e*t*6),l=0;for(let u=0;u<t;u++)for(let m=0;m<e;m++){let f=u*o+m,d=f+o;c[l++]=f,c[l++]=d,c[l++]=f+1,c[l++]=f+1,c[l++]=d,c[l++]=d+1}return{position:a,uv:s,index:c}}function sf(e,t){let n=e*Math.PI/180,o=t*Math.PI/180,r=Math.cos(o);return[r*Math.sin(n),Math.sin(o),-r*Math.cos(n)]}function cf(e,t){let{position:n,uv:o,index:r}=_x(),i=new Gt.Geometry(e,{position:{size:3,data:n},uv:{size:2,data:o},index:{data:r}}),a=new Gt.Texture(e,{image:t,wrapS:e.CLAMP_TO_EDGE,wrapT:e.CLAMP_TO_EDGE,generateMipmaps:!0,flipY:!1}),s=new Gt.Program(e,{vertex:Tx,fragment:Lx,uniforms:{uPano:{value:a},uOpacity:{value:0}},transparent:!0,depthTest:!1,depthWrite:!1}),c=new Gt.Mesh(e,{geometry:i,program:s});return{mesh:c,setOpacity(l){s.uniforms.uOpacity.value=Math.max(0,Math.min(1,l))},setImage(l){a.image=l,a.needsUpdate=!0},dispose(){c.setParent(null),i.remove(),a.texture&&e.deleteTexture(a.texture),s.remove()}}}var Gt,Ex,Rx,Cx,Tx,Lx,lf=Vn(()=>{"use strict";Gt=require("ogl"),Ex=64,Rx=32,Cx=500;Tx=`#version 300 es
|
|
2
2
|
precision highp float;
|
|
3
3
|
in vec3 position;
|
|
4
4
|
in vec2 uv;
|
|
@@ -8,7 +8,7 @@ out vec2 vUv;
|
|
|
8
8
|
void main() {
|
|
9
9
|
vUv = uv;
|
|
10
10
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
11
|
-
}`,
|
|
11
|
+
}`,Lx=`#version 300 es
|
|
12
12
|
precision highp float;
|
|
13
13
|
in vec2 vUv;
|
|
14
14
|
uniform sampler2D uPano;
|
|
@@ -17,7 +17,7 @@ out vec4 fragColor;
|
|
|
17
17
|
void main() {
|
|
18
18
|
vec3 rgb = texture(uPano, vUv).rgb;
|
|
19
19
|
fragColor = vec4(rgb, uOpacity);
|
|
20
|
-
}`});async function uf(e,t,n,o={}){let r=o.fadeMs??400,i=t?.initialBearingDeg??0,a=Math.max(-vt,Math.min(vt,t?.initialPitchDeg??0)),s=Ar,c=!1,l=new AbortController,u=()=>l.abort();o.signal?.addEventListener("abort",u,{once:!0});let m=()=>{},f=[n.camera.position.x,n.camera.position.y,n.camera.position.z];if(!t&&n.cameraOriginWorld&&n.camera.position.set(n.cameraOriginWorld[0],n.cameraOriginWorld[1],n.cameraOriginWorld[2]),!t&&n.focalWorld){let N=n.camera.position,L=n.focalWorld[0]-N.x,B=n.focalWorld[1]-N.y,D=n.focalWorld[2]-N.z,G=Math.hypot(L,D);G>.001&&(i=Math.atan2(L,-D)*180/Math.PI,a=Math.max(-vt,Math.min(vt,Math.atan2(B,G)*180/Math.PI)))}let d=null;if(t){let N=n.gl.getParameter(n.gl.MAX_TEXTURE_SIZE),L=Sr(t,vr(N)),B;try{let D=t.resolveUrl?await t.resolveUrl(L.initialUrl):L.initialUrl;if(!D)throw new Error("panorama_asset_unavailable");B=await xo(D,l.signal)}catch{return o.signal?.removeEventListener("abort",u),null}try{d=sf(n.gl,B)}catch{return l.abort(),o.signal?.removeEventListener("abort",u),null}d.mesh.renderOrder=999,d.mesh.setParent(n.scene),L.upgradeUrl&&(m=wr(()=>{(t.resolveUrl?t.resolveUrl(L.upgradeUrl):Promise.resolve(L.upgradeUrl)).then(G=>!G||l.signal.aborted?null:xo(G,l.signal)).then(G=>{G&&(c||l.signal.aborted||(d?.setImage(G),n.requestRender()))}).catch(()=>{})}))}let h=n.camera.fov;n.camera.perspective({fov:s,aspect:n.camera.aspect});let p=n.camera.quaternion.slice(),b=()=>{let N=n.camera.position;d?.mesh.position.set(N.x,N.y,N.z);let[L,B,D]=af(i,a);n.camera.lookAt([N.x+L,N.y+B,N.z+D]),n.requestRender()};b();let y=document.createElement("div"),M=document.activeElement instanceof HTMLElement?document.activeElement:null;y.setAttribute("role","dialog"),y.setAttribute("aria-modal","true"),y.setAttribute("aria-label",o.seatLabel?`View from ${o.seatLabel}`:"View from seat"),y.tabIndex=-1,Object.assign(y.style,{position:"absolute",inset:"0",zIndex:"10",cursor:"grab",touchAction:"none"});let v=document.createElement("button");if(v.type="button",v.setAttribute("aria-label","Close"),v.textContent="\u2715",Object.assign(v.style,{position:"absolute",top:"12px",right:"12px",zIndex:"2",width:"44px",height:"44px",borderRadius:"999px",cursor:"pointer",border:"1px solid rgba(255,255,255,0.25)",background:"rgba(8,12,18,0.6)",color:"#e6edf3",fontSize:"15px",lineHeight:"1"}),y.appendChild(v),o.disclosure){let N=document.createElement("div");N.textContent=`${o.disclosurePrefix??"360\xB0 panorama"} \xB7 ${o.disclosure}`,Object.assign(N.style,{position:"absolute",top:"calc(12px + var(--sl-3d-top-inset, 0px))",left:"12px",zIndex:"2",maxWidth:"calc(100% - 88px)",padding:"8px 11px",borderRadius:"999px",overflow:"hidden",color:"#dce6f8",background:"rgba(8,12,18,0.68)",font:"600 11px/1.2 ui-sans-serif, system-ui, sans-serif",textOverflow:"ellipsis",whiteSpace:"nowrap",pointerEvents:"none",backdropFilter:"blur(6px)"}),y.appendChild(N)}let A=document.createElement("div");A.textContent=ba(o.lookAroundHint),Object.assign(A.style,{position:"absolute",bottom:"12px",left:"0",right:"0",textAlign:"center",color:"rgba(230,237,243,0.7)",font:"12px ui-sans-serif, system-ui, sans-serif",pointerEvents:"none"}),y.appendChild(A),e.appendChild(y),v.focus({preventScroll:!0});let x=!1,g=0,P=0,S=0,w=new Map,E=()=>{let[N,L]=[...w.values()];return N&&L?Math.hypot(N.x-L.x,N.y-L.y):0},T=N=>{let L=pa(N);L!==s&&(s=L,n.camera.perspective({fov:s,aspect:n.camera.aspect}),b())},F=N=>{N.target!==v&&(w.set(N.pointerId,{x:N.clientX,y:N.clientY}),x=w.size===1,g=N.clientX,P=N.clientY,w.size===2&&(S=E()),y.setPointerCapture?.(N.pointerId),y.style.cursor="grabbing")},R=N=>{if(w.has(N.pointerId)){if(w.set(N.pointerId,{x:N.clientX,y:N.clientY}),w.size>=2){let L=E();S>0&&L>0&&T(s*(S/L)),S=L,x=!1;return}x&&(i+=(N.clientX-g)*lf,a=Math.max(-vt,Math.min(vt,a+(N.clientY-P)*lf)),g=N.clientX,P=N.clientY,b())}},I=N=>{w.delete(N.pointerId),S=w.size===2?E():0;let L=w.values().next().value;x=w.size===1,L?(g=L.x,P=L.y):y.style.cursor="grab";try{y.releasePointerCapture?.(N.pointerId)}catch{}},_=N=>{N.preventDefault(),T(s+N.deltaY*.04)};y.addEventListener("pointerdown",F),y.addEventListener("pointermove",R),y.addEventListener("pointerup",I),y.addEventListener("pointercancel",I),y.addEventListener("wheel",_,{passive:!1});let k=N=>{if(!c){if(N.key==="Tab"){N.preventDefault(),v.focus({preventScroll:!0});return}if(N.key==="Escape"){N.stopPropagation(),U.close();return}if(N.key==="ArrowLeft"||N.key==="ArrowRight")i+=N.key==="ArrowLeft"?-4:4;else if(N.key==="ArrowUp"||N.key==="ArrowDown")a=Math.max(-vt,Math.min(vt,a+(N.key==="ArrowUp"?4:-4)));else if(N.key==="+"||N.key==="="){T(s-5),N.preventDefault();return}else if(N.key==="-"){T(s+5),N.preventDefault();return}else return;N.preventDefault(),b()}};window.addEventListener("keydown",k);let V=0,O=(N,L)=>{if(!d){L?.();return}let B=N===1?0:1,D=performance.now(),G=()=>{if(c)return;let j=r<=0?1:Math.min(1,(performance.now()-D)/r);d?.setOpacity(B+(N-B)*j),n.requestRender(),j<1?V=requestAnimationFrame(G):L?.()};V=requestAnimationFrame(G)};O(1);let H=()=>{c||(c=!0,m(),l.abort(),o.signal?.removeEventListener("abort",u),cancelAnimationFrame(V),y.removeEventListener("pointerdown",F),y.removeEventListener("pointermove",R),y.removeEventListener("pointerup",I),y.removeEventListener("pointercancel",I),y.removeEventListener("wheel",_),window.removeEventListener("keydown",k),y.remove(),M?.isConnected&&M.focus({preventScroll:!0}),d?.dispose(),n.camera.position.set(f[0],f[1],f[2]),n.camera.perspective({fov:h,aspect:n.camera.aspect}),n.camera.quaternion.set(p[0],p[1],p[2],p[3]),n.requestRender())},U={close(){if(c)return;let N=()=>{H(),o.onClose?.()};cancelAnimationFrame(V),O(0,N)},dispose:H};return v.addEventListener("click",()=>U.close()),U}var lf,mf=Vn(()=>{"use strict";cf();Ir();Ir();ha();lf=.15});var ff={};Da(ff,{createOpenPanorama:()=>Lx});function Lx(e){let{container:t,model:n,opts:o,analytics:r,orbit:i,loop:a,seatsById:s,ensureSeatView:c,resolvedSeatViewPose:l,gpu:u,gl:m,isContextLost:f,isDisposed:d,flightGen:h,setPanorama:p,getLoadAbort:b,setLoadAbort:y,setPanoramaSphereVisible:M,setFrozen:v,raisePanoramaLayer:A,restorePanoramaLayer:x,getOverviewChip:g,labelOverlay:P,reducedMotion:S,removeArriveChip:w,showArriveChip:E}=e;return async(T,F,R)=>{b()?.abort();let I=new AbortController;y(I);let _=n.seats.idToIndex.get(T);if(_===void 0){i.syncFromCamera();return}let k=s.get(T)?.label??T,V=l(T,_),O=c(T);if(!O){I.abort(),b()===I&&y(null),i.syncFromCamera();return}v(!0),a.stop();let H;try{H=await O}catch{if(b()===I&&y(null),r.panoramaFailed(T,"source"),!d()&&R===h()){v(!1),i.resumeAfterFlight(V.focal),a.requestRender();let Z=E(T,R,!0);requestAnimationFrame(()=>Z?.querySelector("[data-panorama-trigger]")?.focus())}return}if(d()||R!==h()){I.abort(),b()===I&&y(null);return}w();let U=g(),N=()=>{I.abort(),b()===I&&y(null),p(null),M(!1),x(),U.style.display="",P.setVisible(!o.arriveAtSeatEye),v(!1),r.panoramaClosed(),i.resumeAfterFlight(V.focal),a.requestRender();let Z=E(T,h());requestAnimationFrame(()=>Z?.querySelector("[data-panorama-trigger]")?.focus())},L=H.generated===!0,B=of(H);A(),M(!L),U.style.display="none";let D=S()?0:F,G=u(),j=G&&!f()?await uf(t,L?null:H,{gl:m,scene:G.main,camera:i.camera,requestRender:()=>a.requestRender(),cameraOriginWorld:L?V.eye:void 0,focalWorld:V.focal},{fadeMs:D,seatLabel:k,disclosure:B,disclosurePrefix:L?"Live 3D view":"360\xB0 panorama",lookAroundHint:o.lookAroundHint,onClose:N,signal:I.signal}):null;if(d()||R!==h()){I.abort(),M(!1),b()===I&&y(null),j?.dispose(),U.style.display="",x();return}if(j)i.syncFromCamera(),P.setVisible(!1),v(!1),a.requestRender(),p(j);else if(L){x(),U.style.display="",v(!1),i.resumeAfterFlight(V.focal),a.requestRender(),p(null),M(!1),r.panoramaFailed(T,"mount");let Z=E(T,h(),!0);requestAnimationFrame(()=>Z?.querySelector("[data-panorama-trigger]")?.focus()),b()===I&&y(null);return}else M(!1),r.panoramaFallback(T),p(rf(t,H,{fadeMs:D,seatLabel:k,disclosure:B,onClose:N,signal:I.signal,lookAroundHint:o.lookAroundHint}));r.panoramaOpened()}}var df=Vn(()=>{"use strict";Ir();mf()});var $x={};Da($x,{VENUE3D_QUALITY_REPORT_VERSION:()=>nm,autoVenue3d:()=>lr,buildSceneModel:()=>En,estimateVenue3D:()=>Mo,inspectVenue3DQualityEvidence:()=>hr,mountVenue3D:()=>Kx,prepareVenue3D:()=>Cf,prepareVenue3DFromChart:()=>_f});module.exports=Xf($x);function Ba(e,t,n){let o=Math.floor(t.length/3),r=n.center[0],i=n.center[2];if(o>0){let c=Math.max(1,Math.floor(o/4e3)),l=0,u=0,m=0;for(let f=0;f<o;f+=c)l+=t[f*3],u+=t[f*3+2],m++;r=l/m,i=u/m}let a=e[0]-r,s=e[2]-i;return Math.hypot(a,s)>n.radius*.12?Math.atan2(a,s):void 0}var Tf=require("ogl");function Va(e,t,n="#ffffff"){let{iPosition:o,count:r}=t.seats;if(r<2||typeof document>"u")return null;let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let x=0;x<r;x++){let g=o[x*3],P=o[x*3+2];g<i&&(i=g),g>a&&(a=g),P<s&&(s=P),P>c&&(c=P)}for(let x of t.stages)i=Math.min(i,x.cx-x.halfX),a=Math.max(a,x.cx+x.halfX),s=Math.min(s,x.cz-x.halfZ),c=Math.max(c,x.cz+x.halfZ);let l=Math.min(130/Math.max(.001,a-i),86/Math.max(.001,c-s)),u=(148-(a-i)*l)/2,m=(104-(c-s)*l)/2,f=x=>u+(x-i)*l,d=x=>m+(x-s)*l,h=Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),p=document.createElement("canvas");p.width=Math.round(148*h),p.height=Math.round(104*h),p.setAttribute("aria-hidden","true"),p.setAttribute("data-seat-locator","");let b=p.style;b.position="absolute",b.left="12px",b.bottom="12px",b.width="148px",b.height="104px",b.borderRadius="10px",b.background="rgba(10,14,22,.72)",b.border="1px solid rgba(255,255,255,.14)",b.boxShadow="0 4px 14px rgba(0,0,0,.35)",b.pointerEvents="none",b.zIndex="3",b.display="none",e.appendChild(p);let y=document.createElement("canvas");y.width=p.width,y.height=p.height;let M=y.getContext("2d");if(M){M.scale(h,h),M.fillStyle="rgba(214,222,234,.28)";let x=Math.max(1,Math.ceil(r/6e3));for(let g=0;g<r;g+=x)M.fillRect(f(o[g*3])-.6,d(o[g*3+2])-.6,1.2,1.2);M.fillStyle="rgba(236,240,246,.16)",M.strokeStyle="rgba(236,240,246,.55)",M.lineWidth=1;for(let g of t.stages){let P=f(g.cx-g.halfX),S=d(g.cz-g.halfZ),w=g.halfX*2*l,E=g.halfZ*2*l;M.fillRect(P,S,w,E),M.strokeRect(P+.5,S+.5,Math.max(0,w-1),Math.max(0,E-1))}}let v=p.getContext("2d"),A="";return{el:p,update(x,g){if(!x||!v||e.clientWidth>0&&e.clientWidth<560){b.display!=="none"&&(b.display="none"),A="";return}let P=f(x[0]),S=d(x[2]),w=g?Math.atan2(g[2],g[0]):0,E=`${P.toFixed(1)},${S.toFixed(1)},${w.toFixed(2)}`;if(E!==A){if(A=E,b.display="block",v.setTransform(1,0,0,1,0,0),v.clearRect(0,0,p.width,p.height),v.drawImage(y,0,0),v.setTransform(h,0,0,h,0,0),g){let T=v.createRadialGradient(P,S,0,P,S,26);T.addColorStop(0,"rgba(255,255,255,.55)"),T.addColorStop(1,"rgba(255,255,255,0)"),v.fillStyle=T,v.beginPath(),v.moveTo(P,S),v.arc(P,S,26,w-.5,w+.5),v.closePath(),v.fill()}v.fillStyle=n,v.strokeStyle="rgba(10,14,22,.9)",v.lineWidth=1.5,v.beginPath(),v.arc(P,S,3.6,0,Math.PI*2),v.fill(),v.stroke()}},dispose(){p.remove()}}}var we={pedestal:0,pad:1,back:2,arm:3,footrest:4,leg:5,body:10,head:11},Yf=.44,Kf=.15,Ga=.3,$f=.24;function Ha(e){return e===void 0||!Number.isFinite(e)||e<=0?$f:Math.min(Ga,Math.max(Kf,e*Yf))}var Hn=.21,Zf=.05,zr=.45,Rt=zr+Zf,zn=.92,Gn=.66,jr=1.205,za=-.23,ja=.38,qf=[{part:we.pedestal,min:[-.3,0,-.3],max:[.3,.36,.3]},{part:we.pad,min:[-1,.36,-.95],max:[1,zr,1]},{part:we.back,min:[-1,Rt,-1],max:[1,zn,-.72]},{part:we.arm,min:[-1,.44,-.82],max:[-.78,.65,.78]},{part:we.arm,min:[.78,.44,-.82],max:[1,.65,.78]},{part:we.footrest,min:[-.9,.18,.78],max:[.9,.31,1.34]},{part:we.leg,min:[-.82,0,-.7],max:[-.62,.37,-.48]},{part:we.leg,min:[.62,0,-.7],max:[.82,.37,-.48]},{part:we.leg,min:[-.82,0,.48],max:[-.62,.37,.7]},{part:we.leg,min:[.62,0,.48],max:[.82,.37,.7]}],Qf=[{part:we.body,min:[-.52,.39,-.08],max:[-.08,.55,.82]},{part:we.body,min:[.08,.39,-.08],max:[.52,.55,.82]},{part:we.body,min:[-.47,.05,.58],max:[-.13,.43,.82]},{part:we.body,min:[.13,.05,.58],max:[.47,.43,.82]},{part:we.head,min:[-.16,1.04,-.33],max:[.16,1.1,-.13]}],Jf=[{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 Ua(){let e=[],t=[],n=[],o=[],r=(L,B,D)=>{let G=n.length,[j,Z,$]=L,ee=[Z[0]-j[0],Z[1]-j[1],Z[2]-j[2]],Q=[$[0]-j[0],$[1]-j[1],$[2]-j[2]],X=ee[1]*Q[2]-ee[2]*Q[1],Y=ee[2]*Q[0]-ee[0]*Q[2],K=ee[0]*Q[1]-ee[1]*Q[0],re=Math.hypot(X,Y,K);re>1e-9?(X/=re,Y/=re,K/=re):[X,Y,K]=B,X*B[0]+Y*B[1]+K*B[2]<0&&(X=-X,Y=-Y,K=-K);for(let ne of L)e.push(...ne),t.push(X,Y,K),n.push(D);o.push(G,G+1,G+2,G,G+2,G+3)},i=L=>{for(let B of Jf){let D=B.c.map(G=>G.map((j,Z)=>j?L.max[Z]:L.min[Z]));r(D,B.n,L.part)}},a=(L,B)=>{let[D,G,j]=B?[0,1,2]:[0,2,1],Z=L.min[D],$=L.max[D],ee=L.min[G],Q=L.max[G],X=($-Z)*.1,Y=(Q-ee)*.1,K=B?[[Z+X,ee],[$-X,ee],[$,ee+Y],[$*.94,Q-(Q-ee)*.23],[$*Gn,Q],[Z*Gn,Q],[Z*.94,Q-(Q-ee)*.23],[Z,ee+Y]]:[[Z+X,ee],[$-X,ee],[$,ee+Y],[$,Q-Y],[$-X,Q],[Z+X,Q],[Z,Q-Y],[Z,ee+Y]],re=(se,J,ie)=>{let Ee=[0,0,0];return Ee[D]=se,Ee[G]=J,Ee[j]=ie,Ee},ne=[L.min[j],L.max[j]].map(se=>K.map(([J,ie])=>re(J,ie,se)));for(let se=0;se<K.length;se++){let J=(se+1)%K.length,ie=[0,0,0];ie[D]=(K[se][0]+K[J][0])/2-(Z+$)/2,ie[G]=(K[se][1]+K[J][1])/2-(ee+Q)/2,r([ne[0][se],ne[0][J],ne[1][J],ne[1][se]],ie,L.part)}for(let se=0;se<2;se++){let J=[0,0,0];J[j]=se?1:-1;let ie=ne[se];for(let Ee=1;Ee<ie.length-1;Ee++){let te=n.length;for(let ve of[ie[0],ie[Ee],ie[Ee+1]])e.push(...ve),t.push(...J),n.push(L.part);o.push(te,te+1,te+2)}}};for(let L of qf)L.part===we.pad||L.part===we.back?a(L,L.part===we.back):i(L);for(let L of Qf)i(L);let s=zr,c=1.08,l=.47,u=.69,m=-.55,f=.08,d=-.48,h=.01,p=[-l,s,m],b=[l,s,m],y=[-l,s,f],M=[l,s,f],v=[-u,c,d],A=[u,c,d],x=[-u,c,h],g=[u,c,h];r([b,A,g,M],[1,0,0],we.body),r([y,x,v,p],[-1,0,0],we.body),r([p,b,M,y],[0,-1,0],we.body);let P=c+.07,S=.24,w=[-S,P,d],E=[S,P,d],T=[-S,P,h],F=[S,P,h];r([x,T,w,v],[-.5,1,0],we.body),r([T,F,E,w],[0,1,0],we.body),r([F,g,A,E],[.5,1,0],we.body),r([M,g,x,y],[0,0,1],we.body),r([g,F,T,x],[0,0,1],we.body),r([p,v,A,b],[0,0,-1],we.body),r([v,w,E,A],[0,0,-1],we.body);let R=10,I=8,_=[0,jr,za],k=[.32,.115,ja],V=n.length;for(let L=0;L<=I;L++){let B=Math.PI*L/I,D=Math.cos(B),G=Math.sin(B);for(let j=0;j<=R;j++){let Z=Math.PI*2*j/R,$=G*Math.cos(Z),ee=G*Math.sin(Z);e.push(_[0]+k[0]*$,_[1]+k[1]*D,_[2]+k[2]*ee);let Q=$/k[0],X=D/k[1],Y=ee/k[2],K=Math.hypot(Q,X,Y)||1;Q/=K,X/=K,Y/=K,t.push(Q,X,Y),n.push(we.head)}}for(let L=0;L<I;L++)for(let B=0;B<R;B++){let D=V+L*(R+1)+B,G=D+R+1;o.push(D,G,D+1,D+1,G,G+1)}let O=new Float32Array(e),H=new Float32Array(t),U=new Float32Array(n),N=new Uint16Array(o);return{position:O,normal:H,part:U,index:N,vertexCount:n.length,indexCount:o.length}}function Wa(e,t,n,o){let r=new Float32Array(t),i=l=>e[l*3],a=l=>e[l*3+2],s=0,c=(l,u)=>{let m=u-l;for(let f=l;f<u;f++){let[d,h]=o(f),p=d-i(f),b=h-a(f);if(m>=2){let y=Math.max(l,f-1),M=Math.min(u-1,f+1),v=i(M)-i(y),A=a(M)-a(y),x=Math.hypot(v,A);if(x>1e-6){let g=-A/x,P=v/x;g*p+P*b<0&&(g=-g,P=-P),p=g,b=P}}r[f]=p===0&&b===0?0:Math.atan2(p,b)}};for(let l=1;l<=t;l++)(l===t||n(l)!==n(s))&&(c(s,l),s=l);return r}var Ur=78,Xa=18;function Ya(){let e=[],t=[],n=[],o=[],r=[],i=[{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]]}];for(let s of[{part:1,min:[-1,.36,-.95],max:[1,.45,1]},{part:2,min:[-1,Rt,-1],max:[1,zn,-.72]}])for(let c of i){let l=e.length/3,u=c.n[1]+(s.part===2?Math.abs(c.n[0])*(1-Gn)/(zn-Rt):0),m=Math.hypot(c.n[0],u,c.n[2]),f=[c.n[0]/m,u/m,c.n[2]/m];for(let[d,h]of c.c.entries()){let p=h.map((b,y)=>s.min[y]+b*(s.max[y]-s.min[y]));s.part===2&&(p[0]*=1-h[1]*(1-Gn)),e.push(...p),t.push(...f),n.push(s.part),o.push(...[[-1,-1],[1,-1],[1,1],[-1,1]][d])}r.push(l,l+1,l+2,l,l+2,l+3)}let a=e.length/3;for(let[s,c]of[[-1,-1],[1,-1],[1,1],[-1,1]])e.push(s,c,0),t.push(0,1,0),n.push(0),o.push(s,c);return r.push(a,a+1,a+2,a,a+2,a+3),r.push(...r.slice(12,18),...r.slice(60,66),...r.slice(72,78)),{position:new Float32Array(e),normal:new Float32Array(t),surface:new Float32Array(n),uv:new Float32Array(o),index:new Uint16Array(r)}}var Ja=require("ogl");var ed=/^#?([\da-f]{3}|[\da-f]{6})$/i;function Ka(e){let t=e.replace("#","");return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}function td(e){let t=ed.exec((e??"").trim());if(!t)return null;let n=t[1].length===3?t[1].split("").map(r=>r+r).join(""):t[1],o=parseInt(n,16);return[o>>16&255,o>>8&255,o&255]}function be(e){let t=td(e);return t?[t[0]/255,t[1]/255,t[2]/255]:null}function Wr(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function nd(e){return .2126*Wr(e[0])+.7152*Wr(e[1])+.0722*Wr(e[2])}function $a(e){return nd([e[0]*255,e[1]*255,e[2]*255])}function od(e){return .2126*e[0]+.7152*e[1]+.0722*e[2]}function ge(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n]}function at(e,t){let n=od(e);return ge(e,[n,n,n],t)}function Za({r:e,g:t,b:n}){let o=e/255,r=t/255,i=n/255,a=Math.max(o,r,i),s=Math.min(o,r,i),c=(a+s)/2;if(a===s)return{h:0,s:0,l:c};let l=a-s,u=c>.5?l/(2-a-s):l/(a+s),m;return a===o?m=((r-i)/l+(r<i?6:0))/6:a===r?m=((i-o)/l+2)/6:m=((o-r)/l+4)/6,{h:m,s:u,l:c}}var Be=["available","held","sold","selected","dimmed"];function jn(e){let t=Be.indexOf(e);return t<0?0:t}var qa={available:[.24,.82,.52],held:[.34,.39,.45],sold:[.34,.39,.45],selected:[.24,.74,1],dimmed:[.28,.32,.37]};function Qa(e){let t=.2126*e[0]+.7152*e[1]+.0722*e[2],n=.78,o=.86;return[(t+(e[0]-t)*n)*o,(t+(e[1]-t)*n)*o,(t+(e[2]-t)*n)*o]}var Xr={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]},Wt={top:[.05,.06,.08],bottom:[.1,.12,.15]};function le(e,t){return[Math.min(1,e[0]*t),Math.min(1,e[1]*t),Math.min(1,e[2]*t)]}function rd(){let e=typeof window<"u"&&window.devicePixelRatio||1,t=navigator.deviceMemory,n=typeof t=="number"&&t<=4?1.5:2;return Math.min(e,n)}var Ao=class{constructor(t,n){this.clearRgb=[0,0,0];this.container=t,this.canvas=document.createElement("canvas"),this.canvas.style.display="block",this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.touchAction="none",this.canvas.tabIndex=0,this.canvas.setAttribute("role","application"),this.canvas.setAttribute("aria-label","Interactive 3D venue. Drag or use arrow keys to look around; pinch, scroll, plus or minus to zoom."),this.renderer=new Ja.Renderer({canvas:this.canvas,dpr:rd(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[Wt.top[0],Wt.top[1],Wt.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),t.appendChild(this.canvas),this.lostHandler=o=>{o.preventDefault(),n.onContextLost()},this.restoredHandler=()=>n.onContextRestored(),this.canvas.addEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.restoredHandler,!1),this.resize()}setClearColor(t){this.clearRgb=[t[0],t[1],t[2]],this.gl.clearColor(t[0],t[1],t[2],1)}get clearColor(){return this.clearRgb}resize(){let t=Math.max(1,this.container.clientWidth||this.canvas.clientWidth||1),n=Math.max(1,this.container.clientHeight||this.canvas.clientHeight||1);return this.renderer.setSize(t,n),{width:t,height:n}}get pixelHeight(){return this.renderer.height*this.renderer.dpr}get aspect(){return this.renderer.width/Math.max(1,this.renderer.height)}dispose(){this.canvas.removeEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.restoredHandler,!1);let t=this.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}simulateContextLossCycle(){let t=this.gl.getExtension("WEBGL_lose_context");t&&(t.loseContext(),setTimeout(()=>{t.restoreContext&&t.restoreContext()},300))}};var on=require("ogl"),Ve=Math.PI/180,Yr=15*Ve,Kr=80*Ve,nn=.12,es=35,$r=1.25,ts=.006,id=4,rn=.82,Un=1/rn,ad=.12,sd=2;function cd(e,t){return{azimuth:0-e*ts,polar:-t*ts}}function ns(e,t,n){let o=Math.max(sd,Math.max(1,t)*ad),r=n*id;return{minDist:e?Math.min(e.minDist,o):o,maxDist:e?Math.max(e.maxDist,r):r}}var ld=1.5;function ud(e,t,n){let o=Math.max(1,n)*ld;if(!e)return{anchor:[t[0],t[1],t[2]],limit:o};let[r,i,a]=e.anchor,s=t[1]-i,c=Math.max(Math.abs(t[0]-r),Math.abs(t[2]-a),s>=0?s:-s*2);return{anchor:e.anchor,limit:Math.max(e.limit,c+o)}}function md(e,t,n,o,r,i,a,s){let c=Math.sin(n),l=[c*Math.sin(t),Math.cos(n),c*Math.cos(t)],u=[e[0]+o*l[0],e[1]+o*l[1],e[2]+o*l[2]],m=[-l[0],-l[1],-l[2]],f=[-m[2],0,m[0]],d=Math.hypot(f[0],f[2])||1;f=[f[0]/d,0,f[2]/d];let h=[f[1]*m[2]-f[2]*m[1],f[2]*m[0]-f[0]*m[2],f[0]*m[1]-f[1]*m[0]],p=Math.tan(r*Ve/2),b=p*(i>0?i:1),y=[0,1,2].map(A=>m[A]+a*b*f[A]+s*p*h[A]);if(y[1]>=-1e-6)return null;let M=(e[1]-u[1])/y[1],v=Math.hypot(y[0],y[1],y[2]);return!(M>0)||M*v>o*fd?null:[u[0]+y[0]*M,e[1],u[2]+y[2]*M]}var os=3,fd=4,rs=.72,dd=.6;function hd(e,t,n){return e!=="auto"?e:n!==null&&t<n*dd?"pan":"orbit"}function is(e,t){let n=Math.sin(t),o=-n*Math.sin(e),r=-Math.cos(t),i=-n*Math.cos(e);if(Math.abs(r)>.999)return null;let a=-i,s=o,c=Math.hypot(a,s);return a/=c,s/=c,{fx:o,fy:r,fz:i,rx:a,rz:s,ux:-s*r,uy:s*o-a*i,uz:a*r}}var pd=.4;function bd(e,t,n,o,r,i){let a=[e.center[0],e.center[1],e.center[2]],s=i(a),c=e.fitPoints,l=is(o,r);if(!c||c.length<9||!l)return{center:a,distance:s};let{fx:u,fy:m,fz:f,rx:d,rz:h,ux:p,uy:b,uz:y}=l,M=Math.hypot(u,f),v=u/M,A=f/M,x=v*p+A*y,g=pd*Math.max(1,e.radius);for(let P=0;P<3;P++){let S=1/0,w=-1/0,E=1/0,T=-1/0;for(let V=0;V+2<c.length;V+=3){let O=c[V]-a[0],H=c[V+1]-a[1],U=c[V+2]-a[2],N=s+O*u+H*m+U*f;if(!(N>.001))continue;let L=(O*d+U*h)/(N*t),B=(O*p+H*b+U*y)/(N*n);L<S&&(S=L),L>w&&(w=L),B<E&&(E=B),B>T&&(T=B)}if(!Number.isFinite(S))break;let F=(S+w)/2*s*t,R=Math.abs(x)>.1?(E+T)/2*s*n/x:0,I=F*d+R*v,_=F*h+R*A;if(Math.hypot(a[0]+I-e.center[0],a[2]+_-e.center[2])>g){let V=a[0]-e.center[0],O=a[2]-e.center[2],H=V+I,U=O+_,N=g/Math.hypot(H,U);I=H*N-V,_=U*N-O}a=[a[0]+I,a[1],a[2]+_],s=i(a)}return{center:a,distance:s}}var Io=class{constructor(t,n,o,r){this.fovY=es;this.target=new on.Vec3;this.azimuth=-30*Ve;this.polar=55*Ve;this.distance=10;this.azT=-30*Ve;this.polT=55*Ve;this.distT=10;this.minDist=1;this.maxDist=100;this.envelope=null;this.gestureFired=!1;this.interactionEnabled=!0;this.dragging=!1;this.panning=!1;this.lastX=0;this.lastY=0;this.activePointers=new Map;this.pinchDist=0;this.pinchCx=0;this.pinchCy=0;this.targetT=new on.Vec3;this.panAnchor=new on.Vec3;this.panLimit=0;this.panBox=null;this.zoomPointResolver=null;this.primaryDragMode="auto";this.overviewDist=null;this.pinchAngle=0;this.camera=new on.Camera(t,{fov:es,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=o,this.onGesture=r,this.onPointerDown=i=>{if(this.interactionEnabled){try{this.canvas.setPointerCapture?.(i.pointerId)}catch{}if(this.activePointers.set(i.pointerId,{x:i.clientX,y:i.clientY}),this.activePointers.size===1){let a=this.dragAction(),s=a==="orbit"?"pan":"orbit",c=i.button===2||i.button===1||i.shiftKey?s:a;this.panning=c==="pan",this.dragging=!this.panning,this.lastX=i.clientX,this.lastY=i.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance(),this.pinchAngle=this.currentPinchAngle();let a=this.pinchCentroid();this.pinchCx=a.x,this.pinchCy=a.y}}},this.onPointerMove=i=>{if(!this.interactionEnabled||!this.activePointers.has(i.pointerId))return;if(this.activePointers.set(i.pointerId,{x:i.clientX,y:i.clientY}),this.activePointers.size>=2){let l=this.currentPinchDistance(),u=this.pinchCentroid();this.pinchDist>0&&(this.dollyAt(Math.exp((this.pinchDist-l)*.005),u.x,u.y),this.fireGesture()),this.pinchDist=l;let m=this.currentPinchAngle(),f=m-this.pinchAngle;f>Math.PI&&(f-=2*Math.PI),f<-Math.PI&&(f+=2*Math.PI),this.pinchAngle=m,Math.abs(f)>1e-4&&Math.abs(f)<.5&&(this.azT+=f,this.fireGesture()),this.panBy(u.x-this.pinchCx,u.y-this.pinchCy),this.pinchCx=u.x,this.pinchCy=u.y;return}let a=i.clientX-this.lastX,s=i.clientY-this.lastY;if(this.panning){this.lastX=i.clientX,this.lastY=i.clientY,(a!==0||s!==0)&&(this.panBy(a,s),this.fireGesture());return}if(!this.dragging)return;this.lastX=i.clientX,this.lastY=i.clientY,(a!==0||s!==0)&&this.fireGesture();let c=cd(a,s);this.azT+=c.azimuth,this.polT=Math.max(Yr,Math.min(Kr,this.polT+c.polar)),this.requestRender()},this.onPointerUp=i=>{this.activePointers.delete(i.pointerId);try{this.canvas.releasePointerCapture?.(i.pointerId)}catch{}this.activePointers.size<2&&(this.pinchDist=0),this.activePointers.size===0&&(this.dragging=!1,this.panning=!1)},this.onContextMenu=i=>{i.preventDefault()},this.onWheel=i=>{if(i.preventDefault(),!this.interactionEnabled)return;let a=i.deltaMode===1?16:i.deltaMode===2?100:1,s=Math.max(-2,Math.min(2,i.deltaY*a/100));this.dollyAt(Math.exp(s*.22),i.clientX,i.clientY),this.fireGesture()},this.onKeyDown=i=>{if(!this.interactionEnabled)return;let a=7*Ve;if(i.shiftKey&&(i.key==="ArrowLeft"||i.key==="ArrowRight"||i.key==="ArrowUp"||i.key==="ArrowDown"))this.panBy(i.key==="ArrowLeft"?-32:i.key==="ArrowRight"?32:0,i.key==="ArrowUp"?-32:i.key==="ArrowDown"?32:0);else if(i.key==="ArrowLeft"||i.key==="ArrowRight")this.azT+=i.key==="ArrowLeft"?a:-a;else if(i.key==="ArrowUp"||i.key==="ArrowDown")this.polT=Math.max(Yr,Math.min(Kr,this.polT+(i.key==="ArrowUp"?-a:a)));else if(i.key==="+"||i.key==="=")this.dollyBy(rn);else if(i.key==="-"||i.key==="_")this.dollyBy(Un);else return;i.preventDefault(),this.fireGesture(),this.requestRender()},n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerUp),n.addEventListener("pointercancel",this.onPointerUp),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("keydown",this.onKeyDown),n.addEventListener("contextmenu",this.onContextMenu)}pinchCentroid(){let t=[...this.activePointers.values()];if(!t.length)return{x:0,y:0};let n=0,o=0;for(let r of t)n+=r.x,o+=r.y;return{x:n/t.length,y:o/t.length}}panBy(t,n){let o=this.canvas.clientHeight||1,r=2*this.distance*Math.tan(this.fovY*Ve/2)/o,i=Math.sin(this.azimuth),a=Math.cos(this.azimuth),s=a,c=-i,l=Math.cos(this.polar),u=Math.sin(this.polar),m=-i*l,f=-a*l;this.targetT.x+=(-t*s+n*m)*r,this.targetT.z+=(-t*c+n*f)*r,this.targetT.y+=n*u*r,this.clampPan(),this.requestRender()}widenPanBox(t){this.panBox=ud(this.panBox,t.center,t.radius),this.panAnchor.set(this.panBox.anchor[0],this.panBox.anchor[1],this.panBox.anchor[2]),this.panLimit=this.panBox.limit}clampPan(){if(this.panLimit<=0)return;let t=this.panLimit,n=this.panAnchor.x,o=this.panAnchor.y,r=this.panAnchor.z;this.targetT.x=Math.max(n-t,Math.min(n+t,this.targetT.x)),this.targetT.z=Math.max(r-t,Math.min(r+t,this.targetT.z)),this.targetT.y=Math.max(o-t*.5,Math.min(o+t,this.targetT.y))}fireGesture(){this.gestureFired||(this.gestureFired=!0,this.onGesture?.())}currentPinchAngle(){let[t,n]=[...this.activePointers.values()];return t&&n?Math.atan2(n.y-t.y,n.x-t.x):0}dragAction(){return hd(this.primaryDragMode,this.distT,this.overviewDist)}currentPinchDistance(){let t=[...this.activePointers.values()];return t.length<2?0:Math.hypot(t[0].x-t[1].x,t[0].y-t[1].y)}dollyBy(t){this.distT=Math.max(this.minDist,Math.min(this.maxDist,this.distT*t)),this.requestRender()}dollyAt(t,n,o){let r=this.distT,i=this.canvas.getBoundingClientRect?.(),a=this.zoomPointResolver?.(n,o)??null;if(a){this.distT=Math.max(os,Math.min(this.maxDist,this.distT*t)),this.minDist=Math.min(this.minDist,Math.max(os,this.distT)),this.requestRender(),this.scaleTargetAbout(a,this.distT/r);return}let s=i&&i.width>0&&i.height>0?md([this.targetT.x,this.targetT.y,this.targetT.z],this.azT,this.polT,this.distT,this.fovY,this.camera.aspect||i.width/i.height,(n-i.left)/i.width*2-1,1-(o-i.top)/i.height*2):null;this.dollyBy(t),s&&this.scaleTargetAbout(s,this.distT/r)}scaleTargetAbout(t,n){!Number.isFinite(n)||n===1||(this.targetT.x=t[0]+(this.targetT.x-t[0])*n,this.targetT.y=t[1]+(this.targetT.y-t[1])*n,this.targetT.z=t[2]+(this.targetT.z-t[2])*n,this.clampPan())}setZoomPointResolver(t){this.zoomPointResolver=t}zoomBy(t){this.interactionEnabled&&(this.dollyBy(t),this.fireGesture())}dollyLimitState(){return{atMin:this.distT<=this.minDist+1e-6,atMax:this.distT>=this.maxDist-1e-6}}setPrimaryDragMode(t){this.primaryDragMode=t}setInteractionEnabled(t){this.interactionEnabled=t,!t&&(this.activePointers.clear(),this.dragging=!1,this.panning=!1,this.pinchDist=0)}frame(t,n=!1,o,r=!1,i){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.target.set(t.center[0],t.center[1],t.center[2]),this.targetT.copy(this.target),this.widenPanBox(t);let a=Math.max(1,t.radius),s=this.fovY*Ve/2,c=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,l=Math.atan(Math.tan(s)*c);this.azT=o??-30*Ve,this.polT=Math.max(15,Math.min(80,i?.polarDeg??55))*Ve;let u=this.framedOn(t,s,l),m=u.distance;this.target.set(u.center[0],u.center[1],u.center[2]),this.targetT.copy(this.target),this.distT=m*Math.max(1.05,Math.min(2,i?.margin??$r)),this.envelope=ns(this.envelope,a,m),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.overviewDist===null&&(this.overviewDist=this.distT),n?(this.azimuth=this.azT,this.polar=12*Ve,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(t){if(!(t>0)||!Number.isFinite(t))return;let n=this.camera.aspect;if(this.interactionEnabled&&n>0){let o=Math.min(n,1)/Math.min(t,1);this.distance*=o,this.distT*=o,this.overviewDist!==null&&(this.overviewDist*=o),this.maxDist=Math.max(this.maxDist,this.distance,this.distT),this.applyPosition()}this.camera.perspective({aspect:t})}glideTo(t,n){this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.widenPanBox(t),this.targetT.set(t.center[0],t.center[1],t.center[2]);let o=this.fovY*Ve/2,r=Math.atan(Math.tan(o)*(this.camera.aspect||1));this.azT=this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*Ve;let i=this.framedOn(t,o,r),a=i.distance;this.targetT.set(i.center[0],i.center[1],i.center[2]),this.distT=a*Math.max(1.05,Math.min(2,n?.margin??$r)),this.envelope=ns(this.envelope,Math.max(1,t.radius),a),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.requestRender()}frameSoft(t,n,o=!1,r){this.target.set(t.center[0],t.center[1],t.center[2]),this.targetT.copy(this.target),this.widenPanBox(t),this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let i=this.fovY*Ve/2,a=o?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,s=Math.atan(Math.tan(i)*a);this.azT=n??this.azimuth,this.polT=Math.max(15,Math.min(80,r?.polarDeg??55))*Ve;let c=this.framedOn(t,i,s);this.targetT.set(c.center[0],c.center[1],c.center[2]),this.distT=c.distance*Math.max(1.05,Math.min(2,r?.margin??$r))}framedOn(t,n,o){return bd(t,Math.tan(o),Math.tan(n),this.azT,this.polT,r=>this.fitDistance({...t,center:r},n,o,this.azT,this.polT))}fitDistance(t,n,o,r,i){let a=Math.max(1,t.radius),s=Math.max(a/Math.tan(n),a/Math.tan(o)),c=t.box;if(!c)return s;let l=is(r,i);if(!l)return s;let{fx:u,fy:m,fz:f,rx:d,rz:h,ux:p,uy:b,uz:y}=l,M=Math.tan(o),v=Math.tan(n),A=1;for(let E=0;E<8;E++){let T=(E&1?c.max[0]:c.min[0])-t.center[0],F=(E&2?c.max[1]:c.min[1])-t.center[1],R=(E&4?c.max[2]:c.min[2])-t.center[2],I=T*u+F*m+R*f,_=Math.abs(T*d+R*h),k=Math.abs(T*p+F*b+R*y);A=Math.max(A,_/M-I,k/v-I)}let x=Math.min(s,Math.max(A,a*.35)),g=t.fitPoints;if(!g||g.length<9)return x;let P=0,S=1/(M*rs),w=1/(v*rs);for(let E=0;E+2<g.length;E+=3){let T=g[E]-t.center[0],F=g[E+1]-t.center[1],R=g[E+2]-t.center[2],I=T*u+F*m+R*f,_=Math.abs(T*d+R*h),k=Math.abs(T*p+F*b+R*y);P=Math.max(P,_*S-I,k*w-I)}return Math.min(x*1.5,Math.max(x*.55,P))}updateClipping(t){let n=this.camera.position.x-t.center[0],o=this.camera.position.y-t.center[1],r=this.camera.position.z-t.center[2],i=Math.hypot(this.camera.position.x-this.target.x,this.camera.position.y-this.target.y,this.camera.position.z-this.target.z),a=this.interactionEnabled&&Math.abs(i-this.distance)<=this.distance*.01,{near:s,far:c}=xd(Math.hypot(n,o,r),t.radius,a?this.distance:null);this.camera.perspective({near:s,far:c,aspect:this.camera.aspect})}update(){let t=this.azT-this.azimuth,n=this.polT-this.polar,o=this.distT-this.distance,r=this.targetT.x-this.target.x,i=this.targetT.y-this.target.y,a=this.targetT.z-this.target.z,s=Math.max(1e-4,this.distance*1e-4),c=Math.abs(t)>1e-4||Math.abs(n)>1e-4||Math.abs(o)>1e-4||Math.abs(r)>s||Math.abs(i)>s||Math.abs(a)>s;return this.azimuth+=t*nn,this.polar+=n*nn,this.distance+=o*nn,this.target.x+=r*nn,this.target.y+=i*nn,this.target.z+=a*nn,c&&this.applyPosition(),c}get currentAzimuth(){return this.azimuth}get currentDistance(){return this.distance}get targetDistance(){return this.distT}syncFromCamera(){let t=this.camera.position.x-this.target.x,n=this.camera.position.y-this.target.y,o=this.camera.position.z-this.target.z,r=Math.hypot(t,n,o)||1,i=Math.max(Yr,Math.min(Kr,Math.acos(Math.max(-1,Math.min(1,n/r)))));this.distance=this.distT=r,this.polar=this.polT=i,this.azimuth=this.azT=Math.atan2(t,o)}snapshot(){let t=this.target.clone(),n=this.targetT.clone(),{azimuth:o,azT:r,polar:i,polT:a,distance:s,distT:c}=this,l=this.camera.position.clone(),u=[...this.camera.quaternion],m=this.camera.fov;return()=>{this.target.copy(t),this.targetT.copy(n),Object.assign(this,{azimuth:o,azT:r,polar:i,polT:a,distance:s,distT:c}),this.camera.position.copy(l),this.camera.quaternion.set(u[0],u[1],u[2],u[3]),this.camera.perspective({fov:m,aspect:this.camera.aspect}),this.camera.updateMatrixWorld()}}setTarget(t){this.target.set(t[0],t[1],t[2]),this.targetT.copy(this.target)}resumeAfterFlight(t){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),t&&this.target.set(t[0],t[1],t[2]),this.targetT.copy(this.target),this.syncFromCamera()}applyPosition(){let t=Math.sin(this.polar),n=this.target.x+this.distance*t*Math.sin(this.azimuth),o=this.target.y+this.distance*Math.cos(this.polar),r=this.target.z+this.distance*t*Math.cos(this.azimuth);this.camera.position.set(n,o,r),this.camera.lookAt(this.target)}dispose(){this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointercancel",this.onPointerUp),this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("keydown",this.onKeyDown),this.canvas.removeEventListener("contextmenu",this.onContextMenu),this.activePointers.clear()}},yd=.1,gd=.25;function xd(e,t,n){let o=Math.max(1,t)*1.18,r=n==null?gd:Math.max(.05,n*yd),i=Math.max(r,e-o),a=Math.max(i+10,e+o);return{near:i,far:a}}var Eo=class{constructor(t){this.rafId=0;this.running=!1;this.lastTime=0;this.fpsEma=0;this.rendered=0;this.tick=t=>{let n=this.lastTime?(t-this.lastTime)/1e3:.016666666666666666;if(this.lastTime=t,n>0){let r=1/n;this.fpsEma=this.fpsEma?this.fpsEma*.9+r*.1:r}this.rendered++,this.frame(n)?this.rafId=requestAnimationFrame(this.tick):(this.running=!1,this.rafId=0)};this.frame=t}requestRender(){this.running||(this.running=!0,this.lastTime=0,this.rafId=requestAnimationFrame(this.tick))}stats(){return{fps:this.running?Math.round(this.fpsEma):0,rendered:this.rendered,idle:!this.running}}stop(){this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=0,this.running=!1}};function as(e){let t=!1;return n=>{n!==t&&(t=n,n?e.dataset.slReady="1":delete e.dataset.slReady)}}function Zr(e,t,n){return Math.max(t,Math.min(n,e))}function Md(e){return Zr(e,0,1)}function ss(e){let t=Md(e);return t*t*(3-2*t)}var an=2.5,vd=1.15,Wn=12,sn=22,cs=6,ls=9.5,us=.9,ms=2.2,qr=30,Qr=4,Ro=8192;var fM=sn+Qr;function fs(e,t){let n=t*1.4,o=t*3.2;if(e<=n)return{scale:1,fade:0,minPixels:an};let r=Math.min(1,(e-n)/Math.max(.001,o-n));return{scale:1-r*.4,fade:r*.55,minPixels:an+r*(vd-an)}}function ds(e,t,n){return!(e>0)||!(t>0)||!(n>0)?!1:t*n/e>=64}var Sd=12;function hs(e,t,n,o,r){if(!(e>0)||!(t>0)||!(n>0)||!(o>0)||!(r>0))return!1;let i=Math.tan(o/2*Math.PI/180);if(!(i>0))return!1;let a=t/(n*i)*(r/2);return Math.PI*a*a/e>=Sd}var Jr=[{key:"wheelchair",label:"Wheelchair space",short:"Wheelchair",icon:"\u267F"},{key:"companion",label:"Companion seat",short:"Companion",icon:"\u{1F9D1}\u200D\u{1F91D}\u200D\u{1F9D1}"},{key:"semi-ambulatory",label:"Semi-ambulatory (limited mobility)",short:"Limited mobility",icon:"\u{1F9AF}"},{key:"designated-aisle",label:"Designated aisle / transfer seat",short:"Aisle transfer",icon:"AS"},{key:"step-free",label:"Step-free accessible seat",short:"Step-free",icon:"SF"},{key:"hearing",label:"Assistive listening",short:"Hearing",icon:"\u{1F9BB}"},{key:"cart",label:"CART live-caption view",short:"CART captions",icon:"CC"},{key:"sign-language",label:"Sign-language view",short:"Sign language",icon:"\u{1F91F}"},{key:"low-vision",label:"Blind / low-vision viewing",short:"Low vision",icon:"LV"},{key:"sensory-friendly",label:"Quiet / sensory-friendly seating",short:"Sensory-friendly",icon:"QS"},{key:"plus-size",label:"Plus-size seat",short:"Plus-size",icon:"\u{1F4BA}"},{key:"lift-armrest",label:"Lift-up armrest",short:"Lift armrest",icon:"\u2195\uFE0F"}],hM=new Map(Jr.map(e=>[e.key,e]));var wd={wheelchair:"#3b82f6",companion:"#8b5cf6","semi-ambulatory":"#0ea5e9","designated-aisle":"#0284c7","step-free":"#16a34a",hearing:"#14b8a6",cart:"#7c3aed","sign-language":"#f59e0b","low-vision":"#d97706","sensory-friendly":"#6366f1","plus-size":"#ec4899","lift-armrest":"#22c55e"};function Co(e){let t=e?.[0];return t&&wd[t]||"#3b82f6"}var Pd=[{key:"obstructedView",label:"Obstructed view",short:"Obstructed",icon:"\u26D4"},{key:"restrictedView",label:"Restricted view",short:"Restricted",icon:"\u{1F441}"},{key:"premium",label:"Premium seat",short:"Premium",icon:"\u2605"}],pM=new Map(Pd.map(e=>[e.key,e]));var Ad=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],bM=new Set(Ad);var bs=[{key:"circle",label:"Standard seat",shortLabel:"Standard",useCase:"General assigned seating",group:"general",path:null,bounds:null,mark:null},{key:"theatre",label:"Theatre chair",shortLabel:"Theatre",useCase:"Auditoriums, arenas and stadium stands",group:"fixed",path:"M4.5 3.5 Q4.5 1.5 6.5 1.5 L17.5 1.5 Q19.5 1.5 19.5 3.5 L19.5 13 L4.5 13 Z M3.5 12 L20.5 12 Q22.5 12 22.5 14 L22.5 21 Q22.5 22.5 21 22.5 Q19.5 22.5 19.5 21 L19.5 17.5 L4.5 17.5 L4.5 21 Q4.5 22.5 3 22.5 Q1.5 22.5 1.5 21 L1.5 14 Q1.5 12 3.5 12 Z",bounds:{x:1.5,y:1.5,width:21,height:21},mark:{x:12,y:10,radius:6}},{key:"dining",label:"Dining chair",shortLabel:"Dining",useCase:"Banquets, restaurants and table seating",group:"flexible",path:"M7 1 Q6 1 6 2.5 L6.75 10.5 L5 10.5 Q4 10.5 4 12 L4 14 Q4 15 5.25 15 L6 15 L4 23 L7 23 L9.5 15 L14.5 15 L17 23 L20 23 L18 15 L18.75 15 Q20 15 20 14 L20 12 Q20 10.5 19 10.5 L17.25 10.5 L18 2.5 Q18 1 17 1 Z",bounds:{x:4,y:1,width:16,height:22},mark:{x:12,y:10,radius:4.5}},{key:"folding",label:"Folding chair",shortLabel:"Folding",useCase:"Concert floors, ceremonies and conferences",group:"flexible",path:"M6 2 Q5 2 5 3 L6 8 L18 8 L19 3 Q19 2 18 2 Z M5 9 L19 9 Q20 9 20 10.5 L19 13 L5 13 L4 10.5 Q4 9 5 9 Z M6 12 L9 12 L12 17 L15 12 L18 12 L14 19 L17 23 L14 23 L12 21 L10 23 L7 23 L10 19 Z",bounds:{x:4,y:2,width:16,height:21},mark:{x:12,y:5,radius:3}},{key:"armchair",label:"Premium armchair",shortLabel:"Armchair",useCase:"Boxes, lounges and club seating",group:"premium",path:"M3.5 4 Q3.5 1.5 6 1.5 L18 1.5 Q20.5 1.5 20.5 4 L20.5 13 L3.5 13 Z M1.5 12.5 Q1.5 10 3.25 10 Q5 10 5 12.5 L5 13.5 L19 13.5 L19 12.5 Q19 10 20.75 10 Q22.5 10 22.5 12.5 L22.5 19.5 Q22.5 22 20 22 L4 22 Q1.5 22 1.5 19.5 Z",bounds:{x:1.5,y:1.5,width:21,height:20.5},mark:{x:12,y:7.5,radius:5.5}},{key:"recliner",label:"Recliner",shortLabel:"Recliner",useCase:"Luxury cinemas and premium clubs",group:"premium",path:"M7 2 Q7 1 8.5 1 L15.5 1 Q17 1 17 2 L19 13 L5 13 Z M4 9 Q2 9 2 11.5 L2 16 Q2 18 4 18 L6 18 L6 15 L18 15 L18 18 L20 18 Q22 18 22 16 L22 11.5 Q22 9 20 9 Q18 9 18 11 L18 13 L6 13 L6 11 Q6 9 4 9 Z M7 17 L17 17 Q18 17 18.5 18.5 L19.5 22.5 L4.5 22.5 L5.5 18.5 Q6 17 7 17 Z",bounds:{x:2,y:1,width:20,height:21.5},mark:{x:12,y:8,radius:5}},{key:"stool",label:"Stool",shortLabel:"Stool",useCase:"Bars, high-tops and seating rails",group:"flexible",path:"M6 2.5 L18 2.5 Q22 2.5 22 6.5 L22 12 Q22 16 18 16 L6 16 Q2 16 2 12 L2 6.5 Q2 2.5 6 2.5 Z M6 15.5 L9.5 15.5 L7.5 22.5 L3 22.5 Z M14.5 15.5 L18 15.5 L20.5 22.5 L16 22.5 Z",bounds:{x:2,y:2.5,width:20,height:20},mark:{x:12,y:9.25,radius:6.5}},{key:"bench",label:"Bench place",shortLabel:"Bench",useCase:"Pews, bleachers and terraces",group:"fixed",path:"M2.5 0.5 L21.5 0.5 Q23 0.5 23 2 L23 5 Q23 6.5 21.5 6.5 L2.5 6.5 Q1 6.5 1 5 L1 2 Q1 0.5 2.5 0.5 Z M2 7.5 L22 7.5 Q23.5 7.5 23.5 9 L23.5 15.5 Q23.5 17 22 17 L18 17 L18 21.5 Q18 22.5 16.75 22.5 Q15.5 22.5 15.5 21.5 L15.5 17 L8.5 17 L8.5 21.5 Q8.5 22.5 7.25 22.5 Q6 22.5 6 21.5 L6 17 L2 17 Q0.5 17 0.5 15.5 L0.5 9 Q0.5 7.5 2 7.5 Z",bounds:{x:.5,y:.5,width:23,height:22},mark:{x:12,y:12.25,radius:4.75}}],ys=bs.map(e=>e.key),Id=new Map(bs.map(e=>[e.key,e]));function ps(e){return typeof e=="string"&&Id.has(e)}function gs(e,t){return ps(e)?e:ps(t?.seatGlyph)?t.seatGlyph:"circle"}var fe=.02291666666666667,et=1/fe,Ed=58,Rd=Ed*fe;var Cd=3,xs=0,ei=120,_d=0,Td=45,Ld=7,ht=1.2;function ti(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function kd(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Ld?e:Cd}function Ct(e,t={}){let n=ti(t.floorBaseHeightM,xs,ei,0),o=Math.min(ei,n+kd(e.elevation)*Rd),r=e.height===void 0?o:ti(e.height,xs,ei,o),i=ti(e.rake,_d,Td,0);return{height:r,rake:i}}var vs=dt(require("earcut"),1),ri=dt(require("polygon-clipping"),1);var SM=Math.PI/180;function Ge(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function ni(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function oi(e){let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;let o=e.length||1;return{x:t/o,y:n/o}}function cn(e){return e.length?oi(e):null}function $e(e){let t=0;for(let n=0,o=e.length;n<o;n+=1){let r=e[n],i=e[(n+1)%o];t+=r.x*i.y-i.x*r.y}return t/2}function Ze(e,t,n){let o=!1;for(let r=0,i=e.length-1;r<e.length;i=r++){let a=e[r],s=e[i];a.y>n!=s.y>n&&t<(s.x-a.x)*(n-a.y)/(s.y-a.y)+a.x&&(o=!o)}return o}var C=fe,Od=.002;function Fd(e,t,n){let o=Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2]),r=Math.hypot(n[0]-t[0],n[1]-t[1],n[2]-t[2]),i=Math.hypot(e[0]-n[0],e[1]-n[1],e[2]-n[2]),a=Math.max(o,r,i);if(a<1e-9)return!0;let s=(o+r+i)/2;return 2*Math.sqrt(Math.max(0,s*(s-o)*(s-r)*(s-i)))/a<Od}var Xt=class{constructor(t=16384){this.len=0;this.buf=new Float32Array(t)}push3(t,n,o){this.len+3>this.buf.length&&this.grow(this.len+3),this.buf[this.len++]=t,this.buf[this.len++]=n,this.buf[this.len++]=o}push1(t){this.len+1>this.buf.length&&this.grow(this.len+1),this.buf[this.len++]=t}grow(t){let n=this.buf.length*2;for(;n<t;)n*=2;let o=new Float32Array(n);o.set(this.buf.subarray(0,this.len)),this.buf=o}get length(){return this.len}toArray(){return this.buf.slice(0,this.len)}},Lo=class{constructor(){this.pos=new Xt;this.nor=new Xt;this.col=new Xt;this.flr=new Xt;this.mat=new Xt;this.currentFloor=0;this.currentMaterial=0}setFloor(t){this.currentFloor=t}setMaterial(t){this.currentMaterial=t}tri(t,n,o,r,i,a=i,s=i){Fd(t,n,o)||(this.pos.push3(t[0],t[1],t[2]),this.pos.push3(n[0],n[1],n[2]),this.pos.push3(o[0],o[1],o[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(r[0],r[1],r[2]),this.col.push3(i[0],i[1],i[2]),this.col.push3(a[0],a[1],a[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(t,n,o,r,i,a,s,c=s,l=s){[...t,...n,...o].every(Number.isFinite)&&(this.pos.push3(t[0],t[1],t[2]),this.pos.push3(n[0],n[1],n[2]),this.pos.push3(o[0],o[1],o[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(i[0],i[1],i[2]),this.nor.push3(a[0],a[1],a[2]),this.col.push3(s[0],s[1],s[2]),this.col.push3(c[0],c[1],c[2]),this.col.push3(l[0],l[1],l[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 Dd(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=n[0]-e[0],s=n[1]-e[1],c=n[2]-e[2],l=r*c-i*s,u=i*a-o*c,m=o*s-r*a,f=Math.hypot(l,u,m)||1;return l/=f,u/=f,m/=f,[l,u,m]}function Nd(e,t){let n=[...e],o=[];for(let a of e)o.push(a.x,a.y);let r=[];if(t){for(let a of t)if(!(a.length<3)){r.push(n.length);for(let s of a)n.push(s),o.push(s.x,s.y)}}let i=(0,vs.default)(o,r.length?r:void 0,2);return{pts:n,tris:i}}function pt(e){return $e(e)<0?[...e].reverse():e}var Bd=3;function Vd(e,t,n,o){let r=o(e),i=o(t),a=o(n),s=(d,h,p,b)=>Math.abs(o({x:(d.x+h.x)/2,y:(d.y+h.y)/2})-(p+b)/2),c=(e.x+t.x+n.x)/3,l=(e.y+t.y+n.y)/3,u=(r+i+a)/3,m=Math.max(s(e,t,r,i),s(t,n,i,a),s(n,e,a,r),Math.abs(o({x:c,y:l})-u)),f=(d,h,p)=>{let b=Math.abs(o({x:(d+c)/2,y:(h+l)/2})-(p+u)/2);b>m&&(m=b)};return f((e.x+t.x)/2,(e.y+t.y)/2,(r+i)/2),f((t.x+n.x)/2,(t.y+n.y)/2,(i+a)/2),f((n.x+e.x)/2,(n.y+e.y)/2,(a+r)/2),m}function Xn(e,t,n,o,r){if(r<=0)return Vd(e,t,n,o);let i={x:(e.x+t.x)/2,y:(e.y+t.y)/2},a={x:(t.x+n.x)/2,y:(t.y+n.y)/2},s={x:(n.x+e.x)/2,y:(n.y+e.y)/2};return Math.max(Xn(e,i,s,o,r-1),Xn(i,t,a,o,r-1),Xn(s,a,n,o,r-1),Xn(i,a,s,o,r-1))}function Yn(e,t,n,o,r,i,a,s){if(a>0){let f={x:(t.x+n.x)/2,y:(t.y+n.y)/2},d={x:(n.x+o.x)/2,y:(n.y+o.y)/2},h={x:(o.x+t.x)/2,y:(o.y+t.y)/2};Yn(e,t,f,h,r,i,a-1,s),Yn(e,f,n,d,r,i,a-1,s),Yn(e,h,d,o,r,i,a-1,s),Yn(e,f,d,h,r,i,a-1,s);return}let c=[t.x*C,r(t),t.y*C],l=[n.x*C,r(n),n.y*C],u=[o.x*C,r(o),o.y*C];if(s){e.triN(c,l,u,s(t),s(n),s(o),i);return}let m=Dd(c,l,u);m[1]<0&&(m=[-m[0],-m[1],-m[2]]),e.tri(c,l,u,m,i)}var Gd=8;function Ms(e,t,n){if(!Number.isFinite(n))return e;let o=[],r=(i,a,s,c,l)=>{if(l>0){let u={x:(i.x+a.x)/2,y:(i.y+a.y)/2},m=t(u);if(Math.abs(m-(s+c)/2)>n){r(i,u,s,m,l-1),r(u,a,m,c,l-1);return}}o.push(i)};for(let i=0;i<e.length;i++){let a=e[i],s=e[(i+1)%e.length];r(a,s,t(a),t(s),Gd)}return o}function _o(e,t){if(e.length<3)return e;let n=[];for(let r of e){let i=n[n.length-1];i&&Math.hypot(r.x-i.x,r.y-i.y)<t||n.push(r)}for(;n.length>2&&Math.hypot(n[0].x-n[n.length-1].x,n[0].y-n[n.length-1].y)<t;)n.pop();if(n.length<3)return e;let o=[];for(let r=0;r<n.length;r++){let i=o.length?o[o.length-1]:n[(r-1+n.length)%n.length],a=n[r],s=n[(r+1)%n.length],c=s.x-i.x,l=s.y-i.y,u=Math.hypot(c,l);u>t&&Math.abs((a.x-i.x)*l-(a.y-i.y)*c)/u<t||o.push(a)}return o.length>=3?o:n}var To=.001*et*.1;function ue(e,t,n,o,r,i,a,s,c=1/0,l){if(!t||t.length<3||(c===void 0&&(c=1/0),Math.abs($e(t))<1e-4))return;let u=_o(Ms(_o(pt(t),To),o,c),To),m=n?.map(g=>_o(Ms(_o(pt(g),To),o,c),To)).filter(g=>g.length>=3&&Math.abs($e(g))>=1e-4),{pts:f,tris:d}=Nd(u,m),h=[i[0]*s.top,i[1]*s.top,i[2]*s.top],p=[i[0]*s.bottomCap,i[1]*s.bottomCap,i[2]*s.bottomCap],b=[a[0]*s.top,a[1]*s.top,a[2]*s.top],y=[a[0]*s.wallBottom,a[1]*s.wallBottom,a[2]*s.wallBottom],M=0;if(Number.isFinite(c))for(;M<Bd;M++){let g=0;for(let P=0;P<d.length;P+=3){let S=Xn(f[d[P]],f[d[P+1]],f[d[P+2]],o,M);S>g&&(g=S)}if(g<=c)break}for(let g=0;g<d.length;g+=3){let P=f[d[g]],S=f[d[g+1]],w=f[d[g+2]];Yn(e,P,S,w,o,h,M,l);let E=[P.x*C,r,P.y*C],T=[S.x*C,r,S.y*C],F=[w.x*C,r,w.y*C];e.tri(E,F,T,[0,-1,0],p)}let v=g=>{if(M<=0)return g;let P=1<<M,S=[];for(let w=0;w<g.length;w++){let E=g[w],T=g[(w+1)%g.length];for(let F=0;F<P;F++){let R=F/P;S.push({x:E.x+(T.x-E.x)*R,y:E.y+(T.y-E.y)*R})}}return S},A=oi(u),x=[{ring:v(u),flip:!1}];if(m)for(let g of m)g.length>=3&&x.push({ring:v(g),flip:!0});for(let{ring:g,flip:P}of x)for(let S=0;S<g.length;S++){let w=g[S],E=g[(S+1)%g.length],T=(E.x-w.x)*C,R=(E.y-w.y)*C,I=-T,_=Math.hypot(R,I)||1;R/=_,I/=_;let k=(w.x+E.x)/2-A.x,V=(w.y+E.y)/2-A.y,O=R*k+I*V;P&&(O=-O),O<0&&(R=-R,I=-I);let H=[R,0,I],U=[w.x*C,o(w),w.y*C],N=[E.x*C,o(E),E.y*C],L=[w.x*C,r,w.y*C],B=[E.x*C,r,E.y*C];e.tri(U,N,B,H,b,b,y),e.tri(U,B,L,H,b,y,y)}}function Ss(e){let t=0;for(let c of e)t+=c.count;let n=new Float32Array(t*3),o=new Float32Array(t*3),r=new Float32Array(t*3),i=new Float32Array(t),a=new Float32Array(t),s=0;for(let c of e)n.set(c.position,s*3),o.set(c.normal,s*3),r.set(c.color,s*3),i.set(c.floor,s),a.set(c.material,s),s+=c.count;return{position:n,normal:o,color:r,floor:i,material:a,count:t}}function st(e,t,n=2.5){if(t<=0||e.length<3)return e;let o=pt(e),r=o.length,i=[];for(let s=0;s<r;s++){let c=o[s],l=o[(s+1)%r],u=l.x-c.x,m=l.y-c.y,f=Math.hypot(u,m)||1;i.push({x:m/f,y:-u/f})}let a=[];for(let s=0;s<r;s++){let c=o[s],l=i[(s-1+r)%r],u=i[s],m=l.x+u.x,f=l.y+u.y,d=Math.hypot(m,f),h=()=>{a.push([c.x+l.x*t,c.y+l.y*t]),a.push([c.x+u.x*t,c.y+u.y*t])};if(d<1e-9){h();continue}m/=d,f/=d;let p=m*l.x+f*l.y,b=1/Math.max(p,1e-6);if(!Number.isFinite(b)||b>n){h();continue}a.push([c.x+m*t*b,c.y+f*t*b])}if(a.length<3)return e;try{let s=ri.default.union([[...a,a[0]]]),c=null,l=-1/0;for(let m of s){let f=Math.abs($e(m[0].map(([d,h])=>({x:d,y:h}))));f>l&&(l=f,c=m[0])}if(!c)return e;let u=c.map(([m,f])=>({x:m,y:f}));if(u.length>1){let m=u[0],f=u[u.length-1];Math.abs(m.x-f.x)<1e-9&&Math.abs(m.y-f.y)<1e-9&&u.pop()}return u.length>=3?u:e}catch{return e}}function _t(e,t,n=2.5){if(e.length<3)return[];if(t<=0)return e;let o=pt(e),r=o.length,i=[];for(let c=0;c<r;c++){let l=o[c],u=o[(c+1)%r],m=Math.hypot(u.x-l.x,u.y-l.y)||1;i.push({x:-(u.y-l.y)/m,y:(u.x-l.x)/m})}let a=[],s=[];for(let c=0;c<r;c++){let l=o[c],u=i[(c-1+r)%r],m=i[c],f=u.x+m.x,d=u.y+m.y,h=Math.hypot(f,d),p=h<1e-9?1/0:1/Math.max(f/h*u.x+d/h*u.y,1e-6);if(!Number.isFinite(p)||p>n){a.push({x:l.x+u.x*t,y:l.y+u.y*t},{x:l.x+m.x*t,y:l.y+m.y*t}),s.push(c,c);continue}f/=h,d/=h,a.push({x:l.x+f*t*p,y:l.y+d*t*p}),s.push(c)}for(let c=0;c<a.length;c++){let l=(c+1)%a.length,u=s[c],m=s[l];if(m!==(u+1)%r)continue;let f=o[u],d=o[m];if((a[l].x-a[c].x)*(d.x-f.x)+(a[l].y-a[c].y)*(d.y-f.y)<=0)return[]}try{let c=ri.default.intersection([[...a.map(h=>[h.x,h.y]),[a[0].x,a[0].y]]],[[...o.map(h=>[h.x,h.y]),[o[0].x,o[0].y]]]),l=null,u=0;for(let h of c){let p=Math.abs($e(h[0].map(([b,y])=>({x:b,y}))));p>u&&(u=p,l=h[0])}if(!l)return[];let m=l.map(([h,p])=>({x:h,y:p})),f=m[0],d=m[m.length-1];return m.length>1&&Math.abs(f.x-d.x)<1e-9&&Math.abs(f.y-d.y)<1e-9&&m.pop(),m.length>=3?pt(m):[]}catch{return[]}}function ko(e,t,n,o,r=28){let i=[];for(let a=0;a<r;a++){let s=a/r*Math.PI*2;i.push({x:e+n*Math.cos(s),y:t+o*Math.sin(s)})}return i}function Kn(e,t,n,o){return[{x:e,y:t},{x:e+n,y:t},{x:e+n,y:t+o},{x:e,y:t+o}]}var St=.22;function ws(e,t){let n=Be[e];if(n!=="sold"&&n!=="held")return-1;let o=(t+1)*2654435761;return o^=o>>>15,o=Math.imul(o,2246822519),o^=o>>>13,(o>>>0)%1e5/1e5}var Hd=.42;function zd(e){let t=e.length,n=new Float64Array(t);if(t<2)return n.fill(1/0),n;let o=1/0,r=1/0,i=-1/0,a=-1/0;for(let h of e)h.x<o&&(o=h.x),h.y<r&&(r=h.y),h.x>i&&(i=h.x),h.y>a&&(a=h.y);let s=Math.max(i-o,1e-6),c=Math.max(a-r,1e-6),l=Math.max(Math.sqrt(s*c/t),1e-6),u=Math.max(1,Math.ceil(s/l)+1),m=Math.max(1,Math.ceil(c/l)+1),f=new Map,d=(h,p)=>{let b=Math.min(u-1,Math.max(0,Math.floor((h-o)/l)));return Math.min(m-1,Math.max(0,Math.floor((p-r)/l)))*u+b};for(let h=0;h<t;h++){let p=d(e[h].x,e[h].y),b=f.get(p);b?b.push(h):f.set(p,[h])}for(let h=0;h<t;h++){let p=e[h],b=Math.min(u-1,Math.max(0,Math.floor((p.x-o)/l))),y=Math.min(m-1,Math.max(0,Math.floor((p.y-r)/l))),M=1/0;for(let v=1;v<=4;v++){for(let A=y-v;A<=y+v;A++)if(!(A<0||A>=m))for(let x=b-v;x<=b+v;x++){if(x<0||x>=u||v>1&&Math.abs(A-y)<v&&Math.abs(x-b)<v)continue;let g=f.get(A*u+x);if(g)for(let P of g){if(P===h)continue;let S=Math.hypot(e[P].x-p.x,e[P].y-p.y);S<M&&(M=S)}}if(Number.isFinite(M)&&M<=v*l)break}n[h]=M}return n}function jd(e){let t=e.eyeHeightM;return Number.isFinite(t)?Math.max(0,t-ht):0}function Ps(e,t,n,o,r,i){let a=e.length,s=new Float32Array(a*3),c=new Float32Array(a),l=new Float32Array(a*3),u=new Float32Array(a),m=new Float32Array(a),f=new Float32Array(a),d=new Float32Array(a),h=new Float32Array(a*3),p=new Map,b=zd(e);for(let y=0;y<a;y++){let M=e[y],A=(n?.seatPitchU(y)??b[y])*C;u[y]=Number.isFinite(A)?Math.max(.06,Math.min(St,A*Hd)):St,m[y]=Ha(Number.isFinite(A)?A:void 0);let x=gs(M.glyph,{seatGlyph:i?.get(M.categoryKey)});f[y]=ys.indexOf(x),d[y]=M.wheelchairSpaceType==="no-seat"?0:1,s[y*3]=M.x*C,s[y*3+1]=n?n.seatDeckY(y):jd(M),s[y*3+2]=M.y*C,c[y]=jn(t?t(M):"available");let g=be(r?.get(M.categoryKey)??"#6e7bff")??[.43,.48,1];if(l[y*3]=g[0],l[y*3+1]=g[1],l[y*3+2]=g[2],M.accessibility?.length){let P=be(Co(M.accessibility));P&&(h[y*3]=P[0],h[y*3+1]=P[1],h[y*3+2]=P[2])}p.set(M.id,y)}return{count:a,iPosition:s,iState:c,iCategory:l,iMaxRadius:u,iRing:h,idToIndex:p,iChairWidth:m,iGlyph:f,iPhysicalSeat:d,iFloor:o??new Float32Array(a),iSection:new Float32Array(a).fill(-1),iYaw:new Float32Array(a)}}var Ud=64;function ii(e,t){let n=[];for(let a of t){let s=e.idToIndex.get(a.seatId);if(s===void 0)continue;let c=jn(a.state);e.iState[s]!==c&&(e.iState[s]=c,n.push(s))}if(!n.length)return[];n.sort((a,s)=>a-s);let o=[],r=n[0],i=n[0];for(let a=1;a<n.length;a++){let s=n[a];if(s!==i){if(s<=i+Ud){i=s;continue}o.push({start:r,length:i-r+1}),r=s,i=s}}return o.push({start:r,length:i-r+1}),o}var $n=3,Yt=.38,Zn=.24;function Wd(e){if(e.length<3)return null;let t=e[0],n=e[Math.floor(e.length/2)],o=e[e.length-1],r=(n.x-t.x)*C,i=(n.y-t.y)*C,a=(o.x-t.x)*C,s=(o.y-t.y)*C,c=2*(r*s-i*a);if(Math.abs(c)<1e-7)return null;let l=r*r+i*i,u=a*a+s*s,m=(l*s-u*i)/c+t.x*C,f=(r*u-a*l)/c+t.y*C,d=Math.hypot(t.x*C-m,t.y*C-f);return d<1||d>200||!Number.isFinite(d)||e.some(h=>Math.abs(Math.hypot(h.x*C-m,h.y*C-f)-d)>.03)?null:{x:m,z:f,radius:d}}function As(e){let t=[],n=new Map,o=(c,l)=>`${Math.floor(c/$n)},${Math.floor(l/$n)}`;for(let c of e)for(let l of c.rows){for(let m of l.pts){let f=m.x*C,d=m.y*C,h=o(f,d),p=n.get(h)??[];p.push({x:f,z:d,y:l.y,floor:c.floorIndex}),n.set(h,p)}if(l.patch||l.pts.length<2)continue;let u=Wd(l.pts);for(let m of[0,l.pts.length-1]){let f=l.pts[m],d=l.pts[m===0?1:m-1],h=f.x-d.x,p=f.y-d.y,b=Math.hypot(h,p);b<1e-6||t.push({sectionId:c.sectionId,floorIndex:c.floorIndex,curve:u,row:l,point:f,x:f.x*C,z:f.y*C,dx:h/b,dz:p/b})}}let r=new Map;t.forEach((c,l)=>{let u=o(c.x,c.z),m=r.get(u)??[];m.push(l),r.set(u,m)});let i=(c,l)=>{let u=Math.floor(c/$n),m=Math.floor(l/$n);return[-1,0,1].flatMap(f=>[-1,0,1].map(d=>`${u+f},${m+d}`))},a=new Map;t.forEach((c,l)=>{let u=-1,m=1/0,f=!1;for(let d of i(c.x,c.z))for(let h of r.get(d)??[]){let p=t[h];if(c.sectionId===p.sectionId&&c.row.blockId===p.row.blockId||c.floorIndex!==p.floorIndex||Math.abs(c.row.y-p.row.y)>.05)continue;let b=p.x-c.x,y=p.z-c.z,M=Math.hypot(b,y);if(M<Yt*2+.45||M>$n)continue;let v=c.curve&&p.curve&&Math.hypot(c.curve.x-p.curve.x,c.curve.z-p.curve.z)<=.05&&Math.abs(c.curve.radius-p.curve.radius)<=.05,A=Math.min((b*c.dx+y*c.dz)/M,(-b*p.dx-y*p.dz)/M);(v?A<.8:A<.98)||!v&&(Math.abs(b*c.dz-y*c.dx)>.15||Math.abs(b*p.dz-y*p.dx)>.15)||(M<m-.02?(u=h,m=M,f=!1):Math.abs(M-m)<=.02&&(f=!0))}u>=0&&!f&&a.set(l,u)});let s=[];for(let[c,l]of a){if(c>=l||a.get(l)!==c)continue;let u=t[c],m=t[l],f=Math.hypot(m.x-u.x,m.z-u.z),d=(m.x-u.x)/f,h=(m.z-u.z)/f,p=!1;for(let y of i((u.x+m.x)/2,(u.z+m.z)/2))for(let M of n.get(y)??[]){if(M.floor!==u.floorIndex||Math.abs(M.y-u.row.y)>.75)continue;let v=(M.x-u.x)*d+(M.z-u.z)*h,A=Math.abs((M.x-u.x)*h-(M.z-u.z)*d);v>.01&&v<f-.01&&A<Zn+Yt&&(p=!0)}if(p)continue;let b=(y,M)=>({x:(u.x+d*y-h*M)/C,y:(u.z+h*y+d*M)/C});s.push({sections:[u.sectionId,m.sectionId],blocks:[u.row.blockId,m.row.blockId],floorIndex:u.floorIndex,ends:[u.point,m.point],clearWidthM:f-2*Yt,heightM:(u.row.y+m.row.y)/2,outline:[b(Yt,-Zn),b(f-Yt,-Zn),b(f-Yt,Zn),b(Yt,Zn)]})}return s}var Xd=.15,Yd=1.6;function Is(e){return Zr(e??1,Xd,Yd)}var Kd=.15,$d=.9,Zd=1.76;function Es(e){return!!e&&e[0]*.2126+e[1]*.7152+e[2]*.0722>.55?{zenith:[.36,.58,.84],horizon:[.82,.88,.94]}:{zenith:[.05,.08,.15],horizon:[.3,.38,.5]}}function qd(){return{background:{top:[...Wt.top],bottom:[...Wt.bottom]},sky:Es(null),structure:Xr,seatStates:{...qa},seatScale:1,materials:{seat:null,shell:null,roughness:.78}}}function Qd(e){return!!e&&e[0]*.2126+e[1]*.7152+e[2]*.0722>.55?{deck:"#c9ccc8",fascia:"#b4bab8",shell:"#c3c9c8",roughness:.87}:{deck:"#69747b",fascia:"#3e4d58",shell:"#526572",roughness:.87}}function Rs(e){let t=qd();e??={};let n=be(e.background);if(n){t.background={top:le(n,$d),bottom:le(n,Zd)},t.sky=Es(n);let s={};for(let[l,u]of Object.entries(Xr))s[l]=ge(u,n,Kd);n[0]*.2126+n[1]*.7152+n[2]*.0722>.55&&(s.ground=le(n,.86)),t.structure=s}let o=be(e.selectionColor)??be(e.accent);o&&(t.seatStates={...t.seatStates,selected:o});let r=e.seatScale;typeof r=="number"&&Number.isFinite(r)&&(t.seatScale=Is(r));let i=Object.fromEntries(Object.entries(e.venue3d??{}).filter(([,s])=>s!=null)),a={...Qd(n),...i};if(a){let s=be(a.deck),c=be(a.fascia);s&&(t.structure={...t.structure,tierTop:s,gaTop:s}),c&&(t.structure={...t.structure,tierWall:c,gaWall:c}),t.materials.seat=be(a.seat),t.materials.shell=be(a.shell),typeof a.roughness=="number"&&Number.isFinite(a.roughness)&&(t.materials.roughness=Math.min(1,Math.max(0,a.roughness)))}return t}function Cs(e,t){let n=[];for(let o of t)n.push(...e.seatStates[o]);return n}var Jd=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]),eh=new Set(["pitch-football","track-athletics","oval-cricket","pitch-rugby","diamond-baseball"]);function Kt(e){return!!e&&Jd.has(e)}function Oo(e){return!!e&&eh.has(e)}var ai=1.1;function Ls(e){return Do(e)?e==="ring-boxing"?ai:.06:1}var th={round:{width:6,height:6},"pitch-football":{width:105,height:68},"rink-hockey":{width:60,height:30},"track-athletics":{width:176.9,height:92.5},"oval-cricket":{width:150,height:140},"pitch-rugby":{width:120,height:70},"diamond-baseball":{width:140,height:140},"court-basketball":{width:32,height:19},"court-tennis":{width:36.57,height:18.29},"ring-boxing":{width:7.8,height:7.8}},nh={"pitch-football":"#2f7d4f","rink-hockey":"#e8f1f8","track-athletics":"#a4472f","oval-cricket":"#3d8a53","pitch-rugby":"#2f7d4f","diamond-baseball":"#2f7d4f","court-basketball":"#c8894f","court-tennis":"#3f7a5a","ring-boxing":"#2a4d8f"};var oh=Math.PI*2;function rh(e,t,n,o,r,i){return{x:r+e*n-t*o,y:i+e*o+t*n}}function _s(e,t){let n=Math.max(0,e-t),o=[],r=20;for(let i=0;i<=r;i++){let a=-Math.PI/2+i/r*Math.PI;o.push({x:n+t*Math.cos(a),y:t*Math.sin(a)})}for(let i=0;i<=r;i++){let a=Math.PI/2+i/r*Math.PI;o.push({x:-n+t*Math.cos(a),y:t*Math.sin(a)})}return o}var Ts=(()=>{let t={x:0,y:52},n=25,o={x:70,y:t.y-70},r=(o.x*o.x+o.y*o.y-4900)/(2*(o.y+70)),i=r+70,a=[],s=Math.atan2(o.y-r,o.x),c=Math.atan2(o.y-r,-o.x);for(let l=0;l<=24;l++){let u=s+(c-s)*l/24;a.push({x:i*Math.cos(u),y:r+i*Math.sin(u)})}return{half:70,home:t,backstop:n,fence:a}})();var Fo="#f1f5f9";function Do(e){return Kt(e)}function Tt(e,t,n,o,r=32){let i=[];for(let a=0;a<r;a++){let s=a/r*oh;i.push({x:e+n*Math.cos(s),y:t+o*Math.sin(s)})}return i}function wt(e,t,n,o){return[{x:e-n,y:t-o},{x:e+n,y:t-o},{x:e+n,y:t+o},{x:e-n,y:t+o}]}function ih(e){let{kind:t,cx:n,cy:o,width:r,height:i}=e,a=(e.rotation??0)*Math.PI/180,s=Math.cos(a),c=Math.sin(a),l=r/2,u=i/2,m=[],f=th[t],d=p=>f?p/f.width*r:0,h=p=>f?p/f.height*i:0;switch(t){case"pitch-football":{m.push({points:[{x:0,y:-u},{x:0,y:u}],closed:!1}),m.push({points:Tt(0,0,d(9.15),h(9.15)),closed:!0});for(let p of[-1,1])m.push({points:wt(p*(l-d(16.5)/2),0,d(16.5)/2,h(40.32)/2),closed:!0}),m.push({points:wt(p*(l-d(5.5)/2),0,d(5.5)/2,h(18.32)/2),closed:!0});break}case"rink-hockey":{m.push({points:[{x:0,y:-u},{x:0,y:u}],closed:!1,ink:"#d63b3b"});for(let p of[-1,1]){m.push({points:[{x:p*d(7.5),y:-u},{x:p*d(7.5),y:u}],closed:!1,ink:"#2f6ecb"}),m.push({points:[{x:p*(l-d(4)),y:-h(11)},{x:p*(l-d(4)),y:h(11)}],closed:!1,ink:"#d63b3b"});for(let b of[-1,1])m.push({points:Tt(p*d(20.5),b*h(7),d(4.5),h(4.5)),closed:!0,ink:"#2f6ecb"})}m.push({points:Tt(0,0,d(4.5),h(4.5)),closed:!0,ink:"#2f6ecb"});break}case"track-athletics":{let b=u-h(1.22)*8;b>0&&m.push({points:_s(l-d(1.22)*8,b),closed:!0,fill:"#2f7d4f"});for(let y=1;y<8;y++){let M=h(1.22)*y,v=u-M;if(v<=0)break;m.push({points:_s(l-d(1.22)*y,v),closed:!0})}break}case"oval-cricket":{m.push({points:Tt(0,0,d(27.4),h(27.4+20.12/2),40),closed:!0}),m.push({points:wt(0,0,d(3.05)/2,h(20.12)/2),closed:!0,ink:"#d8cfae"});break}case"pitch-rugby":{let p=b=>({points:[{x:d(b),y:-u},{x:d(b),y:u}],closed:!1});m.push(p(0));for(let b of[-1,1]){m.push(p(b*50),p(b*28));for(let y=-35;y<35;y+=4)m.push({points:[{x:d(b*10),y:h(y)},{x:d(b*10),y:h(Math.min(35,y+2))}],closed:!1})}break}case"diamond-baseball":{let p=(k,V)=>({x:d(k),y:h(V)}),{home:b}=Ts,y=27.43,M=y/Math.SQRT2,v={x:b.x+M,y:b.y-M},A={x:b.x,y:b.y-2*M},x={x:b.x-M,y:b.y-M},g={x:b.x,y:b.y-18.44},P="#b98a59",S=nh["diamond-baseball"],w=38.94,E=[p(b.x,b.y)],T=Math.atan2(b.y-w/Math.SQRT2-g.y,w/Math.SQRT2),F=Math.PI-T;for(let k=0;k<=16;k++){let V=T-(T+Math.PI*2-F)%(Math.PI*2)*(k/16);E.push(p(g.x+29*Math.cos(V),g.y+29*Math.sin(V)))}m.push({points:E,closed:!0,fill:P,ink:P});let R={x:b.x,y:b.y-M},I=[{x:b.x,y:b.y},v,A,x].map(k=>p(R.x+(k.x-R.x)*.84,R.y+(k.y-R.y)*.84));m.push({points:I,closed:!0,fill:S,ink:S}),m.push({points:Tt(d(g.x),h(g.y),d(2.74),h(2.74),20),closed:!0,fill:P,ink:P}),m.push({points:Tt(d(b.x),h(b.y),d(3.96),h(3.96),20),closed:!0,fill:P,ink:P});let _=Ts.fence;m.push({points:[p(b.x,b.y),p(_[0].x,_[0].y)],closed:!1}),m.push({points:[p(b.x,b.y),p(_[_.length-1].x,_[_.length-1].y)],closed:!1});for(let k of[v,A,x])m.push({points:wt(d(k.x),h(k.y),d(.3),h(.3)),closed:!0,fill:Fo});break}case"court-basketball":{m.push({points:wt(0,0,d(14),h(7.5)),closed:!0}),m.push({points:[{x:0,y:-h(7.5)},{x:0,y:h(7.5)}],closed:!1}),m.push({points:Tt(0,0,d(1.8),h(1.8),24),closed:!0});for(let p of[-1,1]){let b=p*14,y=p*(14-5.8),M=p*(14-1.575);m.push({points:wt(d((b+y)/2),0,d(2.9),h(2.45)),closed:!0,fill:"#2f5d8a"}),m.push({points:Tt(d(y),0,d(1.8),h(1.8),24),closed:!0});let v=Math.sqrt(6.75*6.75-6.6*6.6),A=[{x:d(b),y:-h(6.6)}],x=Math.atan2(-6.6,-p*v),g=2*Math.atan2(6.6,v);for(let P=0;P<=16;P++){let S=x-p*g*(P/16);A.push({x:d(M+6.75*Math.cos(S)),y:h(6.75*Math.sin(S))})}A.push({x:d(b),y:h(6.6)}),m.push({points:A,closed:!1})}break}case"court-tennis":{m.push({points:wt(0,0,d(11.885),h(5.485)),closed:!0,fill:"#2b5f99"});for(let p of[-1,1])m.push({points:[{x:-d(11.885),y:p*h(4.115)},{x:d(11.885),y:p*h(4.115)}],closed:!1}),m.push({points:[{x:p*d(6.4),y:-h(4.115)},{x:p*d(6.4),y:h(4.115)}],closed:!1});m.push({points:[{x:-d(6.4),y:0},{x:d(6.4),y:0}],closed:!1}),m.push({points:[{x:0,y:-h(6.4)},{x:0,y:h(6.4)}],closed:!1,ink:"#d1d5db"});break}case"ring-boxing":{m.push({points:wt(0,0,d(3.05),h(3.05)),closed:!0});let y=[[-1,-1,"#c53030"],[1,1,"#2b6cb0"],[1,-1,"#e2e8f0"],[-1,1,"#e2e8f0"]];for(let[M,v,A]of y)m.push({points:wt(M*d(3.05),v*h(3.05),d(.3),h(.3)),closed:!0,fill:A,ink:A});break}default:return[]}return m.map(p=>({...p,points:p.points.map(b=>rh(b.x,b.y,s,c,n,o))}))}function ks(e){if(e.role!=="stage"||!Do(e.stageKind))return[];let t=null;if(e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null&&e.width>0&&e.height>0&&[e.x,e.y,e.width,e.height].every(Number.isFinite))t={cx:e.x+e.width/2,cy:e.y+e.height/2,width:e.width,height:e.height};else if(e.points&&e.points.length>=3&&e.points.every(n=>Number.isFinite(n.x)&&Number.isFinite(n.y))){let n=e.points.map(u=>u.x),o=e.points.map(u=>u.y),r=Math.min(...n),i=Math.max(...n),a=Math.min(...o),s=Math.max(...o),c=Math.max(1,i-r),l=Math.max(1,s-a);t={cx:r+c/2,cy:a+l/2,width:c,height:l}}return t?ih({kind:e.stageKind,...t}):[]}function Os(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,a=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+a*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+a*e.end.y}}function Fs(e,t,n=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[Os(e,.5)];let o=Array.from({length:n+1},(c,l)=>Os(e,l/n)),r=new Float64Array(o.length);for(let c=1;c<o.length;c+=1){let l=o[c].x-o[c-1].x,u=o[c].y-o[c-1].y;r[c]=r[c-1]+Math.hypot(l,u)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let a=[],s=1;for(let c=0;c<t;c+=1){let l=i*c/(t-1);for(;s<r.length-1&&r[s]<l;)s+=1;let u=r[s-1],m=r[s],f=m===u?0:(l-u)/(m-u);a.push({x:o[s-1].x+(o[s].x-o[s-1].x)*f,y:o[s-1].y+(o[s].y-o[s-1].y)*f})}return a}var ln=Math.PI*2;function un(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function ah(e,t,n){let o=t-e;if(n){for(;o<0;)o+=ln;for(;o>=ln;)o-=ln}else{for(;o>0;)o-=ln;for(;o<=-ln;)o+=ln}return o}function Bs(e){if(e.version!==1||e.closed!==!0||!un(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let n of e.segments){if(!n||!un(n.end))return!1;if(n.kind==="line"){if(Ge(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!un(n.control1)||!un(n.control2)||Ge(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!un(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(Ge(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(Ge(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Ge(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return Ge(t,e.start)<=1e-4}function sh(e,t,n){let o=1-n;return{x:o**3*e.x+3*o**2*n*t.control1.x+3*o*n**2*t.control2.x+n**3*t.end.x,y:o**3*e.y+3*o**2*n*t.control1.y+3*o*n**2*t.control2.y+n**3*t.end.y}}function Vs(e,t=2){if(!Bs(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),o=[{...e.start}],r=e.start;for(let i of e.segments){if(i.kind==="line")o.push({...i.end});else if(i.kind==="arc"){let a=Math.atan2(r.y-i.center.y,r.x-i.center.x),s=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),c=ah(a,s,i.clockwise),l=Math.max(2,Math.ceil(Math.abs(c)*i.radius/n));for(let u=1;u<=l;u+=1){let m=a+c*u/l;o.push({x:i.center.x+Math.cos(m)*i.radius,y:i.center.y+Math.sin(m)*i.radius})}}else{let a=Ge(r,i.control1)+Ge(i.control1,i.control2)+Ge(i.control2,i.end),s=Math.max(2,Math.ceil(a/n));for(let c=1;c<=s;c+=1)o.push(sh(r,i,c/s))}r=i.end}return Ge(o[o.length-1],o[0])<=1e-4&&o.pop(),o}var ch=45,si=150,lh=60;function uh(e){let t=ch/100;if(e<=t)return si;let n=Math.min(1,(e-t)/(1-t));return si-n*(si-lh)}var Ds=.5523;function Ns(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function mh(e){let t=[],n=[];for(e.forEach((o,r)=>{un(o)&&(t.length&&Ns(t[t.length-1],o)||(t.push({x:o.x,y:o.y}),n.push(r)))});t.length>1&&Ns(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}var fh=.5,dh=4/3;function hh(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<=1e-9)return{kind:"line",end:{...t}};let a=-r/i,s=o/i,c=n*dh;return{kind:"bezier",control1:{x:e.x+o/3+a*c,y:e.y+r/3+s*c},control2:{x:e.x+o*2/3+a*c,y:e.y+r*2/3+s*c},end:{...t}}}function Gs(e,t){let{points:n,sourceIndex:o}=mh(e),r=n.length;if(r<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,a=t.edgeCurvature,s=new Array(r).fill(0);if(a?.length)for(let A=0;A<r;A+=1){let x=a[o[A]];s[A]=Number.isFinite(x)?Math.min(100,Math.max(-100,x))/100:0}let c=s.some(A=>Math.abs(A)>1e-6);if(i<=0&&!c)return null;let l=t.wideAngleThresholdDeg??uh(i),u=[];for(let A=0;A<r;A+=1)u[A]=Ge(n[A],n[(A+1)%r]);let m=new Array(r).fill(0);for(let A=0;A<r;A+=1){let x=n[(A-1+r)%r],g=n[A],P=n[(A+1)%r],S={x:x.x-g.x,y:x.y-g.y},w={x:P.x-g.x,y:P.y-g.y},E=Math.hypot(S.x,S.y),T=Math.hypot(w.x,w.y);if(E<=1e-9||T<=1e-9)continue;let F=Math.min(1,Math.max(-1,(S.x*w.x+S.y*w.y)/(E*T))),R=Math.acos(F)*180/Math.PI;if(R<l)continue;let I=ss((R-l)/(180-l));m[A]=i*I*.5*Math.min(E,T)}for(let A=0;A<r;A+=1){let x=(A+1)%r,g=m[A]+m[x];if(g>u[A]&&g>1e-9){let P=u[A]/g;m[A]*=P,m[x]*=P}}let f=new Array(r),d=new Array(r);for(let A=0;A<r;A+=1){let x=n[(A-1+r)%r],g=n[A],P=n[(A+1)%r];if(m[A]<=1e-6){f[A]={...g},d[A]={...g};continue}let S=Ge(g,x)||1,w=Ge(g,P)||1;f[A]={x:g.x+(x.x-g.x)/S*m[A],y:g.y+(x.y-g.y)/S*m[A]},d[A]={x:g.x+(P.x-g.x)/w*m[A],y:g.y+(P.y-g.y)/w*m[A]}}if(m.every(A=>A<=1e-6)&&!c)return null;let h=[],p={...d[0]},b=p,y=(A,x)=>{if(Ge(b,A)<=1e-9)return;let g=s[x];Math.abs(g)>1e-6?h.push(hh(b,A,g*fh*u[x])):h.push({kind:"line",end:{...A}}),b=A};for(let A=1;A<=r;A+=1){let x=A%r,g=n[x];y(f[x],(A-1)%r),m[x]>1e-6&&Ge(f[x],d[x])>1e-9&&(h.push({kind:"bezier",control1:ni(f[x],g,Ds),control2:ni(d[x],g,Ds),end:{...d[x]}}),b=d[x])}if(!h.length)return null;let M=h[h.length-1];Ge(M.end,p)>1e-9&&(M.kind==="line"?M.end={...p}:h.push({kind:"line",end:{...p}}));let v={version:1,closed:!0,start:p,segments:h};return Bs(v)?v:null}function ph(e){let t=e.points??[];if(e.kind!=="polygon"||t.length<3||!Array.isArray(e.edgeCurvature))return[];let n=t.map((o,r)=>{let i=e.edgeCurvature[r];return Number.isFinite(i)?Math.min(100,Math.max(-100,i)):0});return n.some(o=>Math.abs(o)>.5)?n:[]}function bh(e){let t=ph(e);return t.length?Gs(e.points,{edgeCurvature:t}):null}function No(e,t=2){let n=bh(e);return n?Vs(n,t):e.points??[]}function Hs(e){return e.kind==="polygon"?qn(e.holes):[]}function js(e){let t=new Map,n=new Map;for(let o of e){if(o.type!=="row"||!o.segmentedRow)continue;let r=n.get(o.segmentedRow.groupId)??[];r.push(o),n.set(o.segmentedRow.groupId,r)}for(let[o,r]of n){let i=r.slice().sort((f,d)=>f.segmentedRow.componentIndex-d.segmentedRow.componentIndex),a=i[0]?.segmentedRow?.componentCount??0,s=i[0]?.segmentedRow;if(!s||!(a>=2&&i.length===a&&s?.boundaryBefore==="start"&&i.every((f,d)=>f.segmentedRow?.kind==="segmented-row-v1"&&f.segmentedRow.groupId===o&&f.segmentedRow.componentCount===a&&f.segmentedRow.componentIndex===d&&f.segmentedRow.repeatLabelOnComponents===s.repeatLabelOnComponents&&(d===0?f.segmentedRow.boundaryBefore==="start":f.segmentedRow.boundaryBefore!=="start")&&f.segmentedRow.displayLabel===s.displayLabel)))continue;let l=i.reduce((f,d)=>f+d.seatCount,0),u=0,m=0;for(let f of i)f.segmentedRow.boundaryBefore==="break"&&(u+=1),t.set(f.id,{groupId:o,adjacencyOffset:u,displayOffset:m,displayLabel:s.displayLabel,totalSeats:l,canonical:i[0],viewFromSeatUrl:s.viewFromSeatUrl,viewFromSeatMeta:s.viewFromSeatMeta,confidenceEvidence:s.confidenceEvidence}),u+=f.seatCount,m+=f.seatCount}return t}var yh="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var gh="abcdefghijklmnopqrstuvwxyz";function xh(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function Qn(e,t=!1){let n=t?gh:yh;return xh(Math.max(0,Math.floor(e)-1),n)}var Mh=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function Us(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of Mh)for(;t>=o;)n+=r,t-=o;return n}function vh(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function li(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",a=e.seatNumbering?.prefix??"",s=e.seatNumbering?.endAt,c=e.seatCount;if(i==="updown"||i==="updown-descending"){let d=Math.ceil(c/2),h=i==="updown"?t<d?n+2*t:n-1+2*(c-t):t<d?n+2*(d-1-t):n+1+2*(t-d);return`${a}${h}`}let l=i==="odd"||i==="even"?2:r,u=s!=null&&Number.isFinite(s)?s-(c-1)*l:n,m=o==="center"?vh(c)[t]:o==="rtl"?c-1-t:t,f;switch(i){case"odd":{let d=u%2===1?u:u+1;f=String(d+m*2);break}case"even":{let d=u%2===0?u:u+1;f=String(d+m*2);break}case"roman":f=Us(u+m*r);break;case"letters-upper":f=Qn(u+m*r,!1);break;case"letters-lower":f=Qn(u+m*r,!0);break;default:f=String(u+m*r);break}return`${a}${f}`}function Sh(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function Ws(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${li(e,t)}`}function wh(e,t,n,o){if(o?.displayLabel)return null;if(e.seatDisplayLabelMode==="number"||!n)return{row:e.displayLabel||e.label,seat:li(e,t)};let r=Sh(n);return{row:n.displayLabel,seat:li(r,n.displayOffset+t)}}function ui(e,t,n,o){let r=wh(e,t,n,o);return r?e.seatDisplayLabelMode==="number"?r.seat:`${r.row}-${r.seat}`:o.displayLabel}function Xs(e,t){return`${e.label}-${t+1}`}function Ph(e,t,n){return e?.direction==="anticlockwise"?Math.max(0,t-1-n):n}function Ah(e,t){let n=e.chairNumbering,o=n?.start??1,r=Ph(n,Math.max(0,Math.round(e.seatCount)),t);return n?.format==="letter"?Qn(Math.max(1,o)+r):String(o+r)}function Ys(e,t){let n=Ah(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${n}`:n}function Ks(e){let t=e.length;return t<=3?[...e]:[e[Math.floor(t*.25)],e[Math.floor(t*.5)],e[Math.floor(t*.75)]]}function mn(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u<0?u=0:u>1&&(u=1);let m=t-(i.x+u*s),f=n-(i.y+u*c);if(Math.abs(m)>=o||Math.abs(f)>=o)continue;let d=Math.hypot(m,f);d<o&&(o=d)}return o}function Ih(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let a=Math.hypot(i.x-t,i.y-n);a>r&&(r=a)}return{cx:t,cy:n,r}}function $s(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function mi(e,t){let n=1/0;for(let o of Ks(e)){let r=mn(t,o.x,o.y);r<n&&(n=r)}for(let o of Ks(t)){let r=mn(e,o.x,o.y);r<n&&(n=r)}return n}function Eh(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let u of e)n+=u.x,o+=u.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let u of e){let m=Math.hypot(u.x-n,u.y-o);m>r&&(r=m,i=u)}let a=i.x-n,s=i.y-o,c=Math.hypot(a,s);c>1e-9?(a/=c,s/=c):(a=1,s=0);let l=e.map((u,m)=>({p:u,i:m,t:(u.x-n)*a+(u.y-o)*s})).sort((u,m)=>u.t-m.t);return{pts:l.map(u=>u.p),seatIndices:l.map(u=>t[u.i])}}function fi(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let M of e)n+=M.x,o+=M.y;n/=t,o/=t;let r=0,i=0,a=0,s=0,c=0,l=0,u=0;for(let M of e){let v=M.x-n,A=M.y-o;r+=v*v,a+=A*A,i+=v*A,s+=v*v*v,c+=A*A*A,l+=v*A*A,u+=A*v*v}let m=r*a-i*i;if(Math.abs(m)<1e-9)return null;let f=(s+l)/2,d=(c+u)/2,h=(f*a-d*i)/m,p=(d*r-f*i)/m,b=h+n,y=p+o;return!Number.isFinite(b)||!Number.isFinite(y)?null:{cx:b,cy:y}}var Rh=.15;function Ch(e){if(e.length<2)return null;let t=e.map(x=>{let g=0,P=0;for(let S of x.pts)g+=S.x,P+=S.y;return{x:g/x.pts.length,y:P/x.pts.length}}),n=0,o=0;for(let x of t)n+=x.x,o+=x.y;n/=t.length,o/=t.length;let r=0,i=0,a=0;for(let x of t){let g=x.x-n,P=x.y-o;r+=g*g,i+=g*P,a+=P*P}let s=r+a,c=r*a-i*i,l=s/2+Math.sqrt(Math.max(0,s*s/4-c)),u,m;Math.abs(i)>1e-12?(u=l-a,m=i):r>=a?(u=1,m=0):(u=0,m=1);let f=Math.hypot(u,m);if(!(f>1e-12))return null;u/=f,m/=f;let d=0,h=0,p=0;for(let x of e){if(x.pts.length<2)continue;let g=x.pts[0],P=x.pts[x.pts.length-1],S=P.x-g.x,w=P.y-g.y,E=Math.hypot(S,w);if(!(E>1e-9))continue;let T=S/E,F=w/E;d+=(T*T-F*F)*E,h+=2*T*F*E,p+=E}if(p>0&&Math.hypot(d,h)>=Th*p){let x=Math.atan2(h,d)/2,g=Math.cos(x),P=Math.sin(x);Math.abs(u*g+m*P)>Lh&&(u=-P,m=g)}let b=1/0,y=-1/0,M=[];for(let x of e){let g=1/0,P=-1/0;for(let S of x.pts){let w=S.x*u+S.y*m;w<g&&(g=w),w>P&&(P=w),w<b&&(b=w),w>y&&(y=w)}M.push(P-g)}let v=y-b;return v>1e-9?(M.sort((x,g)=>x-g),M[Math.min(M.length-1,Math.floor(M.length*.9))]/v<=_h?{x:u,y:m}:null):null}var _h=.35,Th=.8,Lh=.7;function Bo(e,t,n,o){let r=new Map;for(let g of n){let P=t[g],S=P.rowId||`__seat-${g}`,w=r.get(S);w||(w={pts:[],idx:[]},r.set(S,w)),w.pts.push({x:P.x,y:P.y}),w.idx.push(g)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[g,P]of r){let S=Eh(P.pts,P.idx),w=0;for(let E of S.pts)w+=Math.hypot(E.x-o.x,E.y-o.y);i.push({id:g,pts:S.pts,seatIndices:S.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:w/S.pts.length})}let a=i.map(g=>Ih(g.pts)),s=i.length<=256?i.length*(i.length-1)/2:0,c=s?new Float64Array(s):null;c?.fill(Number.NaN);let l=c?new Map(i.map((g,P)=>[g,P])):null,u=(g,P)=>(g>P&&([g,P]=[P,g]),g*(2*i.length-g-1)/2+(P-g-1)),m=(g,P)=>{if(!c)return mi(i[g].pts,i[P].pts);let S=u(g,P),w=c[S];if(!Number.isNaN(w))return w;let E=mi(i[g].pts,i[P].pts);return c[S]=E,E},f=(g,P)=>l?m(l.get(g),l.get(P)):mi(g.pts,P.pts),d=[];for(let g=0;g<i.length;g++){let P=1/0;for(let S=0;S<i.length;S++){if(g===S||$s(a[g],a[S])>=P)continue;let w=m(g,S);w<P&&(P=w)}Number.isFinite(P)&&d.push(P)}d.sort((g,P)=>g-P);let h=d.length?d[Math.floor(d.length/2)]:1,p=Math.max(h*1.8,1e-6),b=i.map(()=>[]);for(let g=0;g<i.length;g++)for(let P=g+1;P<i.length;P++)$s(a[g],a[P])>p||m(g,P)<=p&&(b[g].push(P),b[P].push(g));let y=0;for(let g=0;g<i.length;g++){if(i[g].blockId!==-1)continue;let P=y++,S=[g];for(i[g].blockId=P;S.length;){let w=S.pop();for(let E of b[w])i[E].blockId===-1&&(i[E].blockId=P,S.push(E))}}let M=new Map;for(let g of i){let P=M.get(g.blockId)??[];P.push(g),M.set(g.blockId,P)}let v=[];for(let g of i){if(g.pts.length<4)continue;let P=fi(g.pts);P&&(!Number.isFinite(P.cx)||!Number.isFinite(P.cy)||v.push({x:P.cx,y:P.cy}))}let A=v.length>=2?(()=>{let g=v.map(w=>w.x).sort((w,E)=>w-E),P=v.map(w=>w.y).sort((w,E)=>w-E),S=Math.floor(v.length/2);return{cx:g[S],cy:P[S]}})():null;if(A){let g=F=>Math.hypot(F.x-A.cx,F.y-A.cy),P=1/0,S=-1/0,w=[];for(let F of i){let R=1/0,I=-1/0;for(let _ of F.pts){let k=g(_);k<R&&(R=k),k>I&&(I=k)}w.push(I-R),R<P&&(P=R),I>S&&(S=I)}let E=S-P;w.sort((F,R)=>F-R);let T=w[Math.min(w.length-1,Math.floor(w.length*.9))];if(E>1e-9&&T/E<=Rh){let F=i.map(L=>{let B=0;for(let D of L.pts)B+=g(D);return{row:L,radius:B/L.pts.length}}),R=0,I=0;for(let L of F)R+=L.radius,I+=L.row.focalDistance;R/=F.length,I/=F.length;let _=0;for(let L of F)_+=(L.radius-R)*(L.row.focalDistance-I);if(_<0)for(let L of F)L.radius=-L.radius;let V=1/0;for(let L of F)L.radius<V&&(V=L.radius);F.sort((L,B)=>L.radius-B.radius);let O=-1,H=-1/0,U=E/Math.max(1,F.length)*.5,N=[];for(let L of F)L.radius-H>U&&(O++,H=L.radius),L.row.ordinal=O,L.row.blockDepth=L.radius-V,N.push(L.row);return{sectionId:e,rows:N,blockCount:y}}}let x=[];for(let[,g]of M){let P=Ch(g);if(P){let S=F=>{let R=0;for(let I of F.pts)R+=I.x*P.x+I.y*P.y;return R/F.pts.length};g.sort((F,R)=>S(F)-S(R)),g.length>=2&&g[0].focalDistance>g[g.length-1].focalDistance&&g.reverse();let w=[],E=h*.5;for(let F of g){let R=w[w.length-1];R&&Math.abs(S(F)-S(R[0]))<E?R.push(F):w.push([F])}let T=0;for(let F=0;F<w.length;F++){if(F>0){let R=1/0;for(let I of w[F-1])for(let _ of w[F])R=Math.min(R,f(I,_));T+=R}for(let R of w[F])R.ordinal=F,R.blockDepth=T,x.push(R)}}else{let S=1/0;for(let w of g)w.focalDistance<S&&(S=w.focalDistance);g.sort((w,E)=>w.focalDistance-E.focalDistance);for(let w=0;w<g.length;w++)g[w].ordinal=w,g[w].blockDepth=Math.max(0,g[w].focalDistance-S),x.push(g[w])}}return{sectionId:e,rows:x,blockCount:y}}var kh=/^\d{4}-\d{2}-\d{2}$/;function Oh(e){let t=Date.parse(e);return Number.isFinite(t)?kh.test(e)?t+864e5:t:null}function Fh(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=Oh(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function Dh(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function Nh(e){return e.status!=="draft"&&e.status!=="retracted"}function Bh(e,t){return e.status===void 0?t===void 0:e.status!=="approved"?!0:typeof t=="string"&&typeof e.basisSha256=="string"&&e.basisSha256===t}function Zs(e,t={}){return!!e&&Nh(e)&&Dh(e,t.activeConfigurationId,t.activeConfigurationVersion)&&Bh(e,t.activeBasisSha256)&&Fh(e,t.now)}var Vh=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Gh=/[\s"'<>`\\]/;function Hh(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return Vh.test(e);if(Gh.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function qs(e){let t=e.trim();return Hh(t)?t:null}var di="seatlayer.event-configuration/1";var fn=100,zh=120,jh=2e5,Uh=1e4,Wh=/^[a-f0-9]{64}$/,Xh=new Set(["stage","screen","barrier","camera_platform","sound_desk","rigging_truss"]);function Jn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function $t(e,t){return typeof e=="string"&&e.length>=1&&e.length<=t&&e.normalize("NFKC").trim()===e}function Yh(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}function Qs(e){return!Array.isArray(e)||e.length>jh||!e.every(t=>$t(t,fn))?null:[...new Set(e)].sort()}function Kh(e){return!Jn(e)||!$t(e.chartId,fn)||!$t(e.version,fn)||e.sha256!==void 0&&(typeof e.sha256!="string"||!Wh.test(e.sha256))?null:{chartId:e.chartId,version:e.version,...typeof e.sha256=="string"?{sha256:e.sha256}:{}}}function hi(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n}function $h(e){return Jn(e)?e.mode==="none"||e.mode==="opaque"?e.opacity===void 0?{mode:e.mode}:null:e.mode==="partial"&&hi(e.opacity,.01,.99)?{mode:"partial",opacity:e.opacity}:null:null}function Zh(e,t){if(e===void 0)return;if(!Array.isArray(e)||e.length>Uh)return null;let n=new Set(t),o=new Set,r=new Set,i=0,a=[];for(let s of e){if(!Jn(s)||!$t(s.id,fn)||!$t(s.objectId,fn)||!n.has(s.objectId)||!Xh.has(String(s.kind))||!hi(s.heightM,.05,50)||s.baseElevationM!==void 0&&!hi(s.baseElevationM,-10,100))return null;let c=$h(s.occlusion);if(!c||o.has(s.id)||r.has(s.objectId))return null;let l=s.contentImageUrl===void 0?void 0:typeof s.contentImageUrl=="string"?qs(s.contentImageUrl):null;if(s.contentImageUrl!==void 0&&(!l||s.kind!=="screen"||++i>1))return null;o.add(s.id),r.add(s.objectId),a.push({id:s.id,objectId:s.objectId,kind:s.kind,heightM:s.heightM,...s.baseElevationM!==void 0?{baseElevationM:s.baseElevationM}:{},occlusion:c,...l?{contentImageUrl:l}:{}})}return a.sort((s,c)=>s.id.localeCompare(c.id))}function qh(e){let t=[];if(!Jn(e))return{issues:[{code:"invalid_export",path:"configuration",message:"Configuration must be an object"}]};e.schema!==di&&t.push({code:"unsupported_schema",path:"configuration.schema",message:`Configuration schema must be ${di}`}),$t(e.id,fn)||t.push({code:"invalid_id",path:"configuration.id",message:"Configuration id must contain 1 to 100 normalized characters"}),$t(e.label,zh)||t.push({code:"invalid_label",path:"configuration.label",message:"Configuration label must contain 1 to 120 normalized characters"}),Yh(e.version)||t.push({code:"invalid_version",path:"configuration.version",message:"Configuration version must be a positive integer"});let n=Kh(e.baseVenue);n||t.push({code:"invalid_base_venue",path:"configuration.baseVenue",message:"Base venue must identify one normalized chart id and exact version"});let o=Jn(e.overlay)?e.overlay:null,r=Qs(o?.objectIds),i=Qs(o?.productionKillSeatIds),a=r?Zh(o?.productionElements,r):null;return(!o||!r||!i)&&t.push({code:"invalid_overlay",path:"configuration.overlay",message:"Overlay ids must be bounded arrays of normalized stable ids"}),a===null&&t.push({code:"invalid_production_element",path:"configuration.overlay.productionElements",message:"Production elements must be unique, bounded semantics over referenced base-venue objects"}),t.length||!n||!r||!i||a===null?{issues:t}:{issues:t,value:{schema:di,id:e.id,label:e.label,version:e.version,baseVenue:n,overlay:{objectIds:r,productionKillSeatIds:i,...a!==void 0?{productionElements:a}:{}}}}}function Js(e){let t=qh(e);return t.value?{ok:!0,value:t.value}:{ok:!1,issues:t.issues}}function Qh(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.kind==="polygon"?No(e,6):e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,o=e.width,r=e.height;return[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r},{x:t,y:n+r}]}function Jh(e,t,n){let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),a=e.x-t.x,s=e.y-t.y;return{x:t.x+a*r-s*i,y:t.y+a*i+s*r}}function ec(e){let t=Qh(e);if(!t||t.length<2)return null;let n=e.rotation??0,o=Math.abs(n)<1e-6?t:t.map(c=>Jh(c,{x:t.reduce((l,u)=>l+u.x,0)/t.length,y:t.reduce((l,u)=>l+u.y,0)/t.length},n)),r=1/0,i=1/0,a=-1/0,s=-1/0;for(let c of o)r=Math.min(r,c.x),i=Math.min(i,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y);return!Number.isFinite(r)||a-r<1e-6||s-i<1e-6?null:{minX:r,minY:i,maxX:a,maxY:s}}var ep=5,tp=3,np=.92,op=1.9,rp=2,ip=.6,ap=1,sp=.06;function cp(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?ai:Do(e.stageKind)?sp:ap}function tc(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=-1/0;for(let a of rc(e)){let s=a.baseHeightM??0;for(let c of a.objects){if(c.type!=="shape"||c.role!=="stage")continue;let l=ec(c);l&&(t=Math.min(t,l.minX),n=Math.min(n,l.minY),o=Math.max(o,l.maxX),r=Math.max(r,l.maxY),i=Math.max(i,s+cp(c)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:o,maxY:r,deckTopM:i}}function lp(e,t,n,o){let r=1/0,i=1/0,a=-1/0,s=-1/0;for(let d of e)Number.isFinite(d.eyeHeightM)&&(r=Math.min(r,d.x),a=Math.max(a,d.x),i=Math.min(i,d.y),s=Math.max(s,d.y));if(!Number.isFinite(r))return null;let c=r*t,l=i*t,u=Math.max(1,Math.ceil((a-r)*t/n)+1),m=Math.max(1,Math.ceil((s-i)*t/n)+1),f=new Float64Array(u*m).fill(-1/0);for(let d of e){if(!Number.isFinite(d.eyeHeightM))continue;let h=d.eyeHeightM-ht,p=Math.min(u-1,Math.max(0,Math.floor((d.x*t-c)/n))),y=Math.min(m-1,Math.max(0,Math.floor((d.y*t-l)/n)))*u+p,M=h+o;M>f[y]&&(f[y]=M)}return{cellM:n,minX:c,minY:l,cols:u,rows:m,top:f}}function up(e,t,n){let o=Math.floor((t-e.minX)/e.cellM),r=Math.floor((n-e.minY)/e.cellM);return o<0||r<0||o>=e.cols||r>=e.rows?-1/0:e.top[r*e.cols+o]}function nc(e,t,n={}){let o=new Map;if(!t||!e.length)return o;let r=n.metresPerChartUnit??fe,i=n.cellM??ip,a=n.chairBackM??np,s=n.selfRowSkipM??rp,c=n.clearThreshold??.9,l=n.partialThreshold??.25,u=Math.max(1,n.columns??ep),m=Math.max(1,n.rows??tp),f=lp(e,r,i,a);if(!f)return o;let d=(t.maxX-t.minX)*r,h=(t.maxY-t.minY)*r,p=d>=h,b=(t.minX+t.maxX)/2*r,y=(t.minY+t.maxY)/2*r,M=[];for(let A=0;A<u;A++){let x=(A+.5)/u-.5,g=p?b+x*d:b,P=p?y:y+x*h;for(let S=0;S<m;S++){let w=t.deckTopM+(m===1?0:S/(m-1)*op);M.push({x:g,y:P,z:w})}}let v=i/2;for(let A of e){if(!Number.isFinite(A.eyeHeightM))continue;let x=A.x*r,g=A.y*r,P=A.eyeHeightM,S=0,w=1/0;for(let T of M){let F=T.x-x,R=T.y-g,I=Math.hypot(F,R);if(!(I>s)){S++;continue}let _=F/I,k=R/I,V=0;for(let O=s;O<I;O+=v){let H=up(f,x+_*O,g+k*O);if(!(!Number.isFinite(H)||H>=P)&&H>P+(T.z-P)*O/I){V=O;break}}V?w=Math.min(w,V):S++}let E=S/M.length;E>=c||o.set(A.id,{seatId:A.id,mark:E<l?"obstructedView":"restrictedView",visibleFraction:E,totalRays:M.length,atDistanceM:Number.isFinite(w)?w:0})}return o}function oc(e,t){if(!t.size)return 0;let n=0;for(let o of e){let r=t.get(o.id);if(!r)continue;let i=o.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(o.commercial={...i,[r.mark]:!0},n++)}return n}function pi(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var Go=Math.PI/180;var eo=16;function bi(e,t,n,o){let r=n*Go,i=Math.cos(r),a=Math.sin(r);return{x:o.x+e*i-t*a,y:o.y+e*a+t*i}}function cc(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,a=[];if(e.path)return Fs(e.path,t);if(t<=1)return t===1&&a.push({x:i.x,y:i.y}),a;if(o===0){for(let l=0;l<t;l++)a.push(bi(l*n,0,r,i));return a}let s=o/(t-1)*Go,c=n/(2*Math.sin(Math.abs(s)/2));for(let l=0;l<t;l++){let u=l*s,m=c*Math.sin(u),f=-c+c*Math.cos(u);a.push(bi(m,f,r,i))}return a}function lc(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function mp(e,t){let n=lc(e);return cc(e).map((o,r)=>{let i=n.get(r),a=pi(i),s=Ws(e,r,i),c={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:s,displayLabel:ui(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:a.length>0,accessibility:a,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(c).some(l=>l!==void 0&&l!==!1&&l!=="")?c:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function fp(e){let t=[];for(let n of mp(e))n.skipped||t.push({id:`${e.id}:${n.index}`,label:n.label,displayLabel:n.displayLabel===n.label?void 0:n.displayLabel,x:n.x,y:n.y,rowId:e.id,categoryKey:n.categoryKey,accessible:n.accessible||void 0,accessibility:n.accessibility.length?n.accessibility:void 0,wheelchairSpaceType:n.wheelchairSpaceType,commercial:n.commercial,glyph:n.glyph,viewUrl:n.viewUrl,viewMeta:n.viewMeta,labelStyle:n.labelStyle});return t}function dp(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function hp(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(u=>[u.index,u])),r=(u,m,f,d)=>{let h=o.get(u),p=pi(h),b=h?.label??Xs(e,u);return{index:u,label:b,displayLabel:h?.displayLabel??Ys(e,u),x:m+(h?.dx??0),y:f+(h?.dy??0),categoryKey:h?.categoryKey??e.categoryKey,skipped:!!h?.skip,accessible:p.length>0,accessibility:p,wheelchairSpaceType:h?.wheelchairSpaceType,commercial:h?.commercial,glyph:h?.glyph,viewUrl:h?.viewFromSeatUrl,viewMeta:h?.viewFromSeatUrl?h.viewFromSeatMeta:void 0,labelStyle:h?.labelStyle,...d?{side:d}:{}}};if(e.shape==="round"){let u=(e.radius??40)+eo,m=e.rotation*Go,f=Math.max(0,Math.min(360,e.seatArc??360));if(f>=360||n===1){for(let b=0;b<n;b++){let y=m+b/n*2*Math.PI;t.push(r(b,e.center.x+u*Math.cos(y),e.center.y+u*Math.sin(y)))}return t}let d=f*Go,h=(2*Math.PI-d)/2,p=m+h;for(let b=0;b<n;b++){let y=p+b/(n-1)*d;t.push(r(b,e.center.x+u*Math.cos(y),e.center.y+u*Math.sin(y)))}return t}let i=e.width??80,a=e.height??50,s=dp(e),c=["top","bottom","left","right"],l=0;for(let u of c){let m=s[u];for(let f=0;f<m;f++){let d,h;u==="top"?(d=-i/2+(f+.5)*i/m,h=-a/2-eo):u==="bottom"?(d=-i/2+(f+.5)*i/m,h=a/2+eo):u==="left"?(d=-i/2-eo,h=-a/2+(f+.5)*a/m):(d=i/2+eo,h=-a/2+(f+.5)*a/m);let p=bi(d,h,e.rotation,e.center);t.push(r(l++,p.x,p.y,u))}}return t}function pp(e){return hp(e).filter(t=>!t.skipped).map(t=>({id:`${e.id}:${t.index}`,label:t.label,...t.displayLabel!==t.label?{displayLabel:t.displayLabel}:{},x:t.x,y:t.y,rowId:e.id,categoryKey:t.categoryKey,...t.accessible?{accessible:!0}:{},...t.accessibility.length?{accessibility:t.accessibility}:{},...t.wheelchairSpaceType?{wheelchairSpaceType:t.wheelchairSpaceType}:{},...t.commercial?{commercial:t.commercial}:{},...t.glyph?{glyph:t.glyph}:{},...t.viewUrl?{viewUrl:t.viewUrl}:{},...t.viewUrl&&t.viewMeta?{viewMeta:t.viewMeta}:{},...t.labelStyle?{labelStyle:t.labelStyle}:{}}))}function bp(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function ci(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,a=t[o].y,s=t[r].x,c=t[r].y;a>e.y!=c>e.y&&e.x<(s-i)*(e.y-a)/(c-a)+i&&(n=!n)}return n}function zs(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let a=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),s=(r.x-n.x)**2+(r.y-n.y)**2;return a>=-1e-7&&a<=s+1e-7})}function qn(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function ze(e,t,n){return ci(e,t)&&!qn(n).some(o=>ci(e,o)||zs(e,o))}function Vo(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function uc(e){switch(e.type){case"row":{let t=cc(e),n=lc(e),o=0,r=0,i=0;for(let a=0;a<t.length;a++){let s=n.get(a);s?.skip||(o+=t[a].x+(s?.dx??0),r+=t[a].y+(s?.dy??0),i++)}return i?{x:o/i,y:r/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return Vo(e.points);case"section":return Vo(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?Vo(e.points):e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null?{x:e.x+e.width/2,y:e.y+e.height/2}:{x:e.x??0,y:e.y??0};case"decorImage":return{x:e.x+e.width/2,y:e.y+e.height/2}}}function ic(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function yp(e,t){if(e.type!=="gaArea"||!ic(e.points,t.outline))return!1;let n=qn(e.holes),o=qn(t.holes);return n.length===o.length&&n.every((r,i)=>ic(r,o[i]))}function gp(e,t,n=e.filter(r=>r.type==="section"),o=uc(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?n.find(a=>(a.logicalSectionId??a.id)===r&&(yp(t,a)||ze(o,a.outline,a.holes))):void 0)??n.find(a=>ze(o,a.outline,a.holes))}function rc(e){return e.floors&&e.floors.length?e.floors:[{id:"floor-0",name:"Main",objects:e.objects,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]}function ac(e,t,n,o,r,i,a,s,c){let l=[],u=e.filter(p=>p.type==="section"),m=js(e),f=p=>!p?.eventConfigurationId||p.eventConfigurationId===o&&(p.eventConfigurationVersion===void 0||p.eventConfigurationVersion===c),d=p=>Zs(p,{activeConfigurationId:o,activeConfigurationVersion:c,activeBasisSha256:r,now:s}),h=(p,b)=>d(p)?{...p,coverage:b}:void 0;for(let p of e){let b=[];if(p.type==="row"?b=fp(p):p.type==="table"?b=pp(p):p.type==="booth"&&(b=bp(p)),!b.length)continue;for(let x of b)x.viewUrl&&!f(x.viewMeta)&&(x.viewUrl=void 0,x.viewMeta=void 0);if(p.type==="row"){let x=m.get(p.id);if(x){let g=new Map((p.overrides??[]).map(P=>[P.index,P]));for(let P of b){let S=Number(P.id.slice(P.id.lastIndexOf(":")+1));if(!Number.isInteger(S))continue;P.logicalRowId=x.groupId,P.logicalSeatIndex=x.adjacencyOffset+S,g.get(S)?.displayLabel||(P.displayLabel=ui(p,S,x)),!P.viewUrl&&x.viewFromSeatUrl&&f(x.viewFromSeatMeta)&&(P.viewUrl=x.viewFromSeatUrl,P.viewMeta=x.viewFromSeatMeta);let w=g.get(S)?.confidenceEvidence;P.confidenceEvidence=h(w,"exact-seat")??h(p.confidenceEvidence,"row-representative")??h(x.confidenceEvidence,"row-representative")}}}let y=gp(e,p,u,p.type==="row"?Vo(b):uc(p)),M=y?.viewFromSeatUrl,A=(y?.zone?t?.find(x=>x.id===y.zone):void 0)?.focalPoint??n;for(let x of b){if(!x.confidenceEvidence){let g=Number(x.id.slice(x.id.lastIndexOf(":")+1)),P=(p.type==="row"||p.type==="table")&&Number.isInteger(g)?p.overrides?.find(S=>S.index===g)?.confidenceEvidence:void 0;x.confidenceEvidence=h(P,"exact-seat")??(p.type==="row"?h(p.confidenceEvidence,"row-representative"):void 0)}x.confidenceEvidence??=h(y?.confidenceEvidence,"section-representative")??(a?h(a.evidence,a.coverage):void 0),!x.viewUrl&&M&&f(y?.viewFromSeatMeta)&&(x.viewUrl=M,x.viewMeta=y?.viewFromSeatMeta),!x.viewUrl&&i&&f(i.meta)&&(x.viewUrl=i.url,x.viewMeta=i.meta),y&&(x.sectionId=y.logicalSectionId??y.id),y?.zone&&(x.zoneId=y.zone),A&&(x.focalPoint={...A})}l.push(...b)}return l}function dn(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,a=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,s=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,c=ac(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,a,s,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&sc(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,c);for(let l of c)l.floorId=r.id;for(let l of c)o.push(l)}return o}let n=ac(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&sc(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),xp(e,n,t)}function xp(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||oc(t,nc(t,tc(e))),t}function sc(e,t,n,o){let r=e.filter(m=>m.type==="section"),i=n>0||r.some(m=>m.height!==void 0||m.rake!==void 0||(m.elevation??0)>0);if(!r.length||!i||!t){for(let m of o)m.eyeHeightM=n+ht;return}let a=new Array(o.length),s=new Map;for(let m of r)s.has(m.id)||s.set(m.id,m);let c=new Map,l=new Map;for(let m=0;m<o.length;m++){let f=o[m],h=(f.sectionId?s.get(f.sectionId)??r.find(b=>b.logicalSectionId===f.sectionId&&ze({x:f.x,y:f.y},b.outline,b.holes)):void 0)??r.find(b=>ze({x:f.x,y:f.y},b.outline,b.holes))??null;if(a[m]=h,!h)continue;c.has(h.id)||c.set(h.id,Ct(h,{floorBaseHeightM:n}));let p=l.get(h.id);p?p.push(m):l.set(h.id,[m])}let u=new Array(o.length).fill(void 0);for(let[m,f]of l){let d=c.get(m);if(!d)continue;let h=d.rake>0?Math.tan(d.rake*Math.PI/180):0,p=Bo(m,o,f,t);for(let b of p.rows){let y=b.blockDepth*fe*h,M=d.height+y;for(let v of b.seatIndices)u[v]=M}}for(let m=0;m<o.length;m++){let f=o[m],d=a[m];if(!d){f.eyeHeightM=n+ht;continue}let h=c.get(d.id);f.eyeHeightM=(u[m]??h.height)+ht}}function mc(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=!1;for(let a of e)!Number.isFinite(a.x)||!Number.isFinite(a.y)||(i=!0,a.x<t&&(t=a.x),a.y<n&&(n=a.y),a.x>o&&(o=a.x),a.y>r&&(r=a.y));return i?{minX:t,minY:n,maxX:o,maxY:r}:null}function hn(e,t){return e.minX<=t.maxX&&t.minX<=e.maxX&&e.minY<=t.maxY&&t.minY<=e.maxY}var fc="#ffffff";var Mp={wheelchair:"M7.8 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM8 7L10.5 7L10.5 15L8 15ZM8 12.5L18 12.5L18 15L8 15ZM16 15L18 15L18 18L16 18ZM5.5 16a5.5 5.5 0 1 0 11 0a5.5 5.5 0 1 0 -11 0zM8 16a3 3 0 1 1 6 0a3 3 0 1 1 -6 0z",companion:"M5.5 6.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM4.5 18.5L6 11.5L11 11.5L12.5 18.5ZM12.5 7.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM11.5 19L13 12.5L18 12.5L19.5 19Z","semi-ambulatory":"M8.3 3.8a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM9 6.2L12 6.6L11 13.5L8.6 13L9 6.2ZM8.6 13L11 13L9.5 21L7 21ZM10.4 13L12.6 13L13.6 21L11.2 21ZM11.2 7.2L14 8L14.6 9.6L11.9 8.9ZM14.4 6.8L15.9 6.8L16.4 21L14.8 21Z","designated-aisle":"M3 5L6 5L6 14L3 14ZM3 12L13 12L13 15L3 15ZM5 15L7 15L7 20L5 20ZM11 15L13 15L13 20L11 20ZM13 7L20 7L17 4L19 4L23 8.5L19 13L17 13L20 10L13 10Z","step-free":"M4 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM4.4 7L7.5 7L7.5 13L11 15L9.5 17L5 14L4.4 7ZM2 19L8 19L17 10L22 10L22 13L18 13L10 21L2 21Z",hearing:"M15.5 3.5C9 2.2 5.5 6 5.5 11.5C5.5 16 8 19.5 10.5 21C13.2 22.6 16.4 20.8 15.4 18C14.8 16.4 12.9 16.1 13 14C13.1 11.9 15.8 11.4 15.8 8.5C15.8 5.4 13 4 15.5 3.5Z",cart:"M5.5 6L18.5 6a2.5 2.5 0 0 1 2.5 2.5L21 15.5a2.5 2.5 0 0 1 -2.5 2.5L11 18L7 20.5L7.5 18L5.5 18a2.5 2.5 0 0 1 -2.5 -2.5L3 8.5a2.5 2.5 0 0 1 2.5 -2.5zM6.5 11L17.5 11L17.5 12.6L6.5 12.6zM6.5 14L17.5 14L17.5 15.6L6.5 15.6z","sign-language":"M7 11L17 11L17 18a2 2 0 0 1 -2 2L9 20a2 2 0 0 1 -2 -2zM7.6 5L9.4 5L9.4 12L7.6 12zM9.9 3.5L11.7 3.5L11.7 12L9.9 12zM12.3 3.5L14.1 3.5L14.1 12L12.3 12zM14.6 5L16.4 5L16.4 12L14.6 12zM7.2 12.5L5 10.2L6.4 8.9L8.6 11.2Z","low-vision":"M2.5 12C6 6 18 6 21.5 12C18 18 6 18 2.5 12ZM9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM17.5 3L19 3L19 6L17.5 6ZM19 4L22 4L22 5.5L19 5.5Z","sensory-friendly":"M4 11C4 5 7 2.5 12 2.5S20 5 20 11L17 11C17 7 15.5 5.5 12 5.5S7 7 7 11ZM3 10L8 10L8 19L5 19a2 2 0 0 1 -2 -2ZM16 10L21 10L21 17a2 2 0 0 1 -2 2L16 19ZM9 12L15 12L15 14L9 14ZM10 16L14 16L14 18L10 18Z","plus-size":"M9.4 4.3a2.6 2.6 0 1 0 5.2 0a2.6 2.6 0 1 0 -5.2 0zM5 20L4 13C4 10.5 7 9.5 12 9.5C17 9.5 20 10.5 20 13L19 20Z","lift-armrest":"M5 6L8 6L8 19L5 19zM5 16L18 16L18 19L5 19zM8 12L17 12L17 14.5L8 14.5zM14 7L16 7L16 12L14 12zM12 7L18 7L15 3Z"},Tv=Mp.wheelchair;var Ho=["#e69f00","#56b4e9","#009e73","#f0e442","#0072b2","#d55e00","#cc79a7"],dc="#a4508b";var yi={facilities:dc,"food-drink":Ho[5],navigation:Ho[2],accessibility:Ho[4]},Uo=fc,gi={minDiameterPx:12,glyphScale:.66,ringRatio:1/14,largeFromPx:24};var _e=e=>{let t=Math.round(e*100)/100;return Object.is(t,-0)?"0":String(t)},gn=e=>`${_e(e[0])} ${_e(e[1])}`,yn=(e,t,n,o)=>[e+n*Math.cos(o*Math.PI/180),t+n*Math.sin(o*Math.PI/180)];function Ic(e){let t=`M${gn(e.from)}`;for(let n of e.segs)t+=n.arc?`A${_e(n.arc.r)} ${_e(n.arc.r)} 0 ${n.arc.large} ${n.arc.sweep} ${gn(n.to)}`:`L${gn(n.to)}`;return`${t}Z`}function Te(e){let t=[e.from,...e.segs.map(o=>o.to)],n=[];for(let o=e.segs.length-1;o>=0;o--){let r=e.segs[o].arc;n.push({to:t[o],arc:r&&{...r,sweep:r.sweep?0:1}})}return{from:t[t.length-1],segs:n}}function Le(e,t,n){let o={r:n,large:0,sweep:1};return{from:[e-n,t],segs:[{to:[e+n,t],arc:o},{to:[e-n,t],arc:o}]}}function de(e,t,n,o,r){let i=Math.min(r,n/2,o/2),a={r:i,large:0,sweep:1};return i<=0?Fe([[e,t],[e+n,t],[e+n,t+o],[e,t+o]]):{from:[e+i,t],segs:[{to:[e+n-i,t]},{to:[e+n,t+i],arc:a},{to:[e+n,t+o-i]},{to:[e+n-i,t+o],arc:a},{to:[e+i,t+o]},{to:[e,t+o-i],arc:a},{to:[e,t+i]},{to:[e+i,t],arc:a}]}}function Fe(e){let t=0;for(let o=0;o<e.length;o++){let[r,i]=e[o],[a,s]=e[(o+1)%e.length];t+=r*s-a*i}let n=t>0?e:[...e].reverse();return{from:n[0],segs:[...n.slice(1).map(o=>({to:o})),{to:n[0]}]}}function Ie(e,t,n){let o=n/2,r=t[0]-e[0],i=t[1]-e[1],a=Math.hypot(r,i);if(a<1e-6)return Le(e[0],e[1],o);let s=[i/a*o,-r/a*o],c={r:o,large:0,sweep:1},l=[e[0]+s[0],e[1]+s[1]];return{from:l,segs:[{to:[t[0]+s[0],t[1]+s[1]]},{to:[t[0]-s[0],t[1]-s[1]],arc:c},{to:[e[0]-s[0],e[1]-s[1]]},{to:l,arc:c}]}}function Oe(e,t,n=!1){let o=[],r=n?e.length:e.length-1;for(let i=0;i<r;i++)o.push(Ie(e[i],e[(i+1)%e.length],t));return o}function ct(e,t,n,o,r,i){let a=i/2,s=r-o>180?1:0,c={r:a,large:0,sweep:1},l=yn(e,t,n+a,o);return{from:l,segs:[{to:yn(e,t,n+a,r),arc:{r:n+a,large:s,sweep:1}},{to:yn(e,t,n-a,r),arc:c},{to:yn(e,t,n-a,o),arc:{r:n-a,large:s,sweep:0}},{to:l,arc:c}]}}var he=(...e)=>e.flat().map(Ic).join(" "),We=(e,t,n)=>`M${_e(e-n)} ${_e(t)}a${_e(n)} ${_e(n)} 0 1 0 ${_e(2*n)} 0a${_e(n)} ${_e(n)} 0 1 0 ${_e(-2*n)} 0`,bt=(e,t,n,o,r)=>Ic(de(e,t,n,o,r)),jo=e=>`M${e.map(gn).join("L")}`,zo=(e,t,n,o,r)=>`M${gn(yn(e,t,n,o))}A${_e(n)} ${_e(n)} 0 ${r-o>180?1:0} 1 ${gn(yn(e,t,n,r))}`;function pn(e,t,n,o=1){let r=i=>[i[0]*o+t,i[1]*o+n];return{head:[e.head[0]*o+t,e.head[1]*o+n,e.head[2]*o],limbs:e.limbs.map(i=>i.map(r)),arcs:e.arcs?.map(([i,a,s,c,l])=>[i*o+t,a*o+n,s*o,c,l])}}function to(e){return[We(e.head[0],e.head[1],e.head[2]),...e.limbs.map(jo),...(e.arcs??[]).map(([t,n,o,r,i])=>zo(t,n,o,r,i))].join(" ")}function bn(e,t=2.6){return[Le(e.head[0],e.head[1],e.head[2]+1),...e.limbs.flatMap(n=>Oe(n,t)),...(e.arcs??[]).map(([n,o,r,i,a])=>ct(n,o,r,i,a,t-.2))]}var Zt={head:[10,4,2],limbs:[[[10,8.2],[10,14],[15.5,14],[18,19.5],[20.5,19.5]],[[10,10.6],[14.5,10.6]]],arcs:[[9.5,16,5.5,35,235]]},hc={head:[10.6,3.9,1.9],limbs:[[[9.6,7.8],[7.6,12]],[[5.4,8.2],[9.4,8.4],[12.8,10]],[[4,15.6],[7.6,12],[11,13.6],[10.6,16.4]]]},pc={cx:12,hr:1.9,arm:5,leg:3,r:2},bc={cx:12,hr:1.9,sh:2.2,hem:6,leg:3},yc={cx:6.2,hr:1.8,arm:3.6,leg:2.2,r:1.4},gc={cx:17.8,hr:1.8,sh:1.4,hem:4.1,leg:2.2};function xc({cx:e,hr:t,arm:n,leg:o,r}){return[We(e,2+t,t),`M${_e(e-n+r)} 8.5H${_e(e+n-r)}a${r} ${r} 0 0 1 ${r} ${r}V15H${_e(e+o)}V22H${_e(e-o)}V15H${_e(e-n)}V${_e(8.5+r)}a${r} ${r} 0 0 1 ${r} ${-r}Z`,`M${_e(e)} 15V22`].join(" ")}function Mc({cx:e,hr:t,arm:n,leg:o,r}){return[Le(e,2+t,t+1),de(e-n-.5,7.8,2*n+1,7.7,r+.5),de(e-o-.5,13,o,9.5,1),de(e+.5,13,o,9.5,1)]}function vc({cx:e,hr:t,sh:n,hem:o,leg:r}){return[We(e,2+t,t),jo([[e-n,8.5],[e+n,8.5],[e+o,16],[e+r,16],[e+r,22],[e-r,22],[e-r,16],[e-o,16]])+"Z",`M${_e(e)} 16V22`].join(" ")}function Sc({cx:e,hr:t,sh:n,hem:o,leg:r}){return[Le(e,2+t,t+1),Fe([[e-n-.6,7.8],[e+n+.6,7.8],[e+o+.9,16.8],[e-o-.9,16.8]]),de(e-r-.1,15,r-.4,7.5,.9),de(e+.5,15,r-.4,7.5,.9)]}var vp=[[14.6,1.5],[5.2,13.6],[11,13.6],[9.4,22.5],[18.8,10.4],[13,10.4]],Sp="M8.5 3.5 4 5.5l-1.5 5 3 1 1-2v11h11v-11l1 2 3-1-1.5-5-4.5-2c-.5 1.5-1.8 2.5-3.5 2.5s-3-1-3.5-2.5Z",wp="M12 2.5S5 9.5 5 14.5a7 7 0 0 0 14 0c0-5-7-12-7-12Z",Pp="M2.5 21.5h19V3h-6v6.2H9.2v6.2H2.5Z",wc=[[9,3],[15,3],[15,9],[21,9],[21,15],[15,15],[15,21],[9,21],[9,15],[3,15],[3,9],[9,9]],Ap={from:[3.8,5.2],segs:[{to:[20.2,5.2]},{to:[22,7],arc:{r:1.8,large:0,sweep:1}},{to:[22,9.7]},{to:[22,14.3],arc:{r:2.3,large:0,sweep:0}},{to:[22,17]},{to:[20.2,18.8],arc:{r:1.8,large:0,sweep:1}},{to:[3.8,18.8]},{to:[2,17],arc:{r:1.8,large:0,sweep:1}},{to:[2,14.3]},{to:[2,9.7],arc:{r:2.3,large:0,sweep:0}},{to:[2,7]},{to:[3.8,5.2],arc:{r:1.8,large:0,sweep:1}}]},Ip={from:[12,1.6],segs:[{to:[20.4,4.9]},{to:[20.4,11.2]},{to:[12,22.4],arc:{r:13,large:0,sweep:1}},{to:[3.6,11.2],arc:{r:13,large:0,sweep:1}},{to:[3.6,4.9]},{to:[12,1.6]}]};function Pc(e,t,n){return{from:[e-n,t],segs:[{to:[e+n,t],arc:{r:n,large:0,sweep:1}},{to:[e-n,t]}]}}var Ac={head:[13.2,4.3,2.2],limbs:[[[12.6,8.6],[11.2,15],[17.8,18.4],[9.4,18.4]],[[12.4,9.8],[16,14.4]]]},Ep=[[6,10.5],[15,10.5],[16.5,7],[18.5,5.5],[20,6.5],[21.5,8.5],[19.5,10],[18,12],[18,19],[16.5,19],[15.5,14],[9.5,14],[8.5,19],[7,19],[6.5,13]],Rp=[[5.4,9.8],[14.6,9.8],[16.1,6.4],[18.4,4.6],[20.5,5.9],[22.4,8.6],[19.9,10.6],[18.8,12.3],[18.8,19.8],[15.8,19.8],[15,14.8],[10.1,14.8],[9.2,19.8],[6.2,19.8],[5.6,13.2]],xi=[{key:"restroom-men",label:"Men's restroom",group:"facilities",path:xc(pc),solid:he(Mc(pc))},{key:"restroom-women",label:"Women's restroom",group:"facilities",path:vc(bc),solid:he(Sc(bc))},{key:"restroom-accessible",label:"Accessible restroom",group:"facilities",path:[bt(2.5,2.5,19,19,3.5),to(pn(Zt,4.6,4.3,.66))].join(" "),solid:he(bn(Zt)),solidLarge:he(de(1.5,1.5,21,21,4.5),Te(de(3.9,3.9,16.2,16.2,2.6)),bn(pn(Zt,4.9,4.7,.62),2.2))},{key:"first-aid",label:"First aid",group:"facilities",path:jo(wc)+"Z",solid:he(Fe(wc.map(([e,t])=>[e+(e-12)*.08,t+(t-12)*.08])))},{key:"coat-check",label:"Coat check",group:"facilities",path:"M10 6.5a2 2 0 1 1 2 2V10 M12 10 3.4 16.9a1.4 1.4 0 0 0 .9 2.6h15.4a1.4 1.4 0 0 0 .9-2.6Z",solid:he(ct(12,6.2,2.2,180,450,2.3),Ie([12,8.4],[12,10.5],2.3),Oe([[12,10.2],[3.2,18.8],[20.8,18.8]],2.8,!0))},{key:"atm",label:"ATM / cash",group:"facilities",path:[bt(2,6,20,12,2),We(12,12,2.75),"M6 12h.01 M18 12h.01"].join(" "),solid:he(de(1.5,5.5,21,13,2.4),Te(Le(12,12,3.2)))},{key:"info",label:"Info point",group:"facilities",path:[We(12,12,9.5),"M10.8 11H12v5.8 M12 7.6h.01"].join(" "),solid:he(Le(12,4.9,2.4),de(10.3,9.2,3.4,12.3,1),de(8.2,9.2,4,3,1),de(8.2,18.5,7.6,3,1))},{key:"lost-found",label:"Lost & found",group:"facilities",path:[We(10.5,10.5,7.5),"M16 16l5.5 5.5","M8.4 8.4a2.1 2.1 0 1 1 3 1.9c-.6.4-.9.8-.9 1.6 M10.5 14.6h.01"].join(" "),solid:he(ct(12,7.6,4.2,180,405,3.4),Oe([[14.97,10.57],[12,13],[12,15]],3.4),Le(12,20,2.1))},{key:"restrooms",label:"Toilets",group:"facilities",path:[xc(yc),vc(gc)].join(" "),solid:he(Mc(yc),Sc(gc))},{key:"charging",label:"Charging point",group:"facilities",path:[bt(6,2,12,20,2.5),"M13.2 6.2 9.6 12h4.8l-3.6 5.8"].join(" "),solid:he(Fe(vp))},{key:"smoking",label:"Smoking area",group:"facilities",path:[bt(2,14.5,14.5,4,1),"M6.5 14.5v4","M15.5 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4 M19 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4"].join(" "),solid:he(de(1.5,14,4.2,5,1.2),de(6.8,14,10.4,5,1.2),Oe([[15.9,11.4],[17.3,8.9],[15.9,6.4],[17.1,3.9]],2.2),Oe([[19.6,11.4],[21,8.9],[19.6,6.4],[20.8,3.9]],2.2))},{key:"no-smoking",label:"No smoking",group:"facilities",path:[We(12,12,9.5),"M5.3 5.3l13.4 13.4","M5.5 10.5h13v3h-13Z"].join(" "),solid:he(Le(12,12,10.6),Te(Le(12,12,8)),Ie([6,6],[18,18],2.8),de(5,10.4,3,3.2,.6),de(16,10.4,3,3.2,.6))},{key:"food",label:"Food",group:"food-drink",path:"M5 2.5V8a2.5 2.5 0 0 0 5 0V2.5 M7.5 2.5v19 M18.5 13.5h-2c-1.3 0-2-1-2-2.5 0-4 1.5-7 4-8.5v19",solid:he(Oe([[4.9,2.6],[4.9,8]],2.2),Oe([[10.1,2.6],[10.1,8]],2.2),Oe([[7.5,2.6],[7.5,8]],2.2),ct(7.5,8,2.6,0,180,2.2),Ie([7.5,10],[7.5,21.4],3),Fe([[19.4,2.2],[19.4,14.2],[16.2,14.2],[14.1,12],[14.1,9.4],[15.2,5.8],[17.3,3.3]]),Ie([18,13],[18,21.4],3))},{key:"bar",label:"Bar",group:"food-drink",path:"M3.5 3.5h17L12 13Z M6.2 6.5h11.6 M12 13v7.5 M8 20.5h8",solid:he(Fe([[2.8,3],[21.2,3],[12,13.6]]),Ie([12,12],[12,20.6],2.8),Ie([7.4,21],[16.6,21],2.8))},{key:"coffee",label:"Caf\xE9 / coffee",group:"food-drink",path:"M4 9h12v4.5a5.5 5.5 0 0 1-5.5 5.5h-1A5.5 5.5 0 0 1 4 13.5Z M16 10.5h1.2a2.75 2.75 0 0 1 0 5.5H16 M8 3v3 M12 3v3 M3 21.5h14",solid:he({from:[3.4,8.4],segs:[{to:[16.6,8.4]},{to:[16.6,13.4]},{to:[11,19.4],arc:{r:5.8,large:0,sweep:1}},{to:[9,19.4]},{to:[3.4,13.4],arc:{r:5.8,large:0,sweep:1}},{to:[3.4,8.4]}]},ct(17.2,13.25,2.5,270,450,2.4),Ie([7.8,2.6],[7.8,5.6],2.4),Ie([12.2,2.6],[12.2,5.6],2.4),Ie([2.6,21.6],[17.4,21.6],2.6))},{key:"water",label:"Water / drinks",group:"food-drink",path:wp,solid:"M12 1.2S4 8.9 4 14.5a8 8 0 0 0 16 0c0-5.6-8-13.3-8-13.3Z"},{key:"merch",label:"Merch / shop",group:"food-drink",path:Sp,solid:"M8.4 2.8 3.5 5l-1.9 6 4.2 1.4.4-.8v9.4h11.6v-9.4l.4.8 4.2-1.4-1.9-6-4.9-2.2c-.4 1.5-1.8 2.6-3.6 2.6s-3.2-1.1-3.6-2.6Z"},{key:"screen",label:"Screen",group:"facilities",path:[bt(2,3.5,20,13.5,2),"M12 17v3.5 M8 20.5h8","M10 7.8v5.9l5-2.95Z"].join(" "),solid:he(de(1.5,3,21,14.4,2.4),Te(Fe([[9.6,6.7],[16,10.2],[9.6,13.7]])),de(10.6,16.5,2.8,4,0),Ie([7.4,21],[16.6,21],2.8))},{key:"sound-booth",label:"Sound booth",group:"facilities",path:["M6 3v9 M6 16v5 M12 3v3 M12 10v11 M18 3v10 M18 17v4",We(6,14,2),We(12,8,2),We(18,15,2)].join(" "),solid:he(Ie([6,2.8],[6,21.2],1.8),Ie([12,2.8],[12,21.2],1.8),Ie([18,2.8],[18,21.2],1.8),de(3.2,11.6,5.6,4.8,1.4),de(9.2,5.6,5.6,4.8,1.4),de(15.2,12.6,5.6,4.8,1.4))},{key:"entrance",label:"Entrance",group:"navigation",path:"M11 7V3.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v17a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V17 M2.5 12h13.5 M12.5 8.5 16 12l-3.5 3.5",solid:he(Oe([[11,6.5],[11,2.6],[21,2.6],[21,21.4],[11,21.4],[11,17.5]],2.6),Ie([2.8,12],[13.5,12],3.2),Fe([[12.6,7.8],[18,12],[12.6,16.2]]))},{key:"exit",label:"Exit",group:"navigation",path:"M13 7V3.5a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v17a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V17 M8 12h13.5 M18 8.5l3.5 3.5-3.5 3.5",solid:he(Oe([[13,6.5],[13,2.6],[3,2.6],[3,21.4],[13,21.4],[13,17.5]],2.6),Ie([7.2,12],[17,12],3.2),Fe([[16.2,7.8],[21.6,12],[16.2,16.2]]))},{key:"emergency-exit",label:"Emergency exit",group:"navigation",path:[to(pn(hc,-2,1.4,1.15)),"M15.5 13h6 M19 10.5l2.5 2.5-2.5 2.5"].join(" "),solid:he(bn(pn(hc,-2,1.4,1.15),2.7),Ie([15.6,13],[19.5,13],2.8),Fe([[18.4,9.4],[22.4,13],[18.4,16.6]]))},{key:"stairs",label:"Stairs",group:"navigation",path:Pp,solid:"M1.5 22.5h21V2h-7.8v6.4H8.4v6.4H1.5Z"},{key:"elevator",label:"Elevator",group:"navigation",path:[bt(3.5,2.5,17,19,2.5),"M8.5 9.5 12 5.5l3.5 4Z M8.5 14.5l3.5 4 3.5-4Z"].join(" "),solid:he(Fe([[12,1.6],[19.6,10.2],[4.4,10.2]]),Fe([[4.4,13.8],[19.6,13.8],[12,22.4]]))},{key:"parking",label:"Parking",group:"navigation",path:[bt(3,3,18,18,3),"M9.5 17V7h3.75a3 3 0 0 1 0 6H9.5"].join(" "),solid:"M6.5 21V3H12a5.5 5.5 0 0 1 0 11h-1.9v7Z M10.1 6.6v3.8H12a1.9 1.9 0 0 0 0-3.8Z"},{key:"wheelchair",label:"Wheelchair access",group:"accessibility",path:to(Zt),solid:he(bn(Zt))},{key:"hearing",label:"Hearing assistance",group:"accessibility",path:["M4 9a6 6 0 1 1 12 0c0 3-1.8 4.3-3 5.2-1.1.8-1.6 1.7-1.6 3.1a3.6 3.6 0 0 1-6.2 2.1","M7.5 9a2.5 2.5 0 0 1 5 0c0 1.2-.7 1.9-1.6 2.5","M18.5 5.5a6.5 6.5 0 0 1 0 8"].join(" "),solid:he(ct(10,9,6,180,380,3),Oe([[15.64,11.05],[12.8,14.3],[11.5,17.2]],3),ct(8.2,17.2,3.3,0,150,3),ct(10,9,2.2,180,400,2.4),ct(13.38,9.5,6.5,322,398,2.6))},{key:"box-office",label:"Box office / tickets",group:"navigation",path:"M3 7.5A1.5 1.5 0 0 1 4.5 6h15A1.5 1.5 0 0 1 21 7.5V10a2 2 0 0 0 0 4v2.5a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 16.5V14a2 2 0 0 0 0-4Z M15 6v2 M15 11v2 M15 16v2",solid:he(Ap,Te(de(14.1,7,1.8,2.2,.9)),Te(de(14.1,10.9,1.8,2.2,.9)),Te(de(14.1,14.8,1.8,2.2,.9)))},{key:"escalator",label:"Escalator",group:"navigation",path:"M2.5 17H7l9-9h5.5v4h-4l-9 9h-6Z M11 4.5h.01 M11 8.2v3.3",solid:he(Fe([[2,16.4],[6.8,16.4],[15.8,7.4],[22,7.4],[22,12.6],[17.8,12.6],[8.8,21.6],[2,21.6]]),Le(11,4.3,2.3),Ie([11,8],[11,11],2.6))},{key:"ramp",label:"Ramp",group:"navigation",path:"M2.5 19.5h19v-10Z M4.5 13.2 14 8.2 M10.53 7.76 14 8.2l-1.6 3.11",solid:he(Fe([[1.6,20.4],[22.4,20.4],[22.4,8.6]]),Ie([4.2,13.4],[13.2,8.6],2.6),Fe([[15.4,7.5],[13.16,11.84],[10.56,6.88]]))},{key:"taxi",label:"Taxi / rideshare",group:"navigation",path:["M9.5 2.5h5V5h-5Z M6.5 11 8 7h8l1.5 4",bt(3.5,11,17,6,2),"M6.5 17v2.5 M17.5 17v2.5 M7 14h.01 M17 14h.01"].join(" "),solid:he(de(9,1.8,6,3.4,.8),Fe([[6,11.4],[7.6,6.4],[16.4,6.4],[18,11.4]]),de(2.8,10.6,18.4,7,2.2),Te(Le(6.8,14,1.3)),Te(Le(17.2,14,1.3)),de(4.8,16,3.6,5.2,1.2),de(15.6,16,3.6,5.2,1.2))},{key:"transit",label:"Bus / transit",group:"navigation",path:[bt(4.5,2.5,15,16,3),"M4.5 10.5h15 M9 5.5h6 M7.5 18.5V21 M16.5 18.5V21 M8 14.5h.01 M16 14.5h.01"].join(" "),solid:he(de(4,2,16,17,3.2),Te(de(6.2,5.8,11.6,5,1)),Te(Le(8,14.5,1.3)),Te(Le(16,14.5,1.3)),de(6,17,3.4,5,1.2),de(14.6,17,3.4,5,1.2))},{key:"bike-parking",label:"Bike parking",group:"navigation",path:[We(6,14.5,4),We(18,14.5,4),"M6 14.5 9 7.5h6.5L18 14.5 M9 7.5l2.5 7H6 M11.5 14.5l4-7 M7.5 6h3 M15.5 7.5 15 5.5h2"].join(" "),solid:he(Le(6,14.5,4.9),Te(Le(6,14.5,2.7)),Le(18,14.5,4.9),Te(Le(18,14.5,2.7)),Oe([[6,14.5],[9,7.5],[15.5,7.5],[18,14.5]],2.2),Oe([[9,7.5],[11.5,14.5],[15.5,7.5]],2.2),Ie([6,14.5],[11.5,14.5],2.2),Ie([7.2,5.8],[10.6,5.8],2.2),Oe([[15.4,7.3],[15,5.4],[17.2,5.4]],2.2))},{key:"meeting-point",label:"Meeting point",group:"navigation",path:["M9.5 2.5 12 5l2.5-2.5 M9.5 21.5 12 19l2.5 2.5 M2.5 9.5 5 12l-2.5 2.5 M21.5 9.5 19 12l2.5 2.5",We(10,9.6,1.5),We(14,9.6,1.5),"M7.5 15.5a2.5 2.5 0 0 1 5 0 M11.5 15.5a2.5 2.5 0 0 1 5 0"].join(" "),solid:he(Oe([[9.4,2.4],[12,5],[14.6,2.4]],2.6),Oe([[9.4,21.6],[12,19],[14.6,21.6]],2.6),Oe([[2.4,9.4],[5,12],[2.4,14.6]],2.6),Oe([[21.6,9.4],[19,12],[21.6,14.6]],2.6),Le(9.7,9.3,2.2),Le(14.3,9.3,2.2),Pc(9.7,16,3),Pc(14.3,16,3))},{key:"security",label:"Security / bag check",group:"facilities",path:"M12 2.5 19.5 5.5v6c0 4.6-3.2 8.4-7.5 10-4.3-1.6-7.5-5.4-7.5-10v-6Z M8.5 12l2.5 2.5 4.5-5",solid:he(Ip,Te(Fe([[7.4,12.2],[9,10.6],[10.9,12.5],[15,8.4],[16.6,10],[10.9,15.7]])))},{key:"lockers",label:"Lockers",group:"facilities",path:[bt(3.5,2.5,17,19,1.5),"M12 2.5v19 M6 6h3 M15 6h3 M9.5 11.5v2.5 M14.5 11.5v2.5"].join(" "),solid:he(de(3,2,8.4,20,1.4),Te(de(5,5,4.4,1.7,.8)),Te(de(8.6,10.8,1.5,3.8,.7)),de(12.6,2,8.4,20,1.4),Te(de(14.6,5,4.4,1.7,.8)),Te(de(13.9,10.8,1.5,3.8,.7)))},{key:"baby-change",label:"Baby change",group:"facilities",path:"M10 6.5l.8-3.3a1.2 1.2 0 0 1 2.4 0l.8 3.3 M8.5 6.5h7 M9.5 6.5l-.9 2.2a3 3 0 0 0-.1.9V19a2.5 2.5 0 0 0 2.5 2.5h2a2.5 2.5 0 0 0 2.5-2.5V9.6a3 3 0 0 0-.1-.9l-.9-2.2 M8.5 12.5h3 M8.5 16h3",solid:he(Fe([[9.6,6.2],[10.6,1.8],[13.4,1.8],[14.4,6.2]]),de(7.6,5.4,8.8,2.6,1),de(7.8,7.4,8.4,15,2.6),Te(de(7.8,11.8,3.4,1.5,0)),Te(de(7.8,15.4,3.4,1.5,0)))},{key:"prayer-room",label:"Prayer room",group:"facilities",path:[to(Ac),"M3 21.5h18"].join(" "),solid:he(bn(Ac),de(2.4,20.2,19.2,2.6,1.3))},{key:"quiet-room",label:"Quiet room",group:"facilities",path:"M4 9h3.5l5-4v14l-5-4H4Z M15.5 9.5l5 5 M20.5 9.5l-5 5",solid:he(Fe([[2.6,8.4],[7.2,8.4],[13,3.6],[13,20.4],[7.2,15.6],[2.6,15.6]]),Ie([15.4,9.2],[20.8,14.8],2.8),Ie([20.8,9.2],[15.4,14.8],2.8))},{key:"wifi",label:"Wi-Fi",group:"facilities",path:[zo(12,19,11.5,218,322),zo(12,19,7.5,218,322),zo(12,19,3.5,218,322),"M12 19h.01"].join(" "),solid:he(ct(12,19.2,11,218,322,2.8),ct(12,19.2,6.9,218,322,2.8),Le(12,19.2,2.2))},{key:"vip-lounge",label:"VIP lounge",group:"facilities",path:["M6.5 11V7a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v4","M3.5 11.5a1.5 1.5 0 0 1 3 0V14h11v-2.5a1.5 1.5 0 0 1 3 0v6h-17Z","M5.5 17.5V20 M18.5 17.5V20"].join(" "),solid:he(de(6,4,12,8.5,2.2),de(2.4,9.6,4.6,9,2.2),de(17,9.6,4.6,9,2.2),de(6,13.2,12,5.4,.6),Ie([5,18],[5,20.6],2.4),Ie([19,18],[19,20.6],2.4))},{key:"accessible-entrance",label:"Accessible entrance",group:"accessibility",path:[to(pn(Zt,.3,5,.62)),"M12.5 3.5H20a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1h-7.5"].join(" "),solid:he(bn(pn(Zt,.3,5,.62),2.2),Oe([[13,2.8],[21.2,2.8],[21.2,21.2],[13,21.2]],2.6))},{key:"assistance-dog",label:"Assistance-dog area",group:"accessibility",path:[jo(Ep)+"Z","M6 10.8 3.5 7.5","M10.5 10.5V6h4.5l1 2.5"].join(" "),solid:he(Fe(Rp),Ie([6.2,11],[3.2,7.2],2.4),Oe([[10.5,11],[10.5,5.6],[15.2,5.6],[16.2,8.2]],2.2))}],Dv=new Map(xi.map(e=>[e.key,e]));var Ec=xi;var Cp=new Map(Ec.map(e=>[e.key,e]));function no(e){return e?Cp.get(e):void 0}var Gv=Ec.map(e=>e.key);function oo(e){if(e.length<3)return e.map(i=>({...i}));let t=[...e].sort((i,a)=>i.x-a.x||i.y-a.y),n=(i,a,s)=>(a.x-i.x)*(s.y-i.y)-(a.y-i.y)*(s.x-i.x),o=i=>{let a=[];for(let s of i){for(;a.length>=2&&n(a[a.length-2],a[a.length-1],s)<=0;)a.pop();a.push(s)}return a.pop(),a},r=[...o(t),...o([...t].reverse())];return r.length>=3?r.map(i=>({...i})):t.map(i=>({...i}))}var Yc=dt(require("polygon-clipping"),1);var ae={top:1,wallBottom:.58,bottomCap:.4};function qt(e,t){if(!e)return t;let n=le(at(e,.4),.62);return ge(t,n,.22)}function Rc(e,t){return e?ge(t,le(at(e,.25),.74),.62):t}function Cc(e,t){return e?ge(t,le(at(e,.08),.9),.82):t}function _c(e,t){let n=new Map;for(let i of e.categories??[])n.set(i.key,i.color);let o=new Map;for(let i of t){if(!i.sectionId)continue;let a=o.get(i.sectionId);a||(a=new Map,o.set(i.sectionId,a)),a.set(i.categoryKey,(a.get(i.categoryKey)??0)+1)}let r=new Map;for(let[i,a]of o){let s=0,c=0,l=0,u=0;for(let[m,f]of a){let d=be(n.get(m));d&&(s+=d[0]*f,c+=d[1]*f,l+=d[2]*f,u+=f)}u>0&&r.set(i,[s/u,c/u,l/u])}return r}function Tc(e,t){return be(e.color)??t.get(e.logicalSectionId??e.id)??null}var wi=dt(require("polygon-clipping"),1);var Si=dt(require("polygon-clipping"),1);var Fc=dt(require("earcut"),1);var _p=.58,Lc=.01,tt=St*1.5*et,Tp=.5,Lp=.6;function kp(e,t){let n=e.length,o=[];for(let a=0;a<n;a++){let s=e[Math.max(0,a-1)],c=e[Math.min(n-1,a+1)],l=c.x-s.x,u=c.y-s.y,m=Math.hypot(l,u);if(m<1e-9){o.push([0,0]);continue}l/=m,u/=m,o.push([-u,l])}let r=0;for(let a=0;a<n;a++)r+=(e[a].x-t.x)*o[a][0]+(e[a].y-t.y)*o[a][1];return r<0?o.map(([a,s])=>[-a,-s]):o}function Op(e,t){if(e.length<2||t<=0)return[...e];let n=[...e],o=(a,s)=>{let c=s.x-a.x,l=s.y-a.y,u=Math.hypot(c,l)||1;return{x:c/u,y:l/u}},r=o(n[1],n[0]),i=o(n[n.length-2],n[n.length-1]);return n.unshift({x:n[0].x+r.x*t,y:n[0].y+r.y*t}),n.push({x:n[n.length-1].x+i.x*t,y:n[n.length-1].y+i.y*t}),n}var kc=Math.PI/12;function Fp(e){if(e.length<3)return[...e];let t=[...e].sort((i,a)=>i.x-a.x||i.y-a.y),n=(i,a,s)=>(a.x-i.x)*(s.y-i.y)-(a.y-i.y)*(s.x-i.x),o=i=>{let a=[];for(let s of i){for(;a.length>=2&&n(a[a.length-2],a[a.length-1],s)<=0;)a.pop();a.push(s)}return a.pop(),a},r=[...o(t),...o([...t].reverse())];return r.length>=3?r:[...e]}function Dc(e,t){if(!e.length||!(t>0))return[];let n=Fp(e),o=(s,c,l,u)=>{let m=l-c;for(;m<0;)m+=Math.PI*2;for(;m>Math.PI*2;)m-=Math.PI*2;let f=Math.max(1,Math.ceil(m/kc)),d=t/Math.cos(m/f/2);for(let h=0;h<=f;h++){let p=c+m*h/f;u.push({x:s.x+Math.cos(p)*d,y:s.y+Math.sin(p)*d})}};if(n.length<3){let s=0,c=0;for(let d of n)s+=d.x,c+=d.y;s/=n.length||1,c/=n.length||1;let l=0;for(let d of n)l=Math.max(l,Math.hypot(d.x-s,d.y-c));let u=[],m=Math.max(3,Math.ceil(Math.PI*2/kc)),f=(l+t)/Math.cos(Math.PI/m);for(let d=0;d<m;d++){let h=d/m*Math.PI*2;u.push({x:s+Math.cos(h)*f,y:c+Math.sin(h)*f})}return u}let r=n.length,i=[];for(let s=0;s<r;s++){let c=n[s],l=n[(s+1)%r];i.push(Math.atan2(-(l.x-c.x),l.y-c.y))}let a=[];for(let s=0;s<r;s++)o(n[s],i[(s+r-1)%r],i[s],a);return Hc(a)}function Dp(e,t,n){if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u<0?u=0:u>1&&(u=1);let m=Math.hypot(t-(i.x+u*s),n-(i.y+u*c));m<o&&(o=m)}return o}function Wo(e){let t=e.map(r=>{let i=0,a=0;for(let l of r.pts)i+=l.x,a+=l.y;let s=r.pts.length||1;i/=s,a/=s;let c=0;for(let l of r.pts){let u=Math.hypot(l.x-i,l.y-a);u>c&&(c=u)}return{cx:i,cy:a,rad:c}}),n=r=>{let i=r.length;return i<=2?[...r]:[r[Math.floor(i*.25)],r[Math.floor(i*.5)],r[Math.floor(i*.75)]]},o=[];for(let r=0;r<e.length;r++){let i=n(e[r].pts),a=[],s=1/0,c=null;for(let u of i){let m=1/0;for(let f=0;f<e.length;f++){if(f===r||Math.abs(e[f].y-e[r].y)<.001)continue;let d=t[f],h=Math.hypot(u.x-d.cx,u.y-d.cy)-d.rad;if(h>=m&&h>=s)continue;let p=Dp(e[f].pts,u.x,u.y);p<m&&(m=p),e[f].depth<e[r].depth&&p<s&&(s=p,c=e[f].y)}Number.isFinite(m)&&m>0&&a.push(m)}a.sort((u,m)=>u-m);let l=a.length?a[Math.floor(a.length/2)]:1;o.push({pitch:l,belowY:c})}return o}function Nc(e,t,n,o){let r=e[t],i=r.pts.length>=2?[...r.pts]:r.pts.length===1?(()=>{let u=r.pts[0],m=u.x-o.x,f=u.y-o.y,d=Math.hypot(m,f)||1;m/=d,f/=d;let h=Math.max(n[t].pitch,.001)*.5;return[{x:u.x+f*h,y:u.y-m*h},{x:u.x-f*h,y:u.y+m*h}]})():[];if(i.length<2)return null;let a=0,s=0;for(let u=1;u<i.length;u++){let m=Math.hypot(i[u].x-i[u-1].x,i[u].y-i[u-1].y);m>1e-6&&(a+=m,s++)}let c=s>0?a/s:0,l=Op(i,Math.max(c*Lp,tt));return{pts:l,nrm:kp(l,o),front:Math.max(n[t].pitch*_p,tt),back:Math.max(n[t].pitch*Tp,tt)}}var xn=1.5,Bc=.3;function Mi(e,t){if(e.length<3)return e;let n=e[0],o=e[e.length-1],r=o.x-n.x,i=o.y-n.y,a=Math.hypot(r,i),s=-1,c=-1;for(let m=1;m<e.length-1;m++){let f=e[m],d=a>1e-12?Math.abs((f.x-n.x)*i-(f.y-n.y)*r)/a:Math.hypot(f.x-n.x,f.y-n.y);d>s&&(s=d,c=m)}if(s<=t||c<0)return[n,o];let l=Mi(e.slice(0,c+1),t),u=Mi(e.slice(c),t);return[...l.slice(0,-1),...u]}function Vc(e,t){if(e.length<4)return e;let n=Mi([...e,e[0]],t);return n.pop(),n.length>=3?n:e}function Np(e){let t=e.map((o,r)=>{let i=e[(r+1)%e.length];return{a:o,b:i,i:r,minX:Math.min(o.x,i.x),maxX:Math.max(o.x,i.x),minY:Math.min(o.y,i.y),maxY:Math.max(o.y,i.y)}}).sort((o,r)=>o.minX-r.minX),n=(o,r,i)=>(r.x-o.x)*(i.y-o.y)-(r.y-o.y)*(i.x-o.x);for(let o=0;o<t.length;o++){let r=t[o];for(let i=o+1;i<t.length&&t[i].minX<=r.maxX;i++){let a=t[i];if(!(Math.abs(r.i-a.i)===1||Math.abs(r.i-a.i)===e.length-1||r.maxY<a.minY||a.maxY<r.minY)&&n(r.a,r.b,a.a)*n(r.a,r.b,a.b)<=0&&n(a.a,a.b,r.a)*n(a.a,a.b,r.b)<=0)return!0}}return!1}function Gc(e,t,n){if(e.length<2)return[];let o=n??Wo(e),r=new Map;for(let a=0;a<e.length;a++){let s=r.get(e[a].blockId);s?s.push(a):r.set(e[a].blockId,[a])}let i=[];for(let[,a]of r){let s=[];for(let M of a){let v=e[M].patch;v&&v.length>=3?i.push({outline:[...v],holes:[],topY:e[M].y}):s.push(M)}if(!s.length)continue;s.sort((M,v)=>e[M].depth-e[v].depth);let l=s.map(M=>Nc(e,M,o,t)).filter(M=>M!==null);if(!l.length)continue;let u=(M,v)=>({x:M.pts[v].x-M.nrm[v][0]*(M.front+xn),y:M.pts[v].y-M.nrm[v][1]*(M.front+xn)}),m=(M,v)=>({x:M.pts[v].x+M.nrm[v][0]*(M.back+xn),y:M.pts[v].y+M.nrm[v][1]*(M.back+xn)}),f=l[0],d=l[l.length-1],h=[];for(let M=0;M<f.pts.length;M++)h.push(u(f,M));for(let M of l)h.push(m(M,M.pts.length-1));for(let M=d.pts.length-1;M>=0;M--)h.push(m(d,M));for(let M=l.length-1;M>=0;M--)h.push(u(l[M],0));let p=Hc(h),b=1/0;for(let M of s)e[M].y<b&&(b=e[M].y);if(!Number.isFinite(b))continue;if(p.length>=3&&Math.abs($e(p))>1e-6&&l.every(M=>{let v=M.pts[Math.floor(M.pts.length/2)];return Ze(p,v.x,v.y)})&&!Np(p)){i.push({outline:Vc(p,Bc),holes:[],topY:b});continue}for(let M of Bp(l))i.push({outline:M,holes:[],topY:b})}return i}function Bp(e){let t=[];for(let n of e){let o=[],r=[],i=n.front+xn,a=n.back+xn;for(let c=0;c<n.pts.length;c++){let l=n.pts[c],u=n.nrm[c];o.push([l.x-u[0]*i,l.y-u[1]*i]),r.push([l.x+u[0]*a,l.y+u[1]*a])}let s=[...o,...r.reverse()];s.length<3||(s.push(s[0]),t.push([s]))}if(!t.length)return[];try{let n=Si.default.union(t[0],...t.slice(1)),o=[];for(let r of n){if(!r.length||r[0].length<4)continue;let i=r[0].map(([c,l])=>({x:c,y:l})),a=i[0],s=i[i.length-1];i.length>1&&Math.abs(a.x-s.x)<1e-9&&Math.abs(a.y-s.y)<1e-9&&i.pop(),i.length>=3&&o.push(Vc(i,Bc))}return o}catch{return[]}}function Hc(e){let t=[];for(let n of e){let o=t[t.length-1];o&&Math.hypot(n.x-o.x,n.y-o.y)<1e-9||t.push(n)}for(;t.length>2&&Math.hypot(t[0].x-t[t.length-1].x,t[0].y-t[t.length-1].y)<1e-9;)t.pop();return t}var vi=class{constructor(t){this.minX=1/0;this.minY=1/0;this.maxX=-1/0;this.maxY=-1/0;this.rings=t;for(let n of t)for(let o of n)o.x<this.minX&&(this.minX=o.x),o.y<this.minY&&(this.minY=o.y),o.x>this.maxX&&(this.maxX=o.x),o.y>this.maxY&&(this.maxY=o.y)}containsAll(t){for(let n of t)if(n.x<this.minX||n.x>this.maxX||n.y<this.minY||n.y>this.maxY)return!1;for(let n of this.rings){let o=!0;for(let r of t)if(!Ze(n,r.x,r.y)){o=!1;break}if(o)return!0}return!1}};function Oc(e,t,n,o,r,i){if(o.length<3)return;if(n.containsAll(o)){let l=[0,1,0],u=o[0];for(let m=1;m+1<o.length;m++){let f=o[m],d=o[m+1];e.tri([u.x*C,r,u.y*C],[f.x*C,r,f.y*C],[d.x*C,r,d.y*C],l,i)}return}let a=o.map(l=>[l.x,l.y]);a.push(a[0]);let s;try{s=Si.default.intersection([a],t)}catch{return}let c=[0,1,0];for(let l of s){if(!l.length||l[0].length<4)continue;let u=l[0],m=[],f=[];for(let h=0;h<u.length-1;h++)m.push(u[h][0],u[h][1]),f.push([u[h][0],u[h][1]]);if(f.length<3)continue;let d=(0,Fc.default)(m,void 0,2);for(let h=0;h<d.length;h+=3){let p=f[d[h]],b=f[d[h+1]],y=f[d[h+2]];e.tri([p[0]*C,r,p[1]*C],[b[0]*C,r,b[1]*C],[y[0]*C,r,y[1]*C],c,i)}}}function zc(e,t,n,o,r,i,a){if(t.length<2)return;let s=a??Wo(t),c=[0,1,0],l=i&&i.length>=3?[[...i.map(d=>[d.x,d.y]),[i[0].x,i[0].y]]]:null,u=i&&i.length>=3?new vi([[...i]]):null,m=d=>{e.setMaterial(2),d(),e.setMaterial(0)},f=d=>{e.setMaterial(3),d(),e.setMaterial(0)};for(let d=0;d<t.length;d++){let h=t[d];if(h.patch&&h.patch.length>=3){let x=[...h.patch],g=s[d].belowY??o;if(f(()=>{if(l&&u)Oc(e,l,u,x,h.y,r.tread);else{let P=x[0];for(let S=1;S+1<x.length;S++){let w=x[S],E=x[S+1];e.tri([P.x*C,h.y,P.y*C],[w.x*C,h.y,w.y*C],[E.x*C,h.y,E.y*C],c,r.tread)}}}),h.y>g+Lc){let P=0,S=0;for(let w of x)P+=w.x,S+=w.y;P/=x.length,S/=x.length,m(()=>{for(let w=0;w<x.length;w++){let E=x[w],T=x[(w+1)%x.length],F=T.x-E.x,R=T.y-E.y,I=Math.hypot(F,R);if(I<1e-6)continue;let _=R/I,k=-F/I;(E.x-P)*_+(E.y-S)*k<0&&(_=-_,k=-k);let V=[_,0,k],O=[E.x*C,h.y,E.y*C],H=[T.x*C,h.y,T.y*C],U=[E.x*C,g,E.y*C],N=[T.x*C,g,T.y*C];e.tri(O,H,N,V,r.riser),e.tri(O,N,U,V,r.riser)}})}continue}let p=Nc(t,d,s,n);if(!p)continue;let{pts:b,nrm:y,front:M,back:v}=p,A=s[d].belowY??o;for(let x=0;x+1<b.length;x++){let g=b[x],P=b[x+1],S=y[x],w=y[x+1];if(Math.hypot(P.x-g.x,P.y-g.y)<1e-6||S[0]===0&&S[1]===0||w[0]===0&&w[1]===0)continue;let E=[(g.x-S[0]*M)*C,h.y,(g.y-S[1]*M)*C],T=[(P.x-w[0]*M)*C,h.y,(P.y-w[1]*M)*C],F=[(g.x+S[0]*v)*C,h.y,(g.y+S[1]*v)*C],R=[(P.x+w[0]*v)*C,h.y,(P.y+w[1]*v)*C];if(f(()=>{l&&u?Oc(e,l,u,[{x:g.x-S[0]*M,y:g.y-S[1]*M},{x:P.x-w[0]*M,y:P.y-w[1]*M},{x:P.x+w[0]*v,y:P.y+w[1]*v},{x:g.x+S[0]*v,y:g.y+S[1]*v}],h.y,r.tread):(e.tri(E,T,R,c,r.tread),e.tri(E,R,F,c,r.tread))}),h.y>A+Lc){let I=[E[0],A,E[2]],_=[T[0],A,T[2]],k=[-S[0],0,-S[1]];m(()=>{e.tri(E,T,_,k,r.riser),e.tri(E,_,I,k,r.riser)})}}}}function Vp(e,t){let n=e.eventConfigurationIds;return!n?.length||!!t&&n.includes(t)}function jc(e,t){return e.filter(n=>n.type!=="shape"||Vp(n,t))}function Uc(e,t){let n=e.focalPoint??{x:0,y:0};return e.floors?.length?e.floors.map((o,r)=>({objects:jc(o.objects,t),focal:{x:(o.focalPoint??n).x,y:(o.focalPoint??n).y},baseHeightM:o.baseHeightM??0,index:r})):[{objects:jc(e.objects,t),focal:n,baseHeightM:0,index:0}]}var Gp={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};function Pt(e){return mc(e)??Gp}function Wc(e,t){let n=st(e.outline,tt),o=Pt(n),r=t.filter(a=>a!==e&&a.outline&&a.outline.length>=3&&hn(o,Pt(a.outline)));if(!r.length)return[n];let i=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s};try{let a=wi.default.difference([i(n)],...r.map(c=>[i(c.outline)])),s=[];for(let c of a){if(!c.length)continue;let l=c[0].map(([u,m])=>({x:u,y:m}));if(l.length>1){let u=l[0],m=l[l.length-1];Math.abs(u.x-m.x)<1e-9&&Math.abs(u.y-m.y)<1e-9&&l.pop()}l.length>=3&&s.push(l)}return s.length?s:[n]}catch{return[n]}}function Xc(e,t){if(!t.length)return e;let n=i=>{let a=i.map(s=>[s.x,s.y]);return a.push(a[0]),a},o=t.map(i=>[n(i)]),r=[];for(let i of e){let a;try{a=wi.default.intersection([n(i.outline)],o.flat())}catch{r.push(i);continue}for(let s of a){if(!s.length)continue;let c=s[0].map(([l,u])=>({x:l,y:u}));if(c.length>1){let l=c[0],u=c[c.length-1];Math.abs(l.x-u.x)<1e-9&&Math.abs(l.y-u.y)<1e-9&&c.pop()}c.length>=3&&r.push({outline:c,holes:[],topY:i.topY})}}return r.length?r:e}function Hp(e,t){return e===void 0||t===void 0?!0:Math.abs(e-t)<.001}var Xo=class{constructor(){this.rings=[];this.boxes=[];this.levels=[]}subtract(t,n){let o=t.map(c=>[c.x,c.y]);if(o.length<3)return[];o.push(o[0]);let r=Pt(t),i=this.rings.filter((c,l)=>hn(r,this.boxes[l])&&Hp(n,this.levels[l])),a=[[o]];if(i.length)try{a=Yc.default.difference([o],...i).map(l=>l.map(u=>u.map(([m,f])=>[m,f])))}catch{a=[[o]]}this.rings.push([o]),this.boxes.push(r),this.levels.push(n);let s=[];for(let c of a){if(!c.length)continue;let l=c[0].map(([u,m])=>({x:u,y:m}));if(l.length>1){let u=l[0],m=l[l.length-1];Math.abs(u.x-m.x)<1e-9&&Math.abs(u.y-m.y)<1e-9&&l.pop()}l.length>=3&&s.push(l)}return s}};function Mn(e,t,n=e){if(!t)return e;let o=1/0,r=-1/0,i=1/0,a=-1/0;for(let f of n)o=Math.min(o,f.x),r=Math.max(r,f.x),i=Math.min(i,f.y),a=Math.max(a,f.y);let s=(o+r)/2,c=(i+a)/2,l=t*Math.PI/180,u=Math.cos(l),m=Math.sin(l);return e.map(f=>{let d=f.x-s,h=f.y-c;return{x:s+d*u-h*m,y:c+d*m+h*u}})}function Kc(e){let t=Hs(e);return!t.length||!e.points?.length?[]:t.map(n=>Mn(n,e.rotation,e.points))}function Me(e){let t=null;if(e.kind==="polygon"&&e.points&&e.points.length>=3)return Mn(No(e,4),e.rotation,e.points);if(e.kind==="rect"&&e.width&&e.height&&(t=Kn(e.x??0,e.y??0,e.width,e.height)),e.kind==="ellipse"&&e.width&&e.height){let n=(e.x??0)+e.width/2,o=(e.y??0)+e.height/2;t=ko(n,o,e.width/2,e.height/2)}return t?Mn(t,e.rotation):null}function lt(e){let t=e.role??"",o=t==="stage"?{kind:"stage",heightM:Ls(e.stageKind)}:{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}}[t]??{kind:"plate",heightM:.25};return{...o,heightM:e.heightM??o.heightM}}var zp=.08,jp=30,Up=.015;function Wp(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function $c(e,t){let n=Me(e)??(e.points?.length?Mn(e.points,e.rotation):null),o=lt(e),i=!e.role&&o.kind==="plate"&&e.heightM===void 0&&!!n&&Math.abs($e(n))*fe**2>=jp?Up:o.heightM;if(!n)return{topOffsetM:i,supportOffsetM:0};if(o.kind!=="plate"&&o.kind!=="stage")return{topOffsetM:i,supportOffsetM:0};let a=1/0,s=1/0,c=-1/0,l=-1/0;for(let d of n)a=Math.min(a,d.x),s=Math.min(s,d.y),c=Math.max(c,d.x),l=Math.max(l,d.y);let u=i,m=0,f=1e-6*Math.max(1,c-a,l-s);for(let d of t)c>d.minX&&a<d.maxX&&l>d.minY&&s<d.maxY&&u<=d.topOffsetM+1e-6&&(u=d.topOffsetM+zp),a>=d.minX-f&&c<=d.maxX+f&&s>=d.minY-f&&l<=d.maxY+f&&(!d.poly||n.every(b=>Wp(b,d.poly)||Xp(b,d.poly,f)))&&(m=Math.max(m,d.topOffsetM));return e.fill&&e.fill!=="none"&&e.fill!=="transparent"&&t.push({minX:a,minY:s,maxX:c,maxY:l,topOffsetM:u,poly:n}),{topOffsetM:u,supportOffsetM:Math.min(m,u)}}function Xp(e,t,n){for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[r],a=t[o],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l?Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l)):0;if(Math.hypot(e.x-(i.x+u*s),e.y-(i.y+u*c))<=n)return!0}return!1}function Lt(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function qe(e){if(e.length!==4)return e;let t=Math.hypot(e[1].x-e[0].x,e[1].y-e[0].y),n=Math.hypot(e[2].x-e[1].x,e[2].y-e[1].y);return t>=n?e:[e[1],e[2],e[3],e[0]]}function je(e,t,n){return[Lt(e[0],e[1],t),Lt(e[0],e[1],n),Lt(e[3],e[2],n),Lt(e[3],e[2],t)]}function ro(e,t,n){return[Lt(e[0],e[3],t),Lt(e[1],e[2],t),Lt(e[1],e[2],n),Lt(e[0],e[3],n)]}function pe(e,t,n,o,r,i,a){ue(e,t,a?.length?a:void 0,()=>n,o,r,i,ae)}var Yp=.8,Kp=.6,$p=2;function kt(e,t){if(!t.length)return null;let n=[],o=0;for(let a of e.objects){if(a.type!=="shape"||a.role!=="wall")continue;let s=Me(a)??[],c=Zc(s)/2;!(c>0)||Qp(s)/c*C>$p||(n.push(...s),o+=c)}if(n.length<3)return null;let r=oo(n);if(r.length<3||o<Zc(r)*Kp)return null;let i=0;for(let a of t)Jp(a,r)&&(i+=1);return i>=t.length*Yp?r:null}var Yo=6,Zp=5,qp=8;function qc(e){return Math.max(qp,(Number.isFinite(e)?e:0)+Zp)}function vn(e){let t=0,n=0,o=0;for(let r=0;r<e.length;r++){let i=e[r],a=e[(r+1)%e.length],s=i.x*a.y-a.x*i.y;t+=s,n+=(i.x+a.x)*s,o+=(i.y+a.y)*s}if(Math.abs(t)<1e-9){let r=0,i=0;for(let a of e)r+=a.x,i+=a.y;return{x:r/Math.max(1,e.length),y:i/Math.max(1,e.length)}}return{x:n/(3*t),y:o/(3*t)}}function Qp(e){let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return Math.abs(t)/2}function Zc(e){let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=Math.hypot(r.x-o.x,r.y-o.y)}return t}function Jp(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function eb(e){return{kind:"radial",rowCount:0,rows:[],nearestRow:()=>-1,depthAt:(t,n)=>Math.hypot(t-e.x,n-e.y),gradientAt:(t,n)=>{let o=t-e.x,r=n-e.y,i=Math.hypot(o,r);return i<1e-9?[0,0]:[o/i,r/i]}}}function tb(e,t){if(!e.length)return null;let n=0,o=0,r=0;for(let d of e)n+=d.x,o+=d.y,r+=Math.hypot(d.x-t.x,d.y-t.y);let i=e.length;n/=i,o/=i,r/=i;let a=e[0],s=-1;for(let d of e){let h=Math.hypot(d.x-n,d.y-o);h>s&&(s=h,a=d)}let c=a.x-n,l=a.y-o,u=Math.hypot(c,l);u>1e-9?(c/=u,l/=u):(c=1,l=0);let m=[...e].sort((d,h)=>(d.x-n)*c+(d.y-o)*l-((h.x-n)*c+(h.y-o)*l)),f=0;for(let d of m){let h=Math.hypot(d.x-n,d.y-o);h>f&&(f=h)}return{pts:m,cx:n,cy:o,radius:f,depth:r}}function Qc(e,t,n){let o=e.pts;if(o.length===1)return Math.hypot(t-o[0].x,n-o[0].y);let r=1/0;for(let i=0;i+1<o.length;i++){let a=o[i],s=o[i+1],c=s.x-a.x,l=s.y-a.y,u=c*c+l*l,m=u>1e-12?((t-a.x)*c+(n-a.y)*l)/u:0;m<0?m=0:m>1&&(m=1);let f=Math.hypot(t-(a.x+m*c),n-(a.y+m*l));f<r&&(r=f)}return r}var Ko=8;function nb(e,t,n){let o=new Array(Ko).fill(1/0),r=new Array(Ko).fill(-1);for(let u=0;u<e.length;u++){let m=e[u],f=Math.hypot(t-m.cx,n-m.cy)-m.radius;for(let d=0;d<Ko;d++)if(f<o[d]){for(let h=Ko-1;h>d;h--)o[h]=o[h-1],r[h]=r[h-1];o[d]=f,r[d]=u;break}}let i=new Array(3).fill(1/0),a=new Array(3).fill(-1);for(let u of r){if(u<0)continue;let m=Qc(e[u],t,n);for(let f=0;f<3;f++)if(m<i[f]){for(let d=2;d>f;d--)i[d]=i[d-1],a[d]=a[d-1];i[f]=m,a[f]=u;break}}if(a[0]<0)return 0;if(i[0]<1e-6)return e[a[0]].depth;let s=i[0]*2.2,c=0,l=0;for(let u=0;u<3;u++){let m=a[u];if(m<0||i[u]>s)continue;let f=1/(i[u]*i[u]);c+=f*e[m].depth,l+=f}return l>0?c/l:e[a[0]].depth}function ob(e){let t=(o,r)=>nb(e,o,r),n=(o,r)=>{let i=1/0,a=-1;for(let s=0;s<e.length;s++){let c=e[s];if(Math.hypot(o-c.cx,r-c.cy)-c.radius>=i)continue;let l=Qc(c,o,r);l<i&&(i=l,a=s)}return a};return{kind:"rows",rowCount:e.length,rows:e,nearestRow:n,depthAt:t,gradientAt:(o,r)=>{let i=(t(o+.5,r)-t(o-.5,r))/1,a=(t(o,r+.5)-t(o,r-.5))/(2*.5),s=Math.hypot(i,a);return s<1e-9?[0,0]:[i/s,a/s]}}}function Jc(e,t){let n=[];for(let o of e){let r=tb(o.points,t);r&&n.push(r)}return n.length<2?eb(t):(n.sort((o,r)=>o.depth-r.depth),ob(n))}var Ot=.06,rb=.05,tl=.05,el=.15,Pi=25;function nl(e,t,n){let o=new Map,r=new Array(t.length).fill(null),i=new Float64Array(t.length),a=new Array(t.length).fill(void 0),s=new Array(t.length).fill(void 0),c=new Map,l=[],u=new Set;for(let f=0;f<e.length;f+=1){let d=e[f];for(let h of d.objects){if(h.type==="table"&&u.add(h.id),h.type!=="section"||!h.outline||h.outline.length<3)continue;let p=st(h.outline,tt);c.set(h.id,{section:h,unit:d,frontU:1/0,hasSeats:!1,rows:new Map,seatIndices:[]}),l.push({id:h.id,floorIndex:f,box:Pt(p),section:h,unit:d,outline:p})}}let m=new Map;for(let f of l){let d=m.get(f.floorIndex);d?d.push(f):m.set(f.floorIndex,[f])}for(let f=0;f<t.length;f++){let d=t[f],h=n?m.get(n[f])??[]:l,p=d.sectionId?h.find(y=>y.id===d.sectionId)??h.find(y=>y.section.logicalSectionId===d.sectionId&&ze({x:d.x,y:d.y},y.outline,y.section.holes)):void 0,b=p?[p]:h;for(let y of b){if(n&&y.floorIndex!==n[f]||!p&&(d.x<y.box.minX||d.x>y.box.maxX||d.y<y.box.minY||d.y>y.box.maxY||!ze({x:d.x,y:d.y},y.outline,y.section.holes)))continue;r[f]=y.id;let M=c.get(y.id);M.hasSeats=!0;let v=d.focalPoint??y.unit.focal,A=Math.hypot(d.x-v.x,d.y-v.y);A<M.frontU&&(M.frontU=A),M.seatIndices.push(f);let x=d.rowId||`__seat-${f}`,g=M.rows.get(x);g?g.push({x:d.x,y:d.y}):M.rows.set(x,[{x:d.x,y:d.y}]);break}}for(let[f,d]of c){let h=Ct(d.section,{floorBaseHeightM:d.unit.baseHeightM}),p=d.unit.baseHeightM,b=h.rake>0?Math.tan(h.rake*Math.PI/180):0,y=h.rake<=.01&&h.height<=p+.001,M=d.section.surfaceKind,v=M==="flat"?!0:M==="rakedRows"&&h.rake>.01?!1:y,A=d.hasSeats?Bo(f,t,d.seatIndices,d.unit.focal):{sectionId:f,rows:[],blockCount:0},g=A.rows.length<2?Jc([...d.rows.values()].map(O=>({points:O})),d.unit.focal):null,P=1/0;if(g){if(d.hasSeats)for(let O of d.rows.values())for(let H of O){let U=g.depthAt(H.x,H.y);U<P&&(P=U)}if(!d.hasSeats||!Number.isFinite(P)){P=1/0;for(let O of d.section.outline){let H=g.depthAt(O.x,O.y);H<P&&(P=H)}}}let S=p+rb,w=Math.max(S,h.height),E=O=>{let H=Math.max(0,O-P)*fe,U=Math.min(H*b,Pi);return Math.max(S,h.height+U)},T=O=>{let H=Math.max(0,O)*fe,U=Math.min(H*b,Pi);return Math.max(S,h.height+U)},F=v?[]:A.rows.map(O=>({pts:O.pts,y:T(O.blockDepth),depth:O.blockDepth,blockId:O.blockId,...u.has(O.id)?{patch:Dc(O.pts,tt)}:{}})),R=F.length?F[0].y:w,I=F.map(O=>{let H=O.patch&&O.patch.length>=3?O.patch:O.pts,U=0,N=0;for(let D of H)U+=D.x,N+=D.y;let L=H.length||1;U/=L,N/=L;let B=0;for(let D of H){let G=Math.hypot(D.x-U,D.y-N);G>B&&(B=G)}return{cx:U,cy:N,rad:B}}),_=v?()=>w:F.length>=2?(O,H)=>{let U=1/0,N=R;for(let L=0;L<F.length;L++){let B=I[L];if(Math.hypot(O-B.cx,H-B.cy)-B.rad>=U)continue;let D=F[L].patch,G=D&&D.length>=3?Ze(D,O,H)?0:mn(D,O,H):mn(F[L].pts,O,H);G<U&&(U=G,N=F[L].y)}return N}:(O,H)=>g?E(g.depthAt(O,H)):w,k=[0,1,0],V=F.length>=2||v?()=>k:(O,H)=>{if(!g)return k;let U=g.depthAt(O,H);if(U<=P)return k;let N=(U-P)*fe;if(N*b>=Pi||h.height+N*b<=S)return k;let[L,B]=g.gradientAt(O,H);if(L===0&&B===0)return k;let D=1/Math.hypot(b,1);return[-L*b*D,D,-B*b*D]};if(!v)for(let O of A.rows){let H=T(O.blockDepth);for(let U of O.seatIndices)a[U]=H}for(let O of A.rows){let H=[];for(let D=1;D<O.pts.length;D++){let G=Math.hypot(O.pts[D].x-O.pts[D-1].x,O.pts[D].y-O.pts[D-1].y);G>1e-6&&H.push(G)}H.sort((D,G)=>D-G);let U=H.length?H[Math.floor(H.length/2)]:1/0,N=1/0,L=O.pts[Math.floor(O.pts.length/2)];if(L)for(let D of A.rows){if(D===O||D.blockId!==O.blockId)continue;let G=mn(D.pts,L.x,L.y);G>1e-6&&G<N&&(N=G)}let B=Math.min(U,Math.max(N,U*.5));if(Number.isFinite(B)&&B>0)for(let D of O.seatIndices)s[D]=B}o.set(f,{sectionId:f,deckAt:_,normalAt:V,flat:v,bottomY:p,rowLevels:F,landingY:R})}for(let f=0;f<t.length;f++){let d=r[f],h=t[f];if(d){let y=a[f];i[f]=(y??o.get(d).deckAt(h.x,h.y))+el;continue}let p=h.eyeHeightM,b=Number.isFinite(p)?Math.max(0,p-ht):0;i[f]=h.kind==="booth"?b+Ot+el:b}return{bySection:o,seatOwner:r,seatDeckY:f=>i[f],seatPitchU:f=>s[f]}}function Sn(e,t,n){if(e.length!==4||n<=t)return null;let o=qe(e),r=Math.hypot(o[1].x-o[0].x,o[1].y-o[0].y)*C,i=Math.hypot(o[3].x-o[0].x,o[3].y-o[0].y)*C;if(r<1e-6||i<1e-6)return null;let a=Math.min(.22/r,.16),s=Math.min(.28,(n-t)*.13),c=Math.min(.065/i,.2);return{quad:o,side:a,face:c,opening:je(o,a,1-a),openingTop:n-s}}function Ai(e,t,n){if(e.length!==4||n-t<=.2)return null;let o=qe(e),r=Math.hypot(o[1].x-o[0].x,o[1].y-o[0].y)*C;if(r<=1e-6)return null;let i=Math.min(.14,(n-t)*.08,r*.08),a=i/r,s=je(o,a,1-a);return{quad:o,side:a,trim:i,inner:s,panel:ro(s,.15,.85),bottom:t+i,top:n-i}}function ol(e,t,n,o){let r=Ai(e,t,n);if(!r)return;let{panel:i}=r,a=(M,v)=>({x:(M.x+v.x)/2,y:(M.y+v.y)/2}),s=a(i[0],i[1]),c=a(i[3],i[2]),l=Math.hypot(s.x-o.x,s.y-o.y)<=Math.hypot(c.x-o.x,c.y-o.y),[u,m]=l?[i[0],i[1]]:[i[3],i[2]],f=l?{x:s.x-c.x,y:s.y-c.y}:{x:c.x-s.x,y:c.y-s.y},d=Math.hypot(f.x,f.y);if(d<1e-6)return;-(m.y-u.y)*f.x+(m.x-u.x)*f.y<0&&([u,m]=[m,u]);let h=Math.min(.006,d*C*.05),p=f.x/d*h,b=f.y/d*h,y=(M,v)=>[M.x*C+p,v,M.y*C+b];return[y(u,r.bottom),y(m,r.bottom),y(u,r.top),y(m,r.top)]}var il=dt(require("polygon-clipping"),1);var rl=dt(require("polygon-clipping"),1);function At(e,t,n,o,r,i,a,s={}){let c=Pt(t),l=s.ao??ae,u=r.flatMap(p=>{if(p.role!=="entrance"&&p.role!=="exit")return[];let b=Me(p);if(!b||b.length!==4||!hn(c,Pt(b)))return[];let y=s.portalBase??n,M=Sn(b,y,y+lt(p).heightM);if(!M)return[];let v=Math.min(o,M.openingTop);return v<=n?[]:[{poly:M.opening,height:v}]});if(!u.length)return!1;let m=p=>p.map(b=>[b.x,b.y]),f=[m(t),...(s.holes??[]).map(m)],d=[n,...new Set(u.map(p=>p.height)),o].sort((p,b)=>p-b),h=[];try{for(let p=1;p<d.length;p++){let b=d[p-1],y=d[p];if(y-b<1e-6)continue;let M=u.filter(A=>A.height>b+1e-6).map(A=>[m(A.poly)]),v=M.length?rl.default.difference(f,...M):[f];h.push({low:b,high:y,polys:v})}}catch{return!1}for(let p of h)for(let b of p.polys){let[y,...M]=b.map(A=>A.map(([x,g])=>({x,y:g}))),v=A=>l.wallBottom+(l.top-l.wallBottom)*(A-n)/(o-n);ue(e,y,M,()=>p.high,p.low,i,a,{...l,top:v(p.high),wallBottom:v(p.low)})}return!0}var Ii={depthM:1.6,thicknessM:.35,minWallM:6};function $o(e,t,n,o,r,i,a,s,c){let l=o-n;if(l<=0)return;let u=s&&(c??l)>=Ii.minWallM?ib(t,s):null,m=u?o-Ii.thicknessM:o,f=m-n,d=f<1.5?[[n,m,1]]:u?[[n,n+Math.min(.9,f*.18),.82],[n+Math.min(.9,f*.18),m,1]]:[[n,n+Math.min(.9,f*.18),.82],[n+Math.min(.9,f*.18),m-.1,1],[m-.1,m,1.1]],h=p=>ae.wallBottom+(ae.top-ae.wallBottom)*(p-n)/l;for(let[p,b,y]of d){let M={...ae,top:h(b),wallBottom:h(p)},v=le(i,y),A=le(a,y);At(e,t,p,b,r,v,A,{portalBase:n,ao:M})||ue(e,t,void 0,()=>b,p,v,A,M)}for(let[p,...b]of u??[])ue(e,p,b.length?b:void 0,()=>o,m,le(i,1.12),le(a,.78),ae)}function ib(e,t){let n=Ii.depthM/C,o=e.map(a=>{let s=t.x-a.x,c=t.y-a.y,l=Math.hypot(s,c)||1;return{x:a.x+s/l*n,y:a.y+c/l*n}}),r=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s},i=[[r(e)],[r(o)]];for(let a=0;a<e.length;a++){let s=(a+1)%e.length;i.push([r([e[a],e[s],o[s],o[a]])])}try{let[a,...s]=i,c=il.default.union(a,...s);return c.length?c.map(l=>l.map(u=>u.slice(0,-1).map(([m,f])=>({x:m,y:f})))):null}catch{return null}}function al(e){return e.route?.stepFree===!0&&(e.kind==="line"||e.kind==="polyline")}function sl(e){let t=Number.isFinite(e)&&e>0?e:4;return[Math.max(6,t*2.6),Math.max(4,t*1.7)]}function cl(e,t,n){let o=[];if(e.length<2||!(t>0)||!(n>=0))return o;let r=!0,i=t;for(let a=0;a<e.length-1;a+=1){let s=e[a],c=e[a+1],l=Math.hypot(c.x-s.x,c.y-s.y);if(l<1e-9)continue;let u=(c.x-s.x)/l,m=(c.y-s.y)/l,f=0;for(;f<l-1e-9;){let d=Math.min(i,l-f);r&&o.push([{x:s.x+u*f,y:s.y+m*f},{x:s.x+u*(f+d),y:s.y+m*(f+d)}]),f+=d,i-=d,i<=1e-9&&(r=!r,i=r?t:n)}}return o}function io(e,t,n){let o=be(t.stroke?.color),r=t.stroke?.width??0;if(!o||!Number.isFinite(r)||r<=0)return;let i=t.kind==="line"||t.kind==="polyline",a=i?Mn(t.points??[],t.rotation):Me(t);if(!a||a.length<2)return;let s=r*.5,c=al(t)?cl(a,...sl(r)):Array.from({length:i?a.length-1:a.length},(l,u)=>[a[u],a[(u+1)%a.length]]);for(let[l,u]of c){let m=Math.hypot(u.x-l.x,u.y-l.y);if(m<1e-6)continue;let f=-(u.y-l.y)/m*s,d=(u.x-l.x)/m*s,h=[(l.x+f)*C,n,(l.y+d)*C],p=[(u.x+f)*C,n,(u.y+d)*C],b=[(u.x-f)*C,n,(u.y-d)*C],y=[(l.x-f)*C,n,(l.y-d)*C];e.tri(h,p,b,[0,1,0],o),e.tri(h,b,y,[0,1,0],o)}}function ll(e){return e==="bar"||e==="concession"||e==="coat"||e==="restroom"}var wn=(e,t,n)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n});function Zo(e,t,n,o){let[r,i,a,s]=t?e:[e[3],e[2],e[1],e[0]];return[wn(r,s,n),wn(i,a,n),wn(i,a,o),wn(r,s,o)]}function ul(e,t,n,o,r,i,a,s,c=!1){if(n.length!==4||r-o<.4)return!1;let l=S=>c?Math.min(S,r):S,u=qe(n),m=Math.hypot(u[3].x-u[0].x,u[3].y-u[0].y)*C;if(m<.4)return!1;let f=wn(u[0],u[1],.5),d=wn(u[3],u[2],.5),h=Math.hypot(f.x-s.x,f.y-s.y)<=Math.hypot(d.x-s.x,d.y-s.y),p=ge(a,[.92,.9,.86],.35),b=le(i,.72),y=r-o;if(t==="restroom"){let S=Math.min(.18,y*.08);return pe(e,u,r-S,o,a,i),pe(e,u,r,r-S,p,p),!0}let M=o+Math.min(1.1,y),v=t==="coat"?1:Math.min(.5,.75/m),A=Zo(u,h,0,v);if(pe(e,A,M-.05,o,b,i),pe(e,A,M,M-.05,p,p),t==="coat"||m<1.2)return!0;if(t==="bar"){let S=Zo(u,h,Math.max(v+.2,1-.45/m),1),w=l(o+Math.max(Math.min(2.2,y*2),M-o+.6));return pe(e,S,w,o,a,b),!0}let x=Zo(u,h,Math.max(v+.25,.55),1),g=l(o+Math.max(2.6,M-o+1.4));if(g-.14<=M)return!0;pe(e,x,g-.14,o,a,i),pe(e,u,g,g-.14,p,b);let P=Math.min(.08,.1/Math.max(.1,Math.hypot(u[1].x-u[0].x,u[1].y-u[0].y)*C));for(let[S,w]of[[0,P],[1-P,1]])pe(e,Zo(je(u,S,w),h,0,Math.min(.08,.1/m)),g-.14,M,b,b);return!0}var ab=[.12,.38,.16],sb=[.72,.62,.45],cb=[.88,.93,.96],ml=[.95,.95,.94],lb=[.66,.29,.22],Ei={length:20.12,width:3.05},ub=.14,mb=9.76,It=[.93,.94,.95],qo=[.1,.11,.13],fb=[.45,.85,1.25],db=1.45,fl=.012,dl=.004,hb=1.07,pb=.15;function An(e,t,n,o,r,i){e.setMaterial(i),ue(e,t,n?[n.slice().reverse()]:void 0,()=>o,o-.004,r,r,ae)}var hl=(e,t)=>_t(e,t/C);function pl(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<1e-9)return null;let a=-r/i*n,s=o/i*n;return[{x:e.x+a,y:e.y+s},{x:t.x+a,y:t.y+s},{x:t.x-a,y:t.y-s},{x:e.x-a,y:e.y-s}]}function bb(e,t,n,o){let r=t.map(i=>[i.x*C,n,i.y*C]);e.tri(r[0],r[1],r[2],[0,1,0],o),e.tri(r[0],r[2],r[3],[0,1,0],o)}function Qo(e,t,n,o,r,i){let a=n/C,s=[{x:t.x-a,y:t.y-a},{x:t.x+a,y:t.y-a},{x:t.x+a,y:t.y+a},{x:t.x-a,y:t.y+a}];ue(e,s,void 0,()=>r,o,i,le(i,.85),ae)}function Pn(e,t,n,o,r,i,a){let s=pl(t,n,o/C);s&&ue(e,s,void 0,()=>i,r,a,le(a,.85),ae)}function Jo(e){let t=qe(e),n={x:(t[0].x+t[2].x)/2,y:(t[0].y+t[2].y)/2},o=Math.hypot(t[1].x-t[0].x,t[1].y-t[0].y)||1,r=Math.hypot(t[3].x-t[0].x,t[3].y-t[0].y)||1,i={x:(t[1].x-t[0].x)/o,y:(t[1].y-t[0].y)/o},a={x:(t[3].x-t[0].x)/r,y:(t[3].y-t[0].y)/r};return{at:(c,l)=>({x:n.x+(i.x*c+a.x*l)/C,y:n.y+(i.y*c+a.y*l)/C}),lengthM:o*C,widthM:r*C}}function bl(e,t,n){let o=ks(t);if(!o.length)return;let r=1/0,i=-1/0,a=1/0,s=-1/0;for(let v of t.points??[])r=Math.min(r,v.x),i=Math.max(i,v.x),a=Math.min(a,v.y),s=Math.max(s,v.y);let c=(t.rotation??0)*Math.PI/180,l=Math.cos(c),u=Math.sin(c),m=(r+i)/2,f=(a+s)/2,d=v=>c?{x:m+(v.x-m)*l-(v.y-f)*u,y:f+(v.x-m)*u+(v.y-f)*l}:v,h=Math.min(i-r,s-a)*C,p=Math.max(.04,Math.min(.3,h*.004))/C,b=0;e.setMaterial(0);for(let v of o){if(!v.fill)continue;let A=v.points.map(d);An(e,A,null,n+fl+b*dl,be(v.fill)??It,0),b++}let y=o.filter(v=>!(v.fill&&v.ink===v.fill)),M=[...new Set(y.map(v=>v.ink??Fo))];for(let v of M){let A=n+fl+b++*dl,x=be(v)??It;for(let g of y){if((g.ink??Fo)!==v)continue;let P=g.points.map(d),S=g.closed?P.length:P.length-1;for(let w=0;w<S;w++){let E=pl(P[w],P[(w+1)%P.length],p);E&&bb(e,E,A,x)}}}}function yl(e,t,n,o,r){if(t.length<3)return!1;let i=o+.006,a=r??ab;if(n==="oval-cricket"){let s=t.reduce((x,g)=>x+g.x,0)/t.length,c=t.reduce((x,g)=>x+g.y,0)/t.length,l=x=>t.map(g=>({x:s+(g.x-s)*x,y:c+(g.y-c)*x})),u=8;for(let x=0;x<u;x++){let g=l(1-x/u),P=x===u-1?null:l(1-(x+1)/u);An(e,g,P,i,le(a,x%2?1.04:.96),4)}let m=t[0];for(let x of t)Math.hypot(x.x-s,x.y-c)>Math.hypot(m.x-s,m.y-c)&&(m=x);let f=Math.hypot(m.x-s,m.y-c)||1,d=(m.x-s)/f,h=(m.y-c)/f,p=-h,b=d,y=Math.min(1,2*f*C*ub/Ei.length),M=Ei.length*y/2/C,v=Ei.width*y/2/C,A=[[-M,-v],[M,-v],[M,v],[-M,v]].map(([x,g])=>({x:s+d*x+p*g,y:c+h*x+b*g}));return An(e,A,null,i+.004,sb,0),e.setMaterial(0),!0}if(n==="rink-hockey"){let s=hl(t,pb);return An(e,s,null,i,cb,0),e.setMaterial(0),ue(e,t,[s.slice().reverse()],()=>o+hb,o,ml,le(ml,.9),ae),!0}if(n==="ring-boxing"&&t.length===4){let{at:s}=Jo(t),c=[s(-3.05,-3.05),s(3.05,-3.05),s(3.05,3.05),s(-3.05,3.05)],l=[[.77,.19,.19],It,[.17,.42,.69],It];e.setMaterial(0),c.forEach((u,m)=>Qo(e,u,.07,o,o+db,l[m]));for(let u of fb)for(let m=0;m<4;m++)Pn(e,c[m],c[(m+1)%4],.025,o+u-.025,o+u+.025,It);return!0}if(n==="court-tennis"&&t.length===4){let{at:s}=Jo(t);e.setMaterial(0),Pn(e,s(0,-6.4),s(0,6.4),.015,o,o+.95,qo),Pn(e,s(0,-6.4),s(0,6.4),.03,o+.95,o+1,It);for(let c of[-1,1])Qo(e,s(0,c*6.4),.05,o,o+1.07,qo);return!0}if(n==="court-basketball"&&t.length===4){let{at:s,lengthM:c}=Jo(t),l=Math.min(14,c/2-.5);e.setMaterial(0);for(let u of[-1,1]){let m=s(u*(l+1.2),0),f=s(u*(l-1.2),0);Qo(e,m,.12,o,o+3.4,qo),Pn(e,m,f,.06,o+3.25,o+3.4,qo),Pn(e,s(u*(l-1.2),-.9),s(u*(l-1.2),.9),.03,o+2.9,o+3.95,It)}return!0}if(n==="pitch-rugby"&&t.length===4){let{at:s,lengthM:c}=Jo(t),l=c*(50/120);e.setMaterial(0);for(let u of[-1,1]){for(let m of[-2.8,2.8])Qo(e,s(u*l,m),.07,o,o+12,It);Pn(e,s(u*l,-2.8),s(u*l,2.8),.06,o+2.94,o+3.06,It)}return!0}if(n==="track-athletics"){let s=hl(t,mb);return s.length<3?!1:(An(e,t,s,i,lb,0),An(e,s,null,i,a,4),e.setMaterial(0),!0)}return!1}var gl=[.19,.4,.15],yb=.012,or=2.4,gb=1,xb=.75,Mb=.15;function ut(e){if(e.points&&e.points.length>=3)return e.points;let{center:t,width:n,height:o,rotation:r}=e;if(!n||!o)return null;let i=(r??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=n/2,l=o/2;return[[-c,-l],[c,-l],[c,l],[-c,l]].map(([u,m])=>({x:t.x+u*a-m*s,y:t.y+u*s+m*a}))}function Pl(e,t,n,o,r,i,a=!1){let s=ut(t);if(s){if(a){let c=qt(o,r.boothTop),l=pt([...s]);ue(e,st(l,vb/C),[l.slice().reverse()],()=>n+.03,n,c,le(c,.8),ae);return}if(!(!t.points&&i&&wb(e,s,n,o,i))){if(!t.points&&i&&s.length===4){Sb(e,s,n,o,i);return}ue(e,s,void 0,()=>n+or,n,qt(o,r.boothTop),r.boothWall,ae)}}}var Ri=1.1,xl=[.9,.9,.88],vb=.1,er=[.87,.87,.85],Ml=.08;function Al(e,t){let n=c=>({x:(e[c].x+e[(c+1)%4].x)/2,y:(e[c].y+e[(c+1)%4].y)/2}),o=0,r=1/0;for(let c=0;c<4;c++){let l=n(c),u=Math.hypot(l.x-t.x,l.y-t.y);u<r&&(r=u,o=c)}let i=[0,1,2,3].map(c=>e[(o+c)%4]),a=(c,l,u)=>({x:c.x+(l.x-c.x)*u,y:c.y+(l.y-c.y)*u});return{q:i,part:(c,l,u,m)=>{let f=a(i[0],i[1],c),d=a(i[0],i[1],l),h=a(i[3],i[2],c),p=a(i[3],i[2],l);return[a(f,h,u),a(d,p,u),a(d,p,m),a(f,h,m)]},depthM:Math.hypot(i[3].x-i[0].x,i[3].y-i[0].y)*C,widthM:Math.hypot(i[1].x-i[0].x,i[1].y-i[0].y)*C}}function Sb(e,t,n,o,r){let{q:i,part:a}=Al(t,r),s=o??[.35,.42,.55],c=ge(s,[.78,.78,.77],.62),l=ge(s,[.95,.95,.94],.45);pe(e,i,n+Ot,n,c,le(c,.8)),pe(e,a(.05,.95,.72,.98),n+Ri-.05,n+Ot,l,le(l,.8)),pe(e,a(.03,.97,.7,1),n+Ri,n+Ri-.05,xl,le(xl,.9))}function wb(e,t,n,o,r){if(t.length!==4)return!1;let{q:i,part:a,depthM:s,widthM:c}=Al(t,r);if(s<1||c<1)return!1;let l=o??[.35,.42,.55],u=ge(l,[.78,.78,.77],.62),m=n+or,f=Ml/c,d=Ml/s;pe(e,i,n+Ot,n,u,le(u,.8)),pe(e,a(0,1,1-d,1),m,n+Ot,er,le(er,.9));for(let[b,y]of[[0,f],[1-f,1]])pe(e,a(b,y,0,1-d),m,n+Ot,er,le(er,.9));pe(e,a(f,1-f,0,Math.min(.5,.06/s)),m,m-.3,l,le(l,.85));let h=Math.min(.4,.6/c),p=Math.min(.12,.3/s);return pe(e,a(.5-h,.5+h,.72-p,.72+p),n+gb,n+Ot,ge(l,[.95,.95,.94],.7),le(l,.75)),!0}function rr(e){if(e.shape==="round"){let u=e.radius;return u?ko(e.center.x,e.center.y,u,u,24):null}let{width:t,height:n,rotation:o,center:r}=e;if(!t||!n)return null;let i=(o??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=t/2,l=n/2;return[[-c,-l],[c,-l],[c,l],[-c,l]].map(([u,m])=>({x:r.x+u*a-m*s,y:r.y+u*s+m*a}))}function Il(e,t,n,o,r,i=!0){let a=rr(t);if(!a)return;let s=a.reduce((f,d)=>f+d.x,0)/a.length,c=a.reduce((f,d)=>f+d.y,0)/a.length,l=f=>a.map(d=>({x:s+(d.x-s)*f,y:c+(d.y-c)*f})),u=i&&o?qt(o,r.tableTop):Pb,m=n+xb;ue(e,a,void 0,()=>m,n+Ab,u,le(u,.86),ae),ue(e,l(.12),void 0,()=>m+.12,m,vl,le(vl,.8),ae)}var Pb=[.93,.92,.89],vl=[.78,.66,.42],Ab=.25,ao={armM:1.1,widthM:.28,insideM:1.4,low:.043,high:.048};function Ib(e,t,n){let o=e.reduce((y,M)=>y+M.x,0)/4,r=e.reduce((y,M)=>y+M.y,0)/4,i=e[3].x-e[0].x,a=e[3].y-e[0].y,s=Math.hypot(i,a)||1;i/=s,a/=s,i*(t.x-o)+a*(t.y-r)<0&&(i=-i,a=-a);let c=-a,l=i,u=ao.armM/C,m=ao.widthM/C,f=s/2+ao.insideM/C,d=n?-1:1,h=o+i*(f+(n?0:u)),p=r+a*(f+(n?0:u)),b=(y,M)=>({x:h+i*y*d+c*M,y:p+a*y*d+l*M});return[b(0,0),b(-u,u),b(-u-m,u),b(-m,0),b(-u-m,-u),b(-u,-u)]}function Eb(e,t,n,o,r){let i=[.94,.95,.96];ue(e,Ib(t,o,r),void 0,()=>n+ao.high,n+ao.low,i,i,ae)}function nr(e,t){let n=be(e);return n?{top:le(at(n,.12),.95),wall:le(at(n,.12),.85)}:{top:t.tierTop,wall:t.tierWall}}function El(e,t,n,o,r,i,a,s,c=[]){let l=Me(t),u=Kc(t);if(!t.role&&(!t.fill||t.fill==="none"||t.fill==="transparent")||!l){io(e,t,n+o+yb);return}let f=s?s.kind==="stage":t.role==="stage",d=s?s.kind==="screen":t.role==="screen",h=s?{kind:f?"stage":"solid",heightM:s.topY-s.baseY}:lt(t),p=s?.baseY??n,b=s?.topY??n+o;if(f&&a){let w=1/0,E=-1/0,T=1/0,F=-1/0;for(let R of l)R.x<w&&(w=R.x),R.x>E&&(E=R.x),R.y<T&&(T=R.y),R.y>F&&(F=R.y);a.push({cx:(w+E)/2*C,cz:(T+F)/2*C,y:b,halfX:Math.max((E-w)/2*C,.5),halfZ:Math.max((F-T)/2*C,.5)})}let y=be(t.fill),M=t.role==="wall"||t.role==="entrance"||t.role==="exit",v=M?nr(t.fill,r).top:f&&y?ge(r.stageTop,le(at(y,.18),.9),.9):!t.role&&y?y:qt(y,f?r.stageTop:r.decorTop),A=d?y:null,x=M?nr(t.fill,r).wall:f?y?ge(r.stageWall,le(y,.58),.82):r.stageWall:d?A?ge(le(A,1.42),[.24,.46,.82],.08):[.24,.46,.82]:qt(be(t.fill),r.decorWall);if(t.role==="wall"&&!s){$o(e,l,p,b,c,v,x,i),io(e,t,b+.012);return}if(d&&l.length===4&&b-p>.2){let w=Ai(l,p,b);if(!w)return;let{quad:E,side:T,trim:F,inner:R,panel:I}=w,_=[.12,.15,.18];for(let[k,V]of[[0,T],[1-T,1]])pe(e,je(E,k,V),b,p,_,_);pe(e,R,p+F,p,_,_),pe(e,R,b,b-F,_,_),pe(e,I,b-F,p+F,x,x),io(e,t,b+.012);return}let g=y?le(at(y,.15),.82):x,P=y?le(at(y,.1),1.02):v;if(ll(t.role)&&!s&&ul(e,t.role,l,p,b,g,P,i,t.heightM!==void 0))return;if((t.role==="sound"||s?.kind==="sound_desk")&&l.length===4&&b-p>.3){let w=qe(l),E=Math.hypot(w[1].x-w[0].x,w[1].y-w[0].y)*C,T=Math.min(.12,.09/Math.max(E,.001)),F=[.18,.21,.24],R=b-Math.min(.12,(b-p)*.15);for(let[I,_]of[[0,T],[1-T,1]])pe(e,je(w,I,_),R,p,F,F);pe(e,w,b,R,v,F);return}if(t.role==="rail"&&l.length===4&&b>p){let w=qe(l),E=Math.hypot(w[1].x-w[0].x,w[1].y-w[0].y)*C,T=Math.max(1,Math.min(128,Math.ceil(E/1.4))),F=Math.min(.08,.055/Math.max(.055,E)),R=[.58,.64,.66];for(let I=0;I<=T;I++){let _=I/T,k=Math.min(1-F,Math.max(0,_-F/2));pe(e,je(w,k,k+F),b,p,R,le(R,.8))}for(let I of[.52,1]){let _=p+(b-p)*I;pe(e,w,_,Math.max(p,_-.055),R,le(R,.8))}return}if(t.role==="goal"&&l.length===4){let w=qe(l),E=Math.hypot(w[1].x-w[0].x,w[1].y-w[0].y)*C,T=Math.min(.12,.1/Math.max(.1,E)),F=[.9,.94,.94];for(let[R,I]of[[0,T],[1-T,1]])pe(e,je(w,R,I),Math.max(p,b-.1),p,F,F);pe(e,w,b,Math.max(p,b-.1),F,F);return}if(h.kind==="portal"&&l.length===4){let w=Sn(l,p,b);if(!w)return;let{quad:E,side:T,face:F,openingTop:R}=w;for(let[I,_,k]of[[0,F,1],[F,1-F,.67],[1-F,1,1]]){let V=ro(E,I,_),O=le(v,k),H=le(x,k);for(let[U,N]of[[0,T],[1-T,1]])pe(e,je(V,U,N),R,p,O,H);pe(e,V,b,R,O,H)}(t.role==="entrance"||t.role==="exit")&&Eb(e,E,p,i,t.role==="exit");return}if(h.kind==="suite"&&l.length===4){let w=l.map((F,R)=>{let I=l[(R+1)%4],_=(F.x+I.x)/2,k=(F.y+I.y)/2;return Math.hypot(_-i.x,k-i.y)}),E=w.indexOf(Math.min(...w)),T=[0,1,2,3].map(F=>l[(E+F)%4]);pe(e,je(T,0,.08),b,p,v,x),pe(e,je(T,.92,1),b,p,v,x),pe(e,ro(T,.88,1),b,p,v,x),pe(e,T,b,Math.max(p,b-.18),v,x);return}if(f&&!t.stageKind?.startsWith("pitch-")&&b-p>.12){let w=b-Math.min(.06,(b-p)*.15);pe(e,l,w,p,v,x,u),pe(e,l,b,w,v,ge(v,x,.2),u)}else pe(e,l,b,p,v,x,u);if((t.stageKind==="pitch-football"||t.stageKind==="pitch-rugby")&&l.length===4){e.setMaterial(4);let w=qe(l),E=ge(y??gl,gl,y?.45:0);for(let T=0;T<12;T++){let F=je(w,T/12,(T+1)/12),R=le(E,T%2?1.09:.91),I=F.map(_=>[_.x*C,b+.006,_.y*C]);e.tri(I[0],I[1],I[2],[0,1,0],R),e.tri(I[0],I[2],I[3],[0,1,0],R)}}t.stageKind&&t.stageKind!=="pitch-football"&&yl(e,l,t.stageKind,b,y),f&&Kt(t.stageKind)&&bl(e,t,b),e.setMaterial(d?1:0),io(e,t,b+.012)}function ir(e){let{x:t,y:n,width:o,height:r}=e;if(!o||!r)return null;let i=t+o/2,a=n+r/2,s=(e.rotation??0)*Math.PI/180,c=Math.cos(s),l=Math.sin(s),u=o/2,m=r/2;return[[-u,-m],[u,-m],[u,m],[-u,m]].map(([f,d])=>({x:i+f*c-d*l,y:a+f*l+d*c}))}function Rb(e){if(!e||!e.startsWith("data:image/svg+xml"))return null;let t=e.slice(e.indexOf(",")+1);if(/;base64/i.test(e.slice(0,e.indexOf(","))))try{t=atob(t)}catch{return null}else try{t=decodeURIComponent(t)}catch{}let n=t.match(/<(?:rect|path)\b[^>]*\bfill="([^"]+)"/i);if(!n)return null;let o=n[1].trim();if(o==="none"||o==="transparent")return null;let r=o.match(/^url\(#([^)]+)\)$/);if(!r)return be(o);let i=t.match(new RegExp(`<(?:linear|radial)Gradient\\b[^>]*\\bid="${r[1]}"[^>]*>([\\s\\S]*?)</(?:linear|radial)Gradient>`,"i"));if(!i)return null;let a=[];for(let s of i[1].matchAll(/stop-color="([^"]+)"/gi)){let c=be(s[1].trim());c&&a.push(c)}return a.length?a.reduce((s,c,l)=>ge(s,c,1/(l+1)),a[0]):null}function Rl(e,t,n,o){if(t.layer==="foreground")return;let r=ir(t);if(!r)return;let i=n+Mb,a=qt(Rb(t.href),o.decorTop),s=Math.max(0,Math.min(1,t.opacity??1));s<1&&(a=ge(o.ground,a,s)),ue(e,r,void 0,()=>i,n,a,ge(a,o.decorWall,.5),ae)}function Cl(e,t,n,o,r){if(!t.points||t.points.length<3)return;let i=Rc(o,r.gaTop);ue(e,t.points,t.holes,()=>n+Sl,n,i,r.gaWall,ae),Tb(e,t.points,n+Sl)}var Sl=.15,tr=[.72,.74,.76],Ci=1.1,wl=.12,_i=.05,Cb=.06,_b=2.4;function Tb(e,t,n){let o=pt([...t]),r=_t(o,wl/C),i=_t(o,(wl+_i)/C);if(r.length<3||i.length<3)return;for(let s of[n+Ci,n+Ci*.5])ue(e,r,[i.slice().reverse()],()=>s,s-_i,tr,le(tr,.85),ae);let a=Cb/2/C;for(let s=0;s<r.length;s++){let c=r[s],l=r[(s+1)%r.length],u=Math.hypot(l.x-c.x,l.y-c.y)*C,m=Math.max(1,Math.round(u/_b));for(let f=0;f<m;f++){let d=f/m,h=c.x+(l.x-c.x)*d,p=c.y+(l.y-c.y)*d,b=[{x:h-a,y:p-a},{x:h+a,y:p-a},{x:h+a,y:p+a},{x:h-a,y:p+a}];ue(e,b,void 0,()=>n+Ci-_i,n,tr,le(tr,.8),ae)}}}var Ti=.6,_l=3,Lb=.25;function kb(e,t){if(Ze(t,e.x,e.y))return 0;let n=1/0;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[r],a=t[o],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c||1,u=Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l));n=Math.min(n,Math.hypot(e.x-(i.x+u*s),e.y-(i.y+u*c)))}return n}function Tl(e,t){let n=e.map(a=>({booth:a,ring:ut(a)})).filter(a=>!!a.ring&&a.ring.length===4&&!a.booth.points),o=n.map(({ring:a})=>({minX:Math.min(...a.map(s=>s.x)),maxX:Math.max(...a.map(s=>s.x)),minY:Math.min(...a.map(s=>s.y)),maxY:Math.max(...a.map(s=>s.y))})),r=(_l+Ti)/C,i=new Map;return n.forEach(({booth:a,ring:s},c)=>{let l={x:s.reduce((d,h)=>d+h.x,0)/4,y:s.reduce((d,h)=>d+h.y,0)/4},u=[0,1,2,3].map(d=>{let h=s[d],p=s[(d+1)%4],b={x:(h.x+p.x)/2,y:(h.y+p.y)/2},y=b.x-l.x,M=b.y-l.y,v=Math.hypot(y,M)||1,A={x:b.x+y/v*Ti/C,y:b.y+M/v*Ti/C},x=_l/C;return o.forEach((g,P)=>{P===c||A.x<g.minX-r||A.x>g.maxX+r||A.y<g.minY-r||A.y>g.maxY+r||(x=Math.min(x,kb(A,n[P].ring)))}),{open:x*C,toward:{x:b.x+y/v*10/C,y:b.y+M/v*10/C},focal:Math.hypot(b.x-t.x,b.y-t.y)}}),m=Math.max(...u.map(d=>d.open)),f=u.filter(d=>d.open>=m-Lb).sort((d,h)=>d.focal-h.focal)[0];i.set(a.id,f.toward)}),i}var Ll=dt(require("polygon-clipping"),1);var Ob=.45,Fb=1500,Db=200;function kl(e,t){if(e.role!=="stage"||Kt(e.stageKind))return e;let n=Me(e);if(!n||n.length<3||Math.abs($e(n))*C*C>Fb)return e;let o=t.filter(a=>Ze(n,a.x,a.y));if(!o.length||o.length>Db)return e;let r=Ob/C,i=o.map(a=>[[[a.x-r,a.y-r],[a.x+r,a.y-r],[a.x+r,a.y+r],[a.x-r,a.y+r],[a.x-r,a.y-r]]]);try{let a=Ll.default.difference([[...n.map(l=>[l.x,l.y]),[n[0].x,n[0].y]]],...i),s=null,c=0;for(let l of a){let u=l[0].slice(0,-1).map(([f,d])=>({x:f,y:d})),m=Math.abs($e(u));m>c&&(c=m,s=u)}return!s||s.length<3?e:{...e,kind:"polygon",points:s,rotation:0}}catch{return e}}var Nb=Math.PI/180,Pe=96,Bb=6,Vb=60,Gb=150,Ol=.2,Hb=.35;function zb(e,t){let n=Math.atan2(t.x-e.x,t.y-e.y)/Nb;return n<0?n+360:n}function ar(e){if(!e.length)return NaN;let t=[...e].sort((n,o)=>n-o);return t[Math.floor(t.length/2)]}function sr(e,t,n=2){let o=e.length,r=new Float64Array(o);for(let i=0;i<o;i++){let a=0,s=0;for(let c=-n;c<=n;c++){let l=i+c;if(t)l=(l%o+o)%o;else if(l<0||l>=o)continue;a+=e[l],s++}r[i]=a/s}return r}function Fl(e,t){let n=e.filter(f=>f.rows.length>=1);if(n.length<1)return null;let o=[],r=0,i=0,a=0;for(let f of n)for(let d of f.rows){for(let h of d.pts)r+=h.x,i+=h.y,a++;if(d.pts.length>=4){let h=fi(d.pts);h&&Number.isFinite(h.cx)&&Number.isFinite(h.cy)&&o.push({x:h.cx,y:h.cy})}}if(!a)return null;let s={x:r/a,y:i/a},c=s;if(o.length>=8){let f=ar(o.map(y=>y.x)),d=ar(o.map(y=>y.y)),h=0;for(let y of n)for(let M of y.rows)for(let v of M.pts){let A=Math.hypot(v.x-s.x,v.y-s.y);A>h&&(h=A)}let p=0,b=h*.2;for(let y of n)for(let M of y.rows)for(let v of M.pts)Math.hypot(v.x-f,v.y-d)<b&&p++;Math.hypot(f-s.x,d-s.y)<=h&&p/a<.01&&(c={x:f,y:d})}let l=[];for(let f of n){let d={sectionId:f.sectionId,rMin:1/0,rMax:-1/0,samples:[]};for(let h of f.rows)for(let p of h.pts){let b=Math.hypot(p.x-c.x,p.y-c.y),y=Math.min(Pe-1,Math.floor(zb(c,p)/(360/Pe)));d.samples.push({r:b,bin:y,levelM:h.levelM}),b<d.rMin&&(d.rMin=b),b>d.rMax&&(d.rMax=b)}d.samples.length&&l.push(d)}if(!l.length)return null;l.sort((f,d)=>f.rMin+f.rMax-(d.rMin+d.rMax));let u=[];for(let f of l){let d=!1;for(let h of u){let p=Math.min(f.rMax,h.rMax)-Math.max(f.rMin,h.rMin),b=Math.min(f.rMax-f.rMin,h.rMax-h.rMin);if(b>1e-9&&p>=Hb*b){h.members.push(f),h.rMin=Math.min(h.rMin,f.rMin),h.rMax=Math.max(h.rMax,f.rMax),d=!0;break}}d||u.push({members:[f],rMin:f.rMin,rMax:f.rMax})}let m=[];for(let f of u){let d=new Array(Pe).fill(null);for(let R of f.members)for(let I of R.samples){let _=d[I.bin];_||(_={samples:[]},d[I.bin]=_),_.samples.push({r:I.r,levelM:I.levelM})}let h=d.map(R=>!!R);if(!h.filter(Boolean).length)continue;let b=[],y=[];for(let R of d){if(!R)continue;let I=1/0,_=-1/0;for(let k of R.samples)k.r<I&&(I=k.r),k.r>_&&(_=k.r);b.push(I),y.push(_)}let M=ar(b),v=ar(y);if(!(M>=Ol*v)||!(v>0))continue;let A=[...b].sort((R,I)=>R-I);if(!(A[Math.floor(A.length*.1)]>=Ol*v))continue;let g=d.map(R=>{if(!R)return null;let I=[...R.samples].sort((L,B)=>L.r-B.r),_=I[0].r,k=I[I.length-1].r,V=I[0].levelM,O=-1/0;for(let L of I)L.levelM>O&&(O=L.levelM);let H=[];for(let L of I){let B={r:L.r,l:L.levelM};for(;H.length&&Math.abs(H[H.length-1].r-B.r)<1e-9;){if(H[H.length-1].l<=B.l){B.skip=!0;break}H.pop()}if(!B.skip){for(;H.length>=2;){let D=H[H.length-2],G=H[H.length-1];if((G.r-D.r)*(B.l-D.l)-(G.l-D.l)*(B.r-D.r)<=0)H.pop();else break}H.push(B)}}let U=H.map(L=>L.r),N=H.map(L=>L.l);return{inner:_,outer:k,front:V,top:O,profile:{rs:U,ls:N}}}),P=h.slice();for(let R=0;R<Pe;R++){if(P[R])continue;let I=-1,_=-1,k=0;for(let j=1;j<=Pe;j++){let Z=(R-j+Pe*2)%Pe;if(P[Z]){I=Z;break}}for(let j=1;j<=Pe;j++){let Z=(R+j)%Pe;if(P[Z]){_=Z,k=j;break}}if(I<0||_<0)continue;let V=0;for(let j=1;j<=Pe;j++){let Z=(R-j+Pe*2)%Pe;if(h[Z]){V=j;break}}if(V-1+k>Bb)continue;let H=g[I],U=g[_],N=V/(V+k),L=H.inner+(U.inner-H.inner)*N,B=H.outer+(U.outer-H.outer)*N,D=H.front+(U.front-H.front)*N,G=H.top+(U.top-H.top)*N;g[R]={inner:L,outer:B,front:D,top:G,profile:{rs:[L,B],ls:[D,G]}}}for(let R=0;R<Pe;R++)g[R]&&(P[R]=!0);let S=360/Pe,w=[],E=P.filter(Boolean).length,T=[];if(E===Pe)T.push({start:0,len:Pe});else{let R=0;for(;P[R];)R=(R+1)%Pe;let I=-1;for(let _=0;_<=Pe;_++){let k=(R+_)%Pe,V=_<Pe&&P[k];if(V&&I<0)I=k;else if(!V&&I>=0){let O=(k-I+Pe)%Pe||Pe;T.push({start:I,len:O}),I=-1}}}for(let R of T){if(R.len*S<Vb&&R.len<Pe)continue;let I=R.len===Pe,_=new Float64Array(R.len),k=new Float64Array(R.len),V=new Float64Array(R.len),O=new Float64Array(R.len),H=[];for(let j=0;j<R.len;j++){let Z=g[(R.start+j)%Pe];_[j]=Z.inner,k[j]=Z.outer,V[j]=Z.front,O[j]=Z.top,H.push(Z.profile??{rs:[Z.inner,Z.outer],ls:[Z.front,Z.top]})}let U=sr(_,I),N=sr(k,I),L=sr(V,I),B=sr(O,I);for(let j=0;j<R.len;j++)U[j]>_[j]&&(U[j]=_[j]),N[j]<k[j]&&(N[j]=k[j]),U[j]>N[j]-1e-6&&(U[j]=Math.max(0,N[j]-1e-6)),B[j]<L[j]&&(B[j]=L[j]);let D={startBin:R.start,binCount:R.len,closed:I,innerR:U,outerR:N,frontLevelM:L,topLevelM:B,profiles:H},G=(j,Z,$)=>{let ee=H[j],Q=ee.rs,X=ee.ls;if(Z<=Q[0]){X[0]>$&&(X[0]=$);return}if(Z>=Q[Q.length-1]){X[X.length-1]>$&&(X[X.length-1]=$);return}for(let Y=0;Y+1<Q.length;Y++)if(Z<=Q[Y+1]){X[Y]>$&&(X[Y]=$),X[Y+1]>$&&(X[Y+1]=$);return}};for(let j=0;j<R.len;j++){let Z=d[(R.start+j)%Pe];if(Z)for(let $ of Z.samples){G(j,$.r,$.levelM);let ee=I?(j-1+R.len)%R.len:j-1,Q=I?(j+1)%R.len:j+1;ee>=0&&G(ee,$.r,$.levelM),Q<R.len&&G(Q,$.r,$.levelM)}}w.push(D)}w.reduce((R,I)=>R+I.binCount*S,0)<Gb||m.push({arcs:w,sectionIds:f.members.map(R=>R.sectionId),innerRMedian:M,outerRMedian:v})}if(!m.length)return null;if(m.sort((f,d)=>f.innerRMedian-d.innerRMedian),t){let f=m[m.length-1].outerRMedian;if(Math.hypot(t.x-c.x,t.y-c.y)>.9*f)return null}return{centre:c,binCount:Pe,binStepDeg:360/Pe,rings:m}}function Dl(e,t,n,o){let r=e.binStepDeg,i=n/r-.5-t.startBin;i=(i%e.binCount+e.binCount)%e.binCount,i>t.binCount-1&&(t.closed?i=i-t.binCount<t.binCount-i?0:t.binCount-1:i=i-(t.binCount-1)<e.binCount-i?t.binCount-1:0);let a=Math.floor(i),s=t.closed?(a+1)%t.binCount:Math.min(t.binCount-1,a+1),c=i-a,l=u=>{let m=t.profiles[u],f=m.rs,d=m.ls;if(o<=f[0])return d[0];if(o>=f[f.length-1])return d[d.length-1];for(let h=0;h+1<f.length;h++)if(o<=f[h+1]){let p=f[h+1]-f[h],b=p>1e-9?(o-f[h])/p:0;return d[h]+(d[h+1]-d[h])*b}return d[d.length-1]};return l(a)*(1-c)+l(s)*c}function Li(e,t,n,o,r,i,a,s,c,l=[],u=r){if(t.length!==n.length||t.length<2||i-r<1.5)return;let m=(p,b,y)=>{At(e,p,b,y,l,a,s,{portalBase:u,ao:c})||ue(e,p,void 0,()=>y,b,a,s,c)},f=(p,b,y)=>({x:p.x+(b.x-p.x)*y,y:p.y+(b.y-p.y)*y}),d=o?t.length:t.length-1,h=0;for(let p=0;p<d;p++){let b=(p+1)%t.length,y=Math.hypot(n[b].x-n[p].x,n[b].y-n[p].y)*fe;if(y<1e-5)continue;let M=(g,P)=>[f(t[p],t[b],g),f(t[p],t[b],P),f(n[p],n[b],P),f(n[p],n[b],g)];m(M(0,1),r,r+.95),m(M(0,1),i-.22,i);let v=Math.ceil((h-.32)/6)*6,A=!1,x=!1;for(let g=v;g<h+y;g+=6){let P=Math.max(0,(g-h)/y),S=Math.min(1,(g+.32-h)/y);S<=P||(m(M(P,S),r+.95,i-.22),A||=P<1e-6,x||=S>1-1e-6)}if(!o&&(p===0&&!A||p===d-1&&!x)){let g=Math.min(1,.32/y);m(M(p===0?0:1-g,p===0?g:1),r+.95,i-.22)}h+=y}}var Ft=dt(require("polygon-clipping"),1),co=.65;function ki(e,t){let n=1/0;for(let o of t)for(let r=0;r<o.length;r++){let i=o[r],a=o[(r+1)%o.length],s=a.x-i.x,c=a.y-i.y,l=Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/(s*s+c*c||1)));n=Math.min(n,Math.hypot(e.x-i.x-l*s,e.y-i.y-l*c))}return n}var Oi=.01;function Nl(e,t,n,o,r,i,a,s=[],c=!0,l={bays:[],walls:[]}){if(o-r<=1e-5)return;let u=o-r>=3,m=u?o-co:r;e.setMaterial(5);let f=u?[]:s.filter(g=>{if(g.role!=="entrance"&&g.role!=="exit")return!1;let P=Me(g);if(!P)return!1;let S=Sn(P,r,r+lt(g).heightM);return S!==null&&S.openingTop<=o-.12});if((!f.length||!At(e,t,m,o,f,i,a,{holes:n,portalBase:r}))&&ue(e,t,n,()=>o,m,i,a,ae,void 0,()=>[0,1,0]),!u){e.setMaterial(0);return}let d=c&&l.bays.length?jb(t,n,_t(t,so/C),l):null,h=6/C,p=.22/C,b=s.flatMap(g=>{if(g.role!=="entrance"&&g.role!=="exit")return[];let P=Me(g);return P?.length?[{minX:Math.min(...P.map(S=>S.x)),maxX:Math.max(...P.map(S=>S.x)),minY:Math.min(...P.map(S=>S.y)),maxY:Math.max(...P.map(S=>S.y))}]:[]}),y=Math.min(...t.map(g=>g.x)),M=Math.max(...t.map(g=>g.x)),v=Math.min(...t.map(g=>g.y)),A=Math.max(...t.map(g=>g.y));for(let g=y+h/2;g<M;g+=h)for(let P=v+h/2;P<A;P+=h){if(b.some(w=>g+p>=w.minX&&g-p<=w.maxX&&P+p>=w.minY&&P-p<=w.maxY))continue;let S=[{x:g-p,y:P-p},{x:g+p,y:P-p},{x:g+p,y:P+p},{x:g-p,y:P+p}];!ze({x:g,y:P},t,n)||ki({x:g,y:P},[t,...n??[]])<p*Math.SQRT2+(c?so/C:0)||d&&ki({x:g,y:P},d.flat())<p*Math.SQRT2+so/C||ue(e,S,void 0,()=>m,r,i,a,ae)}if(d){for(let[g,...P]of d)ue(e,g,P,()=>m,r-Oi,i,a,ae);e.setMaterial(0);return}let x=_t(t,so/C);if(c&&x.length>=3){let g=s.filter(w=>{if(w.role!=="entrance"&&w.role!=="exit")return!1;let E=Me(w);return!!E&&E.some(T=>!ze(T,t,void 0)||ki(T,[t])<=so/C)}),P=[x.slice().reverse()],S=r-Oi;(!g.length||!At(e,t,S,m,g,i,a,{holes:P,portalBase:r+Oi}))&&ue(e,t,P,()=>m,S,i,a,ae)}e.setMaterial(0)}var Fi=.25,so=Fi;function jb(e,t,n,o){if(n.length<3)return null;let r=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s},i=a=>{let[s,...c]=a.map(l=>[r(l)]);return Ft.default.union(s,...c)};try{let a=[r(e),...(t??[]).map(r)],s=Ft.default.difference(a,[r(n)]),c=Ft.default.intersection(a,i(o.bays));if(!c.length)return null;let l=Ft.default.difference(Ft.default.intersection(a,i(o.walls)),c);return Ft.default.union(Ft.default.difference(s,c),l).map(m=>m.map(f=>f.slice(0,-1).map(([d,h])=>({x:d,y:h}))))}catch{return null}}var Ub=.02,Wb=.25,Xb=1.2,Yb=.6,Kb=.45,$b=2.3,Zb=Math.PI/180,Bl=.005;function yt(e,t,n){let o=n*Zb;return{x:e.x+t*Math.sin(o),y:e.y+t*Math.cos(o)}}function qb(e,t){let n=t.rings[t.rings.length-1];if(!n)return!1;let o=n.outerRMedian*.85;for(let r of e){if(r.role!=="wall")continue;let i=r.points&&r.points.length>=2?r.points:r.x!==void 0&&r.y!==void 0&&r.width!==void 0&&r.height!==void 0?[{x:r.x,y:r.y},{x:r.x+r.width,y:r.y},{x:r.x+r.width,y:r.y+r.height},{x:r.x,y:r.y+r.height}]:[];if(i.length<2)continue;let a=0;for(let s of i)Math.hypot(s.x-t.centre.x,s.y-t.centre.y)>=o&&a++;if(a>=i.length/2)return!0}return!1}var Qb=24,Jb=.01;function e0(e,t,n,o,r,i,a,s,c){let l=n.binCount,u=Qb,m=fe,f=i+.02,d=i-Jb,h=[];for(let I=0;I<l;I++){let _=(n.startBin+I+.5)*t.binStepDeg,k=new Float64Array(u+1);for(let V=0;V<=u;V++){let O=o[I]+(r[I]-o[I])*V/u;k[V]=Math.max(f,Dl(t,n,_,O)-Wb)}h.push(k)}if(c){let I=0;for(let _=0;_+1<l;_++)for(let k=0;k<u;k++){let V=yt(t.centre,o[_]+(r[_]-o[_])*k/u,(n.startBin+_+.5)*t.binStepDeg),O=yt(t.centre,o[_+1]+(r[_+1]-o[_+1])*(k+1)/u,(n.startBin+_+1.5)*t.binStepDeg);I=Math.max(I,Math.hypot(O.x-V.x,O.y-V.y))}for(let _=0;_<l;_++){let k=(n.startBin+_+.5)*t.binStepDeg;for(let V=0;V<=u;V++){let O=yt(t.centre,o[_]+(r[_]-o[_])*V/u,k),H=c(O.x,O.y,I*1.01);H!==null&&(h[_][V]=Math.min(h[_][V],Math.max(d+Bl,H-Bl)))}}}let p=[a.bandTop[0]*s.top,a.bandTop[1]*s.top,a.bandTop[2]*s.top],b=[a.bandTop[0]*s.bottomCap,a.bandTop[1]*s.bottomCap,a.bandTop[2]*s.bottomCap],y=[a.bandWall[0]*s.top,a.bandWall[1]*s.top,a.bandWall[2]*s.top],M=[a.bandWall[0]*s.wallBottom,a.bandWall[1]*s.wallBottom,a.bandWall[2]*s.wallBottom],v=(I,_)=>{let k=(n.startBin+I+.5)*t.binStepDeg,V=o[I]+(r[I]-o[I])*_/u,O=yt(t.centre,V,k);return[O.x*m,h[I][_],O.y*m]};{let I=Math.tan(12*Math.PI/180);for(let _=0;_<6;_++){let k=!1;for(let O=0;O<l;O++)for(let H=u-1;H>=0;H--)h[O][H]>h[O][H+1]&&(h[O][H]=h[O][H+1],k=!0);let V=n.closed?l:l-1;for(let O=0;O<V;O++){let H=(O+1)%l;for(let U=0;U<=u;U++){let N=h[H][U]-h[O][U];if(Math.abs(N)>1)continue;let L=o[O]+(r[O]-o[O])*U/u,B=o[H]+(r[H]-o[H])*U/u,D=yt(t.centre,L,(n.startBin+O+.5)*t.binStepDeg),G=yt(t.centre,B,(n.startBin+H+.5)*t.binStepDeg),j=I*Math.hypot(G.x-D.x,G.y-D.y)*m;N>j?(h[H][U]=h[O][U]+j,k=!0):-N>j&&(h[O][U]=h[H][U]+j,k=!0)}}if(!k)break}}let A=1,x=(I,_)=>{for(let k=0;k<=u;k+=4)if(Math.abs(h[I][k]-h[_][k])>A)return!0;return Math.abs(h[I][u]-h[_][u])>A},g=Math.tan(38*Math.PI/180),P=I=>(r[I]-o[I])/u*m,S=(I,_)=>h[I][_+1]-h[I][_]>g*Math.max(1e-6,P(I)),w=(I,_)=>{let k=n.closed?(I-1+l)%l:Math.max(0,I-1),V=n.closed?(I+1)%l:Math.min(l-1,I+1);Math.abs(h[k][_]-h[I][_])>A&&(k=I),Math.abs(h[V][_]-h[I][_])>A&&(V=I);let O=Math.max(0,_-1),H=Math.min(u,_+1);O<_&&S(I,O)&&(O=_),H>_&&S(I,_)&&(H=_);let U=v(k,_),N=v(V,_),L=v(I,O),B=v(I,H),D=N[0]-U[0],G=N[1]-U[1],j=N[2]-U[2],Z=B[0]-L[0],$=B[1]-L[1],ee=B[2]-L[2],Q=G*ee-j*$,X=j*Z-D*ee,Y=D*$-G*Z,K=Math.hypot(Q,X,Y);return K>1e-12?(Q/=K,X/=K,Y/=K,X<0&&(Q=-Q,X=-X,Y=-Y),[Q,X,Y]):[0,1,0]},E=(I,_,k=!1)=>{let V=k&&Math.min(I[1],_[1])-i>=3,O=[I[0],V?I[1]-co:d,I[2]],H=[_[0],V?_[1]-co:d,_[2]],U=_[0]-I[0],N=_[2]-I[2],L=Math.hypot(U,N);if(!(L>1e-12))return;let B=[N/L,0,-U/L];e.tri(I,_,H,B,y,y,M),e.tri(I,H,O,B,y,M,M)},T=.05*et,F=I=>r[I]-o[I]<T,R=n.closed?l:l-1;for(let I=0;I<R;I++){let _=(I+1)%l;if(F(I)||F(_))continue;if(x(I,_)){let N=(n.startBin+I+1)*t.binStepDeg,L=($,ee)=>{let Q=(o[I]+o[_])/2,X=(r[I]+r[_])/2,Y=Q+(X-Q)*ee/u,K=yt(t.centre,Y,N);return[K.x*m,h[$][ee],K.y*m]};for(let $=0;$<u;$++){let ee=v(I,$),Q=v(I,$+1),X=L(I,$),Y=L(I,$+1),K=w(I,$),re=w(I,$+1);e.triN(ee,X,Y,K,K,re,p),e.triN(ee,Y,Q,K,re,re,p);let ne=v(_,$),se=v(_,$+1),J=L(_,$),ie=L(_,$+1),Ee=w(_,$),te=w(_,$+1);e.triN(J,ne,se,Ee,Ee,te,p),e.triN(J,se,ie,Ee,te,te,p);let ve=L(I,$),Se=L(I,$+1),ot=L(_,$+1),mt=L(_,$),Ye=Se[0]-ve[0],rt=Se[2]-ve[2],Ae=Math.hypot(Ye,rt);if(Ae>1e-12){let Ht=[rt/Ae,0,-Ye/Ae];e.tri(ve,Se,ot,Ht,y),e.tri(ve,ot,mt,Ht,y)}}let B=v(I,0),D=v(_,0),G=v(_,u),j=v(I,u),Z=$=>[$[0],d,$[2]];Math.min(B[1],D[1])-i<3&&(e.tri(Z(B),Z(G),Z(D),[0,-1,0],b),e.tri(Z(B),Z(j),Z(G),[0,-1,0],b)),E(B,D,!0),E(j,G,!0);continue}for(let N=0;N<u;N++){let L=w(I,N),B=w(_,N),D=w(_,N+1),G=w(I,N+1);if(S(I,N)||S(_,N)){let Q=(Se,ot)=>{let mt=(n.startBin+Se+.5)*t.binStepDeg,Ye=o[Se]+(r[Se]-o[Se])*(N+.5)/u,rt=yt(t.centre,Ye,mt);return[rt.x*m,ot,rt.y*m]},X=v(I,N),Y=v(_,N),K=Q(I,h[I][N]),re=Q(_,h[_][N]);e.triN(X,Y,re,L,B,B,p),e.triN(X,re,K,L,B,L,p);let ne=v(_,N+1),se=v(I,N+1),J=Q(I,h[I][N+1]),ie=Q(_,h[_][N+1]);e.triN(J,ie,ne,G,D,D,p),e.triN(J,ne,se,G,D,G,p);let Ee=re[0]-K[0],te=re[2]-K[2],ve=Math.hypot(Ee,te);if(ve>1e-12){let Se=[-te/ve,0,Ee/ve];e.tri(K,re,ie,Se,y),e.tri(K,ie,J,Se,y)}continue}let j=v(I,N),Z=v(_,N),$=v(_,N+1),ee=v(I,N+1);e.triN(j,Z,$,L,B,D,p),e.triN(j,$,ee,L,D,G,p)}let k=v(I,0),V=v(_,0),O=v(_,u),H=v(I,u),U=N=>[N[0],d,N[2]];Math.min(k[1],V[1])-i<3&&(e.tri(U(k),U(O),U(V),[0,-1,0],b),e.tri(U(k),U(H),U(O),[0,-1,0],b)),E(k,V,!0),E(H,O,!0)}if(!n.closed)for(let I of[0,l-1])for(let _=0;_<u;_++)E(v(I,_),v(I,_+1))}function Vl(e,t,n){let{bottomY:o,colors:r,ao:i}=n,a=new Float64Array(t.binCount).fill(-1/0);for(let u of t.rings)for(let m of u.arcs){let f=new Float64Array(m.binCount),d=new Float64Array(m.binCount);for(let p=0;p<m.binCount;p++){let b=(m.startBin+p)%t.binCount,y=Math.max(0,m.innerR[p]-tt);f[p]=Math.max(y,a[b]+.001),d[p]=Math.max(f[p]+.001,m.outerR[p]+tt)}let h=0;for(let p=0;p<m.binCount;p++){let b=m.topLevelM[p]-o;b>h&&(h=b)}h>=Xb&&e0(e,t,m,f,d,o,r,i,n.standTopNear);for(let p=0;p<m.binCount;p++){let b=(m.startBin+p)%t.binCount;d[p]>a[b]&&(a[b]=d[p])}}if(n.deriveShell===!1||qb(n.shapes,t))return;let s=t.rings[t.rings.length-1],c=Yb*et,l=Kb*et;for(let u of s.arcs){let m=[],f=[];for(let w=0;w<u.binCount;w++){let E=(u.startBin+w+.5)*t.binStepDeg,T=u.outerR[w]+tt+c;m.push(yt(t.centre,T,E)),f.push(yt(t.centre,T+l,E))}let d=-1/0;for(let w=0;w<u.binCount;w++)u.topLevelM[w]>d&&(d=u.topLevelM[w]);let h=d+$b,p=u.closed?f:[...f,...m.slice().reverse()],b=u.closed?[m.slice().reverse()]:void 0,y=ge(r.shellWall,[.66,.71,.72],.62),M=(w,E,T,F,R)=>{let I=Math.abs(F-d)<1e-6?F-Ub:F;At(e,w,T,I,n.shapes,r.shellTop,R,{holes:E,portalBase:o,ao:i})||ue(e,w,E,()=>I,T,r.shellTop,R,i)},v=Math.max(1,Math.ceil((d-o)/4.5)),A=(d-o)/v,x=new Set,g=n.tierFrontLevels??t.rings.map(w=>{let E=w.arcs.flatMap(T=>Array.from(T.frontLevelM)).filter(Number.isFinite).sort((T,F)=>T-F);return E[Math.floor(E.length/2)]});for(let w of g)Number.isFinite(w)&&w-o>=3&&w<d&&x.add(Math.max(0,Math.min(v-1,Math.floor((w-o)/A))));let P=Math.min(...g.filter(w=>Number.isFinite(w)&&w-o>=3&&w<d));for(let w=0;w<v;w++)o+(w+1)*A<=P-co&&Number.isFinite(P)&&x.add(w);for(let w=0;w<v;w++){let E=o+(d-o)*w/v,T=o+(d-o)*(w+1)/v;x.has(w)&&T-E>=3.2?(M(p,b,E,E+.45,y),Li(e,m,f,u.closed,E+.45,T-.16,r.shellTop,y,i,n.shapes,o)):M(p,b,E,T-.16,y),M(p,b,T-.16,T,le(y,.62))}Li(e,m,f,u.closed,d,h,r.shellTop,y,i,n.shapes,o);let S=8;for(let w=1;w<f.length;w++){if(S+=Math.hypot(f[w].x-f[w-1].x,f[w].y-f[w-1].y)*fe,S<8)continue;S=0;let E=f[w],T=f[w-1],F=E.x-T.x,R=E.y-T.y,I=Math.max(1,Math.hypot(F,R)),_=F/I*.16*et,k=R/I*.16*et,V=Math.max(1,Math.hypot(E.x-t.centre.x,E.y-t.centre.y)),O=(E.x-t.centre.x)/V*.24*et,H=(E.y-t.centre.y)/V*.24*et,U=[{x:E.x-_,y:E.y-k},{x:E.x+_,y:E.y+k},{x:E.x+_+O,y:E.y+k+H},{x:E.x-_+O,y:E.y-k+H}];M(U,void 0,o,d,le(y,1.12))}}}var t0=2.5,Gl=.65,n0=2,o0=.03;function r0(e,t){let n=()=>{let o=t;for(;e.length>2;){let r=e[0],i=e[1],a=Math.hypot(i.x-r.x,i.y-r.y);if(a>o){e[0]={x:r.x+(i.x-r.x)/a*o,y:r.y+(i.y-r.y)/a*o};return}o-=a,e.shift()}};n(),e.reverse(),n(),e.reverse()}function Bi(e,t,n){let o=new Map;for(let i of e){let a=o.get(i.blockId);(!a||i.depth<a.depth)&&o.set(i.blockId,i)}let r=[];for(let[i,a]of o){if(a.y-n<t0||a.pts.length<2)continue;let s=a.pts.map(u=>{let m=u.x-t.x,f=u.y-t.y,d=Math.max(1,Math.hypot(m,f));return{x:u.x-m/d*Gl/C,y:u.y-f/d*Gl/C}}),c=[],l=[s[0]];for(let u=1;u<s.length;u++){let m=s[u-1],f=s[u];Math.hypot(f.x-m.x,f.y-m.y)*C>n0?(l.length>=2&&c.push(l),l=[f]):l.push(f)}l.length>=2&&c.push(l);for(let u of c)r0(u,o0/C);c.length&&r.push({blockId:i,y:a.y,runs:c})}return r}var Hl=.1,i0=1.1,a0=.22,Di=.95,Ni=.05,zl=1.8;function jl(e,t,n,o){let r=[.72,.72,.69],i=[.48,.55,.57];for(let a of Bi(t,n,o)){let s=a.y;for(let c of a.runs){let l=zl;for(let u=1;u<c.length;u++){let m=c[u-1],f=c[u],d=f.x-m.x,h=f.y-m.y,p=Math.hypot(d,h);if(p<1e-5)continue;let b=y=>{let M=-h/p*y/C/2,v=d/p*y/C/2;return[{x:m.x+M,y:m.y+v},{x:f.x+M,y:f.y+v},{x:f.x-M,y:f.y-v},{x:m.x-M,y:m.y-v}]};if(ue(e,b(a0),void 0,()=>s+Hl,s-i0,r,r,ae),ue(e,b(Ni),void 0,()=>s+Di,s+Di-Ni,i,i,ae),l+=p*C,l>=zl||u===c.length-1){l=0;let y=.028/C,M=[{x:m.x-y,y:m.y-y},{x:m.x+y,y:m.y-y},{x:m.x+y,y:m.y+y},{x:m.x-y,y:m.y+y}];ue(e,M,void 0,()=>s+Di-Ni,s+Hl,i,i,ae)}}}}}var s0=.9,c0=1.5,l0=.3;function Ul(e,t,n){let o=[],r=[],i=s0/C,a=c0/C,s=l0/C;for(let c of e)for(let l of c.runs){if(l.length<2)continue;let u=l.slice(),m=(b,y)=>{let M=u[b],v=u[y],A=Math.hypot(M.x-v.x,M.y-v.y)||1;u[b]={x:M.x+(M.x-v.x)/A*s,y:M.y+(M.y-v.y)/A*s}};m(0,1),m(u.length-1,u.length-2);let f=u.map((b,y)=>{let M=u[Math.max(0,y-1)],v=u[Math.min(u.length-1,y+1)],A=v.x-M.x,x=v.y-M.y,g=Math.hypot(A,x)||1,P=-x/g,S=A/g;return P*(b.x-t.x)+S*(b.y-t.y)<0&&(P=-P,S=-S),{nx:P,ny:S}}),d=u.map((b,y)=>({x:b.x-f[y].nx*a,y:b.y-f[y].ny*a})),h=u.map((b,y)=>({x:b.x+f[y].nx*i,y:b.y+f[y].ny*i})),p=u.map((b,y)=>({x:b.x+f[y].nx*(i+n/C),y:b.y+f[y].ny*(i+n/C)}));o.push([...d,...h.slice().reverse()]),r.push([...h,...p.reverse()])}return{bays:o,walls:r}}var Vi=.88,cr=.27,u0=1.2,m0=.01;function Wl(e,t,n,o,r){let i=[.67,.71,.68],a=[i[0]*Vi,i[1]*Vi,i[2]*Vi],s=c=>!!r&&r.some((l,u)=>u!==c&&l?.belowY!=null&&Math.abs(l.belowY-t[c].y)<1e-6&&t[u].blockId===t[c].blockId);for(let c=0;c<t.length;c++){let l=t[c];if(!(l.pts.length<2))for(let u of[0,l.pts.length-1]){let m=l.pts[u],f=l.pts[u===0?1:u-1],d=m.x-f.x,h=m.y-f.y,p=Math.hypot(d,h);if(p<1e-5)continue;d/=p,h/=p;let b=1/0;for(let _=0;_<n.length;_++){let k=n[_],V=n[(_+1)%n.length],O=V.x-k.x,H=V.y-k.y,U=d*H-h*O;if(Math.abs(U)<1e-8)continue;let N=k.x-m.x,L=k.y-m.y,B=(N*H-L*O)/U,D=(N*h-L*d)/U;B>0&&D>=0&&D<=1&&(b=Math.min(b,B))}let y=.3/C,M=b-.04/C;if(!Number.isFinite(b)||b*C>2||M-y<.12/C)continue;let v=!!o&&s(c),A=r?.[c]?.pitch,x=v&&A&&Number.isFinite(A)?Math.min(u0/C,Math.max(cr/C,A-cr/C-m0/C)):cr/C,g=-h,P=d;o&&g*(o.x-m.x)+P*(o.y-m.y)<0&&(g=-g,P=-P);let S=cr/C,w=[{x:m.x+d*y+g*S,y:m.y+h*y+P*S},{x:m.x+d*M+g*S,y:m.y+h*M+P*S},{x:m.x+d*M-g*x,y:m.y+h*M-P*x},{x:m.x+d*y-g*x,y:m.y+h*y-P*x}];if(!w.every(_=>Ze(n,_.x,_.y)))continue;let E=r?.[c]?.belowY,T=E==null?0:l.y-E,F=!!o&&T>.03&&T<=.65;if(F&&o){let _=(k,V)=>Math.hypot((k.x+V.x)/2-o.x,(k.y+V.y)/2-o.y);_(w[0],w[1])>_(w[3],w[2])&&(w=[w[3],w[2],w[1],w[0]])}let R=F?Math.ceil((T-1e-8)/.2):1,I=(_,k,V)=>({x:_.x+(k.x-_.x)*V,y:_.y+(k.y-_.y)*V});for(let _=0;_<R;_++){let k=_/R,V=(_+1)/R,O=[I(w[0],w[3],k),I(w[1],w[2],k),I(w[1],w[2],V),I(w[0],w[3],V)],H=l.y+.008-(F?T*(1-V):0);ue(e,O,void 0,()=>H,H-(F?T/R+.1:.16),i,a,ae)}}}}var f0=.02,d0=.012,h0=.01,p0=.3,b0=.5;function y0(e,t,n){if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u=Math.max(0,Math.min(1,u)),o=Math.min(o,Math.hypot(t-(i.x+u*s),n-(i.y+u*c)))}return o}function g0(e,t,n,o){let r=1/0,i=Number.NaN;for(let a=0;a<e.length;a++){let s=t[a];if(Math.hypot(n-s.cx,o-s.cy)-s.rad>=r)continue;let c=y0(e[a].pts,n,o);c<r&&(r=c,i=e[a].y)}return i}function Xl(e,t,n,o,r,i,a){let s=o.filter(f=>f.pts.length>0);if(s.length<2||t.length<3)return;let c=s.map(f=>{let d=0,h=0;for(let b of f.pts)d+=b.x,h+=b.y;d/=f.pts.length,h/=f.pts.length;let p=0;for(let b of f.pts)p=Math.max(p,Math.hypot(b.x-d,b.y-h));return{cx:d,cy:h,rad:p}}),l=[...t],u=n.map(f=>[...f]),m=f0/C;for(let f of[l,...u])for(let d=0;d<f.length;d++){let h=f[d],p=f[(d+1)%f.length],b=p.x-h.x,y=p.y-h.y,M=Math.hypot(b,y);if(M*C<.05)continue;let v=(h.x+p.x)/2,A=(h.y+p.y)/2,x=y/M,g=-b/M;ze({x:v+x*m,y:A+g*m},l,u)&&(x=-x,g=-g);let P=r.x-v,S=r.y-A,w=Math.hypot(P,S)||1;if((x*P+g*S)/w>b0)continue;let E=1/0;for(let O of[.2,.5,.8]){let H=g0(s,c,h.x+b*O-x*m*2,h.y+y*O-g*m*2);Number.isFinite(H)&&(E=Math.min(E,H))}if(!Number.isFinite(E)||E-i<p0)continue;let T=i-h0,F=E-d0,R={x:(h.x-x*m)*C,z:(h.y-g*m)*C},I={x:(p.x-x*m)*C,z:(p.y-g*m)*C},_=[x,0,g],k=le(a,ae.wallBottom),V=le(a,ae.top);e.tri([R.x,F,R.z],[I.x,F,I.z],[I.x,T,I.z],_,V,V,k),e.tri([R.x,F,R.z],[I.x,T,I.z],[R.x,T,R.z],_,V,k,k)}}function Yl(e,t,n,o,r,i,a,s,c=!1){if(!t.outline||t.outline.length<3)return;let l=n.baseHeightM,u=n.objects.filter(M=>M.type==="shape"&&(M.role==="entrance"||M.role==="exit")),m=Cc(o,s.tierTop);if(!r)return;let f=M=>r.deckAt(M.x,M.y),d=Wc(t,a),h=d[0]??t.outline;if(r.rowLevels.length>=2){let M=Wo(r.rowLevels),v=Xc(Gc(r.rowLevels,n.focal,M),d),A=Ul(Bi(r.rowLevels,n.focal,l),n.focal,Fi);for(let g of v){let P=Math.max(l,g.topY-Kl);for(let S of i.subtract(g.outline,P))Nl(e,S,g.holes,P,l,s.tierTop,s.tierWall,u,!c,A);e.setMaterial(5),Xl(e,g.outline,g.holes,r.rowLevels,n.focal,P,s.tierWall),e.setMaterial(0)}v.length||ue(e,h,t.holes,()=>r.landingY,l,m,s.tierWall,ae);let x={tread:[m[0]*ae.top,m[1]*ae.top,m[2]*ae.top],riser:[m[0]*.72,m[1]*.72,m[2]*.72]};for(let g of d.length?d:[h])zc(e,r.rowLevels,n.focal,r.landingY,x,g,M);jl(e,r.rowLevels,n.focal,l),Wl(e,r.rowLevels,t.outline,n.focal,M);return}let p=r.flat?1/0:tl,b=M=>r.normalAt(M.x,M.y),y=r.flat?r.landingY:void 0;for(let M of i.subtract(h,y))ue(e,M,t.holes,f,l,m,s.tierWall,ae,p,b)}function x0(e,t,n){let o=new Set;for(let a of e.objects)a.type==="section"&&o.add(a.id);let r=new Map;for(let a=0;a<t.length;a++){let s=n.seatOwner[a];if(!s||!o.has(s))continue;let c=n.bySection.get(s);if(c&&c.rowLevels.length>=2)continue;let l=t[a];if(l.kind==="booth")continue;let u=r.get(s);u||(u=new Map,r.set(s,u));let m=l.rowId||`__seat-${a}`,f=u.get(m);f||(f={pts:[],levelM:0,n:0},u.set(m,f)),f.pts.push({x:l.x,y:l.y}),f.levelM+=n.seatDeckY(a),f.n++}let i=[];for(let a of e.objects){if(a.type!=="section")continue;let s=n.bySection.get(a.id);if(s&&s.rowLevels.length>=2){let l=s.rowLevels.filter(u=>!u.patch).map(u=>({pts:u.pts,levelM:u.y}));l.length>=2&&i.push({sectionId:a.id,rows:l});continue}let c=r.get(a.id);c&&i.push({sectionId:a.id,rows:[...c.values()].map(l=>({pts:l.pts,levelM:l.levelM/l.n}))})}return i}function M0(e,t){let n=1/0;for(let o=0;o<t.length;o++){let r=t[o],i=t[(o+1)%t.length],a=i.x-r.x,s=i.y-r.y,c=Math.max(0,Math.min(1,((e.x-r.x)*a+(e.y-r.y)*s)/(a*a+s*s||1)));n=Math.min(n,Math.hypot(e.x-r.x-c*a,e.y-r.y-c*s))}return n}var Kl=.02;function v0(e,t){let n=e.objects.filter(o=>o.type==="section"&&!!o.outline&&o.outline.length>=3).flatMap(o=>{let r=t.bySection.get(o.id);if(!r)return[];let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let u of o.outline)u.x<i&&(i=u.x),u.x>a&&(a=u.x),u.y<s&&(s=u.y),u.y>c&&(c=u.y);let l=r.landingY;for(let u of r.rowLevels)l=Math.min(l,u.y-Kl);return[{outline:o.outline,holes:o.holes,surface:r,floorTop:l,minX:i,maxX:a,minY:s,maxY:c}]});return(o,r,i)=>{let a=null;for(let s of n){if(o<s.minX-i||o>s.maxX+i||r<s.minY-i||r>s.maxY+i)continue;let c={x:o,y:r};if(!ze(c,s.outline,s.holes)&&M0(c,s.outline)>i)continue;let l=Math.min(s.surface.deckAt(o,r),s.floorTop);(a===null||l<a)&&(a=l)}return a}}var S0=3,w0=.4;function $l(e,t,n,o,r,i,a=!0){let s=x0(t,n,o);if(s.length<S0)return;let c=Fl(s,t.focal);if(!c)return;let l=Math.max(0,...c.rings.map(u=>u.arcs.reduce((m,f)=>m+f.binCount,0)))/c.binCount;e.setMaterial(5),Vl(e,c,{bottomY:t.baseHeightM,tierFrontLevels:s.map(u=>Math.min(...u.rows.map(m=>m.levelM))),colors:{bandTop:le(r.tierTop,.8),bandWall:r.tierWall,shellTop:i??le(r.tierWall,1.15),shellWall:i??r.tierWall},ao:ae,shapes:t.objects.filter(u=>u.type==="shape"),deriveShell:a&&l>=w0,standTopNear:v0(t,o)}),e.setMaterial(0)}var Zl=4;var P0=[[/\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"]],A0=1.2,I0=12;function ql(e){if(e.heightM!==void 0)return!1;let t=Me(e);if(!t||t.length<3)return!1;let n=0;for(let r=0;r<t.length;r++){let i=t[r],a=t[(r+1)%t.length];n+=Math.hypot(a.x-i.x,a.y-i.y)}return n*fe<I0*2?!1:2*lo(t)/n*fe<=A0}function Gi(e){if(!e)return null;for(let[t,n]of P0)if(t.test(e))return n;return null}var Jl="auto-rows-";function eu(e){return e.id.startsWith(Jl)&&!e.label}var E0=1.15,R0=.09,tu=6,C0=34,_0=.35,T0=6,L0=.35,k0=.75,O0=12,F0=2.5,D0=40,N0=[18,24],B0=[12,16],Ql=14,V0=.8,G0=.6,H0=5,z0=.3,nu=.4,ou=2,j0=400,U0=2.6,W0=.8,X0=4,Y0=26,K0=.7,$0=.5,Z0=.985,q0=1.5,Q0=2.2,J0=3,ey=25,ty=.985,ny=2,oy=6,ry=3,iy=.1,ay=1.5,sy=1.6,cy=6e3,ly=.6,uy="#c3c7cd",Hi=300,my=240;function fy(e,t,n,o){if(!e.fill||!/^#[0-9a-f]{6}$/i.test(e.fill))return null;let r=ji([...t]),i=new Set;for(let u of o)i.add(Math.floor(Math.atan2(u.y-r.y,u.x-r.x)*180/Math.PI/10));if(i.size*10<my)return null;let{h:a,s,l:c}=Za(Ka(e.fill));return a<70/360||a>170/360||s<.2||c<.08||c>.75||n.some(u=>u!==e&&u.type==="shape"&&Me(u)?.some(m=>Xi(m,t)))?null:e.kind==="ellipse"?"oval-cricket":e.kind==="rect"?"pitch-football":null}var dy="Estimated from the drawing; confirm with the venue.",Ui=e=>{if(!e.length)return null;let t=[...e].sort((o,r)=>o-r),n=Math.floor(t.length/2);return t.length%2?t[n]:(t[n-1]+t[n])/2},ji=e=>({x:e.reduce((t,n)=>t+n.x,0)/e.length,y:e.reduce((t,n)=>t+n.y,0)/e.length}),lo=e=>{let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return Math.abs(t)/2};function hy(e){return e.height!==void 0||e.rake!==void 0||e.elevation!==void 0||e.surfaceKind!==void 0}function Wi(e){let t=new Map;for(let n of e){let o=t.get(n.rowId);o?o.push(n):t.set(n.rowId,[n])}return t}function Xi(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function Yi(e,t){let n=t[0],o=1/0;for(let r=0;r<t.length;r++){let i=t[r],a=t[(r+1)%t.length],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>0?Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l)):0,m={x:i.x+s*u,y:i.y+c*u},f=Math.hypot(e.x-m.x,e.y-m.y);f<o&&(o=f,n=m)}return n}function ru(e,t){let n=0,o=0;for(let r of e.values()){if(r.length<3)continue;let i=r[0],a=r[r.length-1],s=a.x-i.x,c=a.y-i.y,l=Math.hypot(s,c);if(l<1e-6)continue;let u={x:(i.x+a.x)/2,y:(i.y+a.y)/2},m=Yi(u,t),f=m.x-u.x,d=m.y-u.y,h=Math.hypot(f,d);h<1e-6||(o+=Math.abs((-c*f+s*d)/(l*h))*r.length,n+=r.length)}return n?o/n:0}function py(e,t,n){let o=e.filter(p=>p.type==="shape"),r=o.find(p=>p.role==="stage");if(r){let p=Me(r);return p?{shape:r,centre:ji(p),outline:p,inferred:!1}:null}if(!n.length)return null;let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let p of n)i=Math.min(i,p.x),a=Math.max(a,p.x),s=Math.min(s,p.y),c=Math.max(c,p.y);let l=(a-i)*(c-s),u=[];for(let p of o){if(p.role)continue;let b=Me(p);if(!b)continue;let y=lo(b);if(y*fe*fe<6||y>l)continue;let M=Math.min(...b.map(w=>w.x)),v=Math.max(...b.map(w=>w.x)),A=Math.min(...b.map(w=>w.y)),x=Math.max(...b.map(w=>w.y)),g=0;for(let w of n)w.x>M&&w.x<v&&w.y>A&&w.y<x&&Xi(w,b)&&g++;if(g>n.length*.05)continue;let P=ji(b),S=ru(t,b);S>=V0&&u.push({shape:p,centre:P,outline:b,score:S,area:y,box:[M,A,v,x]})}let m=(p,b)=>b!==p&&b.area>p.area&&p.box[0]>=b.box[0]-1e-6&&p.box[1]>=b.box[1]-1e-6&&p.box[2]<=b.box[2]+1e-6&&p.box[3]<=b.box[3]+1e-6,f=u.filter(p=>!u.some(b=>m(p,b))),d=Math.max(0,...f.map(p=>p.score)),h=f.filter(p=>p.score>=d-.03).sort((p,b)=>b.area-p.area)[0]??null;return h?{shape:h.shape,centre:h.centre,outline:h.outline,inferred:!0}:null}function by(e,t,n){if(!n||n.length<3)return Math.hypot(e.x-t.x,e.y-t.y);let o=Yi(e,n);return Math.hypot(e.x-o.x,e.y-o.y)}function iu(e){let t=[...e].sort((i,a)=>i.x-a.x||i.y-a.y);if(t.length<3)return t;let n=(i,a,s)=>(a.x-i.x)*(s.y-i.y)-(a.y-i.y)*(s.x-i.x),o=[];for(let i of t){for(;o.length>=2&&n(o[o.length-2],o[o.length-1],i)<=0;)o.pop();o.push(i)}let r=[];for(let i=t.length-1;i>=0;i--){let a=t[i];for(;r.length>=2&&n(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a)}return[...o.slice(0,-1),...r.slice(0,-1)]}function yy(e){if(!e.length||e.length>cy)return[];let t=[...Wi(e).values()],n=t.map((s,c)=>c),o=s=>n[s]===s?s:n[s]=o(n[s]),r=sy/fe,i=t.map(s=>({minX:Math.min(...s.map(c=>c.x))-r,maxX:Math.max(...s.map(c=>c.x))+r,minY:Math.min(...s.map(c=>c.y))-r,maxY:Math.max(...s.map(c=>c.y))+r}));for(let s=0;s<t.length;s++)for(let c=s+1;c<t.length;c++){let l=i[s],u=i[c];if(l.maxX<u.minX||u.maxX<l.minX||l.maxY<u.minY||u.maxY<l.minY)continue;t[s].some(f=>t[c].some(d=>Math.hypot(f.x-d.x,f.y-d.y)<=r))&&(n[o(s)]=o(c))}let a=new Map;return t.forEach((s,c)=>{let l=o(c),u=a.get(l);u?u.push(...s):a.set(l,[...s])}),[...a.values()].filter(s=>new Set(s.map(c=>c.rowId)).size>=2)}function gy(e,t,n){if(!t.length)return null;let o=t.filter(S=>n.tableIds.has(S.rowId)||S.kind==="booth").length>t.length/2,r=Wi(t),i=!n.outline||ru(r,n.outline)>=G0,a=0,s=0;for(let S of r.values()){if(S.length<2)continue;let w=S[0],E=S[S.length-1],T=E.x-w.x,F=E.y-w.y,R=Math.hypot(T,F);if(R<1e-6)continue;let I={x:(w.x+E.x)/2,y:(w.y+E.y)/2},_=i?n.outline?Yi(I,n.outline):n.focal:n.middle,k=-F/R,V=T/R;k*(_.x-I.x)+V*(_.y-I.y)<0&&(k=-k,V=-V),a+=k*S.length,s+=V*S.length}let c={x:t.reduce((S,w)=>S+w.x,0)/t.length,y:t.reduce((S,w)=>S+w.y,0)/t.length};if(Math.hypot(a,s)<1e-9){let S=i?n.focal:n.middle;a=S.x-c.x,s=S.y-c.y}let l=Math.hypot(a,s)||1,u={x:a/l,y:s/l},m=S=>-(S.x*u.x+S.y*u.y),f=S=>-S.x*u.y+S.y*u.x,d=1/0,h=-1/0,p=1/0,b=-1/0,y=1/0,M=new Map;for(let S of t){let w=m(S),E=f(S);d=Math.min(d,w),h=Math.max(h,w),p=Math.min(p,E),b=Math.max(b,E),i&&(y=Math.min(y,by(S,n.focal,n.outline)));let T=S.logicalRowId??S.rowId,F=M.get(T);F?F.push(w):M.set(T,[w])}i||(y=Math.max(0,d-m(n.middle)));let v=[...M.values()].map(S=>Ui(S)).sort((S,w)=>S-w),A=[];if(!o)for(let S of v)A.length&&S-A[A.length-1]<L0/fe||A.push(S);let x=hy(e),g=Ct(e,{floorBaseHeightM:n.baseHeightM}),P={id:e.id,section:e,authored:x,plane:n,facing:u,facesAction:i,hull:iu(t),sample:t.filter((S,w)=>w%Math.ceil(t.length/j0)===0),frontD:d,backD:h,latMin:p,latMax:b,frontDistance:y,rowDepths:A,rowCount:A.length,level:0,height:g.height,rake:x?g.rake:0,backHeight:0};return P.backHeight=P.height+(h-d)*fe*Math.tan(P.rake*Math.PI/180),P}function xy(e,t,n,o){if(e.length<2)return 0;let r=Math.max(1,t*fe),i=n+E0-o,a=0,s=0;for(let l=1;l<e.length;l++){let u=Math.max(k0,(e[l]-e[l-1])*fe),m=(i+R0)*(r+u)/r;a+=m-i,s+=u,i=m,r+=u}let c=Math.atan(a/s)*180/Math.PI;return Math.round(Math.max(tu,Math.min(C0,c))*10)/10}function My(e,t,n=!1){if(!n&&e.facing.x*t.facing.x+e.facing.y*t.facing.y<z0)return null;let o=-1/0,r=1/0,i=-1/0;for(let f of t.hull){o=Math.max(o,-(f.x*e.facing.x+f.y*e.facing.y));let d=-f.x*e.facing.y+f.y*e.facing.x;r=Math.min(r,d),i=Math.max(i,d)}if(Math.min(e.latMax,i)-Math.max(e.latMin,r)<(n?1e-6:nu*(e.latMax-e.latMin)))return null;let s=ou/fe,c=new Map,l=new Map;for(let f of e.sample){let d=Math.floor((-f.x*e.facing.y+f.y*e.facing.x)/s),h=-(f.x*e.facing.x+f.y*e.facing.y);c.set(d,Math.min(c.get(d)??1/0,h))}for(let f of t.sample){let d=Math.floor((-f.x*e.facing.y+f.y*e.facing.x)/s),h=-(f.x*e.facing.x+f.y*e.facing.y);l.set(d,Math.max(l.get(d)??-1/0,h))}let u=[];for(let[f,d]of c){let h=l.get(f);h!==void 0&&u.push(d-h)}let m=u.length?Ui(u):e.frontD-o;return m<-1/fe?null:m}function vy(e,t){if(t.plane.floorIndex>=e.plane.floorIndex)return!1;let n=-1/0,o=1/0,r=1/0,i=-1/0;for(let c of t.hull){let l=-(c.x*e.facing.x+c.y*e.facing.y);n=Math.max(n,l),o=Math.min(o,l);let u=-c.x*e.facing.y+c.y*e.facing.x;r=Math.min(r,u),i=Math.max(i,u)}let a=Math.min(e.latMax,i)-Math.max(e.latMin,r),s=Math.min(e.backD,n)-Math.max(e.frontD,o);return a>nu*(e.latMax-e.latMin)&&s>1/fe}function Sy(e,t){let n=new Set;for(let o of e){let r=(Math.atan2(o.y-t.y,o.x-t.x)*180/Math.PI+360)%360;n.add(Math.floor(r/10))}return n.size/36}function wy(e,t){let n=1/0,o=-1/0;for(let i of t.hull){let a=-(i.x*e.facing.x+i.y*e.facing.y);n=Math.min(n,a),o=Math.max(o,a)}let r=Math.max(0,Math.min(o-n,e.frontD-n));return t.height+r*fe*Math.tan(t.rake*Math.PI/180)}function Py(e,t){if(!e.facesAction)return!1;let n={x:-e.facing.y,y:e.facing.x},o=ou/fe,r=Math.max(1,Math.ceil((e.backD-e.frontD)/o)),i={left:new Map,right:new Map};for(let s of t)if(!(s===e||s.plane.floorIndex!==e.plane.floorIndex)&&!(s.facing.x*e.facing.x+s.facing.y*e.facing.y>=Z0))for(let c of s.sample){let l=-(c.x*e.facing.x+c.y*e.facing.y);if(l<e.frontD||l>e.backD)continue;let u=-c.x*e.facing.y+c.y*e.facing.x,m=u<e.latMin?"left":u>e.latMax?"right":null;if(!m)return!1;let f=Math.min(r-1,Math.floor((l-e.frontD)/o)),d=m==="left"?e.latMin-u:u-e.latMax;d<(i[m].get(f)?.gap??1/0)&&i[m].set(f,{gap:d,other:s})}let a=s=>{let c=s==="left"?e.latMin:e.latMax,l=0;for(let[u,{other:m}]of i[s]){if((m.facing.x*n.x+m.facing.y*n.y)*(s==="left"?1:-1)<K0)continue;let d=e.frontD+(u+.5)*o,h={x:-d*e.facing.x+c*n.x,y:-d*e.facing.y+c*n.y},p=-(h.x*m.facing.x+h.y*m.facing.y),b=-h.x*m.facing.y+h.y*m.facing.x;p<m.frontD&&b>=m.latMin&&b<=m.latMax&&l++}return l/r>=$0};return a("left")&&a("right")}function Ay(e,t){if(t.plane.floorIndex!==e.plane.floorIndex||t.facing.x*e.facing.x+t.facing.y*e.facing.y<ty)return!1;let n=1/0,o=-1/0,r=1/0;for(let s of t.hull){let c=-s.x*e.facing.y+s.y*e.facing.x;n=Math.min(n,c),o=Math.max(o,c),r=Math.min(r,-(s.x*e.facing.x+s.y*e.facing.y))}let i=(e.frontD-r)*fe;if(i<-ny||i>oy)return!1;let a=Math.max(n-e.latMax,e.latMin-o);return a*fe<=ry&&a*fe>=-iy}function Iy(e,t=!1,n=!1,o){let r=t?B0:N0,i=new Set(n?[]:e.filter(p=>!p.authored&&Py(p,e))),a=[...e].sort((p,b)=>p.plane.floorIndex-b.plane.floorIndex||Number(i.has(b))-Number(i.has(p))||p.frontDistance-b.frontDistance);for(let p of i)o?.add(p.id);let s=(p,b,y)=>{let M=new Map,v=[],A=new Map,x=g=>{if(g.plane.floorIndex===0||g.plane.baseHeightM>0)return g.plane.baseHeightM;let P=A.get(g.plane.floorIndex-1);return P===void 0?g.plane.baseHeightM:P+Zl};for(let g of a){if(i.has(g))g.height=x(g),g.level=0,g.rake=0,g.backHeight=g.height,M.set(g.id,void 0);else if(!g.authored){let S=x(g),w;for(let I of v){if(I.plane.floorIndex>g.plane.floorIndex)continue;if(vy(g,I)){let O=wy(g,I)+U0;O>S&&(S=O,w=I);continue}let _=My(g,I,i.has(I));if(_==null)continue;let k=n&&!!g.plane.stageDeck&&I.level===0&&I.plane.floorIndex===g.plane.floorIndex&&Math.max(0,_)*fe<=X0,V=i.has(I)?I.height+q0:k?I.backHeight:I.backHeight+_0+Math.min(T0,Math.max(0,_)*fe)*Math.tan(I.rake*Math.PI/180);V>S&&(S=V,w=I)}let E=p.get(g);E&&E.height>S+.01?(S=E.height,w=void 0):E=void 0,g.height=Math.round(Math.min(S,g.plane.baseHeightM+D0)*100)/100;let T=!w&&!E&&g.height>g.plane.baseHeightM;if(g.level=w?w.level+1:E?E.level:T?1:0,g.rake=xy(g.rowDepths,g.frontDistance,g.height,g.plane.focalHeightM),!g.facesAction&&g.rowCount<H0)g.rake=0;else if(g.level===0){let I=Math.max(1e-6,(g.backD-g.frontD)*fe);g.rake=Math.min(g.rake,O0,Math.round(Math.atan(F0/I)*1800/Math.PI)/10)}else g.rowCount>=2&&(g.rake=Math.max(g.rake,r[Math.min(g.level,r.length)-1]));let F=(g.backD-g.frontD)*fe,R=w&&i.has(w)||E&&y?.has(E.id);if(b!==void 0&&R&&g.rowCount>=2&&(g.rake=b),t&&F>0&&g.height+F*Math.tan(g.rake*Math.PI/180)>g.plane.baseHeightM+Ql){let I=Math.max(0,g.plane.baseHeightM+Ql-g.height);g.rake=Math.max(tu,Math.round(Math.atan(I/F)*1800/Math.PI)/10)}n&&g.plane.stageDeck&&g.level>0&&(g.rake=Math.min(g.rake,Y0)),g.backHeight=g.height+F*Math.tan(g.rake*Math.PI/180),M.set(g.id,w?.id??(E?M.get(E.id):void 0))}let P=g.plane.floorIndex;A.set(P,Math.min(A.get(P)??1/0,g.height)),v.push(g)}return M},c=s(new Map),l=new Map,u=p=>l.get(p)?.height??p.height;for(let p=!0,b=0;p&&b<e.length;b++){p=!1;for(let y of e)if(!(y.authored||i.has(y)))for(let M of e){let v=l.get(M)??M;M===y||v.height-v.plane.baseHeightM<ay||v.height<=u(y)+.01||Ay(y,M)&&(l.set(y,v),p=!0)}}let m=new Map(e.map(p=>[p.id,p])),f=e.filter(p=>!p.authored&&p.rowCount>=2&&i.has(m.get(c.get(p.id)??""))),d=f.length?Ui(f.map(p=>p.rake)):void 0;if(!l.size&&d===void 0)return c;let h=new Map([...new Set(l.values())].map(p=>[p,{...p}]));return s(new Map([...l].map(([p,b])=>[p,h.get(b)])),d,new Set(f.map(p=>p.id)))}var zi=(e,t)=>!!e&&e.x===t.x&&e.y===t.y;function lr(e,t={x:0,y:-40}){let n=dn(e),o=new Map;for(let y of n){if(!y.sectionId)continue;let M=o.get(y.sectionId);M?M.push(y):o.set(y.sectionId,[y])}let r={focalInferred:!1,confident:!1,sections:[]},i=e.floors?.length?e.floors.map((y,M)=>({objects:y.objects,floorIndex:M,floorId:y.id,baseHeightM:y.baseHeightM??0,focal:y.focalPoint??e.focalPoint})):[{objects:e.objects,floorIndex:0,floorId:void 0,baseHeightM:0,focal:e.focalPoint}],a=new Set(i.flatMap(y=>y.objects.filter(M=>M.type==="table").map(M=>M.id))),s=[],c,l=new Set,u=i.map(y=>{let M=R=>!e.floors?.length||R.floorId===y.floorId,v=yy(n.filter(R=>!R.sectionId&&R.kind!=="booth"&&!a.has(R.rowId)&&M(R))),A=[];for(let R of v){let I=st(pt(iu(R)),ly/fe);if(n.some(k=>!M(k)&&Xi(k,I)))continue;let _=`${Jl}${y.floorIndex}-${A.length}`;l.add(_),o.set(_,R),A.push({type:"section",id:_,label:"",color:uy,outline:I})}let x=A.length?{...y,objects:[...y.objects,...A]}:y,g=new Set(x.objects.filter(R=>R.type==="section").map(R=>R.logicalSectionId??R.id)),P=[...o.entries()].filter(([R])=>g.has(R)).flatMap(([,R])=>R),S=py(x.objects,Wi(P),P),w=x.focal;(S||x.focal&&!zi(x.focal,t))&&(r.confident=!0),S&&(r.stage??={id:S.shape.id,inferred:S.inferred,...x.floorId?{floorId:x.floorId}:{}},(S.inferred||zi(x.focal,t))&&(w=S.centre,r.focalInferred=!0));let E=S&&(!S.inferred||lo(S.outline)*fe*fe<=Hi),T=S?void 0:c,F={tableIds:a,floorIndex:x.floorIndex,floorId:x.floorId,baseHeightM:x.baseHeightM,focal:T?.focal??w,outline:S?.outline??T?.outline,focalHeightM:T?.focalHeightM??x.baseHeightM+(S&&E?lt({...S.shape,role:"stage"}).heightM:0),stageDeck:T?.stageDeck??!!(S&&E&&lo(S.outline)*fe*fe<=Hi),middle:P.length?{x:P.reduce((R,I)=>R+I.x,0)/P.length,y:P.reduce((R,I)=>R+I.y,0)/P.length}:w};for(let R of x.objects){if(R.type!=="section")continue;let I=gy(R,o.get(R.logicalSectionId??R.id)??[],F);I&&s.push(I)}return F.outline&&(c=F),zi(x.focal,F.focal)||(r.focal??=[]).push({...x.floorId?{floorId:x.floorId}:{},point:{...F.focal}}),{unit:x,plane:F,stage:S,planeSeats:P}}),m=i.flatMap(y=>y.objects).map(y=>y.type==="shape"&&!y.role&&(Gi(y.label)==="wall"||!Gi(y.label)&&ql(y))?{...y,role:"wall"}:y),f=kt({objects:m},n)!==null;f&&(r.indoor=!0);let d=new Set,h=Iy(s,f,Sy(n,u[0]?.plane.focal??t)<W0,d),p=new Map(s.filter(y=>!y.authored).map(y=>[y.id,y])),b=u.map(({unit:y,plane:M,stage:v,planeSeats:A})=>y.objects.map(x=>{let g=x.type==="shape"&&!x.role&&x.id!==v?.shape.id?Gi(x.label):null;if(x.type==="shape"&&!x.role&&x.id!==v?.shape.id&&(g==="wall"||!g&&ql(x))&&x.type==="shape"){(r.roles??=[]).push({id:x.id,...M.floorId?{floorId:M.floorId}:{},role:"wall"});let{fill:I,..._}=x;return{..._,role:"wall"}}if(g&&x.type==="shape")return(r.roles??=[]).push({id:x.id,...M.floorId?{floorId:M.floorId}:{},role:g}),{...x,role:g};let S=v?.inferred&&x.id===v.shape.id&&x.type==="shape"?fy(x,v.outline,y.objects,A):null;if(S&&x.type==="shape")return r.stage?.id===x.id&&(r.stage.field=S),{...x,role:"stage",stageKind:S};let w=x.type==="shape"&&x.id===v?.shape.id&&x.heightM===void 0&&!x.stageKind&&s.some(I=>I.plane===M&&(d.has(I.id)||I.level===0&&I.facesAction&&I.rake<=J0&&(I.frontDistance+I.backD-I.frontD)*fe>=ey)),E=w?{heightM:Q0}:{};if(v?.inferred&&x.id===v.shape.id&&x.type==="shape"&&lo(v.outline)*fe*fe<=Hi)return r.stage?.id===x.id&&(r.stage.deck=!0),{...x,role:"stage",...E};if(w&&x.type==="shape"&&x.role==="stage")return{...x,...E};let T=x.type==="section"?p.get(x.id):void 0;if(!T||x.type!=="section")return x;let F=T.rowCount>=2&&T.rake>0;l.has(T.id)?r.looseRowBlocks=(r.looseRowBlocks??0)+1:r.sections.push({id:T.id,floorId:M.floorId,surfaceKind:F?"rakedRows":"flat",height:T.height,rake:T.rake,stackedOn:h.get(T.id)});let R={status:"inferred",source:"public-2d-topology",note:dy};return{...x,height:T.height,rake:T.rake,surfaceKind:F?"rakedRows":"flat",physical3dProvenance:{height:R,rake:R,surfaceKind:R}}}));if(e.floors?.length){let y=e.floors.map((M,v)=>({...M,objects:b[v],focalPoint:u[v].plane.focal}));return{doc:{...e,floors:y,objects:y[0].objects,focalPoint:y[0].focalPoint},report:r}}return{doc:{...e,objects:b[0],focalPoint:u[0].plane.focal},report:r}}var au=/^[\p{L}\p{N}]{1,4}$/u,Ey=/^([\p{L}\p{N}]{2,})[\s\-\u2013\u2014\u00b7_./]+(.+)$/u;function su(e,t){let n=t?.trim();if(!n)return e;let o=e.toLocaleLowerCase("en-US"),r=n.toLocaleLowerCase("en-US");if(o.startsWith(`${r} `)){let a=e.slice(n.length).trim();if(au.test(a))return a}let i=Ey.exec(e);if(i){let a=i[1].toLocaleLowerCase("en-US"),s=i[2].trim();if((r.startsWith(a)||a.startsWith(r))&&au.test(s))return s}return e}var cu={inline:"Inline booth \xB7 1 open side",corner:"Corner booth \xB7 2 open sides",peninsula:"Peninsula booth \xB7 3 open sides",island:"Island booth \xB7 4 open sides"},Ry=new Map(Jr.map(e=>[e.key,e.label]));function Cy(e){return`picker.access.${e}`}function lu(e){let t=[],n=e.boothType;n&&Object.prototype.hasOwnProperty.call(cu,n)&&t.push({key:`booth:${n}`,icon:"booth",titleKey:`picker.boothType.${n}`,titleFallback:cu[n],tone:"place"});let o=e.wheelchairSpaceType;for(let s of e.accessibility??[]){if(s==="wheelchair"&&o)continue;let c=Ry.get(s);c&&t.push({key:`access:${s}`,icon:s,titleKey:Cy(s),titleFallback:c,tone:"access"})}o==="no-seat"?t.push({key:"wheelchair:no-seat",icon:"wheelchair",titleKey:"picker.emptyWheelchairSpace",titleFallback:"Empty wheelchair space",tone:"access"}):o==="seat-present"&&t.push({key:"wheelchair:seat-present",icon:"wheelchair",titleKey:"picker.accessiblePhysicalSeat",titleFallback:"Accessible physical seat",tone:"access"}),e.aisle===!0&&t.push({key:"place:aisle",icon:"aisle",titleKey:"picker.aisleSeat",titleFallback:"Aisle seat",tone:"place"});let r=e.commercial;r?.restrictedView&&t.push({key:"mark:restrictedView",icon:"restrictedView",titleKey:"picker.restrictedView",titleFallback:"Restricted view",tone:"warn"}),r?.obstructedView&&t.push({key:"mark:obstructedView",icon:"obstructedView",titleKey:"picker.obstructedView",titleFallback:"Obstructed view",tone:"warn"}),r?.premium&&t.push({key:"mark:premium",icon:"premium",titleKey:"picker.premiumSeat",titleFallback:"Premium seat",tone:"premium"});let i=r?.note?.trim();if(i){let s=t.find(c=>c.tone==="warn"||c.tone==="premium");s?s.note=i:t.push({key:"note",icon:"note",titleKey:"picker.organizerNote",titleFallback:"Organizer note",tone:"note",note:i})}let a=typeof e.entrance=="string"?e.entrance.trim():"";return a&&t.push({key:"place:entrance",icon:"entrance",titleKey:"picker.entrance",titleFallback:"Entrance",tone:"place",note:a}),t}function uu(e,t,n){return n<0?t>1?e.filter(o=>o.kind==="floor"):[...e]:e.filter(o=>o.floorIndex===void 0||o.floorIndex===n)}function mu(e,t){let n=[...e].sort((r,i)=>r.screen.y-i.screen.y),o=[];for(let r of n){let i=o.find(a=>a.some(s=>Math.abs(s.screen.x-r.screen.x)<104&&Math.abs(s.screen.y-r.screen.y)<34));i?i.push(r):o.push([r])}return o.flatMap(r=>r.length<2?r:r.map((i,a)=>({...i,screen:{...i.screen,x:Math.max(54,Math.min(t-54,i.screen.x+(a-(r.length-1)/2)*104))}})))}var _y=1.15,Ty=2.75,Ly=4.5,ky=.85,Oy=.5,Fy=.26;function fu(e,t,n){let o=Math.max(1e-6,t),r=e/o,i=n?.hasZoneLabels??!0,a=new Set(["stage","gate"]);return r>=.75&&a.add("floor"),r>=_y&&a.add("zone"),r<=(i?Ty:Ly)&&(a.add("section"),a.add("ga")),r<=ky&&(a.add("annotation"),a.add("booth")),r<=Oy&&a.add("row"),r<=Fy&&a.add("seat"),a}function du(e,t,n,o,r,i=6){let a=i+t,s=o-i-t,c=i+n,l=r-i-n;return{...e,x:a>s?o/2:Math.max(a,Math.min(s,e.x)),y:c>l?r/2:Math.max(c,Math.min(l,e.y))}}function gt(e,t,n,o){let r=e,i=t[0],a=t[1],s=t[2],c=r[0]*i+r[4]*a+r[8]*s+r[12],l=r[1]*i+r[5]*a+r[9]*s+r[13],u=r[2]*i+r[6]*a+r[10]*s+r[14],m=r[3]*i+r[7]*a+r[11]*s+r[15];if(!(m>1e-6))return{x:0,y:0,depth:1/0,visible:!1};let f=c/m,d=l/m,h=u/m,p=f>=-1.05&&f<=1.05&&d>=-1.05&&d<=1.05&&h<=1;return{x:(f*.5+.5)*n,y:(1-(d*.5+.5))*o,depth:h,visible:p}}function hu(e,t,n=t,o=()=>0){let r=[],i=[...e].sort((a,s)=>o(s)-o(a)||a.screen.depth-s.screen.depth);for(let a of i){let s=!1;for(let c of r)if(uo(a,c,t,n)){s=!0;break}s||r.push(a)}return r}var Dy=6;function uo(e,t,n,o){let r=Math.abs(e.screen.x-t.screen.x),i=Math.abs(e.screen.y-t.screen.y),a=e.halfWidth!=null&&t.halfWidth!=null?Math.max(n,e.halfWidth+t.halfWidth+Dy):n;return r<a&&i<o}function pu(e,t,n){return e.length*t*.58+(n?14:0)}var Ny={row:8,seat:14};function bu(e){return e<480?{row:5,seat:8}:e<768?{row:6,seat:10}:Ny}function yu(e,t,n,o){let r=Math.max(1,Math.min(n,o)*.5),i=Math.min(2,Math.hypot(e.x-n/2,e.y-o/2)/r);return t*(1+1.5*i)}function mo(e,t,n,o,r=[]){let i=[...e].sort((s,c)=>(c.priority??0)-(s.priority??0)||s.focus-c.focus),a=[];for(let s of i){if(a.length>=o)break;let c=!1;for(let l of r)if(uo(s,l,t,n)){c=!0;break}if(!c){for(let l of a)if(uo(s,l,t,n)){c=!0;break}}c||a.push(s)}return a}function Ki(e,t,n,o){let r=e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15];return r<=0||!(n>0)?0:n*Math.hypot(e[0],e[4],e[8])*o/(2*r)}var By=1.5,Vy=30,Gy=4,Hy=3.6,zy=6,$i=15,jy=3,Uy=1;function Wy(e){return Math.max(Hy,Math.min(zy,2.4+.15*e))}var fo=Math.PI*2;function Xy(e,t){let n=0,o=0;for(let m of e)n+=m.x,o+=m.y;let r=Math.atan2(o/e.length-t.y,n/e.length-t.x),i=e.map(m=>{let f=Math.atan2(m.y-t.y,m.x-t.x)-r;for(;f>Math.PI;)f-=fo;for(;f<-Math.PI;)f+=fo;return f+r}),a=i.map((m,f)=>f).sort((m,f)=>i[m]-i[f]),s=i[a[0]],c=i[a[a.length-1]];if(c-s>Math.PI)return null;let l=m=>Math.hypot(m.x-t.x,m.y-t.y),u=m=>{let f=e[m],d=(m+e.length-1)%e.length,h=(m+1)%e.length,p=Math.abs(i[d]-i[m])<=Math.abs(i[h]-i[m])?d:h,b=e[p];return l(f)<=l(b)?[f,b]:[b,f]};return{start:s,end:c,startEdge:u(a[0]),endEdge:u(a[a.length-1])}}function gu(e){return e.type==="shape"&&e.role==="wall"&&e.heightM===void 0}function Zi(e,t,n=()=>!0){let o=[];for(let c of e){if(!gu(c)||!n(c))continue;let l=Me(c);if(!l||l.length<3)continue;let u=Xy(l,t);if(!u)return[];o.push(u)}if(o.length<2)return[];let r=e.flatMap(c=>{if(c.type!=="shape"||c.role!=="entrance"&&c.role!=="exit")return[];let l=Me(c);if(!l?.length)return[];let u=0,m=0;for(let f of l)u+=f.x,m+=f.y;return[{x:u/l.length,y:m/l.length}]}),i=c=>(c%fo+fo)%fo;o.sort((c,l)=>i(c.start)-i(l.start));let a=c=>Math.hypot(c.x-t.x,c.y-t.y),s=[];for(let c=0;c<o.length;c++){let l=o[c],u=o[(c+1)%o.length],m=i(u.start-l.end);if(m<=0||m>=Math.PI/2)continue;let f=g=>i(g-l.end)<m;if(o.some(g=>g!==l&&g!==u&&(f(g.start)||f(g.end)||i(l.end-g.start)<g.end-g.start)))continue;let[h,p]=l.endEdge,[b,y]=u.startEdge,M={x:(h.x+p.x)/2,y:(h.y+p.y)/2},v={x:(b.x+y.x)/2,y:(b.y+y.y)/2},A=Math.hypot(v.x-M.x,v.y-M.y)*C;if(A<By||A>Vy||Math.abs(a(M)-a(v))*C>Gy+.2*A)continue;let x={x:(M.x+v.x)/2,y:(M.y+v.y)/2};r.some(g=>f(Math.atan2(g.y-t.y,g.x-t.x))&&Math.abs(a(g)-a(x))*C<=jy)||s.push({quad:[h,p,y,b],mid:x,widthM:A,openingM:Wy(A)})}return s}function xu(e,t){let n=[];for(let i of t)if(i.text?.trim())for(let a of e){let s=Math.hypot(i.position.x-a.mid.x,i.position.y-a.mid.y)*C;s<=$i&&n.push({text:i,gate:a,d:s})}n.sort((i,a)=>i.d-a.d);let o=new Map,r=new Set;for(let{text:i,gate:a}of n)o.has(i.id)||r.has(a)||(o.set(i.id,a),r.add(a));return o}function Mu(e,t,n,o,r,i,a,s=()=>!0){let c=Zi(t,vn(n),s);if(!c.length)return;let l=t.find(m=>gu(m)&&s(m)),u=nr(l?.fill,a);e.setMaterial(Yo);for(let m of c)r-m.openingM<Uy||$o(e,m.quad,o+m.openingM,o+r,[],u.top,u.wall,i,r);e.setMaterial(0)}var Yy=6,Ky=2.2,ur=.1,$y=/^(gate|entrance|entry|exit|way in|way out|door)s?$/i,Zy=new Set(["stage","entrance","exit","screen","suite","obstruction","sound","bar","concession","restroom","coat"]),qy=.3,Qy=1.8,Jy=.9,eg=.55,tg=1,vu=4e3,ng=6,Su="#d8a425",og="#e8c15a",qi="#1c1608";function wu(e){let t=rg(e);if(!t)return null;let n=lu(e).find(o=>o.icon===t.icon);return{...t,name:n?.titleFallback??t.icon}}function rg(e){let t=e.accessibility;if(t?.length)return{icon:t.includes("wheelchair")?"wheelchair":t[0],color:Co(t)};let n=e.commercial;return n?.obstructedView?{icon:"obstructedView",color:Su,ink:qi}:n?.restrictedView?{icon:"restrictedView",color:Su,ink:qi}:n?.premium?{icon:"premium",color:og,ink:qi}:null}function ig(e,t){if(!e)return;let n,o=0;for(let[i,a]of e)a>o&&(o=a,n=i);let r=t.categories?.find(i=>i.key===n)?.color;return r&&/^#[0-9a-f]{6}$/i.test(r)?r:void 0}var ag=6e3,sg=.25,Pu=[-90,90,-135,135,-45,45];function cg(e,t,n,o){let r=e.flatMap(({id:a,a:s,members:c})=>{let l=(s.minX+s.maxX)/2,u=(s.minY+s.maxY)/2,m=.5*Math.hypot(s.maxX-s.minX,s.maxY-s.minY),f=1/0;for(let d of c)f=Math.min(f,Math.hypot(t[d].x-l,t[d].y-u));return c.length&&f>=m*sg?[{id:a,cx:l,cy:u,half:m,members:c}]:[]}).sort((a,s)=>a.half-s.half),i=new Map;return r.forEach(({id:a,cx:s,cy:c,members:l},u)=>{let m=o.x-s,f=o.y-c,p=(Math.hypot(m,f)>1e-6?Math.atan2(f,m):0)+Pu[u%Pu.length]*Math.PI/180,b=Math.cos(p),y=Math.sin(p),M=-1,v=-1/0;for(let A of l){let x=(t[A].x-s)*b+(t[A].y-c)*y;x>v&&(v=x,M=A)}i.set(a,[t[M].x*C,n.seatDeckY(M),t[M].y*C])}),i}function Iu(e){let{doc:t,units:n,seats:o,surfaces:r,focal:i}=e,a=t.zones??[],s=[];if(a.length){let c=new Map;for(let f of n)for(let d of f.objects)d.type==="section"&&d.zone&&c.set(d.id,d.zone);let l=new Map,u=new Map;for(let f=0;f<o.length;f++){let d=o[f],h=r.seatOwner[f],p=d.zoneId??(h?c.get(h):void 0);if(!p)continue;let b=l.get(p);b||(b={n:0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,sumY:0},l.set(p,b));let y=u.get(p);y||u.set(p,y=[]),y.push(f),b.n++,d.x<b.minX&&(b.minX=d.x),d.y<b.minY&&(b.minY=d.y),d.x>b.maxX&&(b.maxX=d.x),d.y>b.maxY&&(b.maxY=d.y),b.sumY+=r.seatDeckY(f)}let m=cg(a.flatMap(f=>{let d=l.get(f.id);return d?[{id:f.id,a:d,members:u.get(f.id)??[]}]:[]}),o,r,i);for(let f of a){let d=l.get(f.id),h=[];for(let[p,b]of c)b===f.id&&h.push(p);if(!d||d.n===0){s.push({id:f.id,label:f.label,color:be(f.color),sectionIds:h,seatCount:0,center:[0,0,0],radius:0,focalWorld:[(f.focalPoint??i).x*C,1.5,(f.focalPoint??i).y*C]});continue}s.push({id:f.id,label:f.label,color:be(f.color),sectionIds:h,seatCount:d.n,...m.has(f.id)?{labelAt:m.get(f.id)}:{},center:[(d.minX+d.maxX)/2*C,d.sumY/d.n,(d.minY+d.maxY)/2*C],radius:.5*Math.hypot((d.maxX-d.minX)*C,(d.maxY-d.minY)*C)||1,focalWorld:[(f.focalPoint??i).x*C,1.5,(f.focalPoint??i).y*C]})}}return s}function Eu(e){let{doc:t,units:n,seats:o,surfaces:r,seatData:i,hintedSeatFloor:a,zones:s,focal:c}=e,l=[],u=[],m=[],f=new Map;for(let d of n)for(let h of d.objects){if(h.type!=="section"||!h.zone)continue;let p=(h.displayLabel||h.label||"").trim().toLocaleLowerCase();if(!p)continue;let b=t.floors?.[d.index]?.name?.trim().toLocaleLowerCase();if(n.length>1&&b===p)continue;let y=f.get(h.zone);y||f.set(h.zone,y=new Set),y.add(p)}for(let d of s)d.seatCount!==0&&(f.get(d.id)?.has(d.label.trim().toLocaleLowerCase())||l.push({id:`zone:${d.id}`,kind:"zone",text:d.label,anchor:[(d.labelAt??d.center)[0],(d.labelAt??d.center)[1]+Yy,(d.labelAt??d.center)[2]],color:t.zones?.find(h=>h.id===d.id)?.color}));{let d=new Map,h=new Map,p=new Map,b=new Map;for(let y=0;y<o.length;y++){let M=r.seatOwner[y];if(!M)continue;let v=d.get(M);v||(v={n:0,x:0,y:0,deck:0},d.set(M,v)),v.n++,v.x+=o[y].x,v.y+=o[y].y,v.deck+=r.seatDeckY(y);let A=o[y].categoryKey;if(A){let g=h.get(M);g||(g=new Map,h.set(M,g)),g.set(A,(g.get(A)??0)+1)}if(o[y].accessibility?.includes("wheelchair")){let g=p.get(M);g?g.push(y):p.set(M,[y])}let x=b.get(M);x||(x={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0,minDeck:1/0,maxDeck:-1/0},b.set(M,x)),x.minDeck=Math.min(x.minDeck,r.seatDeckY(y)),x.maxDeck=Math.max(x.maxDeck,r.seatDeckY(y)),o[y].x<x.minX&&(x.minX=o[y].x),o[y].x>x.maxX&&(x.maxX=o[y].x),o[y].y<x.minY&&(x.minY=o[y].y),o[y].y>x.maxY&&(x.maxY=o[y].y)}for(let y of n)for(let M of y.objects){if(M.type!=="section"||eu(M))continue;let v=d.get(M.id);if(!v||v.n===0)continue;let A=b.get(M.id),x=[v.x/v.n*C,v.deck/v.n,v.y/v.n*C],g=M.displayLabel||M.label||M.id;u.push({id:M.id,floorIndex:y.index,label:g,seatCount:v.n,center:x,radius:Math.max(1,Math.hypot(A.maxX-A.minX,A.maxY-A.minY)*.5*C),box:{min:[A.minX*C-.4,A.minDeck,A.minY*C-.4],max:[A.maxX*C+.4,A.maxDeck+1,A.maxY*C+.4]},focalWorld:[y.focal.x*C,y.baseHeightM+1.5,y.focal.y*C]});let P=t.floors?.[y.index]?.name?.trim().toLocaleLowerCase();if(!(n.length>1&&P===g.trim().toLocaleLowerCase())){let S=ig(h.get(M.id),t),w=p.get(M.id);l.push({id:`section:${M.id}`,kind:"section",text:g,anchor:[x[0],x[1]+Ky,x[2]],floorIndex:y.index,...S?{tint:S}:{},...w?{wheelchairSeats:w}:{}})}}}{for(let x of n)for(let g of x.objects){if(g.type!=="gaArea")continue;let P=cn(g.points);if(!P)continue;let S=g.labelPresentation?.visible===!1?"":g.displayLabel||g.label||g.id,w=g.capacity>0?[S,g.capacity.toLocaleString()].filter(Boolean).join(" \xB7 "):S;w&&l.push({id:`ga:${g.id}`,kind:"ga",text:w,anchor:[P.x*C,x.baseHeightM+Qy,P.y*C],floorIndex:x.index})}let d=new Map,h=new Map;for(let x of n)for(let g of x.objects)if(g.type==="section"&&d.set(g.id,g.displayLabel||g.label||g.id),g.type==="row"){let P=g.displayLabel?.trim()||g.segmentedRow?.displayLabel?.trim();P&&h.set(g.id,P)}let p=new Map;for(let x=0;x<o.length;x++){let g=o[x],P=Math.hypot(g.x-c.x,g.y-c.y),S=p.get(g.rowId);(!S||P>S.far)&&p.set(g.rowId,{seat:g,index:x,far:P})}for(let[x,g]of p){let P=r.seatOwner[g.index]??g.seat.sectionId,S=Au(g.seat.label,x,d.get(P??""),h.get(x));S&&l.push({id:`row:${x}`,kind:"row",text:S,anchor:[g.seat.x*C,r.seatDeckY(g.index)+Jy,g.seat.y*C],floorIndex:a[g.index]})}let b=new Map;for(let x=0;x<o.length;x++){let g=o[x],P=b.get(g.rowId);P||(P={n:0,x:0,y:0,z:0,minX:1/0,maxX:-1/0,minZ:1/0,maxZ:-1/0,label:Au(g.label,g.rowId,d.get(r.seatOwner[x]??g.sectionId??""),h.get(g.rowId)),sectionId:r.seatOwner[x]??g.sectionId},b.set(g.rowId,P));let S=x*3,w=i.iPosition[S],E=i.iPosition[S+1],T=i.iPosition[S+2];P.n++,P.x+=w,P.y+=E,P.z+=T,P.minX=Math.min(P.minX,w),P.maxX=Math.max(P.maxX,w),P.minZ=Math.min(P.minZ,T),P.maxZ=Math.max(P.maxZ,T)}for(let[x,g]of b)m.push({id:x,label:g.label,sectionId:g.sectionId,seatCount:g.n,center:[g.x/g.n,g.y/g.n,g.z/g.n],radius:Math.max(.8,Math.hypot(g.maxX-g.minX,g.maxZ-g.minZ)*.5)});let y=0,M=(x,g)=>{y++,l.push({id:`access:${o[x].id}`,kind:"access",text:g.name,icon:g.icon,color:g.color,...g.ink?{ink:g.ink}:{},seatWidthM:i.iChairWidth[x]*2,anchor:[o[x].x*C,r.seatDeckY(x)+tg,o[x].y*C],floorIndex:a[x],rowId:o[x].rowId})},v=null,A=()=>{if(v){let x=wu(o[v.seats[0]]),g=v.seats.length,P=Math.max(1,Math.round(g/ng));for(let S=0;S<P&&y<vu;S++)M(v.seats[Math.min(g-1,Math.floor((S+.5)*g/P))],x)}v=null};for(let x=0;x<o.length&&y<vu;x++){let g=wu(o[x]);if(g&&o[x].accessibility?.length){A(),M(x,g);continue}if(!g){A();continue}v&&v.rowId===o[x].rowId&&v.icon===g.icon?v.seats.push(x):(A(),v={rowId:o[x].rowId,icon:g.icon,seats:[x]})}if(A(),o.length<=ag)for(let x=0;x<o.length;x++){let g=o[x],P=Qi(g.displayLabel||g.label);P&&l.push({id:`seat:${g.id}`,kind:"seat",seatWidthM:i.iChairWidth[x]*2,text:P,anchor:[g.x*C,r.seatDeckY(x)+eg,g.y*C],floorIndex:a[x],rowId:g.rowId})}}for(let d of n){let h=kt(d,n.length===1?o:o.filter((y,M)=>a[M]===d.index)),p=h?xu(Zi(d.objects,vn(h)),d.objects.filter(y=>y.type==="text")):new Map,b=[...p.values()];for(let y of d.objects){let M=y.type==="text"?p.get(y.id):void 0;if(y.type==="shape"&&(y.role==="entrance"||y.role==="exit")&&$y.test(y.label?.trim()??"")){let v=Me(y),A=v?cn(v):null;if(A&&b.some(x=>Math.hypot(A.x-x.mid.x,A.y-x.mid.y)*C<=$i+x.widthM))continue}if(M&&y.type==="text")l.push({id:`text:${y.id}`,kind:"gate",text:y.text,icon:"entrance",anchor:[M.mid.x*C,d.baseHeightM+M.openingM+ur,M.mid.y*C],color:y.color,floorIndex:d.index});else if(y.type==="shape"&&y.role&&Zy.has(y.role)){let v=Me(y),A=v?cn(v):null;if(!A||!y.label||y.gate?.hideFromBuyers)continue;l.push({id:`architecture:${y.id}`,kind:y.role==="stage"?"stage":y.role==="entrance"||y.role==="exit"?"gate":"annotation",text:y.label,...y.role==="entrance"||y.role==="exit"?{icon:y.role}:{},...y.gate?.stepFree?{stepFree:!0}:{},anchor:[A.x*C,d.baseHeightM+lt(y).heightM+ur,A.y*C],color:y.fill,floorIndex:d.index})}else if(y.type==="text"){let v=y.semanticKind==="icon"?no(y.iconKey)?.key:void 0,A=y.text||(v?no(v).label:"");if(!A)continue;l.push({id:`text:${y.id}`,kind:"annotation",text:A,...v?{venueIcon:v}:{},anchor:v?[(y.position.x+y.fontSize/2)*C,d.baseHeightM+ur,(y.position.y+y.fontSize/2)*C]:[y.position.x*C,d.baseHeightM+ur,y.position.y*C],color:y.color,rotation:y.rotation,floorIndex:d.index})}else if(y.type==="booth"){if(y.labelPresentation?.visible===!1)continue;let v=ut(y);if(!v)continue;let A=cn(v);if(!A)continue;l.push({id:`booth:${y.id}`,kind:"booth",text:y.displayLabel||y.label||y.id,anchor:[A.x*C,d.baseHeightM+or+qy,A.y*C],floorIndex:d.index})}}}return{labels:l,sections:u,rows:m}}function Ru(e,t){if(t.length>1)for(let n of t)e.push({id:`floor:${n.id}`,kind:"floor",text:n.label,anchor:[n.center[0],n.box.max[1]+1.2,n.center[2]],floorIndex:n.index})}function Qi(e){let t=e.lastIndexOf("-");return t>=0&&t<e.length-1?e.slice(t+1):e}function Au(e,t,n,o){if(o?.trim())return o.trim();let r=e?e.lastIndexOf("-"):-1,i=r>0?e.slice(0,r):t;return i&&su(i,n)}function Cu(e){let{doc:t,units:n,seats:o,surfaces:r,solids:i,hintedSeatFloor:a,seatFloor:s}=e,c=[];{let l=n.map(()=>({minX:1/0,minY:1/0,minZ:1/0,maxX:-1/0,maxY:-1/0,maxZ:-1/0}));for(let f=0;f<i.floor.length;f+=1){let d=Math.max(0,Math.min(n.length-1,Math.round(i.floor[f]))),h=f*3,p=l[d];p.minX=Math.min(p.minX,i.position[h]),p.minY=Math.min(p.minY,i.position[h+1]),p.minZ=Math.min(p.minZ,i.position[h+2]),p.maxX=Math.max(p.maxX,i.position[h]),p.maxY=Math.max(p.maxY,i.position[h+1]),p.maxZ=Math.max(p.maxZ,i.position[h+2])}let u=new Map;for(let f=0;f<n.length;f++)for(let d of n[f].objects)d.type==="section"&&u.set(d.id,f);let m=n.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 f=0;f<o.length;f++){let d=r.seatOwner[f],h=(d!==null?u.get(d):void 0)??a[f];if(h===void 0)continue;let p=m[h],b=o[f];p.n++,b.x<p.minX&&(p.minX=b.x),b.y<p.minY&&(p.minY=b.y),b.x>p.maxX&&(p.maxX=b.x),b.y>p.maxY&&(p.maxY=b.y);let y=r.seatDeckY(f);p.sumX+=b.x*C,p.sumDeck+=y,p.sumZ+=b.y*C,p.minDeck=Math.min(p.minDeck,y),p.maxDeck=Math.max(p.maxDeck,y+1.6),s[f]=h}for(let f=0;f<n.length;f++){let d=m[f],h=t.floors?.[f],p=l[f],b=Math.min(d.n?d.minX*C:n[f].focal.x*C-1,Number.isFinite(p.minX)?p.minX:1/0),y=Math.max(d.n?d.maxX*C:n[f].focal.x*C+1,Number.isFinite(p.maxX)?p.maxX:-1/0),M=Math.min(d.n?d.minY*C:n[f].focal.y*C-1,Number.isFinite(p.minZ)?p.minZ:1/0),v=Math.max(d.n?d.maxY*C:n[f].focal.y*C+1,Number.isFinite(p.maxZ)?p.maxZ:-1/0),A=Math.min(d.n?Math.min(n[f].baseHeightM,d.minDeck):n[f].baseHeightM,Number.isFinite(p.minY)?p.minY:1/0),x=Math.max(d.n?Math.max(d.maxDeck,A+.5):A+.5,Number.isFinite(p.maxY)?p.maxY:-1/0),g=[d.n?d.sumX/d.n:(b+y)/2,d.n?d.sumDeck/d.n:(A+x)/2,d.n?d.sumZ/d.n:(M+v)/2],P=Math.max(1,.5*Math.hypot(y-b,x-A,v-M));c.push({index:f,id:h?.id??`floor-${f}`,label:h?.name??(n.length>1?`Floor ${f+1}`:"Venue"),seatCount:d.n,center:g,radius:P,box:{min:[b,A,M],max:[y,x,v]},focalWorld:[n[f].focal.x*C,n[f].baseHeightM+1.5,n[f].focal.y*C]})}}return c}function Ji(e,t){let n=1/0,o=1/0,r=-1/0,i=-1/0,a=(s,c)=>{s<n&&(n=s),c<o&&(o=c),s>r&&(r=s),c>i&&(i=c)};for(let s of t)a(s.x,s.y);for(let s of e)for(let c of s.objects)if(c.type==="section")for(let l of c.outline)a(l.x,l.y);else if(c.type==="shape"&&c.points)for(let l of c.points)a(l.x,l.y);else if(c.type==="gaArea")for(let l of c.points)a(l.x,l.y);else if(c.type==="booth"){let l=ut(c);if(l)for(let u of l)a(u.x,u.y)}else if(c.type==="table"){let l=rr(c);if(l)for(let u of l)a(u.x,u.y)}else if(c.type==="decorImage"){let l=ir(c);if(l)for(let u of l)a(u.x,u.y)}return Number.isFinite(n)||(n=-100,o=-100,r=100,i=100),{minX:n,minY:o,maxX:r,maxY:i}}function Fu(e,t,n,o,r,i,a){if(t.length===1){let s=n.map(f=>({x:f.x,y:f.y}));for(let f of t[0].objects)f.type==="section"?s.push(...f.outline):f.type==="shape"?s.push(...Me(f)??f.points??[]):f.type==="gaArea"?s.push(...f.points):f.type==="booth"?s.push(...ut(f)??[]):f.type==="table"?s.push(...rr(f)??[]):f.type==="decorImage"&&s.push(...ir(f)??[]);if(Lu(e,t[0],n,i)||Ou(e,t[0],n,s,i))return!1;if(a&&Tu(e,t[0].baseHeightM,s,i,a))return!0;let c=oo(s),l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2,m=c.length>=3?c.map(f=>{let d=f.x-l,h=f.y-u,p=Math.max(1,Math.hypot(d,h));return{x:f.x+d/p*80,y:f.y+h/p*80}}):Kn(r.minX-28,r.minY-28,r.maxX-r.minX+56,r.maxY-r.minY+56);return ue(e,m,void 0,()=>-.04,-.22,i.ground,i.ground,ae),!1}else{let s=t.reduce((b,y)=>y.baseHeightM<b.baseHeightM?y:b);e.setFloor(s.index);let c={...s,objects:t.flatMap(b=>b.objects)},l=n.map(b=>({x:b.x,y:b.y}));for(let b of c.objects)b.type==="section"&&l.push(...b.outline);if(Lu(e,c,n,i)||Ou(e,c,n,l,i))return!1;if(a&&Tu(e,s.baseHeightM,l,i,a))return!0;let u=n.filter((b,y)=>o[y]===s.index),m=Ji([s],u),f=Math.hypot(m.maxX-m.minX,m.maxY-m.minY),d=Math.max(28,Math.min(80,f*.04)),h=Kn(m.minX-d,m.minY-d,m.maxX-m.minX+d*2,m.maxY-m.minY+d*2),p=s.baseHeightM-.03;return ue(e,h,void 0,()=>p,p-.22,i.ground,i.ground,ae),!1}}function ea(e,t,n,o){let{cx:r,cz:i,radius:a}=n,s=1/0,c=1/0,l=1/0,u=-1/0,m=-1/0,f=-1/0,d=(b,y,M)=>{s=Math.min(s,b),u=Math.max(u,b),c=Math.min(c,y),m=Math.max(m,y),l=Math.min(l,M),f=Math.max(f,M)};for(let b=0;b<e.position.length;b+=3){let y=b/3;o&&y>=o[0]&&y<o[1]||d(e.position[b],e.position[b+1],e.position[b+2])}for(let b=0;b<t.count;b++){let y=b*3,M=t.iPosition[y],v=t.iPosition[y+1],A=t.iPosition[y+2],x=Math.max(.35,t.iMaxRadius[b]??.35);d(M-x,v,A-x),d(M+x,v+1.6,A+x)}Number.isFinite(s)||(s=r-a,u=r+a,c=0,m=a*.16,l=i-a,f=i+a);let h=[(s+u)/2,(c+m)/2,(l+f)/2],p=Math.max(1,.5*Math.hypot(u-s,m-c,f-l));return{center:h,radius:p,minY:c,maxY:m}}var lg=4096;function Du(e,t,n=[]){let o=Math.max(1,Math.ceil(e.count/lg)),r=Math.ceil(e.count/o),i=new Float32Array((r*2+t.length*4+n.length)*3),a=0;for(let s=0;s<e.count;s+=o){let c=e.iPosition[s*3],l=e.iPosition[s*3+1],u=e.iPosition[s*3+2];i[a++]=c,i[a++]=l,i[a++]=u,i[a++]=c,i[a++]=0,i[a++]=u}for(let[s,c,l]of n)i[a++]=s,i[a++]=c,i[a++]=l;for(let s of t)for(let[c,l]of[[-1,-1],[1,-1],[1,1],[-1,1]])i[a++]=s.cx+c*s.halfX,i[a++]=s.y,i[a++]=s.cz+l*s.halfZ;return i.subarray(0,a)}function Nu(e,t,n,o,r,i,a=[]){let s=1/0,c=1/0,l=-1/0,u=-1/0;for(let x=0;x<e.count;x++){let g=x*3,P=e.iPosition[g],S=e.iPosition[g+2];P<s&&(s=P),P>l&&(l=P),S<c&&(c=S),S>u&&(u=S)}for(let[x,,g]of a)x<s&&(s=x),x>l&&(l=x),g<c&&(c=g),g>u&&(u=g);for(let x of t)s=Math.min(s,x.cx-x.halfX),l=Math.max(l,x.cx+x.halfX),c=Math.min(c,x.cz-x.halfZ),u=Math.max(u,x.cz+x.halfZ);let m=n.minX*C,f=n.maxX*C,d=n.minY*C,h=n.maxY*C,p=m,b=f,y=d,M=h;if(Number.isFinite(s)){let x=Math.max(2,.06*Math.hypot(l-s,u-c));p=Math.max(m,s-x),b=Math.min(f,l+x),y=Math.max(d,c-x),M=Math.min(h,u+x)}let v=Math.min(0,o),A=Math.max(r,i*.05);return{min:[p,v,y],max:[b,A,M]}}var _u=12,ug=.6,mg=40;function Tu(e,t,n,o,r){let i=oo([...n]);if(i.length<3)return!1;let a=1/0,s=1/0,c=-1/0,l=-1/0;for(let A of i)a=Math.min(a,A.x),c=Math.max(c,A.x),s=Math.min(s,A.y),l=Math.max(l,A.y);let u=Math.hypot(c-a,l-s)*C,m=st(i,_u/C,1.2),f=Math.max(mg,u*ug),d=st(i,(_u+f)/C,1.2);if(m.length!==d.length)return!1;let h=ge(o.ground,[.78,.76,.72],.35),p=ge(o.ground,[.56,.62,.52],.3);ue(e,m,void 0,()=>t-.04,t-.22,h,h,ae);let b=t-.05,y=m.map(A=>[A.x*C,b,A.y*C]),M=d.map(A=>[A.x*C,b,A.y*C]),v=[0,1,0];for(let A=0;A<y.length;A++){let x=(A+1)%y.length;e.tri(y[A],M[x],M[A],v,p,r,r),e.tri(y[A],y[x],M[x],v,p,p,r)}return!0}function Lu(e,t,n,o){let r=kt(t,n);if(!r)return!1;let i=t.baseHeightM,a=ge(o.ground,[.62,.55,.47],.4);return ue(e,r,void 0,()=>i-.04,i-.22,a,a,ae),!0}var fg=3e3,dg=20,ku=1.5,hg=1.2,pg=.25;function Ou(e,t,n,o,r){if(!n.length||n.length>fg||o.length<3)return!1;for(let w of t.objects){if(w.type==="shape"&&Oo(w.stageKind))return!1;if(w.type==="section"){let{height:E}=Ct(w,{floorBaseHeightM:t.baseHeightM});if(E-t.baseHeightM>dg)return!1}}let i=0,a=0;for(let w of o)i+=w.x,a+=w.y;i/=o.length,a/=o.length;let s=0,c=0,l=0;for(let w of o){let E=w.x-i,T=w.y-a;s+=E*E,c+=T*T,l+=E*T}let u=.5*Math.atan2(2*l,s-c),m=Math.cos(u),f=Math.sin(u),d=-f,h=m,p=1/0,b=-1/0,y=1/0,M=-1/0;for(let w of o){let E=(w.x-i)*m+(w.y-a)*f,T=(w.x-i)*d+(w.y-a)*h;p=Math.min(p,E),b=Math.max(b,E),y=Math.min(y,T),M=Math.max(M,T)}let v=w=>[[p-w,y-w],[b+w,y-w],[b+w,M+w],[p-w,M+w]].map(([E,T])=>({x:i+m*E+d*T,y:a+f*E+h*T})),A=v(ku/C),x=v((ku+pg)/C),g=t.baseHeightM,P=ge(r.ground,[.62,.55,.47],.4),S=ge(r.ground,[.86,.86,.84],.55);return ue(e,x,void 0,()=>g-.04,g-.22,P,P,ae),ue(e,x,[A.slice().reverse()],()=>g+hg,g-.04,ge(S,[1,1,1],.2),S,ae),!0}function Bu(e,t,n){let o=()=>({byObjectId:new Map,elements:[]});if(!t||!e)return o();let r=Js(t);if(!r.ok||r.value.id!==e)return o();let i=new Map;for(let m of n)for(let f of m.objects)f.type==="shape"&&i.set(f.id,{shape:f,unit:m});let a=new Set,s=new Set,c=new Map((t.overlay.productionElements??[]).map(m=>{let f=m.runtimeContentImageUrl;return[m.id,typeof f=="string"&&/^(?:blob:|data:image\/|https:\/\/)/.test(f)?f:void 0]})),l=[];for(let m of r.value.overlay.productionElements??[]){let f=i.get(m.objectId),d=f?Me(f.shape):null,h=m.baseElevationM??0;if(!f||!d||d.length<3||!m.id||a.has(m.id)||s.has(m.objectId)||!Number.isFinite(m.heightM)||m.heightM<.05||m.heightM>50||!Number.isFinite(h)||h<-10||h>100)return o();a.add(m.id),s.add(m.objectId);let p=d.map(S=>S.x*C),b=d.map(S=>S.y*C),y=f.unit.baseHeightM+h,M=Math.min(...p),v=Math.max(...p),A=Math.min(...b),x=Math.max(...b),g,P=c.get(m.id)??m.contentImageUrl;if(m.kind==="screen"&&P&&(g=ol(d,y,y+m.heightM,f.unit.focal),!g))if(v-M>=x-A){let S=Math.abs(A-f.unit.focal.y*C)<=Math.abs(x-f.unit.focal.y*C)?A-.006:x+.006;g=[[M,y,S],[v,y,S],[M,y+m.heightM,S],[v,y+m.heightM,S]]}else{let S=Math.abs(M-f.unit.focal.x*C)<=Math.abs(v-f.unit.focal.x*C)?M-.006:v+.006;g=[[S,y,A],[S,y,x],[S,y+m.heightM,A],[S,y+m.heightM,x]]}l.push({id:m.id,objectId:m.objectId,kind:m.kind,floorIndex:f.unit.index,baseY:y,topY:y+m.heightM,bounds:{min:[M,y,A],max:[v,y+m.heightM,x]},occlusion:m.occlusion,...P?{contentImageUrl:P}:{},...g?{contentPlane:g}:{}})}let u=l.sort((m,f)=>m.id.localeCompare(f.id));return{byObjectId:new Map(u.map(m=>[m.objectId,m])),elements:u}}var Vu=[.13,.14,.17],In=[.4,.43,.47],bg=.18,yg=.02,gg=2.4,xg=1500,Mg=240,vg=.25;function Gu(e,t,n,o){let r=t.stageKind??"";if(Kt(r)||r==="round"||!o.length)return;let i=Me(t);if(!i||i.length<3)return;let a={x:i.reduce((k,V)=>k+V.x,0)/i.length,y:i.reduce((k,V)=>k+V.y,0)/i.length},s=0,c=0,l=new Set;for(let k of o)s+=k.x,c+=k.y,l.add(Math.floor(Math.atan2(k.y-a.y,k.x-a.x)*180/Math.PI/10));let u=a.x-s/o.length,m=a.y-c/o.length,f=Math.hypot(u,m);if(f<1e-6)return;let d=o.reduce((k,V)=>k+Math.hypot(V.x-a.x,V.y-a.y),0)/o.length;if(l.size*10>Mg&&f<vg*d)return;let h=u/f,p=m/f,b=-p,y=h,M=-1/0,v=1/0,A=1/0,x=-1/0;for(let k of i){let V=(k.x-a.x)*h+(k.y-a.y)*p,O=(k.x-a.x)*b+(k.y-a.y)*y;M=Math.max(M,V),v=Math.min(v,V),A=Math.min(A,O),x=Math.max(x,O)}let g=(x-A)*C,P=(M-v)*C;if(g<3||P<1.5||g*P>xg)return;let S=bg/C,w=(k,V)=>({x:a.x+h*k+b*V,y:a.y+p*k+y*V}),E=(k,V,O,H)=>[w(k,O),w(k,H),w(V,H),w(V,O)],T=n+Math.max(3.5,Math.min(8,g*.35)),F=n+Math.min(gg,T-n-1),R=.2/C,I=v+Math.min(P*.25,1.5)/C,_=yg/C;ue(e,E(M-2*S+_,M-S-_,A+S+R,x-S-R),void 0,()=>F,n,Vu,Vu,ae);for(let[k,V]of[[A+S,A+S+R],[x-S-R,x-S]])ue(e,E(M-2*S,M-S,k,V),void 0,()=>T+.3,n,In,In,ae),ue(e,E(I+R,M-2*S,k,V),void 0,()=>T+.3,T,In,In,ae);ue(e,E(I,I+R,A+S,x-S),void 0,()=>T+.3,T,In,In,ae)}function Je(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Qe(e){return Array.isArray(e)?e:[]}function Sg(e){let t=[e];for(;t.length;){let n=t.pop();if(Array.isArray(n)){t.push(...n);continue}if(!Je(n))continue;let o=Je(n.extensions)?n.extensions:null;if(o&&Object.prototype.hasOwnProperty.call(o,"KHR_draco_mesh_compression"))return!0;t.push(...Object.values(n))}return!1}function mr(e,t){return!Array.isArray(e)||e.length!==t||!e.every(n=>typeof n=="number"&&Number.isFinite(n))?null:e}function wg(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Pg(e,t){let n=new Array(16).fill(0);for(let o=0;o<4;o++)for(let r=0;r<4;r++)for(let i=0;i<4;i++)n[o*4+r]+=e[i*4+r]*t[o*4+i];return n}function Ag(e){let t=mr(e.matrix,16);if(t)return t;if(e.matrix!==void 0)return null;let n=e.translation===void 0?[0,0,0]:mr(e.translation,3),o=e.rotation===void 0?[0,0,0,1]:mr(e.rotation,4),r=e.scale===void 0?[1,1,1]:mr(e.scale,3);if(!n||!o||!r)return null;let[i,a,s,c]=o,l=Math.hypot(i,a,s,c);if(!(l>1e-8))return null;let u=i/l,m=a/l,f=s/l,d=c/l,h=u+u,p=m+m,b=f+f,y=u*h,M=u*p,v=u*b,A=m*p,x=m*b,g=f*b,P=d*h,S=d*p,w=d*b;return[(1-(A+g))*r[0],(M+w)*r[0],(v-S)*r[0],0,(M-w)*r[1],(1-(y+g))*r[1],(x+P)*r[1],0,(v+S)*r[2],(x-P)*r[2],(1-(y+A))*r[2],0,n[0],n[1],n[2],1]}function Ig(e,t,n,o){return[e[0]*t+e[4]*n+e[8]*o+e[12],e[1]*t+e[5]*n+e[9]*o+e[13],e[2]*t+e[6]*n+e[10]*o+e[14]]}function Eg(e){let t=e[0],n=e[4],o=e[8],r=e[1],i=e[5],a=e[9],s=e[2],c=e[6],l=e[10],u=i*l-a*c,m=a*s-r*l,f=r*c-i*s,d=t*u+n*m+o*f;if(Math.abs(d)<1e-12)return null;let h=1/d;return[u*h,m*h,f*h,(o*c-n*l)*h,(t*l-o*s)*h,(n*s-t*c)*h,(n*a-o*i)*h,(o*r-t*a)*h,(t*i-n*r)*h]}function Hu(e,t,n,o){let r=e[0]*t+e[1]*n+e[2]*o,i=e[3]*t+e[4]*n+e[5]*o,a=e[6]*t+e[7]*n+e[8]*o,s=Math.hypot(r,i,a)||1;return r/=s,i/=s,a/=s,[r,i,a]}function Rg(e){if(e.byteLength<20||e.byteLength>8388608)return null;let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.getUint32(0,!0)!==1179937895||t.getUint32(4,!0)!==2||t.getUint32(8,!0)!==e.byteLength)return null;let n=12,o=null,r=null;for(;n+8<=e.byteLength;){let i=t.getUint32(n,!0),a=t.getUint32(n+4,!0);if(n+=8,i%4!==0||n+i>e.byteLength)return null;let s=e.subarray(n,n+i);if(a===1313821514&&!o)try{let c=JSON.parse(new TextDecoder().decode(s).replace(/[\u0000 ]+$/g,""));if(!Je(c))return null;o=c}catch{return null}else if(a===5130562&&!r)r=s;else return null;n+=i}return n===e.byteLength&&o&&r?{json:o,bin:r}:null}function Cg(e){return e===5120||e===5121?1:e===5122||e===5123?2:e===5125||e===5126?4:0}function _g(e){return e==="SCALAR"?1:e==="VEC2"?2:e==="VEC3"?3:e==="VEC4"?4:0}function Tg(e,t,n){return n===5120?e.getInt8(t):n===5121?e.getUint8(t):n===5122?e.getInt16(t,!0):n===5123?e.getUint16(t,!0):n===5125?e.getUint32(t,!0):e.getFloat32(t,!0)}function Lg(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n=Rg(t);if(!n)return{ok:!1,issue:"invalid_glb"};let{json:o,bin:r}=n;if(!Je(o.asset)||o.asset.version!=="2.0")return{ok:!1,issue:"unsupported_glb"};let i=Qe(o.extensionsUsed).filter(A=>typeof A=="string");if(i.includes("KHR_draco_mesh_compression")||Sg(o))return{ok:!1,issue:"draco_not_allowed"};if(i.length||Qe(o.extensionsRequired).length)return{ok:!1,issue:"unsupported_glb"};if(Qe(o.images).length||Qe(o.textures).length)return{ok:!1,issue:"external_resource"};let a=Qe(o.buffers);if(a.length!==1||!Je(a[0])||a[0].uri!==void 0||typeof a[0].byteLength!="number"||!Number.isInteger(a[0].byteLength)||a[0].byteLength<0||a[0].byteLength>r.byteLength)return{ok:!1,issue:"external_resource"};let s=Qe(o.accessors),c=Qe(o.bufferViews),l=Qe(o.meshes),u=Qe(o.nodes),m=Qe(o.scenes),f=typeof o.scene=="number"?o.scene:0;if(!Je(m[f]))return{ok:!1,issue:"unsupported_glb"};let d=new DataView(r.buffer,r.byteOffset,r.byteLength),h=(A,x,g)=>{if(typeof A!="number"||!Number.isInteger(A)||!Je(s[A]))return null;let P=s[A];if(P.type!==x||P.sparse!==void 0||P.normalized===!0||typeof P.count!="number"||!Number.isInteger(P.count)||P.count<1||typeof P.componentType!="number"||!g.includes(P.componentType)||typeof P.bufferView!="number")return null;let S=c[P.bufferView];if(!Je(S)||S.buffer!==0||typeof S.byteLength!="number"||!Number.isInteger(S.byteLength)||S.byteLength<0)return null;let w=_g(P.type),E=Cg(P.componentType),T=typeof S.byteStride=="number"?S.byteStride:w*E,F=typeof S.byteOffset=="number"?S.byteOffset:0,R=typeof P.byteOffset=="number"?P.byteOffset:0,I=F+R,_=R+(P.count-1)*T+w*E;if(!Number.isInteger(T)||!Number.isInteger(F)||!Number.isInteger(R)||T<w*E||F<0||R<0||F+S.byteLength>r.byteLength||_>S.byteLength)return null;let k=[];for(let V=0;V<P.count;V++){let O=[];for(let H=0;H<w;H++){let U=Tg(d,I+V*T+H*E,P.componentType);if(!Number.isFinite(U))return null;O.push(U)}k.push(O)}return k},p=[],b=[],y=0,M=new Set,v=(A,x)=>{if(typeof A!="number"||!Number.isInteger(A)||!Je(u[A])||M.has(A))return!1;M.add(A);let g=u[A],P=Ag(g);if(!P)return!1;let S=Pg(x,P),w=Eg(S);if(!w)return!1;if(g.mesh!==void 0){if(typeof g.mesh!="number")return!1;let E=l[g.mesh];if(!Je(E))return!1;for(let T of Qe(E.primitives)){if(!Je(T)||T.mode!==void 0&&T.mode!==4||!Je(T.attributes))return!1;let F=h(T.attributes.POSITION,"VEC3",[5126]),R=T.attributes.NORMAL===void 0?null:h(T.attributes.NORMAL,"VEC3",[5126]);if(!F||T.attributes.NORMAL!==void 0&&!R)return!1;let I=F.length;if(T.indices!==void 0){let k=typeof T.indices=="number"?s[T.indices]:null;I=Je(k)?k.count:void 0}if(typeof I!="number"||!Number.isInteger(I)||I%3!==0||(y+=I/3,y>1e5))return!1;let _=T.indices===void 0?F.map((k,V)=>[V]):h(T.indices,"SCALAR",[5121,5123,5125]);if(!_||_.length%3!==0||_.length!==I)return!1;for(let k=0;k<_.length;k+=3){let V=[_[k][0],_[k+1][0],_[k+2][0]];if(V.some(U=>!Number.isInteger(U)||U<0||U>=F.length))return!1;let O=V.map(U=>Ig(S,...F[U])),H=null;if(!R){let U=O[1][0]-O[0][0],N=O[1][1]-O[0][1],L=O[1][2]-O[0][2],B=O[2][0]-O[0][0],D=O[2][1]-O[0][1],G=O[2][2]-O[0][2];H=Hu([1,0,0,0,1,0,0,0,1],N*G-L*D,L*B-U*G,U*D-N*B)}for(let U=0;U<3;U++)p.push(...O[U]),b.push(...R?Hu(w,...R[V[U]]):H)}}}for(let E of Qe(g.children))if(!v(E,S))return!1;return M.delete(A),!0};for(let A of Qe(m[f].nodes))if(!v(A,wg()))return{ok:!1,issue:y>1e5?"triangle_limit":"unsupported_glb"};return!y||p.length!==y*9||b.length!==p.length?{ok:!1,issue:"unsupported_glb"}:{ok:!0,triangleCount:y,position:new Float32Array(p),normal:new Float32Array(b)}}function zu(e){try{return Lg(e)}catch{return{ok:!1,issue:"invalid_glb"}}}function En(e){let{doc:t}=e,n=Rs(t.theme),o=n.structure,r=Uc(t,e.eventConfigurationId??t.eventConfigurationId),i=Bu(e.eventConfigurationId,e.eventConfiguration,r),a=e.seats,s=new Lo,c=null;if(e.registeredShellGlb){let X=zu(e.registeredShellGlb);if(X.ok){let Y=X.position.length/3,K=new Float32Array(X.position.length),re=n.materials.shell??o.tierWall;for(let ne=0;ne<Y;ne++){let se=X.normal[ne*3+1],J=se<-.25?.4:.62+.38*Math.max(0,se);K[ne*3]=re[0]*J,K[ne*3+1]=re[1]*J,K[ne*3+2]=re[2]*J}c={position:X.position,normal:X.normal,color:K,floor:new Float32Array(Y).fill(-2),material:new Float32Array(Y),count:Y}}}let l=new Map;for(let X of r)for(let Y of X.objects)l.set(Y.id,X.index),Y.type==="section"&&l.set(Y.logicalSectionId??Y.id,X.index);let u=a.map(X=>l.get(X.sectionId??"")??l.get(X.rowId??"")??0),m=Ji(r,a),f=s.vertexCount,h=Fu(s,r,a,u,m,o,ge(n.background.top,n.background.bottom,.5))?s.vertexCount:f,p=_c(t,a),b=new Map,y=new Map;for(let X of t.categories??[])b.set(X.key,X.color),X.seatGlyph&&y.set(X.key,X.seatGlyph);let M=[],v=nl(r,a,u),A=new Map;a.forEach((X,Y)=>{let K=v.seatDeckY(Y);Number.isFinite(K)&&A.set(X.rowId,Math.min(A.get(X.rowId)??1/0,K))});let x=new Float32Array(a.length),g=[],P=new Map((t.floors??[]).map((X,Y)=>[X.id,Y])),S=r.map(()=>[]);for(let X of a){let Y=X.floorId?P.get(X.floorId)??0:0;S[Math.min(Y,S.length-1)]?.push(X)}let w=(X,Y)=>{if(!Y||Y.length<3)return!1;let K=Math.min(...Y.map(J=>J.x)),re=Math.max(...Y.map(J=>J.x)),ne=Math.min(...Y.map(J=>J.y)),se=Math.max(...Y.map(J=>J.y));for(let J=0;J<X;J++)for(let ie of S[J])if(!(ie.x<K||ie.x>re||ie.y<ne||ie.y>se)&&ze(ie,Y,void 0))return!0;return!1},E=null,T=X=>r.length===1?a:a.filter((Y,K)=>u[K]===X),F=(X,Y)=>{let K=ut(X);if(!K)return!1;let re=1/0,ne=1/0,se=-1/0,J=-1/0;for(let ie of K)re=Math.min(re,ie.x),se=Math.max(se,ie.x),ne=Math.min(ne,ie.y),J=Math.max(J,ie.y);return a.some((ie,Ee)=>ie.kind!=="booth"&&(r.length===1||u[Ee]===Y)&&ie.x>re&&ie.x<se&&ie.y>ne&&ie.y<J&&Ze(K,ie.x,ie.y))},R;for(let X=0;X<r.length;X++){let Y=r[X];s.setFloor(X);let K=kt(Y,T(X)),re=0;if(K){let te=0;for(let ve of Y.objects)if(ve.type==="section")for(let Se of v.bySection.get(ve.id)?.rowLevels??[])te=Math.max(te,Se.y-Y.baseHeightM);if(re=qc(te),!R){let ve=vn(K);R={centre:[ve.x*C,ve.y*C]}}}let ne=new Xo,se=[],J=Y.objects.filter(te=>te.type==="shape"&&(te.role==="entrance"||te.role==="exit")),ie=Y.objects.filter(te=>te.type==="section"&&!!te.outline&&te.outline.length>=3),Ee=Tl(Y.objects.filter(te=>te.type==="booth"),Y.focal);for(let te of Y.objects)if(te.type==="section"){let ve=s.vertexCount;Yl(s,te,Y,Tc(te,p),v.bySection.get(te.id),ne,ie,o,X>0&&w(X,te.outline));let Se=s.vertexCount-ve;Se>0&&g.push({sectionId:te.id,start:ve,count:Se})}else if(te.type==="shape"){let ve=i.byObjectId.get(te.id),Se=M.length,ot=K!==null&&te.role==="wall"&&!ve;s.setMaterial(ot?Yo:(ve?.kind??te.role)==="screen"?1:0);let mt=te.role==="stage"&&!ve?kl(te,T(X)):ot&&te.heightM===void 0?{...te,heightM:re}:te,Ye=$c(mt,se);if(El(s,mt,Y.baseHeightM+Ye.supportOffsetM,Ye.topOffsetM-Ye.supportOffsetM,o,Y.focal,M,ve,J),s.setMaterial(0),te.role==="stage"&&!ve&&M.length>Se&&(E??X)===X){E=X;let rt=t.floors?.[X]?.id,Ae=r.length>1&&rt?a.filter(Ht=>Ht.floorId===rt):a;Gu(s,mt,M[M.length-1].y,Ae)}}else te.type==="gaArea"?Cl(s,te,Y.baseHeightM,be(b.get(te.categoryKey)),o):te.type==="booth"?Pl(s,te,Y.baseHeightM,be(b.get(te.categoryKey)),o,Ee.get(te.id)??Y.focal,F(te,X)):te.type==="table"?Il(s,te,Math.max(Y.baseHeightM,A.get(te.id)??Y.baseHeightM),be(te.fill??t.theme?.decorFill??"#232c40"),o,!!(te.fill??t.theme?.decorFill)):te.type==="decorImage"&&Rl(s,te,Y.baseHeightM,o);K&&Mu(s,Y.objects,K,Y.baseHeightM,re,Y.focal,o,te=>!i.byObjectId.has(te.id)),$l(s,Y,a,v,o,n.materials.shell,!c)}let I=r.length>1?{x:r.reduce((X,Y)=>X+Y.focal.x,0)/r.length,y:r.reduce((X,Y)=>X+Y.focal.y,0)/r.length}:t.focalPoint??{x:(m.minX+m.maxX)/2,y:(m.minY+m.maxY)/2},_=Ss(c?[s.build(),c]:[s.build()]),k=Ps(a,e.initialState,v,x,b,y),V=Iu({doc:t,units:r,seats:a,surfaces:v,focal:I}),{labels:O,sections:H,rows:U}=Eu({doc:t,units:r,seats:a,surfaces:v,seatData:k,hintedSeatFloor:u,zones:V,focal:I}),N=new Map(H.map((X,Y)=>[X.id,Y]));v.seatOwner.forEach((X,Y)=>{k.iSection[Y]=X?N.get(X)??-1:-1});let L=Cu({doc:t,units:r,seats:a,surfaces:v,solids:_,hintedSeatFloor:u,seatFloor:x});Ru(O,L),k.iYaw=Wa(k.iPosition,a.length,X=>a[X].rowId,X=>{let Y=r[x[X]]?.focal??I;return[Y.x*C,Y.y*C]});let B=(m.minX+m.maxX)/2*C,D=(m.minY+m.maxY)/2*C,G=.5*Math.hypot((m.maxX-m.minX)*C,(m.maxY-m.minY)*C)||10,j=ea(_,k,{cx:B,cz:D,radius:G},[f,h]),Z=ea(_,k,{cx:B,cz:D,radius:G}),$=kg(r),ee=Nu(k,M,m,j.minY,j.maxY,G,$);return{sharedAisles:As(r.flatMap(X=>X.objects.flatMap(Y=>{if(Y.type!=="section")return[];let K=v.bySection.get(Y.id);return K?[{sectionId:Y.id,floorIndex:X.index,rows:K.rowLevels}]:[]}))),solids:_,sectionSolidRanges:g,seats:k,seatSectionIds:v.seatOwner,bounds:{center:[(ee.min[0]+ee.max[0])/2,(ee.min[1]+ee.max[1])/2,(ee.min[2]+ee.max[2])/2],radius:G,groundY:0,box:ee,fitPoints:Du(k,M,$)},...R?{room:R}:{},...!R&&r.some(X=>X.objects.some(Y=>Y.type==="shape"&&Oo(Y.stageKind)))?{outdoor:!0}:{},renderBounds:{center:j.center,radius:j.radius},clipBounds:{center:Z.center,radius:Z.radius},stateColorLUT:Cs(n,Be),theme:n,seatCount:a.length,focalWorld:[I.x*C,1.5,I.y*C],zones:V,stages:M,productionElements:i.elements,sections:H,rows:U,labels:O,floors:L}}function kg(e){let t=[];for(let n of e)for(let o of n.objects){let r=o.type==="gaArea"?o.points:o.type==="booth"?ut(o):null;for(let i of r??[])t.push([i.x*C,n.baseHeightM,i.y*C])}return t}var Dt=require("ogl"),Og=.05,Fg=1.1,Dg=12,Ng=1.6,Bg=1,Vg=2.5,Gg=650,Uu=[[-.15,0,0,.15,.13,.42],[-.13,-.45,.36,.13,.02,.47]],Wu={centre:[0,0,-.05],hipRadius:.15,shoulderRadius:.2,height:.56,sides:8,depth:.62},ta={centre:[0,.74,-.04],radii:[.1,.12,.11]},Rn={height:6,baseRadius:.16,topRadius:.3,fadeInFromM:16,fullByM:40},Hg=90,n5={height:ta.centre[1]+ta.radii[1],radius:Math.max(Wu.shoulderRadius,...Uu.map(e=>Math.max(Math.abs(e[0]),Math.abs(e[3]))))};function zg(e,t){if(t)return 0;let n=(e-Rn.fadeInFromM)/(Rn.fullByM-Rn.fadeInFromM);return Math.max(0,Math.min(1,n))}function jg(e,t){return!t&&e<Hg}var ju=24;function Ug(e){let t=[],n=[],o=[],r=(m,f,d)=>{t.push(...m),n.push(...f),o.push(d)};for(let m=0;m<16;m++){let f=m/16*Math.PI*2,d=(m+1)/16*Math.PI*2,h=v=>[Math.cos(v),0,Math.sin(v)],p=[Math.cos(f)*.012,0,Math.sin(f)*.012],b=[Math.cos(d)*.012,0,Math.sin(d)*.012],y=[Math.cos(f)*.03,1,Math.sin(f)*.03],M=[Math.cos(d)*.03,1,Math.sin(d)*.03];r(p,h(f),0),r(y,h(f),0),r(M,h(d),0),r(p,h(f),0),r(M,h(d),0),r(b,h(d),0)}let c=.16,l=.24,u=.01;for(let m=0;m<48;m++){let f=m/48*Math.PI*2,d=(m+1)/48*Math.PI*2,h=[Math.cos(f)*c,u,Math.sin(f)*c],p=[Math.cos(f)*l,u,Math.sin(f)*l],b=[Math.cos(d)*l,u,Math.sin(d)*l],y=[Math.cos(d)*c,u,Math.sin(d)*c];for(let M of[h,p,b,h,b,y])r(M,[0,1,0],1)}for(let[m,f,d,h,p,b]of Uu){let y=[[[0,0,1],[[m,f,b],[h,f,b],[h,p,b],[m,p,b]]],[[0,0,-1],[[h,f,d],[m,f,d],[m,p,d],[h,p,d]]],[[1,0,0],[[h,f,b],[h,f,d],[h,p,d],[h,p,b]]],[[-1,0,0],[[m,f,d],[m,f,b],[m,p,b],[m,p,d]]],[[0,1,0],[[m,p,b],[h,p,b],[h,p,d],[m,p,d]]],[[0,-1,0],[[m,f,d],[h,f,d],[h,f,b],[m,f,b]]]];for(let[M,[v,A,x,g]]of y)for(let P of[v,A,x,v,x,g])r(P,M,2)}{let{centre:m,hipRadius:f,shoulderRadius:d,height:h,sides:p,depth:b}=Wu,y=(M,v,A)=>{let x=M/p*Math.PI*2+Math.PI/p;return[m[0]+Math.cos(x)*v,m[1]+A,m[2]+Math.sin(x)*v*b]};for(let M=0;M<p;M++){let v=y(M,f,0),A=y(M+1,f,0),x=y(M+1,d,h),g=y(M,d,h),P=[A[0]-v[0],A[1]-v[1],A[2]-v[2]],S=[g[0]-v[0],g[1]-v[1],g[2]-v[2]],w=[P[1]*S[2]-P[2]*S[1],P[2]*S[0]-P[0]*S[2],P[0]*S[1]-P[1]*S[0]],E=Math.hypot(...w)||1;w=[w[0]/E,w[1]/E,w[2]/E],w[0]*(v[0]-m[0])+w[2]*(v[2]-m[2])<0&&(w=[-w[0],-w[1],-w[2]]);for(let T of[v,A,x,v,x,g])r(T,w,2);r([m[0],m[1]+h,m[2]],[0,1,0],2),r(g,[0,1,0],2),r(x,[0,1,0],2)}}{let{centre:m,radii:f}=ta,d=8,h=(p,b)=>{let y=p/16*Math.PI*2,M=b/d*Math.PI,v=[Math.sin(M)*Math.cos(y),Math.cos(M),Math.sin(M)*Math.sin(y)];return[[m[0]+v[0]*f[0],m[1]+v[1]*f[1],m[2]+v[2]*f[2]],v]};for(let p=0;p<16;p++)for(let b=0;b<d;b++){let y=h(p,b),M=h(p+1,b),v=h(p+1,b+1),A=h(p,b+1);for(let[x,g]of[y,M,v,y,v,A])r(x,g,2)}}for(let m=0;m<32;m++){let f=m/32*Math.PI*2,d=(m+1)/32*Math.PI*2,h=Rn.baseRadius,p=Rn.topRadius,b=[Math.cos(f)*h,0,Math.sin(f)*h],y=[Math.cos(d)*h,0,Math.sin(d)*h],M=[Math.cos(f)*p,1,Math.sin(f)*p],v=[Math.cos(d)*p,1,Math.sin(d)*p],A=[Math.cos(f),0,Math.sin(f)],x=[Math.cos(d),0,Math.sin(d)];r(b,A,3),r(M,A,3),r(v,x,3),r(b,A,3),r(v,x,3),r(y,x,3)}return new Dt.Geometry(e,{position:{size:3,data:new Float32Array(t)},normal:{size:3,data:new Float32Array(n)},part:{size:1,data:new Float32Array(o)}})}var Wg=`#version 300 es
|
|
20
|
+
}`});async function mf(e,t,n,o={}){let r=o.fadeMs??400,i=t?.initialBearingDeg??0,a=Math.max(-vt,Math.min(vt,t?.initialPitchDeg??0)),s=Ir,c=!1,l=new AbortController,u=()=>l.abort();o.signal?.addEventListener("abort",u,{once:!0});let m=()=>{},f=[n.camera.position.x,n.camera.position.y,n.camera.position.z];if(!t&&n.cameraOriginWorld&&n.camera.position.set(n.cameraOriginWorld[0],n.cameraOriginWorld[1],n.cameraOriginWorld[2]),!t&&n.focalWorld){let N=n.camera.position,L=n.focalWorld[0]-N.x,B=n.focalWorld[1]-N.y,D=n.focalWorld[2]-N.z,G=Math.hypot(L,D);G>.001&&(i=Math.atan2(L,-D)*180/Math.PI,a=Math.max(-vt,Math.min(vt,Math.atan2(B,G)*180/Math.PI)))}let d=null;if(t){let N=n.gl.getParameter(n.gl.MAX_TEXTURE_SIZE),L=wr(t,Sr(N)),B;try{let D=t.resolveUrl?await t.resolveUrl(L.initialUrl):L.initialUrl;if(!D)throw new Error("panorama_asset_unavailable");B=await xo(D,l.signal)}catch{return o.signal?.removeEventListener("abort",u),null}try{d=cf(n.gl,B)}catch{return l.abort(),o.signal?.removeEventListener("abort",u),null}d.mesh.renderOrder=999,d.mesh.setParent(n.scene),L.upgradeUrl&&(m=Pr(()=>{(t.resolveUrl?t.resolveUrl(L.upgradeUrl):Promise.resolve(L.upgradeUrl)).then(G=>!G||l.signal.aborted?null:xo(G,l.signal)).then(G=>{G&&(c||l.signal.aborted||(d?.setImage(G),n.requestRender()))}).catch(()=>{})}))}let h=n.camera.fov;n.camera.perspective({fov:s,aspect:n.camera.aspect});let p=n.camera.quaternion.slice(),b=()=>{let N=n.camera.position;d?.mesh.position.set(N.x,N.y,N.z);let[L,B,D]=sf(i,a);n.camera.lookAt([N.x+L,N.y+B,N.z+D]),n.requestRender()};b();let y=document.createElement("div"),M=document.activeElement instanceof HTMLElement?document.activeElement:null;y.setAttribute("role","dialog"),y.setAttribute("aria-modal","true"),y.setAttribute("aria-label",o.seatLabel?`View from ${o.seatLabel}`:"View from seat"),y.tabIndex=-1,Object.assign(y.style,{position:"absolute",inset:"0",zIndex:"10",cursor:"grab",touchAction:"none"});let v=document.createElement("button");if(v.type="button",v.setAttribute("aria-label","Close"),v.textContent="\u2715",Object.assign(v.style,{position:"absolute",top:"12px",right:"12px",zIndex:"2",width:"44px",height:"44px",borderRadius:"999px",cursor:"pointer",border:"1px solid rgba(255,255,255,0.25)",background:"rgba(8,12,18,0.6)",color:"#e6edf3",fontSize:"15px",lineHeight:"1"}),y.appendChild(v),o.disclosure){let N=document.createElement("div");N.textContent=`${o.disclosurePrefix??"360\xB0 panorama"} \xB7 ${o.disclosure}`,Object.assign(N.style,{position:"absolute",top:"calc(12px + var(--sl-3d-top-inset, 0px))",left:"12px",zIndex:"2",maxWidth:"calc(100% - 88px)",padding:"8px 11px",borderRadius:"999px",overflow:"hidden",color:"#dce6f8",background:"rgba(8,12,18,0.68)",font:"600 11px/1.2 ui-sans-serif, system-ui, sans-serif",textOverflow:"ellipsis",whiteSpace:"nowrap",pointerEvents:"none",backdropFilter:"blur(6px)"}),y.appendChild(N)}let A=document.createElement("div");A.textContent=ya(o.lookAroundHint),Object.assign(A.style,{position:"absolute",bottom:"12px",left:"0",right:"0",textAlign:"center",color:"rgba(230,237,243,0.7)",font:"12px ui-sans-serif, system-ui, sans-serif",pointerEvents:"none"}),y.appendChild(A),e.appendChild(y),v.focus({preventScroll:!0});let x=!1,g=0,P=0,S=0,w=new Map,E=()=>{let[N,L]=[...w.values()];return N&&L?Math.hypot(N.x-L.x,N.y-L.y):0},T=N=>{let L=ba(N);L!==s&&(s=L,n.camera.perspective({fov:s,aspect:n.camera.aspect}),b())},F=N=>{N.target!==v&&(w.set(N.pointerId,{x:N.clientX,y:N.clientY}),x=w.size===1,g=N.clientX,P=N.clientY,w.size===2&&(S=E()),y.setPointerCapture?.(N.pointerId),y.style.cursor="grabbing")},R=N=>{if(w.has(N.pointerId)){if(w.set(N.pointerId,{x:N.clientX,y:N.clientY}),w.size>=2){let L=E();S>0&&L>0&&T(s*(S/L)),S=L,x=!1;return}x&&(i+=(N.clientX-g)*uf,a=Math.max(-vt,Math.min(vt,a+(N.clientY-P)*uf)),g=N.clientX,P=N.clientY,b())}},I=N=>{w.delete(N.pointerId),S=w.size===2?E():0;let L=w.values().next().value;x=w.size===1,L?(g=L.x,P=L.y):y.style.cursor="grab";try{y.releasePointerCapture?.(N.pointerId)}catch{}},_=N=>{N.preventDefault(),T(s+N.deltaY*.04)};y.addEventListener("pointerdown",F),y.addEventListener("pointermove",R),y.addEventListener("pointerup",I),y.addEventListener("pointercancel",I),y.addEventListener("wheel",_,{passive:!1});let k=N=>{if(!c){if(N.key==="Tab"){N.preventDefault(),v.focus({preventScroll:!0});return}if(N.key==="Escape"){N.stopPropagation(),U.close();return}if(N.key==="ArrowLeft"||N.key==="ArrowRight")i+=N.key==="ArrowLeft"?-4:4;else if(N.key==="ArrowUp"||N.key==="ArrowDown")a=Math.max(-vt,Math.min(vt,a+(N.key==="ArrowUp"?4:-4)));else if(N.key==="+"||N.key==="="){T(s-5),N.preventDefault();return}else if(N.key==="-"){T(s+5),N.preventDefault();return}else return;N.preventDefault(),b()}};window.addEventListener("keydown",k);let V=0,O=(N,L)=>{if(!d){L?.();return}let B=N===1?0:1,D=performance.now(),G=()=>{if(c)return;let j=r<=0?1:Math.min(1,(performance.now()-D)/r);d?.setOpacity(B+(N-B)*j),n.requestRender(),j<1?V=requestAnimationFrame(G):L?.()};V=requestAnimationFrame(G)};O(1);let H=()=>{c||(c=!0,m(),l.abort(),o.signal?.removeEventListener("abort",u),cancelAnimationFrame(V),y.removeEventListener("pointerdown",F),y.removeEventListener("pointermove",R),y.removeEventListener("pointerup",I),y.removeEventListener("pointercancel",I),y.removeEventListener("wheel",_),window.removeEventListener("keydown",k),y.remove(),M?.isConnected&&M.focus({preventScroll:!0}),d?.dispose(),n.camera.position.set(f[0],f[1],f[2]),n.camera.perspective({fov:h,aspect:n.camera.aspect}),n.camera.quaternion.set(p[0],p[1],p[2],p[3]),n.requestRender())},U={close(){if(c)return;let N=()=>{H(),o.onClose?.()};cancelAnimationFrame(V),O(0,N)},dispose:H};return v.addEventListener("click",()=>U.close()),U}var uf,ff=Vn(()=>{"use strict";lf();Er();Er();pa();uf=.15});var df={};Na(df,{createOpenPanorama:()=>kx});function kx(e){let{container:t,model:n,opts:o,analytics:r,orbit:i,loop:a,seatsById:s,ensureSeatView:c,resolvedSeatViewPose:l,gpu:u,gl:m,isContextLost:f,isDisposed:d,flightGen:h,setPanorama:p,getLoadAbort:b,setLoadAbort:y,setPanoramaSphereVisible:M,setFrozen:v,raisePanoramaLayer:A,restorePanoramaLayer:x,getOverviewChip:g,labelOverlay:P,reducedMotion:S,removeArriveChip:w,showArriveChip:E}=e;return async(T,F,R)=>{b()?.abort();let I=new AbortController;y(I);let _=n.seats.idToIndex.get(T);if(_===void 0){i.syncFromCamera();return}let k=s.get(T)?.label??T,V=l(T,_),O=c(T);if(!O){I.abort(),b()===I&&y(null),i.syncFromCamera();return}v(!0),a.stop();let H;try{H=await O}catch{if(b()===I&&y(null),r.panoramaFailed(T,"source"),!d()&&R===h()){v(!1),i.resumeAfterFlight(V.focal),a.requestRender();let Z=E(T,R,!0);requestAnimationFrame(()=>Z?.querySelector("[data-panorama-trigger]")?.focus())}return}if(d()||R!==h()){I.abort(),b()===I&&y(null);return}w();let U=g(),N=()=>{I.abort(),b()===I&&y(null),p(null),M(!1),x(),U.style.display="",P.setVisible(!o.arriveAtSeatEye),v(!1),r.panoramaClosed(),i.resumeAfterFlight(V.focal),a.requestRender();let Z=E(T,h());requestAnimationFrame(()=>Z?.querySelector("[data-panorama-trigger]")?.focus())},L=H.generated===!0,B=rf(H);A(),M(!L),U.style.display="none";let D=S()?0:F,G=u(),j=G&&!f()?await mf(t,L?null:H,{gl:m,scene:G.main,camera:i.camera,requestRender:()=>a.requestRender(),cameraOriginWorld:L?V.eye:void 0,focalWorld:V.focal},{fadeMs:D,seatLabel:k,disclosure:B,disclosurePrefix:L?"Live 3D view":"360\xB0 panorama",lookAroundHint:o.lookAroundHint,onClose:N,signal:I.signal}):null;if(d()||R!==h()){I.abort(),M(!1),b()===I&&y(null),j?.dispose(),U.style.display="",x();return}if(j)i.syncFromCamera(),P.setVisible(!1),v(!1),a.requestRender(),p(j);else if(L){x(),U.style.display="",v(!1),i.resumeAfterFlight(V.focal),a.requestRender(),p(null),M(!1),r.panoramaFailed(T,"mount");let Z=E(T,h(),!0);requestAnimationFrame(()=>Z?.querySelector("[data-panorama-trigger]")?.focus()),b()===I&&y(null);return}else M(!1),r.panoramaFallback(T),p(af(t,H,{fadeMs:D,seatLabel:k,disclosure:B,onClose:N,signal:I.signal,lookAroundHint:o.lookAroundHint}));r.panoramaOpened()}}var hf=Vn(()=>{"use strict";Er();ff()});var Zx={};Na(Zx,{VENUE3D_QUALITY_REPORT_VERSION:()=>om,autoVenue3d:()=>ur,buildSceneModel:()=>En,estimateVenue3D:()=>Mo,inspectVenue3DQualityEvidence:()=>pr,mountVenue3D:()=>$x,prepareVenue3D:()=>_f,prepareVenue3DFromChart:()=>Tf});module.exports=Yf(Zx);function Va(e,t,n){let o=Math.floor(t.length/3),r=n.center[0],i=n.center[2];if(o>0){let c=Math.max(1,Math.floor(o/4e3)),l=0,u=0,m=0;for(let f=0;f<o;f+=c)l+=t[f*3],u+=t[f*3+2],m++;r=l/m,i=u/m}let a=e[0]-r,s=e[2]-i;return Math.hypot(a,s)>n.radius*.12?Math.atan2(a,s):void 0}var Lf=require("ogl");function Ga(e,t,n="#ffffff"){let{iPosition:o,count:r}=t.seats;if(r<2||typeof document>"u")return null;let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let x=0;x<r;x++){let g=o[x*3],P=o[x*3+2];g<i&&(i=g),g>a&&(a=g),P<s&&(s=P),P>c&&(c=P)}for(let x of t.stages)i=Math.min(i,x.cx-x.halfX),a=Math.max(a,x.cx+x.halfX),s=Math.min(s,x.cz-x.halfZ),c=Math.max(c,x.cz+x.halfZ);let l=Math.min(130/Math.max(.001,a-i),86/Math.max(.001,c-s)),u=(148-(a-i)*l)/2,m=(104-(c-s)*l)/2,f=x=>u+(x-i)*l,d=x=>m+(x-s)*l,h=Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),p=document.createElement("canvas");p.width=Math.round(148*h),p.height=Math.round(104*h),p.setAttribute("aria-hidden","true"),p.setAttribute("data-seat-locator","");let b=p.style;b.position="absolute",b.left="12px",b.bottom="12px",b.width="148px",b.height="104px",b.borderRadius="10px",b.background="rgba(10,14,22,.72)",b.border="1px solid rgba(255,255,255,.14)",b.boxShadow="0 4px 14px rgba(0,0,0,.35)",b.pointerEvents="none",b.zIndex="3",b.display="none",e.appendChild(p);let y=document.createElement("canvas");y.width=p.width,y.height=p.height;let M=y.getContext("2d");if(M){M.scale(h,h),M.fillStyle="rgba(214,222,234,.28)";let x=Math.max(1,Math.ceil(r/6e3));for(let g=0;g<r;g+=x)M.fillRect(f(o[g*3])-.6,d(o[g*3+2])-.6,1.2,1.2);M.fillStyle="rgba(236,240,246,.16)",M.strokeStyle="rgba(236,240,246,.55)",M.lineWidth=1;for(let g of t.stages){let P=f(g.cx-g.halfX),S=d(g.cz-g.halfZ),w=g.halfX*2*l,E=g.halfZ*2*l;M.fillRect(P,S,w,E),M.strokeRect(P+.5,S+.5,Math.max(0,w-1),Math.max(0,E-1))}}let v=p.getContext("2d"),A="";return{el:p,update(x,g){if(!x||!v||e.clientWidth>0&&e.clientWidth<560){b.display!=="none"&&(b.display="none"),A="";return}let P=f(x[0]),S=d(x[2]),w=g?Math.atan2(g[2],g[0]):0,E=`${P.toFixed(1)},${S.toFixed(1)},${w.toFixed(2)}`;if(E!==A){if(A=E,b.display="block",v.setTransform(1,0,0,1,0,0),v.clearRect(0,0,p.width,p.height),v.drawImage(y,0,0),v.setTransform(h,0,0,h,0,0),g){let T=v.createRadialGradient(P,S,0,P,S,26);T.addColorStop(0,"rgba(255,255,255,.55)"),T.addColorStop(1,"rgba(255,255,255,0)"),v.fillStyle=T,v.beginPath(),v.moveTo(P,S),v.arc(P,S,26,w-.5,w+.5),v.closePath(),v.fill()}v.fillStyle=n,v.strokeStyle="rgba(10,14,22,.9)",v.lineWidth=1.5,v.beginPath(),v.arc(P,S,3.6,0,Math.PI*2),v.fill(),v.stroke()}},dispose(){p.remove()}}}var we={pedestal:0,pad:1,back:2,arm:3,footrest:4,leg:5,body:10,head:11},Kf=.44,$f=.15,Ha=.3,Zf=.24;function za(e){return e===void 0||!Number.isFinite(e)||e<=0?Zf:Math.min(Ha,Math.max($f,e*Kf))}var Hn=.21,qf=.05,jr=.45,Rt=jr+qf,zn=.92,Gn=.66,Ur=1.205,ja=-.23,Ua=.38,Qf=[{part:we.pedestal,min:[-.3,0,-.3],max:[.3,.36,.3]},{part:we.pad,min:[-1,.36,-.95],max:[1,jr,1]},{part:we.back,min:[-1,Rt,-1],max:[1,zn,-.72]},{part:we.arm,min:[-1,.44,-.82],max:[-.78,.65,.78]},{part:we.arm,min:[.78,.44,-.82],max:[1,.65,.78]},{part:we.footrest,min:[-.9,.18,.78],max:[.9,.31,1.34]},{part:we.leg,min:[-.82,0,-.7],max:[-.62,.37,-.48]},{part:we.leg,min:[.62,0,-.7],max:[.82,.37,-.48]},{part:we.leg,min:[-.82,0,.48],max:[-.62,.37,.7]},{part:we.leg,min:[.62,0,.48],max:[.82,.37,.7]}],Jf=[{part:we.body,min:[-.52,.39,-.08],max:[-.08,.55,.82]},{part:we.body,min:[.08,.39,-.08],max:[.52,.55,.82]},{part:we.body,min:[-.47,.05,.58],max:[-.13,.43,.82]},{part:we.body,min:[.13,.05,.58],max:[.47,.43,.82]},{part:we.head,min:[-.16,1.04,-.33],max:[.16,1.1,-.13]}],ed=[{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 Wa(){let e=[],t=[],n=[],o=[],r=(L,B,D)=>{let G=n.length,[j,Z,$]=L,ee=[Z[0]-j[0],Z[1]-j[1],Z[2]-j[2]],Q=[$[0]-j[0],$[1]-j[1],$[2]-j[2]],X=ee[1]*Q[2]-ee[2]*Q[1],Y=ee[2]*Q[0]-ee[0]*Q[2],K=ee[0]*Q[1]-ee[1]*Q[0],re=Math.hypot(X,Y,K);re>1e-9?(X/=re,Y/=re,K/=re):[X,Y,K]=B,X*B[0]+Y*B[1]+K*B[2]<0&&(X=-X,Y=-Y,K=-K);for(let ne of L)e.push(...ne),t.push(X,Y,K),n.push(D);o.push(G,G+1,G+2,G,G+2,G+3)},i=L=>{for(let B of ed){let D=B.c.map(G=>G.map((j,Z)=>j?L.max[Z]:L.min[Z]));r(D,B.n,L.part)}},a=(L,B)=>{let[D,G,j]=B?[0,1,2]:[0,2,1],Z=L.min[D],$=L.max[D],ee=L.min[G],Q=L.max[G],X=($-Z)*.1,Y=(Q-ee)*.1,K=B?[[Z+X,ee],[$-X,ee],[$,ee+Y],[$*.94,Q-(Q-ee)*.23],[$*Gn,Q],[Z*Gn,Q],[Z*.94,Q-(Q-ee)*.23],[Z,ee+Y]]:[[Z+X,ee],[$-X,ee],[$,ee+Y],[$,Q-Y],[$-X,Q],[Z+X,Q],[Z,Q-Y],[Z,ee+Y]],re=(se,J,ie)=>{let Ee=[0,0,0];return Ee[D]=se,Ee[G]=J,Ee[j]=ie,Ee},ne=[L.min[j],L.max[j]].map(se=>K.map(([J,ie])=>re(J,ie,se)));for(let se=0;se<K.length;se++){let J=(se+1)%K.length,ie=[0,0,0];ie[D]=(K[se][0]+K[J][0])/2-(Z+$)/2,ie[G]=(K[se][1]+K[J][1])/2-(ee+Q)/2,r([ne[0][se],ne[0][J],ne[1][J],ne[1][se]],ie,L.part)}for(let se=0;se<2;se++){let J=[0,0,0];J[j]=se?1:-1;let ie=ne[se];for(let Ee=1;Ee<ie.length-1;Ee++){let te=n.length;for(let ve of[ie[0],ie[Ee],ie[Ee+1]])e.push(...ve),t.push(...J),n.push(L.part);o.push(te,te+1,te+2)}}};for(let L of Qf)L.part===we.pad||L.part===we.back?a(L,L.part===we.back):i(L);for(let L of Jf)i(L);let s=jr,c=1.08,l=.47,u=.69,m=-.55,f=.08,d=-.48,h=.01,p=[-l,s,m],b=[l,s,m],y=[-l,s,f],M=[l,s,f],v=[-u,c,d],A=[u,c,d],x=[-u,c,h],g=[u,c,h];r([b,A,g,M],[1,0,0],we.body),r([y,x,v,p],[-1,0,0],we.body),r([p,b,M,y],[0,-1,0],we.body);let P=c+.07,S=.24,w=[-S,P,d],E=[S,P,d],T=[-S,P,h],F=[S,P,h];r([x,T,w,v],[-.5,1,0],we.body),r([T,F,E,w],[0,1,0],we.body),r([F,g,A,E],[.5,1,0],we.body),r([M,g,x,y],[0,0,1],we.body),r([g,F,T,x],[0,0,1],we.body),r([p,v,A,b],[0,0,-1],we.body),r([v,w,E,A],[0,0,-1],we.body);let R=10,I=8,_=[0,Ur,ja],k=[.32,.115,Ua],V=n.length;for(let L=0;L<=I;L++){let B=Math.PI*L/I,D=Math.cos(B),G=Math.sin(B);for(let j=0;j<=R;j++){let Z=Math.PI*2*j/R,$=G*Math.cos(Z),ee=G*Math.sin(Z);e.push(_[0]+k[0]*$,_[1]+k[1]*D,_[2]+k[2]*ee);let Q=$/k[0],X=D/k[1],Y=ee/k[2],K=Math.hypot(Q,X,Y)||1;Q/=K,X/=K,Y/=K,t.push(Q,X,Y),n.push(we.head)}}for(let L=0;L<I;L++)for(let B=0;B<R;B++){let D=V+L*(R+1)+B,G=D+R+1;o.push(D,G,D+1,D+1,G,G+1)}let O=new Float32Array(e),H=new Float32Array(t),U=new Float32Array(n),N=new Uint16Array(o);return{position:O,normal:H,part:U,index:N,vertexCount:n.length,indexCount:o.length}}function Xa(e,t,n,o){let r=new Float32Array(t),i=l=>e[l*3],a=l=>e[l*3+2],s=0,c=(l,u)=>{let m=u-l;for(let f=l;f<u;f++){let[d,h]=o(f),p=d-i(f),b=h-a(f);if(m>=2){let y=Math.max(l,f-1),M=Math.min(u-1,f+1),v=i(M)-i(y),A=a(M)-a(y),x=Math.hypot(v,A);if(x>1e-6){let g=-A/x,P=v/x;g*p+P*b<0&&(g=-g,P=-P),p=g,b=P}}r[f]=p===0&&b===0?0:Math.atan2(p,b)}};for(let l=1;l<=t;l++)(l===t||n(l)!==n(s))&&(c(s,l),s=l);return r}var Wr=78,Ya=18;function Ka(){let e=[],t=[],n=[],o=[],r=[],i=[{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]]}];for(let s of[{part:1,min:[-1,.36,-.95],max:[1,.45,1]},{part:2,min:[-1,Rt,-1],max:[1,zn,-.72]}])for(let c of i){let l=e.length/3,u=c.n[1]+(s.part===2?Math.abs(c.n[0])*(1-Gn)/(zn-Rt):0),m=Math.hypot(c.n[0],u,c.n[2]),f=[c.n[0]/m,u/m,c.n[2]/m];for(let[d,h]of c.c.entries()){let p=h.map((b,y)=>s.min[y]+b*(s.max[y]-s.min[y]));s.part===2&&(p[0]*=1-h[1]*(1-Gn)),e.push(...p),t.push(...f),n.push(s.part),o.push(...[[-1,-1],[1,-1],[1,1],[-1,1]][d])}r.push(l,l+1,l+2,l,l+2,l+3)}let a=e.length/3;for(let[s,c]of[[-1,-1],[1,-1],[1,1],[-1,1]])e.push(s,c,0),t.push(0,1,0),n.push(0),o.push(s,c);return r.push(a,a+1,a+2,a,a+2,a+3),r.push(...r.slice(12,18),...r.slice(60,66),...r.slice(72,78)),{position:new Float32Array(e),normal:new Float32Array(t),surface:new Float32Array(n),uv:new Float32Array(o),index:new Uint16Array(r)}}var Ja=require("ogl");var td=/^#?([\da-f]{3}|[\da-f]{6})$/i;function $a(e){let t=e.replace("#","");return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}function nd(e){let t=td.exec((e??"").trim());if(!t)return null;let n=t[1].length===3?t[1].split("").map(r=>r+r).join(""):t[1],o=parseInt(n,16);return[o>>16&255,o>>8&255,o&255]}function be(e){let t=nd(e);return t?[t[0]/255,t[1]/255,t[2]/255]:null}function Xr(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function od(e){return .2126*Xr(e[0])+.7152*Xr(e[1])+.0722*Xr(e[2])}function Za(e){return od([e[0]*255,e[1]*255,e[2]*255])}function rd(e){return .2126*e[0]+.7152*e[1]+.0722*e[2]}function ge(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n]}function at(e,t){let n=rd(e);return ge(e,[n,n,n],t)}function qa({r:e,g:t,b:n}){let o=e/255,r=t/255,i=n/255,a=Math.max(o,r,i),s=Math.min(o,r,i),c=(a+s)/2;if(a===s)return{h:0,s:0,l:c};let l=a-s,u=c>.5?l/(2-a-s):l/(a+s),m;return a===o?m=((r-i)/l+(r<i?6:0))/6:a===r?m=((i-o)/l+2)/6:m=((o-r)/l+4)/6,{h:m,s:u,l:c}}var Be=["available","held","sold","selected","dimmed"];function jn(e){let t=Be.indexOf(e);return t<0?0:t}var Qa={available:[.24,.82,.52],held:[.34,.39,.45],sold:[.34,.39,.45],selected:[.24,.74,1],dimmed:[.28,.32,.37]};function Ao(e){let t=.2126*e[0]+.7152*e[1]+.0722*e[2],n=.78,o=.86;return[(t+(e[0]-t)*n)*o,(t+(e[1]-t)*n)*o,(t+(e[2]-t)*n)*o]}var Yr={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]},Wt={top:[.05,.06,.08],bottom:[.1,.12,.15]};function ce(e,t){return[Math.min(1,e[0]*t),Math.min(1,e[1]*t),Math.min(1,e[2]*t)]}function id(){let e=typeof window<"u"&&window.devicePixelRatio||1,t=navigator.deviceMemory,n=typeof t=="number"&&t<=4?1.5:2;return Math.min(e,n)}var Io=class{constructor(t,n){this.clearRgb=[0,0,0];this.container=t,this.canvas=document.createElement("canvas"),this.canvas.style.display="block",this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.touchAction="none",this.canvas.tabIndex=0,this.canvas.setAttribute("role","application"),this.canvas.setAttribute("aria-label","Interactive 3D venue. Drag or use arrow keys to look around; pinch, scroll, plus or minus to zoom."),this.renderer=new Ja.Renderer({canvas:this.canvas,dpr:id(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[Wt.top[0],Wt.top[1],Wt.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),t.appendChild(this.canvas),this.lostHandler=o=>{o.preventDefault(),n.onContextLost()},this.restoredHandler=()=>n.onContextRestored(),this.canvas.addEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.restoredHandler,!1),this.resize()}setClearColor(t){this.clearRgb=[t[0],t[1],t[2]],this.gl.clearColor(t[0],t[1],t[2],1)}get clearColor(){return this.clearRgb}resize(){let t=Math.max(1,this.container.clientWidth||this.canvas.clientWidth||1),n=Math.max(1,this.container.clientHeight||this.canvas.clientHeight||1);return this.renderer.setSize(t,n),{width:t,height:n}}get pixelHeight(){return this.renderer.height*this.renderer.dpr}get aspect(){return this.renderer.width/Math.max(1,this.renderer.height)}dispose(){this.canvas.removeEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.restoredHandler,!1);let t=this.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}simulateContextLossCycle(){let t=this.gl.getExtension("WEBGL_lose_context");t&&(t.loseContext(),setTimeout(()=>{t.restoreContext&&t.restoreContext()},300))}};var on=require("ogl"),Ve=Math.PI/180,Kr=15*Ve,$r=80*Ve,nn=.12,es=35,Zr=1.25,ts=.006,ad=4,rn=.82,Un=1/rn,sd=.12,cd=2;function ld(e,t){return{azimuth:0-e*ts,polar:-t*ts}}function ns(e,t,n){let o=Math.max(cd,Math.max(1,t)*sd),r=n*ad;return{minDist:e?Math.min(e.minDist,o):o,maxDist:e?Math.max(e.maxDist,r):r}}var ud=1.5;function md(e,t,n){let o=Math.max(1,n)*ud;if(!e)return{anchor:[t[0],t[1],t[2]],limit:o};let[r,i,a]=e.anchor,s=t[1]-i,c=Math.max(Math.abs(t[0]-r),Math.abs(t[2]-a),s>=0?s:-s*2);return{anchor:e.anchor,limit:Math.max(e.limit,c+o)}}function fd(e,t,n,o,r,i,a,s){let c=Math.sin(n),l=[c*Math.sin(t),Math.cos(n),c*Math.cos(t)],u=[e[0]+o*l[0],e[1]+o*l[1],e[2]+o*l[2]],m=[-l[0],-l[1],-l[2]],f=[-m[2],0,m[0]],d=Math.hypot(f[0],f[2])||1;f=[f[0]/d,0,f[2]/d];let h=[f[1]*m[2]-f[2]*m[1],f[2]*m[0]-f[0]*m[2],f[0]*m[1]-f[1]*m[0]],p=Math.tan(r*Ve/2),b=p*(i>0?i:1),y=[0,1,2].map(A=>m[A]+a*b*f[A]+s*p*h[A]);if(y[1]>=-1e-6)return null;let M=(e[1]-u[1])/y[1],v=Math.hypot(y[0],y[1],y[2]);return!(M>0)||M*v>o*dd?null:[u[0]+y[0]*M,e[1],u[2]+y[2]*M]}var os=3,dd=4,rs=.72,hd=.6;function pd(e,t,n){return e!=="auto"?e:n!==null&&t<n*hd?"pan":"orbit"}function is(e,t){let n=Math.sin(t),o=-n*Math.sin(e),r=-Math.cos(t),i=-n*Math.cos(e);if(Math.abs(r)>.999)return null;let a=-i,s=o,c=Math.hypot(a,s);return a/=c,s/=c,{fx:o,fy:r,fz:i,rx:a,rz:s,ux:-s*r,uy:s*o-a*i,uz:a*r}}var bd=.4;function yd(e,t,n,o,r,i){let a=[e.center[0],e.center[1],e.center[2]],s=i(a),c=e.fitPoints,l=is(o,r);if(!c||c.length<9||!l)return{center:a,distance:s};let{fx:u,fy:m,fz:f,rx:d,rz:h,ux:p,uy:b,uz:y}=l,M=Math.hypot(u,f),v=u/M,A=f/M,x=v*p+A*y,g=bd*Math.max(1,e.radius);for(let P=0;P<3;P++){let S=1/0,w=-1/0,E=1/0,T=-1/0;for(let V=0;V+2<c.length;V+=3){let O=c[V]-a[0],H=c[V+1]-a[1],U=c[V+2]-a[2],N=s+O*u+H*m+U*f;if(!(N>.001))continue;let L=(O*d+U*h)/(N*t),B=(O*p+H*b+U*y)/(N*n);L<S&&(S=L),L>w&&(w=L),B<E&&(E=B),B>T&&(T=B)}if(!Number.isFinite(S))break;let F=(S+w)/2*s*t,R=Math.abs(x)>.1?(E+T)/2*s*n/x:0,I=F*d+R*v,_=F*h+R*A;if(Math.hypot(a[0]+I-e.center[0],a[2]+_-e.center[2])>g){let V=a[0]-e.center[0],O=a[2]-e.center[2],H=V+I,U=O+_,N=g/Math.hypot(H,U);I=H*N-V,_=U*N-O}a=[a[0]+I,a[1],a[2]+_],s=i(a)}return{center:a,distance:s}}var Eo=class{constructor(t,n,o,r){this.fovY=es;this.target=new on.Vec3;this.azimuth=-30*Ve;this.polar=55*Ve;this.distance=10;this.azT=-30*Ve;this.polT=55*Ve;this.distT=10;this.minDist=1;this.maxDist=100;this.envelope=null;this.gestureFired=!1;this.interactionEnabled=!0;this.dragging=!1;this.panning=!1;this.lastX=0;this.lastY=0;this.activePointers=new Map;this.pinchDist=0;this.pinchCx=0;this.pinchCy=0;this.targetT=new on.Vec3;this.panAnchor=new on.Vec3;this.panLimit=0;this.panBox=null;this.zoomPointResolver=null;this.primaryDragMode="auto";this.overviewDist=null;this.pinchAngle=0;this.camera=new on.Camera(t,{fov:es,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=o,this.onGesture=r,this.onPointerDown=i=>{if(this.interactionEnabled){try{this.canvas.setPointerCapture?.(i.pointerId)}catch{}if(this.activePointers.set(i.pointerId,{x:i.clientX,y:i.clientY}),this.activePointers.size===1){let a=this.dragAction(),s=a==="orbit"?"pan":"orbit",c=i.button===2||i.button===1||i.shiftKey?s:a;this.panning=c==="pan",this.dragging=!this.panning,this.lastX=i.clientX,this.lastY=i.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance(),this.pinchAngle=this.currentPinchAngle();let a=this.pinchCentroid();this.pinchCx=a.x,this.pinchCy=a.y}}},this.onPointerMove=i=>{if(!this.interactionEnabled||!this.activePointers.has(i.pointerId))return;if(this.activePointers.set(i.pointerId,{x:i.clientX,y:i.clientY}),this.activePointers.size>=2){let l=this.currentPinchDistance(),u=this.pinchCentroid();this.pinchDist>0&&(this.dollyAt(Math.exp((this.pinchDist-l)*.005),u.x,u.y),this.fireGesture()),this.pinchDist=l;let m=this.currentPinchAngle(),f=m-this.pinchAngle;f>Math.PI&&(f-=2*Math.PI),f<-Math.PI&&(f+=2*Math.PI),this.pinchAngle=m,Math.abs(f)>1e-4&&Math.abs(f)<.5&&(this.azT+=f,this.fireGesture()),this.panBy(u.x-this.pinchCx,u.y-this.pinchCy),this.pinchCx=u.x,this.pinchCy=u.y;return}let a=i.clientX-this.lastX,s=i.clientY-this.lastY;if(this.panning){this.lastX=i.clientX,this.lastY=i.clientY,(a!==0||s!==0)&&(this.panBy(a,s),this.fireGesture());return}if(!this.dragging)return;this.lastX=i.clientX,this.lastY=i.clientY,(a!==0||s!==0)&&this.fireGesture();let c=ld(a,s);this.azT+=c.azimuth,this.polT=Math.max(Kr,Math.min($r,this.polT+c.polar)),this.requestRender()},this.onPointerUp=i=>{this.activePointers.delete(i.pointerId);try{this.canvas.releasePointerCapture?.(i.pointerId)}catch{}this.activePointers.size<2&&(this.pinchDist=0),this.activePointers.size===0&&(this.dragging=!1,this.panning=!1)},this.onContextMenu=i=>{i.preventDefault()},this.onWheel=i=>{if(i.preventDefault(),!this.interactionEnabled)return;let a=i.deltaMode===1?16:i.deltaMode===2?100:1,s=Math.max(-2,Math.min(2,i.deltaY*a/100));this.dollyAt(Math.exp(s*.22),i.clientX,i.clientY),this.fireGesture()},this.onKeyDown=i=>{if(!this.interactionEnabled)return;let a=7*Ve;if(i.shiftKey&&(i.key==="ArrowLeft"||i.key==="ArrowRight"||i.key==="ArrowUp"||i.key==="ArrowDown"))this.panBy(i.key==="ArrowLeft"?-32:i.key==="ArrowRight"?32:0,i.key==="ArrowUp"?-32:i.key==="ArrowDown"?32:0);else if(i.key==="ArrowLeft"||i.key==="ArrowRight")this.azT+=i.key==="ArrowLeft"?a:-a;else if(i.key==="ArrowUp"||i.key==="ArrowDown")this.polT=Math.max(Kr,Math.min($r,this.polT+(i.key==="ArrowUp"?-a:a)));else if(i.key==="+"||i.key==="=")this.dollyBy(rn);else if(i.key==="-"||i.key==="_")this.dollyBy(Un);else return;i.preventDefault(),this.fireGesture(),this.requestRender()},n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerUp),n.addEventListener("pointercancel",this.onPointerUp),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("keydown",this.onKeyDown),n.addEventListener("contextmenu",this.onContextMenu)}pinchCentroid(){let t=[...this.activePointers.values()];if(!t.length)return{x:0,y:0};let n=0,o=0;for(let r of t)n+=r.x,o+=r.y;return{x:n/t.length,y:o/t.length}}panBy(t,n){let o=this.canvas.clientHeight||1,r=2*this.distance*Math.tan(this.fovY*Ve/2)/o,i=Math.sin(this.azimuth),a=Math.cos(this.azimuth),s=a,c=-i,l=Math.cos(this.polar),u=Math.sin(this.polar),m=-i*l,f=-a*l;this.targetT.x+=(-t*s+n*m)*r,this.targetT.z+=(-t*c+n*f)*r,this.targetT.y+=n*u*r,this.clampPan(),this.requestRender()}widenPanBox(t){this.panBox=md(this.panBox,t.center,t.radius),this.panAnchor.set(this.panBox.anchor[0],this.panBox.anchor[1],this.panBox.anchor[2]),this.panLimit=this.panBox.limit}clampPan(){if(this.panLimit<=0)return;let t=this.panLimit,n=this.panAnchor.x,o=this.panAnchor.y,r=this.panAnchor.z;this.targetT.x=Math.max(n-t,Math.min(n+t,this.targetT.x)),this.targetT.z=Math.max(r-t,Math.min(r+t,this.targetT.z)),this.targetT.y=Math.max(o-t*.5,Math.min(o+t,this.targetT.y))}fireGesture(){this.gestureFired||(this.gestureFired=!0,this.onGesture?.())}currentPinchAngle(){let[t,n]=[...this.activePointers.values()];return t&&n?Math.atan2(n.y-t.y,n.x-t.x):0}dragAction(){return pd(this.primaryDragMode,this.distT,this.overviewDist)}currentPinchDistance(){let t=[...this.activePointers.values()];return t.length<2?0:Math.hypot(t[0].x-t[1].x,t[0].y-t[1].y)}dollyBy(t){this.distT=Math.max(this.minDist,Math.min(this.maxDist,this.distT*t)),this.requestRender()}dollyAt(t,n,o){let r=this.distT,i=this.canvas.getBoundingClientRect?.(),a=this.zoomPointResolver?.(n,o)??null;if(a){this.distT=Math.max(os,Math.min(this.maxDist,this.distT*t)),this.minDist=Math.min(this.minDist,Math.max(os,this.distT)),this.requestRender(),this.scaleTargetAbout(a,this.distT/r);return}let s=i&&i.width>0&&i.height>0?fd([this.targetT.x,this.targetT.y,this.targetT.z],this.azT,this.polT,this.distT,this.fovY,this.camera.aspect||i.width/i.height,(n-i.left)/i.width*2-1,1-(o-i.top)/i.height*2):null;this.dollyBy(t),s&&this.scaleTargetAbout(s,this.distT/r)}scaleTargetAbout(t,n){!Number.isFinite(n)||n===1||(this.targetT.x=t[0]+(this.targetT.x-t[0])*n,this.targetT.y=t[1]+(this.targetT.y-t[1])*n,this.targetT.z=t[2]+(this.targetT.z-t[2])*n,this.clampPan())}setZoomPointResolver(t){this.zoomPointResolver=t}zoomBy(t){this.interactionEnabled&&(this.dollyBy(t),this.fireGesture())}dollyLimitState(){return{atMin:this.distT<=this.minDist+1e-6,atMax:this.distT>=this.maxDist-1e-6}}setPrimaryDragMode(t){this.primaryDragMode=t}setInteractionEnabled(t){this.interactionEnabled=t,!t&&(this.activePointers.clear(),this.dragging=!1,this.panning=!1,this.pinchDist=0)}frame(t,n=!1,o,r=!1,i){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.target.set(t.center[0],t.center[1],t.center[2]),this.targetT.copy(this.target),this.widenPanBox(t);let a=Math.max(1,t.radius),s=this.fovY*Ve/2,c=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,l=Math.atan(Math.tan(s)*c);this.azT=o??-30*Ve,this.polT=Math.max(15,Math.min(80,i?.polarDeg??55))*Ve;let u=this.framedOn(t,s,l),m=u.distance;this.target.set(u.center[0],u.center[1],u.center[2]),this.targetT.copy(this.target),this.distT=m*Math.max(1.05,Math.min(2,i?.margin??Zr)),this.envelope=ns(this.envelope,a,m),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.overviewDist===null&&(this.overviewDist=this.distT),n?(this.azimuth=this.azT,this.polar=12*Ve,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(t){if(!(t>0)||!Number.isFinite(t))return;let n=this.camera.aspect;if(this.interactionEnabled&&n>0){let o=Math.min(n,1)/Math.min(t,1);this.distance*=o,this.distT*=o,this.overviewDist!==null&&(this.overviewDist*=o),this.maxDist=Math.max(this.maxDist,this.distance,this.distT),this.applyPosition()}this.camera.perspective({aspect:t})}glideTo(t,n){this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.widenPanBox(t),this.targetT.set(t.center[0],t.center[1],t.center[2]);let o=this.fovY*Ve/2,r=Math.atan(Math.tan(o)*(this.camera.aspect||1));this.azT=this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*Ve;let i=this.framedOn(t,o,r),a=i.distance;this.targetT.set(i.center[0],i.center[1],i.center[2]),this.distT=a*Math.max(1.05,Math.min(2,n?.margin??Zr)),this.envelope=ns(this.envelope,Math.max(1,t.radius),a),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.requestRender()}frameSoft(t,n,o=!1,r){this.target.set(t.center[0],t.center[1],t.center[2]),this.targetT.copy(this.target),this.widenPanBox(t),this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let i=this.fovY*Ve/2,a=o?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,s=Math.atan(Math.tan(i)*a);this.azT=n??this.azimuth,this.polT=Math.max(15,Math.min(80,r?.polarDeg??55))*Ve;let c=this.framedOn(t,i,s);this.targetT.set(c.center[0],c.center[1],c.center[2]),this.distT=c.distance*Math.max(1.05,Math.min(2,r?.margin??Zr))}framedOn(t,n,o){return yd(t,Math.tan(o),Math.tan(n),this.azT,this.polT,r=>this.fitDistance({...t,center:r},n,o,this.azT,this.polT))}fitDistance(t,n,o,r,i){let a=Math.max(1,t.radius),s=Math.max(a/Math.tan(n),a/Math.tan(o)),c=t.box;if(!c)return s;let l=is(r,i);if(!l)return s;let{fx:u,fy:m,fz:f,rx:d,rz:h,ux:p,uy:b,uz:y}=l,M=Math.tan(o),v=Math.tan(n),A=1;for(let E=0;E<8;E++){let T=(E&1?c.max[0]:c.min[0])-t.center[0],F=(E&2?c.max[1]:c.min[1])-t.center[1],R=(E&4?c.max[2]:c.min[2])-t.center[2],I=T*u+F*m+R*f,_=Math.abs(T*d+R*h),k=Math.abs(T*p+F*b+R*y);A=Math.max(A,_/M-I,k/v-I)}let x=Math.min(s,Math.max(A,a*.35)),g=t.fitPoints;if(!g||g.length<9)return x;let P=0,S=1/(M*rs),w=1/(v*rs);for(let E=0;E+2<g.length;E+=3){let T=g[E]-t.center[0],F=g[E+1]-t.center[1],R=g[E+2]-t.center[2],I=T*u+F*m+R*f,_=Math.abs(T*d+R*h),k=Math.abs(T*p+F*b+R*y);P=Math.max(P,_*S-I,k*w-I)}return Math.min(x*1.5,Math.max(x*.55,P))}updateClipping(t){let n=this.camera.position.x-t.center[0],o=this.camera.position.y-t.center[1],r=this.camera.position.z-t.center[2],i=Math.hypot(this.camera.position.x-this.target.x,this.camera.position.y-this.target.y,this.camera.position.z-this.target.z),a=this.interactionEnabled&&Math.abs(i-this.distance)<=this.distance*.01,{near:s,far:c}=Md(Math.hypot(n,o,r),t.radius,a?this.distance:null);this.camera.perspective({near:s,far:c,aspect:this.camera.aspect})}update(){let t=this.azT-this.azimuth,n=this.polT-this.polar,o=this.distT-this.distance,r=this.targetT.x-this.target.x,i=this.targetT.y-this.target.y,a=this.targetT.z-this.target.z,s=Math.max(1e-4,this.distance*1e-4),c=Math.abs(t)>1e-4||Math.abs(n)>1e-4||Math.abs(o)>1e-4||Math.abs(r)>s||Math.abs(i)>s||Math.abs(a)>s;return this.azimuth+=t*nn,this.polar+=n*nn,this.distance+=o*nn,this.target.x+=r*nn,this.target.y+=i*nn,this.target.z+=a*nn,c&&this.applyPosition(),c}get currentAzimuth(){return this.azimuth}get currentDistance(){return this.distance}get targetDistance(){return this.distT}syncFromCamera(){let t=this.camera.position.x-this.target.x,n=this.camera.position.y-this.target.y,o=this.camera.position.z-this.target.z,r=Math.hypot(t,n,o)||1,i=Math.max(Kr,Math.min($r,Math.acos(Math.max(-1,Math.min(1,n/r)))));this.distance=this.distT=r,this.polar=this.polT=i,this.azimuth=this.azT=Math.atan2(t,o)}snapshot(){let t=this.target.clone(),n=this.targetT.clone(),{azimuth:o,azT:r,polar:i,polT:a,distance:s,distT:c}=this,l=this.camera.position.clone(),u=[...this.camera.quaternion],m=this.camera.fov;return()=>{this.target.copy(t),this.targetT.copy(n),Object.assign(this,{azimuth:o,azT:r,polar:i,polT:a,distance:s,distT:c}),this.camera.position.copy(l),this.camera.quaternion.set(u[0],u[1],u[2],u[3]),this.camera.perspective({fov:m,aspect:this.camera.aspect}),this.camera.updateMatrixWorld()}}setTarget(t){this.target.set(t[0],t[1],t[2]),this.targetT.copy(this.target)}resumeAfterFlight(t){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),t&&this.target.set(t[0],t[1],t[2]),this.targetT.copy(this.target),this.syncFromCamera()}applyPosition(){let t=Math.sin(this.polar),n=this.target.x+this.distance*t*Math.sin(this.azimuth),o=this.target.y+this.distance*Math.cos(this.polar),r=this.target.z+this.distance*t*Math.cos(this.azimuth);this.camera.position.set(n,o,r),this.camera.lookAt(this.target)}dispose(){this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointercancel",this.onPointerUp),this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("keydown",this.onKeyDown),this.canvas.removeEventListener("contextmenu",this.onContextMenu),this.activePointers.clear()}},gd=.1,xd=.25;function Md(e,t,n){let o=Math.max(1,t)*1.18,r=n==null?xd:Math.max(.05,n*gd),i=Math.max(r,e-o),a=Math.max(i+10,e+o);return{near:i,far:a}}var Ro=class{constructor(t){this.rafId=0;this.running=!1;this.lastTime=0;this.fpsEma=0;this.rendered=0;this.tick=t=>{let n=this.lastTime?(t-this.lastTime)/1e3:.016666666666666666;if(this.lastTime=t,n>0){let r=1/n;this.fpsEma=this.fpsEma?this.fpsEma*.9+r*.1:r}this.rendered++,this.frame(n)?this.rafId=requestAnimationFrame(this.tick):(this.running=!1,this.rafId=0)};this.frame=t}requestRender(){this.running||(this.running=!0,this.lastTime=0,this.rafId=requestAnimationFrame(this.tick))}stats(){return{fps:this.running?Math.round(this.fpsEma):0,rendered:this.rendered,idle:!this.running}}stop(){this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=0,this.running=!1}};function as(e){let t=!1;return n=>{n!==t&&(t=n,n?e.dataset.slReady="1":delete e.dataset.slReady)}}function qr(e,t,n){return Math.max(t,Math.min(n,e))}function vd(e){return qr(e,0,1)}function ss(e){let t=vd(e);return t*t*(3-2*t)}var an=2.5,Sd=1.15,Wn=12,sn=22,cs=6,ls=9.5,us=.9,ms=2.2,Qr=30,Jr=4,Co=8192;var dM=sn+Jr;function fs(e,t){let n=t*1.4,o=t*3.2;if(e<=n)return{scale:1,fade:0,minPixels:an};let r=Math.min(1,(e-n)/Math.max(.001,o-n));return{scale:1-r*.4,fade:r*.55,minPixels:an+r*(Sd-an)}}function ds(e,t,n){return!(e>0)||!(t>0)||!(n>0)?!1:t*n/e>=64}var wd=12;function hs(e,t,n,o,r){if(!(e>0)||!(t>0)||!(n>0)||!(o>0)||!(r>0))return!1;let i=Math.tan(o/2*Math.PI/180);if(!(i>0))return!1;let a=t/(n*i)*(r/2);return Math.PI*a*a/e>=wd}var ei=[{key:"wheelchair",label:"Wheelchair space",short:"Wheelchair",icon:"\u267F"},{key:"companion",label:"Companion seat",short:"Companion",icon:"\u{1F9D1}\u200D\u{1F91D}\u200D\u{1F9D1}"},{key:"semi-ambulatory",label:"Semi-ambulatory (limited mobility)",short:"Limited mobility",icon:"\u{1F9AF}"},{key:"designated-aisle",label:"Designated aisle / transfer seat",short:"Aisle transfer",icon:"AS"},{key:"step-free",label:"Step-free accessible seat",short:"Step-free",icon:"SF"},{key:"hearing",label:"Assistive listening",short:"Hearing",icon:"\u{1F9BB}"},{key:"cart",label:"CART live-caption view",short:"CART captions",icon:"CC"},{key:"sign-language",label:"Sign-language view",short:"Sign language",icon:"\u{1F91F}"},{key:"low-vision",label:"Blind / low-vision viewing",short:"Low vision",icon:"LV"},{key:"sensory-friendly",label:"Quiet / sensory-friendly seating",short:"Sensory-friendly",icon:"QS"},{key:"plus-size",label:"Plus-size seat",short:"Plus-size",icon:"\u{1F4BA}"},{key:"lift-armrest",label:"Lift-up armrest",short:"Lift armrest",icon:"\u2195\uFE0F"}],pM=new Map(ei.map(e=>[e.key,e]));var Pd={wheelchair:"#3b82f6",companion:"#8b5cf6","semi-ambulatory":"#0ea5e9","designated-aisle":"#0284c7","step-free":"#16a34a",hearing:"#14b8a6",cart:"#7c3aed","sign-language":"#f59e0b","low-vision":"#d97706","sensory-friendly":"#6366f1","plus-size":"#ec4899","lift-armrest":"#22c55e"};function _o(e){let t=e?.[0];return t&&Pd[t]||"#3b82f6"}var Ad=[{key:"obstructedView",label:"Obstructed view",short:"Obstructed",icon:"\u26D4"},{key:"restrictedView",label:"Restricted view",short:"Restricted",icon:"\u{1F441}"},{key:"premium",label:"Premium seat",short:"Premium",icon:"\u2605"}],bM=new Map(Ad.map(e=>[e.key,e]));var Id=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],yM=new Set(Id);var bs=[{key:"circle",label:"Standard seat",shortLabel:"Standard",useCase:"General assigned seating",group:"general",path:null,bounds:null,mark:null},{key:"theatre",label:"Theatre chair",shortLabel:"Theatre",useCase:"Auditoriums, arenas and stadium stands",group:"fixed",path:"M4.5 3.5 Q4.5 1.5 6.5 1.5 L17.5 1.5 Q19.5 1.5 19.5 3.5 L19.5 13 L4.5 13 Z M3.5 12 L20.5 12 Q22.5 12 22.5 14 L22.5 21 Q22.5 22.5 21 22.5 Q19.5 22.5 19.5 21 L19.5 17.5 L4.5 17.5 L4.5 21 Q4.5 22.5 3 22.5 Q1.5 22.5 1.5 21 L1.5 14 Q1.5 12 3.5 12 Z",bounds:{x:1.5,y:1.5,width:21,height:21},mark:{x:12,y:10,radius:6}},{key:"dining",label:"Dining chair",shortLabel:"Dining",useCase:"Banquets, restaurants and table seating",group:"flexible",path:"M7 1 Q6 1 6 2.5 L6.75 10.5 L5 10.5 Q4 10.5 4 12 L4 14 Q4 15 5.25 15 L6 15 L4 23 L7 23 L9.5 15 L14.5 15 L17 23 L20 23 L18 15 L18.75 15 Q20 15 20 14 L20 12 Q20 10.5 19 10.5 L17.25 10.5 L18 2.5 Q18 1 17 1 Z",bounds:{x:4,y:1,width:16,height:22},mark:{x:12,y:10,radius:4.5}},{key:"folding",label:"Folding chair",shortLabel:"Folding",useCase:"Concert floors, ceremonies and conferences",group:"flexible",path:"M6 2 Q5 2 5 3 L6 8 L18 8 L19 3 Q19 2 18 2 Z M5 9 L19 9 Q20 9 20 10.5 L19 13 L5 13 L4 10.5 Q4 9 5 9 Z M6 12 L9 12 L12 17 L15 12 L18 12 L14 19 L17 23 L14 23 L12 21 L10 23 L7 23 L10 19 Z",bounds:{x:4,y:2,width:16,height:21},mark:{x:12,y:5,radius:3}},{key:"armchair",label:"Premium armchair",shortLabel:"Armchair",useCase:"Boxes, lounges and club seating",group:"premium",path:"M3.5 4 Q3.5 1.5 6 1.5 L18 1.5 Q20.5 1.5 20.5 4 L20.5 13 L3.5 13 Z M1.5 12.5 Q1.5 10 3.25 10 Q5 10 5 12.5 L5 13.5 L19 13.5 L19 12.5 Q19 10 20.75 10 Q22.5 10 22.5 12.5 L22.5 19.5 Q22.5 22 20 22 L4 22 Q1.5 22 1.5 19.5 Z",bounds:{x:1.5,y:1.5,width:21,height:20.5},mark:{x:12,y:7.5,radius:5.5}},{key:"recliner",label:"Recliner",shortLabel:"Recliner",useCase:"Luxury cinemas and premium clubs",group:"premium",path:"M7 2 Q7 1 8.5 1 L15.5 1 Q17 1 17 2 L19 13 L5 13 Z M4 9 Q2 9 2 11.5 L2 16 Q2 18 4 18 L6 18 L6 15 L18 15 L18 18 L20 18 Q22 18 22 16 L22 11.5 Q22 9 20 9 Q18 9 18 11 L18 13 L6 13 L6 11 Q6 9 4 9 Z M7 17 L17 17 Q18 17 18.5 18.5 L19.5 22.5 L4.5 22.5 L5.5 18.5 Q6 17 7 17 Z",bounds:{x:2,y:1,width:20,height:21.5},mark:{x:12,y:8,radius:5}},{key:"stool",label:"Stool",shortLabel:"Stool",useCase:"Bars, high-tops and seating rails",group:"flexible",path:"M6 2.5 L18 2.5 Q22 2.5 22 6.5 L22 12 Q22 16 18 16 L6 16 Q2 16 2 12 L2 6.5 Q2 2.5 6 2.5 Z M6 15.5 L9.5 15.5 L7.5 22.5 L3 22.5 Z M14.5 15.5 L18 15.5 L20.5 22.5 L16 22.5 Z",bounds:{x:2,y:2.5,width:20,height:20},mark:{x:12,y:9.25,radius:6.5}},{key:"bench",label:"Bench place",shortLabel:"Bench",useCase:"Pews, bleachers and terraces",group:"fixed",path:"M2.5 0.5 L21.5 0.5 Q23 0.5 23 2 L23 5 Q23 6.5 21.5 6.5 L2.5 6.5 Q1 6.5 1 5 L1 2 Q1 0.5 2.5 0.5 Z M2 7.5 L22 7.5 Q23.5 7.5 23.5 9 L23.5 15.5 Q23.5 17 22 17 L18 17 L18 21.5 Q18 22.5 16.75 22.5 Q15.5 22.5 15.5 21.5 L15.5 17 L8.5 17 L8.5 21.5 Q8.5 22.5 7.25 22.5 Q6 22.5 6 21.5 L6 17 L2 17 Q0.5 17 0.5 15.5 L0.5 9 Q0.5 7.5 2 7.5 Z",bounds:{x:.5,y:.5,width:23,height:22},mark:{x:12,y:12.25,radius:4.75}}],ys=bs.map(e=>e.key),Ed=new Map(bs.map(e=>[e.key,e]));function ps(e){return typeof e=="string"&&Ed.has(e)}function gs(e,t){return ps(e)?e:ps(t?.seatGlyph)?t.seatGlyph:"circle"}var fe=.02291666666666667,et=1/fe,Rd=58,Cd=Rd*fe;var _d=3,xs=0,ti=120,Td=0,Ld=45,kd=7,ht=1.2;function ni(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function Od(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=kd?e:_d}function Ct(e,t={}){let n=ni(t.floorBaseHeightM,xs,ti,0),o=Math.min(ti,n+Od(e.elevation)*Cd),r=e.height===void 0?o:ni(e.height,xs,ti,o),i=ni(e.rake,Td,Ld,0);return{height:r,rake:i}}var vs=dt(require("earcut"),1),ii=dt(require("polygon-clipping"),1);var wM=Math.PI/180;function Ge(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function oi(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function ri(e){let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;let o=e.length||1;return{x:t/o,y:n/o}}function cn(e){return e.length?ri(e):null}function $e(e){let t=0;for(let n=0,o=e.length;n<o;n+=1){let r=e[n],i=e[(n+1)%o];t+=r.x*i.y-i.x*r.y}return t/2}function Ze(e,t,n){let o=!1;for(let r=0,i=e.length-1;r<e.length;i=r++){let a=e[r],s=e[i];a.y>n!=s.y>n&&t<(s.x-a.x)*(n-a.y)/(s.y-a.y)+a.x&&(o=!o)}return o}var C=fe,Fd=.002;function Dd(e,t,n){let o=Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2]),r=Math.hypot(n[0]-t[0],n[1]-t[1],n[2]-t[2]),i=Math.hypot(e[0]-n[0],e[1]-n[1],e[2]-n[2]),a=Math.max(o,r,i);if(a<1e-9)return!0;let s=(o+r+i)/2;return 2*Math.sqrt(Math.max(0,s*(s-o)*(s-r)*(s-i)))/a<Fd}var Xt=class{constructor(t=16384){this.len=0;this.buf=new Float32Array(t)}push3(t,n,o){this.len+3>this.buf.length&&this.grow(this.len+3),this.buf[this.len++]=t,this.buf[this.len++]=n,this.buf[this.len++]=o}push1(t){this.len+1>this.buf.length&&this.grow(this.len+1),this.buf[this.len++]=t}grow(t){let n=this.buf.length*2;for(;n<t;)n*=2;let o=new Float32Array(n);o.set(this.buf.subarray(0,this.len)),this.buf=o}get length(){return this.len}toArray(){return this.buf.slice(0,this.len)}},ko=class{constructor(){this.pos=new Xt;this.nor=new Xt;this.col=new Xt;this.flr=new Xt;this.mat=new Xt;this.currentFloor=0;this.currentMaterial=0}setFloor(t){this.currentFloor=t}setMaterial(t){this.currentMaterial=t}tri(t,n,o,r,i,a=i,s=i){Dd(t,n,o)||(this.pos.push3(t[0],t[1],t[2]),this.pos.push3(n[0],n[1],n[2]),this.pos.push3(o[0],o[1],o[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(r[0],r[1],r[2]),this.col.push3(i[0],i[1],i[2]),this.col.push3(a[0],a[1],a[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(t,n,o,r,i,a,s,c=s,l=s){[...t,...n,...o].every(Number.isFinite)&&(this.pos.push3(t[0],t[1],t[2]),this.pos.push3(n[0],n[1],n[2]),this.pos.push3(o[0],o[1],o[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(i[0],i[1],i[2]),this.nor.push3(a[0],a[1],a[2]),this.col.push3(s[0],s[1],s[2]),this.col.push3(c[0],c[1],c[2]),this.col.push3(l[0],l[1],l[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 Nd(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=n[0]-e[0],s=n[1]-e[1],c=n[2]-e[2],l=r*c-i*s,u=i*a-o*c,m=o*s-r*a,f=Math.hypot(l,u,m)||1;return l/=f,u/=f,m/=f,[l,u,m]}function Bd(e,t){let n=[...e],o=[];for(let a of e)o.push(a.x,a.y);let r=[];if(t){for(let a of t)if(!(a.length<3)){r.push(n.length);for(let s of a)n.push(s),o.push(s.x,s.y)}}let i=(0,vs.default)(o,r.length?r:void 0,2);return{pts:n,tris:i}}function pt(e){return $e(e)<0?[...e].reverse():e}var Vd=3;function Gd(e,t,n,o){let r=o(e),i=o(t),a=o(n),s=(d,h,p,b)=>Math.abs(o({x:(d.x+h.x)/2,y:(d.y+h.y)/2})-(p+b)/2),c=(e.x+t.x+n.x)/3,l=(e.y+t.y+n.y)/3,u=(r+i+a)/3,m=Math.max(s(e,t,r,i),s(t,n,i,a),s(n,e,a,r),Math.abs(o({x:c,y:l})-u)),f=(d,h,p)=>{let b=Math.abs(o({x:(d+c)/2,y:(h+l)/2})-(p+u)/2);b>m&&(m=b)};return f((e.x+t.x)/2,(e.y+t.y)/2,(r+i)/2),f((t.x+n.x)/2,(t.y+n.y)/2,(i+a)/2),f((n.x+e.x)/2,(n.y+e.y)/2,(a+r)/2),m}function Xn(e,t,n,o,r){if(r<=0)return Gd(e,t,n,o);let i={x:(e.x+t.x)/2,y:(e.y+t.y)/2},a={x:(t.x+n.x)/2,y:(t.y+n.y)/2},s={x:(n.x+e.x)/2,y:(n.y+e.y)/2};return Math.max(Xn(e,i,s,o,r-1),Xn(i,t,a,o,r-1),Xn(s,a,n,o,r-1),Xn(i,a,s,o,r-1))}function Yn(e,t,n,o,r,i,a,s){if(a>0){let f={x:(t.x+n.x)/2,y:(t.y+n.y)/2},d={x:(n.x+o.x)/2,y:(n.y+o.y)/2},h={x:(o.x+t.x)/2,y:(o.y+t.y)/2};Yn(e,t,f,h,r,i,a-1,s),Yn(e,f,n,d,r,i,a-1,s),Yn(e,h,d,o,r,i,a-1,s),Yn(e,f,d,h,r,i,a-1,s);return}let c=[t.x*C,r(t),t.y*C],l=[n.x*C,r(n),n.y*C],u=[o.x*C,r(o),o.y*C];if(s){e.triN(c,l,u,s(t),s(n),s(o),i);return}let m=Nd(c,l,u);m[1]<0&&(m=[-m[0],-m[1],-m[2]]),e.tri(c,l,u,m,i)}var Hd=8;function Ms(e,t,n){if(!Number.isFinite(n))return e;let o=[],r=(i,a,s,c,l)=>{if(l>0){let u={x:(i.x+a.x)/2,y:(i.y+a.y)/2},m=t(u);if(Math.abs(m-(s+c)/2)>n){r(i,u,s,m,l-1),r(u,a,m,c,l-1);return}}o.push(i)};for(let i=0;i<e.length;i++){let a=e[i],s=e[(i+1)%e.length];r(a,s,t(a),t(s),Hd)}return o}function To(e,t){if(e.length<3)return e;let n=[];for(let r of e){let i=n[n.length-1];i&&Math.hypot(r.x-i.x,r.y-i.y)<t||n.push(r)}for(;n.length>2&&Math.hypot(n[0].x-n[n.length-1].x,n[0].y-n[n.length-1].y)<t;)n.pop();if(n.length<3)return e;let o=[];for(let r=0;r<n.length;r++){let i=o.length?o[o.length-1]:n[(r-1+n.length)%n.length],a=n[r],s=n[(r+1)%n.length],c=s.x-i.x,l=s.y-i.y,u=Math.hypot(c,l);u>t&&Math.abs((a.x-i.x)*l-(a.y-i.y)*c)/u<t||o.push(a)}return o.length>=3?o:n}var Lo=.001*et*.1;function ue(e,t,n,o,r,i,a,s,c=1/0,l){if(!t||t.length<3||(c===void 0&&(c=1/0),Math.abs($e(t))<1e-4))return;let u=To(Ms(To(pt(t),Lo),o,c),Lo),m=n?.map(g=>To(Ms(To(pt(g),Lo),o,c),Lo)).filter(g=>g.length>=3&&Math.abs($e(g))>=1e-4),{pts:f,tris:d}=Bd(u,m),h=[i[0]*s.top,i[1]*s.top,i[2]*s.top],p=[i[0]*s.bottomCap,i[1]*s.bottomCap,i[2]*s.bottomCap],b=[a[0]*s.top,a[1]*s.top,a[2]*s.top],y=[a[0]*s.wallBottom,a[1]*s.wallBottom,a[2]*s.wallBottom],M=0;if(Number.isFinite(c))for(;M<Vd;M++){let g=0;for(let P=0;P<d.length;P+=3){let S=Xn(f[d[P]],f[d[P+1]],f[d[P+2]],o,M);S>g&&(g=S)}if(g<=c)break}for(let g=0;g<d.length;g+=3){let P=f[d[g]],S=f[d[g+1]],w=f[d[g+2]];Yn(e,P,S,w,o,h,M,l);let E=[P.x*C,r,P.y*C],T=[S.x*C,r,S.y*C],F=[w.x*C,r,w.y*C];e.tri(E,F,T,[0,-1,0],p)}let v=g=>{if(M<=0)return g;let P=1<<M,S=[];for(let w=0;w<g.length;w++){let E=g[w],T=g[(w+1)%g.length];for(let F=0;F<P;F++){let R=F/P;S.push({x:E.x+(T.x-E.x)*R,y:E.y+(T.y-E.y)*R})}}return S},A=ri(u),x=[{ring:v(u),flip:!1}];if(m)for(let g of m)g.length>=3&&x.push({ring:v(g),flip:!0});for(let{ring:g,flip:P}of x)for(let S=0;S<g.length;S++){let w=g[S],E=g[(S+1)%g.length],T=(E.x-w.x)*C,R=(E.y-w.y)*C,I=-T,_=Math.hypot(R,I)||1;R/=_,I/=_;let k=(w.x+E.x)/2-A.x,V=(w.y+E.y)/2-A.y,O=R*k+I*V;P&&(O=-O),O<0&&(R=-R,I=-I);let H=[R,0,I],U=[w.x*C,o(w),w.y*C],N=[E.x*C,o(E),E.y*C],L=[w.x*C,r,w.y*C],B=[E.x*C,r,E.y*C];e.tri(U,N,B,H,b,b,y),e.tri(U,B,L,H,b,y,y)}}function Ss(e){let t=0;for(let c of e)t+=c.count;let n=new Float32Array(t*3),o=new Float32Array(t*3),r=new Float32Array(t*3),i=new Float32Array(t),a=new Float32Array(t),s=0;for(let c of e)n.set(c.position,s*3),o.set(c.normal,s*3),r.set(c.color,s*3),i.set(c.floor,s),a.set(c.material,s),s+=c.count;return{position:n,normal:o,color:r,floor:i,material:a,count:t}}function st(e,t,n=2.5){if(t<=0||e.length<3)return e;let o=pt(e),r=o.length,i=[];for(let s=0;s<r;s++){let c=o[s],l=o[(s+1)%r],u=l.x-c.x,m=l.y-c.y,f=Math.hypot(u,m)||1;i.push({x:m/f,y:-u/f})}let a=[];for(let s=0;s<r;s++){let c=o[s],l=i[(s-1+r)%r],u=i[s],m=l.x+u.x,f=l.y+u.y,d=Math.hypot(m,f),h=()=>{a.push([c.x+l.x*t,c.y+l.y*t]),a.push([c.x+u.x*t,c.y+u.y*t])};if(d<1e-9){h();continue}m/=d,f/=d;let p=m*l.x+f*l.y,b=1/Math.max(p,1e-6);if(!Number.isFinite(b)||b>n){h();continue}a.push([c.x+m*t*b,c.y+f*t*b])}if(a.length<3)return e;try{let s=ii.default.union([[...a,a[0]]]),c=null,l=-1/0;for(let m of s){let f=Math.abs($e(m[0].map(([d,h])=>({x:d,y:h}))));f>l&&(l=f,c=m[0])}if(!c)return e;let u=c.map(([m,f])=>({x:m,y:f}));if(u.length>1){let m=u[0],f=u[u.length-1];Math.abs(m.x-f.x)<1e-9&&Math.abs(m.y-f.y)<1e-9&&u.pop()}return u.length>=3?u:e}catch{return e}}function _t(e,t,n=2.5){if(e.length<3)return[];if(t<=0)return e;let o=pt(e),r=o.length,i=[];for(let c=0;c<r;c++){let l=o[c],u=o[(c+1)%r],m=Math.hypot(u.x-l.x,u.y-l.y)||1;i.push({x:-(u.y-l.y)/m,y:(u.x-l.x)/m})}let a=[],s=[];for(let c=0;c<r;c++){let l=o[c],u=i[(c-1+r)%r],m=i[c],f=u.x+m.x,d=u.y+m.y,h=Math.hypot(f,d),p=h<1e-9?1/0:1/Math.max(f/h*u.x+d/h*u.y,1e-6);if(!Number.isFinite(p)||p>n){a.push({x:l.x+u.x*t,y:l.y+u.y*t},{x:l.x+m.x*t,y:l.y+m.y*t}),s.push(c,c);continue}f/=h,d/=h,a.push({x:l.x+f*t*p,y:l.y+d*t*p}),s.push(c)}for(let c=0;c<a.length;c++){let l=(c+1)%a.length,u=s[c],m=s[l];if(m!==(u+1)%r)continue;let f=o[u],d=o[m];if((a[l].x-a[c].x)*(d.x-f.x)+(a[l].y-a[c].y)*(d.y-f.y)<=0)return[]}try{let c=ii.default.intersection([[...a.map(h=>[h.x,h.y]),[a[0].x,a[0].y]]],[[...o.map(h=>[h.x,h.y]),[o[0].x,o[0].y]]]),l=null,u=0;for(let h of c){let p=Math.abs($e(h[0].map(([b,y])=>({x:b,y}))));p>u&&(u=p,l=h[0])}if(!l)return[];let m=l.map(([h,p])=>({x:h,y:p})),f=m[0],d=m[m.length-1];return m.length>1&&Math.abs(f.x-d.x)<1e-9&&Math.abs(f.y-d.y)<1e-9&&m.pop(),m.length>=3?pt(m):[]}catch{return[]}}function Oo(e,t,n,o,r=28){let i=[];for(let a=0;a<r;a++){let s=a/r*Math.PI*2;i.push({x:e+n*Math.cos(s),y:t+o*Math.sin(s)})}return i}function Kn(e,t,n,o){return[{x:e,y:t},{x:e+n,y:t},{x:e+n,y:t+o},{x:e,y:t+o}]}var St=.22;function ws(e,t){let n=Be[e];if(n!=="sold"&&n!=="held")return-1;let o=(t+1)*2654435761;return o^=o>>>15,o=Math.imul(o,2246822519),o^=o>>>13,(o>>>0)%1e5/1e5}var zd=.42;function jd(e){let t=e.length,n=new Float64Array(t);if(t<2)return n.fill(1/0),n;let o=1/0,r=1/0,i=-1/0,a=-1/0;for(let h of e)h.x<o&&(o=h.x),h.y<r&&(r=h.y),h.x>i&&(i=h.x),h.y>a&&(a=h.y);let s=Math.max(i-o,1e-6),c=Math.max(a-r,1e-6),l=Math.max(Math.sqrt(s*c/t),1e-6),u=Math.max(1,Math.ceil(s/l)+1),m=Math.max(1,Math.ceil(c/l)+1),f=new Map,d=(h,p)=>{let b=Math.min(u-1,Math.max(0,Math.floor((h-o)/l)));return Math.min(m-1,Math.max(0,Math.floor((p-r)/l)))*u+b};for(let h=0;h<t;h++){let p=d(e[h].x,e[h].y),b=f.get(p);b?b.push(h):f.set(p,[h])}for(let h=0;h<t;h++){let p=e[h],b=Math.min(u-1,Math.max(0,Math.floor((p.x-o)/l))),y=Math.min(m-1,Math.max(0,Math.floor((p.y-r)/l))),M=1/0;for(let v=1;v<=4;v++){for(let A=y-v;A<=y+v;A++)if(!(A<0||A>=m))for(let x=b-v;x<=b+v;x++){if(x<0||x>=u||v>1&&Math.abs(A-y)<v&&Math.abs(x-b)<v)continue;let g=f.get(A*u+x);if(g)for(let P of g){if(P===h)continue;let S=Math.hypot(e[P].x-p.x,e[P].y-p.y);S<M&&(M=S)}}if(Number.isFinite(M)&&M<=v*l)break}n[h]=M}return n}function Ud(e){let t=e.eyeHeightM;return Number.isFinite(t)?Math.max(0,t-ht):0}function Ps(e,t,n,o,r,i){let a=e.length,s=new Float32Array(a*3),c=new Float32Array(a),l=new Float32Array(a*3),u=new Float32Array(a),m=new Float32Array(a),f=new Float32Array(a),d=new Float32Array(a),h=new Float32Array(a*3),p=new Map,b=jd(e);for(let y=0;y<a;y++){let M=e[y],A=(n?.seatPitchU(y)??b[y])*C;u[y]=Number.isFinite(A)?Math.max(.06,Math.min(St,A*zd)):St,m[y]=za(Number.isFinite(A)?A:void 0);let x=gs(M.glyph,{seatGlyph:i?.get(M.categoryKey)});f[y]=ys.indexOf(x),d[y]=M.wheelchairSpaceType==="no-seat"?0:1,s[y*3]=M.x*C,s[y*3+1]=n?n.seatDeckY(y):Ud(M),s[y*3+2]=M.y*C,c[y]=jn(t?t(M):"available");let g=be(r?.get(M.categoryKey)??"#6e7bff")??[.43,.48,1];if(l[y*3]=g[0],l[y*3+1]=g[1],l[y*3+2]=g[2],M.accessibility?.length){let P=be(_o(M.accessibility));P&&(h[y*3]=P[0],h[y*3+1]=P[1],h[y*3+2]=P[2])}p.set(M.id,y)}return{count:a,iPosition:s,iState:c,iCategory:l,iMaxRadius:u,iRing:h,idToIndex:p,iChairWidth:m,iGlyph:f,iPhysicalSeat:d,iFloor:o??new Float32Array(a),iSection:new Float32Array(a).fill(-1),iYaw:new Float32Array(a)}}var Wd=64;function ai(e,t){let n=[];for(let a of t){let s=e.idToIndex.get(a.seatId);if(s===void 0)continue;let c=jn(a.state);e.iState[s]!==c&&(e.iState[s]=c,n.push(s))}if(!n.length)return[];n.sort((a,s)=>a-s);let o=[],r=n[0],i=n[0];for(let a=1;a<n.length;a++){let s=n[a];if(s!==i){if(s<=i+Wd){i=s;continue}o.push({start:r,length:i-r+1}),r=s,i=s}}return o.push({start:r,length:i-r+1}),o}var $n=3,Yt=.38,Zn=.24;function Xd(e){if(e.length<3)return null;let t=e[0],n=e[Math.floor(e.length/2)],o=e[e.length-1],r=(n.x-t.x)*C,i=(n.y-t.y)*C,a=(o.x-t.x)*C,s=(o.y-t.y)*C,c=2*(r*s-i*a);if(Math.abs(c)<1e-7)return null;let l=r*r+i*i,u=a*a+s*s,m=(l*s-u*i)/c+t.x*C,f=(r*u-a*l)/c+t.y*C,d=Math.hypot(t.x*C-m,t.y*C-f);return d<1||d>200||!Number.isFinite(d)||e.some(h=>Math.abs(Math.hypot(h.x*C-m,h.y*C-f)-d)>.03)?null:{x:m,z:f,radius:d}}function As(e){let t=[],n=new Map,o=(c,l)=>`${Math.floor(c/$n)},${Math.floor(l/$n)}`;for(let c of e)for(let l of c.rows){for(let m of l.pts){let f=m.x*C,d=m.y*C,h=o(f,d),p=n.get(h)??[];p.push({x:f,z:d,y:l.y,floor:c.floorIndex}),n.set(h,p)}if(l.patch||l.pts.length<2)continue;let u=Xd(l.pts);for(let m of[0,l.pts.length-1]){let f=l.pts[m],d=l.pts[m===0?1:m-1],h=f.x-d.x,p=f.y-d.y,b=Math.hypot(h,p);b<1e-6||t.push({sectionId:c.sectionId,floorIndex:c.floorIndex,curve:u,row:l,point:f,x:f.x*C,z:f.y*C,dx:h/b,dz:p/b})}}let r=new Map;t.forEach((c,l)=>{let u=o(c.x,c.z),m=r.get(u)??[];m.push(l),r.set(u,m)});let i=(c,l)=>{let u=Math.floor(c/$n),m=Math.floor(l/$n);return[-1,0,1].flatMap(f=>[-1,0,1].map(d=>`${u+f},${m+d}`))},a=new Map;t.forEach((c,l)=>{let u=-1,m=1/0,f=!1;for(let d of i(c.x,c.z))for(let h of r.get(d)??[]){let p=t[h];if(c.sectionId===p.sectionId&&c.row.blockId===p.row.blockId||c.floorIndex!==p.floorIndex||Math.abs(c.row.y-p.row.y)>.05)continue;let b=p.x-c.x,y=p.z-c.z,M=Math.hypot(b,y);if(M<Yt*2+.45||M>$n)continue;let v=c.curve&&p.curve&&Math.hypot(c.curve.x-p.curve.x,c.curve.z-p.curve.z)<=.05&&Math.abs(c.curve.radius-p.curve.radius)<=.05,A=Math.min((b*c.dx+y*c.dz)/M,(-b*p.dx-y*p.dz)/M);(v?A<.8:A<.98)||!v&&(Math.abs(b*c.dz-y*c.dx)>.15||Math.abs(b*p.dz-y*p.dx)>.15)||(M<m-.02?(u=h,m=M,f=!1):Math.abs(M-m)<=.02&&(f=!0))}u>=0&&!f&&a.set(l,u)});let s=[];for(let[c,l]of a){if(c>=l||a.get(l)!==c)continue;let u=t[c],m=t[l],f=Math.hypot(m.x-u.x,m.z-u.z),d=(m.x-u.x)/f,h=(m.z-u.z)/f,p=!1;for(let y of i((u.x+m.x)/2,(u.z+m.z)/2))for(let M of n.get(y)??[]){if(M.floor!==u.floorIndex||Math.abs(M.y-u.row.y)>.75)continue;let v=(M.x-u.x)*d+(M.z-u.z)*h,A=Math.abs((M.x-u.x)*h-(M.z-u.z)*d);v>.01&&v<f-.01&&A<Zn+Yt&&(p=!0)}if(p)continue;let b=(y,M)=>({x:(u.x+d*y-h*M)/C,y:(u.z+h*y+d*M)/C});s.push({sections:[u.sectionId,m.sectionId],blocks:[u.row.blockId,m.row.blockId],floorIndex:u.floorIndex,ends:[u.point,m.point],clearWidthM:f-2*Yt,heightM:(u.row.y+m.row.y)/2,outline:[b(Yt,-Zn),b(f-Yt,-Zn),b(f-Yt,Zn),b(Yt,Zn)]})}return s}var Yd=.15,Kd=1.6;function Is(e){return qr(e??1,Yd,Kd)}var $d=.15,Zd=.9,qd=1.76;function Es(e){return!!e&&e[0]*.2126+e[1]*.7152+e[2]*.0722>.55?{zenith:[.36,.58,.84],horizon:[.82,.88,.94]}:{zenith:[.05,.08,.15],horizon:[.3,.38,.5]}}function Qd(){return{background:{top:[...Wt.top],bottom:[...Wt.bottom]},sky:Es(null),structure:Yr,seatStates:{...Qa},seatScale:1,materials:{seat:null,shell:null,roughness:.78}}}function Jd(e){return!!e&&e[0]*.2126+e[1]*.7152+e[2]*.0722>.55?{deck:"#c9ccc8",fascia:"#b4bab8",shell:"#c3c9c8",roughness:.87}:{deck:"#69747b",fascia:"#3e4d58",shell:"#526572",roughness:.87}}function Rs(e){let t=Qd();e??={};let n=be(e.background);if(n){t.background={top:ce(n,Zd),bottom:ce(n,qd)},t.sky=Es(n);let s={};for(let[l,u]of Object.entries(Yr))s[l]=ge(u,n,$d);n[0]*.2126+n[1]*.7152+n[2]*.0722>.55&&(s.ground=ce(n,.86)),t.structure=s}let o=be(e.selectionColor)??be(e.accent);o&&(t.seatStates={...t.seatStates,selected:o});let r=e.seatScale;typeof r=="number"&&Number.isFinite(r)&&(t.seatScale=Is(r));let i=Object.fromEntries(Object.entries(e.venue3d??{}).filter(([,s])=>s!=null)),a={...Jd(n),...i};if(a){let s=be(a.deck),c=be(a.fascia);s&&(t.structure={...t.structure,tierTop:s,gaTop:s}),c&&(t.structure={...t.structure,tierWall:c,gaWall:c}),t.materials.seat=be(a.seat),t.materials.shell=be(a.shell),typeof a.roughness=="number"&&Number.isFinite(a.roughness)&&(t.materials.roughness=Math.min(1,Math.max(0,a.roughness)))}return t}function Cs(e,t){let n=[];for(let o of t)n.push(...e.seatStates[o]);return n}var eh=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]),th=new Set(["pitch-football","track-athletics","oval-cricket","pitch-rugby","diamond-baseball"]);function Kt(e){return!!e&&eh.has(e)}function Fo(e){return!!e&&th.has(e)}var si=1.1;function Ls(e){return No(e)?e==="ring-boxing"?si:.06:1}var nh={round:{width:6,height:6},"pitch-football":{width:105,height:68},"rink-hockey":{width:60,height:30},"track-athletics":{width:176.9,height:92.5},"oval-cricket":{width:150,height:140},"pitch-rugby":{width:120,height:70},"diamond-baseball":{width:140,height:140},"court-basketball":{width:32,height:19},"court-tennis":{width:36.57,height:18.29},"ring-boxing":{width:7.8,height:7.8}},oh={"pitch-football":"#2f7d4f","rink-hockey":"#e8f1f8","track-athletics":"#a4472f","oval-cricket":"#3d8a53","pitch-rugby":"#2f7d4f","diamond-baseball":"#2f7d4f","court-basketball":"#c8894f","court-tennis":"#3f7a5a","ring-boxing":"#2a4d8f"};var rh=Math.PI*2;function ih(e,t,n,o,r,i){return{x:r+e*n-t*o,y:i+e*o+t*n}}function _s(e,t){let n=Math.max(0,e-t),o=[],r=20;for(let i=0;i<=r;i++){let a=-Math.PI/2+i/r*Math.PI;o.push({x:n+t*Math.cos(a),y:t*Math.sin(a)})}for(let i=0;i<=r;i++){let a=Math.PI/2+i/r*Math.PI;o.push({x:-n+t*Math.cos(a),y:t*Math.sin(a)})}return o}var Ts=(()=>{let t={x:0,y:52},n=25,o={x:70,y:t.y-70},r=(o.x*o.x+o.y*o.y-4900)/(2*(o.y+70)),i=r+70,a=[],s=Math.atan2(o.y-r,o.x),c=Math.atan2(o.y-r,-o.x);for(let l=0;l<=24;l++){let u=s+(c-s)*l/24;a.push({x:i*Math.cos(u),y:r+i*Math.sin(u)})}return{half:70,home:t,backstop:n,fence:a}})();var Do="#f1f5f9";function No(e){return Kt(e)}function Tt(e,t,n,o,r=32){let i=[];for(let a=0;a<r;a++){let s=a/r*rh;i.push({x:e+n*Math.cos(s),y:t+o*Math.sin(s)})}return i}function wt(e,t,n,o){return[{x:e-n,y:t-o},{x:e+n,y:t-o},{x:e+n,y:t+o},{x:e-n,y:t+o}]}function ah(e){let{kind:t,cx:n,cy:o,width:r,height:i}=e,a=(e.rotation??0)*Math.PI/180,s=Math.cos(a),c=Math.sin(a),l=r/2,u=i/2,m=[],f=nh[t],d=p=>f?p/f.width*r:0,h=p=>f?p/f.height*i:0;switch(t){case"pitch-football":{m.push({points:[{x:0,y:-u},{x:0,y:u}],closed:!1}),m.push({points:Tt(0,0,d(9.15),h(9.15)),closed:!0});for(let p of[-1,1])m.push({points:wt(p*(l-d(16.5)/2),0,d(16.5)/2,h(40.32)/2),closed:!0}),m.push({points:wt(p*(l-d(5.5)/2),0,d(5.5)/2,h(18.32)/2),closed:!0});break}case"rink-hockey":{m.push({points:[{x:0,y:-u},{x:0,y:u}],closed:!1,ink:"#d63b3b"});for(let p of[-1,1]){m.push({points:[{x:p*d(7.5),y:-u},{x:p*d(7.5),y:u}],closed:!1,ink:"#2f6ecb"}),m.push({points:[{x:p*(l-d(4)),y:-h(11)},{x:p*(l-d(4)),y:h(11)}],closed:!1,ink:"#d63b3b"});for(let b of[-1,1])m.push({points:Tt(p*d(20.5),b*h(7),d(4.5),h(4.5)),closed:!0,ink:"#2f6ecb"})}m.push({points:Tt(0,0,d(4.5),h(4.5)),closed:!0,ink:"#2f6ecb"});break}case"track-athletics":{let b=u-h(1.22)*8;b>0&&m.push({points:_s(l-d(1.22)*8,b),closed:!0,fill:"#2f7d4f"});for(let y=1;y<8;y++){let M=h(1.22)*y,v=u-M;if(v<=0)break;m.push({points:_s(l-d(1.22)*y,v),closed:!0})}break}case"oval-cricket":{m.push({points:Tt(0,0,d(27.4),h(27.4+20.12/2),40),closed:!0}),m.push({points:wt(0,0,d(3.05)/2,h(20.12)/2),closed:!0,ink:"#d8cfae"});break}case"pitch-rugby":{let p=b=>({points:[{x:d(b),y:-u},{x:d(b),y:u}],closed:!1});m.push(p(0));for(let b of[-1,1]){m.push(p(b*50),p(b*28));for(let y=-35;y<35;y+=4)m.push({points:[{x:d(b*10),y:h(y)},{x:d(b*10),y:h(Math.min(35,y+2))}],closed:!1})}break}case"diamond-baseball":{let p=(k,V)=>({x:d(k),y:h(V)}),{home:b}=Ts,y=27.43,M=y/Math.SQRT2,v={x:b.x+M,y:b.y-M},A={x:b.x,y:b.y-2*M},x={x:b.x-M,y:b.y-M},g={x:b.x,y:b.y-18.44},P="#b98a59",S=oh["diamond-baseball"],w=38.94,E=[p(b.x,b.y)],T=Math.atan2(b.y-w/Math.SQRT2-g.y,w/Math.SQRT2),F=Math.PI-T;for(let k=0;k<=16;k++){let V=T-(T+Math.PI*2-F)%(Math.PI*2)*(k/16);E.push(p(g.x+29*Math.cos(V),g.y+29*Math.sin(V)))}m.push({points:E,closed:!0,fill:P,ink:P});let R={x:b.x,y:b.y-M},I=[{x:b.x,y:b.y},v,A,x].map(k=>p(R.x+(k.x-R.x)*.84,R.y+(k.y-R.y)*.84));m.push({points:I,closed:!0,fill:S,ink:S}),m.push({points:Tt(d(g.x),h(g.y),d(2.74),h(2.74),20),closed:!0,fill:P,ink:P}),m.push({points:Tt(d(b.x),h(b.y),d(3.96),h(3.96),20),closed:!0,fill:P,ink:P});let _=Ts.fence;m.push({points:[p(b.x,b.y),p(_[0].x,_[0].y)],closed:!1}),m.push({points:[p(b.x,b.y),p(_[_.length-1].x,_[_.length-1].y)],closed:!1});for(let k of[v,A,x])m.push({points:wt(d(k.x),h(k.y),d(.3),h(.3)),closed:!0,fill:Do});break}case"court-basketball":{m.push({points:wt(0,0,d(14),h(7.5)),closed:!0}),m.push({points:[{x:0,y:-h(7.5)},{x:0,y:h(7.5)}],closed:!1}),m.push({points:Tt(0,0,d(1.8),h(1.8),24),closed:!0});for(let p of[-1,1]){let b=p*14,y=p*(14-5.8),M=p*(14-1.575);m.push({points:wt(d((b+y)/2),0,d(2.9),h(2.45)),closed:!0,fill:"#2f5d8a"}),m.push({points:Tt(d(y),0,d(1.8),h(1.8),24),closed:!0});let v=Math.sqrt(6.75*6.75-6.6*6.6),A=[{x:d(b),y:-h(6.6)}],x=Math.atan2(-6.6,-p*v),g=2*Math.atan2(6.6,v);for(let P=0;P<=16;P++){let S=x-p*g*(P/16);A.push({x:d(M+6.75*Math.cos(S)),y:h(6.75*Math.sin(S))})}A.push({x:d(b),y:h(6.6)}),m.push({points:A,closed:!1})}break}case"court-tennis":{m.push({points:wt(0,0,d(11.885),h(5.485)),closed:!0,fill:"#2b5f99"});for(let p of[-1,1])m.push({points:[{x:-d(11.885),y:p*h(4.115)},{x:d(11.885),y:p*h(4.115)}],closed:!1}),m.push({points:[{x:p*d(6.4),y:-h(4.115)},{x:p*d(6.4),y:h(4.115)}],closed:!1});m.push({points:[{x:-d(6.4),y:0},{x:d(6.4),y:0}],closed:!1}),m.push({points:[{x:0,y:-h(6.4)},{x:0,y:h(6.4)}],closed:!1,ink:"#d1d5db"});break}case"ring-boxing":{m.push({points:wt(0,0,d(3.05),h(3.05)),closed:!0});let y=[[-1,-1,"#c53030"],[1,1,"#2b6cb0"],[1,-1,"#e2e8f0"],[-1,1,"#e2e8f0"]];for(let[M,v,A]of y)m.push({points:wt(M*d(3.05),v*h(3.05),d(.3),h(.3)),closed:!0,fill:A,ink:A});break}default:return[]}return m.map(p=>({...p,points:p.points.map(b=>ih(b.x,b.y,s,c,n,o))}))}function ks(e){if(e.role!=="stage"||!No(e.stageKind))return[];let t=null;if(e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null&&e.width>0&&e.height>0&&[e.x,e.y,e.width,e.height].every(Number.isFinite))t={cx:e.x+e.width/2,cy:e.y+e.height/2,width:e.width,height:e.height};else if(e.points&&e.points.length>=3&&e.points.every(n=>Number.isFinite(n.x)&&Number.isFinite(n.y))){let n=e.points.map(u=>u.x),o=e.points.map(u=>u.y),r=Math.min(...n),i=Math.max(...n),a=Math.min(...o),s=Math.max(...o),c=Math.max(1,i-r),l=Math.max(1,s-a);t={cx:r+c/2,cy:a+l/2,width:c,height:l}}return t?ah({kind:e.stageKind,...t}):[]}function Os(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,a=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+a*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+a*e.end.y}}function Fs(e,t,n=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[Os(e,.5)];let o=Array.from({length:n+1},(c,l)=>Os(e,l/n)),r=new Float64Array(o.length);for(let c=1;c<o.length;c+=1){let l=o[c].x-o[c-1].x,u=o[c].y-o[c-1].y;r[c]=r[c-1]+Math.hypot(l,u)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let a=[],s=1;for(let c=0;c<t;c+=1){let l=i*c/(t-1);for(;s<r.length-1&&r[s]<l;)s+=1;let u=r[s-1],m=r[s],f=m===u?0:(l-u)/(m-u);a.push({x:o[s-1].x+(o[s].x-o[s-1].x)*f,y:o[s-1].y+(o[s].y-o[s-1].y)*f})}return a}var ln=Math.PI*2;function un(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function sh(e,t,n){let o=t-e;if(n){for(;o<0;)o+=ln;for(;o>=ln;)o-=ln}else{for(;o>0;)o-=ln;for(;o<=-ln;)o+=ln}return o}function Bs(e){if(e.version!==1||e.closed!==!0||!un(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let n of e.segments){if(!n||!un(n.end))return!1;if(n.kind==="line"){if(Ge(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!un(n.control1)||!un(n.control2)||Ge(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!un(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(Ge(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(Ge(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Ge(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return Ge(t,e.start)<=1e-4}function ch(e,t,n){let o=1-n;return{x:o**3*e.x+3*o**2*n*t.control1.x+3*o*n**2*t.control2.x+n**3*t.end.x,y:o**3*e.y+3*o**2*n*t.control1.y+3*o*n**2*t.control2.y+n**3*t.end.y}}function Vs(e,t=2){if(!Bs(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),o=[{...e.start}],r=e.start;for(let i of e.segments){if(i.kind==="line")o.push({...i.end});else if(i.kind==="arc"){let a=Math.atan2(r.y-i.center.y,r.x-i.center.x),s=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),c=sh(a,s,i.clockwise),l=Math.max(2,Math.ceil(Math.abs(c)*i.radius/n));for(let u=1;u<=l;u+=1){let m=a+c*u/l;o.push({x:i.center.x+Math.cos(m)*i.radius,y:i.center.y+Math.sin(m)*i.radius})}}else{let a=Ge(r,i.control1)+Ge(i.control1,i.control2)+Ge(i.control2,i.end),s=Math.max(2,Math.ceil(a/n));for(let c=1;c<=s;c+=1)o.push(ch(r,i,c/s))}r=i.end}return Ge(o[o.length-1],o[0])<=1e-4&&o.pop(),o}var lh=45,ci=150,uh=60;function mh(e){let t=lh/100;if(e<=t)return ci;let n=Math.min(1,(e-t)/(1-t));return ci-n*(ci-uh)}var Ds=.5523;function Ns(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function fh(e){let t=[],n=[];for(e.forEach((o,r)=>{un(o)&&(t.length&&Ns(t[t.length-1],o)||(t.push({x:o.x,y:o.y}),n.push(r)))});t.length>1&&Ns(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}var dh=.5,hh=4/3;function ph(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<=1e-9)return{kind:"line",end:{...t}};let a=-r/i,s=o/i,c=n*hh;return{kind:"bezier",control1:{x:e.x+o/3+a*c,y:e.y+r/3+s*c},control2:{x:e.x+o*2/3+a*c,y:e.y+r*2/3+s*c},end:{...t}}}function Gs(e,t){let{points:n,sourceIndex:o}=fh(e),r=n.length;if(r<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,a=t.edgeCurvature,s=new Array(r).fill(0);if(a?.length)for(let A=0;A<r;A+=1){let x=a[o[A]];s[A]=Number.isFinite(x)?Math.min(100,Math.max(-100,x))/100:0}let c=s.some(A=>Math.abs(A)>1e-6);if(i<=0&&!c)return null;let l=t.wideAngleThresholdDeg??mh(i),u=[];for(let A=0;A<r;A+=1)u[A]=Ge(n[A],n[(A+1)%r]);let m=new Array(r).fill(0);for(let A=0;A<r;A+=1){let x=n[(A-1+r)%r],g=n[A],P=n[(A+1)%r],S={x:x.x-g.x,y:x.y-g.y},w={x:P.x-g.x,y:P.y-g.y},E=Math.hypot(S.x,S.y),T=Math.hypot(w.x,w.y);if(E<=1e-9||T<=1e-9)continue;let F=Math.min(1,Math.max(-1,(S.x*w.x+S.y*w.y)/(E*T))),R=Math.acos(F)*180/Math.PI;if(R<l)continue;let I=ss((R-l)/(180-l));m[A]=i*I*.5*Math.min(E,T)}for(let A=0;A<r;A+=1){let x=(A+1)%r,g=m[A]+m[x];if(g>u[A]&&g>1e-9){let P=u[A]/g;m[A]*=P,m[x]*=P}}let f=new Array(r),d=new Array(r);for(let A=0;A<r;A+=1){let x=n[(A-1+r)%r],g=n[A],P=n[(A+1)%r];if(m[A]<=1e-6){f[A]={...g},d[A]={...g};continue}let S=Ge(g,x)||1,w=Ge(g,P)||1;f[A]={x:g.x+(x.x-g.x)/S*m[A],y:g.y+(x.y-g.y)/S*m[A]},d[A]={x:g.x+(P.x-g.x)/w*m[A],y:g.y+(P.y-g.y)/w*m[A]}}if(m.every(A=>A<=1e-6)&&!c)return null;let h=[],p={...d[0]},b=p,y=(A,x)=>{if(Ge(b,A)<=1e-9)return;let g=s[x];Math.abs(g)>1e-6?h.push(ph(b,A,g*dh*u[x])):h.push({kind:"line",end:{...A}}),b=A};for(let A=1;A<=r;A+=1){let x=A%r,g=n[x];y(f[x],(A-1)%r),m[x]>1e-6&&Ge(f[x],d[x])>1e-9&&(h.push({kind:"bezier",control1:oi(f[x],g,Ds),control2:oi(d[x],g,Ds),end:{...d[x]}}),b=d[x])}if(!h.length)return null;let M=h[h.length-1];Ge(M.end,p)>1e-9&&(M.kind==="line"?M.end={...p}:h.push({kind:"line",end:{...p}}));let v={version:1,closed:!0,start:p,segments:h};return Bs(v)?v:null}function bh(e){let t=e.points??[];if(e.kind!=="polygon"||t.length<3||!Array.isArray(e.edgeCurvature))return[];let n=t.map((o,r)=>{let i=e.edgeCurvature[r];return Number.isFinite(i)?Math.min(100,Math.max(-100,i)):0});return n.some(o=>Math.abs(o)>.5)?n:[]}function yh(e){let t=bh(e);return t.length?Gs(e.points,{edgeCurvature:t}):null}function Bo(e,t=2){let n=yh(e);return n?Vs(n,t):e.points??[]}function Hs(e){return e.kind==="polygon"?qn(e.holes):[]}function js(e){let t=new Map,n=new Map;for(let o of e){if(o.type!=="row"||!o.segmentedRow)continue;let r=n.get(o.segmentedRow.groupId)??[];r.push(o),n.set(o.segmentedRow.groupId,r)}for(let[o,r]of n){let i=r.slice().sort((f,d)=>f.segmentedRow.componentIndex-d.segmentedRow.componentIndex),a=i[0]?.segmentedRow?.componentCount??0,s=i[0]?.segmentedRow;if(!s||!(a>=2&&i.length===a&&s?.boundaryBefore==="start"&&i.every((f,d)=>f.segmentedRow?.kind==="segmented-row-v1"&&f.segmentedRow.groupId===o&&f.segmentedRow.componentCount===a&&f.segmentedRow.componentIndex===d&&f.segmentedRow.repeatLabelOnComponents===s.repeatLabelOnComponents&&(d===0?f.segmentedRow.boundaryBefore==="start":f.segmentedRow.boundaryBefore!=="start")&&f.segmentedRow.displayLabel===s.displayLabel)))continue;let l=i.reduce((f,d)=>f+d.seatCount,0),u=0,m=0;for(let f of i)f.segmentedRow.boundaryBefore==="break"&&(u+=1),t.set(f.id,{groupId:o,adjacencyOffset:u,displayOffset:m,displayLabel:s.displayLabel,totalSeats:l,canonical:i[0],viewFromSeatUrl:s.viewFromSeatUrl,viewFromSeatMeta:s.viewFromSeatMeta,confidenceEvidence:s.confidenceEvidence}),u+=f.seatCount,m+=f.seatCount}return t}var gh="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var xh="abcdefghijklmnopqrstuvwxyz";function Mh(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function Qn(e,t=!1){let n=t?xh:gh;return Mh(Math.max(0,Math.floor(e)-1),n)}var vh=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function Us(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of vh)for(;t>=o;)n+=r,t-=o;return n}function Sh(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function ui(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",a=e.seatNumbering?.prefix??"",s=e.seatNumbering?.endAt,c=e.seatCount;if(i==="updown"||i==="updown-descending"){let d=Math.ceil(c/2),h=i==="updown"?t<d?n+2*t:n-1+2*(c-t):t<d?n+2*(d-1-t):n+1+2*(t-d);return`${a}${h}`}let l=i==="odd"||i==="even"?2:r,u=s!=null&&Number.isFinite(s)?s-(c-1)*l:n,m=o==="center"?Sh(c)[t]:o==="rtl"?c-1-t:t,f;switch(i){case"odd":{let d=u%2===1?u:u+1;f=String(d+m*2);break}case"even":{let d=u%2===0?u:u+1;f=String(d+m*2);break}case"roman":f=Us(u+m*r);break;case"letters-upper":f=Qn(u+m*r,!1);break;case"letters-lower":f=Qn(u+m*r,!0);break;default:f=String(u+m*r);break}return`${a}${f}`}function wh(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function Ws(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${ui(e,t)}`}function Ph(e,t,n,o){if(o?.displayLabel)return null;if(e.seatDisplayLabelMode==="number"||!n)return{row:e.displayLabel||e.label,seat:ui(e,t)};let r=wh(n);return{row:n.displayLabel,seat:ui(r,n.displayOffset+t)}}function mi(e,t,n,o){let r=Ph(e,t,n,o);return r?e.seatDisplayLabelMode==="number"?r.seat:`${r.row}-${r.seat}`:o.displayLabel}function Xs(e,t){return`${e.label}-${t+1}`}function Ah(e,t,n){return e?.direction==="anticlockwise"?Math.max(0,t-1-n):n}function Ih(e,t){let n=e.chairNumbering,o=n?.start??1,r=Ah(n,Math.max(0,Math.round(e.seatCount)),t);return n?.format==="letter"?Qn(Math.max(1,o)+r):String(o+r)}function Ys(e,t){let n=Ih(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${n}`:n}function Ks(e){let t=e.length;return t<=3?[...e]:[e[Math.floor(t*.25)],e[Math.floor(t*.5)],e[Math.floor(t*.75)]]}function mn(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u<0?u=0:u>1&&(u=1);let m=t-(i.x+u*s),f=n-(i.y+u*c);if(Math.abs(m)>=o||Math.abs(f)>=o)continue;let d=Math.hypot(m,f);d<o&&(o=d)}return o}function Eh(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let a=Math.hypot(i.x-t,i.y-n);a>r&&(r=a)}return{cx:t,cy:n,r}}function $s(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function fi(e,t){let n=1/0;for(let o of Ks(e)){let r=mn(t,o.x,o.y);r<n&&(n=r)}for(let o of Ks(t)){let r=mn(e,o.x,o.y);r<n&&(n=r)}return n}function Rh(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let u of e)n+=u.x,o+=u.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let u of e){let m=Math.hypot(u.x-n,u.y-o);m>r&&(r=m,i=u)}let a=i.x-n,s=i.y-o,c=Math.hypot(a,s);c>1e-9?(a/=c,s/=c):(a=1,s=0);let l=e.map((u,m)=>({p:u,i:m,t:(u.x-n)*a+(u.y-o)*s})).sort((u,m)=>u.t-m.t);return{pts:l.map(u=>u.p),seatIndices:l.map(u=>t[u.i])}}function di(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let M of e)n+=M.x,o+=M.y;n/=t,o/=t;let r=0,i=0,a=0,s=0,c=0,l=0,u=0;for(let M of e){let v=M.x-n,A=M.y-o;r+=v*v,a+=A*A,i+=v*A,s+=v*v*v,c+=A*A*A,l+=v*A*A,u+=A*v*v}let m=r*a-i*i;if(Math.abs(m)<1e-9)return null;let f=(s+l)/2,d=(c+u)/2,h=(f*a-d*i)/m,p=(d*r-f*i)/m,b=h+n,y=p+o;return!Number.isFinite(b)||!Number.isFinite(y)?null:{cx:b,cy:y}}var Ch=.15;function _h(e){if(e.length<2)return null;let t=e.map(x=>{let g=0,P=0;for(let S of x.pts)g+=S.x,P+=S.y;return{x:g/x.pts.length,y:P/x.pts.length}}),n=0,o=0;for(let x of t)n+=x.x,o+=x.y;n/=t.length,o/=t.length;let r=0,i=0,a=0;for(let x of t){let g=x.x-n,P=x.y-o;r+=g*g,i+=g*P,a+=P*P}let s=r+a,c=r*a-i*i,l=s/2+Math.sqrt(Math.max(0,s*s/4-c)),u,m;Math.abs(i)>1e-12?(u=l-a,m=i):r>=a?(u=1,m=0):(u=0,m=1);let f=Math.hypot(u,m);if(!(f>1e-12))return null;u/=f,m/=f;let d=0,h=0,p=0;for(let x of e){if(x.pts.length<2)continue;let g=x.pts[0],P=x.pts[x.pts.length-1],S=P.x-g.x,w=P.y-g.y,E=Math.hypot(S,w);if(!(E>1e-9))continue;let T=S/E,F=w/E;d+=(T*T-F*F)*E,h+=2*T*F*E,p+=E}if(p>0&&Math.hypot(d,h)>=Lh*p){let x=Math.atan2(h,d)/2;u=-Math.sin(x),m=Math.cos(x)}let b=1/0,y=-1/0,M=[];for(let x of e){let g=1/0,P=-1/0;for(let S of x.pts){let w=S.x*u+S.y*m;w<g&&(g=w),w>P&&(P=w),w<b&&(b=w),w>y&&(y=w)}M.push(P-g)}let v=y-b;return v>1e-9?(M.sort((x,g)=>x-g),M[Math.min(M.length-1,Math.floor(M.length*.9))]/v<=Th?{x:u,y:m}:null):null}var Th=.35,Lh=.8;function Vo(e,t,n,o){let r=new Map;for(let g of n){let P=t[g],S=P.rowId||`__seat-${g}`,w=r.get(S);w||(w={pts:[],idx:[]},r.set(S,w)),w.pts.push({x:P.x,y:P.y}),w.idx.push(g)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[g,P]of r){let S=Rh(P.pts,P.idx),w=0;for(let E of S.pts)w+=Math.hypot(E.x-o.x,E.y-o.y);i.push({id:g,pts:S.pts,seatIndices:S.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:w/S.pts.length})}let a=i.map(g=>Eh(g.pts)),s=i.length<=256?i.length*(i.length-1)/2:0,c=s?new Float64Array(s):null;c?.fill(Number.NaN);let l=c?new Map(i.map((g,P)=>[g,P])):null,u=(g,P)=>(g>P&&([g,P]=[P,g]),g*(2*i.length-g-1)/2+(P-g-1)),m=(g,P)=>{if(!c)return fi(i[g].pts,i[P].pts);let S=u(g,P),w=c[S];if(!Number.isNaN(w))return w;let E=fi(i[g].pts,i[P].pts);return c[S]=E,E},f=(g,P)=>l?m(l.get(g),l.get(P)):fi(g.pts,P.pts),d=[];for(let g=0;g<i.length;g++){let P=1/0;for(let S=0;S<i.length;S++){if(g===S||$s(a[g],a[S])>=P)continue;let w=m(g,S);w<P&&(P=w)}Number.isFinite(P)&&d.push(P)}d.sort((g,P)=>g-P);let h=d.length?d[Math.floor(d.length/2)]:1,p=Math.max(h*1.8,1e-6),b=i.map(()=>[]);for(let g=0;g<i.length;g++)for(let P=g+1;P<i.length;P++)$s(a[g],a[P])>p||m(g,P)<=p&&(b[g].push(P),b[P].push(g));let y=0;for(let g=0;g<i.length;g++){if(i[g].blockId!==-1)continue;let P=y++,S=[g];for(i[g].blockId=P;S.length;){let w=S.pop();for(let E of b[w])i[E].blockId===-1&&(i[E].blockId=P,S.push(E))}}let M=new Map;for(let g of i){let P=M.get(g.blockId)??[];P.push(g),M.set(g.blockId,P)}let v=[];for(let g of i){if(g.pts.length<4)continue;let P=di(g.pts);P&&(!Number.isFinite(P.cx)||!Number.isFinite(P.cy)||v.push({x:P.cx,y:P.cy}))}let A=v.length>=2?(()=>{let g=v.map(w=>w.x).sort((w,E)=>w-E),P=v.map(w=>w.y).sort((w,E)=>w-E),S=Math.floor(v.length/2);return{cx:g[S],cy:P[S]}})():null;if(A){let g=F=>Math.hypot(F.x-A.cx,F.y-A.cy),P=1/0,S=-1/0,w=[];for(let F of i){let R=1/0,I=-1/0;for(let _ of F.pts){let k=g(_);k<R&&(R=k),k>I&&(I=k)}w.push(I-R),R<P&&(P=R),I>S&&(S=I)}let E=S-P;w.sort((F,R)=>F-R);let T=w[Math.min(w.length-1,Math.floor(w.length*.9))];if(E>1e-9&&T/E<=Ch){let F=i.map(L=>{let B=0;for(let D of L.pts)B+=g(D);return{row:L,radius:B/L.pts.length}}),R=0,I=0;for(let L of F)R+=L.radius,I+=L.row.focalDistance;R/=F.length,I/=F.length;let _=0;for(let L of F)_+=(L.radius-R)*(L.row.focalDistance-I);if(_<0)for(let L of F)L.radius=-L.radius;let V=1/0;for(let L of F)L.radius<V&&(V=L.radius);F.sort((L,B)=>L.radius-B.radius);let O=-1,H=-1/0,U=E/Math.max(1,F.length)*.5,N=[];for(let L of F)L.radius-H>U&&(O++,H=L.radius),L.row.ordinal=O,L.row.blockDepth=L.radius-V,N.push(L.row);return{sectionId:e,rows:N,blockCount:y}}}let x=[];for(let[,g]of M){let P=_h(g);if(P){let S=F=>{let R=0;for(let I of F.pts)R+=I.x*P.x+I.y*P.y;return R/F.pts.length};g.sort((F,R)=>S(F)-S(R)),g.length>=2&&g[0].focalDistance>g[g.length-1].focalDistance&&g.reverse();let w=[],E=h*.5;for(let F of g){let R=w[w.length-1];R&&Math.abs(S(F)-S(R[0]))<E?R.push(F):w.push([F])}let T=0;for(let F=0;F<w.length;F++){if(F>0){let R=1/0;for(let I of w[F-1])for(let _ of w[F])R=Math.min(R,f(I,_));T+=R}for(let R of w[F])R.ordinal=F,R.blockDepth=T,x.push(R)}}else{let S=1/0;for(let w of g)w.focalDistance<S&&(S=w.focalDistance);g.sort((w,E)=>w.focalDistance-E.focalDistance);for(let w=0;w<g.length;w++)g[w].ordinal=w,g[w].blockDepth=Math.max(0,g[w].focalDistance-S),x.push(g[w])}}return{sectionId:e,rows:x,blockCount:y}}var kh=/^\d{4}-\d{2}-\d{2}$/;function Oh(e){let t=Date.parse(e);return Number.isFinite(t)?kh.test(e)?t+864e5:t:null}function Fh(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=Oh(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function Dh(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function Nh(e){return e.status!=="draft"&&e.status!=="retracted"}function Bh(e,t){return e.status===void 0?t===void 0:e.status!=="approved"?!0:typeof t=="string"&&typeof e.basisSha256=="string"&&e.basisSha256===t}function Zs(e,t={}){return!!e&&Nh(e)&&Dh(e,t.activeConfigurationId,t.activeConfigurationVersion)&&Bh(e,t.activeBasisSha256)&&Fh(e,t.now)}var Vh=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Gh=/[\s"'<>`\\]/;function Hh(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return Vh.test(e);if(Gh.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function qs(e){let t=e.trim();return Hh(t)?t:null}var hi="seatlayer.event-configuration/1";var fn=100,zh=120,jh=2e5,Uh=1e4,Wh=/^[a-f0-9]{64}$/,Xh=new Set(["stage","screen","barrier","camera_platform","sound_desk","rigging_truss"]);function Jn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function $t(e,t){return typeof e=="string"&&e.length>=1&&e.length<=t&&e.normalize("NFKC").trim()===e}function Yh(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}function Qs(e){return!Array.isArray(e)||e.length>jh||!e.every(t=>$t(t,fn))?null:[...new Set(e)].sort()}function Kh(e){return!Jn(e)||!$t(e.chartId,fn)||!$t(e.version,fn)||e.sha256!==void 0&&(typeof e.sha256!="string"||!Wh.test(e.sha256))?null:{chartId:e.chartId,version:e.version,...typeof e.sha256=="string"?{sha256:e.sha256}:{}}}function pi(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n}function $h(e){return Jn(e)?e.mode==="none"||e.mode==="opaque"?e.opacity===void 0?{mode:e.mode}:null:e.mode==="partial"&&pi(e.opacity,.01,.99)?{mode:"partial",opacity:e.opacity}:null:null}function Zh(e,t){if(e===void 0)return;if(!Array.isArray(e)||e.length>Uh)return null;let n=new Set(t),o=new Set,r=new Set,i=0,a=[];for(let s of e){if(!Jn(s)||!$t(s.id,fn)||!$t(s.objectId,fn)||!n.has(s.objectId)||!Xh.has(String(s.kind))||!pi(s.heightM,.05,50)||s.baseElevationM!==void 0&&!pi(s.baseElevationM,-10,100))return null;let c=$h(s.occlusion);if(!c||o.has(s.id)||r.has(s.objectId))return null;let l=s.contentImageUrl===void 0?void 0:typeof s.contentImageUrl=="string"?qs(s.contentImageUrl):null;if(s.contentImageUrl!==void 0&&(!l||s.kind!=="screen"||++i>1))return null;o.add(s.id),r.add(s.objectId),a.push({id:s.id,objectId:s.objectId,kind:s.kind,heightM:s.heightM,...s.baseElevationM!==void 0?{baseElevationM:s.baseElevationM}:{},occlusion:c,...l?{contentImageUrl:l}:{}})}return a.sort((s,c)=>s.id.localeCompare(c.id))}function qh(e){let t=[];if(!Jn(e))return{issues:[{code:"invalid_export",path:"configuration",message:"Configuration must be an object"}]};e.schema!==hi&&t.push({code:"unsupported_schema",path:"configuration.schema",message:`Configuration schema must be ${hi}`}),$t(e.id,fn)||t.push({code:"invalid_id",path:"configuration.id",message:"Configuration id must contain 1 to 100 normalized characters"}),$t(e.label,zh)||t.push({code:"invalid_label",path:"configuration.label",message:"Configuration label must contain 1 to 120 normalized characters"}),Yh(e.version)||t.push({code:"invalid_version",path:"configuration.version",message:"Configuration version must be a positive integer"});let n=Kh(e.baseVenue);n||t.push({code:"invalid_base_venue",path:"configuration.baseVenue",message:"Base venue must identify one normalized chart id and exact version"});let o=Jn(e.overlay)?e.overlay:null,r=Qs(o?.objectIds),i=Qs(o?.productionKillSeatIds),a=r?Zh(o?.productionElements,r):null;return(!o||!r||!i)&&t.push({code:"invalid_overlay",path:"configuration.overlay",message:"Overlay ids must be bounded arrays of normalized stable ids"}),a===null&&t.push({code:"invalid_production_element",path:"configuration.overlay.productionElements",message:"Production elements must be unique, bounded semantics over referenced base-venue objects"}),t.length||!n||!r||!i||a===null?{issues:t}:{issues:t,value:{schema:hi,id:e.id,label:e.label,version:e.version,baseVenue:n,overlay:{objectIds:r,productionKillSeatIds:i,...a!==void 0?{productionElements:a}:{}}}}}function Js(e){let t=qh(e);return t.value?{ok:!0,value:t.value}:{ok:!1,issues:t.issues}}function Qh(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.kind==="polygon"?Bo(e,6):e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,o=e.width,r=e.height;return[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r},{x:t,y:n+r}]}function Jh(e,t,n){let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),a=e.x-t.x,s=e.y-t.y;return{x:t.x+a*r-s*i,y:t.y+a*i+s*r}}function ec(e){let t=Qh(e);if(!t||t.length<2)return null;let n=e.rotation??0,o=Math.abs(n)<1e-6?t:t.map(c=>Jh(c,{x:t.reduce((l,u)=>l+u.x,0)/t.length,y:t.reduce((l,u)=>l+u.y,0)/t.length},n)),r=1/0,i=1/0,a=-1/0,s=-1/0;for(let c of o)r=Math.min(r,c.x),i=Math.min(i,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y);return!Number.isFinite(r)||a-r<1e-6||s-i<1e-6?null:{minX:r,minY:i,maxX:a,maxY:s}}var ep=5,tp=3,np=.92,op=1.9,rp=2,ip=.6,ap=1,sp=.06;function cp(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?si:No(e.stageKind)?sp:ap}function tc(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=-1/0;for(let a of rc(e)){let s=a.baseHeightM??0;for(let c of a.objects){if(c.type!=="shape"||c.role!=="stage")continue;let l=ec(c);l&&(t=Math.min(t,l.minX),n=Math.min(n,l.minY),o=Math.max(o,l.maxX),r=Math.max(r,l.maxY),i=Math.max(i,s+cp(c)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:o,maxY:r,deckTopM:i}}function lp(e,t,n,o){let r=1/0,i=1/0,a=-1/0,s=-1/0;for(let d of e)Number.isFinite(d.eyeHeightM)&&(r=Math.min(r,d.x),a=Math.max(a,d.x),i=Math.min(i,d.y),s=Math.max(s,d.y));if(!Number.isFinite(r))return null;let c=r*t,l=i*t,u=Math.max(1,Math.ceil((a-r)*t/n)+1),m=Math.max(1,Math.ceil((s-i)*t/n)+1),f=new Float64Array(u*m).fill(-1/0);for(let d of e){if(!Number.isFinite(d.eyeHeightM))continue;let h=d.eyeHeightM-ht,p=Math.min(u-1,Math.max(0,Math.floor((d.x*t-c)/n))),y=Math.min(m-1,Math.max(0,Math.floor((d.y*t-l)/n)))*u+p,M=h+o;M>f[y]&&(f[y]=M)}return{cellM:n,minX:c,minY:l,cols:u,rows:m,top:f}}function up(e,t,n){let o=Math.floor((t-e.minX)/e.cellM),r=Math.floor((n-e.minY)/e.cellM);return o<0||r<0||o>=e.cols||r>=e.rows?-1/0:e.top[r*e.cols+o]}function nc(e,t,n={}){let o=new Map;if(!t||!e.length)return o;let r=n.metresPerChartUnit??fe,i=n.cellM??ip,a=n.chairBackM??np,s=n.selfRowSkipM??rp,c=n.clearThreshold??.9,l=n.partialThreshold??.25,u=Math.max(1,n.columns??ep),m=Math.max(1,n.rows??tp),f=lp(e,r,i,a);if(!f)return o;let d=(t.maxX-t.minX)*r,h=(t.maxY-t.minY)*r,p=d>=h,b=(t.minX+t.maxX)/2*r,y=(t.minY+t.maxY)/2*r,M=[];for(let A=0;A<u;A++){let x=(A+.5)/u-.5,g=p?b+x*d:b,P=p?y:y+x*h;for(let S=0;S<m;S++){let w=t.deckTopM+(m===1?0:S/(m-1)*op);M.push({x:g,y:P,z:w})}}let v=i/2;for(let A of e){if(!Number.isFinite(A.eyeHeightM))continue;let x=A.x*r,g=A.y*r,P=A.eyeHeightM,S=0,w=1/0;for(let T of M){let F=T.x-x,R=T.y-g,I=Math.hypot(F,R);if(!(I>s)){S++;continue}let _=F/I,k=R/I,V=0;for(let O=s;O<I;O+=v){let H=up(f,x+_*O,g+k*O);if(!(!Number.isFinite(H)||H>=P)&&H>P+(T.z-P)*O/I){V=O;break}}V?w=Math.min(w,V):S++}let E=S/M.length;E>=c||o.set(A.id,{seatId:A.id,mark:E<l?"obstructedView":"restrictedView",visibleFraction:E,totalRays:M.length,atDistanceM:Number.isFinite(w)?w:0})}return o}function oc(e,t){if(!t.size)return 0;let n=0;for(let o of e){let r=t.get(o.id);if(!r)continue;let i=o.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(o.commercial={...i,[r.mark]:!0},n++)}return n}function bi(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var Ho=Math.PI/180;var eo=16;function yi(e,t,n,o){let r=n*Ho,i=Math.cos(r),a=Math.sin(r);return{x:o.x+e*i-t*a,y:o.y+e*a+t*i}}function cc(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,a=[];if(e.path)return Fs(e.path,t);if(t<=1)return t===1&&a.push({x:i.x,y:i.y}),a;if(o===0){for(let l=0;l<t;l++)a.push(yi(l*n,0,r,i));return a}let s=o/(t-1)*Ho,c=n/(2*Math.sin(Math.abs(s)/2));for(let l=0;l<t;l++){let u=l*s,m=c*Math.sin(u),f=-c+c*Math.cos(u);a.push(yi(m,f,r,i))}return a}function lc(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function mp(e,t){let n=lc(e);return cc(e).map((o,r)=>{let i=n.get(r),a=bi(i),s=Ws(e,r,i),c={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:s,displayLabel:mi(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:a.length>0,accessibility:a,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(c).some(l=>l!==void 0&&l!==!1&&l!=="")?c:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function fp(e){let t=[];for(let n of mp(e))n.skipped||t.push({id:`${e.id}:${n.index}`,label:n.label,displayLabel:n.displayLabel===n.label?void 0:n.displayLabel,x:n.x,y:n.y,rowId:e.id,categoryKey:n.categoryKey,accessible:n.accessible||void 0,accessibility:n.accessibility.length?n.accessibility:void 0,wheelchairSpaceType:n.wheelchairSpaceType,commercial:n.commercial,glyph:n.glyph,viewUrl:n.viewUrl,viewMeta:n.viewMeta,labelStyle:n.labelStyle});return t}function dp(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function hp(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(u=>[u.index,u])),r=(u,m,f,d)=>{let h=o.get(u),p=bi(h),b=h?.label??Xs(e,u);return{index:u,label:b,displayLabel:h?.displayLabel??Ys(e,u),x:m+(h?.dx??0),y:f+(h?.dy??0),categoryKey:h?.categoryKey??e.categoryKey,skipped:!!h?.skip,accessible:p.length>0,accessibility:p,wheelchairSpaceType:h?.wheelchairSpaceType,commercial:h?.commercial,glyph:h?.glyph,viewUrl:h?.viewFromSeatUrl,viewMeta:h?.viewFromSeatUrl?h.viewFromSeatMeta:void 0,labelStyle:h?.labelStyle,...d?{side:d}:{}}};if(e.shape==="round"){let u=(e.radius??40)+eo,m=e.rotation*Ho,f=Math.max(0,Math.min(360,e.seatArc??360));if(f>=360||n===1){for(let b=0;b<n;b++){let y=m+b/n*2*Math.PI;t.push(r(b,e.center.x+u*Math.cos(y),e.center.y+u*Math.sin(y)))}return t}let d=f*Ho,h=(2*Math.PI-d)/2,p=m+h;for(let b=0;b<n;b++){let y=p+b/(n-1)*d;t.push(r(b,e.center.x+u*Math.cos(y),e.center.y+u*Math.sin(y)))}return t}let i=e.width??80,a=e.height??50,s=dp(e),c=["top","bottom","left","right"],l=0;for(let u of c){let m=s[u];for(let f=0;f<m;f++){let d,h;u==="top"?(d=-i/2+(f+.5)*i/m,h=-a/2-eo):u==="bottom"?(d=-i/2+(f+.5)*i/m,h=a/2+eo):u==="left"?(d=-i/2-eo,h=-a/2+(f+.5)*a/m):(d=i/2+eo,h=-a/2+(f+.5)*a/m);let p=yi(d,h,e.rotation,e.center);t.push(r(l++,p.x,p.y,u))}}return t}function pp(e){return hp(e).filter(t=>!t.skipped).map(t=>({id:`${e.id}:${t.index}`,label:t.label,...t.displayLabel!==t.label?{displayLabel:t.displayLabel}:{},x:t.x,y:t.y,rowId:e.id,categoryKey:t.categoryKey,...t.accessible?{accessible:!0}:{},...t.accessibility.length?{accessibility:t.accessibility}:{},...t.wheelchairSpaceType?{wheelchairSpaceType:t.wheelchairSpaceType}:{},...t.commercial?{commercial:t.commercial}:{},...t.glyph?{glyph:t.glyph}:{},...t.viewUrl?{viewUrl:t.viewUrl}:{},...t.viewUrl&&t.viewMeta?{viewMeta:t.viewMeta}:{},...t.labelStyle?{labelStyle:t.labelStyle}:{}}))}function bp(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function li(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,a=t[o].y,s=t[r].x,c=t[r].y;a>e.y!=c>e.y&&e.x<(s-i)*(e.y-a)/(c-a)+i&&(n=!n)}return n}function zs(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let a=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),s=(r.x-n.x)**2+(r.y-n.y)**2;return a>=-1e-7&&a<=s+1e-7})}function qn(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function ze(e,t,n){return li(e,t)&&!qn(n).some(o=>li(e,o)||zs(e,o))}function Go(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function uc(e){switch(e.type){case"row":{let t=cc(e),n=lc(e),o=0,r=0,i=0;for(let a=0;a<t.length;a++){let s=n.get(a);s?.skip||(o+=t[a].x+(s?.dx??0),r+=t[a].y+(s?.dy??0),i++)}return i?{x:o/i,y:r/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return Go(e.points);case"section":return Go(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?Go(e.points):e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null?{x:e.x+e.width/2,y:e.y+e.height/2}:{x:e.x??0,y:e.y??0};case"decorImage":return{x:e.x+e.width/2,y:e.y+e.height/2}}}function ic(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function yp(e,t){if(e.type!=="gaArea"||!ic(e.points,t.outline))return!1;let n=qn(e.holes),o=qn(t.holes);return n.length===o.length&&n.every((r,i)=>ic(r,o[i]))}function gp(e,t,n=e.filter(r=>r.type==="section"),o=uc(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?n.find(a=>(a.logicalSectionId??a.id)===r&&(yp(t,a)||ze(o,a.outline,a.holes))):void 0)??n.find(a=>ze(o,a.outline,a.holes))}function rc(e){return e.floors&&e.floors.length?e.floors:[{id:"floor-0",name:"Main",objects:e.objects,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]}function ac(e,t,n,o,r,i,a,s,c){let l=[],u=e.filter(p=>p.type==="section"),m=js(e),f=p=>!p?.eventConfigurationId||p.eventConfigurationId===o&&(p.eventConfigurationVersion===void 0||p.eventConfigurationVersion===c),d=p=>Zs(p,{activeConfigurationId:o,activeConfigurationVersion:c,activeBasisSha256:r,now:s}),h=(p,b)=>d(p)?{...p,coverage:b}:void 0;for(let p of e){let b=[];if(p.type==="row"?b=fp(p):p.type==="table"?b=pp(p):p.type==="booth"&&(b=bp(p)),!b.length)continue;for(let x of b)x.viewUrl&&!f(x.viewMeta)&&(x.viewUrl=void 0,x.viewMeta=void 0);if(p.type==="row"){let x=m.get(p.id);if(x){let g=new Map((p.overrides??[]).map(P=>[P.index,P]));for(let P of b){let S=Number(P.id.slice(P.id.lastIndexOf(":")+1));if(!Number.isInteger(S))continue;P.logicalRowId=x.groupId,P.logicalSeatIndex=x.adjacencyOffset+S,g.get(S)?.displayLabel||(P.displayLabel=mi(p,S,x)),!P.viewUrl&&x.viewFromSeatUrl&&f(x.viewFromSeatMeta)&&(P.viewUrl=x.viewFromSeatUrl,P.viewMeta=x.viewFromSeatMeta);let w=g.get(S)?.confidenceEvidence;P.confidenceEvidence=h(w,"exact-seat")??h(p.confidenceEvidence,"row-representative")??h(x.confidenceEvidence,"row-representative")}}}let y=gp(e,p,u,p.type==="row"?Go(b):uc(p)),M=y?.viewFromSeatUrl,A=(y?.zone?t?.find(x=>x.id===y.zone):void 0)?.focalPoint??n;for(let x of b){if(!x.confidenceEvidence){let g=Number(x.id.slice(x.id.lastIndexOf(":")+1)),P=(p.type==="row"||p.type==="table")&&Number.isInteger(g)?p.overrides?.find(S=>S.index===g)?.confidenceEvidence:void 0;x.confidenceEvidence=h(P,"exact-seat")??(p.type==="row"?h(p.confidenceEvidence,"row-representative"):void 0)}x.confidenceEvidence??=h(y?.confidenceEvidence,"section-representative")??(a?h(a.evidence,a.coverage):void 0),!x.viewUrl&&M&&f(y?.viewFromSeatMeta)&&(x.viewUrl=M,x.viewMeta=y?.viewFromSeatMeta),!x.viewUrl&&i&&f(i.meta)&&(x.viewUrl=i.url,x.viewMeta=i.meta),y&&(x.sectionId=y.logicalSectionId??y.id),y?.zone&&(x.zoneId=y.zone),A&&(x.focalPoint={...A})}l.push(...b)}return l}function dn(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,a=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,s=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,c=ac(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,a,s,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&sc(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,c);for(let l of c)l.floorId=r.id;for(let l of c)o.push(l)}return o}let n=ac(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&sc(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),xp(e,n,t)}function xp(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||oc(t,nc(t,tc(e))),t}function sc(e,t,n,o){let r=e.filter(m=>m.type==="section"),i=n>0||r.some(m=>m.height!==void 0||m.rake!==void 0||(m.elevation??0)>0);if(!r.length||!i||!t){for(let m of o)m.eyeHeightM=n+ht;return}let a=new Array(o.length),s=new Map;for(let m of r)s.has(m.id)||s.set(m.id,m);let c=new Map,l=new Map;for(let m=0;m<o.length;m++){let f=o[m],h=(f.sectionId?s.get(f.sectionId)??r.find(b=>b.logicalSectionId===f.sectionId&&ze({x:f.x,y:f.y},b.outline,b.holes)):void 0)??r.find(b=>ze({x:f.x,y:f.y},b.outline,b.holes))??null;if(a[m]=h,!h)continue;c.has(h.id)||c.set(h.id,Ct(h,{floorBaseHeightM:n}));let p=l.get(h.id);p?p.push(m):l.set(h.id,[m])}let u=new Array(o.length).fill(void 0);for(let[m,f]of l){let d=c.get(m);if(!d)continue;let h=d.rake>0?Math.tan(d.rake*Math.PI/180):0,p=Vo(m,o,f,t);for(let b of p.rows){let y=b.blockDepth*fe*h,M=d.height+y;for(let v of b.seatIndices)u[v]=M}}for(let m=0;m<o.length;m++){let f=o[m],d=a[m];if(!d){f.eyeHeightM=n+ht;continue}let h=c.get(d.id);f.eyeHeightM=(u[m]??h.height)+ht}}function mc(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=!1;for(let a of e)!Number.isFinite(a.x)||!Number.isFinite(a.y)||(i=!0,a.x<t&&(t=a.x),a.y<n&&(n=a.y),a.x>o&&(o=a.x),a.y>r&&(r=a.y));return i?{minX:t,minY:n,maxX:o,maxY:r}:null}function hn(e,t){return e.minX<=t.maxX&&t.minX<=e.maxX&&e.minY<=t.maxY&&t.minY<=e.maxY}var fc="#ffffff";var Mp={wheelchair:"M7.8 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM8 7L10.5 7L10.5 15L8 15ZM8 12.5L18 12.5L18 15L8 15ZM16 15L18 15L18 18L16 18ZM5.5 16a5.5 5.5 0 1 0 11 0a5.5 5.5 0 1 0 -11 0zM8 16a3 3 0 1 1 6 0a3 3 0 1 1 -6 0z",companion:"M5.5 6.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM4.5 18.5L6 11.5L11 11.5L12.5 18.5ZM12.5 7.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM11.5 19L13 12.5L18 12.5L19.5 19Z","semi-ambulatory":"M8.3 3.8a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM9 6.2L12 6.6L11 13.5L8.6 13L9 6.2ZM8.6 13L11 13L9.5 21L7 21ZM10.4 13L12.6 13L13.6 21L11.2 21ZM11.2 7.2L14 8L14.6 9.6L11.9 8.9ZM14.4 6.8L15.9 6.8L16.4 21L14.8 21Z","designated-aisle":"M3 5L6 5L6 14L3 14ZM3 12L13 12L13 15L3 15ZM5 15L7 15L7 20L5 20ZM11 15L13 15L13 20L11 20ZM13 7L20 7L17 4L19 4L23 8.5L19 13L17 13L20 10L13 10Z","step-free":"M4 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM4.4 7L7.5 7L7.5 13L11 15L9.5 17L5 14L4.4 7ZM2 19L8 19L17 10L22 10L22 13L18 13L10 21L2 21Z",hearing:"M15.5 3.5C9 2.2 5.5 6 5.5 11.5C5.5 16 8 19.5 10.5 21C13.2 22.6 16.4 20.8 15.4 18C14.8 16.4 12.9 16.1 13 14C13.1 11.9 15.8 11.4 15.8 8.5C15.8 5.4 13 4 15.5 3.5Z",cart:"M5.5 6L18.5 6a2.5 2.5 0 0 1 2.5 2.5L21 15.5a2.5 2.5 0 0 1 -2.5 2.5L11 18L7 20.5L7.5 18L5.5 18a2.5 2.5 0 0 1 -2.5 -2.5L3 8.5a2.5 2.5 0 0 1 2.5 -2.5zM6.5 11L17.5 11L17.5 12.6L6.5 12.6zM6.5 14L17.5 14L17.5 15.6L6.5 15.6z","sign-language":"M7 11L17 11L17 18a2 2 0 0 1 -2 2L9 20a2 2 0 0 1 -2 -2zM7.6 5L9.4 5L9.4 12L7.6 12zM9.9 3.5L11.7 3.5L11.7 12L9.9 12zM12.3 3.5L14.1 3.5L14.1 12L12.3 12zM14.6 5L16.4 5L16.4 12L14.6 12zM7.2 12.5L5 10.2L6.4 8.9L8.6 11.2Z","low-vision":"M2.5 12C6 6 18 6 21.5 12C18 18 6 18 2.5 12ZM9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM17.5 3L19 3L19 6L17.5 6ZM19 4L22 4L22 5.5L19 5.5Z","sensory-friendly":"M4 11C4 5 7 2.5 12 2.5S20 5 20 11L17 11C17 7 15.5 5.5 12 5.5S7 7 7 11ZM3 10L8 10L8 19L5 19a2 2 0 0 1 -2 -2ZM16 10L21 10L21 17a2 2 0 0 1 -2 2L16 19ZM9 12L15 12L15 14L9 14ZM10 16L14 16L14 18L10 18Z","plus-size":"M9.4 4.3a2.6 2.6 0 1 0 5.2 0a2.6 2.6 0 1 0 -5.2 0zM5 20L4 13C4 10.5 7 9.5 12 9.5C17 9.5 20 10.5 20 13L19 20Z","lift-armrest":"M5 6L8 6L8 19L5 19zM5 16L18 16L18 19L5 19zM8 12L17 12L17 14.5L8 14.5zM14 7L16 7L16 12L14 12zM12 7L18 7L15 3Z"},Lv=Mp.wheelchair;var zo=["#e69f00","#56b4e9","#009e73","#f0e442","#0072b2","#d55e00","#cc79a7"],dc="#a4508b";var gi={facilities:dc,"food-drink":zo[5],navigation:zo[2],accessibility:zo[4]},Wo=fc,xi={minDiameterPx:12,glyphScale:.66,ringRatio:1/14,largeFromPx:24};var _e=e=>{let t=Math.round(e*100)/100;return Object.is(t,-0)?"0":String(t)},gn=e=>`${_e(e[0])} ${_e(e[1])}`,yn=(e,t,n,o)=>[e+n*Math.cos(o*Math.PI/180),t+n*Math.sin(o*Math.PI/180)];function Ic(e){let t=`M${gn(e.from)}`;for(let n of e.segs)t+=n.arc?`A${_e(n.arc.r)} ${_e(n.arc.r)} 0 ${n.arc.large} ${n.arc.sweep} ${gn(n.to)}`:`L${gn(n.to)}`;return`${t}Z`}function Te(e){let t=[e.from,...e.segs.map(o=>o.to)],n=[];for(let o=e.segs.length-1;o>=0;o--){let r=e.segs[o].arc;n.push({to:t[o],arc:r&&{...r,sweep:r.sweep?0:1}})}return{from:t[t.length-1],segs:n}}function Le(e,t,n){let o={r:n,large:0,sweep:1};return{from:[e-n,t],segs:[{to:[e+n,t],arc:o},{to:[e-n,t],arc:o}]}}function de(e,t,n,o,r){let i=Math.min(r,n/2,o/2),a={r:i,large:0,sweep:1};return i<=0?Fe([[e,t],[e+n,t],[e+n,t+o],[e,t+o]]):{from:[e+i,t],segs:[{to:[e+n-i,t]},{to:[e+n,t+i],arc:a},{to:[e+n,t+o-i]},{to:[e+n-i,t+o],arc:a},{to:[e+i,t+o]},{to:[e,t+o-i],arc:a},{to:[e,t+i]},{to:[e+i,t],arc:a}]}}function Fe(e){let t=0;for(let o=0;o<e.length;o++){let[r,i]=e[o],[a,s]=e[(o+1)%e.length];t+=r*s-a*i}let n=t>0?e:[...e].reverse();return{from:n[0],segs:[...n.slice(1).map(o=>({to:o})),{to:n[0]}]}}function Ie(e,t,n){let o=n/2,r=t[0]-e[0],i=t[1]-e[1],a=Math.hypot(r,i);if(a<1e-6)return Le(e[0],e[1],o);let s=[i/a*o,-r/a*o],c={r:o,large:0,sweep:1},l=[e[0]+s[0],e[1]+s[1]];return{from:l,segs:[{to:[t[0]+s[0],t[1]+s[1]]},{to:[t[0]-s[0],t[1]-s[1]],arc:c},{to:[e[0]-s[0],e[1]-s[1]]},{to:l,arc:c}]}}function Oe(e,t,n=!1){let o=[],r=n?e.length:e.length-1;for(let i=0;i<r;i++)o.push(Ie(e[i],e[(i+1)%e.length],t));return o}function ct(e,t,n,o,r,i){let a=i/2,s=r-o>180?1:0,c={r:a,large:0,sweep:1},l=yn(e,t,n+a,o);return{from:l,segs:[{to:yn(e,t,n+a,r),arc:{r:n+a,large:s,sweep:1}},{to:yn(e,t,n-a,r),arc:c},{to:yn(e,t,n-a,o),arc:{r:n-a,large:s,sweep:0}},{to:l,arc:c}]}}var he=(...e)=>e.flat().map(Ic).join(" "),We=(e,t,n)=>`M${_e(e-n)} ${_e(t)}a${_e(n)} ${_e(n)} 0 1 0 ${_e(2*n)} 0a${_e(n)} ${_e(n)} 0 1 0 ${_e(-2*n)} 0`,bt=(e,t,n,o,r)=>Ic(de(e,t,n,o,r)),Uo=e=>`M${e.map(gn).join("L")}`,jo=(e,t,n,o,r)=>`M${gn(yn(e,t,n,o))}A${_e(n)} ${_e(n)} 0 ${r-o>180?1:0} 1 ${gn(yn(e,t,n,r))}`;function pn(e,t,n,o=1){let r=i=>[i[0]*o+t,i[1]*o+n];return{head:[e.head[0]*o+t,e.head[1]*o+n,e.head[2]*o],limbs:e.limbs.map(i=>i.map(r)),arcs:e.arcs?.map(([i,a,s,c,l])=>[i*o+t,a*o+n,s*o,c,l])}}function to(e){return[We(e.head[0],e.head[1],e.head[2]),...e.limbs.map(Uo),...(e.arcs??[]).map(([t,n,o,r,i])=>jo(t,n,o,r,i))].join(" ")}function bn(e,t=2.6){return[Le(e.head[0],e.head[1],e.head[2]+1),...e.limbs.flatMap(n=>Oe(n,t)),...(e.arcs??[]).map(([n,o,r,i,a])=>ct(n,o,r,i,a,t-.2))]}var Zt={head:[10,4,2],limbs:[[[10,8.2],[10,14],[15.5,14],[18,19.5],[20.5,19.5]],[[10,10.6],[14.5,10.6]]],arcs:[[9.5,16,5.5,35,235]]},hc={head:[10.6,3.9,1.9],limbs:[[[9.6,7.8],[7.6,12]],[[5.4,8.2],[9.4,8.4],[12.8,10]],[[4,15.6],[7.6,12],[11,13.6],[10.6,16.4]]]},pc={cx:12,hr:1.9,arm:5,leg:3,r:2},bc={cx:12,hr:1.9,sh:2.2,hem:6,leg:3},yc={cx:6.2,hr:1.8,arm:3.6,leg:2.2,r:1.4},gc={cx:17.8,hr:1.8,sh:1.4,hem:4.1,leg:2.2};function xc({cx:e,hr:t,arm:n,leg:o,r}){return[We(e,2+t,t),`M${_e(e-n+r)} 8.5H${_e(e+n-r)}a${r} ${r} 0 0 1 ${r} ${r}V15H${_e(e+o)}V22H${_e(e-o)}V15H${_e(e-n)}V${_e(8.5+r)}a${r} ${r} 0 0 1 ${r} ${-r}Z`,`M${_e(e)} 15V22`].join(" ")}function Mc({cx:e,hr:t,arm:n,leg:o,r}){return[Le(e,2+t,t+1),de(e-n-.5,7.8,2*n+1,7.7,r+.5),de(e-o-.5,13,o,9.5,1),de(e+.5,13,o,9.5,1)]}function vc({cx:e,hr:t,sh:n,hem:o,leg:r}){return[We(e,2+t,t),Uo([[e-n,8.5],[e+n,8.5],[e+o,16],[e+r,16],[e+r,22],[e-r,22],[e-r,16],[e-o,16]])+"Z",`M${_e(e)} 16V22`].join(" ")}function Sc({cx:e,hr:t,sh:n,hem:o,leg:r}){return[Le(e,2+t,t+1),Fe([[e-n-.6,7.8],[e+n+.6,7.8],[e+o+.9,16.8],[e-o-.9,16.8]]),de(e-r-.1,15,r-.4,7.5,.9),de(e+.5,15,r-.4,7.5,.9)]}var vp=[[14.6,1.5],[5.2,13.6],[11,13.6],[9.4,22.5],[18.8,10.4],[13,10.4]],Sp="M8.5 3.5 4 5.5l-1.5 5 3 1 1-2v11h11v-11l1 2 3-1-1.5-5-4.5-2c-.5 1.5-1.8 2.5-3.5 2.5s-3-1-3.5-2.5Z",wp="M12 2.5S5 9.5 5 14.5a7 7 0 0 0 14 0c0-5-7-12-7-12Z",Pp="M2.5 21.5h19V3h-6v6.2H9.2v6.2H2.5Z",wc=[[9,3],[15,3],[15,9],[21,9],[21,15],[15,15],[15,21],[9,21],[9,15],[3,15],[3,9],[9,9]],Ap={from:[3.8,5.2],segs:[{to:[20.2,5.2]},{to:[22,7],arc:{r:1.8,large:0,sweep:1}},{to:[22,9.7]},{to:[22,14.3],arc:{r:2.3,large:0,sweep:0}},{to:[22,17]},{to:[20.2,18.8],arc:{r:1.8,large:0,sweep:1}},{to:[3.8,18.8]},{to:[2,17],arc:{r:1.8,large:0,sweep:1}},{to:[2,14.3]},{to:[2,9.7],arc:{r:2.3,large:0,sweep:0}},{to:[2,7]},{to:[3.8,5.2],arc:{r:1.8,large:0,sweep:1}}]},Ip={from:[12,1.6],segs:[{to:[20.4,4.9]},{to:[20.4,11.2]},{to:[12,22.4],arc:{r:13,large:0,sweep:1}},{to:[3.6,11.2],arc:{r:13,large:0,sweep:1}},{to:[3.6,4.9]},{to:[12,1.6]}]};function Pc(e,t,n){return{from:[e-n,t],segs:[{to:[e+n,t],arc:{r:n,large:0,sweep:1}},{to:[e-n,t]}]}}var Ac={head:[13.2,4.3,2.2],limbs:[[[12.6,8.6],[11.2,15],[17.8,18.4],[9.4,18.4]],[[12.4,9.8],[16,14.4]]]},Ep=[[6,10.5],[15,10.5],[16.5,7],[18.5,5.5],[20,6.5],[21.5,8.5],[19.5,10],[18,12],[18,19],[16.5,19],[15.5,14],[9.5,14],[8.5,19],[7,19],[6.5,13]],Rp=[[5.4,9.8],[14.6,9.8],[16.1,6.4],[18.4,4.6],[20.5,5.9],[22.4,8.6],[19.9,10.6],[18.8,12.3],[18.8,19.8],[15.8,19.8],[15,14.8],[10.1,14.8],[9.2,19.8],[6.2,19.8],[5.6,13.2]],Mi=[{key:"restroom-men",label:"Men's restroom",group:"facilities",path:xc(pc),solid:he(Mc(pc))},{key:"restroom-women",label:"Women's restroom",group:"facilities",path:vc(bc),solid:he(Sc(bc))},{key:"restroom-accessible",label:"Accessible restroom",group:"facilities",path:[bt(2.5,2.5,19,19,3.5),to(pn(Zt,4.6,4.3,.66))].join(" "),solid:he(bn(Zt)),solidLarge:he(de(1.5,1.5,21,21,4.5),Te(de(3.9,3.9,16.2,16.2,2.6)),bn(pn(Zt,4.9,4.7,.62),2.2))},{key:"first-aid",label:"First aid",group:"facilities",path:Uo(wc)+"Z",solid:he(Fe(wc.map(([e,t])=>[e+(e-12)*.08,t+(t-12)*.08])))},{key:"coat-check",label:"Coat check",group:"facilities",path:"M10 6.5a2 2 0 1 1 2 2V10 M12 10 3.4 16.9a1.4 1.4 0 0 0 .9 2.6h15.4a1.4 1.4 0 0 0 .9-2.6Z",solid:he(ct(12,6.2,2.2,180,450,2.3),Ie([12,8.4],[12,10.5],2.3),Oe([[12,10.2],[3.2,18.8],[20.8,18.8]],2.8,!0))},{key:"atm",label:"ATM / cash",group:"facilities",path:[bt(2,6,20,12,2),We(12,12,2.75),"M6 12h.01 M18 12h.01"].join(" "),solid:he(de(1.5,5.5,21,13,2.4),Te(Le(12,12,3.2)))},{key:"info",label:"Info point",group:"facilities",path:[We(12,12,9.5),"M10.8 11H12v5.8 M12 7.6h.01"].join(" "),solid:he(Le(12,4.9,2.4),de(10.3,9.2,3.4,12.3,1),de(8.2,9.2,4,3,1),de(8.2,18.5,7.6,3,1))},{key:"lost-found",label:"Lost & found",group:"facilities",path:[We(10.5,10.5,7.5),"M16 16l5.5 5.5","M8.4 8.4a2.1 2.1 0 1 1 3 1.9c-.6.4-.9.8-.9 1.6 M10.5 14.6h.01"].join(" "),solid:he(ct(12,7.6,4.2,180,405,3.4),Oe([[14.97,10.57],[12,13],[12,15]],3.4),Le(12,20,2.1))},{key:"restrooms",label:"Toilets",group:"facilities",path:[xc(yc),vc(gc)].join(" "),solid:he(Mc(yc),Sc(gc))},{key:"charging",label:"Charging point",group:"facilities",path:[bt(6,2,12,20,2.5),"M13.2 6.2 9.6 12h4.8l-3.6 5.8"].join(" "),solid:he(Fe(vp))},{key:"smoking",label:"Smoking area",group:"facilities",path:[bt(2,14.5,14.5,4,1),"M6.5 14.5v4","M15.5 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4 M19 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4"].join(" "),solid:he(de(1.5,14,4.2,5,1.2),de(6.8,14,10.4,5,1.2),Oe([[15.9,11.4],[17.3,8.9],[15.9,6.4],[17.1,3.9]],2.2),Oe([[19.6,11.4],[21,8.9],[19.6,6.4],[20.8,3.9]],2.2))},{key:"no-smoking",label:"No smoking",group:"facilities",path:[We(12,12,9.5),"M5.3 5.3l13.4 13.4","M5.5 10.5h13v3h-13Z"].join(" "),solid:he(Le(12,12,10.6),Te(Le(12,12,8)),Ie([6,6],[18,18],2.8),de(5,10.4,3,3.2,.6),de(16,10.4,3,3.2,.6))},{key:"food",label:"Food",group:"food-drink",path:"M5 2.5V8a2.5 2.5 0 0 0 5 0V2.5 M7.5 2.5v19 M18.5 13.5h-2c-1.3 0-2-1-2-2.5 0-4 1.5-7 4-8.5v19",solid:he(Oe([[4.9,2.6],[4.9,8]],2.2),Oe([[10.1,2.6],[10.1,8]],2.2),Oe([[7.5,2.6],[7.5,8]],2.2),ct(7.5,8,2.6,0,180,2.2),Ie([7.5,10],[7.5,21.4],3),Fe([[19.4,2.2],[19.4,14.2],[16.2,14.2],[14.1,12],[14.1,9.4],[15.2,5.8],[17.3,3.3]]),Ie([18,13],[18,21.4],3))},{key:"bar",label:"Bar",group:"food-drink",path:"M3.5 3.5h17L12 13Z M6.2 6.5h11.6 M12 13v7.5 M8 20.5h8",solid:he(Fe([[2.8,3],[21.2,3],[12,13.6]]),Ie([12,12],[12,20.6],2.8),Ie([7.4,21],[16.6,21],2.8))},{key:"coffee",label:"Caf\xE9 / coffee",group:"food-drink",path:"M4 9h12v4.5a5.5 5.5 0 0 1-5.5 5.5h-1A5.5 5.5 0 0 1 4 13.5Z M16 10.5h1.2a2.75 2.75 0 0 1 0 5.5H16 M8 3v3 M12 3v3 M3 21.5h14",solid:he({from:[3.4,8.4],segs:[{to:[16.6,8.4]},{to:[16.6,13.4]},{to:[11,19.4],arc:{r:5.8,large:0,sweep:1}},{to:[9,19.4]},{to:[3.4,13.4],arc:{r:5.8,large:0,sweep:1}},{to:[3.4,8.4]}]},ct(17.2,13.25,2.5,270,450,2.4),Ie([7.8,2.6],[7.8,5.6],2.4),Ie([12.2,2.6],[12.2,5.6],2.4),Ie([2.6,21.6],[17.4,21.6],2.6))},{key:"water",label:"Water / drinks",group:"food-drink",path:wp,solid:"M12 1.2S4 8.9 4 14.5a8 8 0 0 0 16 0c0-5.6-8-13.3-8-13.3Z"},{key:"merch",label:"Merch / shop",group:"food-drink",path:Sp,solid:"M8.4 2.8 3.5 5l-1.9 6 4.2 1.4.4-.8v9.4h11.6v-9.4l.4.8 4.2-1.4-1.9-6-4.9-2.2c-.4 1.5-1.8 2.6-3.6 2.6s-3.2-1.1-3.6-2.6Z"},{key:"screen",label:"Screen",group:"facilities",path:[bt(2,3.5,20,13.5,2),"M12 17v3.5 M8 20.5h8","M10 7.8v5.9l5-2.95Z"].join(" "),solid:he(de(1.5,3,21,14.4,2.4),Te(Fe([[9.6,6.7],[16,10.2],[9.6,13.7]])),de(10.6,16.5,2.8,4,0),Ie([7.4,21],[16.6,21],2.8))},{key:"sound-booth",label:"Sound booth",group:"facilities",path:["M6 3v9 M6 16v5 M12 3v3 M12 10v11 M18 3v10 M18 17v4",We(6,14,2),We(12,8,2),We(18,15,2)].join(" "),solid:he(Ie([6,2.8],[6,21.2],1.8),Ie([12,2.8],[12,21.2],1.8),Ie([18,2.8],[18,21.2],1.8),de(3.2,11.6,5.6,4.8,1.4),de(9.2,5.6,5.6,4.8,1.4),de(15.2,12.6,5.6,4.8,1.4))},{key:"entrance",label:"Entrance",group:"navigation",path:"M11 7V3.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v17a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V17 M2.5 12h13.5 M12.5 8.5 16 12l-3.5 3.5",solid:he(Oe([[11,6.5],[11,2.6],[21,2.6],[21,21.4],[11,21.4],[11,17.5]],2.6),Ie([2.8,12],[13.5,12],3.2),Fe([[12.6,7.8],[18,12],[12.6,16.2]]))},{key:"exit",label:"Exit",group:"navigation",path:"M13 7V3.5a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v17a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V17 M8 12h13.5 M18 8.5l3.5 3.5-3.5 3.5",solid:he(Oe([[13,6.5],[13,2.6],[3,2.6],[3,21.4],[13,21.4],[13,17.5]],2.6),Ie([7.2,12],[17,12],3.2),Fe([[16.2,7.8],[21.6,12],[16.2,16.2]]))},{key:"emergency-exit",label:"Emergency exit",group:"navigation",path:[to(pn(hc,-2,1.4,1.15)),"M15.5 13h6 M19 10.5l2.5 2.5-2.5 2.5"].join(" "),solid:he(bn(pn(hc,-2,1.4,1.15),2.7),Ie([15.6,13],[19.5,13],2.8),Fe([[18.4,9.4],[22.4,13],[18.4,16.6]]))},{key:"stairs",label:"Stairs",group:"navigation",path:Pp,solid:"M1.5 22.5h21V2h-7.8v6.4H8.4v6.4H1.5Z"},{key:"elevator",label:"Elevator",group:"navigation",path:[bt(3.5,2.5,17,19,2.5),"M8.5 9.5 12 5.5l3.5 4Z M8.5 14.5l3.5 4 3.5-4Z"].join(" "),solid:he(Fe([[12,1.6],[19.6,10.2],[4.4,10.2]]),Fe([[4.4,13.8],[19.6,13.8],[12,22.4]]))},{key:"parking",label:"Parking",group:"navigation",path:[bt(3,3,18,18,3),"M9.5 17V7h3.75a3 3 0 0 1 0 6H9.5"].join(" "),solid:"M6.5 21V3H12a5.5 5.5 0 0 1 0 11h-1.9v7Z M10.1 6.6v3.8H12a1.9 1.9 0 0 0 0-3.8Z"},{key:"wheelchair",label:"Wheelchair access",group:"accessibility",path:to(Zt),solid:he(bn(Zt))},{key:"hearing",label:"Hearing assistance",group:"accessibility",path:["M4 9a6 6 0 1 1 12 0c0 3-1.8 4.3-3 5.2-1.1.8-1.6 1.7-1.6 3.1a3.6 3.6 0 0 1-6.2 2.1","M7.5 9a2.5 2.5 0 0 1 5 0c0 1.2-.7 1.9-1.6 2.5","M18.5 5.5a6.5 6.5 0 0 1 0 8"].join(" "),solid:he(ct(10,9,6,180,380,3),Oe([[15.64,11.05],[12.8,14.3],[11.5,17.2]],3),ct(8.2,17.2,3.3,0,150,3),ct(10,9,2.2,180,400,2.4),ct(13.38,9.5,6.5,322,398,2.6))},{key:"box-office",label:"Box office / tickets",group:"navigation",path:"M3 7.5A1.5 1.5 0 0 1 4.5 6h15A1.5 1.5 0 0 1 21 7.5V10a2 2 0 0 0 0 4v2.5a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 16.5V14a2 2 0 0 0 0-4Z M15 6v2 M15 11v2 M15 16v2",solid:he(Ap,Te(de(14.1,7,1.8,2.2,.9)),Te(de(14.1,10.9,1.8,2.2,.9)),Te(de(14.1,14.8,1.8,2.2,.9)))},{key:"escalator",label:"Escalator",group:"navigation",path:"M2.5 17H7l9-9h5.5v4h-4l-9 9h-6Z M11 4.5h.01 M11 8.2v3.3",solid:he(Fe([[2,16.4],[6.8,16.4],[15.8,7.4],[22,7.4],[22,12.6],[17.8,12.6],[8.8,21.6],[2,21.6]]),Le(11,4.3,2.3),Ie([11,8],[11,11],2.6))},{key:"ramp",label:"Ramp",group:"navigation",path:"M2.5 19.5h19v-10Z M4.5 13.2 14 8.2 M10.53 7.76 14 8.2l-1.6 3.11",solid:he(Fe([[1.6,20.4],[22.4,20.4],[22.4,8.6]]),Ie([4.2,13.4],[13.2,8.6],2.6),Fe([[15.4,7.5],[13.16,11.84],[10.56,6.88]]))},{key:"taxi",label:"Taxi / rideshare",group:"navigation",path:["M9.5 2.5h5V5h-5Z M6.5 11 8 7h8l1.5 4",bt(3.5,11,17,6,2),"M6.5 17v2.5 M17.5 17v2.5 M7 14h.01 M17 14h.01"].join(" "),solid:he(de(9,1.8,6,3.4,.8),Fe([[6,11.4],[7.6,6.4],[16.4,6.4],[18,11.4]]),de(2.8,10.6,18.4,7,2.2),Te(Le(6.8,14,1.3)),Te(Le(17.2,14,1.3)),de(4.8,16,3.6,5.2,1.2),de(15.6,16,3.6,5.2,1.2))},{key:"transit",label:"Bus / transit",group:"navigation",path:[bt(4.5,2.5,15,16,3),"M4.5 10.5h15 M9 5.5h6 M7.5 18.5V21 M16.5 18.5V21 M8 14.5h.01 M16 14.5h.01"].join(" "),solid:he(de(4,2,16,17,3.2),Te(de(6.2,5.8,11.6,5,1)),Te(Le(8,14.5,1.3)),Te(Le(16,14.5,1.3)),de(6,17,3.4,5,1.2),de(14.6,17,3.4,5,1.2))},{key:"bike-parking",label:"Bike parking",group:"navigation",path:[We(6,14.5,4),We(18,14.5,4),"M6 14.5 9 7.5h6.5L18 14.5 M9 7.5l2.5 7H6 M11.5 14.5l4-7 M7.5 6h3 M15.5 7.5 15 5.5h2"].join(" "),solid:he(Le(6,14.5,4.9),Te(Le(6,14.5,2.7)),Le(18,14.5,4.9),Te(Le(18,14.5,2.7)),Oe([[6,14.5],[9,7.5],[15.5,7.5],[18,14.5]],2.2),Oe([[9,7.5],[11.5,14.5],[15.5,7.5]],2.2),Ie([6,14.5],[11.5,14.5],2.2),Ie([7.2,5.8],[10.6,5.8],2.2),Oe([[15.4,7.3],[15,5.4],[17.2,5.4]],2.2))},{key:"meeting-point",label:"Meeting point",group:"navigation",path:["M9.5 2.5 12 5l2.5-2.5 M9.5 21.5 12 19l2.5 2.5 M2.5 9.5 5 12l-2.5 2.5 M21.5 9.5 19 12l2.5 2.5",We(10,9.6,1.5),We(14,9.6,1.5),"M7.5 15.5a2.5 2.5 0 0 1 5 0 M11.5 15.5a2.5 2.5 0 0 1 5 0"].join(" "),solid:he(Oe([[9.4,2.4],[12,5],[14.6,2.4]],2.6),Oe([[9.4,21.6],[12,19],[14.6,21.6]],2.6),Oe([[2.4,9.4],[5,12],[2.4,14.6]],2.6),Oe([[21.6,9.4],[19,12],[21.6,14.6]],2.6),Le(9.7,9.3,2.2),Le(14.3,9.3,2.2),Pc(9.7,16,3),Pc(14.3,16,3))},{key:"security",label:"Security / bag check",group:"facilities",path:"M12 2.5 19.5 5.5v6c0 4.6-3.2 8.4-7.5 10-4.3-1.6-7.5-5.4-7.5-10v-6Z M8.5 12l2.5 2.5 4.5-5",solid:he(Ip,Te(Fe([[7.4,12.2],[9,10.6],[10.9,12.5],[15,8.4],[16.6,10],[10.9,15.7]])))},{key:"lockers",label:"Lockers",group:"facilities",path:[bt(3.5,2.5,17,19,1.5),"M12 2.5v19 M6 6h3 M15 6h3 M9.5 11.5v2.5 M14.5 11.5v2.5"].join(" "),solid:he(de(3,2,8.4,20,1.4),Te(de(5,5,4.4,1.7,.8)),Te(de(8.6,10.8,1.5,3.8,.7)),de(12.6,2,8.4,20,1.4),Te(de(14.6,5,4.4,1.7,.8)),Te(de(13.9,10.8,1.5,3.8,.7)))},{key:"baby-change",label:"Baby change",group:"facilities",path:"M10 6.5l.8-3.3a1.2 1.2 0 0 1 2.4 0l.8 3.3 M8.5 6.5h7 M9.5 6.5l-.9 2.2a3 3 0 0 0-.1.9V19a2.5 2.5 0 0 0 2.5 2.5h2a2.5 2.5 0 0 0 2.5-2.5V9.6a3 3 0 0 0-.1-.9l-.9-2.2 M8.5 12.5h3 M8.5 16h3",solid:he(Fe([[9.6,6.2],[10.6,1.8],[13.4,1.8],[14.4,6.2]]),de(7.6,5.4,8.8,2.6,1),de(7.8,7.4,8.4,15,2.6),Te(de(7.8,11.8,3.4,1.5,0)),Te(de(7.8,15.4,3.4,1.5,0)))},{key:"prayer-room",label:"Prayer room",group:"facilities",path:[to(Ac),"M3 21.5h18"].join(" "),solid:he(bn(Ac),de(2.4,20.2,19.2,2.6,1.3))},{key:"quiet-room",label:"Quiet room",group:"facilities",path:"M4 9h3.5l5-4v14l-5-4H4Z M15.5 9.5l5 5 M20.5 9.5l-5 5",solid:he(Fe([[2.6,8.4],[7.2,8.4],[13,3.6],[13,20.4],[7.2,15.6],[2.6,15.6]]),Ie([15.4,9.2],[20.8,14.8],2.8),Ie([20.8,9.2],[15.4,14.8],2.8))},{key:"wifi",label:"Wi-Fi",group:"facilities",path:[jo(12,19,11.5,218,322),jo(12,19,7.5,218,322),jo(12,19,3.5,218,322),"M12 19h.01"].join(" "),solid:he(ct(12,19.2,11,218,322,2.8),ct(12,19.2,6.9,218,322,2.8),Le(12,19.2,2.2))},{key:"vip-lounge",label:"VIP lounge",group:"facilities",path:["M6.5 11V7a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v4","M3.5 11.5a1.5 1.5 0 0 1 3 0V14h11v-2.5a1.5 1.5 0 0 1 3 0v6h-17Z","M5.5 17.5V20 M18.5 17.5V20"].join(" "),solid:he(de(6,4,12,8.5,2.2),de(2.4,9.6,4.6,9,2.2),de(17,9.6,4.6,9,2.2),de(6,13.2,12,5.4,.6),Ie([5,18],[5,20.6],2.4),Ie([19,18],[19,20.6],2.4))},{key:"accessible-entrance",label:"Accessible entrance",group:"accessibility",path:[to(pn(Zt,.3,5,.62)),"M12.5 3.5H20a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1h-7.5"].join(" "),solid:he(bn(pn(Zt,.3,5,.62),2.2),Oe([[13,2.8],[21.2,2.8],[21.2,21.2],[13,21.2]],2.6))},{key:"assistance-dog",label:"Assistance-dog area",group:"accessibility",path:[Uo(Ep)+"Z","M6 10.8 3.5 7.5","M10.5 10.5V6h4.5l1 2.5"].join(" "),solid:he(Fe(Rp),Ie([6.2,11],[3.2,7.2],2.4),Oe([[10.5,11],[10.5,5.6],[15.2,5.6],[16.2,8.2]],2.2))}],Nv=new Map(Mi.map(e=>[e.key,e]));var Ec=Mi;var Cp=new Map(Ec.map(e=>[e.key,e]));function no(e){return e?Cp.get(e):void 0}var Hv=Ec.map(e=>e.key);function oo(e){if(e.length<3)return e.map(i=>({...i}));let t=[...e].sort((i,a)=>i.x-a.x||i.y-a.y),n=(i,a,s)=>(a.x-i.x)*(s.y-i.y)-(a.y-i.y)*(s.x-i.x),o=i=>{let a=[];for(let s of i){for(;a.length>=2&&n(a[a.length-2],a[a.length-1],s)<=0;)a.pop();a.push(s)}return a.pop(),a},r=[...o(t),...o([...t].reverse())];return r.length>=3?r.map(i=>({...i})):t.map(i=>({...i}))}var Kc=dt(require("polygon-clipping"),1);var ae={top:1,wallBottom:.58,bottomCap:.4};function qt(e,t){if(!e)return t;let n=ce(at(e,.4),.62);return ge(t,n,.22)}function Cc(e,t){return e?ge(t,ce(at(e,.25),.74),.62):t}var _p=.5,Rc=e=>.2126*e[0]+.7152*e[1]+.0722*e[2];function _c(e,t){if(!e)return t;let n=ge(t,ce(at(e,.08),.9),.82),o=Rc(Ao(e))*_p,r=Rc(n);return r>o&&r>0?ce(n,o/r):n}function Tc(e,t){let n=new Map;for(let i of e.categories??[])n.set(i.key,i.color);let o=new Map;for(let i of t){if(!i.sectionId)continue;let a=o.get(i.sectionId);a||(a=new Map,o.set(i.sectionId,a)),a.set(i.categoryKey,(a.get(i.categoryKey)??0)+1)}let r=new Map;for(let[i,a]of o){let s=0,c=0,l=0,u=0;for(let[m,f]of a){let d=be(n.get(m));d&&(s+=d[0]*f,c+=d[1]*f,l+=d[2]*f,u+=f)}u>0&&r.set(i,[s/u,c/u,l/u])}return r}function Lc(e,t){return be(e.color)??t.get(e.logicalSectionId??e.id)??null}var Pi=dt(require("polygon-clipping"),1);var wi=dt(require("polygon-clipping"),1);var Dc=dt(require("earcut"),1);var Tp=.58,kc=.01,tt=St*1.5*et,Lp=.5,kp=.6;function Op(e,t){let n=e.length,o=[];for(let a=0;a<n;a++){let s=e[Math.max(0,a-1)],c=e[Math.min(n-1,a+1)],l=c.x-s.x,u=c.y-s.y,m=Math.hypot(l,u);if(m<1e-9){o.push([0,0]);continue}l/=m,u/=m,o.push([-u,l])}let r=0;for(let a=0;a<n;a++)r+=(e[a].x-t.x)*o[a][0]+(e[a].y-t.y)*o[a][1];return r<0?o.map(([a,s])=>[-a,-s]):o}function Fp(e,t){if(e.length<2||t<=0)return[...e];let n=[...e],o=(a,s)=>{let c=s.x-a.x,l=s.y-a.y,u=Math.hypot(c,l)||1;return{x:c/u,y:l/u}},r=o(n[1],n[0]),i=o(n[n.length-2],n[n.length-1]);return n.unshift({x:n[0].x+r.x*t,y:n[0].y+r.y*t}),n.push({x:n[n.length-1].x+i.x*t,y:n[n.length-1].y+i.y*t}),n}var Oc=Math.PI/12;function Dp(e){if(e.length<3)return[...e];let t=[...e].sort((i,a)=>i.x-a.x||i.y-a.y),n=(i,a,s)=>(a.x-i.x)*(s.y-i.y)-(a.y-i.y)*(s.x-i.x),o=i=>{let a=[];for(let s of i){for(;a.length>=2&&n(a[a.length-2],a[a.length-1],s)<=0;)a.pop();a.push(s)}return a.pop(),a},r=[...o(t),...o([...t].reverse())];return r.length>=3?r:[...e]}function Nc(e,t){if(!e.length||!(t>0))return[];let n=Dp(e),o=(s,c,l,u)=>{let m=l-c;for(;m<0;)m+=Math.PI*2;for(;m>Math.PI*2;)m-=Math.PI*2;let f=Math.max(1,Math.ceil(m/Oc)),d=t/Math.cos(m/f/2);for(let h=0;h<=f;h++){let p=c+m*h/f;u.push({x:s.x+Math.cos(p)*d,y:s.y+Math.sin(p)*d})}};if(n.length<3){let s=0,c=0;for(let d of n)s+=d.x,c+=d.y;s/=n.length||1,c/=n.length||1;let l=0;for(let d of n)l=Math.max(l,Math.hypot(d.x-s,d.y-c));let u=[],m=Math.max(3,Math.ceil(Math.PI*2/Oc)),f=(l+t)/Math.cos(Math.PI/m);for(let d=0;d<m;d++){let h=d/m*Math.PI*2;u.push({x:s+Math.cos(h)*f,y:c+Math.sin(h)*f})}return u}let r=n.length,i=[];for(let s=0;s<r;s++){let c=n[s],l=n[(s+1)%r];i.push(Math.atan2(-(l.x-c.x),l.y-c.y))}let a=[];for(let s=0;s<r;s++)o(n[s],i[(s+r-1)%r],i[s],a);return zc(a)}function Np(e,t,n){if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u<0?u=0:u>1&&(u=1);let m=Math.hypot(t-(i.x+u*s),n-(i.y+u*c));m<o&&(o=m)}return o}function Xo(e){let t=e.map(r=>{let i=0,a=0;for(let l of r.pts)i+=l.x,a+=l.y;let s=r.pts.length||1;i/=s,a/=s;let c=0;for(let l of r.pts){let u=Math.hypot(l.x-i,l.y-a);u>c&&(c=u)}return{cx:i,cy:a,rad:c}}),n=r=>{let i=r.length;return i<=2?[...r]:[r[Math.floor(i*.25)],r[Math.floor(i*.5)],r[Math.floor(i*.75)]]},o=[];for(let r=0;r<e.length;r++){let i=n(e[r].pts),a=[],s=1/0,c=null;for(let u of i){let m=1/0;for(let f=0;f<e.length;f++){if(f===r||Math.abs(e[f].y-e[r].y)<.001)continue;let d=t[f],h=Math.hypot(u.x-d.cx,u.y-d.cy)-d.rad;if(h>=m&&h>=s)continue;let p=Np(e[f].pts,u.x,u.y);p<m&&(m=p),e[f].depth<e[r].depth&&p<s&&(s=p,c=e[f].y)}Number.isFinite(m)&&m>0&&a.push(m)}a.sort((u,m)=>u-m);let l=a.length?a[Math.floor(a.length/2)]:1;o.push({pitch:l,belowY:c})}return o}function Bc(e,t,n,o){let r=e[t],i=r.pts.length>=2?[...r.pts]:r.pts.length===1?(()=>{let u=r.pts[0],m=u.x-o.x,f=u.y-o.y,d=Math.hypot(m,f)||1;m/=d,f/=d;let h=Math.max(n[t].pitch,.001)*.5;return[{x:u.x+f*h,y:u.y-m*h},{x:u.x-f*h,y:u.y+m*h}]})():[];if(i.length<2)return null;let a=0,s=0;for(let u=1;u<i.length;u++){let m=Math.hypot(i[u].x-i[u-1].x,i[u].y-i[u-1].y);m>1e-6&&(a+=m,s++)}let c=s>0?a/s:0,l=Fp(i,Math.max(c*kp,tt));return{pts:l,nrm:Op(l,o),front:Math.max(n[t].pitch*Tp,tt),back:Math.max(n[t].pitch*Lp,tt)}}var xn=1.5,Vc=.3;function vi(e,t){if(e.length<3)return e;let n=e[0],o=e[e.length-1],r=o.x-n.x,i=o.y-n.y,a=Math.hypot(r,i),s=-1,c=-1;for(let m=1;m<e.length-1;m++){let f=e[m],d=a>1e-12?Math.abs((f.x-n.x)*i-(f.y-n.y)*r)/a:Math.hypot(f.x-n.x,f.y-n.y);d>s&&(s=d,c=m)}if(s<=t||c<0)return[n,o];let l=vi(e.slice(0,c+1),t),u=vi(e.slice(c),t);return[...l.slice(0,-1),...u]}function Gc(e,t){if(e.length<4)return e;let n=vi([...e,e[0]],t);return n.pop(),n.length>=3?n:e}function Bp(e){let t=e.map((o,r)=>{let i=e[(r+1)%e.length];return{a:o,b:i,i:r,minX:Math.min(o.x,i.x),maxX:Math.max(o.x,i.x),minY:Math.min(o.y,i.y),maxY:Math.max(o.y,i.y)}}).sort((o,r)=>o.minX-r.minX),n=(o,r,i)=>(r.x-o.x)*(i.y-o.y)-(r.y-o.y)*(i.x-o.x);for(let o=0;o<t.length;o++){let r=t[o];for(let i=o+1;i<t.length&&t[i].minX<=r.maxX;i++){let a=t[i];if(!(Math.abs(r.i-a.i)===1||Math.abs(r.i-a.i)===e.length-1||r.maxY<a.minY||a.maxY<r.minY)&&n(r.a,r.b,a.a)*n(r.a,r.b,a.b)<=0&&n(a.a,a.b,r.a)*n(a.a,a.b,r.b)<=0)return!0}}return!1}function Hc(e,t,n){if(e.length<2)return[];let o=n??Xo(e),r=new Map;for(let a=0;a<e.length;a++){let s=r.get(e[a].blockId);s?s.push(a):r.set(e[a].blockId,[a])}let i=[];for(let[,a]of r){let s=[];for(let M of a){let v=e[M].patch;v&&v.length>=3?i.push({outline:[...v],holes:[],topY:e[M].y}):s.push(M)}if(!s.length)continue;s.sort((M,v)=>e[M].depth-e[v].depth);let l=s.map(M=>Bc(e,M,o,t)).filter(M=>M!==null);if(!l.length)continue;let u=(M,v)=>({x:M.pts[v].x-M.nrm[v][0]*(M.front+xn),y:M.pts[v].y-M.nrm[v][1]*(M.front+xn)}),m=(M,v)=>({x:M.pts[v].x+M.nrm[v][0]*(M.back+xn),y:M.pts[v].y+M.nrm[v][1]*(M.back+xn)}),f=l[0],d=l[l.length-1],h=[];for(let M=0;M<f.pts.length;M++)h.push(u(f,M));for(let M of l)h.push(m(M,M.pts.length-1));for(let M=d.pts.length-1;M>=0;M--)h.push(m(d,M));for(let M=l.length-1;M>=0;M--)h.push(u(l[M],0));let p=zc(h),b=1/0;for(let M of s)e[M].y<b&&(b=e[M].y);if(!Number.isFinite(b))continue;if(p.length>=3&&Math.abs($e(p))>1e-6&&l.every(M=>{let v=M.pts[Math.floor(M.pts.length/2)];return Ze(p,v.x,v.y)})&&!Bp(p)){i.push({outline:Gc(p,Vc),holes:[],topY:b});continue}for(let M of Vp(l))i.push({outline:M,holes:[],topY:b})}return i}function Vp(e){let t=[];for(let n of e){let o=[],r=[],i=n.front+xn,a=n.back+xn;for(let c=0;c<n.pts.length;c++){let l=n.pts[c],u=n.nrm[c];o.push([l.x-u[0]*i,l.y-u[1]*i]),r.push([l.x+u[0]*a,l.y+u[1]*a])}let s=[...o,...r.reverse()];s.length<3||(s.push(s[0]),t.push([s]))}if(!t.length)return[];try{let n=wi.default.union(t[0],...t.slice(1)),o=[];for(let r of n){if(!r.length||r[0].length<4)continue;let i=r[0].map(([c,l])=>({x:c,y:l})),a=i[0],s=i[i.length-1];i.length>1&&Math.abs(a.x-s.x)<1e-9&&Math.abs(a.y-s.y)<1e-9&&i.pop(),i.length>=3&&o.push(Gc(i,Vc))}return o}catch{return[]}}function zc(e){let t=[];for(let n of e){let o=t[t.length-1];o&&Math.hypot(n.x-o.x,n.y-o.y)<1e-9||t.push(n)}for(;t.length>2&&Math.hypot(t[0].x-t[t.length-1].x,t[0].y-t[t.length-1].y)<1e-9;)t.pop();return t}var Si=class{constructor(t){this.minX=1/0;this.minY=1/0;this.maxX=-1/0;this.maxY=-1/0;this.rings=t;for(let n of t)for(let o of n)o.x<this.minX&&(this.minX=o.x),o.y<this.minY&&(this.minY=o.y),o.x>this.maxX&&(this.maxX=o.x),o.y>this.maxY&&(this.maxY=o.y)}containsAll(t){for(let n of t)if(n.x<this.minX||n.x>this.maxX||n.y<this.minY||n.y>this.maxY)return!1;for(let n of this.rings){let o=!0;for(let r of t)if(!Ze(n,r.x,r.y)){o=!1;break}if(o)return!0}return!1}};function Fc(e,t,n,o,r,i){if(o.length<3)return;if(n.containsAll(o)){let l=[0,1,0],u=o[0];for(let m=1;m+1<o.length;m++){let f=o[m],d=o[m+1];e.tri([u.x*C,r,u.y*C],[f.x*C,r,f.y*C],[d.x*C,r,d.y*C],l,i)}return}let a=o.map(l=>[l.x,l.y]);a.push(a[0]);let s;try{s=wi.default.intersection([a],t)}catch{return}let c=[0,1,0];for(let l of s){if(!l.length||l[0].length<4)continue;let u=l[0],m=[],f=[];for(let h=0;h<u.length-1;h++)m.push(u[h][0],u[h][1]),f.push([u[h][0],u[h][1]]);if(f.length<3)continue;let d=(0,Dc.default)(m,void 0,2);for(let h=0;h<d.length;h+=3){let p=f[d[h]],b=f[d[h+1]],y=f[d[h+2]];e.tri([p[0]*C,r,p[1]*C],[b[0]*C,r,b[1]*C],[y[0]*C,r,y[1]*C],c,i)}}}function jc(e,t,n,o,r,i,a){if(t.length<2)return;let s=a??Xo(t),c=[0,1,0],l=i&&i.length>=3?[[...i.map(d=>[d.x,d.y]),[i[0].x,i[0].y]]]:null,u=i&&i.length>=3?new Si([[...i]]):null,m=d=>{e.setMaterial(2),d(),e.setMaterial(0)},f=d=>{e.setMaterial(3),d(),e.setMaterial(0)};for(let d=0;d<t.length;d++){let h=t[d];if(h.patch&&h.patch.length>=3){let x=[...h.patch],g=s[d].belowY??o;if(f(()=>{if(l&&u)Fc(e,l,u,x,h.y,r.tread);else{let P=x[0];for(let S=1;S+1<x.length;S++){let w=x[S],E=x[S+1];e.tri([P.x*C,h.y,P.y*C],[w.x*C,h.y,w.y*C],[E.x*C,h.y,E.y*C],c,r.tread)}}}),h.y>g+kc){let P=0,S=0;for(let w of x)P+=w.x,S+=w.y;P/=x.length,S/=x.length,m(()=>{for(let w=0;w<x.length;w++){let E=x[w],T=x[(w+1)%x.length],F=T.x-E.x,R=T.y-E.y,I=Math.hypot(F,R);if(I<1e-6)continue;let _=R/I,k=-F/I;(E.x-P)*_+(E.y-S)*k<0&&(_=-_,k=-k);let V=[_,0,k],O=[E.x*C,h.y,E.y*C],H=[T.x*C,h.y,T.y*C],U=[E.x*C,g,E.y*C],N=[T.x*C,g,T.y*C];e.tri(O,H,N,V,r.riser),e.tri(O,N,U,V,r.riser)}})}continue}let p=Bc(t,d,s,n);if(!p)continue;let{pts:b,nrm:y,front:M,back:v}=p,A=s[d].belowY??o;for(let x=0;x+1<b.length;x++){let g=b[x],P=b[x+1],S=y[x],w=y[x+1];if(Math.hypot(P.x-g.x,P.y-g.y)<1e-6||S[0]===0&&S[1]===0||w[0]===0&&w[1]===0)continue;let E=[(g.x-S[0]*M)*C,h.y,(g.y-S[1]*M)*C],T=[(P.x-w[0]*M)*C,h.y,(P.y-w[1]*M)*C],F=[(g.x+S[0]*v)*C,h.y,(g.y+S[1]*v)*C],R=[(P.x+w[0]*v)*C,h.y,(P.y+w[1]*v)*C];if(f(()=>{l&&u?Fc(e,l,u,[{x:g.x-S[0]*M,y:g.y-S[1]*M},{x:P.x-w[0]*M,y:P.y-w[1]*M},{x:P.x+w[0]*v,y:P.y+w[1]*v},{x:g.x+S[0]*v,y:g.y+S[1]*v}],h.y,r.tread):(e.tri(E,T,R,c,r.tread),e.tri(E,R,F,c,r.tread))}),h.y>A+kc){let I=[E[0],A,E[2]],_=[T[0],A,T[2]],k=[-S[0],0,-S[1]];m(()=>{e.tri(E,T,_,k,r.riser),e.tri(E,_,I,k,r.riser)})}}}}function Gp(e,t){let n=e.eventConfigurationIds;return!n?.length||!!t&&n.includes(t)}function Uc(e,t){return e.filter(n=>n.type!=="shape"||Gp(n,t))}function Wc(e,t){let n=e.focalPoint??{x:0,y:0};return e.floors?.length?e.floors.map((o,r)=>({objects:Uc(o.objects,t),focal:{x:(o.focalPoint??n).x,y:(o.focalPoint??n).y},baseHeightM:o.baseHeightM??0,index:r})):[{objects:Uc(e.objects,t),focal:n,baseHeightM:0,index:0}]}var Hp={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};function Pt(e){return mc(e)??Hp}function Xc(e,t){let n=st(e.outline,tt),o=Pt(n),r=t.filter(a=>a!==e&&a.outline&&a.outline.length>=3&&hn(o,Pt(a.outline)));if(!r.length)return[n];let i=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s};try{let a=Pi.default.difference([i(n)],...r.map(c=>[i(c.outline)])),s=[];for(let c of a){if(!c.length)continue;let l=c[0].map(([u,m])=>({x:u,y:m}));if(l.length>1){let u=l[0],m=l[l.length-1];Math.abs(u.x-m.x)<1e-9&&Math.abs(u.y-m.y)<1e-9&&l.pop()}l.length>=3&&s.push(l)}return s.length?s:[n]}catch{return[n]}}function Yc(e,t){if(!t.length)return e;let n=i=>{let a=i.map(s=>[s.x,s.y]);return a.push(a[0]),a},o=t.map(i=>[n(i)]),r=[];for(let i of e){let a;try{a=Pi.default.intersection([n(i.outline)],o.flat())}catch{r.push(i);continue}for(let s of a){if(!s.length)continue;let c=s[0].map(([l,u])=>({x:l,y:u}));if(c.length>1){let l=c[0],u=c[c.length-1];Math.abs(l.x-u.x)<1e-9&&Math.abs(l.y-u.y)<1e-9&&c.pop()}c.length>=3&&r.push({outline:c,holes:[],topY:i.topY})}}return r.length?r:e}function zp(e,t){return e===void 0||t===void 0?!0:Math.abs(e-t)<.001}var Yo=class{constructor(){this.rings=[];this.boxes=[];this.levels=[]}subtract(t,n){let o=t.map(c=>[c.x,c.y]);if(o.length<3)return[];o.push(o[0]);let r=Pt(t),i=this.rings.filter((c,l)=>hn(r,this.boxes[l])&&zp(n,this.levels[l])),a=[[o]];if(i.length)try{a=Kc.default.difference([o],...i).map(l=>l.map(u=>u.map(([m,f])=>[m,f])))}catch{a=[[o]]}this.rings.push([o]),this.boxes.push(r),this.levels.push(n);let s=[];for(let c of a){if(!c.length)continue;let l=c[0].map(([u,m])=>({x:u,y:m}));if(l.length>1){let u=l[0],m=l[l.length-1];Math.abs(u.x-m.x)<1e-9&&Math.abs(u.y-m.y)<1e-9&&l.pop()}l.length>=3&&s.push(l)}return s}};function Mn(e,t,n=e){if(!t)return e;let o=1/0,r=-1/0,i=1/0,a=-1/0;for(let f of n)o=Math.min(o,f.x),r=Math.max(r,f.x),i=Math.min(i,f.y),a=Math.max(a,f.y);let s=(o+r)/2,c=(i+a)/2,l=t*Math.PI/180,u=Math.cos(l),m=Math.sin(l);return e.map(f=>{let d=f.x-s,h=f.y-c;return{x:s+d*u-h*m,y:c+d*m+h*u}})}function $c(e){let t=Hs(e);return!t.length||!e.points?.length?[]:t.map(n=>Mn(n,e.rotation,e.points))}function Me(e){let t=null;if(e.kind==="polygon"&&e.points&&e.points.length>=3)return Mn(Bo(e,4),e.rotation,e.points);if(e.kind==="rect"&&e.width&&e.height&&(t=Kn(e.x??0,e.y??0,e.width,e.height)),e.kind==="ellipse"&&e.width&&e.height){let n=(e.x??0)+e.width/2,o=(e.y??0)+e.height/2;t=Oo(n,o,e.width/2,e.height/2)}return t?Mn(t,e.rotation):null}function lt(e){let t=e.role??"",o=t==="stage"?{kind:"stage",heightM:Ls(e.stageKind)}:{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}}[t]??{kind:"plate",heightM:.25};return{...o,heightM:e.heightM??o.heightM}}var jp=.08,Up=30,Wp=.015;function Xp(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function Zc(e,t){let n=Me(e)??(e.points?.length?Mn(e.points,e.rotation):null),o=lt(e),i=!e.role&&o.kind==="plate"&&e.heightM===void 0&&!!n&&Math.abs($e(n))*fe**2>=Up?Wp:o.heightM;if(!n)return{topOffsetM:i,supportOffsetM:0};if(o.kind!=="plate"&&o.kind!=="stage")return{topOffsetM:i,supportOffsetM:0};let a=1/0,s=1/0,c=-1/0,l=-1/0;for(let d of n)a=Math.min(a,d.x),s=Math.min(s,d.y),c=Math.max(c,d.x),l=Math.max(l,d.y);let u=i,m=0,f=1e-6*Math.max(1,c-a,l-s);for(let d of t)c>d.minX&&a<d.maxX&&l>d.minY&&s<d.maxY&&u<=d.topOffsetM+1e-6&&(u=d.topOffsetM+jp),a>=d.minX-f&&c<=d.maxX+f&&s>=d.minY-f&&l<=d.maxY+f&&(!d.poly||n.every(b=>Xp(b,d.poly)||Yp(b,d.poly,f)))&&(m=Math.max(m,d.topOffsetM));return e.fill&&e.fill!=="none"&&e.fill!=="transparent"&&t.push({minX:a,minY:s,maxX:c,maxY:l,topOffsetM:u,poly:n}),{topOffsetM:u,supportOffsetM:Math.min(m,u)}}function Yp(e,t,n){for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[r],a=t[o],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l?Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l)):0;if(Math.hypot(e.x-(i.x+u*s),e.y-(i.y+u*c))<=n)return!0}return!1}function Lt(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function qe(e){if(e.length!==4)return e;let t=Math.hypot(e[1].x-e[0].x,e[1].y-e[0].y),n=Math.hypot(e[2].x-e[1].x,e[2].y-e[1].y);return t>=n?e:[e[1],e[2],e[3],e[0]]}function je(e,t,n){return[Lt(e[0],e[1],t),Lt(e[0],e[1],n),Lt(e[3],e[2],n),Lt(e[3],e[2],t)]}function ro(e,t,n){return[Lt(e[0],e[3],t),Lt(e[1],e[2],t),Lt(e[1],e[2],n),Lt(e[0],e[3],n)]}function pe(e,t,n,o,r,i,a){ue(e,t,a?.length?a:void 0,()=>n,o,r,i,ae)}var Kp=.8,$p=.6,Zp=2;function kt(e,t){if(!t.length)return null;let n=[],o=0;for(let a of e.objects){if(a.type!=="shape"||a.role!=="wall")continue;let s=Me(a)??[],c=qc(s)/2;!(c>0)||Jp(s)/c*C>Zp||(n.push(...s),o+=c)}if(n.length<3)return null;let r=oo(n);if(r.length<3||o<qc(r)*$p)return null;let i=0;for(let a of t)eb(a,r)&&(i+=1);return i>=t.length*Kp?r:null}var Ko=6,qp=5,Qp=8;function Qc(e){return Math.max(Qp,(Number.isFinite(e)?e:0)+qp)}function vn(e){let t=0,n=0,o=0;for(let r=0;r<e.length;r++){let i=e[r],a=e[(r+1)%e.length],s=i.x*a.y-a.x*i.y;t+=s,n+=(i.x+a.x)*s,o+=(i.y+a.y)*s}if(Math.abs(t)<1e-9){let r=0,i=0;for(let a of e)r+=a.x,i+=a.y;return{x:r/Math.max(1,e.length),y:i/Math.max(1,e.length)}}return{x:n/(3*t),y:o/(3*t)}}function Jp(e){let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return Math.abs(t)/2}function qc(e){let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=Math.hypot(r.x-o.x,r.y-o.y)}return t}function eb(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function tb(e){return{kind:"radial",rowCount:0,rows:[],nearestRow:()=>-1,depthAt:(t,n)=>Math.hypot(t-e.x,n-e.y),gradientAt:(t,n)=>{let o=t-e.x,r=n-e.y,i=Math.hypot(o,r);return i<1e-9?[0,0]:[o/i,r/i]}}}function nb(e,t){if(!e.length)return null;let n=0,o=0,r=0;for(let d of e)n+=d.x,o+=d.y,r+=Math.hypot(d.x-t.x,d.y-t.y);let i=e.length;n/=i,o/=i,r/=i;let a=e[0],s=-1;for(let d of e){let h=Math.hypot(d.x-n,d.y-o);h>s&&(s=h,a=d)}let c=a.x-n,l=a.y-o,u=Math.hypot(c,l);u>1e-9?(c/=u,l/=u):(c=1,l=0);let m=[...e].sort((d,h)=>(d.x-n)*c+(d.y-o)*l-((h.x-n)*c+(h.y-o)*l)),f=0;for(let d of m){let h=Math.hypot(d.x-n,d.y-o);h>f&&(f=h)}return{pts:m,cx:n,cy:o,radius:f,depth:r}}function Jc(e,t,n){let o=e.pts;if(o.length===1)return Math.hypot(t-o[0].x,n-o[0].y);let r=1/0;for(let i=0;i+1<o.length;i++){let a=o[i],s=o[i+1],c=s.x-a.x,l=s.y-a.y,u=c*c+l*l,m=u>1e-12?((t-a.x)*c+(n-a.y)*l)/u:0;m<0?m=0:m>1&&(m=1);let f=Math.hypot(t-(a.x+m*c),n-(a.y+m*l));f<r&&(r=f)}return r}var $o=8;function ob(e,t,n){let o=new Array($o).fill(1/0),r=new Array($o).fill(-1);for(let u=0;u<e.length;u++){let m=e[u],f=Math.hypot(t-m.cx,n-m.cy)-m.radius;for(let d=0;d<$o;d++)if(f<o[d]){for(let h=$o-1;h>d;h--)o[h]=o[h-1],r[h]=r[h-1];o[d]=f,r[d]=u;break}}let i=new Array(3).fill(1/0),a=new Array(3).fill(-1);for(let u of r){if(u<0)continue;let m=Jc(e[u],t,n);for(let f=0;f<3;f++)if(m<i[f]){for(let d=2;d>f;d--)i[d]=i[d-1],a[d]=a[d-1];i[f]=m,a[f]=u;break}}if(a[0]<0)return 0;if(i[0]<1e-6)return e[a[0]].depth;let s=i[0]*2.2,c=0,l=0;for(let u=0;u<3;u++){let m=a[u];if(m<0||i[u]>s)continue;let f=1/(i[u]*i[u]);c+=f*e[m].depth,l+=f}return l>0?c/l:e[a[0]].depth}function rb(e){let t=(o,r)=>ob(e,o,r),n=(o,r)=>{let i=1/0,a=-1;for(let s=0;s<e.length;s++){let c=e[s];if(Math.hypot(o-c.cx,r-c.cy)-c.radius>=i)continue;let l=Jc(c,o,r);l<i&&(i=l,a=s)}return a};return{kind:"rows",rowCount:e.length,rows:e,nearestRow:n,depthAt:t,gradientAt:(o,r)=>{let i=(t(o+.5,r)-t(o-.5,r))/1,a=(t(o,r+.5)-t(o,r-.5))/(2*.5),s=Math.hypot(i,a);return s<1e-9?[0,0]:[i/s,a/s]}}}function el(e,t){let n=[];for(let o of e){let r=nb(o.points,t);r&&n.push(r)}return n.length<2?tb(t):(n.sort((o,r)=>o.depth-r.depth),rb(n))}var Ot=.06,ib=.05,nl=.05,tl=.15,Ai=25;function ol(e,t,n){let o=new Map,r=new Array(t.length).fill(null),i=new Float64Array(t.length),a=new Array(t.length).fill(void 0),s=new Array(t.length).fill(void 0),c=new Map,l=[],u=new Set;for(let f=0;f<e.length;f+=1){let d=e[f];for(let h of d.objects){if(h.type==="table"&&u.add(h.id),h.type!=="section"||!h.outline||h.outline.length<3)continue;let p=st(h.outline,tt);c.set(h.id,{section:h,unit:d,frontU:1/0,hasSeats:!1,rows:new Map,seatIndices:[]}),l.push({id:h.id,floorIndex:f,box:Pt(p),section:h,unit:d,outline:p})}}let m=new Map;for(let f of l){let d=m.get(f.floorIndex);d?d.push(f):m.set(f.floorIndex,[f])}for(let f=0;f<t.length;f++){let d=t[f],h=n?m.get(n[f])??[]:l,p=d.sectionId?h.find(y=>y.id===d.sectionId)??h.find(y=>y.section.logicalSectionId===d.sectionId&&ze({x:d.x,y:d.y},y.outline,y.section.holes)):void 0,b=p?[p]:h;for(let y of b){if(n&&y.floorIndex!==n[f]||!p&&(d.x<y.box.minX||d.x>y.box.maxX||d.y<y.box.minY||d.y>y.box.maxY||!ze({x:d.x,y:d.y},y.outline,y.section.holes)))continue;r[f]=y.id;let M=c.get(y.id);M.hasSeats=!0;let v=d.focalPoint??y.unit.focal,A=Math.hypot(d.x-v.x,d.y-v.y);A<M.frontU&&(M.frontU=A),M.seatIndices.push(f);let x=d.rowId||`__seat-${f}`,g=M.rows.get(x);g?g.push({x:d.x,y:d.y}):M.rows.set(x,[{x:d.x,y:d.y}]);break}}for(let[f,d]of c){let h=Ct(d.section,{floorBaseHeightM:d.unit.baseHeightM}),p=d.unit.baseHeightM,b=h.rake>0?Math.tan(h.rake*Math.PI/180):0,y=h.rake<=.01&&h.height<=p+.001,M=d.section.surfaceKind,v=M==="flat"?!0:M==="rakedRows"&&h.rake>.01?!1:y,A=d.hasSeats?Vo(f,t,d.seatIndices,d.unit.focal):{sectionId:f,rows:[],blockCount:0},g=A.rows.length<2?el([...d.rows.values()].map(O=>({points:O})),d.unit.focal):null,P=1/0;if(g){if(d.hasSeats)for(let O of d.rows.values())for(let H of O){let U=g.depthAt(H.x,H.y);U<P&&(P=U)}if(!d.hasSeats||!Number.isFinite(P)){P=1/0;for(let O of d.section.outline){let H=g.depthAt(O.x,O.y);H<P&&(P=H)}}}let S=p+ib,w=Math.max(S,h.height),E=O=>{let H=Math.max(0,O-P)*fe,U=Math.min(H*b,Ai);return Math.max(S,h.height+U)},T=O=>{let H=Math.max(0,O)*fe,U=Math.min(H*b,Ai);return Math.max(S,h.height+U)},F=v?[]:A.rows.map(O=>({pts:O.pts,y:T(O.blockDepth),depth:O.blockDepth,blockId:O.blockId,...u.has(O.id)?{patch:Nc(O.pts,tt)}:{}})),R=F.length?F[0].y:w,I=F.map(O=>{let H=O.patch&&O.patch.length>=3?O.patch:O.pts,U=0,N=0;for(let D of H)U+=D.x,N+=D.y;let L=H.length||1;U/=L,N/=L;let B=0;for(let D of H){let G=Math.hypot(D.x-U,D.y-N);G>B&&(B=G)}return{cx:U,cy:N,rad:B}}),_=v?()=>w:F.length>=2?(O,H)=>{let U=1/0,N=R;for(let L=0;L<F.length;L++){let B=I[L];if(Math.hypot(O-B.cx,H-B.cy)-B.rad>=U)continue;let D=F[L].patch,G=D&&D.length>=3?Ze(D,O,H)?0:mn(D,O,H):mn(F[L].pts,O,H);G<U&&(U=G,N=F[L].y)}return N}:(O,H)=>g?E(g.depthAt(O,H)):w,k=[0,1,0],V=F.length>=2||v?()=>k:(O,H)=>{if(!g)return k;let U=g.depthAt(O,H);if(U<=P)return k;let N=(U-P)*fe;if(N*b>=Ai||h.height+N*b<=S)return k;let[L,B]=g.gradientAt(O,H);if(L===0&&B===0)return k;let D=1/Math.hypot(b,1);return[-L*b*D,D,-B*b*D]};if(!v)for(let O of A.rows){let H=T(O.blockDepth);for(let U of O.seatIndices)a[U]=H}for(let O of A.rows){let H=[];for(let D=1;D<O.pts.length;D++){let G=Math.hypot(O.pts[D].x-O.pts[D-1].x,O.pts[D].y-O.pts[D-1].y);G>1e-6&&H.push(G)}H.sort((D,G)=>D-G);let U=H.length?H[Math.floor(H.length/2)]:1/0,N=1/0,L=O.pts[Math.floor(O.pts.length/2)];if(L)for(let D of A.rows){if(D===O||D.blockId!==O.blockId)continue;let G=mn(D.pts,L.x,L.y);G>1e-6&&G<N&&(N=G)}let B=Math.min(U,Math.max(N,U*.5));if(Number.isFinite(B)&&B>0)for(let D of O.seatIndices)s[D]=B}o.set(f,{sectionId:f,deckAt:_,normalAt:V,flat:v,bottomY:p,rowLevels:F,landingY:R})}for(let f=0;f<t.length;f++){let d=r[f],h=t[f];if(d){let y=a[f];i[f]=(y??o.get(d).deckAt(h.x,h.y))+tl;continue}let p=h.eyeHeightM,b=Number.isFinite(p)?Math.max(0,p-ht):0;i[f]=h.kind==="booth"?b+Ot+tl:b}return{bySection:o,seatOwner:r,seatDeckY:f=>i[f],seatPitchU:f=>s[f]}}function Sn(e,t,n){if(e.length!==4||n<=t)return null;let o=qe(e),r=Math.hypot(o[1].x-o[0].x,o[1].y-o[0].y)*C,i=Math.hypot(o[3].x-o[0].x,o[3].y-o[0].y)*C;if(r<1e-6||i<1e-6)return null;let a=Math.min(.22/r,.16),s=Math.min(.28,(n-t)*.13),c=Math.min(.065/i,.2);return{quad:o,side:a,face:c,opening:je(o,a,1-a),openingTop:n-s}}function Ii(e,t,n){if(e.length!==4||n-t<=.2)return null;let o=qe(e),r=Math.hypot(o[1].x-o[0].x,o[1].y-o[0].y)*C;if(r<=1e-6)return null;let i=Math.min(.14,(n-t)*.08,r*.08),a=i/r,s=je(o,a,1-a);return{quad:o,side:a,trim:i,inner:s,panel:ro(s,.15,.85),bottom:t+i,top:n-i}}function rl(e,t,n,o){let r=Ii(e,t,n);if(!r)return;let{panel:i}=r,a=(M,v)=>({x:(M.x+v.x)/2,y:(M.y+v.y)/2}),s=a(i[0],i[1]),c=a(i[3],i[2]),l=Math.hypot(s.x-o.x,s.y-o.y)<=Math.hypot(c.x-o.x,c.y-o.y),[u,m]=l?[i[0],i[1]]:[i[3],i[2]],f=l?{x:s.x-c.x,y:s.y-c.y}:{x:c.x-s.x,y:c.y-s.y},d=Math.hypot(f.x,f.y);if(d<1e-6)return;-(m.y-u.y)*f.x+(m.x-u.x)*f.y<0&&([u,m]=[m,u]);let h=Math.min(.006,d*C*.05),p=f.x/d*h,b=f.y/d*h,y=(M,v)=>[M.x*C+p,v,M.y*C+b];return[y(u,r.bottom),y(m,r.bottom),y(u,r.top),y(m,r.top)]}var al=dt(require("polygon-clipping"),1);var il=dt(require("polygon-clipping"),1);function At(e,t,n,o,r,i,a,s={}){let c=Pt(t),l=s.ao??ae,u=r.flatMap(p=>{if(p.role!=="entrance"&&p.role!=="exit")return[];let b=Me(p);if(!b||b.length!==4||!hn(c,Pt(b)))return[];let y=s.portalBase??n,M=Sn(b,y,y+lt(p).heightM);if(!M)return[];let v=Math.min(o,M.openingTop);return v<=n?[]:[{poly:M.opening,height:v}]});if(!u.length)return!1;let m=p=>p.map(b=>[b.x,b.y]),f=[m(t),...(s.holes??[]).map(m)],d=[n,...new Set(u.map(p=>p.height)),o].sort((p,b)=>p-b),h=[];try{for(let p=1;p<d.length;p++){let b=d[p-1],y=d[p];if(y-b<1e-6)continue;let M=u.filter(A=>A.height>b+1e-6).map(A=>[m(A.poly)]),v=M.length?il.default.difference(f,...M):[f];h.push({low:b,high:y,polys:v})}}catch{return!1}for(let p of h)for(let b of p.polys){let[y,...M]=b.map(A=>A.map(([x,g])=>({x,y:g}))),v=A=>l.wallBottom+(l.top-l.wallBottom)*(A-n)/(o-n);ue(e,y,M,()=>p.high,p.low,i,a,{...l,top:v(p.high),wallBottom:v(p.low)})}return!0}var Ei={depthM:1.6,thicknessM:.35,minWallM:6};function Zo(e,t,n,o,r,i,a,s,c){let l=o-n;if(l<=0)return;let u=s&&(c??l)>=Ei.minWallM?ab(t,s):null,m=u?o-Ei.thicknessM:o,f=m-n,d=f<1.5?[[n,m,1]]:u?[[n,n+Math.min(.9,f*.18),.82],[n+Math.min(.9,f*.18),m,1]]:[[n,n+Math.min(.9,f*.18),.82],[n+Math.min(.9,f*.18),m-.1,1],[m-.1,m,1.1]],h=p=>ae.wallBottom+(ae.top-ae.wallBottom)*(p-n)/l;for(let[p,b,y]of d){let M={...ae,top:h(b),wallBottom:h(p)},v=ce(i,y),A=ce(a,y);At(e,t,p,b,r,v,A,{portalBase:n,ao:M})||ue(e,t,void 0,()=>b,p,v,A,M)}for(let[p,...b]of u??[])ue(e,p,b.length?b:void 0,()=>o,m,ce(i,1.12),ce(a,.78),ae)}function ab(e,t){let n=Ei.depthM/C,o=e.map(a=>{let s=t.x-a.x,c=t.y-a.y,l=Math.hypot(s,c)||1;return{x:a.x+s/l*n,y:a.y+c/l*n}}),r=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s},i=[[r(e)],[r(o)]];for(let a=0;a<e.length;a++){let s=(a+1)%e.length;i.push([r([e[a],e[s],o[s],o[a]])])}try{let[a,...s]=i,c=al.default.union(a,...s);return c.length?c.map(l=>l.map(u=>u.slice(0,-1).map(([m,f])=>({x:m,y:f})))):null}catch{return null}}function sl(e){return e.route?.stepFree===!0&&(e.kind==="line"||e.kind==="polyline")}function cl(e){let t=Number.isFinite(e)&&e>0?e:4;return[Math.max(6,t*2.6),Math.max(4,t*1.7)]}function ll(e,t,n){let o=[];if(e.length<2||!(t>0)||!(n>=0))return o;let r=!0,i=t;for(let a=0;a<e.length-1;a+=1){let s=e[a],c=e[a+1],l=Math.hypot(c.x-s.x,c.y-s.y);if(l<1e-9)continue;let u=(c.x-s.x)/l,m=(c.y-s.y)/l,f=0;for(;f<l-1e-9;){let d=Math.min(i,l-f);r&&o.push([{x:s.x+u*f,y:s.y+m*f},{x:s.x+u*(f+d),y:s.y+m*(f+d)}]),f+=d,i-=d,i<=1e-9&&(r=!r,i=r?t:n)}}return o}function io(e,t,n){let o=be(t.stroke?.color),r=t.stroke?.width??0;if(!o||!Number.isFinite(r)||r<=0)return;let i=t.kind==="line"||t.kind==="polyline",a=i?Mn(t.points??[],t.rotation):Me(t);if(!a||a.length<2)return;let s=r*.5,c=sl(t)?ll(a,...cl(r)):Array.from({length:i?a.length-1:a.length},(l,u)=>[a[u],a[(u+1)%a.length]]);for(let[l,u]of c){let m=Math.hypot(u.x-l.x,u.y-l.y);if(m<1e-6)continue;let f=-(u.y-l.y)/m*s,d=(u.x-l.x)/m*s,h=[(l.x+f)*C,n,(l.y+d)*C],p=[(u.x+f)*C,n,(u.y+d)*C],b=[(u.x-f)*C,n,(u.y-d)*C],y=[(l.x-f)*C,n,(l.y-d)*C];e.tri(h,p,b,[0,1,0],o),e.tri(h,b,y,[0,1,0],o)}}function ul(e){return e==="bar"||e==="concession"||e==="coat"||e==="restroom"}var wn=(e,t,n)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n});function qo(e,t,n,o){let[r,i,a,s]=t?e:[e[3],e[2],e[1],e[0]];return[wn(r,s,n),wn(i,a,n),wn(i,a,o),wn(r,s,o)]}function ml(e,t,n,o,r,i,a,s,c=!1){if(n.length!==4||r-o<.4)return!1;let l=S=>c?Math.min(S,r):S,u=qe(n),m=Math.hypot(u[3].x-u[0].x,u[3].y-u[0].y)*C;if(m<.4)return!1;let f=wn(u[0],u[1],.5),d=wn(u[3],u[2],.5),h=Math.hypot(f.x-s.x,f.y-s.y)<=Math.hypot(d.x-s.x,d.y-s.y),p=ge(a,[.92,.9,.86],.35),b=ce(i,.72),y=r-o;if(t==="restroom"){let S=Math.min(.18,y*.08);return pe(e,u,r-S,o,a,i),pe(e,u,r,r-S,p,p),!0}let M=o+Math.min(1.1,y),v=t==="coat"?1:Math.min(.5,.75/m),A=qo(u,h,0,v);if(pe(e,A,M-.05,o,b,i),pe(e,A,M,M-.05,p,p),t==="coat"||m<1.2)return!0;if(t==="bar"){let S=qo(u,h,Math.max(v+.2,1-.45/m),1),w=l(o+Math.max(Math.min(2.2,y*2),M-o+.6));return pe(e,S,w,o,a,b),!0}let x=qo(u,h,Math.max(v+.25,.55),1),g=l(o+Math.max(2.6,M-o+1.4));if(g-.14<=M)return!0;pe(e,x,g-.14,o,a,i),pe(e,u,g,g-.14,p,b);let P=Math.min(.08,.1/Math.max(.1,Math.hypot(u[1].x-u[0].x,u[1].y-u[0].y)*C));for(let[S,w]of[[0,P],[1-P,1]])pe(e,qo(je(u,S,w),h,0,Math.min(.08,.1/m)),g-.14,M,b,b);return!0}var sb=[.12,.38,.16],cb=[.72,.62,.45],lb=[.88,.93,.96],fl=[.95,.95,.94],ub=[.66,.29,.22],Ri={length:20.12,width:3.05},mb=.14,fb=9.76,It=[.93,.94,.95],Qo=[.1,.11,.13],db=[.45,.85,1.25],hb=1.45,dl=.012,hl=.004,pb=1.07,bb=.15;function An(e,t,n,o,r,i){e.setMaterial(i),ue(e,t,n?[n.slice().reverse()]:void 0,()=>o,o-.004,r,r,ae)}var pl=(e,t)=>_t(e,t/C);function bl(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<1e-9)return null;let a=-r/i*n,s=o/i*n;return[{x:e.x+a,y:e.y+s},{x:t.x+a,y:t.y+s},{x:t.x-a,y:t.y-s},{x:e.x-a,y:e.y-s}]}function yb(e,t,n,o){let r=t.map(i=>[i.x*C,n,i.y*C]);e.tri(r[0],r[1],r[2],[0,1,0],o),e.tri(r[0],r[2],r[3],[0,1,0],o)}function Jo(e,t,n,o,r,i){let a=n/C,s=[{x:t.x-a,y:t.y-a},{x:t.x+a,y:t.y-a},{x:t.x+a,y:t.y+a},{x:t.x-a,y:t.y+a}];ue(e,s,void 0,()=>r,o,i,ce(i,.85),ae)}function Pn(e,t,n,o,r,i,a){let s=bl(t,n,o/C);s&&ue(e,s,void 0,()=>i,r,a,ce(a,.85),ae)}function er(e){let t=qe(e),n={x:(t[0].x+t[2].x)/2,y:(t[0].y+t[2].y)/2},o=Math.hypot(t[1].x-t[0].x,t[1].y-t[0].y)||1,r=Math.hypot(t[3].x-t[0].x,t[3].y-t[0].y)||1,i={x:(t[1].x-t[0].x)/o,y:(t[1].y-t[0].y)/o},a={x:(t[3].x-t[0].x)/r,y:(t[3].y-t[0].y)/r};return{at:(c,l)=>({x:n.x+(i.x*c+a.x*l)/C,y:n.y+(i.y*c+a.y*l)/C}),lengthM:o*C,widthM:r*C}}function yl(e,t,n){let o=ks(t);if(!o.length)return;let r=1/0,i=-1/0,a=1/0,s=-1/0;for(let v of t.points??[])r=Math.min(r,v.x),i=Math.max(i,v.x),a=Math.min(a,v.y),s=Math.max(s,v.y);let c=(t.rotation??0)*Math.PI/180,l=Math.cos(c),u=Math.sin(c),m=(r+i)/2,f=(a+s)/2,d=v=>c?{x:m+(v.x-m)*l-(v.y-f)*u,y:f+(v.x-m)*u+(v.y-f)*l}:v,h=Math.min(i-r,s-a)*C,p=Math.max(.04,Math.min(.3,h*.004))/C,b=0;e.setMaterial(0);for(let v of o){if(!v.fill)continue;let A=v.points.map(d);An(e,A,null,n+dl+b*hl,be(v.fill)??It,0),b++}let y=o.filter(v=>!(v.fill&&v.ink===v.fill)),M=[...new Set(y.map(v=>v.ink??Do))];for(let v of M){let A=n+dl+b++*hl,x=be(v)??It;for(let g of y){if((g.ink??Do)!==v)continue;let P=g.points.map(d),S=g.closed?P.length:P.length-1;for(let w=0;w<S;w++){let E=bl(P[w],P[(w+1)%P.length],p);E&&yb(e,E,A,x)}}}}function gl(e,t,n,o,r){if(t.length<3)return!1;let i=o+.006,a=r??sb;if(n==="oval-cricket"){let s=t.reduce((x,g)=>x+g.x,0)/t.length,c=t.reduce((x,g)=>x+g.y,0)/t.length,l=x=>t.map(g=>({x:s+(g.x-s)*x,y:c+(g.y-c)*x})),u=8;for(let x=0;x<u;x++){let g=l(1-x/u),P=x===u-1?null:l(1-(x+1)/u);An(e,g,P,i,ce(a,x%2?1.04:.96),4)}let m=t[0];for(let x of t)Math.hypot(x.x-s,x.y-c)>Math.hypot(m.x-s,m.y-c)&&(m=x);let f=Math.hypot(m.x-s,m.y-c)||1,d=(m.x-s)/f,h=(m.y-c)/f,p=-h,b=d,y=Math.min(1,2*f*C*mb/Ri.length),M=Ri.length*y/2/C,v=Ri.width*y/2/C,A=[[-M,-v],[M,-v],[M,v],[-M,v]].map(([x,g])=>({x:s+d*x+p*g,y:c+h*x+b*g}));return An(e,A,null,i+.004,cb,0),e.setMaterial(0),!0}if(n==="rink-hockey"){let s=pl(t,bb);return An(e,s,null,i,lb,0),e.setMaterial(0),ue(e,t,[s.slice().reverse()],()=>o+pb,o,fl,ce(fl,.9),ae),!0}if(n==="ring-boxing"&&t.length===4){let{at:s}=er(t),c=[s(-3.05,-3.05),s(3.05,-3.05),s(3.05,3.05),s(-3.05,3.05)],l=[[.77,.19,.19],It,[.17,.42,.69],It];e.setMaterial(0),c.forEach((u,m)=>Jo(e,u,.07,o,o+hb,l[m]));for(let u of db)for(let m=0;m<4;m++)Pn(e,c[m],c[(m+1)%4],.025,o+u-.025,o+u+.025,It);return!0}if(n==="court-tennis"&&t.length===4){let{at:s}=er(t);e.setMaterial(0),Pn(e,s(0,-6.4),s(0,6.4),.015,o,o+.95,Qo),Pn(e,s(0,-6.4),s(0,6.4),.03,o+.95,o+1,It);for(let c of[-1,1])Jo(e,s(0,c*6.4),.05,o,o+1.07,Qo);return!0}if(n==="court-basketball"&&t.length===4){let{at:s,lengthM:c}=er(t),l=Math.min(14,c/2-.5);e.setMaterial(0);for(let u of[-1,1]){let m=s(u*(l+1.2),0),f=s(u*(l-1.2),0);Jo(e,m,.12,o,o+3.4,Qo),Pn(e,m,f,.06,o+3.25,o+3.4,Qo),Pn(e,s(u*(l-1.2),-.9),s(u*(l-1.2),.9),.03,o+2.9,o+3.95,It)}return!0}if(n==="pitch-rugby"&&t.length===4){let{at:s,lengthM:c}=er(t),l=c*(50/120);e.setMaterial(0);for(let u of[-1,1]){for(let m of[-2.8,2.8])Jo(e,s(u*l,m),.07,o,o+12,It);Pn(e,s(u*l,-2.8),s(u*l,2.8),.06,o+2.94,o+3.06,It)}return!0}if(n==="track-athletics"){let s=pl(t,fb);return s.length<3?!1:(An(e,t,s,i,ub,0),An(e,s,null,i,a,4),e.setMaterial(0),!0)}return!1}var xl=[.19,.4,.15],gb=.012,rr=2.4,xb=1,Mb=.75,vb=.15;function ut(e){if(e.points&&e.points.length>=3)return e.points;let{center:t,width:n,height:o,rotation:r}=e;if(!n||!o)return null;let i=(r??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=n/2,l=o/2;return[[-c,-l],[c,-l],[c,l],[-c,l]].map(([u,m])=>({x:t.x+u*a-m*s,y:t.y+u*s+m*a}))}function Al(e,t,n,o,r,i,a=!1){let s=ut(t);if(s){if(a){let c=qt(o,r.boothTop),l=pt([...s]);ue(e,st(l,Sb/C),[l.slice().reverse()],()=>n+.03,n,c,ce(c,.8),ae);return}if(!(!t.points&&i&&Pb(e,s,n,o,i))){if(!t.points&&i&&s.length===4){wb(e,s,n,o,i);return}ue(e,s,void 0,()=>n+rr,n,qt(o,r.boothTop),r.boothWall,ae)}}}var Ci=1.1,Ml=[.9,.9,.88],Sb=.1,tr=[.87,.87,.85],vl=.08;function Il(e,t){let n=c=>({x:(e[c].x+e[(c+1)%4].x)/2,y:(e[c].y+e[(c+1)%4].y)/2}),o=0,r=1/0;for(let c=0;c<4;c++){let l=n(c),u=Math.hypot(l.x-t.x,l.y-t.y);u<r&&(r=u,o=c)}let i=[0,1,2,3].map(c=>e[(o+c)%4]),a=(c,l,u)=>({x:c.x+(l.x-c.x)*u,y:c.y+(l.y-c.y)*u});return{q:i,part:(c,l,u,m)=>{let f=a(i[0],i[1],c),d=a(i[0],i[1],l),h=a(i[3],i[2],c),p=a(i[3],i[2],l);return[a(f,h,u),a(d,p,u),a(d,p,m),a(f,h,m)]},depthM:Math.hypot(i[3].x-i[0].x,i[3].y-i[0].y)*C,widthM:Math.hypot(i[1].x-i[0].x,i[1].y-i[0].y)*C}}function wb(e,t,n,o,r){let{q:i,part:a}=Il(t,r),s=o??[.35,.42,.55],c=ge(s,[.78,.78,.77],.62),l=ge(s,[.95,.95,.94],.45);pe(e,i,n+Ot,n,c,ce(c,.8)),pe(e,a(.05,.95,.72,.98),n+Ci-.05,n+Ot,l,ce(l,.8)),pe(e,a(.03,.97,.7,1),n+Ci,n+Ci-.05,Ml,ce(Ml,.9))}function Pb(e,t,n,o,r){if(t.length!==4)return!1;let{q:i,part:a,depthM:s,widthM:c}=Il(t,r);if(s<1||c<1)return!1;let l=o??[.35,.42,.55],u=ge(l,[.78,.78,.77],.62),m=n+rr,f=vl/c,d=vl/s;pe(e,i,n+Ot,n,u,ce(u,.8)),pe(e,a(0,1,1-d,1),m,n+Ot,tr,ce(tr,.9));for(let[b,y]of[[0,f],[1-f,1]])pe(e,a(b,y,0,1-d),m,n+Ot,tr,ce(tr,.9));pe(e,a(f,1-f,0,Math.min(.5,.06/s)),m,m-.3,l,ce(l,.85));let h=Math.min(.4,.6/c),p=Math.min(.12,.3/s);return pe(e,a(.5-h,.5+h,.72-p,.72+p),n+xb,n+Ot,ge(l,[.95,.95,.94],.7),ce(l,.75)),!0}function ir(e){if(e.shape==="round"){let u=e.radius;return u?Oo(e.center.x,e.center.y,u,u,24):null}let{width:t,height:n,rotation:o,center:r}=e;if(!t||!n)return null;let i=(o??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=t/2,l=n/2;return[[-c,-l],[c,-l],[c,l],[-c,l]].map(([u,m])=>({x:r.x+u*a-m*s,y:r.y+u*s+m*a}))}function El(e,t,n,o,r,i=!0){let a=ir(t);if(!a)return;let s=a.reduce((f,d)=>f+d.x,0)/a.length,c=a.reduce((f,d)=>f+d.y,0)/a.length,l=f=>a.map(d=>({x:s+(d.x-s)*f,y:c+(d.y-c)*f})),u=i&&o?qt(o,r.tableTop):Ab,m=n+Mb;ue(e,a,void 0,()=>m,n+Ib,u,ce(u,.86),ae),ue(e,l(.12),void 0,()=>m+.12,m,Sl,ce(Sl,.8),ae)}var Ab=[.93,.92,.89],Sl=[.78,.66,.42],Ib=.25,ao={armM:1.1,widthM:.28,insideM:1.4,low:.043,high:.048};function Eb(e,t,n){let o=e.reduce((y,M)=>y+M.x,0)/4,r=e.reduce((y,M)=>y+M.y,0)/4,i=e[3].x-e[0].x,a=e[3].y-e[0].y,s=Math.hypot(i,a)||1;i/=s,a/=s,i*(t.x-o)+a*(t.y-r)<0&&(i=-i,a=-a);let c=-a,l=i,u=ao.armM/C,m=ao.widthM/C,f=s/2+ao.insideM/C,d=n?-1:1,h=o+i*(f+(n?0:u)),p=r+a*(f+(n?0:u)),b=(y,M)=>({x:h+i*y*d+c*M,y:p+a*y*d+l*M});return[b(0,0),b(-u,u),b(-u-m,u),b(-m,0),b(-u-m,-u),b(-u,-u)]}function Rb(e,t,n,o,r){let i=[.94,.95,.96];ue(e,Eb(t,o,r),void 0,()=>n+ao.high,n+ao.low,i,i,ae)}function or(e,t){let n=be(e);return n?{top:ce(at(n,.12),.95),wall:ce(at(n,.12),.85)}:{top:t.tierTop,wall:t.tierWall}}function Rl(e,t,n,o,r,i,a,s,c=[]){let l=Me(t),u=$c(t);if(!t.role&&(!t.fill||t.fill==="none"||t.fill==="transparent")||!l){io(e,t,n+o+gb);return}let f=s?s.kind==="stage":t.role==="stage",d=s?s.kind==="screen":t.role==="screen",h=s?{kind:f?"stage":"solid",heightM:s.topY-s.baseY}:lt(t),p=s?.baseY??n,b=s?.topY??n+o;if(f&&a){let w=1/0,E=-1/0,T=1/0,F=-1/0;for(let R of l)R.x<w&&(w=R.x),R.x>E&&(E=R.x),R.y<T&&(T=R.y),R.y>F&&(F=R.y);a.push({cx:(w+E)/2*C,cz:(T+F)/2*C,y:b,halfX:Math.max((E-w)/2*C,.5),halfZ:Math.max((F-T)/2*C,.5)})}let y=be(t.fill),M=t.role==="wall"||t.role==="entrance"||t.role==="exit",v=M?or(t.fill,r).top:f&&y?ge(r.stageTop,ce(at(y,.18),.9),.9):!t.role&&y?y:qt(y,f?r.stageTop:r.decorTop),A=d?y:null,x=M?or(t.fill,r).wall:f?y?ge(r.stageWall,ce(y,.58),.82):r.stageWall:d?A?ge(ce(A,1.42),[.24,.46,.82],.08):[.24,.46,.82]:qt(be(t.fill),r.decorWall);if(t.role==="wall"&&!s){Zo(e,l,p,b,c,v,x,i),io(e,t,b+.012);return}if(d&&l.length===4&&b-p>.2){let w=Ii(l,p,b);if(!w)return;let{quad:E,side:T,trim:F,inner:R,panel:I}=w,_=[.12,.15,.18];for(let[k,V]of[[0,T],[1-T,1]])pe(e,je(E,k,V),b,p,_,_);pe(e,R,p+F,p,_,_),pe(e,R,b,b-F,_,_),pe(e,I,b-F,p+F,x,x),io(e,t,b+.012);return}let g=y?ce(at(y,.15),.82):x,P=y?ce(at(y,.1),1.02):v;if(ul(t.role)&&!s&&ml(e,t.role,l,p,b,g,P,i,t.heightM!==void 0))return;if((t.role==="sound"||s?.kind==="sound_desk")&&l.length===4&&b-p>.3){let w=qe(l),E=Math.hypot(w[1].x-w[0].x,w[1].y-w[0].y)*C,T=Math.min(.12,.09/Math.max(E,.001)),F=[.18,.21,.24],R=b-Math.min(.12,(b-p)*.15);for(let[I,_]of[[0,T],[1-T,1]])pe(e,je(w,I,_),R,p,F,F);pe(e,w,b,R,v,F);return}if(t.role==="rail"&&l.length===4&&b>p){let w=qe(l),E=Math.hypot(w[1].x-w[0].x,w[1].y-w[0].y)*C,T=Math.max(1,Math.min(128,Math.ceil(E/1.4))),F=Math.min(.08,.055/Math.max(.055,E)),R=[.58,.64,.66];for(let I=0;I<=T;I++){let _=I/T,k=Math.min(1-F,Math.max(0,_-F/2));pe(e,je(w,k,k+F),b,p,R,ce(R,.8))}for(let I of[.52,1]){let _=p+(b-p)*I;pe(e,w,_,Math.max(p,_-.055),R,ce(R,.8))}return}if(t.role==="goal"&&l.length===4){let w=qe(l),E=Math.hypot(w[1].x-w[0].x,w[1].y-w[0].y)*C,T=Math.min(.12,.1/Math.max(.1,E)),F=[.9,.94,.94];for(let[R,I]of[[0,T],[1-T,1]])pe(e,je(w,R,I),Math.max(p,b-.1),p,F,F);pe(e,w,b,Math.max(p,b-.1),F,F);return}if(h.kind==="portal"&&l.length===4){let w=Sn(l,p,b);if(!w)return;let{quad:E,side:T,face:F,openingTop:R}=w;for(let[I,_,k]of[[0,F,1],[F,1-F,.67],[1-F,1,1]]){let V=ro(E,I,_),O=ce(v,k),H=ce(x,k);for(let[U,N]of[[0,T],[1-T,1]])pe(e,je(V,U,N),R,p,O,H);pe(e,V,b,R,O,H)}(t.role==="entrance"||t.role==="exit")&&Rb(e,E,p,i,t.role==="exit");return}if(h.kind==="suite"&&l.length===4){let w=l.map((F,R)=>{let I=l[(R+1)%4],_=(F.x+I.x)/2,k=(F.y+I.y)/2;return Math.hypot(_-i.x,k-i.y)}),E=w.indexOf(Math.min(...w)),T=[0,1,2,3].map(F=>l[(E+F)%4]);pe(e,je(T,0,.08),b,p,v,x),pe(e,je(T,.92,1),b,p,v,x),pe(e,ro(T,.88,1),b,p,v,x),pe(e,T,b,Math.max(p,b-.18),v,x);return}if(f&&!t.stageKind?.startsWith("pitch-")&&b-p>.12){let w=b-Math.min(.06,(b-p)*.15);pe(e,l,w,p,v,x,u),pe(e,l,b,w,v,ge(v,x,.2),u)}else pe(e,l,b,p,v,x,u);if((t.stageKind==="pitch-football"||t.stageKind==="pitch-rugby")&&l.length===4){e.setMaterial(4);let w=qe(l),E=ge(y??xl,xl,y?.45:0);for(let T=0;T<12;T++){let F=je(w,T/12,(T+1)/12),R=ce(E,T%2?1.09:.91),I=F.map(_=>[_.x*C,b+.006,_.y*C]);e.tri(I[0],I[1],I[2],[0,1,0],R),e.tri(I[0],I[2],I[3],[0,1,0],R)}}t.stageKind&&t.stageKind!=="pitch-football"&&gl(e,l,t.stageKind,b,y),f&&Kt(t.stageKind)&&yl(e,t,b),e.setMaterial(d?1:0),io(e,t,b+.012)}function ar(e){let{x:t,y:n,width:o,height:r}=e;if(!o||!r)return null;let i=t+o/2,a=n+r/2,s=(e.rotation??0)*Math.PI/180,c=Math.cos(s),l=Math.sin(s),u=o/2,m=r/2;return[[-u,-m],[u,-m],[u,m],[-u,m]].map(([f,d])=>({x:i+f*c-d*l,y:a+f*l+d*c}))}function Cb(e){if(!e||!e.startsWith("data:image/svg+xml"))return null;let t=e.slice(e.indexOf(",")+1);if(/;base64/i.test(e.slice(0,e.indexOf(","))))try{t=atob(t)}catch{return null}else try{t=decodeURIComponent(t)}catch{}let n=t.match(/<(?:rect|path)\b[^>]*\bfill="([^"]+)"/i);if(!n)return null;let o=n[1].trim();if(o==="none"||o==="transparent")return null;let r=o.match(/^url\(#([^)]+)\)$/);if(!r)return be(o);let i=t.match(new RegExp(`<(?:linear|radial)Gradient\\b[^>]*\\bid="${r[1]}"[^>]*>([\\s\\S]*?)</(?:linear|radial)Gradient>`,"i"));if(!i)return null;let a=[];for(let s of i[1].matchAll(/stop-color="([^"]+)"/gi)){let c=be(s[1].trim());c&&a.push(c)}return a.length?a.reduce((s,c,l)=>ge(s,c,1/(l+1)),a[0]):null}function Cl(e,t,n,o){if(t.layer==="foreground")return;let r=ar(t);if(!r)return;let i=n+vb,a=qt(Cb(t.href),o.decorTop),s=Math.max(0,Math.min(1,t.opacity??1));s<1&&(a=ge(o.ground,a,s)),ue(e,r,void 0,()=>i,n,a,ge(a,o.decorWall,.5),ae)}function _l(e,t,n,o,r){if(!t.points||t.points.length<3)return;let i=Cc(o,r.gaTop);ue(e,t.points,t.holes,()=>n+wl,n,i,r.gaWall,ae),Lb(e,t.points,n+wl)}var wl=.15,nr=[.72,.74,.76],_i=1.1,Pl=.12,Ti=.05,_b=.06,Tb=2.4;function Lb(e,t,n){let o=pt([...t]),r=_t(o,Pl/C),i=_t(o,(Pl+Ti)/C);if(r.length<3||i.length<3)return;for(let s of[n+_i,n+_i*.5])ue(e,r,[i.slice().reverse()],()=>s,s-Ti,nr,ce(nr,.85),ae);let a=_b/2/C;for(let s=0;s<r.length;s++){let c=r[s],l=r[(s+1)%r.length],u=Math.hypot(l.x-c.x,l.y-c.y)*C,m=Math.max(1,Math.round(u/Tb));for(let f=0;f<m;f++){let d=f/m,h=c.x+(l.x-c.x)*d,p=c.y+(l.y-c.y)*d,b=[{x:h-a,y:p-a},{x:h+a,y:p-a},{x:h+a,y:p+a},{x:h-a,y:p+a}];ue(e,b,void 0,()=>n+_i-Ti,n,nr,ce(nr,.8),ae)}}}var Li=.6,Tl=3,kb=.25;function Ob(e,t){if(Ze(t,e.x,e.y))return 0;let n=1/0;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[r],a=t[o],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c||1,u=Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l));n=Math.min(n,Math.hypot(e.x-(i.x+u*s),e.y-(i.y+u*c)))}return n}function Ll(e,t){let n=e.map(a=>({booth:a,ring:ut(a)})).filter(a=>!!a.ring&&a.ring.length===4&&!a.booth.points),o=n.map(({ring:a})=>({minX:Math.min(...a.map(s=>s.x)),maxX:Math.max(...a.map(s=>s.x)),minY:Math.min(...a.map(s=>s.y)),maxY:Math.max(...a.map(s=>s.y))})),r=(Tl+Li)/C,i=new Map;return n.forEach(({booth:a,ring:s},c)=>{let l={x:s.reduce((d,h)=>d+h.x,0)/4,y:s.reduce((d,h)=>d+h.y,0)/4},u=[0,1,2,3].map(d=>{let h=s[d],p=s[(d+1)%4],b={x:(h.x+p.x)/2,y:(h.y+p.y)/2},y=b.x-l.x,M=b.y-l.y,v=Math.hypot(y,M)||1,A={x:b.x+y/v*Li/C,y:b.y+M/v*Li/C},x=Tl/C;return o.forEach((g,P)=>{P===c||A.x<g.minX-r||A.x>g.maxX+r||A.y<g.minY-r||A.y>g.maxY+r||(x=Math.min(x,Ob(A,n[P].ring)))}),{open:x*C,toward:{x:b.x+y/v*10/C,y:b.y+M/v*10/C},focal:Math.hypot(b.x-t.x,b.y-t.y)}}),m=Math.max(...u.map(d=>d.open)),f=u.filter(d=>d.open>=m-kb).sort((d,h)=>d.focal-h.focal)[0];i.set(a.id,f.toward)}),i}var kl=dt(require("polygon-clipping"),1);var Fb=.45,Db=1500,Nb=200;function Ol(e,t){if(e.role!=="stage"||Kt(e.stageKind))return e;let n=Me(e);if(!n||n.length<3||Math.abs($e(n))*C*C>Db)return e;let o=t.filter(a=>Ze(n,a.x,a.y));if(!o.length||o.length>Nb)return e;let r=Fb/C,i=o.map(a=>[[[a.x-r,a.y-r],[a.x+r,a.y-r],[a.x+r,a.y+r],[a.x-r,a.y+r],[a.x-r,a.y-r]]]);try{let a=kl.default.difference([[...n.map(l=>[l.x,l.y]),[n[0].x,n[0].y]]],...i),s=null,c=0;for(let l of a){let u=l[0].slice(0,-1).map(([f,d])=>({x:f,y:d})),m=Math.abs($e(u));m>c&&(c=m,s=u)}return!s||s.length<3?e:{...e,kind:"polygon",points:s,rotation:0}}catch{return e}}var Bb=Math.PI/180,Pe=96,Vb=6,Gb=60,Hb=150,Fl=.2,zb=.35;function jb(e,t){let n=Math.atan2(t.x-e.x,t.y-e.y)/Bb;return n<0?n+360:n}function sr(e){if(!e.length)return NaN;let t=[...e].sort((n,o)=>n-o);return t[Math.floor(t.length/2)]}function cr(e,t,n=2){let o=e.length,r=new Float64Array(o);for(let i=0;i<o;i++){let a=0,s=0;for(let c=-n;c<=n;c++){let l=i+c;if(t)l=(l%o+o)%o;else if(l<0||l>=o)continue;a+=e[l],s++}r[i]=a/s}return r}function Dl(e,t){let n=e.filter(f=>f.rows.length>=1);if(n.length<1)return null;let o=[],r=0,i=0,a=0;for(let f of n)for(let d of f.rows){for(let h of d.pts)r+=h.x,i+=h.y,a++;if(d.pts.length>=4){let h=di(d.pts);h&&Number.isFinite(h.cx)&&Number.isFinite(h.cy)&&o.push({x:h.cx,y:h.cy})}}if(!a)return null;let s={x:r/a,y:i/a},c=s;if(o.length>=8){let f=sr(o.map(y=>y.x)),d=sr(o.map(y=>y.y)),h=0;for(let y of n)for(let M of y.rows)for(let v of M.pts){let A=Math.hypot(v.x-s.x,v.y-s.y);A>h&&(h=A)}let p=0,b=h*.2;for(let y of n)for(let M of y.rows)for(let v of M.pts)Math.hypot(v.x-f,v.y-d)<b&&p++;Math.hypot(f-s.x,d-s.y)<=h&&p/a<.01&&(c={x:f,y:d})}let l=[];for(let f of n){let d={sectionId:f.sectionId,rMin:1/0,rMax:-1/0,samples:[]};for(let h of f.rows)for(let p of h.pts){let b=Math.hypot(p.x-c.x,p.y-c.y),y=Math.min(Pe-1,Math.floor(jb(c,p)/(360/Pe)));d.samples.push({r:b,bin:y,levelM:h.levelM}),b<d.rMin&&(d.rMin=b),b>d.rMax&&(d.rMax=b)}d.samples.length&&l.push(d)}if(!l.length)return null;l.sort((f,d)=>f.rMin+f.rMax-(d.rMin+d.rMax));let u=[];for(let f of l){let d=!1;for(let h of u){let p=Math.min(f.rMax,h.rMax)-Math.max(f.rMin,h.rMin),b=Math.min(f.rMax-f.rMin,h.rMax-h.rMin);if(b>1e-9&&p>=zb*b){h.members.push(f),h.rMin=Math.min(h.rMin,f.rMin),h.rMax=Math.max(h.rMax,f.rMax),d=!0;break}}d||u.push({members:[f],rMin:f.rMin,rMax:f.rMax})}let m=[];for(let f of u){let d=new Array(Pe).fill(null);for(let R of f.members)for(let I of R.samples){let _=d[I.bin];_||(_={samples:[]},d[I.bin]=_),_.samples.push({r:I.r,levelM:I.levelM})}let h=d.map(R=>!!R);if(!h.filter(Boolean).length)continue;let b=[],y=[];for(let R of d){if(!R)continue;let I=1/0,_=-1/0;for(let k of R.samples)k.r<I&&(I=k.r),k.r>_&&(_=k.r);b.push(I),y.push(_)}let M=sr(b),v=sr(y);if(!(M>=Fl*v)||!(v>0))continue;let A=[...b].sort((R,I)=>R-I);if(!(A[Math.floor(A.length*.1)]>=Fl*v))continue;let g=d.map(R=>{if(!R)return null;let I=[...R.samples].sort((L,B)=>L.r-B.r),_=I[0].r,k=I[I.length-1].r,V=I[0].levelM,O=-1/0;for(let L of I)L.levelM>O&&(O=L.levelM);let H=[];for(let L of I){let B={r:L.r,l:L.levelM};for(;H.length&&Math.abs(H[H.length-1].r-B.r)<1e-9;){if(H[H.length-1].l<=B.l){B.skip=!0;break}H.pop()}if(!B.skip){for(;H.length>=2;){let D=H[H.length-2],G=H[H.length-1];if((G.r-D.r)*(B.l-D.l)-(G.l-D.l)*(B.r-D.r)<=0)H.pop();else break}H.push(B)}}let U=H.map(L=>L.r),N=H.map(L=>L.l);return{inner:_,outer:k,front:V,top:O,profile:{rs:U,ls:N}}}),P=h.slice();for(let R=0;R<Pe;R++){if(P[R])continue;let I=-1,_=-1,k=0;for(let j=1;j<=Pe;j++){let Z=(R-j+Pe*2)%Pe;if(P[Z]){I=Z;break}}for(let j=1;j<=Pe;j++){let Z=(R+j)%Pe;if(P[Z]){_=Z,k=j;break}}if(I<0||_<0)continue;let V=0;for(let j=1;j<=Pe;j++){let Z=(R-j+Pe*2)%Pe;if(h[Z]){V=j;break}}if(V-1+k>Vb)continue;let H=g[I],U=g[_],N=V/(V+k),L=H.inner+(U.inner-H.inner)*N,B=H.outer+(U.outer-H.outer)*N,D=H.front+(U.front-H.front)*N,G=H.top+(U.top-H.top)*N;g[R]={inner:L,outer:B,front:D,top:G,profile:{rs:[L,B],ls:[D,G]}}}for(let R=0;R<Pe;R++)g[R]&&(P[R]=!0);let S=360/Pe,w=[],E=P.filter(Boolean).length,T=[];if(E===Pe)T.push({start:0,len:Pe});else{let R=0;for(;P[R];)R=(R+1)%Pe;let I=-1;for(let _=0;_<=Pe;_++){let k=(R+_)%Pe,V=_<Pe&&P[k];if(V&&I<0)I=k;else if(!V&&I>=0){let O=(k-I+Pe)%Pe||Pe;T.push({start:I,len:O}),I=-1}}}for(let R of T){if(R.len*S<Gb&&R.len<Pe)continue;let I=R.len===Pe,_=new Float64Array(R.len),k=new Float64Array(R.len),V=new Float64Array(R.len),O=new Float64Array(R.len),H=[];for(let j=0;j<R.len;j++){let Z=g[(R.start+j)%Pe];_[j]=Z.inner,k[j]=Z.outer,V[j]=Z.front,O[j]=Z.top,H.push(Z.profile??{rs:[Z.inner,Z.outer],ls:[Z.front,Z.top]})}let U=cr(_,I),N=cr(k,I),L=cr(V,I),B=cr(O,I);for(let j=0;j<R.len;j++)U[j]>_[j]&&(U[j]=_[j]),N[j]<k[j]&&(N[j]=k[j]),U[j]>N[j]-1e-6&&(U[j]=Math.max(0,N[j]-1e-6)),B[j]<L[j]&&(B[j]=L[j]);let D={startBin:R.start,binCount:R.len,closed:I,innerR:U,outerR:N,frontLevelM:L,topLevelM:B,profiles:H},G=(j,Z,$)=>{let ee=H[j],Q=ee.rs,X=ee.ls;if(Z<=Q[0]){X[0]>$&&(X[0]=$);return}if(Z>=Q[Q.length-1]){X[X.length-1]>$&&(X[X.length-1]=$);return}for(let Y=0;Y+1<Q.length;Y++)if(Z<=Q[Y+1]){X[Y]>$&&(X[Y]=$),X[Y+1]>$&&(X[Y+1]=$);return}};for(let j=0;j<R.len;j++){let Z=d[(R.start+j)%Pe];if(Z)for(let $ of Z.samples){G(j,$.r,$.levelM);let ee=I?(j-1+R.len)%R.len:j-1,Q=I?(j+1)%R.len:j+1;ee>=0&&G(ee,$.r,$.levelM),Q<R.len&&G(Q,$.r,$.levelM)}}w.push(D)}w.reduce((R,I)=>R+I.binCount*S,0)<Hb||m.push({arcs:w,sectionIds:f.members.map(R=>R.sectionId),innerRMedian:M,outerRMedian:v})}if(!m.length)return null;if(m.sort((f,d)=>f.innerRMedian-d.innerRMedian),t){let f=m[m.length-1].outerRMedian;if(Math.hypot(t.x-c.x,t.y-c.y)>.9*f)return null}return{centre:c,binCount:Pe,binStepDeg:360/Pe,rings:m}}function Nl(e,t,n,o){let r=e.binStepDeg,i=n/r-.5-t.startBin;i=(i%e.binCount+e.binCount)%e.binCount,i>t.binCount-1&&(t.closed?i=i-t.binCount<t.binCount-i?0:t.binCount-1:i=i-(t.binCount-1)<e.binCount-i?t.binCount-1:0);let a=Math.floor(i),s=t.closed?(a+1)%t.binCount:Math.min(t.binCount-1,a+1),c=i-a,l=u=>{let m=t.profiles[u],f=m.rs,d=m.ls;if(o<=f[0])return d[0];if(o>=f[f.length-1])return d[d.length-1];for(let h=0;h+1<f.length;h++)if(o<=f[h+1]){let p=f[h+1]-f[h],b=p>1e-9?(o-f[h])/p:0;return d[h]+(d[h+1]-d[h])*b}return d[d.length-1]};return l(a)*(1-c)+l(s)*c}function ki(e,t,n,o,r,i,a,s,c,l=[],u=r){if(t.length!==n.length||t.length<2||i-r<1.5)return;let m=(p,b,y)=>{At(e,p,b,y,l,a,s,{portalBase:u,ao:c})||ue(e,p,void 0,()=>y,b,a,s,c)},f=(p,b,y)=>({x:p.x+(b.x-p.x)*y,y:p.y+(b.y-p.y)*y}),d=o?t.length:t.length-1,h=0;for(let p=0;p<d;p++){let b=(p+1)%t.length,y=Math.hypot(n[b].x-n[p].x,n[b].y-n[p].y)*fe;if(y<1e-5)continue;let M=(g,P)=>[f(t[p],t[b],g),f(t[p],t[b],P),f(n[p],n[b],P),f(n[p],n[b],g)];m(M(0,1),r,r+.95),m(M(0,1),i-.22,i);let v=Math.ceil((h-.32)/6)*6,A=!1,x=!1;for(let g=v;g<h+y;g+=6){let P=Math.max(0,(g-h)/y),S=Math.min(1,(g+.32-h)/y);S<=P||(m(M(P,S),r+.95,i-.22),A||=P<1e-6,x||=S>1-1e-6)}if(!o&&(p===0&&!A||p===d-1&&!x)){let g=Math.min(1,.32/y);m(M(p===0?0:1-g,p===0?g:1),r+.95,i-.22)}h+=y}}var Ft=dt(require("polygon-clipping"),1),co=.65;function Oi(e,t){let n=1/0;for(let o of t)for(let r=0;r<o.length;r++){let i=o[r],a=o[(r+1)%o.length],s=a.x-i.x,c=a.y-i.y,l=Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/(s*s+c*c||1)));n=Math.min(n,Math.hypot(e.x-i.x-l*s,e.y-i.y-l*c))}return n}var Fi=.01;function Bl(e,t,n,o,r,i,a,s=[],c=!0,l={bays:[],walls:[]}){if(o-r<=1e-5)return;let u=o-r>=3,m=u?o-co:r;e.setMaterial(5);let f=u?[]:s.filter(g=>{if(g.role!=="entrance"&&g.role!=="exit")return!1;let P=Me(g);if(!P)return!1;let S=Sn(P,r,r+lt(g).heightM);return S!==null&&S.openingTop<=o-.12});if((!f.length||!At(e,t,m,o,f,i,a,{holes:n,portalBase:r}))&&ue(e,t,n,()=>o,m,i,a,ae,void 0,()=>[0,1,0]),!u){e.setMaterial(0);return}let d=c&&l.bays.length?Ub(t,n,_t(t,so/C),l):null,h=6/C,p=.22/C,b=s.flatMap(g=>{if(g.role!=="entrance"&&g.role!=="exit")return[];let P=Me(g);return P?.length?[{minX:Math.min(...P.map(S=>S.x)),maxX:Math.max(...P.map(S=>S.x)),minY:Math.min(...P.map(S=>S.y)),maxY:Math.max(...P.map(S=>S.y))}]:[]}),y=Math.min(...t.map(g=>g.x)),M=Math.max(...t.map(g=>g.x)),v=Math.min(...t.map(g=>g.y)),A=Math.max(...t.map(g=>g.y));for(let g=y+h/2;g<M;g+=h)for(let P=v+h/2;P<A;P+=h){if(b.some(w=>g+p>=w.minX&&g-p<=w.maxX&&P+p>=w.minY&&P-p<=w.maxY))continue;let S=[{x:g-p,y:P-p},{x:g+p,y:P-p},{x:g+p,y:P+p},{x:g-p,y:P+p}];!ze({x:g,y:P},t,n)||Oi({x:g,y:P},[t,...n??[]])<p*Math.SQRT2+(c?so/C:0)||d&&Oi({x:g,y:P},d.flat())<p*Math.SQRT2+so/C||ue(e,S,void 0,()=>m,r,i,a,ae)}if(d){for(let[g,...P]of d)ue(e,g,P,()=>m,r-Fi,i,a,ae);e.setMaterial(0);return}let x=_t(t,so/C);if(c&&x.length>=3){let g=s.filter(w=>{if(w.role!=="entrance"&&w.role!=="exit")return!1;let E=Me(w);return!!E&&E.some(T=>!ze(T,t,void 0)||Oi(T,[t])<=so/C)}),P=[x.slice().reverse()],S=r-Fi;(!g.length||!At(e,t,S,m,g,i,a,{holes:P,portalBase:r+Fi}))&&ue(e,t,P,()=>m,S,i,a,ae)}e.setMaterial(0)}var Di=.25,so=Di;function Ub(e,t,n,o){if(n.length<3)return null;let r=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s},i=a=>{let[s,...c]=a.map(l=>[r(l)]);return Ft.default.union(s,...c)};try{let a=[r(e),...(t??[]).map(r)],s=Ft.default.difference(a,[r(n)]),c=Ft.default.intersection(a,i(o.bays));if(!c.length)return null;let l=Ft.default.difference(Ft.default.intersection(a,i(o.walls)),c);return Ft.default.union(Ft.default.difference(s,c),l).map(m=>m.map(f=>f.slice(0,-1).map(([d,h])=>({x:d,y:h}))))}catch{return null}}var Wb=.02,Xb=.25,Yb=1.2,Kb=.6,$b=.45,Zb=2.3,qb=Math.PI/180,Vl=.005;function yt(e,t,n){let o=n*qb;return{x:e.x+t*Math.sin(o),y:e.y+t*Math.cos(o)}}function Qb(e,t){let n=t.rings[t.rings.length-1];if(!n)return!1;let o=n.outerRMedian*.85;for(let r of e){if(r.role!=="wall")continue;let i=r.points&&r.points.length>=2?r.points:r.x!==void 0&&r.y!==void 0&&r.width!==void 0&&r.height!==void 0?[{x:r.x,y:r.y},{x:r.x+r.width,y:r.y},{x:r.x+r.width,y:r.y+r.height},{x:r.x,y:r.y+r.height}]:[];if(i.length<2)continue;let a=0;for(let s of i)Math.hypot(s.x-t.centre.x,s.y-t.centre.y)>=o&&a++;if(a>=i.length/2)return!0}return!1}var Jb=24,e0=.01;function t0(e,t,n,o,r,i,a,s,c){let l=n.binCount,u=Jb,m=fe,f=i+.02,d=i-e0,h=[];for(let I=0;I<l;I++){let _=(n.startBin+I+.5)*t.binStepDeg,k=new Float64Array(u+1);for(let V=0;V<=u;V++){let O=o[I]+(r[I]-o[I])*V/u;k[V]=Math.max(f,Nl(t,n,_,O)-Xb)}h.push(k)}if(c){let I=0;for(let _=0;_+1<l;_++)for(let k=0;k<u;k++){let V=yt(t.centre,o[_]+(r[_]-o[_])*k/u,(n.startBin+_+.5)*t.binStepDeg),O=yt(t.centre,o[_+1]+(r[_+1]-o[_+1])*(k+1)/u,(n.startBin+_+1.5)*t.binStepDeg);I=Math.max(I,Math.hypot(O.x-V.x,O.y-V.y))}for(let _=0;_<l;_++){let k=(n.startBin+_+.5)*t.binStepDeg;for(let V=0;V<=u;V++){let O=yt(t.centre,o[_]+(r[_]-o[_])*V/u,k),H=c(O.x,O.y,I*1.01);H!==null&&(h[_][V]=Math.min(h[_][V],Math.max(d+Vl,H-Vl)))}}}let p=[a.bandTop[0]*s.top,a.bandTop[1]*s.top,a.bandTop[2]*s.top],b=[a.bandTop[0]*s.bottomCap,a.bandTop[1]*s.bottomCap,a.bandTop[2]*s.bottomCap],y=[a.bandWall[0]*s.top,a.bandWall[1]*s.top,a.bandWall[2]*s.top],M=[a.bandWall[0]*s.wallBottom,a.bandWall[1]*s.wallBottom,a.bandWall[2]*s.wallBottom],v=(I,_)=>{let k=(n.startBin+I+.5)*t.binStepDeg,V=o[I]+(r[I]-o[I])*_/u,O=yt(t.centre,V,k);return[O.x*m,h[I][_],O.y*m]};{let I=Math.tan(12*Math.PI/180);for(let _=0;_<6;_++){let k=!1;for(let O=0;O<l;O++)for(let H=u-1;H>=0;H--)h[O][H]>h[O][H+1]&&(h[O][H]=h[O][H+1],k=!0);let V=n.closed?l:l-1;for(let O=0;O<V;O++){let H=(O+1)%l;for(let U=0;U<=u;U++){let N=h[H][U]-h[O][U];if(Math.abs(N)>1)continue;let L=o[O]+(r[O]-o[O])*U/u,B=o[H]+(r[H]-o[H])*U/u,D=yt(t.centre,L,(n.startBin+O+.5)*t.binStepDeg),G=yt(t.centre,B,(n.startBin+H+.5)*t.binStepDeg),j=I*Math.hypot(G.x-D.x,G.y-D.y)*m;N>j?(h[H][U]=h[O][U]+j,k=!0):-N>j&&(h[O][U]=h[H][U]+j,k=!0)}}if(!k)break}}let A=1,x=(I,_)=>{for(let k=0;k<=u;k+=4)if(Math.abs(h[I][k]-h[_][k])>A)return!0;return Math.abs(h[I][u]-h[_][u])>A},g=Math.tan(38*Math.PI/180),P=I=>(r[I]-o[I])/u*m,S=(I,_)=>h[I][_+1]-h[I][_]>g*Math.max(1e-6,P(I)),w=(I,_)=>{let k=n.closed?(I-1+l)%l:Math.max(0,I-1),V=n.closed?(I+1)%l:Math.min(l-1,I+1);Math.abs(h[k][_]-h[I][_])>A&&(k=I),Math.abs(h[V][_]-h[I][_])>A&&(V=I);let O=Math.max(0,_-1),H=Math.min(u,_+1);O<_&&S(I,O)&&(O=_),H>_&&S(I,_)&&(H=_);let U=v(k,_),N=v(V,_),L=v(I,O),B=v(I,H),D=N[0]-U[0],G=N[1]-U[1],j=N[2]-U[2],Z=B[0]-L[0],$=B[1]-L[1],ee=B[2]-L[2],Q=G*ee-j*$,X=j*Z-D*ee,Y=D*$-G*Z,K=Math.hypot(Q,X,Y);return K>1e-12?(Q/=K,X/=K,Y/=K,X<0&&(Q=-Q,X=-X,Y=-Y),[Q,X,Y]):[0,1,0]},E=(I,_,k=!1)=>{let V=k&&Math.min(I[1],_[1])-i>=3,O=[I[0],V?I[1]-co:d,I[2]],H=[_[0],V?_[1]-co:d,_[2]],U=_[0]-I[0],N=_[2]-I[2],L=Math.hypot(U,N);if(!(L>1e-12))return;let B=[N/L,0,-U/L];e.tri(I,_,H,B,y,y,M),e.tri(I,H,O,B,y,M,M)},T=.05*et,F=I=>r[I]-o[I]<T,R=n.closed?l:l-1;for(let I=0;I<R;I++){let _=(I+1)%l;if(F(I)||F(_))continue;if(x(I,_)){let N=(n.startBin+I+1)*t.binStepDeg,L=($,ee)=>{let Q=(o[I]+o[_])/2,X=(r[I]+r[_])/2,Y=Q+(X-Q)*ee/u,K=yt(t.centre,Y,N);return[K.x*m,h[$][ee],K.y*m]};for(let $=0;$<u;$++){let ee=v(I,$),Q=v(I,$+1),X=L(I,$),Y=L(I,$+1),K=w(I,$),re=w(I,$+1);e.triN(ee,X,Y,K,K,re,p),e.triN(ee,Y,Q,K,re,re,p);let ne=v(_,$),se=v(_,$+1),J=L(_,$),ie=L(_,$+1),Ee=w(_,$),te=w(_,$+1);e.triN(J,ne,se,Ee,Ee,te,p),e.triN(J,se,ie,Ee,te,te,p);let ve=L(I,$),Se=L(I,$+1),ot=L(_,$+1),mt=L(_,$),Ye=Se[0]-ve[0],rt=Se[2]-ve[2],Ae=Math.hypot(Ye,rt);if(Ae>1e-12){let Ht=[rt/Ae,0,-Ye/Ae];e.tri(ve,Se,ot,Ht,y),e.tri(ve,ot,mt,Ht,y)}}let B=v(I,0),D=v(_,0),G=v(_,u),j=v(I,u),Z=$=>[$[0],d,$[2]];Math.min(B[1],D[1])-i<3&&(e.tri(Z(B),Z(G),Z(D),[0,-1,0],b),e.tri(Z(B),Z(j),Z(G),[0,-1,0],b)),E(B,D,!0),E(j,G,!0);continue}for(let N=0;N<u;N++){let L=w(I,N),B=w(_,N),D=w(_,N+1),G=w(I,N+1);if(S(I,N)||S(_,N)){let Q=(Se,ot)=>{let mt=(n.startBin+Se+.5)*t.binStepDeg,Ye=o[Se]+(r[Se]-o[Se])*(N+.5)/u,rt=yt(t.centre,Ye,mt);return[rt.x*m,ot,rt.y*m]},X=v(I,N),Y=v(_,N),K=Q(I,h[I][N]),re=Q(_,h[_][N]);e.triN(X,Y,re,L,B,B,p),e.triN(X,re,K,L,B,L,p);let ne=v(_,N+1),se=v(I,N+1),J=Q(I,h[I][N+1]),ie=Q(_,h[_][N+1]);e.triN(J,ie,ne,G,D,D,p),e.triN(J,ne,se,G,D,G,p);let Ee=re[0]-K[0],te=re[2]-K[2],ve=Math.hypot(Ee,te);if(ve>1e-12){let Se=[-te/ve,0,Ee/ve];e.tri(K,re,ie,Se,y),e.tri(K,ie,J,Se,y)}continue}let j=v(I,N),Z=v(_,N),$=v(_,N+1),ee=v(I,N+1);e.triN(j,Z,$,L,B,D,p),e.triN(j,$,ee,L,D,G,p)}let k=v(I,0),V=v(_,0),O=v(_,u),H=v(I,u),U=N=>[N[0],d,N[2]];Math.min(k[1],V[1])-i<3&&(e.tri(U(k),U(O),U(V),[0,-1,0],b),e.tri(U(k),U(H),U(O),[0,-1,0],b)),E(k,V,!0),E(H,O,!0)}if(!n.closed)for(let I of[0,l-1])for(let _=0;_<u;_++)E(v(I,_),v(I,_+1))}function Gl(e,t,n){let{bottomY:o,colors:r,ao:i}=n,a=new Float64Array(t.binCount).fill(-1/0);for(let u of t.rings)for(let m of u.arcs){let f=new Float64Array(m.binCount),d=new Float64Array(m.binCount);for(let p=0;p<m.binCount;p++){let b=(m.startBin+p)%t.binCount,y=Math.max(0,m.innerR[p]-tt);f[p]=Math.max(y,a[b]+.001),d[p]=Math.max(f[p]+.001,m.outerR[p]+tt)}let h=0;for(let p=0;p<m.binCount;p++){let b=m.topLevelM[p]-o;b>h&&(h=b)}h>=Yb&&t0(e,t,m,f,d,o,r,i,n.standTopNear);for(let p=0;p<m.binCount;p++){let b=(m.startBin+p)%t.binCount;d[p]>a[b]&&(a[b]=d[p])}}if(n.deriveShell===!1||Qb(n.shapes,t))return;let s=t.rings[t.rings.length-1],c=Kb*et,l=$b*et;for(let u of s.arcs){let m=[],f=[];for(let w=0;w<u.binCount;w++){let E=(u.startBin+w+.5)*t.binStepDeg,T=u.outerR[w]+tt+c;m.push(yt(t.centre,T,E)),f.push(yt(t.centre,T+l,E))}let d=-1/0;for(let w=0;w<u.binCount;w++)u.topLevelM[w]>d&&(d=u.topLevelM[w]);let h=d+Zb,p=u.closed?f:[...f,...m.slice().reverse()],b=u.closed?[m.slice().reverse()]:void 0,y=ge(r.shellWall,[.66,.71,.72],.62),M=(w,E,T,F,R)=>{let I=Math.abs(F-d)<1e-6?F-Wb:F;At(e,w,T,I,n.shapes,r.shellTop,R,{holes:E,portalBase:o,ao:i})||ue(e,w,E,()=>I,T,r.shellTop,R,i)},v=Math.max(1,Math.ceil((d-o)/4.5)),A=(d-o)/v,x=new Set,g=n.tierFrontLevels??t.rings.map(w=>{let E=w.arcs.flatMap(T=>Array.from(T.frontLevelM)).filter(Number.isFinite).sort((T,F)=>T-F);return E[Math.floor(E.length/2)]});for(let w of g)Number.isFinite(w)&&w-o>=3&&w<d&&x.add(Math.max(0,Math.min(v-1,Math.floor((w-o)/A))));let P=Math.min(...g.filter(w=>Number.isFinite(w)&&w-o>=3&&w<d));for(let w=0;w<v;w++)o+(w+1)*A<=P-co&&Number.isFinite(P)&&x.add(w);for(let w=0;w<v;w++){let E=o+(d-o)*w/v,T=o+(d-o)*(w+1)/v;x.has(w)&&T-E>=3.2?(M(p,b,E,E+.45,y),ki(e,m,f,u.closed,E+.45,T-.16,r.shellTop,y,i,n.shapes,o)):M(p,b,E,T-.16,y),M(p,b,T-.16,T,ce(y,.62))}ki(e,m,f,u.closed,d,h,r.shellTop,y,i,n.shapes,o);let S=8;for(let w=1;w<f.length;w++){if(S+=Math.hypot(f[w].x-f[w-1].x,f[w].y-f[w-1].y)*fe,S<8)continue;S=0;let E=f[w],T=f[w-1],F=E.x-T.x,R=E.y-T.y,I=Math.max(1,Math.hypot(F,R)),_=F/I*.16*et,k=R/I*.16*et,V=Math.max(1,Math.hypot(E.x-t.centre.x,E.y-t.centre.y)),O=(E.x-t.centre.x)/V*.24*et,H=(E.y-t.centre.y)/V*.24*et,U=[{x:E.x-_,y:E.y-k},{x:E.x+_,y:E.y+k},{x:E.x+_+O,y:E.y+k+H},{x:E.x-_+O,y:E.y-k+H}];M(U,void 0,o,d,ce(y,1.12))}}}var n0=2.5,Hl=.65,o0=2,r0=.03;function i0(e,t){let n=()=>{let o=t;for(;e.length>2;){let r=e[0],i=e[1],a=Math.hypot(i.x-r.x,i.y-r.y);if(a>o){e[0]={x:r.x+(i.x-r.x)/a*o,y:r.y+(i.y-r.y)/a*o};return}o-=a,e.shift()}};n(),e.reverse(),n(),e.reverse()}function Vi(e,t,n){let o=new Map;for(let i of e){let a=o.get(i.blockId);(!a||i.depth<a.depth)&&o.set(i.blockId,i)}let r=[];for(let[i,a]of o){if(a.y-n<n0||a.pts.length<2)continue;let s=a.pts.map(u=>{let m=u.x-t.x,f=u.y-t.y,d=Math.max(1,Math.hypot(m,f));return{x:u.x-m/d*Hl/C,y:u.y-f/d*Hl/C}}),c=[],l=[s[0]];for(let u=1;u<s.length;u++){let m=s[u-1],f=s[u];Math.hypot(f.x-m.x,f.y-m.y)*C>o0?(l.length>=2&&c.push(l),l=[f]):l.push(f)}l.length>=2&&c.push(l);for(let u of c)i0(u,r0/C);c.length&&r.push({blockId:i,y:a.y,runs:c})}return r}var zl=.1,a0=1.1,s0=.22,Ni=.95,Bi=.05,jl=1.8;function Ul(e,t,n,o){let r=[.72,.72,.69],i=[.48,.55,.57];for(let a of Vi(t,n,o)){let s=a.y;for(let c of a.runs){let l=jl;for(let u=1;u<c.length;u++){let m=c[u-1],f=c[u],d=f.x-m.x,h=f.y-m.y,p=Math.hypot(d,h);if(p<1e-5)continue;let b=y=>{let M=-h/p*y/C/2,v=d/p*y/C/2;return[{x:m.x+M,y:m.y+v},{x:f.x+M,y:f.y+v},{x:f.x-M,y:f.y-v},{x:m.x-M,y:m.y-v}]};if(ue(e,b(s0),void 0,()=>s+zl,s-a0,r,r,ae),ue(e,b(Bi),void 0,()=>s+Ni,s+Ni-Bi,i,i,ae),l+=p*C,l>=jl||u===c.length-1){l=0;let y=.028/C,M=[{x:m.x-y,y:m.y-y},{x:m.x+y,y:m.y-y},{x:m.x+y,y:m.y+y},{x:m.x-y,y:m.y+y}];ue(e,M,void 0,()=>s+Ni-Bi,s+zl,i,i,ae)}}}}}var c0=.9,l0=1.5,u0=.3;function Wl(e,t,n){let o=[],r=[],i=c0/C,a=l0/C,s=u0/C;for(let c of e)for(let l of c.runs){if(l.length<2)continue;let u=l.slice(),m=(b,y)=>{let M=u[b],v=u[y],A=Math.hypot(M.x-v.x,M.y-v.y)||1;u[b]={x:M.x+(M.x-v.x)/A*s,y:M.y+(M.y-v.y)/A*s}};m(0,1),m(u.length-1,u.length-2);let f=u.map((b,y)=>{let M=u[Math.max(0,y-1)],v=u[Math.min(u.length-1,y+1)],A=v.x-M.x,x=v.y-M.y,g=Math.hypot(A,x)||1,P=-x/g,S=A/g;return P*(b.x-t.x)+S*(b.y-t.y)<0&&(P=-P,S=-S),{nx:P,ny:S}}),d=u.map((b,y)=>({x:b.x-f[y].nx*a,y:b.y-f[y].ny*a})),h=u.map((b,y)=>({x:b.x+f[y].nx*i,y:b.y+f[y].ny*i})),p=u.map((b,y)=>({x:b.x+f[y].nx*(i+n/C),y:b.y+f[y].ny*(i+n/C)}));o.push([...d,...h.slice().reverse()]),r.push([...h,...p.reverse()])}return{bays:o,walls:r}}var Gi=.88,lr=.27,m0=1.2,f0=.01;function Xl(e,t,n,o,r){let i=[.67,.71,.68],a=[i[0]*Gi,i[1]*Gi,i[2]*Gi],s=c=>!!r&&r.some((l,u)=>u!==c&&l?.belowY!=null&&Math.abs(l.belowY-t[c].y)<1e-6&&t[u].blockId===t[c].blockId);for(let c=0;c<t.length;c++){let l=t[c];if(!(l.pts.length<2))for(let u of[0,l.pts.length-1]){let m=l.pts[u],f=l.pts[u===0?1:u-1],d=m.x-f.x,h=m.y-f.y,p=Math.hypot(d,h);if(p<1e-5)continue;d/=p,h/=p;let b=1/0;for(let _=0;_<n.length;_++){let k=n[_],V=n[(_+1)%n.length],O=V.x-k.x,H=V.y-k.y,U=d*H-h*O;if(Math.abs(U)<1e-8)continue;let N=k.x-m.x,L=k.y-m.y,B=(N*H-L*O)/U,D=(N*h-L*d)/U;B>0&&D>=0&&D<=1&&(b=Math.min(b,B))}let y=.3/C,M=b-.04/C;if(!Number.isFinite(b)||b*C>2||M-y<.12/C)continue;let v=!!o&&s(c),A=r?.[c]?.pitch,x=v&&A&&Number.isFinite(A)?Math.min(m0/C,Math.max(lr/C,A-lr/C-f0/C)):lr/C,g=-h,P=d;o&&g*(o.x-m.x)+P*(o.y-m.y)<0&&(g=-g,P=-P);let S=lr/C,w=[{x:m.x+d*y+g*S,y:m.y+h*y+P*S},{x:m.x+d*M+g*S,y:m.y+h*M+P*S},{x:m.x+d*M-g*x,y:m.y+h*M-P*x},{x:m.x+d*y-g*x,y:m.y+h*y-P*x}];if(!w.every(_=>Ze(n,_.x,_.y)))continue;let E=r?.[c]?.belowY,T=E==null?0:l.y-E,F=!!o&&T>.03&&T<=.65;if(F&&o){let _=(k,V)=>Math.hypot((k.x+V.x)/2-o.x,(k.y+V.y)/2-o.y);_(w[0],w[1])>_(w[3],w[2])&&(w=[w[3],w[2],w[1],w[0]])}let R=F?Math.ceil((T-1e-8)/.2):1,I=(_,k,V)=>({x:_.x+(k.x-_.x)*V,y:_.y+(k.y-_.y)*V});for(let _=0;_<R;_++){let k=_/R,V=(_+1)/R,O=[I(w[0],w[3],k),I(w[1],w[2],k),I(w[1],w[2],V),I(w[0],w[3],V)],H=l.y+.008-(F?T*(1-V):0);ue(e,O,void 0,()=>H,H-(F?T/R+.1:.16),i,a,ae)}}}}var d0=.02,h0=.012,p0=.01,b0=.3,y0=.5;function g0(e,t,n){if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u=Math.max(0,Math.min(1,u)),o=Math.min(o,Math.hypot(t-(i.x+u*s),n-(i.y+u*c)))}return o}function x0(e,t,n,o){let r=1/0,i=Number.NaN;for(let a=0;a<e.length;a++){let s=t[a];if(Math.hypot(n-s.cx,o-s.cy)-s.rad>=r)continue;let c=g0(e[a].pts,n,o);c<r&&(r=c,i=e[a].y)}return i}function Yl(e,t,n,o,r,i,a){let s=o.filter(f=>f.pts.length>0);if(s.length<2||t.length<3)return;let c=s.map(f=>{let d=0,h=0;for(let b of f.pts)d+=b.x,h+=b.y;d/=f.pts.length,h/=f.pts.length;let p=0;for(let b of f.pts)p=Math.max(p,Math.hypot(b.x-d,b.y-h));return{cx:d,cy:h,rad:p}}),l=[...t],u=n.map(f=>[...f]),m=d0/C;for(let f of[l,...u])for(let d=0;d<f.length;d++){let h=f[d],p=f[(d+1)%f.length],b=p.x-h.x,y=p.y-h.y,M=Math.hypot(b,y);if(M*C<.05)continue;let v=(h.x+p.x)/2,A=(h.y+p.y)/2,x=y/M,g=-b/M;ze({x:v+x*m,y:A+g*m},l,u)&&(x=-x,g=-g);let P=r.x-v,S=r.y-A,w=Math.hypot(P,S)||1;if((x*P+g*S)/w>y0)continue;let E=1/0;for(let O of[.2,.5,.8]){let H=x0(s,c,h.x+b*O-x*m*2,h.y+y*O-g*m*2);Number.isFinite(H)&&(E=Math.min(E,H))}if(!Number.isFinite(E)||E-i<b0)continue;let T=i-p0,F=E-h0,R={x:(h.x-x*m)*C,z:(h.y-g*m)*C},I={x:(p.x-x*m)*C,z:(p.y-g*m)*C},_=[x,0,g],k=ce(a,ae.wallBottom),V=ce(a,ae.top);e.tri([R.x,F,R.z],[I.x,F,I.z],[I.x,T,I.z],_,V,V,k),e.tri([R.x,F,R.z],[I.x,T,I.z],[R.x,T,R.z],_,V,k,k)}}function Kl(e,t,n,o,r,i,a,s,c=!1){if(!t.outline||t.outline.length<3)return;let l=n.baseHeightM,u=n.objects.filter(M=>M.type==="shape"&&(M.role==="entrance"||M.role==="exit")),m=_c(o,s.tierTop);if(!r)return;let f=M=>r.deckAt(M.x,M.y),d=Xc(t,a),h=d[0]??t.outline;if(r.rowLevels.length>=2){let M=Xo(r.rowLevels),v=Yc(Hc(r.rowLevels,n.focal,M),d),A=Wl(Vi(r.rowLevels,n.focal,l),n.focal,Di);for(let g of v){let P=Math.max(l,g.topY-$l);for(let S of i.subtract(g.outline,P))Bl(e,S,g.holes,P,l,s.tierTop,s.tierWall,u,!c,A);e.setMaterial(5),Yl(e,g.outline,g.holes,r.rowLevels,n.focal,P,s.tierWall),e.setMaterial(0)}v.length||ue(e,h,t.holes,()=>r.landingY,l,m,s.tierWall,ae);let x={tread:[m[0]*ae.top,m[1]*ae.top,m[2]*ae.top],riser:[m[0]*.72,m[1]*.72,m[2]*.72]};for(let g of d.length?d:[h])jc(e,r.rowLevels,n.focal,r.landingY,x,g,M);Ul(e,r.rowLevels,n.focal,l),Xl(e,r.rowLevels,t.outline,n.focal,M);return}let p=r.flat?1/0:nl,b=M=>r.normalAt(M.x,M.y),y=r.flat?r.landingY:void 0;for(let M of i.subtract(h,y))ue(e,M,t.holes,f,l,m,s.tierWall,ae,p,b)}function M0(e,t,n){let o=new Set;for(let a of e.objects)a.type==="section"&&o.add(a.id);let r=new Map;for(let a=0;a<t.length;a++){let s=n.seatOwner[a];if(!s||!o.has(s))continue;let c=n.bySection.get(s);if(c&&c.rowLevels.length>=2)continue;let l=t[a];if(l.kind==="booth")continue;let u=r.get(s);u||(u=new Map,r.set(s,u));let m=l.rowId||`__seat-${a}`,f=u.get(m);f||(f={pts:[],levelM:0,n:0},u.set(m,f)),f.pts.push({x:l.x,y:l.y}),f.levelM+=n.seatDeckY(a),f.n++}let i=[];for(let a of e.objects){if(a.type!=="section")continue;let s=n.bySection.get(a.id);if(s&&s.rowLevels.length>=2){let l=s.rowLevels.filter(u=>!u.patch).map(u=>({pts:u.pts,levelM:u.y}));l.length>=2&&i.push({sectionId:a.id,rows:l});continue}let c=r.get(a.id);c&&i.push({sectionId:a.id,rows:[...c.values()].map(l=>({pts:l.pts,levelM:l.levelM/l.n}))})}return i}function v0(e,t){let n=1/0;for(let o=0;o<t.length;o++){let r=t[o],i=t[(o+1)%t.length],a=i.x-r.x,s=i.y-r.y,c=Math.max(0,Math.min(1,((e.x-r.x)*a+(e.y-r.y)*s)/(a*a+s*s||1)));n=Math.min(n,Math.hypot(e.x-r.x-c*a,e.y-r.y-c*s))}return n}var $l=.02;function S0(e,t){let n=e.objects.filter(o=>o.type==="section"&&!!o.outline&&o.outline.length>=3).flatMap(o=>{let r=t.bySection.get(o.id);if(!r)return[];let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let u of o.outline)u.x<i&&(i=u.x),u.x>a&&(a=u.x),u.y<s&&(s=u.y),u.y>c&&(c=u.y);let l=r.landingY;for(let u of r.rowLevels)l=Math.min(l,u.y-$l);return[{outline:o.outline,holes:o.holes,surface:r,floorTop:l,minX:i,maxX:a,minY:s,maxY:c}]});return(o,r,i)=>{let a=null;for(let s of n){if(o<s.minX-i||o>s.maxX+i||r<s.minY-i||r>s.maxY+i)continue;let c={x:o,y:r};if(!ze(c,s.outline,s.holes)&&v0(c,s.outline)>i)continue;let l=Math.min(s.surface.deckAt(o,r),s.floorTop);(a===null||l<a)&&(a=l)}return a}}var w0=3,P0=.4;function Zl(e,t,n,o,r,i,a=!0){let s=M0(t,n,o);if(s.length<w0)return;let c=Dl(s,t.focal);if(!c)return;let l=Math.max(0,...c.rings.map(u=>u.arcs.reduce((m,f)=>m+f.binCount,0)))/c.binCount;e.setMaterial(5),Gl(e,c,{bottomY:t.baseHeightM,tierFrontLevels:s.map(u=>Math.min(...u.rows.map(m=>m.levelM))),colors:{bandTop:ce(r.tierTop,.8),bandWall:r.tierWall,shellTop:i??ce(r.tierWall,1.15),shellWall:i??r.tierWall},ao:ae,shapes:t.objects.filter(u=>u.type==="shape"),deriveShell:a&&l>=P0,standTopNear:S0(t,o)}),e.setMaterial(0)}var ql=4;var A0=[[/\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"]],I0=1.2,E0=12;function Ql(e){if(e.heightM!==void 0)return!1;let t=Me(e);if(!t||t.length<3)return!1;let n=0;for(let r=0;r<t.length;r++){let i=t[r],a=t[(r+1)%t.length];n+=Math.hypot(a.x-i.x,a.y-i.y)}return n*fe<E0*2?!1:2*lo(t)/n*fe<=I0}function Hi(e){if(!e)return null;for(let[t,n]of A0)if(t.test(e))return n;return null}var eu="auto-rows-";function tu(e){return e.id.startsWith(eu)&&!e.label}var R0=1.15,C0=.09,nu=6,_0=34,T0=.35,L0=6,k0=.35,O0=.75,F0=12,D0=2.5,N0=40,B0=[18,24],V0=[12,16],Jl=14,G0=.8,H0=.6,z0=5,j0=.3,ou=.4,ru=2,U0=400,W0=2.6,X0=.8,Y0=4,K0=26,$0=.7,Z0=.5,q0=.985,Q0=1.5,J0=2.2,ey=3,ty=25,ny=.985,oy=2,ry=6,iy=3,ay=.1,sy=1.5,cy=1.6,ly=6e3,uy=.6,my="#c3c7cd",zi=300,fy=240;function dy(e,t,n,o){if(!e.fill||!/^#[0-9a-f]{6}$/i.test(e.fill))return null;let r=Ui([...t]),i=new Set;for(let u of o)i.add(Math.floor(Math.atan2(u.y-r.y,u.x-r.x)*180/Math.PI/10));if(i.size*10<fy)return null;let{h:a,s,l:c}=qa($a(e.fill));return a<70/360||a>170/360||s<.2||c<.08||c>.75||n.some(u=>u!==e&&u.type==="shape"&&Me(u)?.some(m=>Yi(m,t)))?null:e.kind==="ellipse"?"oval-cricket":e.kind==="rect"?"pitch-football":null}var hy="Estimated from the drawing; confirm with the venue.",Wi=e=>{if(!e.length)return null;let t=[...e].sort((o,r)=>o-r),n=Math.floor(t.length/2);return t.length%2?t[n]:(t[n-1]+t[n])/2},Ui=e=>({x:e.reduce((t,n)=>t+n.x,0)/e.length,y:e.reduce((t,n)=>t+n.y,0)/e.length}),lo=e=>{let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return Math.abs(t)/2};function py(e){return e.height!==void 0||e.rake!==void 0||e.elevation!==void 0||e.surfaceKind!==void 0}function Xi(e){let t=new Map;for(let n of e){let o=t.get(n.rowId);o?o.push(n):t.set(n.rowId,[n])}return t}function Yi(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function Ki(e,t){let n=t[0],o=1/0;for(let r=0;r<t.length;r++){let i=t[r],a=t[(r+1)%t.length],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>0?Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l)):0,m={x:i.x+s*u,y:i.y+c*u},f=Math.hypot(e.x-m.x,e.y-m.y);f<o&&(o=f,n=m)}return n}function iu(e,t){let n=0,o=0;for(let r of e.values()){if(r.length<3)continue;let i=r[0],a=r[r.length-1],s=a.x-i.x,c=a.y-i.y,l=Math.hypot(s,c);if(l<1e-6)continue;let u={x:(i.x+a.x)/2,y:(i.y+a.y)/2},m=Ki(u,t),f=m.x-u.x,d=m.y-u.y,h=Math.hypot(f,d);h<1e-6||(o+=Math.abs((-c*f+s*d)/(l*h))*r.length,n+=r.length)}return n?o/n:0}function by(e,t,n){let o=e.filter(p=>p.type==="shape"),r=o.find(p=>p.role==="stage");if(r){let p=Me(r);return p?{shape:r,centre:Ui(p),outline:p,inferred:!1}:null}if(!n.length)return null;let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let p of n)i=Math.min(i,p.x),a=Math.max(a,p.x),s=Math.min(s,p.y),c=Math.max(c,p.y);let l=(a-i)*(c-s),u=[];for(let p of o){if(p.role)continue;let b=Me(p);if(!b)continue;let y=lo(b);if(y*fe*fe<6||y>l)continue;let M=Math.min(...b.map(w=>w.x)),v=Math.max(...b.map(w=>w.x)),A=Math.min(...b.map(w=>w.y)),x=Math.max(...b.map(w=>w.y)),g=0;for(let w of n)w.x>M&&w.x<v&&w.y>A&&w.y<x&&Yi(w,b)&&g++;if(g>n.length*.05)continue;let P=Ui(b),S=iu(t,b);S>=G0&&u.push({shape:p,centre:P,outline:b,score:S,area:y,box:[M,A,v,x]})}let m=(p,b)=>b!==p&&b.area>p.area&&p.box[0]>=b.box[0]-1e-6&&p.box[1]>=b.box[1]-1e-6&&p.box[2]<=b.box[2]+1e-6&&p.box[3]<=b.box[3]+1e-6,f=u.filter(p=>!u.some(b=>m(p,b))),d=Math.max(0,...f.map(p=>p.score)),h=f.filter(p=>p.score>=d-.03).sort((p,b)=>b.area-p.area)[0]??null;return h?{shape:h.shape,centre:h.centre,outline:h.outline,inferred:!0}:null}function yy(e,t,n){if(!n||n.length<3)return Math.hypot(e.x-t.x,e.y-t.y);let o=Ki(e,n);return Math.hypot(e.x-o.x,e.y-o.y)}function au(e){let t=[...e].sort((i,a)=>i.x-a.x||i.y-a.y);if(t.length<3)return t;let n=(i,a,s)=>(a.x-i.x)*(s.y-i.y)-(a.y-i.y)*(s.x-i.x),o=[];for(let i of t){for(;o.length>=2&&n(o[o.length-2],o[o.length-1],i)<=0;)o.pop();o.push(i)}let r=[];for(let i=t.length-1;i>=0;i--){let a=t[i];for(;r.length>=2&&n(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a)}return[...o.slice(0,-1),...r.slice(0,-1)]}function gy(e){if(!e.length||e.length>ly)return[];let t=[...Xi(e).values()],n=t.map((s,c)=>c),o=s=>n[s]===s?s:n[s]=o(n[s]),r=cy/fe,i=t.map(s=>({minX:Math.min(...s.map(c=>c.x))-r,maxX:Math.max(...s.map(c=>c.x))+r,minY:Math.min(...s.map(c=>c.y))-r,maxY:Math.max(...s.map(c=>c.y))+r}));for(let s=0;s<t.length;s++)for(let c=s+1;c<t.length;c++){let l=i[s],u=i[c];if(l.maxX<u.minX||u.maxX<l.minX||l.maxY<u.minY||u.maxY<l.minY)continue;t[s].some(f=>t[c].some(d=>Math.hypot(f.x-d.x,f.y-d.y)<=r))&&(n[o(s)]=o(c))}let a=new Map;return t.forEach((s,c)=>{let l=o(c),u=a.get(l);u?u.push(...s):a.set(l,[...s])}),[...a.values()].filter(s=>new Set(s.map(c=>c.rowId)).size>=2)}function xy(e,t,n){if(!t.length)return null;let o=t.filter(S=>n.tableIds.has(S.rowId)||S.kind==="booth").length>t.length/2,r=Xi(t),i=!n.outline||iu(r,n.outline)>=H0,a=0,s=0;for(let S of r.values()){if(S.length<2)continue;let w=S[0],E=S[S.length-1],T=E.x-w.x,F=E.y-w.y,R=Math.hypot(T,F);if(R<1e-6)continue;let I={x:(w.x+E.x)/2,y:(w.y+E.y)/2},_=i?n.outline?Ki(I,n.outline):n.focal:n.middle,k=-F/R,V=T/R;k*(_.x-I.x)+V*(_.y-I.y)<0&&(k=-k,V=-V),a+=k*S.length,s+=V*S.length}let c={x:t.reduce((S,w)=>S+w.x,0)/t.length,y:t.reduce((S,w)=>S+w.y,0)/t.length};if(Math.hypot(a,s)<1e-9){let S=i?n.focal:n.middle;a=S.x-c.x,s=S.y-c.y}let l=Math.hypot(a,s)||1,u={x:a/l,y:s/l},m=S=>-(S.x*u.x+S.y*u.y),f=S=>-S.x*u.y+S.y*u.x,d=1/0,h=-1/0,p=1/0,b=-1/0,y=1/0,M=new Map;for(let S of t){let w=m(S),E=f(S);d=Math.min(d,w),h=Math.max(h,w),p=Math.min(p,E),b=Math.max(b,E),i&&(y=Math.min(y,yy(S,n.focal,n.outline)));let T=S.logicalRowId??S.rowId,F=M.get(T);F?F.push(w):M.set(T,[w])}i||(y=Math.max(0,d-m(n.middle)));let v=[...M.values()].map(S=>Wi(S)).sort((S,w)=>S-w),A=[];if(!o)for(let S of v)A.length&&S-A[A.length-1]<k0/fe||A.push(S);let x=py(e),g=Ct(e,{floorBaseHeightM:n.baseHeightM}),P={id:e.id,section:e,authored:x,plane:n,facing:u,facesAction:i,hull:au(t),sample:t.filter((S,w)=>w%Math.ceil(t.length/U0)===0),frontD:d,backD:h,latMin:p,latMax:b,frontDistance:y,rowDepths:A,rowCount:A.length,level:0,height:g.height,rake:x?g.rake:0,backHeight:0};return P.backHeight=P.height+(h-d)*fe*Math.tan(P.rake*Math.PI/180),P}function My(e,t,n,o){if(e.length<2)return 0;let r=Math.max(1,t*fe),i=n+R0-o,a=0,s=0;for(let l=1;l<e.length;l++){let u=Math.max(O0,(e[l]-e[l-1])*fe),m=(i+C0)*(r+u)/r;a+=m-i,s+=u,i=m,r+=u}let c=Math.atan(a/s)*180/Math.PI;return Math.round(Math.max(nu,Math.min(_0,c))*10)/10}function vy(e,t,n=!1){if(!n&&e.facing.x*t.facing.x+e.facing.y*t.facing.y<j0)return null;let o=-1/0,r=1/0,i=-1/0;for(let f of t.hull){o=Math.max(o,-(f.x*e.facing.x+f.y*e.facing.y));let d=-f.x*e.facing.y+f.y*e.facing.x;r=Math.min(r,d),i=Math.max(i,d)}if(Math.min(e.latMax,i)-Math.max(e.latMin,r)<(n?1e-6:ou*(e.latMax-e.latMin)))return null;let s=ru/fe,c=new Map,l=new Map;for(let f of e.sample){let d=Math.floor((-f.x*e.facing.y+f.y*e.facing.x)/s),h=-(f.x*e.facing.x+f.y*e.facing.y);c.set(d,Math.min(c.get(d)??1/0,h))}for(let f of t.sample){let d=Math.floor((-f.x*e.facing.y+f.y*e.facing.x)/s),h=-(f.x*e.facing.x+f.y*e.facing.y);l.set(d,Math.max(l.get(d)??-1/0,h))}let u=[];for(let[f,d]of c){let h=l.get(f);h!==void 0&&u.push(d-h)}let m=u.length?Wi(u):e.frontD-o;return m<-1/fe?null:m}function Sy(e,t){if(t.plane.floorIndex>=e.plane.floorIndex)return!1;let n=-1/0,o=1/0,r=1/0,i=-1/0;for(let c of t.hull){let l=-(c.x*e.facing.x+c.y*e.facing.y);n=Math.max(n,l),o=Math.min(o,l);let u=-c.x*e.facing.y+c.y*e.facing.x;r=Math.min(r,u),i=Math.max(i,u)}let a=Math.min(e.latMax,i)-Math.max(e.latMin,r),s=Math.min(e.backD,n)-Math.max(e.frontD,o);return a>ou*(e.latMax-e.latMin)&&s>1/fe}function wy(e,t){let n=new Set;for(let o of e){let r=(Math.atan2(o.y-t.y,o.x-t.x)*180/Math.PI+360)%360;n.add(Math.floor(r/10))}return n.size/36}function Py(e,t){let n=1/0,o=-1/0;for(let i of t.hull){let a=-(i.x*e.facing.x+i.y*e.facing.y);n=Math.min(n,a),o=Math.max(o,a)}let r=Math.max(0,Math.min(o-n,e.frontD-n));return t.height+r*fe*Math.tan(t.rake*Math.PI/180)}function Ay(e,t){if(!e.facesAction)return!1;let n={x:-e.facing.y,y:e.facing.x},o=ru/fe,r=Math.max(1,Math.ceil((e.backD-e.frontD)/o)),i={left:new Map,right:new Map};for(let s of t)if(!(s===e||s.plane.floorIndex!==e.plane.floorIndex)&&!(s.facing.x*e.facing.x+s.facing.y*e.facing.y>=q0))for(let c of s.sample){let l=-(c.x*e.facing.x+c.y*e.facing.y);if(l<e.frontD||l>e.backD)continue;let u=-c.x*e.facing.y+c.y*e.facing.x,m=u<e.latMin?"left":u>e.latMax?"right":null;if(!m)return!1;let f=Math.min(r-1,Math.floor((l-e.frontD)/o)),d=m==="left"?e.latMin-u:u-e.latMax;d<(i[m].get(f)?.gap??1/0)&&i[m].set(f,{gap:d,other:s})}let a=s=>{let c=s==="left"?e.latMin:e.latMax,l=0;for(let[u,{other:m}]of i[s]){if((m.facing.x*n.x+m.facing.y*n.y)*(s==="left"?1:-1)<$0)continue;let d=e.frontD+(u+.5)*o,h={x:-d*e.facing.x+c*n.x,y:-d*e.facing.y+c*n.y},p=-(h.x*m.facing.x+h.y*m.facing.y),b=-h.x*m.facing.y+h.y*m.facing.x;p<m.frontD&&b>=m.latMin&&b<=m.latMax&&l++}return l/r>=Z0};return a("left")&&a("right")}function Iy(e,t){if(t.plane.floorIndex!==e.plane.floorIndex||t.facing.x*e.facing.x+t.facing.y*e.facing.y<ny)return!1;let n=1/0,o=-1/0,r=1/0;for(let s of t.hull){let c=-s.x*e.facing.y+s.y*e.facing.x;n=Math.min(n,c),o=Math.max(o,c),r=Math.min(r,-(s.x*e.facing.x+s.y*e.facing.y))}let i=(e.frontD-r)*fe;if(i<-oy||i>ry)return!1;let a=Math.max(n-e.latMax,e.latMin-o);return a*fe<=iy&&a*fe>=-ay}function Ey(e,t=!1,n=!1,o){let r=t?V0:B0,i=new Set(n?[]:e.filter(p=>!p.authored&&Ay(p,e))),a=[...e].sort((p,b)=>p.plane.floorIndex-b.plane.floorIndex||Number(i.has(b))-Number(i.has(p))||p.frontDistance-b.frontDistance);for(let p of i)o?.add(p.id);let s=(p,b,y)=>{let M=new Map,v=[],A=new Map,x=g=>{if(g.plane.floorIndex===0||g.plane.baseHeightM>0)return g.plane.baseHeightM;let P=A.get(g.plane.floorIndex-1);return P===void 0?g.plane.baseHeightM:P+ql};for(let g of a){if(i.has(g))g.height=x(g),g.level=0,g.rake=0,g.backHeight=g.height,M.set(g.id,void 0);else if(!g.authored){let S=x(g),w;for(let I of v){if(I.plane.floorIndex>g.plane.floorIndex)continue;if(Sy(g,I)){let O=Py(g,I)+W0;O>S&&(S=O,w=I);continue}let _=vy(g,I,i.has(I));if(_==null)continue;let k=n&&!!g.plane.stageDeck&&I.level===0&&I.plane.floorIndex===g.plane.floorIndex&&Math.max(0,_)*fe<=Y0,V=i.has(I)?I.height+Q0:k?I.backHeight:I.backHeight+T0+Math.min(L0,Math.max(0,_)*fe)*Math.tan(I.rake*Math.PI/180);V>S&&(S=V,w=I)}let E=p.get(g);E&&E.height>S+.01?(S=E.height,w=void 0):E=void 0,g.height=Math.round(Math.min(S,g.plane.baseHeightM+N0)*100)/100;let T=!w&&!E&&g.height>g.plane.baseHeightM;if(g.level=w?w.level+1:E?E.level:T?1:0,g.rake=My(g.rowDepths,g.frontDistance,g.height,g.plane.focalHeightM),!g.facesAction&&g.rowCount<z0)g.rake=0;else if(g.level===0){let I=Math.max(1e-6,(g.backD-g.frontD)*fe);g.rake=Math.min(g.rake,F0,Math.round(Math.atan(D0/I)*1800/Math.PI)/10)}else g.rowCount>=2&&(g.rake=Math.max(g.rake,r[Math.min(g.level,r.length)-1]));let F=(g.backD-g.frontD)*fe,R=w&&i.has(w)||E&&y?.has(E.id);if(b!==void 0&&R&&g.rowCount>=2&&(g.rake=b),t&&F>0&&g.height+F*Math.tan(g.rake*Math.PI/180)>g.plane.baseHeightM+Jl){let I=Math.max(0,g.plane.baseHeightM+Jl-g.height);g.rake=Math.max(nu,Math.round(Math.atan(I/F)*1800/Math.PI)/10)}n&&g.plane.stageDeck&&g.level>0&&(g.rake=Math.min(g.rake,K0)),g.backHeight=g.height+F*Math.tan(g.rake*Math.PI/180),M.set(g.id,w?.id??(E?M.get(E.id):void 0))}let P=g.plane.floorIndex;A.set(P,Math.min(A.get(P)??1/0,g.height)),v.push(g)}return M},c=s(new Map),l=new Map,u=p=>l.get(p)?.height??p.height;for(let p=!0,b=0;p&&b<e.length;b++){p=!1;for(let y of e)if(!(y.authored||i.has(y)))for(let M of e){let v=l.get(M)??M;M===y||v.height-v.plane.baseHeightM<sy||v.height<=u(y)+.01||Iy(y,M)&&(l.set(y,v),p=!0)}}let m=new Map(e.map(p=>[p.id,p])),f=e.filter(p=>!p.authored&&p.rowCount>=2&&i.has(m.get(c.get(p.id)??""))),d=f.length?Wi(f.map(p=>p.rake)):void 0;if(!l.size&&d===void 0)return c;let h=new Map([...new Set(l.values())].map(p=>[p,{...p}]));return s(new Map([...l].map(([p,b])=>[p,h.get(b)])),d,new Set(f.map(p=>p.id)))}var ji=(e,t)=>!!e&&e.x===t.x&&e.y===t.y;function ur(e,t={x:0,y:-40}){let n=dn(e),o=new Map;for(let y of n){if(!y.sectionId)continue;let M=o.get(y.sectionId);M?M.push(y):o.set(y.sectionId,[y])}let r={focalInferred:!1,confident:!1,sections:[]},i=e.floors?.length?e.floors.map((y,M)=>({objects:y.objects,floorIndex:M,floorId:y.id,baseHeightM:y.baseHeightM??0,focal:y.focalPoint??e.focalPoint})):[{objects:e.objects,floorIndex:0,floorId:void 0,baseHeightM:0,focal:e.focalPoint}],a=new Set(i.flatMap(y=>y.objects.filter(M=>M.type==="table").map(M=>M.id))),s=[],c,l=new Set,u=i.map(y=>{let M=R=>!e.floors?.length||R.floorId===y.floorId,v=gy(n.filter(R=>!R.sectionId&&R.kind!=="booth"&&!a.has(R.rowId)&&M(R))),A=[];for(let R of v){let I=st(pt(au(R)),uy/fe);if(n.some(k=>!M(k)&&Yi(k,I)))continue;let _=`${eu}${y.floorIndex}-${A.length}`;l.add(_),o.set(_,R),A.push({type:"section",id:_,label:"",color:my,outline:I})}let x=A.length?{...y,objects:[...y.objects,...A]}:y,g=new Set(x.objects.filter(R=>R.type==="section").map(R=>R.logicalSectionId??R.id)),P=[...o.entries()].filter(([R])=>g.has(R)).flatMap(([,R])=>R),S=by(x.objects,Xi(P),P),w=x.focal;(S||x.focal&&!ji(x.focal,t))&&(r.confident=!0),S&&(r.stage??={id:S.shape.id,inferred:S.inferred,...x.floorId?{floorId:x.floorId}:{}},(S.inferred||ji(x.focal,t))&&(w=S.centre,r.focalInferred=!0));let E=S&&(!S.inferred||lo(S.outline)*fe*fe<=zi),T=S?void 0:c,F={tableIds:a,floorIndex:x.floorIndex,floorId:x.floorId,baseHeightM:x.baseHeightM,focal:T?.focal??w,outline:S?.outline??T?.outline,focalHeightM:T?.focalHeightM??x.baseHeightM+(S&&E?lt({...S.shape,role:"stage"}).heightM:0),stageDeck:T?.stageDeck??!!(S&&E&&lo(S.outline)*fe*fe<=zi),middle:P.length?{x:P.reduce((R,I)=>R+I.x,0)/P.length,y:P.reduce((R,I)=>R+I.y,0)/P.length}:w};for(let R of x.objects){if(R.type!=="section")continue;let I=xy(R,o.get(R.logicalSectionId??R.id)??[],F);I&&s.push(I)}return F.outline&&(c=F),ji(x.focal,F.focal)||(r.focal??=[]).push({...x.floorId?{floorId:x.floorId}:{},point:{...F.focal}}),{unit:x,plane:F,stage:S,planeSeats:P}}),m=i.flatMap(y=>y.objects).map(y=>y.type==="shape"&&!y.role&&(Hi(y.label)==="wall"||!Hi(y.label)&&Ql(y))?{...y,role:"wall"}:y),f=kt({objects:m},n)!==null;f&&(r.indoor=!0);let d=new Set,h=Ey(s,f,wy(n,u[0]?.plane.focal??t)<X0,d),p=new Map(s.filter(y=>!y.authored).map(y=>[y.id,y])),b=u.map(({unit:y,plane:M,stage:v,planeSeats:A})=>y.objects.map(x=>{let g=x.type==="shape"&&!x.role&&x.id!==v?.shape.id?Hi(x.label):null;if(x.type==="shape"&&!x.role&&x.id!==v?.shape.id&&(g==="wall"||!g&&Ql(x))&&x.type==="shape"){(r.roles??=[]).push({id:x.id,...M.floorId?{floorId:M.floorId}:{},role:"wall"});let{fill:I,..._}=x;return{..._,role:"wall"}}if(g&&x.type==="shape")return(r.roles??=[]).push({id:x.id,...M.floorId?{floorId:M.floorId}:{},role:g}),{...x,role:g};let S=v?.inferred&&x.id===v.shape.id&&x.type==="shape"?dy(x,v.outline,y.objects,A):null;if(S&&x.type==="shape")return r.stage?.id===x.id&&(r.stage.field=S),{...x,role:"stage",stageKind:S};let w=x.type==="shape"&&x.id===v?.shape.id&&x.heightM===void 0&&!x.stageKind&&s.some(I=>I.plane===M&&(d.has(I.id)||I.level===0&&I.facesAction&&I.rake<=ey&&(I.frontDistance+I.backD-I.frontD)*fe>=ty)),E=w?{heightM:J0}:{};if(v?.inferred&&x.id===v.shape.id&&x.type==="shape"&&lo(v.outline)*fe*fe<=zi)return r.stage?.id===x.id&&(r.stage.deck=!0),{...x,role:"stage",...E};if(w&&x.type==="shape"&&x.role==="stage")return{...x,...E};let T=x.type==="section"?p.get(x.id):void 0;if(!T||x.type!=="section")return x;let F=T.rowCount>=2&&T.rake>0;l.has(T.id)?r.looseRowBlocks=(r.looseRowBlocks??0)+1:r.sections.push({id:T.id,floorId:M.floorId,surfaceKind:F?"rakedRows":"flat",height:T.height,rake:T.rake,stackedOn:h.get(T.id)});let R={status:"inferred",source:"public-2d-topology",note:hy};return{...x,height:T.height,rake:T.rake,surfaceKind:F?"rakedRows":"flat",physical3dProvenance:{height:R,rake:R,surfaceKind:R}}}));if(e.floors?.length){let y=e.floors.map((M,v)=>({...M,objects:b[v],focalPoint:u[v].plane.focal}));return{doc:{...e,floors:y,objects:y[0].objects,focalPoint:y[0].focalPoint},report:r}}return{doc:{...e,objects:b[0],focalPoint:u[0].plane.focal},report:r}}var su=/^[\p{L}\p{N}]{1,4}$/u,Ry=/^([\p{L}\p{N}]{2,})[\s\-\u2013\u2014\u00b7_./]+(.+)$/u;function cu(e,t){let n=t?.trim();if(!n)return e;let o=e.toLocaleLowerCase("en-US"),r=n.toLocaleLowerCase("en-US");if(o.startsWith(`${r} `)){let a=e.slice(n.length).trim();if(su.test(a))return a}let i=Ry.exec(e);if(i){let a=i[1].toLocaleLowerCase("en-US"),s=i[2].trim();if((r.startsWith(a)||a.startsWith(r))&&su.test(s))return s}return e}var lu={inline:"Inline booth \xB7 1 open side",corner:"Corner booth \xB7 2 open sides",peninsula:"Peninsula booth \xB7 3 open sides",island:"Island booth \xB7 4 open sides"},Cy=new Map(ei.map(e=>[e.key,e.label]));function _y(e){return`picker.access.${e}`}function uu(e){let t=[],n=e.boothType;n&&Object.prototype.hasOwnProperty.call(lu,n)&&t.push({key:`booth:${n}`,icon:"booth",titleKey:`picker.boothType.${n}`,titleFallback:lu[n],tone:"place"});let o=e.wheelchairSpaceType;for(let s of e.accessibility??[]){if(s==="wheelchair"&&o)continue;let c=Cy.get(s);c&&t.push({key:`access:${s}`,icon:s,titleKey:_y(s),titleFallback:c,tone:"access"})}o==="no-seat"?t.push({key:"wheelchair:no-seat",icon:"wheelchair",titleKey:"picker.emptyWheelchairSpace",titleFallback:"Empty wheelchair space",tone:"access"}):o==="seat-present"&&t.push({key:"wheelchair:seat-present",icon:"wheelchair",titleKey:"picker.accessiblePhysicalSeat",titleFallback:"Accessible physical seat",tone:"access"}),e.aisle===!0&&t.push({key:"place:aisle",icon:"aisle",titleKey:"picker.aisleSeat",titleFallback:"Aisle seat",tone:"place"});let r=e.commercial;r?.restrictedView&&t.push({key:"mark:restrictedView",icon:"restrictedView",titleKey:"picker.restrictedView",titleFallback:"Restricted view",tone:"warn"}),r?.obstructedView&&t.push({key:"mark:obstructedView",icon:"obstructedView",titleKey:"picker.obstructedView",titleFallback:"Obstructed view",tone:"warn"}),r?.premium&&t.push({key:"mark:premium",icon:"premium",titleKey:"picker.premiumSeat",titleFallback:"Premium seat",tone:"premium"});let i=r?.note?.trim();if(i){let s=t.find(c=>c.tone==="warn"||c.tone==="premium");s?s.note=i:t.push({key:"note",icon:"note",titleKey:"picker.organizerNote",titleFallback:"Organizer note",tone:"note",note:i})}let a=typeof e.entrance=="string"?e.entrance.trim():"";return a&&t.push({key:"place:entrance",icon:"entrance",titleKey:"picker.entrance",titleFallback:"Entrance",tone:"place",note:a}),t}function mu(e,t,n){return n<0?t>1?e.filter(o=>o.kind==="floor"):[...e]:e.filter(o=>o.floorIndex===void 0||o.floorIndex===n)}function fu(e,t){let n=[...e].sort((r,i)=>r.screen.y-i.screen.y),o=[];for(let r of n){let i=o.find(a=>a.some(s=>Math.abs(s.screen.x-r.screen.x)<104&&Math.abs(s.screen.y-r.screen.y)<34));i?i.push(r):o.push([r])}return o.flatMap(r=>r.length<2?r:r.map((i,a)=>({...i,screen:{...i.screen,x:Math.max(54,Math.min(t-54,i.screen.x+(a-(r.length-1)/2)*104))}})))}var Ty=1.15,Ly=2.75,ky=4.5,Oy=.85,Fy=.5,Dy=.26;function du(e,t,n){let o=Math.max(1e-6,t),r=e/o,i=n?.hasZoneLabels??!0,a=new Set(["stage","gate"]);return r>=.75&&a.add("floor"),r>=Ty&&a.add("zone"),r<=(i?Ly:ky)&&(a.add("section"),a.add("ga")),r<=Oy&&(a.add("annotation"),a.add("booth")),r<=Fy&&a.add("row"),r<=Dy&&a.add("seat"),a}function hu(e,t,n,o,r,i=6){let a=i+t,s=o-i-t,c=i+n,l=r-i-n;return{...e,x:a>s?o/2:Math.max(a,Math.min(s,e.x)),y:c>l?r/2:Math.max(c,Math.min(l,e.y))}}function gt(e,t,n,o){let r=e,i=t[0],a=t[1],s=t[2],c=r[0]*i+r[4]*a+r[8]*s+r[12],l=r[1]*i+r[5]*a+r[9]*s+r[13],u=r[2]*i+r[6]*a+r[10]*s+r[14],m=r[3]*i+r[7]*a+r[11]*s+r[15];if(!(m>1e-6))return{x:0,y:0,depth:1/0,visible:!1};let f=c/m,d=l/m,h=u/m,p=f>=-1.05&&f<=1.05&&d>=-1.05&&d<=1.05&&h<=1;return{x:(f*.5+.5)*n,y:(1-(d*.5+.5))*o,depth:h,visible:p}}function pu(e,t,n=t,o=()=>0){let r=[],i=[...e].sort((a,s)=>o(s)-o(a)||a.screen.depth-s.screen.depth);for(let a of i){let s=!1;for(let c of r)if(uo(a,c,t,n)){s=!0;break}s||r.push(a)}return r}var Ny=6;function uo(e,t,n,o){let r=Math.abs(e.screen.x-t.screen.x),i=Math.abs(e.screen.y-t.screen.y),a=e.halfWidth!=null&&t.halfWidth!=null?Math.max(n,e.halfWidth+t.halfWidth+Ny):n;return r<a&&i<o}function bu(e,t,n){return e.length*t*.58+(n?14:0)}var By={row:8,seat:14};function yu(e){return e<480?{row:5,seat:8}:e<768?{row:6,seat:10}:By}function gu(e,t,n,o){let r=Math.max(1,Math.min(n,o)*.5),i=Math.min(2,Math.hypot(e.x-n/2,e.y-o/2)/r);return t*(1+1.5*i)}function mo(e,t,n,o,r=[]){let i=[...e].sort((s,c)=>(c.priority??0)-(s.priority??0)||s.focus-c.focus),a=[];for(let s of i){if(a.length>=o)break;let c=!1;for(let l of r)if(uo(s,l,t,n)){c=!0;break}if(!c){for(let l of a)if(uo(s,l,t,n)){c=!0;break}}c||a.push(s)}return a}function $i(e,t,n,o){let r=e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15];return r<=0||!(n>0)?0:n*Math.hypot(e[0],e[4],e[8])*o/(2*r)}var Vy=1.5,Gy=30,Hy=4,zy=3.6,jy=6,Zi=15,Uy=3,Wy=1;function Xy(e){return Math.max(zy,Math.min(jy,2.4+.15*e))}var fo=Math.PI*2;function Yy(e,t){let n=0,o=0;for(let m of e)n+=m.x,o+=m.y;let r=Math.atan2(o/e.length-t.y,n/e.length-t.x),i=e.map(m=>{let f=Math.atan2(m.y-t.y,m.x-t.x)-r;for(;f>Math.PI;)f-=fo;for(;f<-Math.PI;)f+=fo;return f+r}),a=i.map((m,f)=>f).sort((m,f)=>i[m]-i[f]),s=i[a[0]],c=i[a[a.length-1]];if(c-s>Math.PI)return null;let l=m=>Math.hypot(m.x-t.x,m.y-t.y),u=m=>{let f=e[m],d=(m+e.length-1)%e.length,h=(m+1)%e.length,p=Math.abs(i[d]-i[m])<=Math.abs(i[h]-i[m])?d:h,b=e[p];return l(f)<=l(b)?[f,b]:[b,f]};return{start:s,end:c,startEdge:u(a[0]),endEdge:u(a[a.length-1])}}function xu(e){return e.type==="shape"&&e.role==="wall"&&e.heightM===void 0}function qi(e,t,n=()=>!0){let o=[];for(let c of e){if(!xu(c)||!n(c))continue;let l=Me(c);if(!l||l.length<3)continue;let u=Yy(l,t);if(!u)return[];o.push(u)}if(o.length<2)return[];let r=e.flatMap(c=>{if(c.type!=="shape"||c.role!=="entrance"&&c.role!=="exit")return[];let l=Me(c);if(!l?.length)return[];let u=0,m=0;for(let f of l)u+=f.x,m+=f.y;return[{x:u/l.length,y:m/l.length}]}),i=c=>(c%fo+fo)%fo;o.sort((c,l)=>i(c.start)-i(l.start));let a=c=>Math.hypot(c.x-t.x,c.y-t.y),s=[];for(let c=0;c<o.length;c++){let l=o[c],u=o[(c+1)%o.length],m=i(u.start-l.end);if(m<=0||m>=Math.PI/2)continue;let f=g=>i(g-l.end)<m;if(o.some(g=>g!==l&&g!==u&&(f(g.start)||f(g.end)||i(l.end-g.start)<g.end-g.start)))continue;let[h,p]=l.endEdge,[b,y]=u.startEdge,M={x:(h.x+p.x)/2,y:(h.y+p.y)/2},v={x:(b.x+y.x)/2,y:(b.y+y.y)/2},A=Math.hypot(v.x-M.x,v.y-M.y)*C;if(A<Vy||A>Gy||Math.abs(a(M)-a(v))*C>Hy+.2*A)continue;let x={x:(M.x+v.x)/2,y:(M.y+v.y)/2};r.some(g=>f(Math.atan2(g.y-t.y,g.x-t.x))&&Math.abs(a(g)-a(x))*C<=Uy)||s.push({quad:[h,p,y,b],mid:x,widthM:A,openingM:Xy(A)})}return s}function Mu(e,t){let n=[];for(let i of t)if(i.text?.trim())for(let a of e){let s=Math.hypot(i.position.x-a.mid.x,i.position.y-a.mid.y)*C;s<=Zi&&n.push({text:i,gate:a,d:s})}n.sort((i,a)=>i.d-a.d);let o=new Map,r=new Set;for(let{text:i,gate:a}of n)o.has(i.id)||r.has(a)||(o.set(i.id,a),r.add(a));return o}function vu(e,t,n,o,r,i,a,s=()=>!0){let c=qi(t,vn(n),s);if(!c.length)return;let l=t.find(m=>xu(m)&&s(m)),u=or(l?.fill,a);e.setMaterial(Ko);for(let m of c)r-m.openingM<Wy||Zo(e,m.quad,o+m.openingM,o+r,[],u.top,u.wall,i,r);e.setMaterial(0)}var Ky=6,$y=2.2,mr=.1,Zy=/^(gate|entrance|entry|exit|way in|way out|door)s?$/i,qy=new Set(["stage","entrance","exit","screen","suite","obstruction","sound","bar","concession","restroom","coat"]),Qy=.3,Jy=1.8,eg=.9,tg=.55,ng=1,Su=4e3,og=6,wu="#d8a425",rg="#e8c15a",Qi="#1c1608";function Pu(e){let t=ig(e);if(!t)return null;let n=uu(e).find(o=>o.icon===t.icon);return{...t,name:n?.titleFallback??t.icon}}function ig(e){let t=e.accessibility;if(t?.length)return{icon:t.includes("wheelchair")?"wheelchair":t[0],color:_o(t)};let n=e.commercial;return n?.obstructedView?{icon:"obstructedView",color:wu,ink:Qi}:n?.restrictedView?{icon:"restrictedView",color:wu,ink:Qi}:n?.premium?{icon:"premium",color:rg,ink:Qi}:null}function ag(e,t){if(!e)return;let n,o=0;for(let[i,a]of e)a>o&&(o=a,n=i);let r=t.categories?.find(i=>i.key===n)?.color;return r&&/^#[0-9a-f]{6}$/i.test(r)?r:void 0}var sg=6e3,cg=.25,Au=[-90,90,-135,135,-45,45];function lg(e,t,n,o){let r=e.flatMap(({id:a,a:s,members:c})=>{let l=(s.minX+s.maxX)/2,u=(s.minY+s.maxY)/2,m=.5*Math.hypot(s.maxX-s.minX,s.maxY-s.minY),f=1/0;for(let d of c)f=Math.min(f,Math.hypot(t[d].x-l,t[d].y-u));return c.length&&f>=m*cg?[{id:a,cx:l,cy:u,half:m,members:c}]:[]}).sort((a,s)=>a.half-s.half),i=new Map;return r.forEach(({id:a,cx:s,cy:c,members:l},u)=>{let m=o.x-s,f=o.y-c,p=(Math.hypot(m,f)>1e-6?Math.atan2(f,m):0)+Au[u%Au.length]*Math.PI/180,b=Math.cos(p),y=Math.sin(p),M=-1,v=-1/0;for(let A of l){let x=(t[A].x-s)*b+(t[A].y-c)*y;x>v&&(v=x,M=A)}i.set(a,[t[M].x*C,n.seatDeckY(M),t[M].y*C])}),i}function Eu(e){let{doc:t,units:n,seats:o,surfaces:r,focal:i}=e,a=t.zones??[],s=[];if(a.length){let c=new Map;for(let f of n)for(let d of f.objects)d.type==="section"&&d.zone&&c.set(d.id,d.zone);let l=new Map,u=new Map;for(let f=0;f<o.length;f++){let d=o[f],h=r.seatOwner[f],p=d.zoneId??(h?c.get(h):void 0);if(!p)continue;let b=l.get(p);b||(b={n:0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,sumY:0},l.set(p,b));let y=u.get(p);y||u.set(p,y=[]),y.push(f),b.n++,d.x<b.minX&&(b.minX=d.x),d.y<b.minY&&(b.minY=d.y),d.x>b.maxX&&(b.maxX=d.x),d.y>b.maxY&&(b.maxY=d.y),b.sumY+=r.seatDeckY(f)}let m=lg(a.flatMap(f=>{let d=l.get(f.id);return d?[{id:f.id,a:d,members:u.get(f.id)??[]}]:[]}),o,r,i);for(let f of a){let d=l.get(f.id),h=[];for(let[p,b]of c)b===f.id&&h.push(p);if(!d||d.n===0){s.push({id:f.id,label:f.label,color:be(f.color),sectionIds:h,seatCount:0,center:[0,0,0],radius:0,focalWorld:[(f.focalPoint??i).x*C,1.5,(f.focalPoint??i).y*C]});continue}s.push({id:f.id,label:f.label,color:be(f.color),sectionIds:h,seatCount:d.n,...m.has(f.id)?{labelAt:m.get(f.id)}:{},center:[(d.minX+d.maxX)/2*C,d.sumY/d.n,(d.minY+d.maxY)/2*C],radius:.5*Math.hypot((d.maxX-d.minX)*C,(d.maxY-d.minY)*C)||1,focalWorld:[(f.focalPoint??i).x*C,1.5,(f.focalPoint??i).y*C]})}}return s}function Ru(e){let{doc:t,units:n,seats:o,surfaces:r,seatData:i,hintedSeatFloor:a,zones:s,focal:c}=e,l=[],u=[],m=[],f=new Map;for(let d of n)for(let h of d.objects){if(h.type!=="section"||!h.zone)continue;let p=(h.displayLabel||h.label||"").trim().toLocaleLowerCase();if(!p)continue;let b=t.floors?.[d.index]?.name?.trim().toLocaleLowerCase();if(n.length>1&&b===p)continue;let y=f.get(h.zone);y||f.set(h.zone,y=new Set),y.add(p)}for(let d of s)d.seatCount!==0&&(f.get(d.id)?.has(d.label.trim().toLocaleLowerCase())||l.push({id:`zone:${d.id}`,kind:"zone",text:d.label,anchor:[(d.labelAt??d.center)[0],(d.labelAt??d.center)[1]+Ky,(d.labelAt??d.center)[2]],color:t.zones?.find(h=>h.id===d.id)?.color}));{let d=new Map,h=new Map,p=new Map,b=new Map;for(let y=0;y<o.length;y++){let M=r.seatOwner[y];if(!M)continue;let v=d.get(M);v||(v={n:0,x:0,y:0,deck:0},d.set(M,v)),v.n++,v.x+=o[y].x,v.y+=o[y].y,v.deck+=r.seatDeckY(y);let A=o[y].categoryKey;if(A){let g=h.get(M);g||(g=new Map,h.set(M,g)),g.set(A,(g.get(A)??0)+1)}if(o[y].accessibility?.includes("wheelchair")){let g=p.get(M);g?g.push(y):p.set(M,[y])}let x=b.get(M);x||(x={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0,minDeck:1/0,maxDeck:-1/0},b.set(M,x)),x.minDeck=Math.min(x.minDeck,r.seatDeckY(y)),x.maxDeck=Math.max(x.maxDeck,r.seatDeckY(y)),o[y].x<x.minX&&(x.minX=o[y].x),o[y].x>x.maxX&&(x.maxX=o[y].x),o[y].y<x.minY&&(x.minY=o[y].y),o[y].y>x.maxY&&(x.maxY=o[y].y)}for(let y of n)for(let M of y.objects){if(M.type!=="section"||tu(M))continue;let v=d.get(M.id);if(!v||v.n===0)continue;let A=b.get(M.id),x=[v.x/v.n*C,v.deck/v.n,v.y/v.n*C],g=M.displayLabel||M.label||M.id;u.push({id:M.id,floorIndex:y.index,label:g,seatCount:v.n,center:x,radius:Math.max(1,Math.hypot(A.maxX-A.minX,A.maxY-A.minY)*.5*C),box:{min:[A.minX*C-.4,A.minDeck,A.minY*C-.4],max:[A.maxX*C+.4,A.maxDeck+1,A.maxY*C+.4]},focalWorld:[y.focal.x*C,y.baseHeightM+1.5,y.focal.y*C]});let P=t.floors?.[y.index]?.name?.trim().toLocaleLowerCase();if(!(n.length>1&&P===g.trim().toLocaleLowerCase())){let S=ag(h.get(M.id),t),w=p.get(M.id);l.push({id:`section:${M.id}`,kind:"section",text:g,anchor:[x[0],x[1]+$y,x[2]],floorIndex:y.index,...S?{tint:S}:{},...w?{wheelchairSeats:w}:{}})}}}{for(let x of n)for(let g of x.objects){if(g.type!=="gaArea")continue;let P=cn(g.points);if(!P)continue;let S=g.labelPresentation?.visible===!1?"":g.displayLabel||g.label||g.id,w=g.capacity>0?[S,g.capacity.toLocaleString()].filter(Boolean).join(" \xB7 "):S;w&&l.push({id:`ga:${g.id}`,kind:"ga",text:w,anchor:[P.x*C,x.baseHeightM+Jy,P.y*C],floorIndex:x.index})}let d=new Map,h=new Map;for(let x of n)for(let g of x.objects)if(g.type==="section"&&d.set(g.id,g.displayLabel||g.label||g.id),g.type==="row"){let P=g.displayLabel?.trim()||g.segmentedRow?.displayLabel?.trim();P&&h.set(g.id,P)}let p=new Map;for(let x=0;x<o.length;x++){let g=o[x],P=Math.hypot(g.x-c.x,g.y-c.y),S=p.get(g.rowId);(!S||P>S.far)&&p.set(g.rowId,{seat:g,index:x,far:P})}for(let[x,g]of p){let P=r.seatOwner[g.index]??g.seat.sectionId,S=Iu(g.seat.label,x,d.get(P??""),h.get(x));S&&l.push({id:`row:${x}`,kind:"row",text:S,anchor:[g.seat.x*C,r.seatDeckY(g.index)+eg,g.seat.y*C],floorIndex:a[g.index]})}let b=new Map;for(let x=0;x<o.length;x++){let g=o[x],P=b.get(g.rowId);P||(P={n:0,x:0,y:0,z:0,minX:1/0,maxX:-1/0,minZ:1/0,maxZ:-1/0,label:Iu(g.label,g.rowId,d.get(r.seatOwner[x]??g.sectionId??""),h.get(g.rowId)),sectionId:r.seatOwner[x]??g.sectionId},b.set(g.rowId,P));let S=x*3,w=i.iPosition[S],E=i.iPosition[S+1],T=i.iPosition[S+2];P.n++,P.x+=w,P.y+=E,P.z+=T,P.minX=Math.min(P.minX,w),P.maxX=Math.max(P.maxX,w),P.minZ=Math.min(P.minZ,T),P.maxZ=Math.max(P.maxZ,T)}for(let[x,g]of b)m.push({id:x,label:g.label,sectionId:g.sectionId,seatCount:g.n,center:[g.x/g.n,g.y/g.n,g.z/g.n],radius:Math.max(.8,Math.hypot(g.maxX-g.minX,g.maxZ-g.minZ)*.5)});let y=0,M=(x,g)=>{y++,l.push({id:`access:${o[x].id}`,kind:"access",text:g.name,icon:g.icon,color:g.color,...g.ink?{ink:g.ink}:{},seatWidthM:i.iChairWidth[x]*2,anchor:[o[x].x*C,r.seatDeckY(x)+ng,o[x].y*C],floorIndex:a[x],rowId:o[x].rowId})},v=null,A=()=>{if(v){let x=Pu(o[v.seats[0]]),g=v.seats.length,P=Math.max(1,Math.round(g/og));for(let S=0;S<P&&y<Su;S++)M(v.seats[Math.min(g-1,Math.floor((S+.5)*g/P))],x)}v=null};for(let x=0;x<o.length&&y<Su;x++){let g=Pu(o[x]);if(g&&o[x].accessibility?.length){A(),M(x,g);continue}if(!g){A();continue}v&&v.rowId===o[x].rowId&&v.icon===g.icon?v.seats.push(x):(A(),v={rowId:o[x].rowId,icon:g.icon,seats:[x]})}if(A(),o.length<=sg)for(let x=0;x<o.length;x++){let g=o[x],P=Ji(g.displayLabel||g.label);P&&l.push({id:`seat:${g.id}`,kind:"seat",seatWidthM:i.iChairWidth[x]*2,text:P,anchor:[g.x*C,r.seatDeckY(x)+tg,g.y*C],floorIndex:a[x],rowId:g.rowId})}}for(let d of n){let h=kt(d,n.length===1?o:o.filter((y,M)=>a[M]===d.index)),p=h?Mu(qi(d.objects,vn(h)),d.objects.filter(y=>y.type==="text")):new Map,b=[...p.values()];for(let y of d.objects){let M=y.type==="text"?p.get(y.id):void 0;if(y.type==="shape"&&(y.role==="entrance"||y.role==="exit")&&Zy.test(y.label?.trim()??"")){let v=Me(y),A=v?cn(v):null;if(A&&b.some(x=>Math.hypot(A.x-x.mid.x,A.y-x.mid.y)*C<=Zi+x.widthM))continue}if(M&&y.type==="text")l.push({id:`text:${y.id}`,kind:"gate",text:y.text,icon:"entrance",anchor:[M.mid.x*C,d.baseHeightM+M.openingM+mr,M.mid.y*C],color:y.color,floorIndex:d.index});else if(y.type==="shape"&&y.role&&qy.has(y.role)){let v=Me(y),A=v?cn(v):null;if(!A||!y.label||y.gate?.hideFromBuyers)continue;l.push({id:`architecture:${y.id}`,kind:y.role==="stage"?"stage":y.role==="entrance"||y.role==="exit"?"gate":"annotation",text:y.label,...y.role==="entrance"||y.role==="exit"?{icon:y.role}:{},...y.gate?.stepFree?{stepFree:!0}:{},anchor:[A.x*C,d.baseHeightM+lt(y).heightM+mr,A.y*C],color:y.fill,floorIndex:d.index})}else if(y.type==="text"){let v=y.semanticKind==="icon"?no(y.iconKey)?.key:void 0,A=y.text||(v?no(v).label:"");if(!A)continue;l.push({id:`text:${y.id}`,kind:"annotation",text:A,...v?{venueIcon:v}:{},anchor:v?[(y.position.x+y.fontSize/2)*C,d.baseHeightM+mr,(y.position.y+y.fontSize/2)*C]:[y.position.x*C,d.baseHeightM+mr,y.position.y*C],color:y.color,rotation:y.rotation,floorIndex:d.index})}else if(y.type==="booth"){if(y.labelPresentation?.visible===!1)continue;let v=ut(y);if(!v)continue;let A=cn(v);if(!A)continue;l.push({id:`booth:${y.id}`,kind:"booth",text:y.displayLabel||y.label||y.id,anchor:[A.x*C,d.baseHeightM+rr+Qy,A.y*C],floorIndex:d.index})}}}return{labels:l,sections:u,rows:m}}function Cu(e,t){if(t.length>1)for(let n of t)e.push({id:`floor:${n.id}`,kind:"floor",text:n.label,anchor:[n.center[0],n.box.max[1]+1.2,n.center[2]],floorIndex:n.index})}function Ji(e){let t=e.lastIndexOf("-");return t>=0&&t<e.length-1?e.slice(t+1):e}function Iu(e,t,n,o){if(o?.trim())return o.trim();let r=e?e.lastIndexOf("-"):-1,i=r>0?e.slice(0,r):t;return i&&cu(i,n)}function _u(e){let{doc:t,units:n,seats:o,surfaces:r,solids:i,hintedSeatFloor:a,seatFloor:s}=e,c=[];{let l=n.map(()=>({minX:1/0,minY:1/0,minZ:1/0,maxX:-1/0,maxY:-1/0,maxZ:-1/0}));for(let f=0;f<i.floor.length;f+=1){let d=Math.max(0,Math.min(n.length-1,Math.round(i.floor[f]))),h=f*3,p=l[d];p.minX=Math.min(p.minX,i.position[h]),p.minY=Math.min(p.minY,i.position[h+1]),p.minZ=Math.min(p.minZ,i.position[h+2]),p.maxX=Math.max(p.maxX,i.position[h]),p.maxY=Math.max(p.maxY,i.position[h+1]),p.maxZ=Math.max(p.maxZ,i.position[h+2])}let u=new Map;for(let f=0;f<n.length;f++)for(let d of n[f].objects)d.type==="section"&&u.set(d.id,f);let m=n.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 f=0;f<o.length;f++){let d=r.seatOwner[f],h=(d!==null?u.get(d):void 0)??a[f];if(h===void 0)continue;let p=m[h],b=o[f];p.n++,b.x<p.minX&&(p.minX=b.x),b.y<p.minY&&(p.minY=b.y),b.x>p.maxX&&(p.maxX=b.x),b.y>p.maxY&&(p.maxY=b.y);let y=r.seatDeckY(f);p.sumX+=b.x*C,p.sumDeck+=y,p.sumZ+=b.y*C,p.minDeck=Math.min(p.minDeck,y),p.maxDeck=Math.max(p.maxDeck,y+1.6),s[f]=h}for(let f=0;f<n.length;f++){let d=m[f],h=t.floors?.[f],p=l[f],b=Math.min(d.n?d.minX*C:n[f].focal.x*C-1,Number.isFinite(p.minX)?p.minX:1/0),y=Math.max(d.n?d.maxX*C:n[f].focal.x*C+1,Number.isFinite(p.maxX)?p.maxX:-1/0),M=Math.min(d.n?d.minY*C:n[f].focal.y*C-1,Number.isFinite(p.minZ)?p.minZ:1/0),v=Math.max(d.n?d.maxY*C:n[f].focal.y*C+1,Number.isFinite(p.maxZ)?p.maxZ:-1/0),A=Math.min(d.n?Math.min(n[f].baseHeightM,d.minDeck):n[f].baseHeightM,Number.isFinite(p.minY)?p.minY:1/0),x=Math.max(d.n?Math.max(d.maxDeck,A+.5):A+.5,Number.isFinite(p.maxY)?p.maxY:-1/0),g=[d.n?d.sumX/d.n:(b+y)/2,d.n?d.sumDeck/d.n:(A+x)/2,d.n?d.sumZ/d.n:(M+v)/2],P=Math.max(1,.5*Math.hypot(y-b,x-A,v-M));c.push({index:f,id:h?.id??`floor-${f}`,label:h?.name??(n.length>1?`Floor ${f+1}`:"Venue"),seatCount:d.n,center:g,radius:P,box:{min:[b,A,M],max:[y,x,v]},focalWorld:[n[f].focal.x*C,n[f].baseHeightM+1.5,n[f].focal.y*C]})}}return c}function ea(e,t){let n=1/0,o=1/0,r=-1/0,i=-1/0,a=(s,c)=>{s<n&&(n=s),c<o&&(o=c),s>r&&(r=s),c>i&&(i=c)};for(let s of t)a(s.x,s.y);for(let s of e)for(let c of s.objects)if(c.type==="section")for(let l of c.outline)a(l.x,l.y);else if(c.type==="shape"&&c.points)for(let l of c.points)a(l.x,l.y);else if(c.type==="gaArea")for(let l of c.points)a(l.x,l.y);else if(c.type==="booth"){let l=ut(c);if(l)for(let u of l)a(u.x,u.y)}else if(c.type==="table"){let l=ir(c);if(l)for(let u of l)a(u.x,u.y)}else if(c.type==="decorImage"){let l=ar(c);if(l)for(let u of l)a(u.x,u.y)}return Number.isFinite(n)||(n=-100,o=-100,r=100,i=100),{minX:n,minY:o,maxX:r,maxY:i}}function Du(e,t,n,o,r,i,a){if(t.length===1){let s=n.map(f=>({x:f.x,y:f.y}));for(let f of t[0].objects)f.type==="section"?s.push(...f.outline):f.type==="shape"?s.push(...Me(f)??f.points??[]):f.type==="gaArea"?s.push(...f.points):f.type==="booth"?s.push(...ut(f)??[]):f.type==="table"?s.push(...ir(f)??[]):f.type==="decorImage"&&s.push(...ar(f)??[]);if(ku(e,t[0],n,i)||Fu(e,t[0],n,s,i))return!1;if(a&&Lu(e,t[0].baseHeightM,s,i,a))return!0;let c=oo(s),l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2,m=c.length>=3?c.map(f=>{let d=f.x-l,h=f.y-u,p=Math.max(1,Math.hypot(d,h));return{x:f.x+d/p*80,y:f.y+h/p*80}}):Kn(r.minX-28,r.minY-28,r.maxX-r.minX+56,r.maxY-r.minY+56);return ue(e,m,void 0,()=>-.04,-.22,i.ground,i.ground,ae),!1}else{let s=t.reduce((b,y)=>y.baseHeightM<b.baseHeightM?y:b);e.setFloor(s.index);let c={...s,objects:t.flatMap(b=>b.objects)},l=n.map(b=>({x:b.x,y:b.y}));for(let b of c.objects)b.type==="section"&&l.push(...b.outline);if(ku(e,c,n,i)||Fu(e,c,n,l,i))return!1;if(a&&Lu(e,s.baseHeightM,l,i,a))return!0;let u=n.filter((b,y)=>o[y]===s.index),m=ea([s],u),f=Math.hypot(m.maxX-m.minX,m.maxY-m.minY),d=Math.max(28,Math.min(80,f*.04)),h=Kn(m.minX-d,m.minY-d,m.maxX-m.minX+d*2,m.maxY-m.minY+d*2),p=s.baseHeightM-.03;return ue(e,h,void 0,()=>p,p-.22,i.ground,i.ground,ae),!1}}function ta(e,t,n,o){let{cx:r,cz:i,radius:a}=n,s=1/0,c=1/0,l=1/0,u=-1/0,m=-1/0,f=-1/0,d=(b,y,M)=>{s=Math.min(s,b),u=Math.max(u,b),c=Math.min(c,y),m=Math.max(m,y),l=Math.min(l,M),f=Math.max(f,M)};for(let b=0;b<e.position.length;b+=3){let y=b/3;o&&y>=o[0]&&y<o[1]||d(e.position[b],e.position[b+1],e.position[b+2])}for(let b=0;b<t.count;b++){let y=b*3,M=t.iPosition[y],v=t.iPosition[y+1],A=t.iPosition[y+2],x=Math.max(.35,t.iMaxRadius[b]??.35);d(M-x,v,A-x),d(M+x,v+1.6,A+x)}Number.isFinite(s)||(s=r-a,u=r+a,c=0,m=a*.16,l=i-a,f=i+a);let h=[(s+u)/2,(c+m)/2,(l+f)/2],p=Math.max(1,.5*Math.hypot(u-s,m-c,f-l));return{center:h,radius:p,minY:c,maxY:m}}var ug=4096;function Nu(e,t,n=[]){let o=Math.max(1,Math.ceil(e.count/ug)),r=Math.ceil(e.count/o),i=new Float32Array((r*2+t.length*4+n.length)*3),a=0;for(let s=0;s<e.count;s+=o){let c=e.iPosition[s*3],l=e.iPosition[s*3+1],u=e.iPosition[s*3+2];i[a++]=c,i[a++]=l,i[a++]=u,i[a++]=c,i[a++]=0,i[a++]=u}for(let[s,c,l]of n)i[a++]=s,i[a++]=c,i[a++]=l;for(let s of t)for(let[c,l]of[[-1,-1],[1,-1],[1,1],[-1,1]])i[a++]=s.cx+c*s.halfX,i[a++]=s.y,i[a++]=s.cz+l*s.halfZ;return i.subarray(0,a)}function Bu(e,t,n,o,r,i,a=[]){let s=1/0,c=1/0,l=-1/0,u=-1/0;for(let x=0;x<e.count;x++){let g=x*3,P=e.iPosition[g],S=e.iPosition[g+2];P<s&&(s=P),P>l&&(l=P),S<c&&(c=S),S>u&&(u=S)}for(let[x,,g]of a)x<s&&(s=x),x>l&&(l=x),g<c&&(c=g),g>u&&(u=g);for(let x of t)s=Math.min(s,x.cx-x.halfX),l=Math.max(l,x.cx+x.halfX),c=Math.min(c,x.cz-x.halfZ),u=Math.max(u,x.cz+x.halfZ);let m=n.minX*C,f=n.maxX*C,d=n.minY*C,h=n.maxY*C,p=m,b=f,y=d,M=h;if(Number.isFinite(s)){let x=Math.max(2,.06*Math.hypot(l-s,u-c));p=Math.max(m,s-x),b=Math.min(f,l+x),y=Math.max(d,c-x),M=Math.min(h,u+x)}let v=Math.min(0,o),A=Math.max(r,i*.05);return{min:[p,v,y],max:[b,A,M]}}var Tu=12,mg=.6,fg=40;function Lu(e,t,n,o,r){let i=oo([...n]);if(i.length<3)return!1;let a=1/0,s=1/0,c=-1/0,l=-1/0;for(let A of i)a=Math.min(a,A.x),c=Math.max(c,A.x),s=Math.min(s,A.y),l=Math.max(l,A.y);let u=Math.hypot(c-a,l-s)*C,m=st(i,Tu/C,1.2),f=Math.max(fg,u*mg),d=st(i,(Tu+f)/C,1.2);if(m.length!==d.length)return!1;let h=ge(o.ground,[.78,.76,.72],.35),p=ge(o.ground,[.56,.62,.52],.3);ue(e,m,void 0,()=>t-.04,t-.22,h,h,ae);let b=t-.05,y=m.map(A=>[A.x*C,b,A.y*C]),M=d.map(A=>[A.x*C,b,A.y*C]),v=[0,1,0];for(let A=0;A<y.length;A++){let x=(A+1)%y.length;e.tri(y[A],M[x],M[A],v,p,r,r),e.tri(y[A],y[x],M[x],v,p,p,r)}return!0}function ku(e,t,n,o){let r=kt(t,n);if(!r)return!1;let i=t.baseHeightM,a=ge(o.ground,[.62,.55,.47],.4);return ue(e,r,void 0,()=>i-.04,i-.22,a,a,ae),!0}var dg=3e3,hg=20,Ou=1.5,pg=1.2,bg=.25;function Fu(e,t,n,o,r){if(!n.length||n.length>dg||o.length<3)return!1;for(let w of t.objects){if(w.type==="shape"&&Fo(w.stageKind))return!1;if(w.type==="section"){let{height:E}=Ct(w,{floorBaseHeightM:t.baseHeightM});if(E-t.baseHeightM>hg)return!1}}let i=0,a=0;for(let w of o)i+=w.x,a+=w.y;i/=o.length,a/=o.length;let s=0,c=0,l=0;for(let w of o){let E=w.x-i,T=w.y-a;s+=E*E,c+=T*T,l+=E*T}let u=.5*Math.atan2(2*l,s-c),m=Math.cos(u),f=Math.sin(u),d=-f,h=m,p=1/0,b=-1/0,y=1/0,M=-1/0;for(let w of o){let E=(w.x-i)*m+(w.y-a)*f,T=(w.x-i)*d+(w.y-a)*h;p=Math.min(p,E),b=Math.max(b,E),y=Math.min(y,T),M=Math.max(M,T)}let v=w=>[[p-w,y-w],[b+w,y-w],[b+w,M+w],[p-w,M+w]].map(([E,T])=>({x:i+m*E+d*T,y:a+f*E+h*T})),A=v(Ou/C),x=v((Ou+bg)/C),g=t.baseHeightM,P=ge(r.ground,[.62,.55,.47],.4),S=ge(r.ground,[.86,.86,.84],.55);return ue(e,x,void 0,()=>g-.04,g-.22,P,P,ae),ue(e,x,[A.slice().reverse()],()=>g+pg,g-.04,ge(S,[1,1,1],.2),S,ae),!0}function Vu(e,t,n){let o=()=>({byObjectId:new Map,elements:[]});if(!t||!e)return o();let r=Js(t);if(!r.ok||r.value.id!==e)return o();let i=new Map;for(let m of n)for(let f of m.objects)f.type==="shape"&&i.set(f.id,{shape:f,unit:m});let a=new Set,s=new Set,c=new Map((t.overlay.productionElements??[]).map(m=>{let f=m.runtimeContentImageUrl;return[m.id,typeof f=="string"&&/^(?:blob:|data:image\/|https:\/\/)/.test(f)?f:void 0]})),l=[];for(let m of r.value.overlay.productionElements??[]){let f=i.get(m.objectId),d=f?Me(f.shape):null,h=m.baseElevationM??0;if(!f||!d||d.length<3||!m.id||a.has(m.id)||s.has(m.objectId)||!Number.isFinite(m.heightM)||m.heightM<.05||m.heightM>50||!Number.isFinite(h)||h<-10||h>100)return o();a.add(m.id),s.add(m.objectId);let p=d.map(S=>S.x*C),b=d.map(S=>S.y*C),y=f.unit.baseHeightM+h,M=Math.min(...p),v=Math.max(...p),A=Math.min(...b),x=Math.max(...b),g,P=c.get(m.id)??m.contentImageUrl;if(m.kind==="screen"&&P&&(g=rl(d,y,y+m.heightM,f.unit.focal),!g))if(v-M>=x-A){let S=Math.abs(A-f.unit.focal.y*C)<=Math.abs(x-f.unit.focal.y*C)?A-.006:x+.006;g=[[M,y,S],[v,y,S],[M,y+m.heightM,S],[v,y+m.heightM,S]]}else{let S=Math.abs(M-f.unit.focal.x*C)<=Math.abs(v-f.unit.focal.x*C)?M-.006:v+.006;g=[[S,y,A],[S,y,x],[S,y+m.heightM,A],[S,y+m.heightM,x]]}l.push({id:m.id,objectId:m.objectId,kind:m.kind,floorIndex:f.unit.index,baseY:y,topY:y+m.heightM,bounds:{min:[M,y,A],max:[v,y+m.heightM,x]},occlusion:m.occlusion,...P?{contentImageUrl:P}:{},...g?{contentPlane:g}:{}})}let u=l.sort((m,f)=>m.id.localeCompare(f.id));return{byObjectId:new Map(u.map(m=>[m.objectId,m])),elements:u}}var Gu=[.13,.14,.17],In=[.4,.43,.47],yg=.18,gg=.02,xg=2.4,Mg=1500,vg=240,Sg=.25;function Hu(e,t,n,o){let r=t.stageKind??"";if(Kt(r)||r==="round"||!o.length)return;let i=Me(t);if(!i||i.length<3)return;let a={x:i.reduce((k,V)=>k+V.x,0)/i.length,y:i.reduce((k,V)=>k+V.y,0)/i.length},s=0,c=0,l=new Set;for(let k of o)s+=k.x,c+=k.y,l.add(Math.floor(Math.atan2(k.y-a.y,k.x-a.x)*180/Math.PI/10));let u=a.x-s/o.length,m=a.y-c/o.length,f=Math.hypot(u,m);if(f<1e-6)return;let d=o.reduce((k,V)=>k+Math.hypot(V.x-a.x,V.y-a.y),0)/o.length;if(l.size*10>vg&&f<Sg*d)return;let h=u/f,p=m/f,b=-p,y=h,M=-1/0,v=1/0,A=1/0,x=-1/0;for(let k of i){let V=(k.x-a.x)*h+(k.y-a.y)*p,O=(k.x-a.x)*b+(k.y-a.y)*y;M=Math.max(M,V),v=Math.min(v,V),A=Math.min(A,O),x=Math.max(x,O)}let g=(x-A)*C,P=(M-v)*C;if(g<3||P<1.5||g*P>Mg)return;let S=yg/C,w=(k,V)=>({x:a.x+h*k+b*V,y:a.y+p*k+y*V}),E=(k,V,O,H)=>[w(k,O),w(k,H),w(V,H),w(V,O)],T=n+Math.max(3.5,Math.min(8,g*.35)),F=n+Math.min(xg,T-n-1),R=.2/C,I=v+Math.min(P*.25,1.5)/C,_=gg/C;ue(e,E(M-2*S+_,M-S-_,A+S+R,x-S-R),void 0,()=>F,n,Gu,Gu,ae);for(let[k,V]of[[A+S,A+S+R],[x-S-R,x-S]])ue(e,E(M-2*S,M-S,k,V),void 0,()=>T+.3,n,In,In,ae),ue(e,E(I+R,M-2*S,k,V),void 0,()=>T+.3,T,In,In,ae);ue(e,E(I,I+R,A+S,x-S),void 0,()=>T+.3,T,In,In,ae)}function Je(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Qe(e){return Array.isArray(e)?e:[]}function wg(e){let t=[e];for(;t.length;){let n=t.pop();if(Array.isArray(n)){t.push(...n);continue}if(!Je(n))continue;let o=Je(n.extensions)?n.extensions:null;if(o&&Object.prototype.hasOwnProperty.call(o,"KHR_draco_mesh_compression"))return!0;t.push(...Object.values(n))}return!1}function fr(e,t){return!Array.isArray(e)||e.length!==t||!e.every(n=>typeof n=="number"&&Number.isFinite(n))?null:e}function Pg(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Ag(e,t){let n=new Array(16).fill(0);for(let o=0;o<4;o++)for(let r=0;r<4;r++)for(let i=0;i<4;i++)n[o*4+r]+=e[i*4+r]*t[o*4+i];return n}function Ig(e){let t=fr(e.matrix,16);if(t)return t;if(e.matrix!==void 0)return null;let n=e.translation===void 0?[0,0,0]:fr(e.translation,3),o=e.rotation===void 0?[0,0,0,1]:fr(e.rotation,4),r=e.scale===void 0?[1,1,1]:fr(e.scale,3);if(!n||!o||!r)return null;let[i,a,s,c]=o,l=Math.hypot(i,a,s,c);if(!(l>1e-8))return null;let u=i/l,m=a/l,f=s/l,d=c/l,h=u+u,p=m+m,b=f+f,y=u*h,M=u*p,v=u*b,A=m*p,x=m*b,g=f*b,P=d*h,S=d*p,w=d*b;return[(1-(A+g))*r[0],(M+w)*r[0],(v-S)*r[0],0,(M-w)*r[1],(1-(y+g))*r[1],(x+P)*r[1],0,(v+S)*r[2],(x-P)*r[2],(1-(y+A))*r[2],0,n[0],n[1],n[2],1]}function Eg(e,t,n,o){return[e[0]*t+e[4]*n+e[8]*o+e[12],e[1]*t+e[5]*n+e[9]*o+e[13],e[2]*t+e[6]*n+e[10]*o+e[14]]}function Rg(e){let t=e[0],n=e[4],o=e[8],r=e[1],i=e[5],a=e[9],s=e[2],c=e[6],l=e[10],u=i*l-a*c,m=a*s-r*l,f=r*c-i*s,d=t*u+n*m+o*f;if(Math.abs(d)<1e-12)return null;let h=1/d;return[u*h,m*h,f*h,(o*c-n*l)*h,(t*l-o*s)*h,(n*s-t*c)*h,(n*a-o*i)*h,(o*r-t*a)*h,(t*i-n*r)*h]}function zu(e,t,n,o){let r=e[0]*t+e[1]*n+e[2]*o,i=e[3]*t+e[4]*n+e[5]*o,a=e[6]*t+e[7]*n+e[8]*o,s=Math.hypot(r,i,a)||1;return r/=s,i/=s,a/=s,[r,i,a]}function Cg(e){if(e.byteLength<20||e.byteLength>8388608)return null;let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.getUint32(0,!0)!==1179937895||t.getUint32(4,!0)!==2||t.getUint32(8,!0)!==e.byteLength)return null;let n=12,o=null,r=null;for(;n+8<=e.byteLength;){let i=t.getUint32(n,!0),a=t.getUint32(n+4,!0);if(n+=8,i%4!==0||n+i>e.byteLength)return null;let s=e.subarray(n,n+i);if(a===1313821514&&!o)try{let c=JSON.parse(new TextDecoder().decode(s).replace(/[\u0000 ]+$/g,""));if(!Je(c))return null;o=c}catch{return null}else if(a===5130562&&!r)r=s;else return null;n+=i}return n===e.byteLength&&o&&r?{json:o,bin:r}:null}function _g(e){return e===5120||e===5121?1:e===5122||e===5123?2:e===5125||e===5126?4:0}function Tg(e){return e==="SCALAR"?1:e==="VEC2"?2:e==="VEC3"?3:e==="VEC4"?4:0}function Lg(e,t,n){return n===5120?e.getInt8(t):n===5121?e.getUint8(t):n===5122?e.getInt16(t,!0):n===5123?e.getUint16(t,!0):n===5125?e.getUint32(t,!0):e.getFloat32(t,!0)}function kg(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n=Cg(t);if(!n)return{ok:!1,issue:"invalid_glb"};let{json:o,bin:r}=n;if(!Je(o.asset)||o.asset.version!=="2.0")return{ok:!1,issue:"unsupported_glb"};let i=Qe(o.extensionsUsed).filter(A=>typeof A=="string");if(i.includes("KHR_draco_mesh_compression")||wg(o))return{ok:!1,issue:"draco_not_allowed"};if(i.length||Qe(o.extensionsRequired).length)return{ok:!1,issue:"unsupported_glb"};if(Qe(o.images).length||Qe(o.textures).length)return{ok:!1,issue:"external_resource"};let a=Qe(o.buffers);if(a.length!==1||!Je(a[0])||a[0].uri!==void 0||typeof a[0].byteLength!="number"||!Number.isInteger(a[0].byteLength)||a[0].byteLength<0||a[0].byteLength>r.byteLength)return{ok:!1,issue:"external_resource"};let s=Qe(o.accessors),c=Qe(o.bufferViews),l=Qe(o.meshes),u=Qe(o.nodes),m=Qe(o.scenes),f=typeof o.scene=="number"?o.scene:0;if(!Je(m[f]))return{ok:!1,issue:"unsupported_glb"};let d=new DataView(r.buffer,r.byteOffset,r.byteLength),h=(A,x,g)=>{if(typeof A!="number"||!Number.isInteger(A)||!Je(s[A]))return null;let P=s[A];if(P.type!==x||P.sparse!==void 0||P.normalized===!0||typeof P.count!="number"||!Number.isInteger(P.count)||P.count<1||typeof P.componentType!="number"||!g.includes(P.componentType)||typeof P.bufferView!="number")return null;let S=c[P.bufferView];if(!Je(S)||S.buffer!==0||typeof S.byteLength!="number"||!Number.isInteger(S.byteLength)||S.byteLength<0)return null;let w=Tg(P.type),E=_g(P.componentType),T=typeof S.byteStride=="number"?S.byteStride:w*E,F=typeof S.byteOffset=="number"?S.byteOffset:0,R=typeof P.byteOffset=="number"?P.byteOffset:0,I=F+R,_=R+(P.count-1)*T+w*E;if(!Number.isInteger(T)||!Number.isInteger(F)||!Number.isInteger(R)||T<w*E||F<0||R<0||F+S.byteLength>r.byteLength||_>S.byteLength)return null;let k=[];for(let V=0;V<P.count;V++){let O=[];for(let H=0;H<w;H++){let U=Lg(d,I+V*T+H*E,P.componentType);if(!Number.isFinite(U))return null;O.push(U)}k.push(O)}return k},p=[],b=[],y=0,M=new Set,v=(A,x)=>{if(typeof A!="number"||!Number.isInteger(A)||!Je(u[A])||M.has(A))return!1;M.add(A);let g=u[A],P=Ig(g);if(!P)return!1;let S=Ag(x,P),w=Rg(S);if(!w)return!1;if(g.mesh!==void 0){if(typeof g.mesh!="number")return!1;let E=l[g.mesh];if(!Je(E))return!1;for(let T of Qe(E.primitives)){if(!Je(T)||T.mode!==void 0&&T.mode!==4||!Je(T.attributes))return!1;let F=h(T.attributes.POSITION,"VEC3",[5126]),R=T.attributes.NORMAL===void 0?null:h(T.attributes.NORMAL,"VEC3",[5126]);if(!F||T.attributes.NORMAL!==void 0&&!R)return!1;let I=F.length;if(T.indices!==void 0){let k=typeof T.indices=="number"?s[T.indices]:null;I=Je(k)?k.count:void 0}if(typeof I!="number"||!Number.isInteger(I)||I%3!==0||(y+=I/3,y>1e5))return!1;let _=T.indices===void 0?F.map((k,V)=>[V]):h(T.indices,"SCALAR",[5121,5123,5125]);if(!_||_.length%3!==0||_.length!==I)return!1;for(let k=0;k<_.length;k+=3){let V=[_[k][0],_[k+1][0],_[k+2][0]];if(V.some(U=>!Number.isInteger(U)||U<0||U>=F.length))return!1;let O=V.map(U=>Eg(S,...F[U])),H=null;if(!R){let U=O[1][0]-O[0][0],N=O[1][1]-O[0][1],L=O[1][2]-O[0][2],B=O[2][0]-O[0][0],D=O[2][1]-O[0][1],G=O[2][2]-O[0][2];H=zu([1,0,0,0,1,0,0,0,1],N*G-L*D,L*B-U*G,U*D-N*B)}for(let U=0;U<3;U++)p.push(...O[U]),b.push(...R?zu(w,...R[V[U]]):H)}}}for(let E of Qe(g.children))if(!v(E,S))return!1;return M.delete(A),!0};for(let A of Qe(m[f].nodes))if(!v(A,Pg()))return{ok:!1,issue:y>1e5?"triangle_limit":"unsupported_glb"};return!y||p.length!==y*9||b.length!==p.length?{ok:!1,issue:"unsupported_glb"}:{ok:!0,triangleCount:y,position:new Float32Array(p),normal:new Float32Array(b)}}function ju(e){try{return kg(e)}catch{return{ok:!1,issue:"invalid_glb"}}}function En(e){let{doc:t}=e,n=Rs(t.theme),o=n.structure,r=Wc(t,e.eventConfigurationId??t.eventConfigurationId),i=Vu(e.eventConfigurationId,e.eventConfiguration,r),a=e.seats,s=new ko,c=null;if(e.registeredShellGlb){let X=ju(e.registeredShellGlb);if(X.ok){let Y=X.position.length/3,K=new Float32Array(X.position.length),re=n.materials.shell??o.tierWall;for(let ne=0;ne<Y;ne++){let se=X.normal[ne*3+1],J=se<-.25?.4:.62+.38*Math.max(0,se);K[ne*3]=re[0]*J,K[ne*3+1]=re[1]*J,K[ne*3+2]=re[2]*J}c={position:X.position,normal:X.normal,color:K,floor:new Float32Array(Y).fill(-2),material:new Float32Array(Y),count:Y}}}let l=new Map;for(let X of r)for(let Y of X.objects)l.set(Y.id,X.index),Y.type==="section"&&l.set(Y.logicalSectionId??Y.id,X.index);let u=a.map(X=>l.get(X.sectionId??"")??l.get(X.rowId??"")??0),m=ea(r,a),f=s.vertexCount,h=Du(s,r,a,u,m,o,ge(n.background.top,n.background.bottom,.5))?s.vertexCount:f,p=Tc(t,a),b=new Map,y=new Map;for(let X of t.categories??[])b.set(X.key,X.color),X.seatGlyph&&y.set(X.key,X.seatGlyph);let M=[],v=ol(r,a,u),A=new Map;a.forEach((X,Y)=>{let K=v.seatDeckY(Y);Number.isFinite(K)&&A.set(X.rowId,Math.min(A.get(X.rowId)??1/0,K))});let x=new Float32Array(a.length),g=[],P=new Map((t.floors??[]).map((X,Y)=>[X.id,Y])),S=r.map(()=>[]);for(let X of a){let Y=X.floorId?P.get(X.floorId)??0:0;S[Math.min(Y,S.length-1)]?.push(X)}let w=(X,Y)=>{if(!Y||Y.length<3)return!1;let K=Math.min(...Y.map(J=>J.x)),re=Math.max(...Y.map(J=>J.x)),ne=Math.min(...Y.map(J=>J.y)),se=Math.max(...Y.map(J=>J.y));for(let J=0;J<X;J++)for(let ie of S[J])if(!(ie.x<K||ie.x>re||ie.y<ne||ie.y>se)&&ze(ie,Y,void 0))return!0;return!1},E=null,T=X=>r.length===1?a:a.filter((Y,K)=>u[K]===X),F=(X,Y)=>{let K=ut(X);if(!K)return!1;let re=1/0,ne=1/0,se=-1/0,J=-1/0;for(let ie of K)re=Math.min(re,ie.x),se=Math.max(se,ie.x),ne=Math.min(ne,ie.y),J=Math.max(J,ie.y);return a.some((ie,Ee)=>ie.kind!=="booth"&&(r.length===1||u[Ee]===Y)&&ie.x>re&&ie.x<se&&ie.y>ne&&ie.y<J&&Ze(K,ie.x,ie.y))},R;for(let X=0;X<r.length;X++){let Y=r[X];s.setFloor(X);let K=kt(Y,T(X)),re=0;if(K){let te=0;for(let ve of Y.objects)if(ve.type==="section")for(let Se of v.bySection.get(ve.id)?.rowLevels??[])te=Math.max(te,Se.y-Y.baseHeightM);if(re=Qc(te),!R){let ve=vn(K);R={centre:[ve.x*C,ve.y*C]}}}let ne=new Yo,se=[],J=Y.objects.filter(te=>te.type==="shape"&&(te.role==="entrance"||te.role==="exit")),ie=Y.objects.filter(te=>te.type==="section"&&!!te.outline&&te.outline.length>=3),Ee=Ll(Y.objects.filter(te=>te.type==="booth"),Y.focal);for(let te of Y.objects)if(te.type==="section"){let ve=s.vertexCount;Kl(s,te,Y,Lc(te,p),v.bySection.get(te.id),ne,ie,o,X>0&&w(X,te.outline));let Se=s.vertexCount-ve;Se>0&&g.push({sectionId:te.id,start:ve,count:Se})}else if(te.type==="shape"){let ve=i.byObjectId.get(te.id),Se=M.length,ot=K!==null&&te.role==="wall"&&!ve;s.setMaterial(ot?Ko:(ve?.kind??te.role)==="screen"?1:0);let mt=te.role==="stage"&&!ve?Ol(te,T(X)):ot&&te.heightM===void 0?{...te,heightM:re}:te,Ye=Zc(mt,se);if(Rl(s,mt,Y.baseHeightM+Ye.supportOffsetM,Ye.topOffsetM-Ye.supportOffsetM,o,Y.focal,M,ve,J),s.setMaterial(0),te.role==="stage"&&!ve&&M.length>Se&&(E??X)===X){E=X;let rt=t.floors?.[X]?.id,Ae=r.length>1&&rt?a.filter(Ht=>Ht.floorId===rt):a;Hu(s,mt,M[M.length-1].y,Ae)}}else te.type==="gaArea"?_l(s,te,Y.baseHeightM,be(b.get(te.categoryKey)),o):te.type==="booth"?Al(s,te,Y.baseHeightM,be(b.get(te.categoryKey)),o,Ee.get(te.id)??Y.focal,F(te,X)):te.type==="table"?El(s,te,Math.max(Y.baseHeightM,A.get(te.id)??Y.baseHeightM),be(te.fill??t.theme?.decorFill??"#232c40"),o,!!(te.fill??t.theme?.decorFill)):te.type==="decorImage"&&Cl(s,te,Y.baseHeightM,o);K&&vu(s,Y.objects,K,Y.baseHeightM,re,Y.focal,o,te=>!i.byObjectId.has(te.id)),Zl(s,Y,a,v,o,n.materials.shell,!c)}let I=r.length>1?{x:r.reduce((X,Y)=>X+Y.focal.x,0)/r.length,y:r.reduce((X,Y)=>X+Y.focal.y,0)/r.length}:t.focalPoint??{x:(m.minX+m.maxX)/2,y:(m.minY+m.maxY)/2},_=Ss(c?[s.build(),c]:[s.build()]),k=Ps(a,e.initialState,v,x,b,y),V=Eu({doc:t,units:r,seats:a,surfaces:v,focal:I}),{labels:O,sections:H,rows:U}=Ru({doc:t,units:r,seats:a,surfaces:v,seatData:k,hintedSeatFloor:u,zones:V,focal:I}),N=new Map(H.map((X,Y)=>[X.id,Y]));v.seatOwner.forEach((X,Y)=>{k.iSection[Y]=X?N.get(X)??-1:-1});let L=_u({doc:t,units:r,seats:a,surfaces:v,solids:_,hintedSeatFloor:u,seatFloor:x});Cu(O,L),k.iYaw=Xa(k.iPosition,a.length,X=>a[X].rowId,X=>{let Y=r[x[X]]?.focal??I;return[Y.x*C,Y.y*C]});let B=(m.minX+m.maxX)/2*C,D=(m.minY+m.maxY)/2*C,G=.5*Math.hypot((m.maxX-m.minX)*C,(m.maxY-m.minY)*C)||10,j=ta(_,k,{cx:B,cz:D,radius:G},[f,h]),Z=ta(_,k,{cx:B,cz:D,radius:G}),$=Og(r),ee=Bu(k,M,m,j.minY,j.maxY,G,$);return{sharedAisles:As(r.flatMap(X=>X.objects.flatMap(Y=>{if(Y.type!=="section")return[];let K=v.bySection.get(Y.id);return K?[{sectionId:Y.id,floorIndex:X.index,rows:K.rowLevels}]:[]}))),solids:_,sectionSolidRanges:g,seats:k,seatSectionIds:v.seatOwner,bounds:{center:[(ee.min[0]+ee.max[0])/2,(ee.min[1]+ee.max[1])/2,(ee.min[2]+ee.max[2])/2],radius:G,groundY:0,box:ee,fitPoints:Nu(k,M,$)},...R?{room:R}:{},...!R&&r.some(X=>X.objects.some(Y=>Y.type==="shape"&&Fo(Y.stageKind)))?{outdoor:!0}:{},renderBounds:{center:j.center,radius:j.radius},clipBounds:{center:Z.center,radius:Z.radius},stateColorLUT:Cs(n,Be),theme:n,seatCount:a.length,focalWorld:[I.x*C,1.5,I.y*C],zones:V,stages:M,productionElements:i.elements,sections:H,rows:U,labels:O,floors:L}}function Og(e){let t=[];for(let n of e)for(let o of n.objects){let r=o.type==="gaArea"?o.points:o.type==="booth"?ut(o):null;for(let i of r??[])t.push([i.x*C,n.baseHeightM,i.y*C])}return t}var Dt=require("ogl"),Fg=.05,Dg=1.1,Ng=12,Bg=1.6,Vg=1,Gg=2.5,Hg=650,Wu=[[-.15,0,0,.15,.13,.42],[-.13,-.45,.36,.13,.02,.47]],Xu={centre:[0,0,-.05],hipRadius:.15,shoulderRadius:.2,height:.56,sides:8,depth:.62},na={centre:[0,.74,-.04],radii:[.1,.12,.11]},Rn={height:6,baseRadius:.16,topRadius:.3,fadeInFromM:16,fullByM:40},zg=90,o5={height:na.centre[1]+na.radii[1],radius:Math.max(Xu.shoulderRadius,...Wu.map(e=>Math.max(Math.abs(e[0]),Math.abs(e[3]))))};function jg(e,t){if(t)return 0;let n=(e-Rn.fadeInFromM)/(Rn.fullByM-Rn.fadeInFromM);return Math.max(0,Math.min(1,n))}function Ug(e,t){return!t&&e<zg}var Uu=24;function Wg(e){let t=[],n=[],o=[],r=(m,f,d)=>{t.push(...m),n.push(...f),o.push(d)};for(let m=0;m<16;m++){let f=m/16*Math.PI*2,d=(m+1)/16*Math.PI*2,h=v=>[Math.cos(v),0,Math.sin(v)],p=[Math.cos(f)*.012,0,Math.sin(f)*.012],b=[Math.cos(d)*.012,0,Math.sin(d)*.012],y=[Math.cos(f)*.03,1,Math.sin(f)*.03],M=[Math.cos(d)*.03,1,Math.sin(d)*.03];r(p,h(f),0),r(y,h(f),0),r(M,h(d),0),r(p,h(f),0),r(M,h(d),0),r(b,h(d),0)}let c=.16,l=.24,u=.01;for(let m=0;m<48;m++){let f=m/48*Math.PI*2,d=(m+1)/48*Math.PI*2,h=[Math.cos(f)*c,u,Math.sin(f)*c],p=[Math.cos(f)*l,u,Math.sin(f)*l],b=[Math.cos(d)*l,u,Math.sin(d)*l],y=[Math.cos(d)*c,u,Math.sin(d)*c];for(let M of[h,p,b,h,b,y])r(M,[0,1,0],1)}for(let[m,f,d,h,p,b]of Wu){let y=[[[0,0,1],[[m,f,b],[h,f,b],[h,p,b],[m,p,b]]],[[0,0,-1],[[h,f,d],[m,f,d],[m,p,d],[h,p,d]]],[[1,0,0],[[h,f,b],[h,f,d],[h,p,d],[h,p,b]]],[[-1,0,0],[[m,f,d],[m,f,b],[m,p,b],[m,p,d]]],[[0,1,0],[[m,p,b],[h,p,b],[h,p,d],[m,p,d]]],[[0,-1,0],[[m,f,d],[h,f,d],[h,f,b],[m,f,b]]]];for(let[M,[v,A,x,g]]of y)for(let P of[v,A,x,v,x,g])r(P,M,2)}{let{centre:m,hipRadius:f,shoulderRadius:d,height:h,sides:p,depth:b}=Xu,y=(M,v,A)=>{let x=M/p*Math.PI*2+Math.PI/p;return[m[0]+Math.cos(x)*v,m[1]+A,m[2]+Math.sin(x)*v*b]};for(let M=0;M<p;M++){let v=y(M,f,0),A=y(M+1,f,0),x=y(M+1,d,h),g=y(M,d,h),P=[A[0]-v[0],A[1]-v[1],A[2]-v[2]],S=[g[0]-v[0],g[1]-v[1],g[2]-v[2]],w=[P[1]*S[2]-P[2]*S[1],P[2]*S[0]-P[0]*S[2],P[0]*S[1]-P[1]*S[0]],E=Math.hypot(...w)||1;w=[w[0]/E,w[1]/E,w[2]/E],w[0]*(v[0]-m[0])+w[2]*(v[2]-m[2])<0&&(w=[-w[0],-w[1],-w[2]]);for(let T of[v,A,x,v,x,g])r(T,w,2);r([m[0],m[1]+h,m[2]],[0,1,0],2),r(g,[0,1,0],2),r(x,[0,1,0],2)}}{let{centre:m,radii:f}=na,d=8,h=(p,b)=>{let y=p/16*Math.PI*2,M=b/d*Math.PI,v=[Math.sin(M)*Math.cos(y),Math.cos(M),Math.sin(M)*Math.sin(y)];return[[m[0]+v[0]*f[0],m[1]+v[1]*f[1],m[2]+v[2]*f[2]],v]};for(let p=0;p<16;p++)for(let b=0;b<d;b++){let y=h(p,b),M=h(p+1,b),v=h(p+1,b+1),A=h(p,b+1);for(let[x,g]of[y,M,v,y,v,A])r(x,g,2)}}for(let m=0;m<32;m++){let f=m/32*Math.PI*2,d=(m+1)/32*Math.PI*2,h=Rn.baseRadius,p=Rn.topRadius,b=[Math.cos(f)*h,0,Math.sin(f)*h],y=[Math.cos(d)*h,0,Math.sin(d)*h],M=[Math.cos(f)*p,1,Math.sin(f)*p],v=[Math.cos(d)*p,1,Math.sin(d)*p],A=[Math.cos(f),0,Math.sin(f)],x=[Math.cos(d),0,Math.sin(d)];r(b,A,3),r(M,A,3),r(v,x,3),r(b,A,3),r(v,x,3),r(y,x,3)}return new Dt.Geometry(e,{position:{size:3,data:new Float32Array(t)},normal:{size:3,data:new Float32Array(n)},part:{size:1,data:new Float32Array(o)}})}var Xg=`#version 300 es
|
|
21
21
|
precision highp float;
|
|
22
22
|
in vec3 position; in vec3 normal; in float part;
|
|
23
23
|
uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform mat3 normalMatrix;
|
|
@@ -48,7 +48,7 @@ void main() {
|
|
|
48
48
|
float scale = part > 0.5 ? uRingScale : uHeight;
|
|
49
49
|
vec3 world = uSeat + vec3(position.x, position.y * grow, position.z) * scale;
|
|
50
50
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(world, 1.0);
|
|
51
|
-
}`,
|
|
51
|
+
}`,Yg=`#version 300 es
|
|
52
52
|
precision highp float;
|
|
53
53
|
in vec3 vNormal; in float vPart; in float vAlong;
|
|
54
54
|
uniform vec3 uColor; uniform float uRingAlpha; uniform vec3 uFigureColor; uniform float uBeam;
|
|
@@ -76,15 +76,15 @@ void main() {
|
|
|
76
76
|
float key = max(dot(normalize(vNormal), normalize(vec3(-0.4, 0.7, 0.6))), 0.0);
|
|
77
77
|
vec3 c = uColor * (0.55 + 0.5 * key) + vec3(0.12) * pow(key, 12.0);
|
|
78
78
|
fragColor = vec4(c, 1.0);
|
|
79
|
-
}`;function Yg(e){if(e>=1)return 1;if(e<.72){let n=e/.72;return 1-(1-n)*(1-n)}let t=(e-.72)/.28;return 1-.08*Math.sin(t*Math.PI)}function na(e){return Math.max(Fg,Math.min(Dg,e*Og))}function Kg(e){let t=.2126*e[0]+.7152*e[1]+.0722*e[2],n=t>=.25?0:Math.min(.45,(.25-t)*2.2);return e.map(o=>o+(1-o)*n)}function Xu(e,t,n=[.24,.74,1]){n=Kg(n);let o=new Dt.Transform,r=Ug(e),i=new Map,a=(s,c,l)=>{let u=new Dt.Program(e,{vertex:Wg,fragment:Xg,uniforms:{uSeat:{value:s},uHeight:{value:1},uLift:{value:0},uRingScale:{value:1},uFigure:{value:1},uYaw:{value:l},uBeamHeight:{value:Rn.height},uBeam:{value:0},uFigureColor:{value:n},uColor:{value:t},uRingAlpha:{value:.85}},transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1}),m=new Dt.Mesh(e,{geometry:r,program:u});return m.frustumCulled=!1,m.setParent(o),{mesh:m,program:u,seat:s,start:c}};return{root:o,setSeats(s,c,l){let u=new Set(s.slice(0,ju).map(m=>m.id));for(let[m,f]of i)u.has(m)||(f.mesh.setParent(null),i.delete(m));for(let m of s.slice(0,ju))i.has(m.id)||i.set(m.id,a(m.position,l?c:-1/0,m.facing??0))},update(s,c,l,u=!1){let m=!1;for(let f of i.values()){let d=c[0]-f.seat[0],h=c[1]-f.seat[1],p=c[2]-f.seat[2],b=Math.hypot(d,h,p);f.mesh.visible=!l&&b>(u?Bg:Vg);let y=na(b),M=Math.max(0,Math.min(1,(s-f.start)/Gg));M<1&&(m=!0),f.program.uniforms.uHeight.value=y,f.program.uniforms.uRingScale.value=Math.min(y,Ng),f.program.uniforms.uLift.value=u?1:1-Yg(M),f.program.uniforms.uFigure.value=jg(b,u)?1:0,f.program.uniforms.uBeam.value=zg(b,u),f.program.uniforms.uRingAlpha.value=.55+.4*(M<1?Math.sin(M*Math.PI):0)}return m},dispose(){for(let s of i.values())s.mesh.setParent(null);i.clear(),r.remove()}}}var $g={wheelchair:'<circle cx="10.6" cy="3.7" r="1.7" /><path d="M8.9 6.3v4.3a1.3 1.3 0 0 0 1.3 1.3h3.4l1.9 4.5h1.9" /><circle cx="9.7" cy="13.3" r="4.7" />',companion:'<circle cx="6" cy="6" r="2" /><circle cx="14" cy="6" r="2" /><path d="M2.5 16v-3.5A3.5 3.5 0 0 1 6 9a3.5 3.5 0 0 1 3.5 3.5V16M10.5 16v-3.5A3.5 3.5 0 0 1 14 9a3.5 3.5 0 0 1 3.5 3.5V16" />',"semi-ambulatory":'<circle cx="8" cy="4" r="1.7" /><path d="m8 6 2 4 3 2M10 10l-2 3-1 4M10 10l2 7M14 7l2 10" />',"designated-aisle":'<path d="M3.5 5.5v7h8.5V10H6.5M5 12.5V17M11 12.5V17" /><path d="M13.5 6.5H19M16.5 4l2.5 2.5L16.5 9" />',"step-free":'<circle cx="5.5" cy="5" r="1.7" /><path d="M5.5 7v4l3 2M2.5 16.5H8l7-7h3M8 16.5h10" />',hearing:'<path d="M7 16c-1-1.2-1.5-2.4-1.5-3.8V9a5 5 0 1 1 10 0c0 2.2-1.2 3.2-2.6 4-1.2.7-1.7 1.4-1.7 2.4A2.6 2.6 0 0 1 8.6 18" />',cart:'<path d="M8 6.5A4 4 0 1 0 8 13M17 6.5a4 4 0 1 0 0 6.5" />',"sign-language":'<path d="M6 16V8.5a1 1 0 0 1 2 0v3M8 11V5.5a1 1 0 0 1 2 0V11M10 11V4.5a1 1 0 0 1 2 0V11M12 11V6a1 1 0 0 1 2 0v6l1-1.5a1.2 1.2 0 0 1 2 1.3L14 17H9.5A3.5 3.5 0 0 1 6 13.5" />',"low-vision":'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><circle cx="10" cy="10" r="2.5" /><path d="m15 4 .5-1.5M17 5l1.5-.8" />',"sensory-friendly":'<path d="M4 11v-1a6 6 0 0 1 12 0v1M4 11h2.5v5H5a1 1 0 0 1-1-1v-4ZM16 11h-2.5v5H15a1 1 0 0 0 1-1v-4Z" /><path d="M8.5 11.5c.8.7 2.2.7 3 0M9 14c.6.4 1.4.4 2 0" />',"plus-size":'<path d="M5 9V6.5A2.5 2.5 0 0 1 7.5 4h5A2.5 2.5 0 0 1 15 6.5V9M3.5 8.5v5h13v-5M6 13.5V17M14 13.5V17" />',"lift-armrest":'<path d="M5 10V6.5A2.5 2.5 0 0 1 7.5 4h4A2.5 2.5 0 0 1 14 6.5V10M4 9v4h11V9M6 13v4M13 13v4" /><path d="M17 11V4M15 6l2-2 2 2" />',obstructedView:'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><path d="m4 17 12-14" />',restrictedView:'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><path d="M10 7.5v3.5M10 13.5h.01" />',premium:'<path d="m10 2.5 2.2 4.6 5 .7-3.6 3.5.9 5-4.5-2.4-4.5 2.4.9-5-3.6-3.5 5-.7Z" />',note:'<circle cx="10" cy="10" r="7.5" /><path d="M10 9.2v4.6M10 6.3h.01" />',aisle:'<path d="M2.5 6v7h6.5v-2.5H4.5M3.5 13v3.5M8 13v3.5" /><path d="M12.5 3v14M17 3v14" />',entrance:'<path d="M10 3.5h6.5v13H10" /><path d="M3 10h8.5M8.5 7l3 3-3 3" />',booth:'<path d="M3.5 8.5h13v8h-13ZM2.5 8.5 4 4h12l1.5 4.5M8 16.5v-4h4v4" />'};function Zg(e){return $g[e]??""}function fr(e,t={}){let n=Zg(e);if(!n)return"";let o=t.size??18,r=20;return`<svg viewBox="0 0 ${r} ${r}" width="${o}" height="${o}" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round"`+(t.className?` class="${t.className}"`:"")+` aria-hidden="true" focusable="false">${n}</svg>`}var ho="#ffffff",Yu="#0b1220",po=6,qg=80,Ku=14,$u=88,Zu=20,qu={floor:{size:14,weight:"700",opacity:.98},stage:{size:14,weight:"700",opacity:.98},zone:{size:15,weight:"600",opacity:.95},section:{size:12,weight:"500",opacity:.88},ga:{size:12,weight:"500",opacity:.88},gate:{size:12,weight:"700",opacity:.98},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:11.5,weight:"700",opacity:.94},seat:{size:12.5,weight:"800",opacity:1},access:{size:12,weight:"700",opacity:1}},Qg=640,Jg=.8,e1=11,t1="3px 7px",n1="2px 5px",Qu="rgba(10,14,22,.62)",o1="#f4f7fb",Ju=5,em=2,r1=6,bo=new Set(["row","seat","access"]),oa={stage:6,gate:5,floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},Cn={row:{x:66,y:20},seat:{x:52,y:22}},Qt=be,ra=e=>$a(e);function Jt(e,t){let n=ra(e),o=ra(t);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}function i1(e){let t=Qt(e);if(!t)return null;let n=i=>`#${i.map(a=>Math.round(Math.max(0,Math.min(1,a))*255).toString(16).padStart(2,"0")).join("")}`,o=t.map(i=>i+(1-i)*.78),r=t.map(i=>i*.62);for(let i=0;i<12&&Jt(r,o)<4.5;i++)r=r.map(a=>a*.8);return{fill:n(o),ink:n(r),border:n(t.map(i=>i+(1-i)*.35)),contrast:Jt(r,o)}}var a1=30;function ia(e,t){let n=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(e.replace(/\s/g,""));if(!n)return t;let o=Math.max(0,Math.min(1,Number(n[4])));return[1,2,3].map(r=>Number(n[r])/255*o+t[r-1]*(1-o))}function s1(e,t=[.04,.06,.1],n=!0){let o=ra(t)<.42,r=o?"#f4f7fb":"#0b1220",i=o?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",a=n?ia(i,t):t,s=Qt(e),c=n?7:4.5,l=s&&Jt(s,a)>=c?e:r;return o?{ink:l,backing:i,border:"rgba(210,222,245,.24)"}:{ink:l,backing:i,border:"rgba(11,18,32,.22)"}}function c1(e,t=[.04,.06,.1]){let n=ia(Qu,t),o=Qt(e);return{ink:o&&Jt(o,n)>=4.5?e:o1,backing:Qu}}var l1=.8,_n=20,u1=14,m1=60,f1='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',dr=class{constructor(t,n={}){this.nodes=new Map;this.labels=[];this.wheelchairFree=new Map;this.nodeAppearance=new WeakMap;this.forcedDense=!1;this.overviewDistance=null;this.selectedSeatLabelIds=new Set;this.narrowStage=!1;this.seatNumberRow=void 0;this.seatNumberSeat=null;this.pinHeads=[];this.opts=n,this.root=document.createElement("div"),this.root.setAttribute("data-view3d-labels","");let o=this.root.style;o.position="absolute",o.inset="0",o.pointerEvents="none",o.overflow="hidden",o.fontFamily=n.fontFamily||f1,t.appendChild(this.root)}setVisible(t){this.root.style.visibility=t?"":"hidden"}setLabels(t){this.labels=t;let n=new Set(t.map(o=>o.id));for(let[o,r]of this.nodes)n.has(o)||(r.remove(),this.nodes.delete(o))}setForcedDense(t){this.forcedDense=t}setOverviewDistance(t){this.overviewDistance=t>0?t:null}setSeatNumberRow(t){return t===this.seatNumberRow?!1:(this.seatNumberRow=t,!0)}setSeatNumberSeat(t){let n=t?`seat:${t}`:null;return n===this.seatNumberSeat?!1:(this.seatNumberSeat=n,!0)}setWheelchairFree(t){let n=t.size!==this.wheelchairFree.size;if(!n){for(let[o,r]of t)if(this.wheelchairFree.get(o)!==r){n=!0;break}}return n&&(this.wheelchairFree=new Map(t)),n}setSelectedSeatIds(t){this.selectedSeatLabelIds=new Set(Array.from(t,n=>`seat:${n}`))}sizeFor(t){let n=qu[t].size;return!this.narrowStage||bo.has(t)?n:Math.max(e1,n*Jg)}qualityEvidence(){let t=this.root.getBoundingClientRect(),n=this.root.style.visibility!=="hidden";return this.labels.map(o=>{let r=this.nodes.get(o.id),i=r?.getBoundingClientRect(),a=!!(n&&r&&r.style.display!=="none"&&i&&i.width>0&&i.height>0);return{id:o.id,kind:o.kind,text:o.text,visible:a,renderedFontPx:r&&Number.parseFloat(r.style.fontSize)||0,contrast:r?Number(r.dataset.qualityContrast??0):0,...a&&i?{screenBox:{x:i.x-t.x,y:i.y-t.y,width:i.width,height:i.height}}:{}}})}update(t,n,o,r,i,a){if(!this.labels.length)return;this.narrowStage=n>0&&n<Qg;let s=fu(r,i,{hasZoneLabels:this.labels.some(S=>S.kind==="zone")});this.forcedDense&&(s.add("row"),s.add("seat"),s.add("access")),!this.forcedDense&&this.overviewDistance!==null&&r>this.overviewDistance*l1&&(s.delete("section"),s.delete("ga")),s.has("section")&&this.labels.some(S=>S.kind==="section")&&s.delete("zone");let c=[];for(let S of this.labels){let w=S.kind==="annotation"&&!!S.venueIcon;if(!s.has(S.kind)&&!w&&!(S.kind==="seat"&&this.selectedSeatLabelIds.has(S.id)))continue;let E=S.kind==="seat"&&a&&this.selectedSeatLabelIds.has(S.id)?S.pinBase:void 0,T=E&&a?[E[0],E[1]+na(Math.hypot(E[0]-a[0],E[1]-a[1],E[2]-a[2])),E[2]]:S.anchor,F=gt(t,T,n,o);if(!F.visible)continue;let R=bo.has(S.kind),I=this.sizeFor(S.kind),_=S.kind==="access"?_n:pu(S.text,I,!R)+(R?Ju*2:0)+((this.wheelchairFree.get(S.id)??0)>0?a1:0);if(S.kind==="access"&&S.seatWidthM!==void 0&&Ki(t,S.anchor,S.seatWidthM,n)<u1||S.kind==="seat"&&S.seatWidthM!==void 0&&!this.selectedSeatLabelIds.has(S.id)&&Ki(t,S.anchor,S.seatWidthM,n)<Math.max(22,_))continue;let k=du(F,_/2,I/2+(R?em:4),n,o),V=a?Math.hypot(S.anchor[0]-a[0],S.anchor[1]-a[1],S.anchor[2]-a[2]):1;c.push({label:S,screen:k,focus:yu(k,V,n,o),halfWidth:_/2,...this.selectedSeatLabelIds.has(S.id)?{priority:1}:{}})}let l=mu(c.filter(S=>S.label.kind==="floor"),n),u=[...c.filter(S=>!bo.has(S.label.kind)&&S.label.kind!=="floor"),...l],m=bu(n),f=c.filter(S=>S.label.kind==="seat"&&this.selectedSeatLabelIds.has(S.label.id)),d=mo(f,Cn.seat.x,Cn.seat.y,m.seat);this.placePinHeads(f.filter(S=>S.label.pinBase&&!d.includes(S)).map(S=>S.screen));let h=hu(u,$u,Zu,S=>oa[S.label.kind]??0).filter(S=>!d.some(w=>uo(S,w,$u,Zu))),p=mo(c.filter(S=>S.label.kind==="access"),_n,_n,m1,[...h,...d]),b=mo(c.filter(S=>S.label.kind==="row"),Cn.row.x,Cn.row.y,m.row,[...h,...d,...p]),y=this.seatNumberRow!==void 0||this.seatNumberSeat!==null,M=mo(c.filter(S=>S.label.kind==="seat"&&!this.selectedSeatLabelIds.has(S.label.id)&&(this.seatNumberSeat!==null?S.label.id===this.seatNumberSeat:!y||this.seatNumberRow!==null&&S.label.rowId===this.seatNumberRow)),Cn.seat.x,Cn.seat.y,y?qg:m.seat-d.length,[...h,...d,...p,...b]),v=[...h,...p,...b,...d,...M],A=new Set(v.map(S=>S.label.id));for(let{label:S,screen:w}of v){let T=this.nodeFor(S).style;T.display=S.kind==="access"?"flex":S.kind==="gate"?"inline-flex":"";let F=!!S.pinBase&&this.selectedSeatLabelIds.has(S.id);T.transform=F?`translate(-50%, -100%) translate(${w.x.toFixed(1)}px, ${(w.y-po).toFixed(1)}px)`:`translate(-50%, -50%) translate(${w.x.toFixed(1)}px, ${w.y.toFixed(1)}px)`}let g=v.filter(({label:S})=>!bo.has(S.kind)).sort((S,w)=>oa[w.label.kind]-oa[S.label.kind]||S.screen.depth-w.screen.depth||S.focus-w.focus).flatMap(({label:S})=>{let w=this.nodes.get(S.id);return w&&w.style.display!=="none"?[{node:w,box:w.getBoundingClientRect()}]:[]}),P=[];for(let{node:S,box:w}of g)P.some(T=>w.left<T.right+3&&w.right+3>T.left&&w.top<T.bottom+3&&w.bottom+3>T.top)?S.style.display="none":P.push(w);for(let[S,w]of this.nodes)A.has(S)||(w.style.display="none")}nodeFor(t){let n=this.nodes.get(t.id);if(!n){n=document.createElement("div");let y=n.style;y.position="absolute",y.left="0",y.top="0",y.whiteSpace="nowrap",y.display="none",this.root.appendChild(n),this.nodes.set(t.id,n)}let o=this.selectedSeatLabelIds.has(t.id),r=this.nodeAppearance.get(n),i=this.wheelchairFree.get(t.id)??0,a=t.text+(t.icon??"")+(t.venueIcon??"")+(t.tint??"")+(i>0?`|${i}`:"");if(r&&r.text===a&&r.kind===t.kind&&r.color===t.color&&r.selected===o&&r.narrow===this.narrowStage)return n;if(this.nodeAppearance.set(n,{text:a,kind:t.kind,color:t.color,selected:o,narrow:this.narrowStage}),t.kind==="access")return this.paintAccessChip(n,t);if(n.textContent=t.text,o){let y=document.createElement("span"),M=y.style;M.position="absolute",M.left="50%",M.bottom=`-${po}px`,M.transform="translateX(-50%)",M.borderLeft=`${po}px solid transparent`,M.borderRight=`${po}px solid transparent`,M.borderTop=`${po}px solid ${ho}`,n.appendChild(y)}n.setAttribute("data-label-kind",t.kind),n.toggleAttribute("data-selected-seat",o);let s=qu[t.kind],c=n.style;c.fontSize=`${this.sizeFor(t.kind)}px`,c.fontWeight=o?"800":s.weight,c.opacity=o?"1":String(s.opacity);let l=bo.has(t.kind),u=!l,m=s1(t.color??this.opts.ink,this.opts.backgroundRgb,!0),f=l?c1(t.color??this.opts.ink,this.opts.backgroundRgb):m;c.color=o?Yu:f.ink,c.background=o?ho:f.backing,c.border=o?`1px solid ${ho}`:u?`1px solid ${m.border}`:"",c.borderRadius=o||u?"999px":`${r1}px`;let d=this.narrowStage?n1:t1;c.padding=o||u?d:`${em}px ${Ju}px`,c.lineHeight=l?"1.1":"",c.boxShadow=o?"0 0 0 3px rgba(255,255,255,.28), 0 0 18px rgba(255,255,255,.55), 0 5px 14px rgba(0,0,0,.45)":u?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",c.textShadow=o||u?"none":"0 1px 1px rgba(0,0,0,0.4)",c.letterSpacing=t.kind==="zone"||t.kind==="floor"?"0.08em":"0.02em";let h=this.opts.backgroundRgb??[.04,.06,.1],p=Qt(o?Yu:f.ink)??[1,1,1],b=ia(o?ho:f.backing,h);return n.dataset.qualityContrast=Jt(p,b).toFixed(3),c.textTransform=t.kind==="zone"||t.kind==="floor"?"uppercase":"",t.kind==="section"&&this.dressSectionTag(n,t,i),t.kind==="gate"&&this.dressGateTag(n,t),t.venueIcon&&this.dressVenueIconTag(n,t.venueIcon),n}dressVenueIconTag(t,n){let o=no(n);if(!o)return;let r=t.style;r.display="inline-flex",r.alignItems="center",r.gap="5px";let i=16,a=gi.glyphScale,s=document.createElement("span");s.setAttribute("aria-hidden","true"),s.setAttribute("data-venue-icon",o.key),s.style.lineHeight="0",s.innerHTML=`<svg width="${i}" height="${i}" viewBox="0 0 24 24"><circle cx="12" cy="12" r="11.25" fill="${yi[o.group]}" stroke="${Uo}" stroke-width="1.5"/><path transform="translate(${12-12*a} ${12-12*a}) scale(${a})" d="${o.solid}" fill="${Uo}"/></svg>`,t.prepend(s)}dressGateTag(t,n){let o=t.style;o.background="#0f172a",o.color="#ffffff",o.border="1px solid rgba(255,255,255,0.28)",o.textTransform="uppercase",o.letterSpacing="0.06em",o.display="inline-flex",o.alignItems="center",o.gap="5px";let r=document.createElement("span");if(r.setAttribute("aria-hidden","true"),r.setAttribute("data-gate-arrow",n.icon==="exit"?"out":"in"),r.innerHTML=n.icon==="exit"?'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 1.5H2v9h3"/><path d="M5.5 6h5M8.5 3.5 11 6 8.5 8.5"/></svg>':'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M7 1.5h3v9H7"/><path d="M1 6h5.5M4 3.5 6.5 6 4 8.5"/></svg>',t.prepend(r),n.stepFree){let i=document.createElement("span");i.setAttribute("data-gate-step-free","true"),i.setAttribute("aria-label","Step-free"),i.style.lineHeight="0",i.innerHTML=fr("wheelchair",{size:11}),t.append(i)}t.dataset.qualityContrast=Jt([1,1,1],Qt("#0f172a")).toFixed(3)}dressSectionTag(t,n,o){let r=n.tint?i1(n.tint):null,i=t.style;if(r&&(i.background=r.fill,i.color=r.ink,i.border=`1px solid ${r.border}`,t.dataset.qualityContrast=r.contrast.toFixed(3)),o<=0)return;let a=document.createElement("span");a.setAttribute("data-wheelchair-free",String(o)),a.setAttribute("aria-label",`${o} wheelchair ${o===1?"place":"places"} free`),a.innerHTML=`${fr("wheelchair",{size:11})}<span>${o}</span>`;let s=a.style;s.display="inline-flex",s.alignItems="center",s.gap="2px",s.marginLeft="6px",s.padding="1px 5px",s.borderRadius="999px",s.background="#2563eb",s.color="#ffffff",s.fontSize="0.85em",s.lineHeight="1.2",s.verticalAlign="middle",t.appendChild(a)}paintAccessChip(t,n){t.setAttribute("data-label-kind","access"),t.setAttribute("data-access-type",n.icon??""),t.innerHTML=n.icon?fr(n.icon,{size:_n-6}):"",t.setAttribute("role","img"),t.setAttribute("aria-label",n.text);let o=t.style;return o.width=`${_n}px`,o.height=`${_n}px`,o.alignItems="center",o.justifyContent="center",o.borderRadius="50%",o.background=n.color??"#3b82f6",o.color=n.ink??"#ffffff",o.border="1.5px solid #ffffff",o.boxShadow="0 2px 6px rgba(0,0,0,.35)",o.padding="0",o.lineHeight="0",o.boxSizing="border-box",t.dataset.qualityContrast=Jt(Qt(n.ink??"#ffffff")??[1,1,1],Qt(n.color??"#3b82f6")??[.23,.51,.96]).toFixed(3),t}placePinHeads(t){for(;this.pinHeads.length<t.length;){let n=document.createElement("div");n.setAttribute("data-pin-head",""),n.setAttribute("aria-hidden","true");let o=n.style;o.position="absolute",o.left="0",o.top="0",o.width=`${Ku}px`,o.height=`${Ku}px`,o.borderRadius="50%",o.background=ho,o.boxShadow="0 0 0 3px rgba(255,255,255,.28), 0 0 14px rgba(255,255,255,.55), 0 3px 8px rgba(0,0,0,.45)",o.pointerEvents="none",this.root.appendChild(n),this.pinHeads.push(n)}this.pinHeads.forEach((n,o)=>{let r=t[o];n.style.display=r?"":"none",r&&(n.style.transform=`translate(-50%, -100%) translate(${r.x.toFixed(1)}px, ${r.y.toFixed(1)}px)`)})}dispose(){this.pinHeads=[],this.root.remove(),this.nodes.clear()}};var nm=1;var d1=new Set(["floor","stage","zone","section","ga","booth","annotation"]);function h1(e){return e.every(t=>Number.isFinite(t))}function p1(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function tm(e){return e.length?Math.round(Math.min(...e)*100)/100:null}function en(e){return Math.round(e*1e4)/1e4}function b1(e){if(e)return{box:{x:en(e.box.x),y:en(e.box.y),width:en(e.box.width),height:en(e.box.height)},horizontalFillRatio:en(e.horizontalFillRatio),verticalFillRatio:en(e.verticalFillRatio),visibleAreaRatio:en(e.visibleAreaRatio),clippedEdges:[...e.clippedEdges]}}function xt(e,t,n){return n.length?{code:e,message:t,count:n.length,samples:n.slice(0,20)}:null}function hr(e){let t=e.labels.filter(s=>s.visible&&s.screenBox),n=t.filter(s=>d1.has(s.kind)),o=e.scene.floorCount>1?e.scene.floorCount:e.scene.zoneCount||e.scene.sectionCount,r=[];for(let s=0;s<n.length;s+=1)for(let c=0;c<s;c+=1)p1(n[s].screenBox,n[c].screenBox)&&r.push({primaryId:n[s].id,primaryLabel:n[s].text,secondaryId:n[c].id});let i=[...e.camera.position,e.camera.distance,e.camera.verticalFovDeg],a=[xt("webgl2-unavailable","The venue scene must render through WebGL2",e.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),xt("context-lost","The WebGL context must be live at capture",e.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),xt("frame-not-stable","The captured 3D frame must be rendered and parked",e.frame.rendered>0&&e.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),xt("viewport-empty","The 3D viewport must have visible dimensions",e.viewport.width>1&&e.viewport.height>1?[]:[{primaryId:"viewport",primaryLabel:`${e.viewport.width}\xD7${e.viewport.height}`}]),xt("camera-invalid","The capture camera must have a finite physical pose",h1(i)&&e.camera.distance>0&&e.camera.verticalFovDeg>0&&e.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),xt("authored-relief-not-visible","Authored 3D height or rake must produce visible screen-space relief",!e.scene.authoredRelief||e.scene.renderedVerticalSpanM>.05&&e.scene.projectedReliefPx>=2?[]:[{primaryId:"scene",primaryLabel:"authored relief",measured:e.scene.projectedReliefPx,minimum:2}]),xt("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",o===0||n.length>0?[]:[{primaryId:"labels",primaryLabel:`${o} expected hierarchy labels`}]),xt("hierarchy-label-undersized","Visible 3D hierarchy labels must remain readable",n.filter(s=>s.renderedFontPx<11).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.renderedFontPx,minimum:11}))),xt("hierarchy-label-contrast-low","Visible 3D hierarchy labels must meet text contrast",n.filter(s=>s.contrast<4.5).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.contrast,minimum:4.5}))),xt("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",r)].filter(s=>!!s);return{version:1,state:"venue3d",passed:a.length===0,resolvedRules:["rendered-3d-webgl-context","rendered-3d-stable-frame","rendered-3d-camera-pose","rendered-3d-relief-projection","rendered-3d-label-size","rendered-3d-label-contrast","rendered-3d-label-collision"],viewport:e.viewport,context:e.context,frame:e.frame,camera:e.camera,scene:e.scene,composition:{visibleLabels:t.map(({id:s,kind:c,text:l})=>({id:s,kind:c,text:l})).sort((s,c)=>s.kind.localeCompare(c.kind)||s.id.localeCompare(c.id)),framing:b1(e.framing)},metrics:{minimumHierarchyFontPx:tm(n.map(s=>s.renderedFontPx)),minimumHierarchyContrast:tm(n.map(s=>s.contrast)),projectedReliefPx:Math.round(e.scene.projectedReliefPx*100)/100},findings:a}}function om(e,t,n){e.fill(0);for(let o=0;o<Math.min(n,t.length);o++)e[t[o]]=1}var Ne=require("ogl");var Nt=require("ogl");var pr=`
|
|
79
|
+
}`;function Kg(e){if(e>=1)return 1;if(e<.72){let n=e/.72;return 1-(1-n)*(1-n)}let t=(e-.72)/.28;return 1-.08*Math.sin(t*Math.PI)}function oa(e){return Math.max(Dg,Math.min(Ng,e*Fg))}function $g(e){let t=.2126*e[0]+.7152*e[1]+.0722*e[2],n=t>=.25?0:Math.min(.45,(.25-t)*2.2);return e.map(o=>o+(1-o)*n)}function Yu(e,t,n=[.24,.74,1]){n=$g(n);let o=new Dt.Transform,r=Wg(e),i=new Map,a=(s,c,l)=>{let u=new Dt.Program(e,{vertex:Xg,fragment:Yg,uniforms:{uSeat:{value:s},uHeight:{value:1},uLift:{value:0},uRingScale:{value:1},uFigure:{value:1},uYaw:{value:l},uBeamHeight:{value:Rn.height},uBeam:{value:0},uFigureColor:{value:n},uColor:{value:t},uRingAlpha:{value:.85}},transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1}),m=new Dt.Mesh(e,{geometry:r,program:u});return m.frustumCulled=!1,m.setParent(o),{mesh:m,program:u,seat:s,start:c}};return{root:o,setSeats(s,c,l){let u=new Set(s.slice(0,Uu).map(m=>m.id));for(let[m,f]of i)u.has(m)||(f.mesh.setParent(null),i.delete(m));for(let m of s.slice(0,Uu))i.has(m.id)||i.set(m.id,a(m.position,l?c:-1/0,m.facing??0))},update(s,c,l,u=!1){let m=!1;for(let f of i.values()){let d=c[0]-f.seat[0],h=c[1]-f.seat[1],p=c[2]-f.seat[2],b=Math.hypot(d,h,p);f.mesh.visible=!l&&b>(u?Vg:Gg);let y=oa(b),M=Math.max(0,Math.min(1,(s-f.start)/Hg));M<1&&(m=!0),f.program.uniforms.uHeight.value=y,f.program.uniforms.uRingScale.value=Math.min(y,Bg),f.program.uniforms.uLift.value=u?1:1-Kg(M),f.program.uniforms.uFigure.value=Ug(b,u)?1:0,f.program.uniforms.uBeam.value=jg(b,u),f.program.uniforms.uRingAlpha.value=.55+.4*(M<1?Math.sin(M*Math.PI):0)}return m},dispose(){for(let s of i.values())s.mesh.setParent(null);i.clear(),r.remove()}}}var Zg={wheelchair:'<circle cx="10.6" cy="3.7" r="1.7" /><path d="M8.9 6.3v4.3a1.3 1.3 0 0 0 1.3 1.3h3.4l1.9 4.5h1.9" /><circle cx="9.7" cy="13.3" r="4.7" />',companion:'<circle cx="6" cy="6" r="2" /><circle cx="14" cy="6" r="2" /><path d="M2.5 16v-3.5A3.5 3.5 0 0 1 6 9a3.5 3.5 0 0 1 3.5 3.5V16M10.5 16v-3.5A3.5 3.5 0 0 1 14 9a3.5 3.5 0 0 1 3.5 3.5V16" />',"semi-ambulatory":'<circle cx="8" cy="4" r="1.7" /><path d="m8 6 2 4 3 2M10 10l-2 3-1 4M10 10l2 7M14 7l2 10" />',"designated-aisle":'<path d="M3.5 5.5v7h8.5V10H6.5M5 12.5V17M11 12.5V17" /><path d="M13.5 6.5H19M16.5 4l2.5 2.5L16.5 9" />',"step-free":'<circle cx="5.5" cy="5" r="1.7" /><path d="M5.5 7v4l3 2M2.5 16.5H8l7-7h3M8 16.5h10" />',hearing:'<path d="M7 16c-1-1.2-1.5-2.4-1.5-3.8V9a5 5 0 1 1 10 0c0 2.2-1.2 3.2-2.6 4-1.2.7-1.7 1.4-1.7 2.4A2.6 2.6 0 0 1 8.6 18" />',cart:'<path d="M8 6.5A4 4 0 1 0 8 13M17 6.5a4 4 0 1 0 0 6.5" />',"sign-language":'<path d="M6 16V8.5a1 1 0 0 1 2 0v3M8 11V5.5a1 1 0 0 1 2 0V11M10 11V4.5a1 1 0 0 1 2 0V11M12 11V6a1 1 0 0 1 2 0v6l1-1.5a1.2 1.2 0 0 1 2 1.3L14 17H9.5A3.5 3.5 0 0 1 6 13.5" />',"low-vision":'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><circle cx="10" cy="10" r="2.5" /><path d="m15 4 .5-1.5M17 5l1.5-.8" />',"sensory-friendly":'<path d="M4 11v-1a6 6 0 0 1 12 0v1M4 11h2.5v5H5a1 1 0 0 1-1-1v-4ZM16 11h-2.5v5H15a1 1 0 0 0 1-1v-4Z" /><path d="M8.5 11.5c.8.7 2.2.7 3 0M9 14c.6.4 1.4.4 2 0" />',"plus-size":'<path d="M5 9V6.5A2.5 2.5 0 0 1 7.5 4h5A2.5 2.5 0 0 1 15 6.5V9M3.5 8.5v5h13v-5M6 13.5V17M14 13.5V17" />',"lift-armrest":'<path d="M5 10V6.5A2.5 2.5 0 0 1 7.5 4h4A2.5 2.5 0 0 1 14 6.5V10M4 9v4h11V9M6 13v4M13 13v4" /><path d="M17 11V4M15 6l2-2 2 2" />',obstructedView:'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><path d="m4 17 12-14" />',restrictedView:'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><path d="M10 7.5v3.5M10 13.5h.01" />',premium:'<path d="m10 2.5 2.2 4.6 5 .7-3.6 3.5.9 5-4.5-2.4-4.5 2.4.9-5-3.6-3.5 5-.7Z" />',note:'<circle cx="10" cy="10" r="7.5" /><path d="M10 9.2v4.6M10 6.3h.01" />',aisle:'<path d="M2.5 6v7h6.5v-2.5H4.5M3.5 13v3.5M8 13v3.5" /><path d="M12.5 3v14M17 3v14" />',entrance:'<path d="M10 3.5h6.5v13H10" /><path d="M3 10h8.5M8.5 7l3 3-3 3" />',booth:'<path d="M3.5 8.5h13v8h-13ZM2.5 8.5 4 4h12l1.5 4.5M8 16.5v-4h4v4" />'};function qg(e){return Zg[e]??""}function dr(e,t={}){let n=qg(e);if(!n)return"";let o=t.size??18,r=20;return`<svg viewBox="0 0 ${r} ${r}" width="${o}" height="${o}" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round"`+(t.className?` class="${t.className}"`:"")+` aria-hidden="true" focusable="false">${n}</svg>`}var ho="#ffffff",Ku="#0b1220",po=6,Qg=80,$u=14,Zu=88,qu=20,Qu={floor:{size:14,weight:"700",opacity:.98},stage:{size:14,weight:"700",opacity:.98},zone:{size:15,weight:"600",opacity:.95},section:{size:12,weight:"500",opacity:.88},ga:{size:12,weight:"500",opacity:.88},gate:{size:12,weight:"700",opacity:.98},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:11.5,weight:"700",opacity:.94},seat:{size:12.5,weight:"800",opacity:1},access:{size:12,weight:"700",opacity:1}},Jg=640,e1=.8,t1=11,n1="3px 7px",o1="2px 5px",Ju="rgba(10,14,22,.62)",r1="#f4f7fb",em=5,tm=2,i1=6,bo=new Set(["row","seat","access"]),ra={stage:6,gate:5,floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},Cn={row:{x:66,y:20},seat:{x:52,y:22}},Qt=be,ia=e=>Za(e);function Jt(e,t){let n=ia(e),o=ia(t);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}function a1(e){let t=Qt(e);if(!t)return null;let n=i=>`#${i.map(a=>Math.round(Math.max(0,Math.min(1,a))*255).toString(16).padStart(2,"0")).join("")}`,o=t.map(i=>i+(1-i)*.78),r=t.map(i=>i*.62);for(let i=0;i<12&&Jt(r,o)<4.5;i++)r=r.map(a=>a*.8);return{fill:n(o),ink:n(r),border:n(t.map(i=>i+(1-i)*.35)),contrast:Jt(r,o)}}var s1=30;function aa(e,t){let n=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(e.replace(/\s/g,""));if(!n)return t;let o=Math.max(0,Math.min(1,Number(n[4])));return[1,2,3].map(r=>Number(n[r])/255*o+t[r-1]*(1-o))}function c1(e,t=[.04,.06,.1],n=!0){let o=ia(t)<.42,r=o?"#f4f7fb":"#0b1220",i=o?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",a=n?aa(i,t):t,s=Qt(e),c=n?7:4.5,l=s&&Jt(s,a)>=c?e:r;return o?{ink:l,backing:i,border:"rgba(210,222,245,.24)"}:{ink:l,backing:i,border:"rgba(11,18,32,.22)"}}function l1(e,t=[.04,.06,.1]){let n=aa(Ju,t),o=Qt(e);return{ink:o&&Jt(o,n)>=4.5?e:r1,backing:Ju}}var u1=.8,_n=20,m1=14,f1=60,d1='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',hr=class{constructor(t,n={}){this.nodes=new Map;this.labels=[];this.wheelchairFree=new Map;this.nodeAppearance=new WeakMap;this.forcedDense=!1;this.overviewDistance=null;this.selectedSeatLabelIds=new Set;this.narrowStage=!1;this.seatNumberRow=void 0;this.seatNumberSeat=null;this.pinHeads=[];this.opts=n,this.root=document.createElement("div"),this.root.setAttribute("data-view3d-labels","");let o=this.root.style;o.position="absolute",o.inset="0",o.pointerEvents="none",o.overflow="hidden",o.fontFamily=n.fontFamily||d1,t.appendChild(this.root)}setVisible(t){this.root.style.visibility=t?"":"hidden"}setLabels(t){this.labels=t;let n=new Set(t.map(o=>o.id));for(let[o,r]of this.nodes)n.has(o)||(r.remove(),this.nodes.delete(o))}setForcedDense(t){this.forcedDense=t}setOverviewDistance(t){this.overviewDistance=t>0?t:null}setSeatNumberRow(t){return t===this.seatNumberRow?!1:(this.seatNumberRow=t,!0)}setSeatNumberSeat(t){let n=t?`seat:${t}`:null;return n===this.seatNumberSeat?!1:(this.seatNumberSeat=n,!0)}setWheelchairFree(t){let n=t.size!==this.wheelchairFree.size;if(!n){for(let[o,r]of t)if(this.wheelchairFree.get(o)!==r){n=!0;break}}return n&&(this.wheelchairFree=new Map(t)),n}setSelectedSeatIds(t){this.selectedSeatLabelIds=new Set(Array.from(t,n=>`seat:${n}`))}sizeFor(t){let n=Qu[t].size;return!this.narrowStage||bo.has(t)?n:Math.max(t1,n*e1)}qualityEvidence(){let t=this.root.getBoundingClientRect(),n=this.root.style.visibility!=="hidden";return this.labels.map(o=>{let r=this.nodes.get(o.id),i=r?.getBoundingClientRect(),a=!!(n&&r&&r.style.display!=="none"&&i&&i.width>0&&i.height>0);return{id:o.id,kind:o.kind,text:o.text,visible:a,renderedFontPx:r&&Number.parseFloat(r.style.fontSize)||0,contrast:r?Number(r.dataset.qualityContrast??0):0,...a&&i?{screenBox:{x:i.x-t.x,y:i.y-t.y,width:i.width,height:i.height}}:{}}})}update(t,n,o,r,i,a){if(!this.labels.length)return;this.narrowStage=n>0&&n<Jg;let s=du(r,i,{hasZoneLabels:this.labels.some(S=>S.kind==="zone")});this.forcedDense&&(s.add("row"),s.add("seat"),s.add("access")),!this.forcedDense&&this.overviewDistance!==null&&r>this.overviewDistance*u1&&(s.delete("section"),s.delete("ga")),s.has("section")&&this.labels.some(S=>S.kind==="section")&&s.delete("zone");let c=[];for(let S of this.labels){let w=S.kind==="annotation"&&!!S.venueIcon;if(!s.has(S.kind)&&!w&&!(S.kind==="seat"&&this.selectedSeatLabelIds.has(S.id)))continue;let E=S.kind==="seat"&&a&&this.selectedSeatLabelIds.has(S.id)?S.pinBase:void 0,T=E&&a?[E[0],E[1]+oa(Math.hypot(E[0]-a[0],E[1]-a[1],E[2]-a[2])),E[2]]:S.anchor,F=gt(t,T,n,o);if(!F.visible)continue;let R=bo.has(S.kind),I=this.sizeFor(S.kind),_=S.kind==="access"?_n:bu(S.text,I,!R)+(R?em*2:0)+((this.wheelchairFree.get(S.id)??0)>0?s1:0);if(S.kind==="access"&&S.seatWidthM!==void 0&&$i(t,S.anchor,S.seatWidthM,n)<m1||S.kind==="seat"&&S.seatWidthM!==void 0&&!this.selectedSeatLabelIds.has(S.id)&&$i(t,S.anchor,S.seatWidthM,n)<Math.max(22,_))continue;let k=hu(F,_/2,I/2+(R?tm:4),n,o),V=a?Math.hypot(S.anchor[0]-a[0],S.anchor[1]-a[1],S.anchor[2]-a[2]):1;c.push({label:S,screen:k,focus:gu(k,V,n,o),halfWidth:_/2,...this.selectedSeatLabelIds.has(S.id)?{priority:1}:{}})}let l=fu(c.filter(S=>S.label.kind==="floor"),n),u=[...c.filter(S=>!bo.has(S.label.kind)&&S.label.kind!=="floor"),...l],m=yu(n),f=c.filter(S=>S.label.kind==="seat"&&this.selectedSeatLabelIds.has(S.label.id)),d=mo(f,Cn.seat.x,Cn.seat.y,m.seat);this.placePinHeads(f.filter(S=>S.label.pinBase&&!d.includes(S)).map(S=>S.screen));let h=pu(u,Zu,qu,S=>ra[S.label.kind]??0).filter(S=>!d.some(w=>uo(S,w,Zu,qu))),p=mo(c.filter(S=>S.label.kind==="access"),_n,_n,f1,[...h,...d]),b=mo(c.filter(S=>S.label.kind==="row"),Cn.row.x,Cn.row.y,m.row,[...h,...d,...p]),y=this.seatNumberRow!==void 0||this.seatNumberSeat!==null,M=mo(c.filter(S=>S.label.kind==="seat"&&!this.selectedSeatLabelIds.has(S.label.id)&&(this.seatNumberSeat!==null?S.label.id===this.seatNumberSeat:!y||this.seatNumberRow!==null&&S.label.rowId===this.seatNumberRow)),Cn.seat.x,Cn.seat.y,y?Qg:m.seat-d.length,[...h,...d,...p,...b]),v=[...h,...p,...b,...d,...M],A=new Set(v.map(S=>S.label.id));for(let{label:S,screen:w}of v){let T=this.nodeFor(S).style;T.display=S.kind==="access"?"flex":S.kind==="gate"?"inline-flex":"";let F=!!S.pinBase&&this.selectedSeatLabelIds.has(S.id);T.transform=F?`translate(-50%, -100%) translate(${w.x.toFixed(1)}px, ${(w.y-po).toFixed(1)}px)`:`translate(-50%, -50%) translate(${w.x.toFixed(1)}px, ${w.y.toFixed(1)}px)`}let g=v.filter(({label:S})=>!bo.has(S.kind)).sort((S,w)=>ra[w.label.kind]-ra[S.label.kind]||S.screen.depth-w.screen.depth||S.focus-w.focus).flatMap(({label:S})=>{let w=this.nodes.get(S.id);return w&&w.style.display!=="none"?[{node:w,box:w.getBoundingClientRect()}]:[]}),P=[];for(let{node:S,box:w}of g)P.some(T=>w.left<T.right+3&&w.right+3>T.left&&w.top<T.bottom+3&&w.bottom+3>T.top)?S.style.display="none":P.push(w);for(let[S,w]of this.nodes)A.has(S)||(w.style.display="none")}nodeFor(t){let n=this.nodes.get(t.id);if(!n){n=document.createElement("div");let y=n.style;y.position="absolute",y.left="0",y.top="0",y.whiteSpace="nowrap",y.display="none",this.root.appendChild(n),this.nodes.set(t.id,n)}let o=this.selectedSeatLabelIds.has(t.id),r=this.nodeAppearance.get(n),i=this.wheelchairFree.get(t.id)??0,a=t.text+(t.icon??"")+(t.venueIcon??"")+(t.tint??"")+(i>0?`|${i}`:"");if(r&&r.text===a&&r.kind===t.kind&&r.color===t.color&&r.selected===o&&r.narrow===this.narrowStage)return n;if(this.nodeAppearance.set(n,{text:a,kind:t.kind,color:t.color,selected:o,narrow:this.narrowStage}),t.kind==="access")return this.paintAccessChip(n,t);if(n.textContent=t.text,o){let y=document.createElement("span"),M=y.style;M.position="absolute",M.left="50%",M.bottom=`-${po}px`,M.transform="translateX(-50%)",M.borderLeft=`${po}px solid transparent`,M.borderRight=`${po}px solid transparent`,M.borderTop=`${po}px solid ${ho}`,n.appendChild(y)}n.setAttribute("data-label-kind",t.kind),n.toggleAttribute("data-selected-seat",o);let s=Qu[t.kind],c=n.style;c.fontSize=`${this.sizeFor(t.kind)}px`,c.fontWeight=o?"800":s.weight,c.opacity=o?"1":String(s.opacity);let l=bo.has(t.kind),u=!l,m=c1(t.color??this.opts.ink,this.opts.backgroundRgb,!0),f=l?l1(t.color??this.opts.ink,this.opts.backgroundRgb):m;c.color=o?Ku:f.ink,c.background=o?ho:f.backing,c.border=o?`1px solid ${ho}`:u?`1px solid ${m.border}`:"",c.borderRadius=o||u?"999px":`${i1}px`;let d=this.narrowStage?o1:n1;c.padding=o||u?d:`${tm}px ${em}px`,c.lineHeight=l?"1.1":"",c.boxShadow=o?"0 0 0 3px rgba(255,255,255,.28), 0 0 18px rgba(255,255,255,.55), 0 5px 14px rgba(0,0,0,.45)":u?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",c.textShadow=o||u?"none":"0 1px 1px rgba(0,0,0,0.4)",c.letterSpacing=t.kind==="zone"||t.kind==="floor"?"0.08em":"0.02em";let h=this.opts.backgroundRgb??[.04,.06,.1],p=Qt(o?Ku:f.ink)??[1,1,1],b=aa(o?ho:f.backing,h);return n.dataset.qualityContrast=Jt(p,b).toFixed(3),c.textTransform=t.kind==="zone"||t.kind==="floor"?"uppercase":"",t.kind==="section"&&this.dressSectionTag(n,t,i),t.kind==="gate"&&this.dressGateTag(n,t),t.venueIcon&&this.dressVenueIconTag(n,t.venueIcon),n}dressVenueIconTag(t,n){let o=no(n);if(!o)return;let r=t.style;r.display="inline-flex",r.alignItems="center",r.gap="5px";let i=16,a=xi.glyphScale,s=document.createElement("span");s.setAttribute("aria-hidden","true"),s.setAttribute("data-venue-icon",o.key),s.style.lineHeight="0",s.innerHTML=`<svg width="${i}" height="${i}" viewBox="0 0 24 24"><circle cx="12" cy="12" r="11.25" fill="${gi[o.group]}" stroke="${Wo}" stroke-width="1.5"/><path transform="translate(${12-12*a} ${12-12*a}) scale(${a})" d="${o.solid}" fill="${Wo}"/></svg>`,t.prepend(s)}dressGateTag(t,n){let o=t.style;o.background="#0f172a",o.color="#ffffff",o.border="1px solid rgba(255,255,255,0.28)",o.textTransform="uppercase",o.letterSpacing="0.06em",o.display="inline-flex",o.alignItems="center",o.gap="5px";let r=document.createElement("span");if(r.setAttribute("aria-hidden","true"),r.setAttribute("data-gate-arrow",n.icon==="exit"?"out":"in"),r.innerHTML=n.icon==="exit"?'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 1.5H2v9h3"/><path d="M5.5 6h5M8.5 3.5 11 6 8.5 8.5"/></svg>':'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M7 1.5h3v9H7"/><path d="M1 6h5.5M4 3.5 6.5 6 4 8.5"/></svg>',t.prepend(r),n.stepFree){let i=document.createElement("span");i.setAttribute("data-gate-step-free","true"),i.setAttribute("aria-label","Step-free"),i.style.lineHeight="0",i.innerHTML=dr("wheelchair",{size:11}),t.append(i)}t.dataset.qualityContrast=Jt([1,1,1],Qt("#0f172a")).toFixed(3)}dressSectionTag(t,n,o){let r=n.tint?a1(n.tint):null,i=t.style;if(r&&(i.background=r.fill,i.color=r.ink,i.border=`1px solid ${r.border}`,t.dataset.qualityContrast=r.contrast.toFixed(3)),o<=0)return;let a=document.createElement("span");a.setAttribute("data-wheelchair-free",String(o)),a.setAttribute("aria-label",`${o} wheelchair ${o===1?"place":"places"} free`),a.innerHTML=`${dr("wheelchair",{size:11})}<span>${o}</span>`;let s=a.style;s.display="inline-flex",s.alignItems="center",s.gap="2px",s.marginLeft="6px",s.padding="1px 5px",s.borderRadius="999px",s.background="#2563eb",s.color="#ffffff",s.fontSize="0.85em",s.lineHeight="1.2",s.verticalAlign="middle",t.appendChild(a)}paintAccessChip(t,n){t.setAttribute("data-label-kind","access"),t.setAttribute("data-access-type",n.icon??""),t.innerHTML=n.icon?dr(n.icon,{size:_n-6}):"",t.setAttribute("role","img"),t.setAttribute("aria-label",n.text);let o=t.style;return o.width=`${_n}px`,o.height=`${_n}px`,o.alignItems="center",o.justifyContent="center",o.borderRadius="50%",o.background=n.color??"#3b82f6",o.color=n.ink??"#ffffff",o.border="1.5px solid #ffffff",o.boxShadow="0 2px 6px rgba(0,0,0,.35)",o.padding="0",o.lineHeight="0",o.boxSizing="border-box",t.dataset.qualityContrast=Jt(Qt(n.ink??"#ffffff")??[1,1,1],Qt(n.color??"#3b82f6")??[.23,.51,.96]).toFixed(3),t}placePinHeads(t){for(;this.pinHeads.length<t.length;){let n=document.createElement("div");n.setAttribute("data-pin-head",""),n.setAttribute("aria-hidden","true");let o=n.style;o.position="absolute",o.left="0",o.top="0",o.width=`${$u}px`,o.height=`${$u}px`,o.borderRadius="50%",o.background=ho,o.boxShadow="0 0 0 3px rgba(255,255,255,.28), 0 0 14px rgba(255,255,255,.55), 0 3px 8px rgba(0,0,0,.45)",o.pointerEvents="none",this.root.appendChild(n),this.pinHeads.push(n)}this.pinHeads.forEach((n,o)=>{let r=t[o];n.style.display=r?"":"none",r&&(n.style.transform=`translate(-50%, -100%) translate(${r.x.toFixed(1)}px, ${r.y.toFixed(1)}px)`)})}dispose(){this.pinHeads=[],this.root.remove(),this.nodes.clear()}};var om=1;var h1=new Set(["floor","stage","zone","section","ga","booth","annotation"]);function p1(e){return e.every(t=>Number.isFinite(t))}function b1(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function nm(e){return e.length?Math.round(Math.min(...e)*100)/100:null}function en(e){return Math.round(e*1e4)/1e4}function y1(e){if(e)return{box:{x:en(e.box.x),y:en(e.box.y),width:en(e.box.width),height:en(e.box.height)},horizontalFillRatio:en(e.horizontalFillRatio),verticalFillRatio:en(e.verticalFillRatio),visibleAreaRatio:en(e.visibleAreaRatio),clippedEdges:[...e.clippedEdges]}}function xt(e,t,n){return n.length?{code:e,message:t,count:n.length,samples:n.slice(0,20)}:null}function pr(e){let t=e.labels.filter(s=>s.visible&&s.screenBox),n=t.filter(s=>h1.has(s.kind)),o=e.scene.floorCount>1?e.scene.floorCount:e.scene.zoneCount||e.scene.sectionCount,r=[];for(let s=0;s<n.length;s+=1)for(let c=0;c<s;c+=1)b1(n[s].screenBox,n[c].screenBox)&&r.push({primaryId:n[s].id,primaryLabel:n[s].text,secondaryId:n[c].id});let i=[...e.camera.position,e.camera.distance,e.camera.verticalFovDeg],a=[xt("webgl2-unavailable","The venue scene must render through WebGL2",e.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),xt("context-lost","The WebGL context must be live at capture",e.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),xt("frame-not-stable","The captured 3D frame must be rendered and parked",e.frame.rendered>0&&e.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),xt("viewport-empty","The 3D viewport must have visible dimensions",e.viewport.width>1&&e.viewport.height>1?[]:[{primaryId:"viewport",primaryLabel:`${e.viewport.width}\xD7${e.viewport.height}`}]),xt("camera-invalid","The capture camera must have a finite physical pose",p1(i)&&e.camera.distance>0&&e.camera.verticalFovDeg>0&&e.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),xt("authored-relief-not-visible","Authored 3D height or rake must produce visible screen-space relief",!e.scene.authoredRelief||e.scene.renderedVerticalSpanM>.05&&e.scene.projectedReliefPx>=2?[]:[{primaryId:"scene",primaryLabel:"authored relief",measured:e.scene.projectedReliefPx,minimum:2}]),xt("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",o===0||n.length>0?[]:[{primaryId:"labels",primaryLabel:`${o} expected hierarchy labels`}]),xt("hierarchy-label-undersized","Visible 3D hierarchy labels must remain readable",n.filter(s=>s.renderedFontPx<11).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.renderedFontPx,minimum:11}))),xt("hierarchy-label-contrast-low","Visible 3D hierarchy labels must meet text contrast",n.filter(s=>s.contrast<4.5).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.contrast,minimum:4.5}))),xt("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",r)].filter(s=>!!s);return{version:1,state:"venue3d",passed:a.length===0,resolvedRules:["rendered-3d-webgl-context","rendered-3d-stable-frame","rendered-3d-camera-pose","rendered-3d-relief-projection","rendered-3d-label-size","rendered-3d-label-contrast","rendered-3d-label-collision"],viewport:e.viewport,context:e.context,frame:e.frame,camera:e.camera,scene:e.scene,composition:{visibleLabels:t.map(({id:s,kind:c,text:l})=>({id:s,kind:c,text:l})).sort((s,c)=>s.kind.localeCompare(c.kind)||s.id.localeCompare(c.id)),framing:y1(e.framing)},metrics:{minimumHierarchyFontPx:nm(n.map(s=>s.renderedFontPx)),minimumHierarchyContrast:nm(n.map(s=>s.contrast)),projectedReliefPx:Math.round(e.scene.projectedReliefPx*100)/100},findings:a}}function rm(e,t,n){e.fill(0);for(let o=0;o<Math.min(n,t.length);o++)e[t[o]]=1}var Ne=require("ogl");var Nt=require("ogl");var br=`
|
|
80
80
|
float chairWeight(float depth) {
|
|
81
81
|
return 1.0 - smoothstep(uChairFull, uChairNone, depth);
|
|
82
|
-
}`,
|
|
82
|
+
}`,im=`
|
|
83
83
|
float occupantWeight(float depth) {
|
|
84
84
|
float nearWeight = smoothstep(${us.toFixed(1)}, ${ms.toFixed(1)}, depth);
|
|
85
85
|
float farWeight = 1.0 - smoothstep(${cs.toFixed(1)}, ${ls.toFixed(1)}, depth);
|
|
86
86
|
return nearWeight * farWeight;
|
|
87
|
-
}`,
|
|
87
|
+
}`,sa=`
|
|
88
88
|
float glyphEq(float glyph, float expected) {
|
|
89
89
|
return 1.0 - step(0.25, abs(glyph - expected));
|
|
90
90
|
}
|
|
@@ -133,7 +133,7 @@ vec3 glyphChairPosition(vec3 p, float partId, float glyph) {
|
|
|
133
133
|
p.y += 0.16;
|
|
134
134
|
}
|
|
135
135
|
return p;
|
|
136
|
-
}`,
|
|
136
|
+
}`,g1=1.5,Tn=`
|
|
137
137
|
uniform vec4 uSeeThrough; // xyz = the seats looked at, w = cone radius there; 0 = off
|
|
138
138
|
bool seeThroughCut(vec3 p, vec3 eye) {
|
|
139
139
|
if (uSeeThrough.w <= 0.0) return false;
|
|
@@ -142,11 +142,11 @@ bool seeThroughCut(vec3 p, vec3 eye) {
|
|
|
142
142
|
if (len < 1.0) return false;
|
|
143
143
|
vec3 dir = axis / len;
|
|
144
144
|
float t = dot(p - eye, dir);
|
|
145
|
-
if (t <= 0.0 || t > len - ${
|
|
145
|
+
if (t <= 0.0 || t > len - ${g1.toFixed(2)}) return false;
|
|
146
146
|
vec3 onLine = eye + dir * t;
|
|
147
147
|
if (p.y < onLine.y - 0.25) return false;
|
|
148
148
|
return length(p - onLine) < uSeeThrough.w * t / len;
|
|
149
|
-
}`,
|
|
149
|
+
}`,x1=`#version 300 es
|
|
150
150
|
precision highp float;
|
|
151
151
|
in vec3 position;
|
|
152
152
|
in vec3 normal;
|
|
@@ -184,13 +184,13 @@ void main() {
|
|
|
184
184
|
vNormalWorld = normalize(mat3(modelMatrix) * normal);
|
|
185
185
|
vColor = color;
|
|
186
186
|
gl_Position = projectionMatrix * mv;
|
|
187
|
-
}`,
|
|
187
|
+
}`,am=`
|
|
188
188
|
bool roomWallHidden(float material, vec3 normalWorld, vec3 posWorld, vec3 eye, vec2 roomCentre) {
|
|
189
189
|
if (abs(material - 6.0) > 0.5) return false;
|
|
190
190
|
vec3 n = normalize(normalWorld);
|
|
191
191
|
if (abs(n.y) > 0.5) return true;
|
|
192
192
|
return dot(n.xz, eye.xz - posWorld.xz) * dot(n.xz, roomCentre - posWorld.xz) <= 0.0;
|
|
193
|
-
}`,
|
|
193
|
+
}`,M1=`#version 300 es
|
|
194
194
|
precision highp float;
|
|
195
195
|
in vec3 vColor;
|
|
196
196
|
in vec3 vNormalWorld;
|
|
@@ -210,7 +210,7 @@ uniform mat4 uShadowMatrix;
|
|
|
210
210
|
uniform vec3 cameraPosition;
|
|
211
211
|
uniform vec2 uRoomCentre;
|
|
212
212
|
out vec4 fragColor;
|
|
213
|
-
${
|
|
213
|
+
${am}
|
|
214
214
|
${Tn}
|
|
215
215
|
// Stable world-space variation; no textures or per-frame random grain.
|
|
216
216
|
float turfHash(vec2 p) {
|
|
@@ -342,8 +342,8 @@ void main() {
|
|
|
342
342
|
+ vec3(0.20, 0.10, 0.34) * focalHalo;
|
|
343
343
|
base = mix(base, display, poweredDisplay * verticalFace * 0.92);
|
|
344
344
|
fragColor = vec4(base, 1.0);
|
|
345
|
-
}`,
|
|
346
|
-
${
|
|
345
|
+
}`,sm=`
|
|
346
|
+
${sa}
|
|
347
347
|
vec4 seatSurface(vec3 source, float radius) {
|
|
348
348
|
vec4 origin = modelViewMatrix * vec4(iOffset, 1.0);
|
|
349
349
|
if (iPhysicalSeat < 0.5) {
|
|
@@ -362,7 +362,7 @@ vec4 seatSurface(vec3 source, float radius) {
|
|
|
362
362
|
vec3 rotated = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
|
|
363
363
|
return modelViewMatrix * vec4(iOffset + rotated, 1.0);
|
|
364
364
|
}
|
|
365
|
-
`,
|
|
365
|
+
`,v1=`#version 300 es
|
|
366
366
|
precision highp float;
|
|
367
367
|
in float surface;
|
|
368
368
|
in float iYaw;
|
|
@@ -402,8 +402,8 @@ out float vDotWeight; // 1 = the dot IS this seat, 0 = the chair has taken over
|
|
|
402
402
|
out float vPhysicalSeat;
|
|
403
403
|
out float vPixelRadius;
|
|
404
404
|
uniform vec3 cameraPosition;
|
|
405
|
-
${
|
|
406
|
-
${
|
|
405
|
+
${br}
|
|
406
|
+
${sm}
|
|
407
407
|
${Tn}
|
|
408
408
|
void main() {
|
|
409
409
|
if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
@@ -438,13 +438,13 @@ void main() {
|
|
|
438
438
|
vDim = (uFocusFloor < -0.5 || abs(iFloor - uFocusFloor) < 0.5) ? 0.0 : 1.0;
|
|
439
439
|
vSectionFade = (uFocusSection < -0.5 || abs(iSection - uFocusSection) < 0.5) ? 0.0 : 1.0;
|
|
440
440
|
gl_Position = projectionMatrix * mv;
|
|
441
|
-
}`,
|
|
441
|
+
}`,cm=`
|
|
442
442
|
float seatSilhouette(vec2 uv, float physical) {
|
|
443
443
|
// Solid furniture owns its silhouette in geometry. Only empty bays need
|
|
444
444
|
// a fragment mask; cutting physical faces would open holes in the volume.
|
|
445
445
|
return mix(max(abs(uv.x), abs(uv.y)), 0.0, physical);
|
|
446
446
|
}
|
|
447
|
-
`,
|
|
447
|
+
`,S1=`#version 300 es
|
|
448
448
|
precision highp float;
|
|
449
449
|
in vec3 vSeatNormal;
|
|
450
450
|
in float vSeatHeight;
|
|
@@ -464,7 +464,7 @@ uniform float uSeatDetail; // 0 for venue/area overview; 1 in section/row/sea
|
|
|
464
464
|
uniform vec3 uFadeColor;
|
|
465
465
|
uniform float uRoughness;
|
|
466
466
|
out vec4 fragColor;
|
|
467
|
-
${
|
|
467
|
+
${cm}
|
|
468
468
|
void main() {
|
|
469
469
|
if (vDim > 0.5) discard;
|
|
470
470
|
// Same screen-door dissolve as the structure rung (uStructureDetail): the
|
|
@@ -529,7 +529,7 @@ void main() {
|
|
|
529
529
|
c = mix(c, mix(vec3(lum), vec3(0.93), 0.35), 0.45);
|
|
530
530
|
}
|
|
531
531
|
fragColor = vec4(c, alpha);
|
|
532
|
-
}`,
|
|
532
|
+
}`,w1=`#version 300 es
|
|
533
533
|
precision highp float;
|
|
534
534
|
in vec3 position; // local: x/z in units of the seat radius, y in METRES
|
|
535
535
|
in vec3 normal;
|
|
@@ -565,9 +565,9 @@ out float vSectionFade;
|
|
|
565
565
|
out float vOccupant; // 1 = this vertex belongs to a person, not to the chair
|
|
566
566
|
out vec3 vOccupantTint;
|
|
567
567
|
out float vTaken; // 1 = sold or held: not for sale
|
|
568
|
-
${
|
|
569
|
-
${
|
|
570
|
-
${
|
|
568
|
+
${br}
|
|
569
|
+
${im}
|
|
570
|
+
${sa}
|
|
571
571
|
uniform vec3 cameraPosition;
|
|
572
572
|
${Tn}
|
|
573
573
|
void main() {
|
|
@@ -656,7 +656,7 @@ void main() {
|
|
|
656
656
|
vDim = (uFocusFloor < -0.5 || abs(iFloor - uFocusFloor) < 0.5) ? 0.0 : 1.0;
|
|
657
657
|
vSectionFade = (uFocusSection < -0.5 || abs(iSection - uFocusSection) < 0.5) ? 0.0 : 1.0;
|
|
658
658
|
gl_Position = projectionMatrix * mv;
|
|
659
|
-
}`,
|
|
659
|
+
}`,P1=`#version 300 es
|
|
660
660
|
precision highp float;
|
|
661
661
|
in vec3 vColor;
|
|
662
662
|
in vec3 vNormalWorld;
|
|
@@ -745,14 +745,14 @@ void main() {
|
|
|
745
745
|
base = mix(base, mix(vec3(lum), vec3(0.93), 0.35), 0.45);
|
|
746
746
|
}
|
|
747
747
|
fragColor = vec4(base, 1.0);
|
|
748
|
-
}`,
|
|
748
|
+
}`,A1=`#version 300 es
|
|
749
749
|
precision highp float;
|
|
750
750
|
in vec2 position;
|
|
751
751
|
out vec2 vUv;
|
|
752
752
|
void main() {
|
|
753
753
|
vUv = position * 0.5 + 0.5;
|
|
754
754
|
gl_Position = vec4(position, 0.999, 1.0);
|
|
755
|
-
}`,
|
|
755
|
+
}`,I1=`#version 300 es
|
|
756
756
|
precision highp float;
|
|
757
757
|
in vec2 vUv;
|
|
758
758
|
uniform vec3 uTop;
|
|
@@ -783,7 +783,7 @@ void main() {
|
|
|
783
783
|
col = mix(col, sky, smoothstep(-0.22, 0.03, up));
|
|
784
784
|
}
|
|
785
785
|
fragColor = vec4(col, 1.0);
|
|
786
|
-
}`,
|
|
786
|
+
}`,E1=`#version 300 es
|
|
787
787
|
precision highp float;
|
|
788
788
|
in float surface;
|
|
789
789
|
in float iYaw;
|
|
@@ -812,8 +812,8 @@ out float vDotWeight;
|
|
|
812
812
|
out float vHidden;
|
|
813
813
|
flat out vec3 vPick;
|
|
814
814
|
uniform vec3 cameraPosition;
|
|
815
|
-
${
|
|
816
|
-
${
|
|
815
|
+
${br}
|
|
816
|
+
${sm}
|
|
817
817
|
${Tn}
|
|
818
818
|
void main() {
|
|
819
819
|
if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
@@ -829,7 +829,7 @@ void main() {
|
|
|
829
829
|
vPhysicalSeat = iPhysicalSeat;
|
|
830
830
|
vHidden = (uFocusFloor > -0.5 && abs(iFloor - uFocusFloor) > 0.5) ? 1.0 : 0.0;
|
|
831
831
|
gl_Position = projectionMatrix * mv;
|
|
832
|
-
}`,
|
|
832
|
+
}`,R1=`#version 300 es
|
|
833
833
|
precision highp float;
|
|
834
834
|
in vec2 vUv;
|
|
835
835
|
in float vPhysicalSeat;
|
|
@@ -837,7 +837,7 @@ in float vDotWeight;
|
|
|
837
837
|
in float vHidden;
|
|
838
838
|
flat in vec3 vPick;
|
|
839
839
|
out vec4 fragColor;
|
|
840
|
-
${
|
|
840
|
+
${cm}
|
|
841
841
|
void main() {
|
|
842
842
|
if (vHidden > 0.5) discard;
|
|
843
843
|
if (vDotWeight <= 0.99) discard;
|
|
@@ -845,7 +845,7 @@ void main() {
|
|
|
845
845
|
float d = seatSilhouette(vUv, vPhysicalSeat);
|
|
846
846
|
if (d > 1.0) discard; // hit-mask matches chair/bay shape
|
|
847
847
|
fragColor = vec4(vPick, 1.0);
|
|
848
|
-
}`,
|
|
848
|
+
}`,C1=`#version 300 es
|
|
849
849
|
precision highp float;
|
|
850
850
|
in vec3 position;
|
|
851
851
|
in float part;
|
|
@@ -868,9 +868,9 @@ flat out vec3 vPick;
|
|
|
868
868
|
out float vChairWeight;
|
|
869
869
|
out float vHidden;
|
|
870
870
|
uniform vec3 cameraPosition;
|
|
871
|
-
${
|
|
872
|
-
${
|
|
873
|
-
${
|
|
871
|
+
${br}
|
|
872
|
+
${im}
|
|
873
|
+
${sa}
|
|
874
874
|
${Tn}
|
|
875
875
|
void main() {
|
|
876
876
|
if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
@@ -906,7 +906,7 @@ void main() {
|
|
|
906
906
|
float c = cos(iYaw), s = sin(iYaw);
|
|
907
907
|
vec3 rp = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
|
|
908
908
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(iOffset + rp, 1.0);
|
|
909
|
-
}`,
|
|
909
|
+
}`,_1=`#version 300 es
|
|
910
910
|
precision highp float;
|
|
911
911
|
flat in vec3 vPick;
|
|
912
912
|
in float vHidden;
|
|
@@ -916,7 +916,7 @@ void main() {
|
|
|
916
916
|
if (vHidden > 0.5) discard;
|
|
917
917
|
if (vChairWeight < 0.01) discard;
|
|
918
918
|
fragColor = vec4(vPick, 1.0);
|
|
919
|
-
}`,
|
|
919
|
+
}`,T1=`#version 300 es
|
|
920
920
|
precision highp float;
|
|
921
921
|
in vec3 position;
|
|
922
922
|
in vec3 normal;
|
|
@@ -936,7 +936,7 @@ void main() {
|
|
|
936
936
|
vNormalWorld = mat3(modelMatrix) * normal;
|
|
937
937
|
vPosWorld = (modelMatrix * vec4(position, 1.0)).xyz;
|
|
938
938
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
939
|
-
}`,
|
|
939
|
+
}`,L1=`#version 300 es
|
|
940
940
|
precision highp float;
|
|
941
941
|
in float vHidden;
|
|
942
942
|
in float vMaterial;
|
|
@@ -945,14 +945,14 @@ in vec3 vPosWorld;
|
|
|
945
945
|
uniform vec3 cameraPosition;
|
|
946
946
|
uniform vec2 uRoomCentre;
|
|
947
947
|
out vec4 fragColor;
|
|
948
|
-
${
|
|
948
|
+
${am}
|
|
949
949
|
${Tn}
|
|
950
950
|
void main() {
|
|
951
951
|
if (vHidden > 0.5) discard;
|
|
952
952
|
if (roomWallHidden(vMaterial, vNormalWorld, vPosWorld, cameraPosition, uRoomCentre)) discard;
|
|
953
953
|
if (seeThroughCut(vPosWorld, cameraPosition)) discard;
|
|
954
954
|
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
955
|
-
}`;function
|
|
955
|
+
}`;function lm(e){return new Nt.Program(e,{vertex:E1,fragment:R1,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uSeatRadius:{value:St},uSeatScale:{value:1},uMinPixels:{value:an},uPixelToWorld:{value:.002},uChairFull:{value:Wn},uChairNone:{value:sn},uFocusFloor:{value:-1}}})}function um(e){return new Nt.Program(e,{vertex:C1,fragment:_1,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uChairFull:{value:Wn},uChairNone:{value:sn},uBackRake:{value:Hn},uBackBase:{value:Rt},uFocusFloor:{value:-1}}})}function mm(e){return new Nt.Program(e,{vertex:T1,fragment:L1,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uFocusFloor:{value:-1},uRoomCentre:{value:new Float32Array([0,0])}}})}function fm(e,t=.78,n=[.63,.66,.65]){return new Nt.Program(e,{vertex:x1,fragment:M1,cullFace:!1,depthTest:!0,depthWrite:!0,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uFocusFloor:{value:-1},uStructureDetail:{value:0},uDeckColor:{value:new Float32Array(n)},uSectionFilter:{value:0},uRoughness:{value:t},uRoomCentre:{value:new Float32Array([0,0])}}})}function dm(e){return new Nt.Program(e,{vertex:v1,fragment:S1,transparent:!0,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uSeatRadius:{value:St},uSeatScale:{value:1},uMinPixels:{value:an},uPixelToWorld:{value:.002},uSeatFade:{value:0},uSeatDetail:{value:0},uFocusFloor:{value:-1},uFocusSection:{value:-1},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:Wn},uChairNone:{value:sn}}})}function hm(e,t=.78){return new Nt.Program(e,{vertex:w1,fragment:P1,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:Wn},uChairNone:{value:sn},uBackRake:{value:Hn},uBackBase:{value:Rt},uFocusFloor:{value:-1},uFocusSection:{value:-1},uRoughness:{value:t}}})}function pm(e,t,n,o){return new Nt.Program(e,{vertex:A1,fragment:I1,depthTest:!1,depthWrite:!1,cullFace:!1,uniforms:{uTop:{value:new Float32Array(t)},uBottom:{value:new Float32Array(n)},uSky:{value:o?1:0},uZenith:{value:new Float32Array(o?.zenith??[0,0,0])},uHorizon:{value:new Float32Array(o?.horizon??[0,0,0])},uInvViewProj:{value:new Float32Array(16)}}})}var nt=require("ogl");function bm(e,t,n){let r=Math.max(3,n.radius*1.04),[i,a,s]=n.center,c=new nt.Camera(e,{left:-r,right:r,bottom:-r,top:r,near:.1,far:r*6});c.position.set(i-r*1.44,a+r*2.34,s+r*1.2),c.lookAt([i,a,s]);let l=new nt.RenderTarget(e,{width:1024,height:1024,depthTexture:!0,minFilter:e.NEAREST,magFilter:e.NEAREST}),u=new nt.Program(e,{cullFace:!1,vertex:`#version 300 es
|
|
956
956
|
in vec3 position;
|
|
957
957
|
in float materialIndex;
|
|
958
958
|
uniform mat4 modelViewMatrix;
|
|
@@ -965,7 +965,7 @@ void main() {
|
|
|
965
965
|
void main() {
|
|
966
966
|
if (abs(vMaterial - 6.0) < 0.5) discard;
|
|
967
967
|
fragColor = vec4(1.0);
|
|
968
|
-
}`}),m=new nt.Transform,f=new nt.Mesh(e,{geometry:t,program:u});f.frustumCulled=!1,f.setParent(m);let d=e.getParameter(e.COLOR_CLEAR_VALUE),h=e.isEnabled(e.DITHER);try{e.disable(e.DITHER),e.clearColor(1,1,1,1),e.renderer.render({scene:m,camera:c,target:l})}finally{h&&e.enable(e.DITHER),e.clearColor(d[0],d[1],d[2],d[3]),u.remove()}let p=new nt.Mat4().multiply(c.projectionMatrix,c.viewMatrix);return{texture:l.depthTexture,matrix:p,dispose(){for(let b of l.textures)e.deleteTexture(b.texture);e.deleteTexture(l.depthTexture.texture),e.deleteFramebuffer(l.buffer),l.depthBuffer&&e.deleteRenderbuffer(l.depthBuffer)}}}var
|
|
968
|
+
}`}),m=new nt.Transform,f=new nt.Mesh(e,{geometry:t,program:u});f.frustumCulled=!1,f.setParent(m);let d=e.getParameter(e.COLOR_CLEAR_VALUE),h=e.isEnabled(e.DITHER);try{e.disable(e.DITHER),e.clearColor(1,1,1,1),e.renderer.render({scene:m,camera:c,target:l})}finally{h&&e.enable(e.DITHER),e.clearColor(d[0],d[1],d[2],d[3]),u.remove()}let p=new nt.Mat4().multiply(c.projectionMatrix,c.viewMatrix);return{texture:l.depthTexture,matrix:p,dispose(){for(let b of l.textures)e.deleteTexture(b.texture);e.deleteTexture(l.depthTexture.texture),e.deleteFramebuffer(l.buffer),l.depthBuffer&&e.deleteRenderbuffer(l.depthBuffer)}}}var k1=.65,O1=new Set(["dimmed","sold"]),F1=new Set(["dimmed","sold","held"]);function ym(e,t,n){let o=new Set,r=!1,i=Be.indexOf("dimmed"),a=!1;for(let c=0;c<n.length;c+=1)if(n[c]===i){a=!0;break}let s=a?F1:O1;for(let c of e){let l=t.get(c.sectionId);if(!l||!l.length){o.add(c.sectionId);continue}let u=!1;for(let m of l){let f=Be[n[m]]??"available";if(!s.has(f)){u=!0;break}}u?o.add(c.sectionId):r=!0}return{lit:o,anyUnlit:r}}function gm(e,t,n,o,r,i){let a=[];for(let s of e){let c=r===null||r.has(s.sectionId);if(o.get(s.sectionId)===c)continue;o.set(s.sectionId,c);let l=(s.start+s.count)*3;for(let u=s.start*3;u<l;u++)t[u]=c?n[u]:n[u]+(i[u%3]-n[u])*k1;a.push(s)}return a}var xm=Be.indexOf("selected");function D1(e,t){return[0,1,2].map(n=>e[n]*.15+.75+t[n]*.1)}function Mm(e,t,n,o,r,i){for(let a=n;a<n+o;a++){let s=i&&t[a]===0,c=i&&t[a]===xm?D1([i[a*3],i[a*3+1],i[a*3+2]],r[xm]??r[0]):s?null:r[t[a]]??r[0];e[a*3]=c?c[0]:i[a*3],e[a*3+1]=c?c[1]:i[a*3+1],e[a*3+2]=c?c[2]:i[a*3+2]}}var N1=new Float32Array([-1,-1,3,-1,-1,3]);function vm(e,t){let n=new Ne.Transform,o=new Ne.Transform,r=new Ne.Geometry(e,{position:{size:2,data:N1}}),i=pm(e,t.theme.background.top,t.theme.background.bottom,t.outdoor?t.theme.sky:null),a=new Ne.Mesh(e,{geometry:r,program:i});a.frustumCulled=!1,a.setParent(o);let s=new Ne.Geometry(e,{position:{size:3,data:t.solids.position},normal:{size:3,data:t.solids.normal},color:{size:3,data:t.solids.color},floorIndex:{size:1,data:t.solids.floor},materialIndex:{size:1,data:t.solids.material}}),c=bm(e,s,t.renderBounds),l=fm(e,t.theme.materials.roughness,t.theme.structure.tierTop);l.uniforms.tVenueShadow={value:c.texture},l.uniforms.uShadowMatrix={value:c.matrix},t.room&&l.uniforms.uRoomCentre.value.set(t.room.centre);let u=new Ne.Mesh(e,{geometry:s,program:l});u.frustumCulled=!1,u.setParent(n);let m=dm(e),f=new Float32Array(t.seats.count*3),d=Be.map(K=>t.theme.seatStates[K]),h=t.seats.iCategory.slice();for(let K=0;K<t.seats.count;K++){if(t.seats.iPhysicalSeat[K]<.5)continue;let re=t.theme.materials.seat??Ao([h[K*3],h[K*3+1],h[K*3+2]]);h.set(re,K*3)}Mm(f,t.seats.iState,0,t.seats.count,d,h);let p=Ka(),b=new Uint8Array(t.seats.count),y=new Ne.Geometry(e,{position:{size:3,data:p.position},normal:{size:3,data:p.normal},uv:{size:2,data:p.uv},index:{size:1,data:p.index},surface:{size:1,data:p.surface},iYaw:{size:1,data:t.seats.iYaw,instanced:1},iChairWidth:{size:1,data:t.seats.iChairWidth,instanced:1},iGlyph:{size:1,data:t.seats.iGlyph,instanced:1},iOffset:{size:3,data:t.seats.iPosition,instanced:1},iColor:{size:3,data:f,instanced:1},iMaxRadius:{size:1,data:t.seats.iMaxRadius,instanced:1},iHasChair:{size:1,data:b,type:e.UNSIGNED_BYTE,usage:e.DYNAMIC_DRAW,instanced:1},iPhysicalSeat:{size:1,data:t.seats.iPhysicalSeat,instanced:1},iRing:{size:3,data:t.seats.iRing,instanced:1},iFloor:{size:1,data:t.seats.iFloor,instanced:1},iSection:{size:1,data:t.seats.iSection,instanced:1}}),M=new Ne.Mesh(e,{geometry:y,program:m});M.frustumCulled=!1,t.seats.count>0&&M.setParent(n);let v=y.attributes.iColor,A=t.solids.color.slice(),x=t.theme.structure.ground,g=new Map(t.sectionSolidRanges.map(K=>[K.sectionId,!0])),P=Wa(),S=hm(e,t.theme.materials.roughness),w=Co,E=new Float32Array(w*3),T=new Float32Array(w*3),F=new Float32Array(w),R=new Float32Array(w),I=new Float32Array(w),_=new Float32Array(w*3),k=new Float32Array(w),V=new Float32Array(w),O=new Float32Array(w),H=new Float32Array(w),U=new Float32Array(w),N=new Ne.Geometry(e,{position:{size:3,data:P.position},normal:{size:3,data:P.normal},part:{size:1,data:P.part},index:{data:P.index},iOffset:{size:3,data:E,instanced:1},iColor:{size:3,data:T,instanced:1},iRadius:{size:1,data:F,instanced:1},iYaw:{size:1,data:R,instanced:1},iGlyph:{size:1,data:I,instanced:1},iRing:{size:3,data:_,instanced:1},iFloor:{size:1,data:k,instanced:1},iSection:{size:1,data:V,instanced:1},iPhysicalSeat:{size:1,data:O,instanced:1},iSeed:{size:1,data:U,instanced:1},iPickIndex:{size:1,data:H,instanced:1}}),L=new Ne.Mesh(e,{geometry:N,program:S});L.frustumCulled=!1;let B=0,D=!1,G=!1,j=null,Z=null,$=null,ee=new Int32Array(0),Q=()=>{let K=t.seats;for(let re=0;re<B;re++){let ne=ee[re];U[re]=ws(K.iState[ne],ne),T[re*3]=f[ne*3],T[re*3+1]=f[ne*3+1],T[re*3+2]=f[ne*3+2]}N.attributes.iColor.needsUpdate=!0,N.attributes.iSeed.needsUpdate=!0},X={main:n,background:o,backgroundProgram:i,seatProgram:m,solidProgram:l,chairProgram:S,seatGeometry:y,chairGeometry:N,solidGeometry:s,drawCalls:3,setNearSeats(K,re){let ne=Math.min(re,w,K.length);if(rm(b,K,ne),y.attributes.iHasChair.needsUpdate=!0,ee=K,B=ne,ne===0){L.parent&&L.setParent(null),N.instancedCount=0,X.drawCalls=3+(D?1:0);return}let se=t.seats;for(let J=0;J<ne;J++){let ie=K[J];E[J*3]=se.iPosition[ie*3],E[J*3+1]=se.iPosition[ie*3+1],E[J*3+2]=se.iPosition[ie*3+2],F[J]=se.iChairWidth[ie],R[J]=se.iYaw[ie],I[J]=se.iGlyph[ie],_[J*3]=se.iRing[ie*3],_[J*3+1]=se.iRing[ie*3+1],_[J*3+2]=se.iRing[ie*3+2],k[J]=se.iFloor[ie],V[J]=se.iSection[ie],O[J]=se.iPhysicalSeat[ie],H[J]=ie+1}Q(),N.attributes.iOffset.needsUpdate=!0,N.attributes.iRadius.needsUpdate=!0,N.attributes.iYaw.needsUpdate=!0,N.attributes.iGlyph.needsUpdate=!0,N.attributes.iRing.needsUpdate=!0,N.attributes.iFloor.needsUpdate=!0,N.attributes.iSection.needsUpdate=!0,N.attributes.iPhysicalSeat.needsUpdate=!0,N.attributes.iSeed.needsUpdate=!0,N.attributes.iPickIndex.needsUpdate=!0,N.instancedCount=ne,L.parent||L.setParent(n),X.drawCalls=4+(D?1:0)},nearSeatCount(){return B},setSectionShellLit(K){l.uniforms.uSectionFilter.value=K===null?0:1;let re=gm(t.sectionSolidRanges,t.solids.color,A,g,K,x);if(!re.length)return;let ne=s.attributes.color,se=ne.buffer;if(!se){ne.needsUpdate=!0;return}e.bindBuffer(e.ARRAY_BUFFER,se);for(let J of re){let ie=t.solids.color.subarray(J.start*3,(J.start+J.count)*3);e.bufferSubData(e.ARRAY_BUFFER,J.start*3*Float32Array.BYTES_PER_ELEMENT,ie)}},uploadSeatStateRuns(K){if(!K.length)return;B&&Q();for(let ne of K)Mm(f,t.seats.iState,ne.start,ne.length,d,h);let re=v.buffer;if(!re){v.needsUpdate=!0;return}e.bindBuffer(e.ARRAY_BUFFER,re);for(let ne of K){let se=f.subarray(ne.start*3,(ne.start+ne.length)*3);e.bufferSubData(e.ARRAY_BUFFER,ne.start*3*Float32Array.BYTES_PER_ELEMENT,se)}},dispose(){G=!0,c.dispose(),r.remove(),i.remove(),s.remove(),l.remove(),y.remove(),m.remove(),N.remove(),S.remove(),j?.remove(),Z?.remove(),$?.texture&&e.deleteTexture($.texture)}},Y=t.productionElements.find(K=>K.contentImageUrl&&K.contentPlane);if(Y?.contentImageUrl&&Y.contentPlane?.length===4&&typeof Image<"u"){let K=new Image;K.crossOrigin="anonymous",K.onload=()=>{if(G)return;let re=Y.contentPlane;j=new Ne.Geometry(e,{position:{size:3,data:new Float32Array(re.flat())},uv:{size:2,data:new Float32Array([0,1,1,1,0,0,1,0])},floorIndex:{size:1,data:new Float32Array(4).fill(Y.floorIndex)},index:{data:new Uint16Array([0,1,2,2,1,3])}}),$=new Ne.Texture(e,{image:K,generateMipmaps:!0,wrapS:e.CLAMP_TO_EDGE,wrapT:e.CLAMP_TO_EDGE,flipY:!1}),Z=new Ne.Program(e,{vertex:`#version 300 es
|
|
969
969
|
precision highp float;
|
|
970
970
|
in vec3 position; in vec2 uv; in float floorIndex;
|
|
971
971
|
uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform float uFocusFloor;
|
|
@@ -973,4 +973,4 @@ void main() {
|
|
|
973
973
|
void main(){ vUv=uv; vDim=(uFocusFloor < -0.5 || abs(floorIndex-uFocusFloor)<0.5)?0.0:1.0; gl_Position=projectionMatrix*modelViewMatrix*vec4(position,1.0); }`,fragment:`#version 300 es
|
|
974
974
|
precision highp float;
|
|
975
975
|
in vec2 vUv; in float vDim; uniform sampler2D uImage; out vec4 fragColor;
|
|
976
|
-
void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:$},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let ne=new Ne.Mesh(e,{geometry:j,program:Z});ne.frustumCulled=!1,ne.setParent(n),X.screenProgram=Z,D=!0,X.drawCalls=3+(B?1:0)+1},K.src=Y.contentImageUrl}return X}var Mt=require("ogl");function N1(e,t,n){let o=e+(t<<8)+(n<<16);return o===0?-1:o-1}function vm(e,t,n,o,r,i){let a=-1,s=1/0;for(let c=0;c<n;c++)for(let l=0;l<t;l++){let u=(c*t+l)*4,m=N1(e[u],e[u+1],e[u+2]);if(m<0||m>=i)continue;let f=l-o,d=c-r,h=f*f+d*d;h<s&&(s=h,a=m)}return a}function Sm(e,t,n,o,r,i){let a=e-n.left,s=t-n.top,c=Math.round(a*o),l=Math.round((n.height-s)*o);return{x:Math.max(0,Math.min(r-1,c)),y:Math.max(0,Math.min(i-1,l))}}var B1=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],br=class{constructor(t,n,o,r,i){this.seatScene=new Mt.Transform;this.chairScene=new Mt.Transform;this.solidScene=new Mt.Transform;this.target=null;this.restoreClear=[0,0,0];this.renderer=t,this.gl=t.gl,this.maxIndex=i,this.seatProg=cm(this.gl),this.chairProg=lm(this.gl),this.depthProg=um(this.gl);let a=new Mt.Mesh(this.gl,{geometry:n,program:this.seatProg});a.frustumCulled=!1,a.setParent(this.seatScene);let s=new Mt.Mesh(this.gl,{geometry:o,program:this.chairProg});s.frustumCulled=!1,s.setParent(this.chairScene);let c=new Mt.Mesh(this.gl,{geometry:r,program:this.depthProg});c.frustumCulled=!1,c.setParent(this.solidScene)}setRoomCentre(t){this.depthProg.uniforms.uRoomCentre.value.set(t??[0,0])}setRestoreClear(t){this.restoreClear=[t[0],t[1],t[2]]}syncFromSeatProgram(t){for(let r of B1)this.seatProg.uniforms[r].value=t.uniforms[r].value;let n=t.uniforms.uFocusFloor.value;this.seatProg.uniforms.uFocusFloor.value=n,this.chairProg.uniforms.uFocusFloor.value=n,this.depthProg.uniforms.uFocusFloor.value=n;let o=t.uniforms.uSeeThrough?.value;if(o)for(let r of[this.seatProg,this.chairProg,this.depthProg])r.uniforms.uSeeThrough.value=o}ensureTarget(){let t=this.gl.drawingBufferWidth,n=this.gl.drawingBufferHeight;return this.target&&(this.target.width!==t||this.target.height!==n)&&this.destroyTarget(),this.target||(this.target=new Mt.RenderTarget(this.gl,{width:t,height:n,depth:!0})),this.target}destroyTarget(){if(!this.target)return;let t=this.gl;this.target.buffer&&t.deleteFramebuffer(this.target.buffer);for(let n of this.target.textures??[])n.texture&&t.deleteTexture(n.texture);this.target.depthBuffer&&t.deleteRenderbuffer(this.target.depthBuffer),this.target=null}pick(t,n,o,r){let i=this.gl,a=this.ensureTarget(),s=i.drawingBufferWidth,c=i.drawingBufferHeight,l=Math.max(0,n-r),u=Math.max(0,o-r),m=Math.max(1,Math.min(s,n+r+1)-l),f=Math.max(1,Math.min(c,o+r+1)-u);i.enable(i.SCISSOR_TEST),i.scissor(l,u,m,f);let[d,h,p]=this.restoreClear;i.clearColor(0,0,0,1),this.renderer.render({scene:this.solidScene,camera:t,target:a,clear:!0}),this.renderer.render({scene:this.seatScene,camera:t,target:a,clear:!1}),this.renderer.render({scene:this.chairScene,camera:t,target:a,clear:!1}),i.clearColor(d,h,p,1),i.disable(i.SCISSOR_TEST);let b=new Uint8Array(m*f*4);return this.renderer.bindFramebuffer(a),i.readPixels(l,u,m,f,i.RGBA,i.UNSIGNED_BYTE,b),this.renderer.bindFramebuffer(),vm(b,m,f,n-l,o-u,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function wm(e,t){let n=[];for(let o of t)e.has(o.seatId)?e.set(o.seatId,jn(o.state)):n.push(o);return n}function Pm(e,t,n){let o=new Set;for(let a of t)(e.has(a)||n(a)!==void 0)&&o.add(a);let r=new Map(e),i=[];for(let[a,s]of e)o.has(a)||(i.push({seatId:a,state:Be[s]??"available"}),r.delete(a));for(let a of o){if(r.has(a))continue;let s=n(a);s!==void 0&&(r.set(a,s),i.push({seatId:a,state:"selected"}))}return{updates:i,next:r}}var Bt=require("ogl");function V1(e,t){return[e[0]-t[0],e[1]-t[1],e[2]-t[2]]}function Am(e,t){return[e[0]+t[0],e[1]+t[1],e[2]+t[2]]}function G1(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Im(e){let t=Math.hypot(e[0],e[1],e[2]);return t>1e-6?[e[0]/t,e[1]/t,e[2]/t]:[0,0,0]}function sa(e){let t=Math.max(0,Math.min(1,e));return t*t*t*(t*(t*6-15)+10)}function ca(e,t){return Math.max(0,Math.min(1,e+t))}function Em(e,t){let n=e.length;if(n===0)return[0,0,0];if(n===1)return[...e[0]];let o=Math.max(0,Math.min(1,t)),r=n-1,i=Math.floor(o*r);i>=r&&(i=r-1);let a=o*r-i,s=e[Math.max(0,i-1)],c=e[i],l=e[i+1],u=e[Math.min(n-1,i+2)],m=a*a,f=m*a,d=[0,0,0];for(let h=0;h<3;h++)d[h]=.5*(2*c[h]+(-s[h]+l[h])*a+(2*s[h]-5*c[h]+4*l[h]-u[h])*m+(-s[h]+3*c[h]-3*l[h]+u[h])*f);return d}function la(e,t,n,o,r){let i=Im(V1(t,n));i[0]===0&&i[1]===0&&i[2]===0&&(i=[0,0,1]);let a=Am(Am(t,G1(i,2.5)),[0,1.5,0]),s=[t[0]-o[0],0,t[2]-o[2]],c=Im(s);c[0]===0&&c[2]===0&&(c=[i[0],0,i[2]]);let l=Math.max(1,r),u=[o[0]+c[0]*l*1.3,o[1]+l*.75,o[2]+c[2]*l*1.3];return{waypoints:[e,u,a],finalPos:a}}function ua(e,t,n=35,o=28){let r=sa(t),i=Em(e,r),a=sa(Math.max(0,Math.min(1,(t-.66)/.34)));return{pos:i,fov:n+(o-n)*a,eased:r}}function Tm(e,t,n){let o=e.position.clone(),r=new Bt.Quat().copy(e.quaternion);e.position.set(t[0],t[1],t[2]),e.lookAt(new Bt.Vec3(n[0],n[1],n[2]));let i=new Bt.Quat().copy(e.quaternion);return e.position.copy(o),e.quaternion.copy(r),i}var yr=class{constructor(t){this.active=!1;this.waypoints=[];this.startQuat=new Bt.Quat;this.endQuat=new Bt.Quat;this.outQuat=new Bt.Quat;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=t}start(t,n,o,r=2500,i=28){return this.settle(),this.waypoints=t,this.startQuat.copy(n),this.endQuat.copy(o),this.duration=r,this.endFov=i,this.startTime=performance.now(),this.active=!0,new Promise(a=>{this.resolveFn=a})}update(t){if(!this.active)return!1;let n=Math.min(1,(t-this.startTime)/this.duration),{pos:o,fov:r,eased:i}=ua(this.waypoints,n,35,this.endFov);return this.camera.position.set(o[0],o[1],o[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,ca(i,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=r,this.camera.updateProjectionMatrix(),n>=1?(this.settle(),!1):!0}cancel(){this.settle()}settle(){this.active=!1;let t=this.resolveFn;this.resolveFn=null,t&&t()}};var Lm=jr,H1=.12,z1=1.6,km=.12;function Om(e,t,n){let o=e[t*3],r=e[t*3+1],i=e[t*3+2],a=n[0]-o,s=n[2]-i,c=Math.hypot(a,s);if(!(c>.001))return null;let l=a/c,u=s/c,m=1/0,f=null;for(let d=0;d*3<e.length;d++){if(d===t)continue;let h=e[d*3]-o,p=e[d*3+2]-i,b=h*l+p*u;b<.3||b>1.6||Math.abs(h*u-p*l)>.6||b<m&&(m=b,f=r-e[d*3+1])}return f}var j1=.25,U1=1.5;function Fm(e,t,n=0,o,r,i=!1){let a=[t.x*C,n+U1,t.y*C],s=r?[r[0],r[1],r[2]]:a,c=e[1],l=Number.isFinite(c)?c+(i?z1:Lm):Number.isFinite(o)?n+o:n+Lm,u=a[0]-e[0],m=a[2]-e[2],f=Math.hypot(u,m),d=f>.001?Math.min(H1,f*j1):0,h=f>.001?u/f:0,p=f>.001?m/f:0;return{eye:[e[0]+h*d,l,e[2]+p*d],focal:s}}var Vt=Math.PI/180,W1=45,ma=80,gr=70,X1=1,Y1=.99;function K1(e,t){if(!(e<X1))return ma;if(!(Number.isFinite(t)&&t>0))return gr;let n=2*Math.atan(t/(2*xr*Y1)/Math.max(.05,e))/Vt;return Math.max(gr,Math.min(ma,n))}var $1=.25,xr=1,Z1=.25,q1=12*Vt,Q1=.2,J1=1.5,Dm=.8,Nm=6,jm=1.9,ex=2/3,tx=.12,nx=.9,ox=1.2,rx=2,Um=.05,ix=6;function Wm(e,t,n=0){if(!e.length)return{min:[t[0]-6,n,t[2]-6],max:[t[0]+6,Math.max(n+Dm,t[1]),t[2]+6]};let o=1/0,r=-1/0,i=1/0,a=-1/0,s=n;for(let h of e)o=Math.min(o,h.cx-h.halfX),r=Math.max(r,h.cx+h.halfX),i=Math.min(i,h.cz-h.halfZ),a=Math.max(a,h.cz+h.halfZ),s=Math.max(s,h.y);let c=r-o,l=a-i,u=Math.max(c,Math.min(l,Nm))/2,m=Math.max(l,Math.min(c,Nm))/2,f=(o+r)/2,d=(i+a)/2;return{min:[f-u,n,d-m],max:[f+u,Math.max(n+Dm,s),d+m]}}function ax(e){return{min:[e.min[0],e.min[1],e.min[2]],max:[e.max[0],e.max[1]+jm,e.max[2]]}}function fa(e){let t=e.max[1];return[(e.min[0]+e.max[0])/2,Math.max(e.min[1]+J1,t+Q1,t+jm*ex),(e.min[2]+e.max[2])/2]}function Xm(e,t){let n=e[0]-t[0],o=e[2]-t[2],r=Math.hypot(n,o);return r<.001?{x:0,z:1}:{x:n/r,z:o/r}}function Bm(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=Math.hypot(o,r,i)||1;o/=a,r/=a,i/=a;let s=-i,c=o,l=Math.hypot(s,c);if(l<1e-6)return 1/0;s/=l,c/=l;let u=1/0,m=-1/0;for(let f=0;f<8;f++){let d=(f&1?n.max[0]:n.min[0])-e[0],h=(f&2?n.max[1]:n.min[1])-e[1],p=(f&4?n.max[2]:n.min[2])-e[2],b=Math.max(Um,d*o+h*r+p*i),y=(d*s+p*c)/b;y<u&&(u=y),y>m&&(m=y)}return m-u}function Vm(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=Math.hypot(o,r,i)||1;o/=a,r/=a,i/=a;let s=-i,c=o,l=Math.hypot(s,c);if(l<1e-6)return 1/0;s/=l,c/=l;let u=-c*r,m=c*o-s*i,f=s*r,d=1/0,h=-1/0;for(let p=0;p<8;p++){let b=(p&1?n.max[0]:n.min[0])-e[0],y=(p&2?n.max[1]:n.min[1])-e[1],M=(p&4?n.max[2]:n.min[2])-e[2],v=Math.max(Um,b*o+y*r+M*i),A=(b*u+y*m+M*f)/v;A<d&&(d=A),A>h&&(h=A)}return h-d}function Mr(e,t){return Math.tan(e*Vt/2)*Math.max(.05,t)}function Gm(e,t,n){let o=K1(n,e),r=c=>Math.max(W1,Math.min(o,c)),i=c=>2*Math.atan(c)/Vt,a=Number.isFinite(e)&&e>0?r(i(e/(2*$1)/Math.max(.05,n))):o;if(!(Number.isFinite(t)&&t>0))return a;let s=Math.min(a,r(i(t/(2*tx))));return e/(2*Mr(s,n))>xr?a:s}function Ym(e,t,n,o={}){let r=fa(t),i=[e[0],e[1],e[2]],a=0,s=0,c=h=>{if(!(h>0))return;let p=Xm(i,r);i[0]+=p.x*h,i[2]+=p.z*h,s+=h},l=o.preserveEye?0:t.max[1]+Z1-i[1];l>0&&(i[1]+=l,a=l,c(l/Math.tan(q1)));let u=ax(t),m=Bm(i,r,t),f=Gm(m,Vm(i,r,u),n),d=m/(2*Mr(f,n));for(let h=0;!o.preserveEye&&h<ix&&d>xr;h++){let p=Math.max(1,Math.hypot(i[0]-r[0],i[2]-r[2])),b=Number.isFinite(d)?d/xr:2;c(Math.min(60,p*(Math.min(4,b)-1)+.5)),m=Bm(i,r,t),f=Gm(m,Vm(i,r,u),n),d=m/(2*Mr(f,n))}return{eye:i,focal:r,fov:f,raisedM:a,pulledBackM:s,stageFrameWidth:d}}function sx(e,t,n){let o=Math.tan(t*Vt/2),r=Mr(t,n);return Math.max(1,e/Math.max(.05,Math.min(o,r)))}var cx=.7,Hm=.5,lx=.8;function zm(e,t,n){let o=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],r=[n[0]-e[0],n[1]-e[1],n[2]-e[2]],i=o[0]*r[0]+o[1]*r[1]+o[2]*r[2],a=Math.hypot(o[0],o[1],o[2])*Math.hypot(r[0],r[1],r[2])||1;return Math.acos(Math.max(-1,Math.min(1,i/a)))/Vt}function ux(e,t,n){let o=l=>{let u=Math.hypot(l[0],l[1],l[2])||1;return[l[0]/u,l[1]/u,l[2]/u]},r=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],i=Math.hypot(r[0],r[1],r[2]),a=o(r),s=o([n[0]-e[0],n[1]-e[1],n[2]-e[2]]),c=o([0,1,2].map(l=>a[l]*(1-Hm)+s[l]*Hm));return[e[0]+c[0]*i,e[1]+c[1]*i,e[2]+c[2]*i]}function Km(e,t){let{aspect:n,venue:o}=t,r=e.focal,i=Xm(e.eye,r),a=p=>(p[0]-r[0])*i.x+(p[2]-r[2])*i.z,s=[{name:"seat",eye:e.eye,focal:r,fov:e.fov}],c=rx*(t.rowDepthM??nx),l=[e.eye[0]+i.x*c,e.eye[1]+ox,e.eye[2]+i.z*c],u=[e.eye[0],e.eye[1]-cx,e.eye[2]],m=ux(l,r,u);s.push({name:"row",eye:l,focal:m,fov:Math.min(ma,Math.max(e.fov,2*Math.max(zm(l,m,u),zm(l,m,r))/lx))});let f=(p,b,y,M)=>{let v=sx(y,e.fov,n)*1.08,A=v*Math.sin(M*Vt),x=Number.isFinite(t.seatingTopY)?t.seatingTopY+2:-1/0,g=Math.max(A,x-b[1]),P=v*Math.cos(M*Vt);return{name:p,eye:[b[0]+i.x*P,b[1]+g,b[2]+i.z*P],focal:b,fov:e.fov}};t.section&&t.section.radius>0&&s.push(f("section",t.section.center,t.section.radius,35)),s.push(f("venue",o.center,Math.max(1,o.radius),40));let d=[],h=-1/0;for(let p of s){let b=a(p.eye);d.length&&b<=h+.5||(d.push(p),h=b)}return d}var Qm=require("ogl"),go=Math.PI/180,da=320,$m=70*go,mx=32*go,fx=24*go,Zm=.0026,dx=.22,hx=.006,px=180,bx=900,yx=1100,gx=4,Xe=(e,t,n)=>Math.max(t,Math.min(n,e)),qm=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;function Jm(e){let{canvas:t,camera:n}=e,o=[],r=!1,i=0,a=0,s=0,c=0,l=0,u=0,m=da,f=null,d=()=>{f&&(clearTimeout(f),f=null)},h=!1,p=[0,0],b=0,y=!1,M=null,v=null,A=new Map,x=!1,g=0,P=0,S=0,w=0,E=()=>r&&o.length?o[Xe(Math.round(i),0,o.length-1)].name:null,T=()=>{let L=E();L!==M&&(M=L,e.onStopChange?.(L))},F=()=>{if(!r||!o.length)return;let L=o[Xe(Math.floor(i),0,o.length-1)],B=o[Xe(Math.ceil(i),0,o.length-1)],D=Xe(i-Math.floor(i),0,1),G=(J,ie)=>J+(ie-J)*D,j=[G(L.eye[0],B.eye[0]),G(L.eye[1],B.eye[1]),G(L.eye[2],B.eye[2])],Z=[G(L.focal[0],B.focal[0]),G(L.focal[1],B.focal[1]),G(L.focal[2],B.focal[2])],$=Z[0]-j[0],ee=Z[1]-j[1],Q=Z[2]-j[2],X=Math.hypot($,ee,Q)||1,Y=Math.atan2($,Q),K=Math.asin(Xe(ee/X,-1,1)),re=Y+a,ne=Xe(K+s,-80*go,80*go),se=Math.cos(ne)*X;$=Math.sin(re)*se,ee=Math.sin(ne)*X,Q=Math.cos(re)*se,n.position.set(j[0],j[1],j[2]),n.fov=G(L.fov,B.fov),n.updateProjectionMatrix(),n.lookAt(new Qm.Vec3(j[0]+$,j[1]+ee,j[2]+Q)),e.onApplied?.()},R=()=>{if(!r||!o.length)return;let L=Xe(Math.round(i),0,o.length-1);if(e.reducedMotion()){h=!1,i=L,F(),T(),e.requestRender();return}if(Math.abs(L-i)<.001){h=!1,T();return}c=i,l=L,u=performance.now(),m=da,h=!0,e.requestRender()},I=L=>{!r||o.length<2||(d(),h=!1,i=Xe(i+L,0,o.length-1),F(),T(),e.requestRender())},_=(L,B)=>{r&&(d(),h=!1,y=!1,a=Xe(a-L*Zm,-$m,$m),s=Xe(s-B*Zm,-fx,mx),F(),e.requestRender())},k=L=>{r&&(A.set(L.pointerId,{x:L.clientX,y:L.clientY}),A.size===1?(x=!0,w=0,g=L.clientX,P=L.clientY):A.size===2&&(x=!1,S=V()))},V=()=>{let L=[...A.values()];return L.length<2?0:Math.hypot(L[0].x-L[1].x,L[0].y-L[1].y)},O=L=>{if(!r||!A.has(L.pointerId))return;if(A.set(L.pointerId,{x:L.clientX,y:L.clientY}),A.size>=2){let G=V();S>0&&I((S-G)*hx),S=G;return}if(!x)return;let B=L.clientX-g,D=L.clientY-P;g=L.clientX,P=L.clientY,w+=Math.abs(B)+Math.abs(D),!(w<=gx)&&_(B,D)},H=L=>{A.delete(L.pointerId)&&(A.size<2&&(S=0),A.size===0&&(x=!1,R()))},U=L=>{if(!r)return;L.preventDefault();let B=L.deltaMode===1?16:L.deltaMode===2?100:1,D=Xe(L.deltaY*B/100,-2,2);I(D*dx),v&&clearTimeout(v),v=setTimeout(()=>{v=null,R()},px)},N=()=>{d(),r&&(r=!1,h=!1,y=!1,o=[],A.clear(),x=!1,v&&(clearTimeout(v),v=null),M!==null&&(M=null,e.onStopChange?.(null)))};return t.addEventListener("pointerdown",k),t.addEventListener("pointermove",O),t.addEventListener("pointerup",H),t.addEventListener("pointercancel",H),t.addEventListener("wheel",U,{passive:!1}),{get active(){return r},enter(L,B=0){if(L.length<2){N();return}d(),o=L,r=!0,i=e.reducedMotion()?0:Xe(B,0,L.length-1),i>0&&(f=setTimeout(()=>{f=null,r&&(c=i,l=0,u=performance.now(),m=yx,h=!0,e.requestRender())},bx)),a=0,s=0,h=!1,y=!1,M=null,F(),T(),e.requestRender()},exit:N,recentre(){return r?Math.abs(a)<1e-4&&Math.abs(s)<1e-4?!0:e.reducedMotion()?(y=!1,a=0,s=0,F(),e.requestRender(),!0):(p=[a,s],b=performance.now(),y=!0,e.requestRender(),!0):!1},update(L){if(!r)return!1;let B=!1;if(y){let D=Xe((L-b)/da,0,1),G=1-qm(D);a=p[0]*G,s=p[1]*G,D>=1?(y=!1,a=0,s=0):B=!0}if(h){let D=Xe((L-u)/m,0,1);i=c+(l-c)*qm(D),D>=1?(h=!1,i=l,T()):B=!0}return F(),B},currentStop:E,dispose(){N(),t.removeEventListener("pointerdown",k),t.removeEventListener("pointermove",O),t.removeEventListener("pointerup",H),t.removeEventListener("pointercancel",H),t.removeEventListener("wheel",U)}}}function ef(e){return e.flying?"cinematic":e.panoramaMounted?"panorama":e.seatViewActive?"seatView":"orbit"}var ya=null;function hf(){return ya??=Promise.resolve().then(()=>(df(),ff)).catch(e=>{throw ya=null,e}),ya}var pf=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),Er=class{constructor(t){this.orbitLatched=!1;this.panoramaOpenedAt=0;this.cb=t}emit(t,n){if(this.cb)try{this.cb(t,n)}catch{}}opened(t,n,o,r){this.emit("3d_opened",{seats:t,hasHeights:n,...o===void 0?{}:{buildMs:Math.round(o)},...r===void 0?{}:{prepSource:r}})}orbitEngaged(){this.orbitLatched||(this.orbitLatched=!0,this.emit("3d_orbit_engaged"))}seatPicked(t,n){this.emit("3d_seat_picked",{seatId:t,sectionId:n})}cinematicPlayed(t){this.emit("3d_cinematic_played",{durationMs:t,reducedMotion:!1})}cinematicSkipped(){this.emit("3d_cinematic_skipped",{reducedMotion:!0})}cinematicCancelled(){this.emit("3d_cinematic_cancelled")}panoramaOpened(){this.panoramaOpenedAt=pf(),this.emit("3d_panorama_opened")}panoramaClosed(){let t=this.panoramaOpenedAt?Math.round(pf()-this.panoramaOpenedAt):0;this.panoramaOpenedAt=0,this.emit("3d_panorama_closed",{viewMs:t})}panoramaFailed(t,n){this.emit("3d_panorama_failed",{seatId:t,phase:n})}panoramaFallback(t){this.emit("3d_panorama_fallback",{seatId:t})}contextLost(){this.emit("3d_context_lost")}contextRestored(){this.emit("3d_context_restored")}};function bf(e){let t=e.style.position;return getComputedStyle(e).position!=="static"?()=>{}:(e.style.position="relative",()=>{e.style.position==="relative"&&(e.style.position=t)})}function yf(e){let{container:t,model:n,opts:o,expandedSeatById:r,seatIdsByRow:i,isNarrow:a}=e,s=null,c=()=>{if(!s)return;let m=a();Object.assign(s.style,m?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},l=()=>{s?.remove(),s=null};return{show:(m,f,d=!1)=>{if(l(),e.isDisposed())return null;let h=document.createElement("div");h.setAttribute("role","group"),Object.assign(h.style,{position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",zIndex:"4"});let p=o.chrome?.caption!==!1,b=o.chrome?.seatStepper!==!1;if(!p&&!b)return null;let y=r.get(m),M=y?.sectionId?n.sections.find(E=>E.id===y.sectionId):void 0,v=y?.label??m;h.setAttribute("aria-label",`Explore views near ${M?.label?`${M.label}, `:""}seat ${v}`);let A=document.createElement("span");A.textContent=o.seatViewCaption?.(m)??["Live 3D seat view",M?.label,v].filter(Boolean).join(" \xB7 "),Object.assign(A.style,{maxWidth:"min(70vw, 560px)",padding:"5px 10px",borderRadius:"999px",overflow:"hidden",color:"#d9e3f5",background:"rgba(12,18,32,0.72)",font:"600 11px/1.2 inherit",textOverflow:"ellipsis",whiteSpace:"nowrap",backdropFilter:"blur(6px)"}),p&&h.appendChild(A);let x=document.createElement("div");Object.assign(x.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),h.appendChild(x);let g=y?.rowId?i.get(y.rowId):void 0,P=g?.indexOf(m)??-1,S=P>=0?[g?.[P-1],g?.[P+1]]:[void 0,void 0],w=(E,T,F,R=!1)=>{let I=document.createElement("button");I.type="button",I.textContent=E,I.setAttribute("aria-label",T),Object.assign(I.style,{minHeight:"44px",padding:R?"10px 16px":"10px",borderRadius:"999px",background:"rgba(12,18,32,0.78)",color:"#eef1f8",border:"1px solid rgba(150,165,205,0.4)",backdropFilter:"blur(6px)",font:"600 13px/1 inherit",cursor:"pointer",whiteSpace:"nowrap"}),R||(I.style.minWidth="44px"),R&&(I.dataset.panoramaTrigger=""),I.addEventListener("click",F),x.appendChild(I)};if(b&&S[0]){let E=r.get(S[0])?.label??S[0];w("\u2039",`View previous seat ${E}`,()=>{e.flyToSeat(S[0])})}if(b&&o.getSeatView){let E=o.seatViewActionLabel?.(m)??"Open 360\xB0 panorama";w(d?`\u21BB Retry ${E}`:`\u25C9 ${E}`,`${d?"Retry":E} from seat ${v}`,()=>{if(e.isDisposed()||f!==e.flightGen()){l();return}l(),e.openPanorama(m,400,f)},!0)}if(b&&S[1]){let E=r.get(S[1])?.label??S[1];w("\u203A",`View next seat ${E}`,()=>{e.flyToSeat(S[1])})}return!x.childElementCount&&!p?null:(t.appendChild(h),s=h,c(),h)},remove:l,layout:c}}var kx={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function gf(e){let{container:t,orbit:n,isNarrow:o}=e,r={...kx,...e.labels??{}},i=(x,g)=>{x.setAttribute("aria-label",g),x.title=g},a=document.createElement("div"),s=!1;a.className="sl-3d-navigation-controls",Object.assign(a.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let c=document.createElement("div");c.setAttribute("role","group"),c.setAttribute("aria-label","3D drag mode"),Object.assign(c.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let l=document.createElement("div");l.setAttribute("role","group"),l.setAttribute("aria-label","3D view controls"),Object.assign(l.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let u=document.createElement("button");u.type="button",u.textContent="\u21BB",i(u,r.rotate);let m=document.createElement("button");m.type="button",m.textContent="\u2725",i(m,r.move);let f=document.createElement("button");f.type="button",f.textContent="\u2212",i(f,r.zoomOut);let d=document.createElement("button");d.type="button",d.textContent="+",i(d,r.zoomIn);for(let x of[u,m,f,d])x.className="sl-3d-icon-control",Object.assign(x.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",border:"1px solid rgba(150,165,205,0.35)",borderRadius:"999px",color:"#c9d4ea",background:"rgba(12,18,32,0.82)",font:"600 17px/1 inherit",backdropFilter:"blur(6px)",cursor:"pointer",whiteSpace:"nowrap"});c.append(u,m),l.append(d,f);let h=null,p=()=>{let x=n.dragAction();if(x===h)return;h=x;let g=x==="orbit";u.setAttribute("aria-pressed",String(g)),m.setAttribute("aria-pressed",String(!g)),u.style.background=g?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",m.style.background=g?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",a.title=g?`${r.rotate} \xB7 ${r.move} with Shift`:`${r.move} \xB7 ${r.rotate} with Shift`},b=x=>{n.setPrimaryDragMode(x),p()};u.addEventListener("click",()=>b("orbit")),m.addEventListener("click",()=>b("pan"));let y=()=>{let{atMin:x,atMax:g}=n.dollyLimitState();d.disabled!==x&&(d.disabled=x),f.disabled!==g&&(f.disabled=g)};f.addEventListener("click",()=>{n.zoomBy(Un),y()}),d.addEventListener("click",()=>{n.zoomBy(rn),y()}),a.append(c,l),b("auto"),t.appendChild(a);let M=e.enabled!==!1,v=()=>{let x=o();a.style.display=s||!M?"none":"flex",a.style.right=x?"12px":"14px",a.style.bottom=x?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",c.style.display=x?"none":"flex",d.style.display=x?"none":"",f.style.display=x?"none":""};return v(),{element:a,utilityControls:l,setNavigationMode:b,syncNavigationMode:p,syncZoomLimits:y,setSeatViewLocked:x=>{s=x,n.setInteractionEnabled(!x),v()},seatViewLocked:()=>s,layout:v}}var Ox=.5,xf=12,Mf=20,Fx=28;function Dx(e,t,n){return!(e>0)||!(n>0)?0:Ox*n/(2*e*Math.tan(t*Math.PI/360))}function vf(e){let{glctx:t,orbit:n,model:o,seats:r,opts:i,cinematic:a,analytics:s,seatIdByIndex:c,sectionIdBySeatId:l,tapSlop:u,tapMs:m,cancelFlight:f,focusSectionCamera:d,setSelection:h,ensureSeatView:p}=e,b=0,y=0,M=0,v=-1,A=!1,x=!1,g=R=>{e.seatViewLocked()||v===-1&&(v=R.pointerId,b=R.clientX,y=R.clientY,M=performance.now(),A=!1,x=a.active,a.active&&(s.cinematicCancelled(),f(),i.onViewTargetChange?.(null)))},P=R=>{R.pointerId===v&&Math.hypot(R.clientX-b,R.clientY-y)>u&&(A=!0)},S=(R,I,_,k,V)=>{let O=t.canvas.getBoundingClientRect(),H=t.canvas.clientWidth||O.width||1,U=t.canvas.clientHeight||O.height||1,N=R-O.left,L=I-O.top,B=k*k,D=-1,G=B,j=1/0;for(let Z of r){if(_&&Z.sectionId!==_)continue;let $=o.seats.idToIndex.get(Z.id);if($===void 0)continue;if(V){let re=Math.round(o.seats.iState[$]??0);if(re!==0&&re!==3)continue}let ee=$*3,Q=gt(n.camera.projectionViewMatrix,[o.seats.iPosition[ee],o.seats.iPosition[ee+1]+.55,o.seats.iPosition[ee+2]],H,U);if(!Q.visible)continue;let X=Q.x-N,Y=Q.y-L,K=X*X+Y*Y;(K<G||Math.abs(K-G)<1&&Q.depth<j)&&(D=$,G=K,j=Q.depth)}return D},w=(R,I)=>{let _=e.gpu(),k=e.pick();if(!_||!k)return-1;k.syncFromSeatProgram(_.seatProgram);let V=t.canvas.getBoundingClientRect(),O=t.renderer.dpr,{x:H,y:U}=Sm(R,I,V,O,t.gl.drawingBufferWidth,t.gl.drawingBufferHeight),N=Math.max(2,Math.round(8*O));return k.pick(n.camera,H,U,N)},E=()=>t.canvas.clientHeight||t.canvas.getBoundingClientRect().height,T=(R,I=xf)=>{let _=n.camera?.position;if(!_)return!1;let k=R*3,V=Math.hypot(_.x-o.seats.iPosition[k],_.y-o.seats.iPosition[k+1],_.z-o.seats.iPosition[k+2]);return Dx(V,n.fovY,E())>=I};return{onDown:g,onMove:P,onUp:R=>{if(R.pointerId!==v)return;let I=!A&&performance.now()-M<m;if(v=-1,x){x=!1;return}let _=e.gpu(),k=e.pick();if(!I||!_||!k)return;let V=w(R.clientX,R.clientY),O=R.pointerType==="touch"||R.pointerType==="pen",H=O?Mf:xf,U=V>=0&&T(V,H),N=!1;if(e.focusedSectionId()&&V>=0){let D=c[V],G=D?l.get(D):void 0;if(G&&G!==e.focusedSectionId()&&d(G,{keepCamera:U})){if(!U)return;N=!0}}if(e.focusedSectionId()&&V<0&&(V=S(R.clientX,R.clientY,e.focusedSectionId(),44,!1)),e.focusedSectionId()&&V<0){let D=S(R.clientX,R.clientY,null,72,!1),G=D>=0?c[D]:void 0,j=G?l.get(G):void 0;if(j&&j!==e.focusedSectionId()&&d(j))return}if(!e.focusedSectionId()){V<0&&(V=S(R.clientX,R.clientY,null,42,!1));let D=V>=0?c[V]:void 0,G=D?l.get(D):void 0;if(G&&d(G,{keepCamera:U})){if(!U)return;N=!0}}if(V<0||V>=c.length){e.selection().size&&(h([]),i.onViewTargetChange?.(null));return}let L=c[V];if(O&&e.focusedSectionId()&&!N&&!T(V,Mf)){e.focusSeatCamera(L,{seatPx:Fx,viewportHeightPx:E()});return}let B=Be[Math.round(o.seats.iState[V]??0)]??"available";if(B!=="available"&&B!=="selected"){i.onSeatInspect?.(L,B);return}if(e.selection().has(L)&&e.selection().size===1){h([]),i.onViewTargetChange?.(null),i.onSeatPick?.(L);return}h([L]),p(L),s.seatPicked(L,l.get(L)),i.onSeatPick?.(L)}}}var Rr=class{constructor(t,n){this.minX=0;this.minZ=0;this.cell=1;this.cols=1;this.rows=1;this.cellStart=null;this.cellItems=null;this.iPosition=t,this.count=n}ensureGrid(){if(this.cellStart||this.count===0)return;let t=this.iPosition,n=1/0,o=1/0,r=-1/0,i=-1/0;for(let d=0;d<this.count;d++){let h=t[d*3],p=t[d*3+2];h<n&&(n=h),h>r&&(r=h),p<o&&(o=p),p>i&&(i=p)}let a=Math.max(r-n,.001),s=Math.max(i-o,.001);this.cell=Math.max(Math.sqrt(a*s*4/this.count),.25),this.cols=Math.max(1,Math.ceil(a/this.cell)+1),this.rows=Math.max(1,Math.ceil(s/this.cell)+1),this.minX=n,this.minZ=o;let c=this.cols*this.rows,l=new Int32Array(c+1),u=d=>{let h=Math.min(this.cols-1,Math.max(0,Math.floor((t[d*3]-n)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((t[d*3+2]-o)/this.cell)))*this.cols+h};for(let d=0;d<this.count;d++)l[u(d)+1]++;for(let d=0;d<c;d++)l[d+1]+=l[d];let m=new Int32Array(this.count),f=l.slice(0,c);for(let d=0;d<this.count;d++)m[f[u(d)]++]=d;this.cellStart=l,this.cellItems=m}gather(t,n,o,r,i){this.ensureGrid();let a=this.cellStart,s=this.cellItems;if(!a||!s)return 0;let c=r.length,l=o*o,u=Math.floor((t-this.minX)/this.cell),m=Math.floor((n-this.minZ)/this.cell),f=Math.ceil(o/this.cell)+1,d=this.iPosition,h=0;for(let p=0;p<=f&&h<c;p++){let b=m-p,y=m+p,M=u-p,v=u+p;for(let A=b;A<=y&&h<c;A++){if(A<0||A>=this.rows)continue;let x=A===b||A===y;for(let g=M;g<=v&&h<c;g++){if(!x&&g!==M&&g!==v){g=v-1;continue}if(g<0||g>=this.cols)continue;let P=A*this.cols+g;for(let S=a[P],w=a[P+1];S<w&&h<c;S++){let E=s[S],T=d[E*3]-t,F=d[E*3+2]-n,R=i===void 0?0:d[E*3+1]-i;T*T+R*R+F*F<=l&&(r[h++]=E)}}}}return h}};var Cr=class{constructor(t){this.ctx=t;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(Ro);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.lastGatherY=1/0;this.nearIndex=new Rr(t.model.seats.iPosition,t.model.seats.count)}forceRegather(){this.lastGatherX=1/0}setDetailEnabled(t){let n=this.ctx.gpu();t||(this.detailVisible=!1),this.lastGatherX=1/0,this.lastGatherZ=1/0,!t&&n?.nearSeatCount()&&n.setNearSeats(this.nearBuf,0)}update(t){let{model:n}=this.ctx,o=this.ctx.gpu();if(!o)return;if(!t){o.nearSeatCount()&&o.setNearSeats(this.nearBuf,0);return}let r=this.ctx.orbit().camera.position;if(Math.hypot(r.x-this.lastGatherX,r.y-this.lastGatherY,r.z-this.lastGatherZ)<Qr)return;if(this.lastGatherX=r.x,this.lastGatherY=r.y,this.lastGatherZ=r.z,Math.hypot(r.x-n.bounds.center[0],r.y-n.bounds.center[1],r.z-n.bounds.center[2])-n.bounds.radius>qr){o.nearSeatCount()&&o.setNearSeats(this.nearBuf,0);return}let s=this.nearIndex.gather(r.x,r.z,qr,this.nearBuf,r.y);s===0&&o.nearSeatCount()===0||o.setNearSeats(this.nearBuf,s)}ease(t,n,o){let r=1-Math.exp(-t*9),i=1-Math.exp(-t*20);this.seatDetailMix+=(n-this.seatDetailMix)*(n>this.seatDetailMix?r:i),this.structureDetailMix+=(o-this.structureDetailMix)*(o>this.structureDetailMix?r:i),Math.abs(n-this.seatDetailMix)<.01&&(this.seatDetailMix=n),Math.abs(o-this.structureDetailMix)<.01&&(this.structureDetailMix=o)}};function Sf(e){let t=Math.max(5,e.radius),n=e.focalWorld[0]-e.center[0],o=e.focalWorld[2]-e.center[2],r=Math.hypot(n,o);if(r<t*.12)return{center:e.center,radius:t,polarDeg:48};let i=Math.min(r*.25,t*.2);return{center:[e.center[0]+n/r*i,e.center[1],e.center[2]+o/r*i],radius:t+i,polarDeg:50}}var _r=require("ogl");function wf(){let e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round");let n=document.createElementNS(e,"path");return n.setAttribute("d","M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 0 2 2v3M8 21H5a2 2 0 0 0-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3"),t.appendChild(n),t}function Pf(e){let{container:t,model:n,opts:o,orbit:r,cinematic:i,analytics:a,loop:s,labelOverlay:c,stageAzimuth:l,overviewFraming:u}=e,m=0,f=-1,d=(E,T,F=28)=>{r.camera.position.set(E[0],E[1],E[2]),r.camera.lookAt(new _r.Vec3(T[0],T[1],T[2])),r.camera.fov=F,r.camera.updateProjectionMatrix()},h=document.createElement("button");h.className="sl-3d-overview-control sl-3d-icon-control",h.type="button",h.replaceChildren(wf());let p=o.navLabels?.fitView??"Show whole venue";h.setAttribute("aria-label",p),h.title=p,Object.assign(h.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",borderRadius:"999px",background:"rgba(12,18,32,0.72)",color:"#c9d4ea",border:"1px solid rgba(150,165,205,0.35)",backdropFilter:"blur(6px)",font:"600 11px/1 inherit",cursor:"pointer",whiteSpace:"nowrap"});let b=()=>{h.firstElementChild||h.replaceChildren(wf())};b();let y=E=>{f=E;let T=e.gpu();T&&(T.seatProgram.uniforms.uFocusFloor.value=E,T.solidProgram.uniforms.uFocusFloor.value=E,T.chairProgram.uniforms.uFocusFloor.value=E),e.showSectionSeatLabels(null)},M=null,v=!1,A=()=>{if(M=null,v=!1,e.setSeeThrough?.(null),e.isDisposed())return;o.onViewTargetChange?.(null),o.onSectionFocusChange?.(null),e.panorama()&&(e.panorama().dispose(),e.setPanorama(null),a.panoramaClosed()),e.setPanoramaSphereVisible(!1),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),e.restorePanoramaLayer(),h.style.display="",c.setVisible(!0),e.setFrozen(!1);let E=f>=0?n.floors[f]:null;if(e.setNearFieldDetailEnabled(!!E),e.setSeatViewLocked(!1),x(),e.removeArriveChip(),e.setNavigationMode("auto"),E){let T=E.focalWorld[0]-E.center[0],F=E.focalWorld[2]-E.center[2],R=Math.hypot(T,F)>E.radius*.12?Math.atan2(T,F):l,I={center:E.center,radius:E.radius,box:E.box},_={polarDeg:58,margin:1.12};e.reducedMotion()?r.frame(I,!1,R,!1,_):r.frameSoft(I,R,!1,_)}else e.reducedMotion()?r.frame(n.bounds,!1,l,o.portraitOverviewCrop===!0,u):r.frameSoft(n.bounds,l,o.portraitOverviewCrop===!0,u);c.setOverviewDistance(r.targetDistance),e.showSectionSeatLabels(null),s.requestRender()},x=()=>{m++,e.setSeatStepping(!1),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),i.active&&(i.cancel(),r.resumeAfterFlight(n.focalWorld))},g=E=>{if(e.isDisposed()||!e.gpu())return Promise.resolve();let T=n.seats.idToIndex.get(E);if(T===void 0)return Promise.resolve();e.setNearFieldDetailEnabled(!0),o.onViewTargetChange?.(E),e.panorama()&&(e.panorama().dispose(),e.setPanorama(null),e.setPanoramaSphereVisible(!1),h.style.display="",e.restorePanoramaLayer()),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),e.setFrozen(!1);let F=e.inSeatView()&&o.arriveAtSeatEye===!0;e.setSeatStepping(F),e.setSeatViewLocked(!1);let R=++m;F?e.showArriveChip(E,R):e.removeArriveChip();let{eye:I,focal:_}=e.resolvedSeatViewPose(E,T),k=o.arriveAtSeatEye?e.seatViewArrival(E,T):null,V=k&&k.stops.length>1&&k.stops[1].name==="row"?k.stops[1]:null,O=k?k.focal:_,H=[r.camera.position.x,r.camera.position.y,r.camera.position.z],U=la(H,k?.eye??I,O,n.bounds.center,n.bounds.radius),N=V?V.eye:k?k.eye:o.arriveAtSeatEye?I:U.finalPos,L=k?k.fov:o.arriveAtSeatEye?t.clientWidth/Math.max(1,t.clientHeight)<.7?gr:65:28,B=[U.waypoints[0],U.waypoints[1],N];if(c.setVisible(!1),e.reducedMotion())return e.setSeatStepping(!1),d(N,O,L),s.requestRender(),a.cinematicSkipped(),e.isDisposed()||r.syncFromCamera(),e.setSeatViewLocked(o.arriveAtSeatEye===!0),k&&e.enterSeatView(k.stops),e.showArriveChip(E,R),Promise.resolve();let D=new _r.Quat().copy(r.camera.quaternion),G=Tm(r.camera,N,O);s.requestRender();let j=F?700:2500;return i.start(B,D,G,j,L).then(()=>{e.isDisposed()||R!==m||(e.setSeatStepping(!1),a.cinematicPlayed(j),r.resumeAfterFlight(O),e.setSeatViewLocked(o.arriveAtSeatEye===!0),k&&e.enterSeatView(k.stops,V?1:0),s.requestRender(),e.showArriveChip(E,R))})},P=(E,T)=>{let F=n.sections.find(R=>R.id===E);if(!F||F.seatCount===0)return!1;if(M=E,v=!1,e.setSeeThrough?.(null),e.setNearFieldDetailEnabled(!0),e.setSeatStepping(!1),e.setSeatViewLocked(!1),i.cancel(),e.removeArriveChip(),n.floors.length>1&&f!==F.floorIndex&&y(F.floorIndex),e.setNavigationMode("auto"),e.panorama()||c.setVisible(!0),e.showSectionSeatLabels(E),!T?.keepCamera){let R=Sf(F),I={polarDeg:R.polarDeg,margin:1.12};e.reducedMotion()?r.frame({center:R.center,radius:R.radius},!1,r.currentAzimuth,!1,I):r.glideTo({center:R.center,radius:R.radius},I)}return o.onSectionFocusChange?.(E),s.requestRender(),!0},S=(E,T)=>{if(e.isDisposed()||!e.gpu())return!1;let F=n.seats.idToIndex.get(E);if(F===void 0)return!1;let R=F*3,I=[n.seats.iPosition[R],n.seats.iPosition[R+1]+.55,n.seats.iPosition[R+2]],_=T?Nx(T,r.fovY,r.camera.aspect||1):Af;return v=!0,e.setSeeThrough?.(I),e.reducedMotion()?r.frame({center:I,radius:_},!1,void 0,!1,ga):r.frameSoft({center:I,radius:_},void 0,!1,ga),s.requestRender(),!0},w=()=>{if(e.isNarrow?.()&&v&&M&&P(M)){s.requestRender();return}A()};return h.addEventListener("click",w),{overviewChip:h,layoutOverviewChip:b,flightGen:()=>m,focusedFloor:()=>f,applyFloorFocus:y,placeCameraFinal:d,cancelFlight:x,focusOverview:A,flyToSeat:g,focusSectionCamera:P,focusSeatCamera:S}}var Af=4.5;function Nx(e,t,n){let o=Math.tan(t*Math.PI/360),r=o*Math.max(.001,n),a=Bx*e.viewportHeightPx/(2*Math.max(1,e.seatPx)*o)*Math.min(o,r)/ga.margin;return Math.max(Vx,Math.min(Af,a))}var Bx=.5,Vx=1.5,ga={polarDeg:48,margin:1.25};function Mo(e,t){let{doc:n,report:o}=lr(e),r=o.confident&&(o.sections.length>0||!!o.looseRowBlocks);if(!r&&!o.roles?.length)return null;if(!r){let c=new Map(o.roles.map(d=>[d.id,d.role])),l=d=>d.map(h=>h.type==="shape"&&c.has(h.id)?{...h,role:c.get(h.id)}:h),u=e.floors?.map(d=>({...d,objects:l(d.objects)})),m=new Float64Array(t.length).fill(Number.NaN),f=new Float64Array(t.length*2).fill(Number.NaN);return t.forEach((d,h)=>{d.eyeHeightM!==void 0&&(m[h]=d.eyeHeightM),d.focalPoint&&(f[h*2]=d.focalPoint.x,f[h*2+1]=d.focalPoint.y)}),{doc:{...e,objects:u?.[0]?.objects??l(e.objects),...u?{floors:u}:{}},report:o,eyeHeightM:m,focal:f}}let i=new Map(dn(n).map(c=>[c.id,c])),a=new Float64Array(t.length).fill(Number.NaN),s=new Float64Array(t.length*2).fill(Number.NaN);return t.forEach((c,l)=>{let u=i.get(c.id)??c;u.eyeHeightM!==void 0&&(a[l]=u.eyeHeightM),u.focalPoint&&(s[l*2]=u.focalPoint.x,s[l*2+1]=u.focalPoint.y)}),{doc:n,report:o,eyeHeightM:a,focal:s}}function xa(e,t){return e.map((n,o)=>{let r=t.eyeHeightM[o],i=t.focal[o*2],a=t.focal[o*2+1],s={...n};return Number.isNaN(r)?delete s.eyeHeightM:s.eyeHeightM=r,Number.isNaN(i)?delete s.focalPoint:s.focalPoint={x:i,y:a},s})}function If(e){let t=e.estimate===!1?null:Mo(e.doc,e.seats);return t?{input:{...e,doc:t.doc,seats:xa(e.seats,t)},estimate:t}:{input:e}}function Ma(e,t,n,o,r,i,a,s,c=.5){let l=-1,u=s*s,m=1/0;for(let f=0;f<t;f++){let d=f*3,h=gt(n,[e[d],e[d+1]+c,e[d+2]],o,r);if(!h.visible)continue;let p=h.x-i,b=h.y-a,y=p*p+b*b;(y<u-4||y<u+4&&h.depth<m)&&(l=f,u=Math.min(u,y),m=h.depth)}return l}var Hx={};function Ef(e){let t=performance.now(),{input:n,estimate:o}=If(e);return{model:En(n),buildMs:performance.now()-t,source:"main",...o?{estimate:o}:{}}}function Gx(e){let t=dn(e.doc);return{...Ef({...e,seats:t}),seats:t}}function Rf(e,t,n){let o=i=>({...t(),fallbackReason:i});if(typeof Worker>"u")return Promise.resolve(o("unavailable"));let r;try{r=new Worker(new URL("./scene/scene.worker.js",Hx.url),{type:"module"})}catch{return Promise.resolve(o("unavailable"))}return new Promise(i=>{let a=!1,s=u=>{a||(a=!0,clearTimeout(l),r.terminate(),i(u))},c=u=>s(o(u)),l=window.setTimeout(()=>c("timeout"),15e3);r.onerror=()=>c("worker_error"),r.onmessage=u=>{let m=n(u.data);m?s(m):c("bad_response")},r.postMessage(e)})}function Cf(e){return Rf(e,()=>Ef(e),({model:t,buildMs:n,estimate:o})=>({model:t,buildMs:n,source:"worker",...o?{estimate:o}:{}}))}function _f(e){return Rf(e,()=>Gx(e),({model:t,buildMs:n,seats:o,estimate:r})=>o?{model:t,buildMs:n,seats:o,source:"worker",...r?{estimate:r}:{}}:null)}var zx=40,jx=48,Ux=Math.PI/180,Wx=6,Xx=500,Yx=6;function Kx(e,t,n={}){let o=performance.now(),r=t.prepared?t.prepared.estimate:t.estimate===!1?null:Mo(t.doc,t.seats);r&&(t={...t,doc:r.doc,seats:xa(t.seats,r)});let i=t.prepared?.model??En(t),a=new Er(n.onAnalytics),s=new Array(i.seats.count);for(let[z,W]of i.seats.idToIndex)s[W]=z;let c=new Map(t.seats.map(z=>[z.id,z])),l=new Map;for(let z of t.seats){if(!z.rowId)continue;let W=l.get(z.rowId);W?W.push(z.id):l.set(z.rowId,[z.id])}let u=new Map,m=[0,0,0,0];function f(){if(b)for(let z of[b.seatProgram,b.solidProgram,b.chairProgram])z.uniforms.uSeeThrough.value=m}t.seats.forEach((z,W)=>{u.set(z.id,i.seatSectionIds?.[W]??z.sectionId)});let d=new Map;for(let[z,W]of i.seats.idToIndex){let q=u.get(z);if(!q)continue;let ce=d.get(q);ce?ce.push(W):d.set(q,[W])}let h=()=>{if(!b||!i.sectionSolidRanges.length)return;let{lit:z,anyUnlit:W}=bm(i.sectionSolidRanges,d,i.seats.iState);b.setSectionShellLit(W?z:null)},p=t.doc.floors?.some(W=>(W.baseHeightM??0)>0)?!0:(t.doc.floors?.flatMap(W=>W.objects)??t.doc.objects).some(W=>W.type==="section"&&((W.height??0)>0||(W.rake??0)>0)),b=null,y=null,M=null,v=!1,A=!1,x=!1,g=new Map,P=null,S=null,w=null,E=new Map,T=null,F=()=>{w===null&&(w=e.style.zIndex,e.style.zIndex="20")},R=()=>{w!==null&&(e.style.zIndex==="20"&&(e.style.zIndex=w),w=null)},I=!1,_=()=>I?Ue.focusedFloor():-1,k=()=>{b=Mm(B.gl,i),y?.dispose(),y=Xu(B.gl,[1,1,1],i.theme.seatStates.selected),Pa(!1),h(),te(),M=new br(B.renderer,b.seatGeometry,b.chairGeometry,b.solidGeometry,i.seats.count),B.setClearColor(i.theme.background.top),M.setRestoreClear(i.theme.background.top),M.setRoomCentre(i.room?.centre),b.seatProgram.uniforms.uSeatRadius.value=St*i.theme.seatScale,b.seatProgram.uniforms.uFocusFloor.value=_(),b.solidProgram.uniforms.uFocusFloor.value=_(),b.chairProgram.uniforms.uFocusFloor.value=_(),b.screenProgram&&(b.screenProgram.uniforms.uFocusFloor.value=_()),f(),O.forceRegather()},V=!1,O=new Cr({model:i,orbit:()=>D,gpu:()=>b}),H=!1,U=new Map,N=24,L=z=>O.setDetailEnabled(z),B=new Ao(e,{onContextLost:()=>{x||a.contextLost(),v=!0,Ae.stop(),b=null,M=null},onContextRestored:()=>{k(),v=!1,x||a.contextRestored(),Ae.requestRender()}}),D=new Io(B.gl,B.canvas,()=>Ae.requestRender(),()=>a.orbitEngaged());D.setAspect(B.aspect);let G=(t.doc.floors?.flatMap(z=>z.objects)??t.doc.objects).some(z=>z.type==="section"&&z.physical3dProvenance?.surfaceKind?.status==="inferred"),j=(()=>{if(Number.isFinite(n.overviewAzimuthDeg))return n.overviewAzimuthDeg*Math.PI/180;if(!(G&&i.stages.length===0))return Ba(i.focalWorld,i.seats.iPosition,i.bounds)})(),Z=(t.doc.floors?.flatMap(z=>z.objects)??t.doc.objects).some(z=>z.type==="shape"&&z.stageKind?.startsWith("pitch-")),$=i.floors.length>1?{polarDeg:48,margin:1.1}:{polarDeg:Z?36:48,margin:1.05},ee=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;D.frame(i.bounds,!ee&&n.skipInitialOverviewAnimation!==!0,j,n.portraitOverviewCrop===!0,$);let Q=new yr(D.camera),X=bf(e),Y=Va(e,i),K=new dr(e,{fontFamily:t.doc.theme?.fontFamily,ink:t.doc.theme?.textColor,backgroundRgb:i.theme.background.top}),re=i.labels,ne=()=>uu(re,i.floors.length,_());K.setLabels(ne()),K.setOverviewDistance(D.targetDistance);let se=()=>{let z=new Map,W=Be.indexOf("available");for(let q of re){if(!q.wheelchairSeats)continue;let ce=0;for(let me of q.wheelchairSeats)i.seats.iState[me]===W&&ce++;ce>0&&z.set(q.id,ce)}return K.setWheelchairFree(z)};se();let J=null,ie=()=>[...g.keys()].flatMap(z=>{let W=i.seats.idToIndex.get(z),q=W===void 0?void 0:t.seats[W];if(W===void 0||q?.id!==z)return[];let ce=W*3;return[{id:`seat:${z}`,kind:"seat",seatWidthM:i.seats.iChairWidth[W]*2,text:q.displayLabel||q.label,anchor:[i.seats.iPosition[ce],i.seats.iPosition[ce+1]+1.05,i.seats.iPosition[ce+2]],pinBase:Tr(ce)}]}),Ee=-1,te=()=>{b&&(Ee=J?i.sections.findIndex(z=>z.id===J):-1,b.seatProgram.uniforms.uFocusSection.value=Ee,b.chairProgram.uniforms.uFocusSection.value=Ee)},ve=z=>{if(J=z,te(),K.setForcedDense(!!z),!z){let oe=ie(),ke=new Set(oe.map(Ce=>Ce.id));K.setLabels([...ne().filter(Ce=>!ke.has(Ce.id)),...oe]);return}let W=t.seats.filter(oe=>u.get(oe.id)===z),q=new Set(W.map(oe=>oe.id)),ce=new Set(W.map(oe=>oe.rowId)),me=new Set(g.keys()),ye=new Set(W.filter(oe=>me.has(oe.id)).map(oe=>oe.id)),xe=ne().filter(oe=>oe.kind!=="row"&&oe.kind!=="seat"&&oe.kind!=="access"||oe.kind==="access"&&q.has(oe.id.slice(7))||(oe.kind==="row"?ce.has(oe.id.slice(4)):q.has(oe.id.slice(5))));if(i.seatCount<=6e3&&ye.size===0){K.setLabels(xe);return}let Re=W,He=new Set(Re.map(oe=>`seat:${oe.id}`)),Ke=Re.flatMap(oe=>{let ke=i.seats.idToIndex.get(oe.id);if(ke===void 0)return[];let Ce=ke*3;return[{id:`seat:${oe.id}`,kind:"seat",seatWidthM:i.seats.iChairWidth[ke]*2,rowId:oe.rowId,text:me.has(oe.id)?oe.displayLabel||oe.label:Qi(oe.displayLabel||oe.label),anchor:[i.seats.iPosition[Ce],i.seats.iPosition[Ce+1]+(me.has(oe.id)?1.05:.55),i.seats.iPosition[Ce+2]],...me.has(oe.id)?{pinBase:Tr(Ce)}:{}}]});K.setLabels([...xe.filter(oe=>!He.has(oe.id)),...Ke])};k();let Se=null,ot=null,mt=new Tf.Mat4,Ye=z=>{if(v||!b||A)return!1;let W=ef({flying:Q.active,panoramaMounted:P!==null,seatViewActive:Se?.active===!0}),q=W==="orbit"?Ee:-1;b.seatProgram.uniforms.uFocusSection.value=q,b.chairProgram.uniforms.uFocusSection.value=q;let ce=H?!1:W==="cinematic"?Q.update(performance.now()):W==="seatView"?Se.update(performance.now()):W==="orbit"?D.update():!1;ot?.syncZoomLimits(),ot?.syncNavigationMode();let me=_()>=0?i.floors[_()]:null,ye=me?.radius??i.bounds.radius,xe=fs(D.currentDistance,ye),Re=V?{center:[D.camera.position.x,D.camera.position.y,D.camera.position.z],radius:520}:i.clipBounds??i.renderBounds;D.updateClipping(Re);let He=me?.center??i.renderBounds.center,Ke=me?.radius??i.renderBounds.radius,oe=(De,Hr)=>Math.hypot(D.camera.position.x-De[0],D.camera.position.y-De[1],D.camera.position.z-De[2])<=Hr*(O.detailVisible?1.8:1.55),ke=oe(He,Ke);if(!ke&&J){let De=i.sections.find(Hr=>Hr.id===J);De&&(ke=oe(De.center,Math.max(12,De.radius*2)))}O.detailVisible=ke;let Ce=b.seatProgram.uniforms;Ce.uSeatScale.value=xe.scale,Ce.uSeatFade.value=xe.fade;let it=!!me&&ds(me.seatCount,B.canvas.clientWidth||1,B.canvas.clientHeight||1),Ut=hs(i.seats.count,ye,D.currentDistance,D.camera.fov,B.canvas.clientHeight||1),Dn=O.detailVisible||it||Ut?1:0,Nn=O.detailVisible||_()>=0||i.floors.length>1?1:0;O.ease(z,Dn,Nn),Ce.uSeatDetail.value=O.seatDetailMix;let wo=Dn===0&&O.seatDetailMix<.01;b.seatGeometry.setDrawRange(wo?Ur:0,wo?Xa:Ur),b.solidProgram.uniforms.uStructureDetail.value=O.structureDetailMix,Ce.uMinPixels.value=xe.minPixels,Ce.uPixelToWorld.value=2*Math.tan(D.camera.fov*Ux/2)/Math.max(1,B.pixelHeight),O.update(O.detailVisible),i.outdoor&&(mt.copy(D.camera.projectionViewMatrix).inverse(),b.backgroundProgram.uniforms.uInvViewProj.value.set(mt)),B.renderer.render({scene:b.background,clear:!0}),B.renderer.render({scene:b.main,camera:D.camera,clear:!1});let Bn=y?y.update(performance.now(),[D.camera.position.x,D.camera.position.y,D.camera.position.z],P!==null,W==="seatView"):!1;if(y&&B.renderer.render({scene:y.root,camera:D.camera,clear:!1}),Y){let De=D.camera.worldMatrix;Y.update(W==="seatView"?[D.camera.position.x,D.camera.position.y,D.camera.position.z]:null,[-De[8],-De[9],-De[10]])}K.update(D.camera.projectionViewMatrix,B.canvas.clientWidth||1,B.canvas.clientHeight||1,D.currentDistance,ye,[D.camera.position.x,D.camera.position.y,D.camera.position.z]);let tn=ce||Bn||O.seatDetailMix!==Dn||O.structureDetailMix!==Nn;return rt(!tn),tn},rt=as(e),Ae=new Eo(Ye),Ht=typeof ResizeObserver<"u"?new ResizeObserver(()=>Gr.resize()):null;Ht?.observe(e),D.setZoomPointResolver((z,W)=>{let q=B.canvas.getBoundingClientRect(),ce=B.canvas.clientWidth||q.width,me=B.canvas.clientHeight||q.height;if(!(ce>0)||!(me>0))return null;D.camera.updateMatrixWorld();let ye=Ma(i.seats.iPosition,i.seats.count,D.camera.projectionViewMatrix,ce,me,z-q.left,W-q.top,zx);if(ye<0)return null;let xe=ye*3;return[i.seats.iPosition[xe],i.seats.iPosition[xe+1]+.5,i.seats.iPosition[xe+2]]});function Tr(z){return[i.seats.iPosition[z],i.seats.iPosition[z+1]+.5,i.seats.iPosition[z+2]]}K.setSeatNumberRow(null);let ft=null,zt=0,Lr=null,va=()=>{zt=0;let z=null,W=null;if(ft&&!Se?.active&&!Q.active){let me=B.canvas.getBoundingClientRect(),ye=B.canvas.clientWidth||me.width,xe=B.canvas.clientHeight||me.height;if(ye>0&&xe>0){let Re=Ma(i.seats.iPosition,i.seats.count,D.camera.projectionViewMatrix,ye,xe,ft.x-me.left,ft.y-me.top,jx);z=Re>=0?t.seats[Re]?.rowId??null:null;let He=Re>=0?t.seats[Re]?.id??null:null;if(W=He,ft.mouse&&!ft.pressing&&!!J&&!!He&&u.get(He)===J){let oe=e.getBoundingClientRect();Lr=He,n.onSeatHover?.(He,{x:ft.x-oe.left,y:ft.y-oe.top})}else Sa()}}else Sa();let q=ft?.mouse?W:null,ce=K.setSeatNumberSeat(q);(K.setSeatNumberRow(z)||ce)&&Ae.requestRender()};function Sa(){Lr!==null&&(Lr=null,n.onSeatHover?.(null,null))}let vo=z=>{ft={x:z.clientX,y:z.clientY,mouse:z.pointerType==="mouse",pressing:z.type==="pointerdown"},zt||(zt=requestAnimationFrame(va))},wa=z=>{z.pointerType==="mouse"&&(ft=null,zt||(zt=requestAnimationFrame(va)))};B.canvas.addEventListener("pointermove",vo),B.canvas.addEventListener("pointerdown",vo),B.canvas.addEventListener("pointerleave",wa);function Pa(z){if(!y)return;let W=[];for(let q of g.keys()){let ce=i.seats.idToIndex.get(q);if(ce===void 0)continue;let me=ce*3,ye=Tr(me),xe=Math.atan2(i.focalWorld[0]-ye[0],i.focalWorld[2]-ye[2]);W.push({id:q,position:ye,facing:xe})}y.setSeats(W,performance.now(),z)}let Aa=z=>{let W=me=>{let ye=i.seats.idToIndex.get(me);return ye===void 0?void 0:i.seats.iState[ye]},{updates:q,next:ce}=Pm(g,z,W);if(g=ce,K.setSelectedSeatIds(g.keys()),Pa(!kn()),Ae.requestRender(),ve(J),q.length){let me=ii(i.seats,q);b&&b.uploadSeatStateRuns(me),h(),Ae.requestRender()}},kn=()=>T!==null?T:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Lf=8,Ia=z=>{if(!n.getSeatView)return null;let W=E.get(z);if(!W)for(W=Promise.resolve(n.getSeatView(z)),E.set(z,W),W.catch(()=>{E.get(z)===W&&E.delete(z)});E.size>Lf;){let q=E.keys().next().value;if(q===void 0)break;E.delete(q)}return W},Ea=Wm(i.stages,i.focalWorld,i.bounds.groundY??0),Ra=fa(Ea),kr=(z,W)=>{let q=c.get(z),ce=Math.max(0,Math.round(i.seats.iFloor[W]??0)),me=t.doc.floors?.[ce],ye=i.floors[ce],xe=me?.focalPoint??t.doc.focalPoint,Re=ye?{x:ye.focalWorld[0]/C,y:ye.focalWorld[2]/C}:xe,He=q?.focalPoint?{x:q.focalPoint.x+Re.x-xe.x,y:q.focalPoint.y+Re.y-xe.y}:Re,Ke=[i.seats.iPosition[W*3],i.seats.iPosition[W*3+1],i.seats.iPosition[W*3+2]],oe=Om(i.seats.iPosition,W,Ra),ke=oe!==null&&Math.abs(oe)<km;return Fm(Ke,He,me?.baseHeightM??0,q?.eyeHeightM,Ra,ke)},Or=()=>(e.clientWidth||B.canvas.clientWidth)<=520,Fr=null,Ca=null,kf=async(z,W,q)=>{if(!n.getSeatView||x||q!==Ue.flightGen())return;let ce;try{ce=await hf()}catch{if(a.panoramaFailed(z,"mount"),!x&&q===Ue.flightGen()){let me=Nr(z,q,!0);requestAnimationFrame(()=>me?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(x||q!==Ue.flightGen()||!Fr))return Ca??=ce.createOpenPanorama(Fr),Ca(z,W,q)},Dr=yf({container:e,model:i,opts:n,expandedSeatById:c,seatIdsByRow:l,isNarrow:Or,isDisposed:()=>x,flightGen:()=>Ue.flightGen(),flyToSeat:z=>Oa(z),openPanorama:(z,W,q)=>kf(z,W,q)}),Nr=Dr.show,Br=Dr.remove,Of=Dr.layout,jt=gf({container:e,orbit:D,isNarrow:Or,enabled:n.chrome?.controlDock!==!1,...n.navLabels?{labels:n.navLabels}:{}});ot=jt;let Ff=jt.element,On=jt.setNavigationMode,Df=jt.layout,Nf=jt.utilityControls,Fn=null,_a=!1,So=z=>{jt.setSeatViewLocked(z),z||Se?.exit()};Se=Jm({canvas:B.canvas,camera:D.camera,requestRender:()=>Ae.requestRender(),reducedMotion:kn,onStopChange:z=>{let W=z??(_a?"seat":null);Fn=W;try{n.onSeatViewStopChange?.(W)}catch{}},onApplied:()=>{x||D.syncFromCamera()}});let Ta=i.sections.reduce((z,W)=>W.seatCount>0&&W.box?Math.max(z,W.box.max[1]):z,-1/0),La=(z,W)=>{let{eye:q}=kr(z,W),ce=(e.clientWidth||B.canvas.clientWidth||1)/Math.max(1,e.clientHeight||B.canvas.clientHeight||1),me=Ym(q,Ea,ce,{preserveEye:!0});if(n.seatViewStops===!1)return{...me,stops:[]};let ye=u.get(z),xe=ye?i.sections.find(Re=>Re.id===ye):void 0;return{...me,stops:Km(me,{aspect:ce,seatingTopY:Number.isFinite(Ta)?Ta:i.bounds.box.max[1],section:xe&&xe.seatCount>0?{center:xe.center,radius:xe.radius}:null,venue:{center:i.bounds.center,radius:i.bounds.radius}})}},Ue=Pf({isNarrow:Or,setSeeThrough:z=>{m=z?[z[0],z[1],z[2],Yx]:[0,0,0,0],f(),Ae.requestRender()},container:e,model:i,opts:n,orbit:D,cinematic:Q,analytics:a,loop:Ae,labelOverlay:K,stageAzimuth:j,overviewFraming:$,gpu:()=>b,isDisposed:()=>x,panorama:()=>P,setPanorama:z=>{P=z},setPanoramaSphereVisible:z=>{V=z},panoramaLoadAbort:()=>S,setPanoramaLoadAbort:z=>{S=z},setFrozen:z=>{A=z},restorePanoramaLayer:R,reducedMotion:kn,resolvedSeatViewPose:kr,showSectionSeatLabels:ve,setNearFieldDetailEnabled:L,setSeatViewLocked:So,setNavigationMode:On,showArriveChip:Nr,removeArriveChip:Br,inSeatView:()=>Fn!==null,setSeatStepping:z=>{_a=z},seatViewArrival:(z,W)=>n.arriveAtSeatEye?La(z,W):null,enterSeatView:(z,W)=>Se?.enter(z,W)});I=!0;let Vr=Ue.overviewChip,Bf=Ue.layoutOverviewChip,Vf=Ue.applyFloorFocus,Gf=Ue.focusOverview,ka=Ue.cancelFlight,Oa=Ue.flyToSeat,Fa=Ue.focusSectionCamera;Nf.appendChild(Vr),Fr={container:e,model:i,opts:n,analytics:a,orbit:D,loop:Ae,seatsById:c,ensureSeatView:Ia,resolvedSeatViewPose:kr,gpu:()=>b,gl:B.gl,isContextLost:()=>v,isDisposed:()=>x,flightGen:()=>Ue.flightGen(),setPanorama:z=>{P=z},getLoadAbort:()=>S,setLoadAbort:z=>{S=z},setPanoramaSphereVisible:z=>{V=z,z&&Se?.exit()},setFrozen:z=>{A=z},raisePanoramaLayer:F,restorePanoramaLayer:R,getOverviewChip:()=>Vr,labelOverlay:K,reducedMotion:kn,removeArriveChip:Br,showArriveChip:Nr};let Et=vf({glctx:B,orbit:D,model:i,seats:t.seats,opts:n,cinematic:Q,analytics:a,seatIdByIndex:s,sectionIdBySeatId:u,tapSlop:Wx,tapMs:Xx,gpu:()=>b,pick:()=>M,seatViewLocked:()=>jt.seatViewLocked(),focusedSectionId:()=>J,selection:()=>g,cancelFlight:ka,focusSectionCamera:Fa,focusSeatCamera:Ue.focusSeatCamera,setSelection:Aa,ensureSeatView:Ia});B.canvas.addEventListener("pointerdown",Et.onDown),B.canvas.addEventListener("pointermove",Et.onMove),B.canvas.addEventListener("pointerup",Et.onUp),B.canvas.addEventListener("pointercancel",Et.onUp),Ae.requestRender();let Gr={setAvailability(z){let W=wm(g,z),q=ii(i.seats,W);q.length&&b&&b.uploadSeatStateRuns(q),h(),q.length&&se(),Ae.requestRender()},setSelection:Aa,setNavigationMode:On,zoomIn(){D.zoomBy(rn),Ae.requestRender()},zoomOut(){D.zoomBy(Un),Ae.requestRender()},flyToSeat:Oa,focusOverview:Gf,seatViewStop:()=>Fn,recentreSeatView:()=>Se?.recentre()??!1,resize(){let{width:z,height:W}=B.resize();D.setAspect(z/Math.max(1,W)),Of(),Df(),Bf(),Ae.requestRender()},stats(){return{...Ae.stats(),drawCalls:b?b.drawCalls:0,fallbackTriangles:b?b.seatGeometry.drawRange.count/3*i.seats.count:0,seatCount:i.seatCount}},captureImage(z=1280){if(v||!b||typeof document>"u")return null;Ye(0);let W=B.canvas,q=Math.min(1,z/Math.max(W.width,W.height,1)),ce=document.createElement("canvas");ce.width=Math.max(1,Math.round(W.width*q)),ce.height=Math.max(1,Math.round(W.height*q));let me=ce.getContext("2d");return me?(me.drawImage(W,0,0,ce.width,ce.height),ce.toDataURL("image/jpeg",.82)):null},captureSeatView(z,W=480){if(v||!b||A||typeof document>"u"||Q.active||P!==null||Se?.active)return null;let q=U.get(z);if(q)return q;let ce=i.seats.idToIndex.get(z);if(ce===void 0)return null;let{eye:me,focal:ye,fov:xe}=La(z,ce),Re=D.snapshot(),He=[O.seatDetailMix,O.structureDetailMix],Ke=null;try{H=!0,D.camera.position.set(me[0],me[1],me[2]),D.camera.perspective({fov:xe,aspect:D.camera.aspect}),D.camera.lookAt(ye),D.camera.updateMatrixWorld(),D.syncFromCamera(),O.seatDetailMix=1,O.structureDetailMix=1,O.forceRegather(),Ye(0);let oe=B.canvas,ke=Math.min(oe.width,Math.round(oe.height*16/9)),Ce=Math.round(ke*9/16),it=document.createElement("canvas");it.width=Math.max(1,Math.round(W)),it.height=Math.max(1,Math.round(W*9/16));let Ut=it.getContext("2d");Ut&&(Ut.drawImage(oe,(oe.width-ke)/2,(oe.height-Ce)/2,ke,Ce,0,0,it.width,it.height),Ke=it.toDataURL("image/jpeg",.8))}finally{H=!1,Re(),O.seatDetailMix=He[0],O.structureDetailMix=He[1],O.forceRegather(),Ye(0)}if(Ke)for(U.set(z,Ke);U.size>N;)U.delete(U.keys().next().value);return Ke},getQualityEvidence(){let z=Ae.stats(),W=B.canvas.clientWidth||1,q=B.canvas.clientHeight||1,ce=i.bounds.center,me=gt(D.camera.projectionViewMatrix,[ce[0],i.bounds.box.min[1],ce[2]],W,q),ye=gt(D.camera.projectionViewMatrix,[ce[0],i.bounds.box.max[1],ce[2]],W,q),xe=i.bounds.box,Re=[xe.min[0],xe.max[0]].flatMap(oe=>[xe.min[1],xe.max[1]].flatMap(ke=>[xe.min[2],xe.max[2]].map(Ce=>gt(D.camera.projectionViewMatrix,[oe,ke,Ce],W,q)))).filter(oe=>Number.isFinite(oe.x)&&Number.isFinite(oe.y)&&Number.isFinite(oe.depth)),He=Re.length?(()=>{let oe=Math.min(...Re.map(De=>De.x)),ke=Math.max(...Re.map(De=>De.x)),Ce=Math.min(...Re.map(De=>De.y)),it=Math.max(...Re.map(De=>De.y)),Ut=Math.max(0,oe),Dn=Math.min(W,ke),Nn=Math.max(0,Ce),wo=Math.min(q,it),Bn=Math.max(0,Dn-Ut),tn=Math.max(0,wo-Nn);return{box:{x:Ut,y:Nn,width:Bn,height:tn},horizontalFillRatio:Bn/W,verticalFillRatio:tn/q,visibleAreaRatio:Bn*tn/(W*q),clippedEdges:[...Ce<0?["top"]:[],...ke>W?["right"]:[],...it>q?["bottom"]:[],...oe<0?["left"]:[]]}})():void 0,Ke=String(B.gl.getParameter(B.gl.VERSION)??"");return{viewport:{width:W,height:q},context:{webgl2:/webgl\s*2/i.test(Ke),lost:v},frame:{rendered:z.rendered,idle:z.idle},camera:{position:[D.camera.position.x,D.camera.position.y,D.camera.position.z],distance:D.currentDistance,verticalFovDeg:D.fovY},scene:{seatCount:i.seatCount,floorCount:i.floors.length,zoneCount:i.zones.length,sectionCount:i.sections.length,authoredRelief:p,renderedVerticalSpanM:Math.max(0,i.bounds.box.max[1]-i.bounds.box.min[1]),projectedReliefPx:me.visible&&ye.visible?Math.abs(me.y-ye.y):0},labels:K.qualityEvidence(),framing:He,...Fn?{seatView:{fovDeg:D.camera.fov,stop:Fn}}:{}}},getQualityReport(){return hr(Gr.getQualityEvidence())},loseContextForTest(){B.simulateContextLossCycle()},floors(){return i.floors},focusFloor(z){if(z!==null&&!i.floors.some(q=>q.index===z))return!1;let W=z??-1;if(L(z!==null),So(!1),Vf(W),On("orbit"),z===null)Q.cancel(),kn()?D.frame(i.bounds,!1,j,n.portraitOverviewCrop===!0,$):D.frameSoft(i.bounds,j,n.portraitOverviewCrop===!0,$),K.setOverviewDistance(D.targetDistance);else{let q=i.floors[z];if(q.seatCount>0){Q.cancel();let ce=q.focalWorld[0]-q.center[0],me=q.focalWorld[2]-q.center[2],ye=Math.hypot(ce,me)>q.radius*.12?Math.atan2(ce,me):j;D.frame({center:q.center,radius:q.radius,box:q.box},!1,ye,!1,{polarDeg:58,margin:1.12}),K.setOverviewDistance(D.targetDistance)}}return Ae.requestRender(),!0},zones(){return i.zones},focusZone(z){let W=i.zones.find(ye=>ye.id===z);if(!W||W.seatCount===0)return!1;L(!1),So(!1),Q.cancel(),On("orbit"),ve(null),n.onSectionFocusChange?.(null);let q=W.focalWorld[0]-W.center[0],ce=W.focalWorld[2]-W.center[2],me=Math.hypot(q,ce)>W.radius*.12?Math.atan2(q,ce):void 0;return D.frame({center:W.center,radius:W.radius*1.25},!1,me),Ae.requestRender(),!0},sections(){return i.sections},focusSection(z){return Fa(z)},rows(z){return z?i.rows.filter(W=>W.sectionId===z):i.rows},seatsInRow(z){return t.seats.filter(W=>W.rowId===z).map(W=>({id:W.id,label:W.displayLabel||W.label}))},focusRow(z){let W=i.rows.find(q=>q.id===z);return!W||W.seatCount===0?!1:(L(!0),So(!1),Q.cancel(),On("pan"),W.sectionId&&(ve(W.sectionId),n.onSectionFocusChange?.(W.sectionId)),D.frame({center:W.center,radius:Math.max(2.5,W.radius*.65)}),Ae.requestRender(),!0)},setReducedMotionForTest(z){T=z},dispose(){x=!0,Y?.dispose(),rt(!1),Br(),Vr.remove(),Ff.remove(),ka(),Se?.dispose(),Ae.stop(),K.dispose(),Ht?.disconnect(),P&&(P.dispose(),P=null),R(),X(),B.canvas.removeEventListener("pointerdown",Et.onDown),B.canvas.removeEventListener("pointermove",Et.onMove),B.canvas.removeEventListener("pointerup",Et.onUp),B.canvas.removeEventListener("pointercancel",Et.onUp),B.canvas.removeEventListener("pointermove",vo),B.canvas.removeEventListener("pointerdown",vo),B.canvas.removeEventListener("pointerleave",wa),zt&&cancelAnimationFrame(zt),D.dispose(),M&&M.dispose(),b&&b.dispose(),b=null,y?.dispose(),y=null,M=null,B.dispose()}};return a.opened(i.seatCount,p,t.prepared?.buildMs??performance.now()-o,t.prepared?.source??"inline"),Gr}0&&(module.exports={VENUE3D_QUALITY_REPORT_VERSION,autoVenue3d,buildSceneModel,estimateVenue3D,inspectVenue3DQualityEvidence,mountVenue3D,prepareVenue3D,prepareVenue3DFromChart});
|
|
976
|
+
void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:$},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let ne=new Ne.Mesh(e,{geometry:j,program:Z});ne.frustumCulled=!1,ne.setParent(n),X.screenProgram=Z,D=!0,X.drawCalls=3+(B?1:0)+1},K.src=Y.contentImageUrl}return X}var Mt=require("ogl");function B1(e,t,n){let o=e+(t<<8)+(n<<16);return o===0?-1:o-1}function Sm(e,t,n,o,r,i){let a=-1,s=1/0;for(let c=0;c<n;c++)for(let l=0;l<t;l++){let u=(c*t+l)*4,m=B1(e[u],e[u+1],e[u+2]);if(m<0||m>=i)continue;let f=l-o,d=c-r,h=f*f+d*d;h<s&&(s=h,a=m)}return a}function wm(e,t,n,o,r,i){let a=e-n.left,s=t-n.top,c=Math.round(a*o),l=Math.round((n.height-s)*o);return{x:Math.max(0,Math.min(r-1,c)),y:Math.max(0,Math.min(i-1,l))}}var V1=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],yr=class{constructor(t,n,o,r,i){this.seatScene=new Mt.Transform;this.chairScene=new Mt.Transform;this.solidScene=new Mt.Transform;this.target=null;this.restoreClear=[0,0,0];this.renderer=t,this.gl=t.gl,this.maxIndex=i,this.seatProg=lm(this.gl),this.chairProg=um(this.gl),this.depthProg=mm(this.gl);let a=new Mt.Mesh(this.gl,{geometry:n,program:this.seatProg});a.frustumCulled=!1,a.setParent(this.seatScene);let s=new Mt.Mesh(this.gl,{geometry:o,program:this.chairProg});s.frustumCulled=!1,s.setParent(this.chairScene);let c=new Mt.Mesh(this.gl,{geometry:r,program:this.depthProg});c.frustumCulled=!1,c.setParent(this.solidScene)}setRoomCentre(t){this.depthProg.uniforms.uRoomCentre.value.set(t??[0,0])}setRestoreClear(t){this.restoreClear=[t[0],t[1],t[2]]}syncFromSeatProgram(t){for(let r of V1)this.seatProg.uniforms[r].value=t.uniforms[r].value;let n=t.uniforms.uFocusFloor.value;this.seatProg.uniforms.uFocusFloor.value=n,this.chairProg.uniforms.uFocusFloor.value=n,this.depthProg.uniforms.uFocusFloor.value=n;let o=t.uniforms.uSeeThrough?.value;if(o)for(let r of[this.seatProg,this.chairProg,this.depthProg])r.uniforms.uSeeThrough.value=o}ensureTarget(){let t=this.gl.drawingBufferWidth,n=this.gl.drawingBufferHeight;return this.target&&(this.target.width!==t||this.target.height!==n)&&this.destroyTarget(),this.target||(this.target=new Mt.RenderTarget(this.gl,{width:t,height:n,depth:!0})),this.target}destroyTarget(){if(!this.target)return;let t=this.gl;this.target.buffer&&t.deleteFramebuffer(this.target.buffer);for(let n of this.target.textures??[])n.texture&&t.deleteTexture(n.texture);this.target.depthBuffer&&t.deleteRenderbuffer(this.target.depthBuffer),this.target=null}pick(t,n,o,r){let i=this.gl,a=this.ensureTarget(),s=i.drawingBufferWidth,c=i.drawingBufferHeight,l=Math.max(0,n-r),u=Math.max(0,o-r),m=Math.max(1,Math.min(s,n+r+1)-l),f=Math.max(1,Math.min(c,o+r+1)-u);i.enable(i.SCISSOR_TEST),i.scissor(l,u,m,f);let[d,h,p]=this.restoreClear;i.clearColor(0,0,0,1),this.renderer.render({scene:this.solidScene,camera:t,target:a,clear:!0}),this.renderer.render({scene:this.seatScene,camera:t,target:a,clear:!1}),this.renderer.render({scene:this.chairScene,camera:t,target:a,clear:!1}),i.clearColor(d,h,p,1),i.disable(i.SCISSOR_TEST);let b=new Uint8Array(m*f*4);return this.renderer.bindFramebuffer(a),i.readPixels(l,u,m,f,i.RGBA,i.UNSIGNED_BYTE,b),this.renderer.bindFramebuffer(),Sm(b,m,f,n-l,o-u,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function Pm(e,t){let n=[];for(let o of t)e.has(o.seatId)?e.set(o.seatId,jn(o.state)):n.push(o);return n}function Am(e,t,n){let o=new Set;for(let a of t)(e.has(a)||n(a)!==void 0)&&o.add(a);let r=new Map(e),i=[];for(let[a,s]of e)o.has(a)||(i.push({seatId:a,state:Be[s]??"available"}),r.delete(a));for(let a of o){if(r.has(a))continue;let s=n(a);s!==void 0&&(r.set(a,s),i.push({seatId:a,state:"selected"}))}return{updates:i,next:r}}var Bt=require("ogl");function G1(e,t){return[e[0]-t[0],e[1]-t[1],e[2]-t[2]]}function Im(e,t){return[e[0]+t[0],e[1]+t[1],e[2]+t[2]]}function H1(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Em(e){let t=Math.hypot(e[0],e[1],e[2]);return t>1e-6?[e[0]/t,e[1]/t,e[2]/t]:[0,0,0]}function ca(e){let t=Math.max(0,Math.min(1,e));return t*t*t*(t*(t*6-15)+10)}function la(e,t){return Math.max(0,Math.min(1,e+t))}function Rm(e,t){let n=e.length;if(n===0)return[0,0,0];if(n===1)return[...e[0]];let o=Math.max(0,Math.min(1,t)),r=n-1,i=Math.floor(o*r);i>=r&&(i=r-1);let a=o*r-i,s=e[Math.max(0,i-1)],c=e[i],l=e[i+1],u=e[Math.min(n-1,i+2)],m=a*a,f=m*a,d=[0,0,0];for(let h=0;h<3;h++)d[h]=.5*(2*c[h]+(-s[h]+l[h])*a+(2*s[h]-5*c[h]+4*l[h]-u[h])*m+(-s[h]+3*c[h]-3*l[h]+u[h])*f);return d}function ua(e,t,n,o,r){let i=Em(G1(t,n));i[0]===0&&i[1]===0&&i[2]===0&&(i=[0,0,1]);let a=Im(Im(t,H1(i,2.5)),[0,1.5,0]),s=[t[0]-o[0],0,t[2]-o[2]],c=Em(s);c[0]===0&&c[2]===0&&(c=[i[0],0,i[2]]);let l=Math.max(1,r),u=[o[0]+c[0]*l*1.3,o[1]+l*.75,o[2]+c[2]*l*1.3];return{waypoints:[e,u,a],finalPos:a}}function ma(e,t,n=35,o=28){let r=ca(t),i=Rm(e,r),a=ca(Math.max(0,Math.min(1,(t-.66)/.34)));return{pos:i,fov:n+(o-n)*a,eased:r}}function Lm(e,t,n){let o=e.position.clone(),r=new Bt.Quat().copy(e.quaternion);e.position.set(t[0],t[1],t[2]),e.lookAt(new Bt.Vec3(n[0],n[1],n[2]));let i=new Bt.Quat().copy(e.quaternion);return e.position.copy(o),e.quaternion.copy(r),i}var gr=class{constructor(t){this.active=!1;this.waypoints=[];this.startQuat=new Bt.Quat;this.endQuat=new Bt.Quat;this.outQuat=new Bt.Quat;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=t}start(t,n,o,r=2500,i=28){return this.settle(),this.waypoints=t,this.startQuat.copy(n),this.endQuat.copy(o),this.duration=r,this.endFov=i,this.startTime=performance.now(),this.active=!0,new Promise(a=>{this.resolveFn=a})}update(t){if(!this.active)return!1;let n=Math.min(1,(t-this.startTime)/this.duration),{pos:o,fov:r,eased:i}=ma(this.waypoints,n,35,this.endFov);return this.camera.position.set(o[0],o[1],o[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,la(i,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=r,this.camera.updateProjectionMatrix(),n>=1?(this.settle(),!1):!0}cancel(){this.settle()}settle(){this.active=!1;let t=this.resolveFn;this.resolveFn=null,t&&t()}};var km=Ur,z1=.12,j1=1.6,Om=.12;function Fm(e,t,n){let o=e[t*3],r=e[t*3+1],i=e[t*3+2],a=n[0]-o,s=n[2]-i,c=Math.hypot(a,s);if(!(c>.001))return null;let l=a/c,u=s/c,m=1/0,f=null;for(let d=0;d*3<e.length;d++){if(d===t)continue;let h=e[d*3]-o,p=e[d*3+2]-i,b=h*l+p*u;b<.3||b>1.6||Math.abs(h*u-p*l)>.6||b<m&&(m=b,f=r-e[d*3+1])}return f}var U1=.25,W1=1.5;function Dm(e,t,n=0,o,r,i=!1){let a=[t.x*C,n+W1,t.y*C],s=r?[r[0],r[1],r[2]]:a,c=e[1],l=Number.isFinite(c)?c+(i?j1:km):Number.isFinite(o)?n+o:n+km,u=a[0]-e[0],m=a[2]-e[2],f=Math.hypot(u,m),d=f>.001?Math.min(z1,f*U1):0,h=f>.001?u/f:0,p=f>.001?m/f:0;return{eye:[e[0]+h*d,l,e[2]+p*d],focal:s}}var Vt=Math.PI/180,X1=45,fa=80,xr=70,Y1=1,K1=.99;function $1(e,t){if(!(e<Y1))return fa;if(!(Number.isFinite(t)&&t>0))return xr;let n=2*Math.atan(t/(2*Mr*K1)/Math.max(.05,e))/Vt;return Math.max(xr,Math.min(fa,n))}var Z1=.25,Mr=1,q1=.25,Q1=12*Vt,J1=.2,ex=1.5,Nm=.8,Bm=6,Um=1.9,tx=2/3,nx=.12,ox=.9,rx=1.2,ix=2,Wm=.05,ax=6;function Xm(e,t,n=0){if(!e.length)return{min:[t[0]-6,n,t[2]-6],max:[t[0]+6,Math.max(n+Nm,t[1]),t[2]+6]};let o=1/0,r=-1/0,i=1/0,a=-1/0,s=n;for(let h of e)o=Math.min(o,h.cx-h.halfX),r=Math.max(r,h.cx+h.halfX),i=Math.min(i,h.cz-h.halfZ),a=Math.max(a,h.cz+h.halfZ),s=Math.max(s,h.y);let c=r-o,l=a-i,u=Math.max(c,Math.min(l,Bm))/2,m=Math.max(l,Math.min(c,Bm))/2,f=(o+r)/2,d=(i+a)/2;return{min:[f-u,n,d-m],max:[f+u,Math.max(n+Nm,s),d+m]}}function sx(e){return{min:[e.min[0],e.min[1],e.min[2]],max:[e.max[0],e.max[1]+Um,e.max[2]]}}function da(e){let t=e.max[1];return[(e.min[0]+e.max[0])/2,Math.max(e.min[1]+ex,t+J1,t+Um*tx),(e.min[2]+e.max[2])/2]}function Ym(e,t){let n=e[0]-t[0],o=e[2]-t[2],r=Math.hypot(n,o);return r<.001?{x:0,z:1}:{x:n/r,z:o/r}}function Vm(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=Math.hypot(o,r,i)||1;o/=a,r/=a,i/=a;let s=-i,c=o,l=Math.hypot(s,c);if(l<1e-6)return 1/0;s/=l,c/=l;let u=1/0,m=-1/0;for(let f=0;f<8;f++){let d=(f&1?n.max[0]:n.min[0])-e[0],h=(f&2?n.max[1]:n.min[1])-e[1],p=(f&4?n.max[2]:n.min[2])-e[2],b=Math.max(Wm,d*o+h*r+p*i),y=(d*s+p*c)/b;y<u&&(u=y),y>m&&(m=y)}return m-u}function Gm(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=Math.hypot(o,r,i)||1;o/=a,r/=a,i/=a;let s=-i,c=o,l=Math.hypot(s,c);if(l<1e-6)return 1/0;s/=l,c/=l;let u=-c*r,m=c*o-s*i,f=s*r,d=1/0,h=-1/0;for(let p=0;p<8;p++){let b=(p&1?n.max[0]:n.min[0])-e[0],y=(p&2?n.max[1]:n.min[1])-e[1],M=(p&4?n.max[2]:n.min[2])-e[2],v=Math.max(Wm,b*o+y*r+M*i),A=(b*u+y*m+M*f)/v;A<d&&(d=A),A>h&&(h=A)}return h-d}function vr(e,t){return Math.tan(e*Vt/2)*Math.max(.05,t)}function Hm(e,t,n){let o=$1(n,e),r=c=>Math.max(X1,Math.min(o,c)),i=c=>2*Math.atan(c)/Vt,a=Number.isFinite(e)&&e>0?r(i(e/(2*Z1)/Math.max(.05,n))):o;if(!(Number.isFinite(t)&&t>0))return a;let s=Math.min(a,r(i(t/(2*nx))));return e/(2*vr(s,n))>Mr?a:s}function Km(e,t,n,o={}){let r=da(t),i=[e[0],e[1],e[2]],a=0,s=0,c=h=>{if(!(h>0))return;let p=Ym(i,r);i[0]+=p.x*h,i[2]+=p.z*h,s+=h},l=o.preserveEye?0:t.max[1]+q1-i[1];l>0&&(i[1]+=l,a=l,c(l/Math.tan(Q1)));let u=sx(t),m=Vm(i,r,t),f=Hm(m,Gm(i,r,u),n),d=m/(2*vr(f,n));for(let h=0;!o.preserveEye&&h<ax&&d>Mr;h++){let p=Math.max(1,Math.hypot(i[0]-r[0],i[2]-r[2])),b=Number.isFinite(d)?d/Mr:2;c(Math.min(60,p*(Math.min(4,b)-1)+.5)),m=Vm(i,r,t),f=Hm(m,Gm(i,r,u),n),d=m/(2*vr(f,n))}return{eye:i,focal:r,fov:f,raisedM:a,pulledBackM:s,stageFrameWidth:d}}function cx(e,t,n){let o=Math.tan(t*Vt/2),r=vr(t,n);return Math.max(1,e/Math.max(.05,Math.min(o,r)))}var lx=.7,zm=.5,ux=.8;function jm(e,t,n){let o=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],r=[n[0]-e[0],n[1]-e[1],n[2]-e[2]],i=o[0]*r[0]+o[1]*r[1]+o[2]*r[2],a=Math.hypot(o[0],o[1],o[2])*Math.hypot(r[0],r[1],r[2])||1;return Math.acos(Math.max(-1,Math.min(1,i/a)))/Vt}function mx(e,t,n){let o=l=>{let u=Math.hypot(l[0],l[1],l[2])||1;return[l[0]/u,l[1]/u,l[2]/u]},r=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],i=Math.hypot(r[0],r[1],r[2]),a=o(r),s=o([n[0]-e[0],n[1]-e[1],n[2]-e[2]]),c=o([0,1,2].map(l=>a[l]*(1-zm)+s[l]*zm));return[e[0]+c[0]*i,e[1]+c[1]*i,e[2]+c[2]*i]}function $m(e,t){let{aspect:n,venue:o}=t,r=e.focal,i=Ym(e.eye,r),a=p=>(p[0]-r[0])*i.x+(p[2]-r[2])*i.z,s=[{name:"seat",eye:e.eye,focal:r,fov:e.fov}],c=ix*(t.rowDepthM??ox),l=[e.eye[0]+i.x*c,e.eye[1]+rx,e.eye[2]+i.z*c],u=[e.eye[0],e.eye[1]-lx,e.eye[2]],m=mx(l,r,u);s.push({name:"row",eye:l,focal:m,fov:Math.min(fa,Math.max(e.fov,2*Math.max(jm(l,m,u),jm(l,m,r))/ux))});let f=(p,b,y,M)=>{let v=cx(y,e.fov,n)*1.08,A=v*Math.sin(M*Vt),x=Number.isFinite(t.seatingTopY)?t.seatingTopY+2:-1/0,g=Math.max(A,x-b[1]),P=v*Math.cos(M*Vt);return{name:p,eye:[b[0]+i.x*P,b[1]+g,b[2]+i.z*P],focal:b,fov:e.fov}};t.section&&t.section.radius>0&&s.push(f("section",t.section.center,t.section.radius,35)),s.push(f("venue",o.center,Math.max(1,o.radius),40));let d=[],h=-1/0;for(let p of s){let b=a(p.eye);d.length&&b<=h+.5||(d.push(p),h=b)}return d}var Jm=require("ogl"),go=Math.PI/180,ha=320,Zm=70*go,fx=32*go,dx=24*go,qm=.0026,hx=.22,px=.006,bx=180,yx=900,gx=1100,xx=4,Xe=(e,t,n)=>Math.max(t,Math.min(n,e)),Qm=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;function ef(e){let{canvas:t,camera:n}=e,o=[],r=!1,i=0,a=0,s=0,c=0,l=0,u=0,m=ha,f=null,d=()=>{f&&(clearTimeout(f),f=null)},h=!1,p=[0,0],b=0,y=!1,M=null,v=null,A=new Map,x=!1,g=0,P=0,S=0,w=0,E=()=>r&&o.length?o[Xe(Math.round(i),0,o.length-1)].name:null,T=()=>{let L=E();L!==M&&(M=L,e.onStopChange?.(L))},F=()=>{if(!r||!o.length)return;let L=o[Xe(Math.floor(i),0,o.length-1)],B=o[Xe(Math.ceil(i),0,o.length-1)],D=Xe(i-Math.floor(i),0,1),G=(J,ie)=>J+(ie-J)*D,j=[G(L.eye[0],B.eye[0]),G(L.eye[1],B.eye[1]),G(L.eye[2],B.eye[2])],Z=[G(L.focal[0],B.focal[0]),G(L.focal[1],B.focal[1]),G(L.focal[2],B.focal[2])],$=Z[0]-j[0],ee=Z[1]-j[1],Q=Z[2]-j[2],X=Math.hypot($,ee,Q)||1,Y=Math.atan2($,Q),K=Math.asin(Xe(ee/X,-1,1)),re=Y+a,ne=Xe(K+s,-80*go,80*go),se=Math.cos(ne)*X;$=Math.sin(re)*se,ee=Math.sin(ne)*X,Q=Math.cos(re)*se,n.position.set(j[0],j[1],j[2]),n.fov=G(L.fov,B.fov),n.updateProjectionMatrix(),n.lookAt(new Jm.Vec3(j[0]+$,j[1]+ee,j[2]+Q)),e.onApplied?.()},R=()=>{if(!r||!o.length)return;let L=Xe(Math.round(i),0,o.length-1);if(e.reducedMotion()){h=!1,i=L,F(),T(),e.requestRender();return}if(Math.abs(L-i)<.001){h=!1,T();return}c=i,l=L,u=performance.now(),m=ha,h=!0,e.requestRender()},I=L=>{!r||o.length<2||(d(),h=!1,i=Xe(i+L,0,o.length-1),F(),T(),e.requestRender())},_=(L,B)=>{r&&(d(),h=!1,y=!1,a=Xe(a-L*qm,-Zm,Zm),s=Xe(s-B*qm,-dx,fx),F(),e.requestRender())},k=L=>{r&&(A.set(L.pointerId,{x:L.clientX,y:L.clientY}),A.size===1?(x=!0,w=0,g=L.clientX,P=L.clientY):A.size===2&&(x=!1,S=V()))},V=()=>{let L=[...A.values()];return L.length<2?0:Math.hypot(L[0].x-L[1].x,L[0].y-L[1].y)},O=L=>{if(!r||!A.has(L.pointerId))return;if(A.set(L.pointerId,{x:L.clientX,y:L.clientY}),A.size>=2){let G=V();S>0&&I((S-G)*px),S=G;return}if(!x)return;let B=L.clientX-g,D=L.clientY-P;g=L.clientX,P=L.clientY,w+=Math.abs(B)+Math.abs(D),!(w<=xx)&&_(B,D)},H=L=>{A.delete(L.pointerId)&&(A.size<2&&(S=0),A.size===0&&(x=!1,R()))},U=L=>{if(!r)return;L.preventDefault();let B=L.deltaMode===1?16:L.deltaMode===2?100:1,D=Xe(L.deltaY*B/100,-2,2);I(D*hx),v&&clearTimeout(v),v=setTimeout(()=>{v=null,R()},bx)},N=()=>{d(),r&&(r=!1,h=!1,y=!1,o=[],A.clear(),x=!1,v&&(clearTimeout(v),v=null),M!==null&&(M=null,e.onStopChange?.(null)))};return t.addEventListener("pointerdown",k),t.addEventListener("pointermove",O),t.addEventListener("pointerup",H),t.addEventListener("pointercancel",H),t.addEventListener("wheel",U,{passive:!1}),{get active(){return r},enter(L,B=0){if(L.length<2){N();return}d(),o=L,r=!0,i=e.reducedMotion()?0:Xe(B,0,L.length-1),i>0&&(f=setTimeout(()=>{f=null,r&&(c=i,l=0,u=performance.now(),m=gx,h=!0,e.requestRender())},yx)),a=0,s=0,h=!1,y=!1,M=null,F(),T(),e.requestRender()},exit:N,recentre(){return r?Math.abs(a)<1e-4&&Math.abs(s)<1e-4?!0:e.reducedMotion()?(y=!1,a=0,s=0,F(),e.requestRender(),!0):(p=[a,s],b=performance.now(),y=!0,e.requestRender(),!0):!1},update(L){if(!r)return!1;let B=!1;if(y){let D=Xe((L-b)/ha,0,1),G=1-Qm(D);a=p[0]*G,s=p[1]*G,D>=1?(y=!1,a=0,s=0):B=!0}if(h){let D=Xe((L-u)/m,0,1);i=c+(l-c)*Qm(D),D>=1?(h=!1,i=l,T()):B=!0}return F(),B},currentStop:E,dispose(){N(),t.removeEventListener("pointerdown",k),t.removeEventListener("pointermove",O),t.removeEventListener("pointerup",H),t.removeEventListener("pointercancel",H),t.removeEventListener("wheel",U)}}}function tf(e){return e.flying?"cinematic":e.panoramaMounted?"panorama":e.seatViewActive?"seatView":"orbit"}var ga=null;function pf(){return ga??=Promise.resolve().then(()=>(hf(),df)).catch(e=>{throw ga=null,e}),ga}var bf=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),Rr=class{constructor(t){this.orbitLatched=!1;this.panoramaOpenedAt=0;this.cb=t}emit(t,n){if(this.cb)try{this.cb(t,n)}catch{}}opened(t,n,o,r){this.emit("3d_opened",{seats:t,hasHeights:n,...o===void 0?{}:{buildMs:Math.round(o)},...r===void 0?{}:{prepSource:r}})}orbitEngaged(){this.orbitLatched||(this.orbitLatched=!0,this.emit("3d_orbit_engaged"))}seatPicked(t,n){this.emit("3d_seat_picked",{seatId:t,sectionId:n})}cinematicPlayed(t){this.emit("3d_cinematic_played",{durationMs:t,reducedMotion:!1})}cinematicSkipped(){this.emit("3d_cinematic_skipped",{reducedMotion:!0})}cinematicCancelled(){this.emit("3d_cinematic_cancelled")}panoramaOpened(){this.panoramaOpenedAt=bf(),this.emit("3d_panorama_opened")}panoramaClosed(){let t=this.panoramaOpenedAt?Math.round(bf()-this.panoramaOpenedAt):0;this.panoramaOpenedAt=0,this.emit("3d_panorama_closed",{viewMs:t})}panoramaFailed(t,n){this.emit("3d_panorama_failed",{seatId:t,phase:n})}panoramaFallback(t){this.emit("3d_panorama_fallback",{seatId:t})}contextLost(){this.emit("3d_context_lost")}contextRestored(){this.emit("3d_context_restored")}};function yf(e){let t=e.style.position;return getComputedStyle(e).position!=="static"?()=>{}:(e.style.position="relative",()=>{e.style.position==="relative"&&(e.style.position=t)})}function gf(e){let{container:t,model:n,opts:o,expandedSeatById:r,seatIdsByRow:i,isNarrow:a}=e,s=null,c=()=>{if(!s)return;let m=a();Object.assign(s.style,m?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},l=()=>{s?.remove(),s=null};return{show:(m,f,d=!1)=>{if(l(),e.isDisposed())return null;let h=document.createElement("div");h.setAttribute("role","group"),Object.assign(h.style,{position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",zIndex:"4"});let p=o.chrome?.caption!==!1,b=o.chrome?.seatStepper!==!1;if(!p&&!b)return null;let y=r.get(m),M=y?.sectionId?n.sections.find(E=>E.id===y.sectionId):void 0,v=y?.label??m;h.setAttribute("aria-label",`Explore views near ${M?.label?`${M.label}, `:""}seat ${v}`);let A=document.createElement("span");A.textContent=o.seatViewCaption?.(m)??["Live 3D seat view",M?.label,v].filter(Boolean).join(" \xB7 "),Object.assign(A.style,{maxWidth:"min(70vw, 560px)",padding:"5px 10px",borderRadius:"999px",overflow:"hidden",color:"#d9e3f5",background:"rgba(12,18,32,0.72)",font:"600 11px/1.2 inherit",textOverflow:"ellipsis",whiteSpace:"nowrap",backdropFilter:"blur(6px)"}),p&&h.appendChild(A);let x=document.createElement("div");Object.assign(x.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),h.appendChild(x);let g=y?.rowId?i.get(y.rowId):void 0,P=g?.indexOf(m)??-1,S=P>=0?[g?.[P-1],g?.[P+1]]:[void 0,void 0],w=(E,T,F,R=!1)=>{let I=document.createElement("button");I.type="button",I.textContent=E,I.setAttribute("aria-label",T),Object.assign(I.style,{minHeight:"44px",padding:R?"10px 16px":"10px",borderRadius:"999px",background:"rgba(12,18,32,0.78)",color:"#eef1f8",border:"1px solid rgba(150,165,205,0.4)",backdropFilter:"blur(6px)",font:"600 13px/1 inherit",cursor:"pointer",whiteSpace:"nowrap"}),R||(I.style.minWidth="44px"),R&&(I.dataset.panoramaTrigger=""),I.addEventListener("click",F),x.appendChild(I)};if(b&&S[0]){let E=r.get(S[0])?.label??S[0];w("\u2039",`View previous seat ${E}`,()=>{e.flyToSeat(S[0])})}if(b&&o.getSeatView){let E=o.seatViewActionLabel?.(m)??"Open 360\xB0 panorama";w(d?`\u21BB Retry ${E}`:`\u25C9 ${E}`,`${d?"Retry":E} from seat ${v}`,()=>{if(e.isDisposed()||f!==e.flightGen()){l();return}l(),e.openPanorama(m,400,f)},!0)}if(b&&S[1]){let E=r.get(S[1])?.label??S[1];w("\u203A",`View next seat ${E}`,()=>{e.flyToSeat(S[1])})}return!x.childElementCount&&!p?null:(t.appendChild(h),s=h,c(),h)},remove:l,layout:c}}var Ox={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function xf(e){let{container:t,orbit:n,isNarrow:o}=e,r={...Ox,...e.labels??{}},i=(x,g)=>{x.setAttribute("aria-label",g),x.title=g},a=document.createElement("div"),s=!1;a.className="sl-3d-navigation-controls",Object.assign(a.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let c=document.createElement("div");c.setAttribute("role","group"),c.setAttribute("aria-label","3D drag mode"),Object.assign(c.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let l=document.createElement("div");l.setAttribute("role","group"),l.setAttribute("aria-label","3D view controls"),Object.assign(l.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let u=document.createElement("button");u.type="button",u.textContent="\u21BB",i(u,r.rotate);let m=document.createElement("button");m.type="button",m.textContent="\u2725",i(m,r.move);let f=document.createElement("button");f.type="button",f.textContent="\u2212",i(f,r.zoomOut);let d=document.createElement("button");d.type="button",d.textContent="+",i(d,r.zoomIn);for(let x of[u,m,f,d])x.className="sl-3d-icon-control",Object.assign(x.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",border:"1px solid rgba(150,165,205,0.35)",borderRadius:"999px",color:"#c9d4ea",background:"rgba(12,18,32,0.82)",font:"600 17px/1 inherit",backdropFilter:"blur(6px)",cursor:"pointer",whiteSpace:"nowrap"});c.append(u,m),l.append(d,f);let h=null,p=()=>{let x=n.dragAction();if(x===h)return;h=x;let g=x==="orbit";u.setAttribute("aria-pressed",String(g)),m.setAttribute("aria-pressed",String(!g)),u.style.background=g?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",m.style.background=g?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",a.title=g?`${r.rotate} \xB7 ${r.move} with Shift`:`${r.move} \xB7 ${r.rotate} with Shift`},b=x=>{n.setPrimaryDragMode(x),p()};u.addEventListener("click",()=>b("orbit")),m.addEventListener("click",()=>b("pan"));let y=()=>{let{atMin:x,atMax:g}=n.dollyLimitState();d.disabled!==x&&(d.disabled=x),f.disabled!==g&&(f.disabled=g)};f.addEventListener("click",()=>{n.zoomBy(Un),y()}),d.addEventListener("click",()=>{n.zoomBy(rn),y()}),a.append(c,l),b("auto"),t.appendChild(a);let M=e.enabled!==!1,v=()=>{let x=o();a.style.display=s||!M?"none":"flex",a.style.right=x?"12px":"14px",a.style.bottom=x?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",c.style.display=x?"none":"flex",d.style.display=x?"none":"",f.style.display=x?"none":""};return v(),{element:a,utilityControls:l,setNavigationMode:b,syncNavigationMode:p,syncZoomLimits:y,setSeatViewLocked:x=>{s=x,n.setInteractionEnabled(!x),v()},seatViewLocked:()=>s,layout:v}}var Fx=.5,Mf=12,vf=20,Dx=28;function Nx(e,t,n){return!(e>0)||!(n>0)?0:Fx*n/(2*e*Math.tan(t*Math.PI/360))}function Sf(e){let{glctx:t,orbit:n,model:o,seats:r,opts:i,cinematic:a,analytics:s,seatIdByIndex:c,sectionIdBySeatId:l,tapSlop:u,tapMs:m,cancelFlight:f,focusSectionCamera:d,setSelection:h,ensureSeatView:p}=e,b=0,y=0,M=0,v=-1,A=!1,x=!1,g=R=>{e.seatViewLocked()||v===-1&&(v=R.pointerId,b=R.clientX,y=R.clientY,M=performance.now(),A=!1,x=a.active,a.active&&(s.cinematicCancelled(),f(),i.onViewTargetChange?.(null)))},P=R=>{R.pointerId===v&&Math.hypot(R.clientX-b,R.clientY-y)>u&&(A=!0)},S=(R,I,_,k,V)=>{let O=t.canvas.getBoundingClientRect(),H=t.canvas.clientWidth||O.width||1,U=t.canvas.clientHeight||O.height||1,N=R-O.left,L=I-O.top,B=k*k,D=-1,G=B,j=1/0;for(let Z of r){if(_&&Z.sectionId!==_)continue;let $=o.seats.idToIndex.get(Z.id);if($===void 0)continue;if(V){let re=Math.round(o.seats.iState[$]??0);if(re!==0&&re!==3)continue}let ee=$*3,Q=gt(n.camera.projectionViewMatrix,[o.seats.iPosition[ee],o.seats.iPosition[ee+1]+.55,o.seats.iPosition[ee+2]],H,U);if(!Q.visible)continue;let X=Q.x-N,Y=Q.y-L,K=X*X+Y*Y;(K<G||Math.abs(K-G)<1&&Q.depth<j)&&(D=$,G=K,j=Q.depth)}return D},w=(R,I)=>{let _=e.gpu(),k=e.pick();if(!_||!k)return-1;k.syncFromSeatProgram(_.seatProgram);let V=t.canvas.getBoundingClientRect(),O=t.renderer.dpr,{x:H,y:U}=wm(R,I,V,O,t.gl.drawingBufferWidth,t.gl.drawingBufferHeight),N=Math.max(2,Math.round(8*O));return k.pick(n.camera,H,U,N)},E=()=>t.canvas.clientHeight||t.canvas.getBoundingClientRect().height,T=(R,I=Mf)=>{let _=n.camera?.position;if(!_)return!1;let k=R*3,V=Math.hypot(_.x-o.seats.iPosition[k],_.y-o.seats.iPosition[k+1],_.z-o.seats.iPosition[k+2]);return Nx(V,n.fovY,E())>=I};return{onDown:g,onMove:P,onUp:R=>{if(R.pointerId!==v)return;let I=!A&&performance.now()-M<m;if(v=-1,x){x=!1;return}let _=e.gpu(),k=e.pick();if(!I||!_||!k)return;let V=w(R.clientX,R.clientY),O=R.pointerType==="touch"||R.pointerType==="pen",H=O?vf:Mf,U=V>=0&&T(V,H),N=!1;if(e.focusedSectionId()&&V>=0){let D=c[V],G=D?l.get(D):void 0;if(G&&G!==e.focusedSectionId()&&d(G,{keepCamera:U})){if(!U)return;N=!0}}if(e.focusedSectionId()&&V<0&&(V=S(R.clientX,R.clientY,e.focusedSectionId(),44,!1)),e.focusedSectionId()&&V<0){let D=S(R.clientX,R.clientY,null,72,!1),G=D>=0?c[D]:void 0,j=G?l.get(G):void 0;if(j&&j!==e.focusedSectionId()&&d(j))return}if(!e.focusedSectionId()){V<0&&(V=S(R.clientX,R.clientY,null,42,!1));let D=V>=0?c[V]:void 0,G=D?l.get(D):void 0;if(G&&d(G,{keepCamera:U})){if(!U)return;N=!0}}if(V<0||V>=c.length){e.selection().size&&(h([]),i.onViewTargetChange?.(null));return}let L=c[V];if(O&&e.focusedSectionId()&&!N&&!T(V,vf)){e.focusSeatCamera(L,{seatPx:Dx,viewportHeightPx:E()});return}let B=Be[Math.round(o.seats.iState[V]??0)]??"available";if(B!=="available"&&B!=="selected"){i.onSeatInspect?.(L,B);return}if(e.selection().has(L)&&e.selection().size===1){h([]),i.onViewTargetChange?.(null),i.onSeatPick?.(L);return}h([L]),p(L),s.seatPicked(L,l.get(L)),i.onSeatPick?.(L)}}}var Cr=class{constructor(t,n){this.minX=0;this.minZ=0;this.cell=1;this.cols=1;this.rows=1;this.cellStart=null;this.cellItems=null;this.iPosition=t,this.count=n}ensureGrid(){if(this.cellStart||this.count===0)return;let t=this.iPosition,n=1/0,o=1/0,r=-1/0,i=-1/0;for(let d=0;d<this.count;d++){let h=t[d*3],p=t[d*3+2];h<n&&(n=h),h>r&&(r=h),p<o&&(o=p),p>i&&(i=p)}let a=Math.max(r-n,.001),s=Math.max(i-o,.001);this.cell=Math.max(Math.sqrt(a*s*4/this.count),.25),this.cols=Math.max(1,Math.ceil(a/this.cell)+1),this.rows=Math.max(1,Math.ceil(s/this.cell)+1),this.minX=n,this.minZ=o;let c=this.cols*this.rows,l=new Int32Array(c+1),u=d=>{let h=Math.min(this.cols-1,Math.max(0,Math.floor((t[d*3]-n)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((t[d*3+2]-o)/this.cell)))*this.cols+h};for(let d=0;d<this.count;d++)l[u(d)+1]++;for(let d=0;d<c;d++)l[d+1]+=l[d];let m=new Int32Array(this.count),f=l.slice(0,c);for(let d=0;d<this.count;d++)m[f[u(d)]++]=d;this.cellStart=l,this.cellItems=m}gather(t,n,o,r,i){this.ensureGrid();let a=this.cellStart,s=this.cellItems;if(!a||!s)return 0;let c=r.length,l=o*o,u=Math.floor((t-this.minX)/this.cell),m=Math.floor((n-this.minZ)/this.cell),f=Math.ceil(o/this.cell)+1,d=this.iPosition,h=0;for(let p=0;p<=f&&h<c;p++){let b=m-p,y=m+p,M=u-p,v=u+p;for(let A=b;A<=y&&h<c;A++){if(A<0||A>=this.rows)continue;let x=A===b||A===y;for(let g=M;g<=v&&h<c;g++){if(!x&&g!==M&&g!==v){g=v-1;continue}if(g<0||g>=this.cols)continue;let P=A*this.cols+g;for(let S=a[P],w=a[P+1];S<w&&h<c;S++){let E=s[S],T=d[E*3]-t,F=d[E*3+2]-n,R=i===void 0?0:d[E*3+1]-i;T*T+R*R+F*F<=l&&(r[h++]=E)}}}}return h}};var _r=class{constructor(t){this.ctx=t;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(Co);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.lastGatherY=1/0;this.nearIndex=new Cr(t.model.seats.iPosition,t.model.seats.count)}forceRegather(){this.lastGatherX=1/0}setDetailEnabled(t){let n=this.ctx.gpu();t||(this.detailVisible=!1),this.lastGatherX=1/0,this.lastGatherZ=1/0,!t&&n?.nearSeatCount()&&n.setNearSeats(this.nearBuf,0)}update(t){let{model:n}=this.ctx,o=this.ctx.gpu();if(!o)return;if(!t){o.nearSeatCount()&&o.setNearSeats(this.nearBuf,0);return}let r=this.ctx.orbit().camera.position;if(Math.hypot(r.x-this.lastGatherX,r.y-this.lastGatherY,r.z-this.lastGatherZ)<Jr)return;if(this.lastGatherX=r.x,this.lastGatherY=r.y,this.lastGatherZ=r.z,Math.hypot(r.x-n.bounds.center[0],r.y-n.bounds.center[1],r.z-n.bounds.center[2])-n.bounds.radius>Qr){o.nearSeatCount()&&o.setNearSeats(this.nearBuf,0);return}let s=this.nearIndex.gather(r.x,r.z,Qr,this.nearBuf,r.y);s===0&&o.nearSeatCount()===0||o.setNearSeats(this.nearBuf,s)}ease(t,n,o){let r=1-Math.exp(-t*9),i=1-Math.exp(-t*20);this.seatDetailMix+=(n-this.seatDetailMix)*(n>this.seatDetailMix?r:i),this.structureDetailMix+=(o-this.structureDetailMix)*(o>this.structureDetailMix?r:i),Math.abs(n-this.seatDetailMix)<.01&&(this.seatDetailMix=n),Math.abs(o-this.structureDetailMix)<.01&&(this.structureDetailMix=o)}};function wf(e){let t=Math.max(5,e.radius),n=e.focalWorld[0]-e.center[0],o=e.focalWorld[2]-e.center[2],r=Math.hypot(n,o);if(r<t*.12)return{center:e.center,radius:t,polarDeg:48};let i=Math.min(r*.25,t*.2);return{center:[e.center[0]+n/r*i,e.center[1],e.center[2]+o/r*i],radius:t+i,polarDeg:50}}var Tr=require("ogl");function Pf(){let e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round");let n=document.createElementNS(e,"path");return n.setAttribute("d","M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 0 2 2v3M8 21H5a2 2 0 0 0-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3"),t.appendChild(n),t}function Af(e){let{container:t,model:n,opts:o,orbit:r,cinematic:i,analytics:a,loop:s,labelOverlay:c,stageAzimuth:l,overviewFraming:u}=e,m=0,f=-1,d=(E,T,F=28)=>{r.camera.position.set(E[0],E[1],E[2]),r.camera.lookAt(new Tr.Vec3(T[0],T[1],T[2])),r.camera.fov=F,r.camera.updateProjectionMatrix()},h=document.createElement("button");h.className="sl-3d-overview-control sl-3d-icon-control",h.type="button",h.replaceChildren(Pf());let p=o.navLabels?.fitView??"Show whole venue";h.setAttribute("aria-label",p),h.title=p,Object.assign(h.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",borderRadius:"999px",background:"rgba(12,18,32,0.72)",color:"#c9d4ea",border:"1px solid rgba(150,165,205,0.35)",backdropFilter:"blur(6px)",font:"600 11px/1 inherit",cursor:"pointer",whiteSpace:"nowrap"});let b=()=>{h.firstElementChild||h.replaceChildren(Pf())};b();let y=E=>{f=E;let T=e.gpu();T&&(T.seatProgram.uniforms.uFocusFloor.value=E,T.solidProgram.uniforms.uFocusFloor.value=E,T.chairProgram.uniforms.uFocusFloor.value=E),e.showSectionSeatLabels(null)},M=null,v=!1,A=()=>{if(M=null,v=!1,e.setSeeThrough?.(null),e.isDisposed())return;o.onViewTargetChange?.(null),o.onSectionFocusChange?.(null),e.panorama()&&(e.panorama().dispose(),e.setPanorama(null),a.panoramaClosed()),e.setPanoramaSphereVisible(!1),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),e.restorePanoramaLayer(),h.style.display="",c.setVisible(!0),e.setFrozen(!1);let E=f>=0?n.floors[f]:null;if(e.setNearFieldDetailEnabled(!!E),e.setSeatViewLocked(!1),x(),e.removeArriveChip(),e.setNavigationMode("auto"),E){let T=E.focalWorld[0]-E.center[0],F=E.focalWorld[2]-E.center[2],R=Math.hypot(T,F)>E.radius*.12?Math.atan2(T,F):l,I={center:E.center,radius:E.radius,box:E.box},_={polarDeg:58,margin:1.12};e.reducedMotion()?r.frame(I,!1,R,!1,_):r.frameSoft(I,R,!1,_)}else e.reducedMotion()?r.frame(n.bounds,!1,l,o.portraitOverviewCrop===!0,u):r.frameSoft(n.bounds,l,o.portraitOverviewCrop===!0,u);c.setOverviewDistance(r.targetDistance),e.showSectionSeatLabels(null),s.requestRender()},x=()=>{m++,e.setSeatStepping(!1),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),i.active&&(i.cancel(),r.resumeAfterFlight(n.focalWorld))},g=E=>{if(e.isDisposed()||!e.gpu())return Promise.resolve();let T=n.seats.idToIndex.get(E);if(T===void 0)return Promise.resolve();e.setNearFieldDetailEnabled(!0),o.onViewTargetChange?.(E),e.panorama()&&(e.panorama().dispose(),e.setPanorama(null),e.setPanoramaSphereVisible(!1),h.style.display="",e.restorePanoramaLayer()),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),e.setFrozen(!1);let F=e.inSeatView()&&o.arriveAtSeatEye===!0;e.setSeatStepping(F),e.setSeatViewLocked(!1);let R=++m;F?e.showArriveChip(E,R):e.removeArriveChip();let{eye:I,focal:_}=e.resolvedSeatViewPose(E,T),k=o.arriveAtSeatEye?e.seatViewArrival(E,T):null,V=k&&k.stops.length>1&&k.stops[1].name==="row"?k.stops[1]:null,O=k?k.focal:_,H=[r.camera.position.x,r.camera.position.y,r.camera.position.z],U=ua(H,k?.eye??I,O,n.bounds.center,n.bounds.radius),N=V?V.eye:k?k.eye:o.arriveAtSeatEye?I:U.finalPos,L=k?k.fov:o.arriveAtSeatEye?t.clientWidth/Math.max(1,t.clientHeight)<.7?xr:65:28,B=[U.waypoints[0],U.waypoints[1],N];if(c.setVisible(!1),e.reducedMotion())return e.setSeatStepping(!1),d(N,O,L),s.requestRender(),a.cinematicSkipped(),e.isDisposed()||r.syncFromCamera(),e.setSeatViewLocked(o.arriveAtSeatEye===!0),k&&e.enterSeatView(k.stops),e.showArriveChip(E,R),Promise.resolve();let D=new Tr.Quat().copy(r.camera.quaternion),G=Lm(r.camera,N,O);s.requestRender();let j=F?700:2500;return i.start(B,D,G,j,L).then(()=>{e.isDisposed()||R!==m||(e.setSeatStepping(!1),a.cinematicPlayed(j),r.resumeAfterFlight(O),e.setSeatViewLocked(o.arriveAtSeatEye===!0),k&&e.enterSeatView(k.stops,V?1:0),s.requestRender(),e.showArriveChip(E,R))})},P=(E,T)=>{let F=n.sections.find(R=>R.id===E);if(!F||F.seatCount===0)return!1;if(M=E,v=!1,e.setSeeThrough?.(null),e.setNearFieldDetailEnabled(!0),e.setSeatStepping(!1),e.setSeatViewLocked(!1),i.cancel(),e.removeArriveChip(),n.floors.length>1&&f!==F.floorIndex&&y(F.floorIndex),e.setNavigationMode("auto"),e.panorama()||c.setVisible(!0),e.showSectionSeatLabels(E),!T?.keepCamera){let R=wf(F),I={polarDeg:R.polarDeg,margin:1.12};e.reducedMotion()?r.frame({center:R.center,radius:R.radius},!1,r.currentAzimuth,!1,I):r.glideTo({center:R.center,radius:R.radius},I)}return o.onSectionFocusChange?.(E),s.requestRender(),!0},S=(E,T)=>{if(e.isDisposed()||!e.gpu())return!1;let F=n.seats.idToIndex.get(E);if(F===void 0)return!1;let R=F*3,I=[n.seats.iPosition[R],n.seats.iPosition[R+1]+.55,n.seats.iPosition[R+2]],_=T?Bx(T,r.fovY,r.camera.aspect||1):If;return v=!0,e.setSeeThrough?.(I),e.reducedMotion()?r.frame({center:I,radius:_},!1,void 0,!1,xa):r.frameSoft({center:I,radius:_},void 0,!1,xa),s.requestRender(),!0},w=()=>{if(e.isNarrow?.()&&v&&M&&P(M)){s.requestRender();return}A()};return h.addEventListener("click",w),{overviewChip:h,layoutOverviewChip:b,flightGen:()=>m,focusedFloor:()=>f,applyFloorFocus:y,placeCameraFinal:d,cancelFlight:x,focusOverview:A,flyToSeat:g,focusSectionCamera:P,focusSeatCamera:S}}var If=4.5;function Bx(e,t,n){let o=Math.tan(t*Math.PI/360),r=o*Math.max(.001,n),a=Vx*e.viewportHeightPx/(2*Math.max(1,e.seatPx)*o)*Math.min(o,r)/xa.margin;return Math.max(Gx,Math.min(If,a))}var Vx=.5,Gx=1.5,xa={polarDeg:48,margin:1.25};function Mo(e,t){let{doc:n,report:o}=ur(e),r=o.confident&&(o.sections.length>0||!!o.looseRowBlocks);if(!r&&!o.roles?.length)return null;if(!r){let c=new Map(o.roles.map(d=>[d.id,d.role])),l=d=>d.map(h=>h.type==="shape"&&c.has(h.id)?{...h,role:c.get(h.id)}:h),u=e.floors?.map(d=>({...d,objects:l(d.objects)})),m=new Float64Array(t.length).fill(Number.NaN),f=new Float64Array(t.length*2).fill(Number.NaN);return t.forEach((d,h)=>{d.eyeHeightM!==void 0&&(m[h]=d.eyeHeightM),d.focalPoint&&(f[h*2]=d.focalPoint.x,f[h*2+1]=d.focalPoint.y)}),{doc:{...e,objects:u?.[0]?.objects??l(e.objects),...u?{floors:u}:{}},report:o,eyeHeightM:m,focal:f}}let i=new Map(dn(n).map(c=>[c.id,c])),a=new Float64Array(t.length).fill(Number.NaN),s=new Float64Array(t.length*2).fill(Number.NaN);return t.forEach((c,l)=>{let u=i.get(c.id)??c;u.eyeHeightM!==void 0&&(a[l]=u.eyeHeightM),u.focalPoint&&(s[l*2]=u.focalPoint.x,s[l*2+1]=u.focalPoint.y)}),{doc:n,report:o,eyeHeightM:a,focal:s}}function Ma(e,t){return e.map((n,o)=>{let r=t.eyeHeightM[o],i=t.focal[o*2],a=t.focal[o*2+1],s={...n};return Number.isNaN(r)?delete s.eyeHeightM:s.eyeHeightM=r,Number.isNaN(i)?delete s.focalPoint:s.focalPoint={x:i,y:a},s})}function Ef(e){let t=e.estimate===!1?null:Mo(e.doc,e.seats);return t?{input:{...e,doc:t.doc,seats:Ma(e.seats,t)},estimate:t}:{input:e}}function va(e,t,n,o,r,i,a,s,c=.5){let l=-1,u=s*s,m=1/0;for(let f=0;f<t;f++){let d=f*3,h=gt(n,[e[d],e[d+1]+c,e[d+2]],o,r);if(!h.visible)continue;let p=h.x-i,b=h.y-a,y=p*p+b*b;(y<u-4||y<u+4&&h.depth<m)&&(l=f,u=Math.min(u,y),m=h.depth)}return l}var zx={};function Rf(e){let t=performance.now(),{input:n,estimate:o}=Ef(e);return{model:En(n),buildMs:performance.now()-t,source:"main",...o?{estimate:o}:{}}}function Hx(e){let t=dn(e.doc);return{...Rf({...e,seats:t}),seats:t}}function Cf(e,t,n){let o=i=>({...t(),fallbackReason:i});if(typeof Worker>"u")return Promise.resolve(o("unavailable"));let r;try{r=new Worker(new URL("./scene/scene.worker.js",zx.url),{type:"module"})}catch{return Promise.resolve(o("unavailable"))}return new Promise(i=>{let a=!1,s=u=>{a||(a=!0,clearTimeout(l),r.terminate(),i(u))},c=u=>s(o(u)),l=window.setTimeout(()=>c("timeout"),15e3);r.onerror=()=>c("worker_error"),r.onmessage=u=>{let m=n(u.data);m?s(m):c("bad_response")},r.postMessage(e)})}function _f(e){return Cf(e,()=>Rf(e),({model:t,buildMs:n,estimate:o})=>({model:t,buildMs:n,source:"worker",...o?{estimate:o}:{}}))}function Tf(e){return Cf(e,()=>Hx(e),({model:t,buildMs:n,seats:o,estimate:r})=>o?{model:t,buildMs:n,seats:o,source:"worker",...r?{estimate:r}:{}}:null)}var jx=40,Ux=48,Wx=Math.PI/180,Xx=6,Yx=500,Kx=6;function $x(e,t,n={}){let o=performance.now(),r=t.prepared?t.prepared.estimate:t.estimate===!1?null:Mo(t.doc,t.seats);r&&(t={...t,doc:r.doc,seats:Ma(t.seats,r)});let i=t.prepared?.model??En(t),a=new Rr(n.onAnalytics),s=new Array(i.seats.count);for(let[z,W]of i.seats.idToIndex)s[W]=z;let c=new Map(t.seats.map(z=>[z.id,z])),l=new Map;for(let z of t.seats){if(!z.rowId)continue;let W=l.get(z.rowId);W?W.push(z.id):l.set(z.rowId,[z.id])}let u=new Map,m=[0,0,0,0];function f(){if(b)for(let z of[b.seatProgram,b.solidProgram,b.chairProgram])z.uniforms.uSeeThrough.value=m}t.seats.forEach((z,W)=>{u.set(z.id,i.seatSectionIds?.[W]??z.sectionId)});let d=new Map;for(let[z,W]of i.seats.idToIndex){let q=u.get(z);if(!q)continue;let le=d.get(q);le?le.push(W):d.set(q,[W])}let h=()=>{if(!b||!i.sectionSolidRanges.length)return;let{lit:z,anyUnlit:W}=ym(i.sectionSolidRanges,d,i.seats.iState);b.setSectionShellLit(W?z:null)},p=t.doc.floors?.some(W=>(W.baseHeightM??0)>0)?!0:(t.doc.floors?.flatMap(W=>W.objects)??t.doc.objects).some(W=>W.type==="section"&&((W.height??0)>0||(W.rake??0)>0)),b=null,y=null,M=null,v=!1,A=!1,x=!1,g=new Map,P=null,S=null,w=null,E=new Map,T=null,F=()=>{w===null&&(w=e.style.zIndex,e.style.zIndex="20")},R=()=>{w!==null&&(e.style.zIndex==="20"&&(e.style.zIndex=w),w=null)},I=!1,_=()=>I?Ue.focusedFloor():-1,k=()=>{b=vm(B.gl,i),y?.dispose(),y=Yu(B.gl,[1,1,1],i.theme.seatStates.selected),Aa(!1),h(),te(),M=new yr(B.renderer,b.seatGeometry,b.chairGeometry,b.solidGeometry,i.seats.count),B.setClearColor(i.theme.background.top),M.setRestoreClear(i.theme.background.top),M.setRoomCentre(i.room?.centre),b.seatProgram.uniforms.uSeatRadius.value=St*i.theme.seatScale,b.seatProgram.uniforms.uFocusFloor.value=_(),b.solidProgram.uniforms.uFocusFloor.value=_(),b.chairProgram.uniforms.uFocusFloor.value=_(),b.screenProgram&&(b.screenProgram.uniforms.uFocusFloor.value=_()),f(),O.forceRegather()},V=!1,O=new _r({model:i,orbit:()=>D,gpu:()=>b}),H=!1,U=new Map,N=24,L=z=>O.setDetailEnabled(z),B=new Io(e,{onContextLost:()=>{x||a.contextLost(),v=!0,Ae.stop(),b=null,M=null},onContextRestored:()=>{k(),v=!1,x||a.contextRestored(),Ae.requestRender()}}),D=new Eo(B.gl,B.canvas,()=>Ae.requestRender(),()=>a.orbitEngaged());D.setAspect(B.aspect);let G=(t.doc.floors?.flatMap(z=>z.objects)??t.doc.objects).some(z=>z.type==="section"&&z.physical3dProvenance?.surfaceKind?.status==="inferred"),j=(()=>{if(Number.isFinite(n.overviewAzimuthDeg))return n.overviewAzimuthDeg*Math.PI/180;if(!(G&&i.stages.length===0))return Va(i.focalWorld,i.seats.iPosition,i.bounds)})(),Z=(t.doc.floors?.flatMap(z=>z.objects)??t.doc.objects).some(z=>z.type==="shape"&&z.stageKind?.startsWith("pitch-")),$=i.floors.length>1?{polarDeg:48,margin:1.1}:{polarDeg:Z?36:48,margin:1.05},ee=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;D.frame(i.bounds,!ee&&n.skipInitialOverviewAnimation!==!0,j,n.portraitOverviewCrop===!0,$);let Q=new gr(D.camera),X=yf(e),Y=Ga(e,i),K=new hr(e,{fontFamily:t.doc.theme?.fontFamily,ink:t.doc.theme?.textColor,backgroundRgb:i.theme.background.top}),re=i.labels,ne=()=>mu(re,i.floors.length,_());K.setLabels(ne()),K.setOverviewDistance(D.targetDistance);let se=()=>{let z=new Map,W=Be.indexOf("available");for(let q of re){if(!q.wheelchairSeats)continue;let le=0;for(let me of q.wheelchairSeats)i.seats.iState[me]===W&&le++;le>0&&z.set(q.id,le)}return K.setWheelchairFree(z)};se();let J=null,ie=()=>[...g.keys()].flatMap(z=>{let W=i.seats.idToIndex.get(z),q=W===void 0?void 0:t.seats[W];if(W===void 0||q?.id!==z)return[];let le=W*3;return[{id:`seat:${z}`,kind:"seat",seatWidthM:i.seats.iChairWidth[W]*2,text:q.displayLabel||q.label,anchor:[i.seats.iPosition[le],i.seats.iPosition[le+1]+1.05,i.seats.iPosition[le+2]],pinBase:Lr(le)}]}),Ee=-1,te=()=>{b&&(Ee=J?i.sections.findIndex(z=>z.id===J):-1,b.seatProgram.uniforms.uFocusSection.value=Ee,b.chairProgram.uniforms.uFocusSection.value=Ee)},ve=z=>{if(J=z,te(),K.setForcedDense(!!z),!z){let oe=ie(),ke=new Set(oe.map(Ce=>Ce.id));K.setLabels([...ne().filter(Ce=>!ke.has(Ce.id)),...oe]);return}let W=t.seats.filter(oe=>u.get(oe.id)===z),q=new Set(W.map(oe=>oe.id)),le=new Set(W.map(oe=>oe.rowId)),me=new Set(g.keys()),ye=new Set(W.filter(oe=>me.has(oe.id)).map(oe=>oe.id)),xe=ne().filter(oe=>oe.kind!=="row"&&oe.kind!=="seat"&&oe.kind!=="access"||oe.kind==="access"&&q.has(oe.id.slice(7))||(oe.kind==="row"?le.has(oe.id.slice(4)):q.has(oe.id.slice(5))));if(i.seatCount<=6e3&&ye.size===0){K.setLabels(xe);return}let Re=W,He=new Set(Re.map(oe=>`seat:${oe.id}`)),Ke=Re.flatMap(oe=>{let ke=i.seats.idToIndex.get(oe.id);if(ke===void 0)return[];let Ce=ke*3;return[{id:`seat:${oe.id}`,kind:"seat",seatWidthM:i.seats.iChairWidth[ke]*2,rowId:oe.rowId,text:me.has(oe.id)?oe.displayLabel||oe.label:Ji(oe.displayLabel||oe.label),anchor:[i.seats.iPosition[Ce],i.seats.iPosition[Ce+1]+(me.has(oe.id)?1.05:.55),i.seats.iPosition[Ce+2]],...me.has(oe.id)?{pinBase:Lr(Ce)}:{}}]});K.setLabels([...xe.filter(oe=>!He.has(oe.id)),...Ke])};k();let Se=null,ot=null,mt=new Lf.Mat4,Ye=z=>{if(v||!b||A)return!1;let W=tf({flying:Q.active,panoramaMounted:P!==null,seatViewActive:Se?.active===!0}),q=W==="orbit"?Ee:-1;b.seatProgram.uniforms.uFocusSection.value=q,b.chairProgram.uniforms.uFocusSection.value=q;let le=H?!1:W==="cinematic"?Q.update(performance.now()):W==="seatView"?Se.update(performance.now()):W==="orbit"?D.update():!1;ot?.syncZoomLimits(),ot?.syncNavigationMode();let me=_()>=0?i.floors[_()]:null,ye=me?.radius??i.bounds.radius,xe=fs(D.currentDistance,ye),Re=V?{center:[D.camera.position.x,D.camera.position.y,D.camera.position.z],radius:520}:i.clipBounds??i.renderBounds;D.updateClipping(Re);let He=me?.center??i.renderBounds.center,Ke=me?.radius??i.renderBounds.radius,oe=(De,zr)=>Math.hypot(D.camera.position.x-De[0],D.camera.position.y-De[1],D.camera.position.z-De[2])<=zr*(O.detailVisible?1.8:1.55),ke=oe(He,Ke);if(!ke&&J){let De=i.sections.find(zr=>zr.id===J);De&&(ke=oe(De.center,Math.max(12,De.radius*2)))}O.detailVisible=ke;let Ce=b.seatProgram.uniforms;Ce.uSeatScale.value=xe.scale,Ce.uSeatFade.value=xe.fade;let it=!!me&&ds(me.seatCount,B.canvas.clientWidth||1,B.canvas.clientHeight||1),Ut=hs(i.seats.count,ye,D.currentDistance,D.camera.fov,B.canvas.clientHeight||1),Dn=O.detailVisible||it||Ut?1:0,Nn=O.detailVisible||_()>=0||i.floors.length>1?1:0;O.ease(z,Dn,Nn),Ce.uSeatDetail.value=O.seatDetailMix;let wo=Dn===0&&O.seatDetailMix<.01;b.seatGeometry.setDrawRange(wo?Wr:0,wo?Ya:Wr),b.solidProgram.uniforms.uStructureDetail.value=O.structureDetailMix,Ce.uMinPixels.value=xe.minPixels,Ce.uPixelToWorld.value=2*Math.tan(D.camera.fov*Wx/2)/Math.max(1,B.pixelHeight),O.update(O.detailVisible),i.outdoor&&(mt.copy(D.camera.projectionViewMatrix).inverse(),b.backgroundProgram.uniforms.uInvViewProj.value.set(mt)),B.renderer.render({scene:b.background,clear:!0}),B.renderer.render({scene:b.main,camera:D.camera,clear:!1});let Bn=y?y.update(performance.now(),[D.camera.position.x,D.camera.position.y,D.camera.position.z],P!==null,W==="seatView"):!1;if(y&&B.renderer.render({scene:y.root,camera:D.camera,clear:!1}),Y){let De=D.camera.worldMatrix;Y.update(W==="seatView"?[D.camera.position.x,D.camera.position.y,D.camera.position.z]:null,[-De[8],-De[9],-De[10]])}K.update(D.camera.projectionViewMatrix,B.canvas.clientWidth||1,B.canvas.clientHeight||1,D.currentDistance,ye,[D.camera.position.x,D.camera.position.y,D.camera.position.z]);let tn=le||Bn||O.seatDetailMix!==Dn||O.structureDetailMix!==Nn;return rt(!tn),tn},rt=as(e),Ae=new Ro(Ye),Ht=typeof ResizeObserver<"u"?new ResizeObserver(()=>Hr.resize()):null;Ht?.observe(e),D.setZoomPointResolver((z,W)=>{let q=B.canvas.getBoundingClientRect(),le=B.canvas.clientWidth||q.width,me=B.canvas.clientHeight||q.height;if(!(le>0)||!(me>0))return null;D.camera.updateMatrixWorld();let ye=va(i.seats.iPosition,i.seats.count,D.camera.projectionViewMatrix,le,me,z-q.left,W-q.top,jx);if(ye<0)return null;let xe=ye*3;return[i.seats.iPosition[xe],i.seats.iPosition[xe+1]+.5,i.seats.iPosition[xe+2]]});function Lr(z){return[i.seats.iPosition[z],i.seats.iPosition[z+1]+.5,i.seats.iPosition[z+2]]}K.setSeatNumberRow(null);let ft=null,zt=0,kr=null,Sa=()=>{zt=0;let z=null,W=null;if(ft&&!Se?.active&&!Q.active){let me=B.canvas.getBoundingClientRect(),ye=B.canvas.clientWidth||me.width,xe=B.canvas.clientHeight||me.height;if(ye>0&&xe>0){let Re=va(i.seats.iPosition,i.seats.count,D.camera.projectionViewMatrix,ye,xe,ft.x-me.left,ft.y-me.top,Ux);z=Re>=0?t.seats[Re]?.rowId??null:null;let He=Re>=0?t.seats[Re]?.id??null:null;if(W=He,ft.mouse&&!ft.pressing&&!!J&&!!He&&u.get(He)===J){let oe=e.getBoundingClientRect();kr=He,n.onSeatHover?.(He,{x:ft.x-oe.left,y:ft.y-oe.top})}else wa()}}else wa();let q=ft?.mouse?W:null,le=K.setSeatNumberSeat(q);(K.setSeatNumberRow(z)||le)&&Ae.requestRender()};function wa(){kr!==null&&(kr=null,n.onSeatHover?.(null,null))}let vo=z=>{ft={x:z.clientX,y:z.clientY,mouse:z.pointerType==="mouse",pressing:z.type==="pointerdown"},zt||(zt=requestAnimationFrame(Sa))},Pa=z=>{z.pointerType==="mouse"&&(ft=null,zt||(zt=requestAnimationFrame(Sa)))};B.canvas.addEventListener("pointermove",vo),B.canvas.addEventListener("pointerdown",vo),B.canvas.addEventListener("pointerleave",Pa);function Aa(z){if(!y)return;let W=[];for(let q of g.keys()){let le=i.seats.idToIndex.get(q);if(le===void 0)continue;let me=le*3,ye=Lr(me),xe=Math.atan2(i.focalWorld[0]-ye[0],i.focalWorld[2]-ye[2]);W.push({id:q,position:ye,facing:xe})}y.setSeats(W,performance.now(),z)}let Ia=z=>{let W=me=>{let ye=i.seats.idToIndex.get(me);return ye===void 0?void 0:i.seats.iState[ye]},{updates:q,next:le}=Am(g,z,W);if(g=le,K.setSelectedSeatIds(g.keys()),Aa(!kn()),Ae.requestRender(),ve(J),q.length){let me=ai(i.seats,q);b&&b.uploadSeatStateRuns(me),h(),Ae.requestRender()}},kn=()=>T!==null?T:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,kf=8,Ea=z=>{if(!n.getSeatView)return null;let W=E.get(z);if(!W)for(W=Promise.resolve(n.getSeatView(z)),E.set(z,W),W.catch(()=>{E.get(z)===W&&E.delete(z)});E.size>kf;){let q=E.keys().next().value;if(q===void 0)break;E.delete(q)}return W},Ra=Xm(i.stages,i.focalWorld,i.bounds.groundY??0),Ca=da(Ra),Or=(z,W)=>{let q=c.get(z),le=Math.max(0,Math.round(i.seats.iFloor[W]??0)),me=t.doc.floors?.[le],ye=i.floors[le],xe=me?.focalPoint??t.doc.focalPoint,Re=ye?{x:ye.focalWorld[0]/C,y:ye.focalWorld[2]/C}:xe,He=q?.focalPoint?{x:q.focalPoint.x+Re.x-xe.x,y:q.focalPoint.y+Re.y-xe.y}:Re,Ke=[i.seats.iPosition[W*3],i.seats.iPosition[W*3+1],i.seats.iPosition[W*3+2]],oe=Fm(i.seats.iPosition,W,Ca),ke=oe!==null&&Math.abs(oe)<Om;return Dm(Ke,He,me?.baseHeightM??0,q?.eyeHeightM,Ca,ke)},Fr=()=>(e.clientWidth||B.canvas.clientWidth)<=520,Dr=null,_a=null,Of=async(z,W,q)=>{if(!n.getSeatView||x||q!==Ue.flightGen())return;let le;try{le=await pf()}catch{if(a.panoramaFailed(z,"mount"),!x&&q===Ue.flightGen()){let me=Br(z,q,!0);requestAnimationFrame(()=>me?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(x||q!==Ue.flightGen()||!Dr))return _a??=le.createOpenPanorama(Dr),_a(z,W,q)},Nr=gf({container:e,model:i,opts:n,expandedSeatById:c,seatIdsByRow:l,isNarrow:Fr,isDisposed:()=>x,flightGen:()=>Ue.flightGen(),flyToSeat:z=>Fa(z),openPanorama:(z,W,q)=>Of(z,W,q)}),Br=Nr.show,Vr=Nr.remove,Ff=Nr.layout,jt=xf({container:e,orbit:D,isNarrow:Fr,enabled:n.chrome?.controlDock!==!1,...n.navLabels?{labels:n.navLabels}:{}});ot=jt;let Df=jt.element,On=jt.setNavigationMode,Nf=jt.layout,Bf=jt.utilityControls,Fn=null,Ta=!1,So=z=>{jt.setSeatViewLocked(z),z||Se?.exit()};Se=ef({canvas:B.canvas,camera:D.camera,requestRender:()=>Ae.requestRender(),reducedMotion:kn,onStopChange:z=>{let W=z??(Ta?"seat":null);Fn=W;try{n.onSeatViewStopChange?.(W)}catch{}},onApplied:()=>{x||D.syncFromCamera()}});let La=i.sections.reduce((z,W)=>W.seatCount>0&&W.box?Math.max(z,W.box.max[1]):z,-1/0),ka=(z,W)=>{let{eye:q}=Or(z,W),le=(e.clientWidth||B.canvas.clientWidth||1)/Math.max(1,e.clientHeight||B.canvas.clientHeight||1),me=Km(q,Ra,le,{preserveEye:!0});if(n.seatViewStops===!1)return{...me,stops:[]};let ye=u.get(z),xe=ye?i.sections.find(Re=>Re.id===ye):void 0;return{...me,stops:$m(me,{aspect:le,seatingTopY:Number.isFinite(La)?La:i.bounds.box.max[1],section:xe&&xe.seatCount>0?{center:xe.center,radius:xe.radius}:null,venue:{center:i.bounds.center,radius:i.bounds.radius}})}},Ue=Af({isNarrow:Fr,setSeeThrough:z=>{m=z?[z[0],z[1],z[2],Kx]:[0,0,0,0],f(),Ae.requestRender()},container:e,model:i,opts:n,orbit:D,cinematic:Q,analytics:a,loop:Ae,labelOverlay:K,stageAzimuth:j,overviewFraming:$,gpu:()=>b,isDisposed:()=>x,panorama:()=>P,setPanorama:z=>{P=z},setPanoramaSphereVisible:z=>{V=z},panoramaLoadAbort:()=>S,setPanoramaLoadAbort:z=>{S=z},setFrozen:z=>{A=z},restorePanoramaLayer:R,reducedMotion:kn,resolvedSeatViewPose:Or,showSectionSeatLabels:ve,setNearFieldDetailEnabled:L,setSeatViewLocked:So,setNavigationMode:On,showArriveChip:Br,removeArriveChip:Vr,inSeatView:()=>Fn!==null,setSeatStepping:z=>{Ta=z},seatViewArrival:(z,W)=>n.arriveAtSeatEye?ka(z,W):null,enterSeatView:(z,W)=>Se?.enter(z,W)});I=!0;let Gr=Ue.overviewChip,Vf=Ue.layoutOverviewChip,Gf=Ue.applyFloorFocus,Hf=Ue.focusOverview,Oa=Ue.cancelFlight,Fa=Ue.flyToSeat,Da=Ue.focusSectionCamera;Bf.appendChild(Gr),Dr={container:e,model:i,opts:n,analytics:a,orbit:D,loop:Ae,seatsById:c,ensureSeatView:Ea,resolvedSeatViewPose:Or,gpu:()=>b,gl:B.gl,isContextLost:()=>v,isDisposed:()=>x,flightGen:()=>Ue.flightGen(),setPanorama:z=>{P=z},getLoadAbort:()=>S,setLoadAbort:z=>{S=z},setPanoramaSphereVisible:z=>{V=z,z&&Se?.exit()},setFrozen:z=>{A=z},raisePanoramaLayer:F,restorePanoramaLayer:R,getOverviewChip:()=>Gr,labelOverlay:K,reducedMotion:kn,removeArriveChip:Vr,showArriveChip:Br};let Et=Sf({glctx:B,orbit:D,model:i,seats:t.seats,opts:n,cinematic:Q,analytics:a,seatIdByIndex:s,sectionIdBySeatId:u,tapSlop:Xx,tapMs:Yx,gpu:()=>b,pick:()=>M,seatViewLocked:()=>jt.seatViewLocked(),focusedSectionId:()=>J,selection:()=>g,cancelFlight:Oa,focusSectionCamera:Da,focusSeatCamera:Ue.focusSeatCamera,setSelection:Ia,ensureSeatView:Ea});B.canvas.addEventListener("pointerdown",Et.onDown),B.canvas.addEventListener("pointermove",Et.onMove),B.canvas.addEventListener("pointerup",Et.onUp),B.canvas.addEventListener("pointercancel",Et.onUp),Ae.requestRender();let Hr={setAvailability(z){let W=Pm(g,z),q=ai(i.seats,W);q.length&&b&&b.uploadSeatStateRuns(q),h(),q.length&&se(),Ae.requestRender()},setSelection:Ia,setNavigationMode:On,zoomIn(){D.zoomBy(rn),Ae.requestRender()},zoomOut(){D.zoomBy(Un),Ae.requestRender()},flyToSeat:Fa,focusOverview:Hf,seatViewStop:()=>Fn,recentreSeatView:()=>Se?.recentre()??!1,resize(){let{width:z,height:W}=B.resize();D.setAspect(z/Math.max(1,W)),Ff(),Nf(),Vf(),Ae.requestRender()},stats(){return{...Ae.stats(),drawCalls:b?b.drawCalls:0,fallbackTriangles:b?b.seatGeometry.drawRange.count/3*i.seats.count:0,seatCount:i.seatCount}},captureImage(z=1280){if(v||!b||typeof document>"u")return null;Ye(0);let W=B.canvas,q=Math.min(1,z/Math.max(W.width,W.height,1)),le=document.createElement("canvas");le.width=Math.max(1,Math.round(W.width*q)),le.height=Math.max(1,Math.round(W.height*q));let me=le.getContext("2d");return me?(me.drawImage(W,0,0,le.width,le.height),le.toDataURL("image/jpeg",.82)):null},captureSeatView(z,W=480){if(v||!b||A||typeof document>"u"||Q.active||P!==null||Se?.active)return null;let q=U.get(z);if(q)return q;let le=i.seats.idToIndex.get(z);if(le===void 0)return null;let{eye:me,focal:ye,fov:xe}=ka(z,le),Re=D.snapshot(),He=[O.seatDetailMix,O.structureDetailMix],Ke=null;try{H=!0,D.camera.position.set(me[0],me[1],me[2]),D.camera.perspective({fov:xe,aspect:D.camera.aspect}),D.camera.lookAt(ye),D.camera.updateMatrixWorld(),D.syncFromCamera(),O.seatDetailMix=1,O.structureDetailMix=1,O.forceRegather(),Ye(0);let oe=B.canvas,ke=Math.min(oe.width,Math.round(oe.height*16/9)),Ce=Math.round(ke*9/16),it=document.createElement("canvas");it.width=Math.max(1,Math.round(W)),it.height=Math.max(1,Math.round(W*9/16));let Ut=it.getContext("2d");Ut&&(Ut.drawImage(oe,(oe.width-ke)/2,(oe.height-Ce)/2,ke,Ce,0,0,it.width,it.height),Ke=it.toDataURL("image/jpeg",.8))}finally{H=!1,Re(),O.seatDetailMix=He[0],O.structureDetailMix=He[1],O.forceRegather(),Ye(0)}if(Ke)for(U.set(z,Ke);U.size>N;)U.delete(U.keys().next().value);return Ke},getQualityEvidence(){let z=Ae.stats(),W=B.canvas.clientWidth||1,q=B.canvas.clientHeight||1,le=i.bounds.center,me=gt(D.camera.projectionViewMatrix,[le[0],i.bounds.box.min[1],le[2]],W,q),ye=gt(D.camera.projectionViewMatrix,[le[0],i.bounds.box.max[1],le[2]],W,q),xe=i.bounds.box,Re=[xe.min[0],xe.max[0]].flatMap(oe=>[xe.min[1],xe.max[1]].flatMap(ke=>[xe.min[2],xe.max[2]].map(Ce=>gt(D.camera.projectionViewMatrix,[oe,ke,Ce],W,q)))).filter(oe=>Number.isFinite(oe.x)&&Number.isFinite(oe.y)&&Number.isFinite(oe.depth)),He=Re.length?(()=>{let oe=Math.min(...Re.map(De=>De.x)),ke=Math.max(...Re.map(De=>De.x)),Ce=Math.min(...Re.map(De=>De.y)),it=Math.max(...Re.map(De=>De.y)),Ut=Math.max(0,oe),Dn=Math.min(W,ke),Nn=Math.max(0,Ce),wo=Math.min(q,it),Bn=Math.max(0,Dn-Ut),tn=Math.max(0,wo-Nn);return{box:{x:Ut,y:Nn,width:Bn,height:tn},horizontalFillRatio:Bn/W,verticalFillRatio:tn/q,visibleAreaRatio:Bn*tn/(W*q),clippedEdges:[...Ce<0?["top"]:[],...ke>W?["right"]:[],...it>q?["bottom"]:[],...oe<0?["left"]:[]]}})():void 0,Ke=String(B.gl.getParameter(B.gl.VERSION)??"");return{viewport:{width:W,height:q},context:{webgl2:/webgl\s*2/i.test(Ke),lost:v},frame:{rendered:z.rendered,idle:z.idle},camera:{position:[D.camera.position.x,D.camera.position.y,D.camera.position.z],distance:D.currentDistance,verticalFovDeg:D.fovY},scene:{seatCount:i.seatCount,floorCount:i.floors.length,zoneCount:i.zones.length,sectionCount:i.sections.length,authoredRelief:p,renderedVerticalSpanM:Math.max(0,i.bounds.box.max[1]-i.bounds.box.min[1]),projectedReliefPx:me.visible&&ye.visible?Math.abs(me.y-ye.y):0},labels:K.qualityEvidence(),framing:He,...Fn?{seatView:{fovDeg:D.camera.fov,stop:Fn}}:{}}},getQualityReport(){return pr(Hr.getQualityEvidence())},loseContextForTest(){B.simulateContextLossCycle()},floors(){return i.floors},focusFloor(z){if(z!==null&&!i.floors.some(q=>q.index===z))return!1;let W=z??-1;if(L(z!==null),So(!1),Gf(W),On("orbit"),z===null)Q.cancel(),kn()?D.frame(i.bounds,!1,j,n.portraitOverviewCrop===!0,$):D.frameSoft(i.bounds,j,n.portraitOverviewCrop===!0,$),K.setOverviewDistance(D.targetDistance);else{let q=i.floors[z];if(q.seatCount>0){Q.cancel();let le=q.focalWorld[0]-q.center[0],me=q.focalWorld[2]-q.center[2],ye=Math.hypot(le,me)>q.radius*.12?Math.atan2(le,me):j;D.frame({center:q.center,radius:q.radius,box:q.box},!1,ye,!1,{polarDeg:58,margin:1.12}),K.setOverviewDistance(D.targetDistance)}}return Ae.requestRender(),!0},zones(){return i.zones},focusZone(z){let W=i.zones.find(ye=>ye.id===z);if(!W||W.seatCount===0)return!1;L(!1),So(!1),Q.cancel(),On("orbit"),ve(null),n.onSectionFocusChange?.(null);let q=W.focalWorld[0]-W.center[0],le=W.focalWorld[2]-W.center[2],me=Math.hypot(q,le)>W.radius*.12?Math.atan2(q,le):void 0;return D.frame({center:W.center,radius:W.radius*1.25},!1,me),Ae.requestRender(),!0},sections(){return i.sections},focusSection(z){return Da(z)},rows(z){return z?i.rows.filter(W=>W.sectionId===z):i.rows},seatsInRow(z){return t.seats.filter(W=>W.rowId===z).map(W=>({id:W.id,label:W.displayLabel||W.label}))},focusRow(z){let W=i.rows.find(q=>q.id===z);return!W||W.seatCount===0?!1:(L(!0),So(!1),Q.cancel(),On("pan"),W.sectionId&&(ve(W.sectionId),n.onSectionFocusChange?.(W.sectionId)),D.frame({center:W.center,radius:Math.max(2.5,W.radius*.65)}),Ae.requestRender(),!0)},setReducedMotionForTest(z){T=z},dispose(){x=!0,Y?.dispose(),rt(!1),Vr(),Gr.remove(),Df.remove(),Oa(),Se?.dispose(),Ae.stop(),K.dispose(),Ht?.disconnect(),P&&(P.dispose(),P=null),R(),X(),B.canvas.removeEventListener("pointerdown",Et.onDown),B.canvas.removeEventListener("pointermove",Et.onMove),B.canvas.removeEventListener("pointerup",Et.onUp),B.canvas.removeEventListener("pointercancel",Et.onUp),B.canvas.removeEventListener("pointermove",vo),B.canvas.removeEventListener("pointerdown",vo),B.canvas.removeEventListener("pointerleave",Pa),zt&&cancelAnimationFrame(zt),D.dispose(),M&&M.dispose(),b&&b.dispose(),b=null,y?.dispose(),y=null,M=null,B.dispose()}};return a.opened(i.seatCount,p,t.prepared?.buildMs??performance.now()-o,t.prepared?.source??"inline"),Hr}0&&(module.exports={VENUE3D_QUALITY_REPORT_VERSION,autoVenue3d,buildSceneModel,estimateVenue3D,inspectVenue3DQualityEvidence,mountVenue3D,prepareVenue3D,prepareVenue3DFromChart});
|